Merge remote-tracking branch 'origin/main' into main
# Conflicts: # web-infrastructure/src/main/java/com/zcloud/basic/info/persistence/repository/CorpInfoRepository.java # web-infrastructure/src/main/java/com/zcloud/basic/info/persistence/repository/impl/CorpInfoRepositoryImpl.javamain
commit
c00c0c9155
|
|
@ -13,6 +13,7 @@ import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.DepartmentSuperviseDO;
|
import com.zcloud.basic.info.persistence.dataobject.DepartmentSuperviseDO;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.PostDO;
|
import com.zcloud.basic.info.persistence.dataobject.PostDO;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.PostDepartmentDO;
|
import com.zcloud.basic.info.persistence.dataobject.PostDepartmentDO;
|
||||||
|
import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
|
||||||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||||
import com.zcloud.basic.info.persistence.repository.DepartmentSuperviseRepository;
|
import com.zcloud.basic.info.persistence.repository.DepartmentSuperviseRepository;
|
||||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||||
|
|
@ -40,6 +41,7 @@ public class DepartmentQueryExe {
|
||||||
private final DepartmentCoConvertor departmentCoConvertor;
|
private final DepartmentCoConvertor departmentCoConvertor;
|
||||||
private final DepartmentSuperviseRepository departmentSuperviseRepository;
|
private final DepartmentSuperviseRepository departmentSuperviseRepository;
|
||||||
private final UserRepository userRepository;
|
private final UserRepository userRepository;
|
||||||
|
private final CorpInfoRepository corpInfoRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页
|
* 分页
|
||||||
|
|
@ -80,6 +82,14 @@ public class DepartmentQueryExe {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
List<DepartmentTreeInfoCO> examCenterCOS = departmentCoConvertor.converDOsToInfoCOs(pageResponse);
|
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 -> {
|
||||||
|
examCenterCO.setCorpinfoName(corpinfoMap.getOrDefault(examCenterCO.getCorpinfoId(), StringUtils.EMPTY));
|
||||||
|
});
|
||||||
|
}
|
||||||
//GBS部门根节点父部门是tenantId
|
//GBS部门根节点父部门是tenantId
|
||||||
if(departmentQry.getEqParentId()!=null){
|
if(departmentQry.getEqParentId()!=null){
|
||||||
return Tools.buildEntityTree(examCenterCOS, "id", "parentId", "childrenList",departmentQry.getEqParentId());
|
return Tools.buildEntityTree(examCenterCOS, "id", "parentId", "childrenList",departmentQry.getEqParentId());
|
||||||
|
|
@ -141,13 +151,21 @@ public class DepartmentQueryExe {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
List<DepartmentTreeInfoCO> examCenterCOS = departmentCoConvertor.converDOsToInfoCOs(pageResponse);
|
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 -> {
|
||||||
|
examCenterCO.setCorpinfoName(corpinfoMap.getOrDefault(examCenterCO.getCorpinfoId(), StringUtils.EMPTY));
|
||||||
|
});
|
||||||
|
}
|
||||||
//GBS部门根节点父部门是tenantId
|
//GBS部门根节点父部门是tenantId
|
||||||
//按照企业分组
|
//按照企业分组
|
||||||
List<List<DepartmentTreeInfoCO>> result1= new ArrayList<>();
|
List<List<DepartmentTreeInfoCO>> result1= new ArrayList<>();
|
||||||
Map<Long, List<DepartmentTreeInfoCO>> corpMap = examCenterCOS.stream().collect(Collectors.groupingBy(DepartmentTreeInfoCO::getCorpinfoId));
|
Map<Long, List<DepartmentTreeInfoCO>> corpMap = examCenterCOS.stream().collect(Collectors.groupingBy(DepartmentTreeInfoCO::getCorpinfoId));
|
||||||
corpMap.forEach((corpId, list) -> {
|
corpMap.forEach((corpId, list) -> {
|
||||||
List<DepartmentTreeInfoCO> departmentTreeInfoCOS = Tools.buildEntityTree(list, "id", "parentId", "childrenList", 0L);
|
List<DepartmentTreeInfoCO> departmentTreeInfoCOS = Tools.buildEntityTree(list, "id", "parentId", "childrenList", 0L);
|
||||||
result1.add(departmentTreeInfoCOS);
|
if(CollUtil.isNotEmpty(departmentTreeInfoCOS)){
|
||||||
|
result1.add(departmentTreeInfoCOS);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,9 @@ public class DepartmentTreeInfoCO extends ClientObject {
|
||||||
@ApiModelProperty(value = "父部门id")
|
@ApiModelProperty(value = "父部门id")
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属企业名称")
|
||||||
|
private String corpinfoName;
|
||||||
|
|
||||||
private List<DepartmentTreeInfoCO> childrenList;
|
private List<DepartmentTreeInfoCO> childrenList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ public interface CorpInfoRepository extends BaseRepository<CorpInfoDO> {
|
||||||
|
|
||||||
void updateCorpName(CorpInfoDO corpInfo);
|
void updateCorpName(CorpInfoDO corpInfo);
|
||||||
|
|
||||||
|
Map<Long, String> getCorpinfoNameByCorpinfoId(List<Long> collect);
|
||||||
|
|
||||||
List<CorpInfoDO> getCorpinfoByCode(String code);
|
List<CorpInfoDO> getCorpinfoByCode(String code);
|
||||||
|
|
||||||
List<CorpInfoDO> getCorpinfoByCodeAndId(String code, Long id);
|
List<CorpInfoDO> getCorpinfoByCodeAndId(String code, Long id);
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,9 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-infrastructure
|
* web-infrastructure
|
||||||
|
|
@ -114,6 +114,18 @@ public class CorpInfoRepositoryImpl extends BaseRepositoryImpl<CorpInfoMapper, C
|
||||||
unitFacade.update(ouac);
|
unitFacade.update(ouac);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Long, String> getCorpinfoNameByCorpinfoId(List<Long> collect) {
|
||||||
|
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.in("id", collect);
|
||||||
|
List<CorpInfoDO> corpInfoDOList = corpInfoMapper.selectList(queryWrapper);
|
||||||
|
Map<Long, String> map = corpInfoDOList.stream().collect(
|
||||||
|
Collectors.toMap(CorpInfoDO::getId, CorpInfoDO::getCorpName)
|
||||||
|
);
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CorpInfoDO> getCorpinfoByCode(String code) {
|
public List<CorpInfoDO> getCorpinfoByCode(String code) {
|
||||||
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CorpInfoDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue