部门全称
parent
984a607c45
commit
ae8bfd5635
|
|
@ -93,9 +93,10 @@ public class ZcloudDepartmentFacadeImpl implements ZcloudDepartmentFacade {
|
|||
|
||||
@Override
|
||||
public Map<Long, String> listFullName(List<Long> list) {
|
||||
List<DepartmentCO> deptlist = departmentService.getDeptList();
|
||||
Map<Long, String> map = new HashMap<>();
|
||||
for (Long id : list){
|
||||
map.put(id, getFullName(id));
|
||||
map.put(id, departmentService.getFullNameForList(id, deptlist));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,10 @@ import com.zcloud.basic.info.persistence.repository.DepartmentSuperviseRepositor
|
|||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.zclouddepartment.face.ZcloudDepartmentFacade;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
|
@ -38,6 +40,8 @@ public class DepartmentQueryExe {
|
|||
private final DepartmentSuperviseRepository departmentSuperviseRepository;
|
||||
private final UserRepository userRepository;
|
||||
private final CorpInfoRepository corpInfoRepository;
|
||||
@DubboReference
|
||||
private ZcloudDepartmentFacade zcloudDepartmentFacade;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
|
|
@ -85,8 +89,12 @@ public class DepartmentQueryExe {
|
|||
//补充企业名称
|
||||
Map<Long, String> corpinfoMap = corpInfoRepository.getCorpinfoNameByCorpinfoId(examCenterCOS.stream().map(DepartmentTreeInfoCO::getCorpinfoId).collect(Collectors.toList()));
|
||||
if (CollUtil.isNotEmpty(corpinfoMap)) {
|
||||
examCenterCOS.forEach(examCenterCO -> {
|
||||
List<Long> departmentIds = examCenterCOS.stream().peek(examCenterCO -> {
|
||||
examCenterCO.setCorpinfoName(corpinfoMap.getOrDefault(examCenterCO.getCorpinfoId(), StringUtils.EMPTY));
|
||||
}).map(DepartmentTreeInfoCO :: getId).collect(Collectors.toList());
|
||||
Map<Long, String> deptMap = zcloudDepartmentFacade.listFullName(departmentIds);
|
||||
examCenterCOS.forEach(examCenterCO -> {
|
||||
examCenterCO.setFullName(deptMap.getOrDefault(examCenterCO.getId(), StringUtils.EMPTY));
|
||||
});
|
||||
}
|
||||
//GBS部门根节点父部门是tenantId
|
||||
|
|
@ -152,8 +160,12 @@ public class DepartmentQueryExe {
|
|||
List<DepartmentTreeInfoCO> examCenterCOS = departmentCoConvertor.converDOsToInfoCOs(pageResponse);
|
||||
Map<Long, String> corpinfoMap = corpInfoRepository.getCorpinfoNameByCorpinfoId(examCenterCOS.stream().map(DepartmentTreeInfoCO::getCorpinfoId).collect(Collectors.toList()));
|
||||
if (CollUtil.isNotEmpty(corpinfoMap)) {
|
||||
examCenterCOS.forEach(examCenterCO -> {
|
||||
List<Long> departmentIds = examCenterCOS.stream().peek(examCenterCO -> {
|
||||
examCenterCO.setCorpinfoName(corpinfoMap.getOrDefault(examCenterCO.getCorpinfoId(), StringUtils.EMPTY));
|
||||
}).map(DepartmentTreeInfoCO :: getId).collect(Collectors.toList());
|
||||
Map<Long, String> deptMap = zcloudDepartmentFacade.listFullName(departmentIds);
|
||||
examCenterCOS.forEach(examCenterCO -> {
|
||||
examCenterCO.setFullName(deptMap.getOrDefault(examCenterCO.getId(), StringUtils.EMPTY));
|
||||
});
|
||||
}
|
||||
//GBS部门根节点父部门是tenantId
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import com.zcloud.gbscommon.utils.Tools;
|
|||
import com.zcloud.gbscommon.utils.ZcloudRedisUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -56,7 +57,8 @@ public class UserQueryExe {
|
|||
private final CorpInfoCoConvertor corpInfoCoConvertor;
|
||||
private ZcloudRedisUtil zcloudRedisUtil;
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param userPageQry
|
||||
|
|
|
|||
|
|
@ -12,8 +12,10 @@ import com.zcloud.basic.info.dto.clientobject.CorpDepartmentCO;
|
|||
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentInfoCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentTreeInfoCO;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
@ -86,5 +88,11 @@ public class DepartmentServiceImpl implements DepartmentServiceI {
|
|||
public List<DepartmentTreeInfoCO> listAllTree() {
|
||||
return departmentQueryExe.listAllTree();
|
||||
}
|
||||
@Override
|
||||
@Cacheable(value = "deptAllNameCache", key="'deptId:'+#deptId")
|
||||
public String getFullNameForList(Long deptId, List<DepartmentCO> list) {
|
||||
String name = Tools.getTreeFullName(list,"id", "parentId", "name", deptId);
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import com.zcloud.basic.info.dto.clientobject.CorpDepartmentCO;
|
|||
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentInfoCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentTreeInfoCO;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
|
@ -37,5 +39,9 @@ public interface DepartmentServiceI {
|
|||
List<DepartmentCO> getDeptList();
|
||||
|
||||
List<DepartmentTreeInfoCO> listAllTree();
|
||||
|
||||
String getFullNameForList(Long deptId, List<DepartmentCO> list);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public class UserPageQry extends PageQuery {
|
|||
@ApiModelProperty(value = "身份证号")
|
||||
private String likeUserIdCard;
|
||||
|
||||
|
||||
private String menuPath;
|
||||
|
||||
private Integer noMain;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ public class UserQryCmd {
|
|||
private String eqCorpinfoId;
|
||||
private String eqDepartmentId;
|
||||
private String eqPostId;
|
||||
private Integer eqEmploymentFlag;
|
||||
|
||||
private Long corpinfoId;
|
||||
private Long departmentId;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,12 @@ public class DepartmentTreeInfoCO extends ClientObject {
|
|||
//名称
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
//名称
|
||||
@ApiModelProperty(value = "部门全称")
|
||||
private String fullName;
|
||||
//名称
|
||||
@ApiModelProperty(value = "id全拼接")
|
||||
private String fullId;
|
||||
//父部门id
|
||||
@ApiModelProperty(value = "父部门id")
|
||||
private Long parentId;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.zcloud.basic.info.persistence.dataobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
|
|
@ -49,6 +50,14 @@ public class DepartmentDO extends BaseDO {
|
|||
private Integer securityFlag;
|
||||
@ApiModelProperty(value = "部门职能")
|
||||
private String departmentFunction;
|
||||
//名称
|
||||
@ApiModelProperty(value = "部门全称")
|
||||
@TableField(exist = false)
|
||||
private String fullName;
|
||||
//名称
|
||||
@ApiModelProperty(value = "id全拼接")
|
||||
@TableField(exist = false)
|
||||
private String fullId;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import com.jjb.saas.framework.repository.common.PageHelper;
|
|||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import com.jjb.saas.message.client.message.facede.MessageFacade;
|
||||
import com.jjb.saas.message.client.todotask.facade.BusTodoTaskFacade;
|
||||
import com.jjb.saas.message.client.todotask.request.HandelTaskAddCmd;
|
||||
import com.jjb.saas.system.client.role.facade.RoleFacade;
|
||||
import com.jjb.saas.system.client.role.response.RoleCO;
|
||||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||
|
|
@ -31,10 +30,8 @@ import com.zcloud.basic.info.persistence.dataobject.DepartmentLeaderStatictiscDO
|
|||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
import com.zcloud.basic.info.persistence.mapper.UserMapper;
|
||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import com.zcloud.gbscommon.utils.Query;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.gbscommon.utils.*;
|
||||
import com.zcloud.gbscommon.zclouddepartment.face.ZcloudDepartmentFacade;
|
||||
import com.zcloud.gbscommon.zcloudimgfiles.facade.ZcloudImgFilesFacade;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -45,10 +42,8 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -132,8 +127,17 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
|
|||
@DubboReference
|
||||
private BusTodoTaskFacade busTodoTaskFacade;
|
||||
|
||||
// @DubboReference
|
||||
// private ZcloudDepartmentFacade zcloudDepartmentFacade;
|
||||
|
||||
@Override
|
||||
public List<UserDO> listAll(Map<String, Object> params) {
|
||||
// SSOUser ssoUsexr = AuthContext.getCurrentUser();
|
||||
// String sd = zcloudDepartmentFacade.getFullName(1999009782763397120L);
|
||||
// List<Long> ids = new ArrayList<>();
|
||||
// ids.add(1999009782763397120L);
|
||||
// Map<Long, String> sd1 = zcloudDepartmentFacade.listFullName(ids);
|
||||
|
||||
if (!ObjectUtils.isEmpty(params.get("corpinfoId"))) {
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
params.put("corpinfoId", ssoUser.getTenantId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue