Sfoglia il codice sorgente

借阅 发起单位的流程

tags/24080901
PoffyZhang 1 anno fa
parent
commit
525d079743
5 ha cambiato i file con 87 aggiunte e 1 eliminazioni
  1. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionsCacheHelperImpl.java
  2. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java
  3. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java
  4. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java
  5. +73
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionsCacheHelperImpl.java Vedi File

@@ -108,6 +108,9 @@ public class RegionsCacheHelperImpl extends AbstractRegionCacheHelper implements
* @return 展示名称
*/
private String getDisplayName(RegionDTO region, int sLevel) {
if (Objects.isNull(region)) {
return StringUtils.EMPTY;
}
Integer level = region.getRegionLevel();
if (RegionConst.RL_PROVINCE > sLevel || sLevel > level) {
throw BizException.wrap("区域层级无效");


+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java Vedi File

@@ -91,4 +91,9 @@ public class DingInfoPullController {
public String getToken() {
return employeeBatchGetTask.getToken();
}

@GetMapping("/getAuthToken")
public String getAuthToken() {
return employeeBatchGetTask.getAuthToken();
}
}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java Vedi File

@@ -477,4 +477,9 @@ public class EmployeeBatchGetTask {
GenericResult<String> accessToken = zwddClient.getAccessToken();
return accessToken.getData();
}

public String getAuthToken() {
GenericResult<String> accessToken = zwddAuthClient.getAccessToken();
return accessToken.getData();
}
}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java Vedi File

@@ -274,7 +274,7 @@ public class ProjectFileManage {
// 把条件值给放入工作流
defaultDeclaredProjectManage.buildCondition(params, project);
// 获取发起单位、发起单位主管单位、发起单位上级条线主管单位信息
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMap(employeeCode, project);
Map<String, OrgInfoDTO> orgModelMap = defaultDeclaredProjectManage.buildOrgModelMapUserOrgCode(employeeCode, project);
String instanceId =
processInstanceService.newStartProcess(model.getProcessDefId(), model.getFormId(), params, orgModelMap);
log.info("申请借阅申报成功 【{}】", instanceId);


+ 73
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java Vedi File

@@ -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){
//查此人建设单位的项目


Loading…
Annulla
Salva