|
|
@@ -3,6 +3,7 @@ package com.jzg.organization.service.impl;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
@@ -22,12 +23,15 @@ import com.jzg.commons.util.StringUtils;
|
|
|
import com.jzg.organization.mapper.SysOrganizationMapper;
|
|
|
import com.jzg.organization.service.SysOrganizationService;
|
|
|
import com.jzg.organization.service.SysOrganizationUserLinkService;
|
|
|
+import com.jzg.organization.service.SysUserJzgInfoSalesmanService;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -43,6 +47,8 @@ public class SysOrganizationServiceImpl extends ServiceImpl<SysOrganizationMappe
|
|
|
|
|
|
@Autowired
|
|
|
private SysOrganizationUserLinkService sysOrganizationUserLinkService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserJzgInfoSalesmanService sysUserJzgInfoSalesmanService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -178,6 +184,23 @@ public class SysOrganizationServiceImpl extends ServiceImpl<SysOrganizationMappe
|
|
|
public Page<SysOrganizationUserLinkVo> getTeamUserPage(Page page,SysOrganizationUserLinkQueryVo sysOrganizationUserLinkQueryVo) {
|
|
|
log.info("获取团队下的人员列表分页. sysOrganizationUserLinkQueryVo=[{}], page=[{}]", JSONUtil.toJsonStr(sysOrganizationUserLinkQueryVo), JSONUtil.toJsonStr(page));
|
|
|
Page<SysOrganizationUserLinkVo> teamUserPage = baseMapper.getTeamUserPage(page, sysOrganizationUserLinkQueryVo);
|
|
|
+ List<SysOrganizationUserLinkVo> records = teamUserPage.getRecords();
|
|
|
+ if(CollUtil.isNotEmpty(records)){
|
|
|
+ // 填充岗位信息
|
|
|
+ Map<String, String> attrTypeMap = sysUserJzgInfoSalesmanService.queryAllTypeAttrMap();
|
|
|
+ records = records.stream().peek(action->{
|
|
|
+ String typeAttr = attrTypeMap.getOrDefault(action.getId(),null);
|
|
|
+ if(StrUtil.isNotEmpty(typeAttr)){
|
|
|
+ // add by lipf 和 田智沟通后,确定可能存在同时是后线和前线的情况,这里把后线移除显示来解决显示的问题
|
|
|
+ List<String> list = new ArrayList<>(Arrays.asList(typeAttr.split(",")));
|
|
|
+ list.remove("2");
|
|
|
+ list.remove("1");
|
|
|
+ typeAttr = String.join(",", list);
|
|
|
+ }
|
|
|
+ action.setTypeAttr(typeAttr);
|
|
|
+ }).toList();
|
|
|
+ teamUserPage.setRecords(records);
|
|
|
+ }
|
|
|
log.debug("获取团队下的人员列表分页.查询出[{}]个业务员。 sysOrganizationUserLinkQueryVo=[{}], page=[{}]", CollUtil.size(teamUserPage.getRecords()), JSONUtil.toJsonStr(sysOrganizationUserLinkQueryVo), JSONUtil.toJsonStr(page));
|
|
|
return teamUserPage;
|
|
|
}
|