|
|
@@ -219,6 +219,79 @@ public class DefaultDeclaredProjectManage { |
|
|
|
return orgMap; |
|
|
|
} |
|
|
|
|
|
|
|
public Map<String, OrgInfoDTO> buildOrgModelMapUserOrgCode(String employeeCode,Project project) { |
|
|
|
Map<String, OrgInfoDTO> orgMap = new HashMap<>(); |
|
|
|
|
|
|
|
// 查出所有的单位流程配置 |
|
|
|
List<WflowOrgModels> orgModelsList = orgProcdefService.list(); |
|
|
|
|
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfoByEmployeeCode(employeeCode); |
|
|
|
if(Objects.isNull(userFullInfo)){ |
|
|
|
log.warn("取不到员工 返回空map"); |
|
|
|
return Collections.emptyMap(); |
|
|
|
} |
|
|
|
|
|
|
|
String startOrgCode = project.getBuildOrgCode(); |
|
|
|
String startOrgName = project.getBuildOrgName(); |
|
|
|
String startOrgParentCode; |
|
|
|
String startOrgParentName; |
|
|
|
// 如果申报时 上级主管单位,由该单位自己审核 |
|
|
|
if (CommonEnum.NO.getCode().equals(project.getIsSuperOrg())){ |
|
|
|
startOrgParentCode = startOrgCode; |
|
|
|
startOrgParentName = startOrgName; |
|
|
|
}else { |
|
|
|
startOrgParentCode = project.getSuperOrgCode(); |
|
|
|
startOrgParentName = project.getSuperOrg(); |
|
|
|
} |
|
|
|
//查询 当前发起人及主管单位所在区域的 单位流程配置 |
|
|
|
OrgInfoDTO startOrgInfoDto = new OrgInfoDTO(); |
|
|
|
startOrgInfoDto.setOrganizationCode(startOrgCode); |
|
|
|
startOrgInfoDto.setOrganizationName(startOrgName); |
|
|
|
|
|
|
|
startOrgInfoDto.setOrgModelMap(orgModelsList.stream() |
|
|
|
.filter(v -> v.getOrgCode().equals(startOrgCode) |
|
|
|
&& Boolean.FALSE.equals(v.getIsDelete()) |
|
|
|
&& (ProcessDefTypeEnum.SEAL.name().equals(v.getType()) || |
|
|
|
ProcessDefTypeEnum.DEFAULT.name().equals(v.getType()))) |
|
|
|
.collect(Collectors.toMap(WflowOrgModels::getType, v -> v))); |
|
|
|
|
|
|
|
OrgInfoDTO parentOrgInfoDto = new OrgInfoDTO(); |
|
|
|
parentOrgInfoDto.setOrganizationCode(startOrgParentCode); |
|
|
|
parentOrgInfoDto.setOrganizationName(startOrgParentName); |
|
|
|
parentOrgInfoDto.setOrgModelMap(orgModelsList.stream() |
|
|
|
.filter(v -> v.getOrgCode().equals(startOrgParentCode) |
|
|
|
&& Boolean.FALSE.equals(v.getIsDelete()) |
|
|
|
&& (ProcessDefTypeEnum.SEAL.name().equals(v.getType()) || |
|
|
|
ProcessDefTypeEnum.DEFAULT.name().equals(v.getType()))) |
|
|
|
.collect(Collectors.toMap(WflowOrgModels::getType, v -> v))); |
|
|
|
|
|
|
|
orgMap.put(OrgTypeEnum.TARGET_OWNER.name(),startOrgInfoDto); |
|
|
|
orgMap.put(OrgTypeEnum.TARGET_MANAGEMENT.name(),parentOrgInfoDto); |
|
|
|
|
|
|
|
// 如果是指定单位,直接根据流程定义ID放入map |
|
|
|
OrgInfoDTO orgInfoDTO = new OrgInfoDTO(); |
|
|
|
orgInfoDTO.setOrgModelMap(orgModelsList.stream() |
|
|
|
.collect(Collectors.toMap(WflowOrgModels::getProcessDefId, v -> v))); |
|
|
|
orgMap.put(OrgTypeEnum.TARGET_LABEL.name(),orgInfoDTO); |
|
|
|
|
|
|
|
//如果有上级条线主管单位 并且 不是市本级 |
|
|
|
if(!RegionConst.RC_LS.equals(project.getAreaCode()) && |
|
|
|
CommonEnum.YES.getCode().equals(project.getIsHigherSuperOrg())){ |
|
|
|
OrgInfoDTO parentLineOrgInfoDto = new OrgInfoDTO(); |
|
|
|
parentLineOrgInfoDto.setOrganizationCode(project.getHigherSuperOrgCode()); |
|
|
|
parentLineOrgInfoDto.setOrganizationName(project.getHigherSuperOrg()); |
|
|
|
parentLineOrgInfoDto.setOrgModelMap(orgModelsList.stream() |
|
|
|
.filter(v -> v.getOrgCode().equals(project.getHigherSuperOrgCode()) |
|
|
|
&& Boolean.FALSE.equals(v.getIsDelete()) |
|
|
|
&& (ProcessDefTypeEnum.SEAL.name().equals(v.getType()) || |
|
|
|
ProcessDefTypeEnum.DEFAULT.name().equals(v.getType()))) |
|
|
|
.collect(Collectors.toMap(WflowOrgModels::getType, v -> v))); |
|
|
|
|
|
|
|
orgMap.put(OrgTypeEnum.TARGET_LINE_MANAGEMENT.name(),parentLineOrgInfoDto); |
|
|
|
} |
|
|
|
return orgMap; |
|
|
|
} |
|
|
|
|
|
|
|
//根据提交者的单位 |
|
|
|
public DeclaredProjectStatisticsPO declaredProjectOrgStatistics(Integer year, UserFullInfoDTO user){ |
|
|
|
//查此人建设单位的项目 |
|
|
|