diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java index 067983b..97222af 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java @@ -133,6 +133,12 @@ public class OrganizationManage { public List treeRubbishVOList(ReqSynthesizePO request) { String organizationCode = request.getOrganizationCode(); String organizationName = request.getOrganizationName(); + String employeeName = request.getEmployeeName(); + + // 用户搜索为特殊逻辑 + if (StringUtils.isNotBlank(employeeName)) { + return treeEmployeeQuery(employeeName, organizationCode); + } List dingOrganizationList = new ArrayList<>(); List organizationCodeList = new ArrayList<>(); @@ -164,6 +170,61 @@ public class OrganizationManage { return orgKeyTreeVOList; } + public List treeEmployeeQuery(String employeeName, String organizationCode) { + List organizationCodeList = CollUtil.toList(organizationCode).stream() + .filter(StringUtils::isNotBlank) + .collect(Collectors.toList()); + List dingEmployeeInfoList = iDingEmployeeInfoService + .list(Wrappers.lambdaQuery(DingEmployeeInfo.class) + .like(DingEmployeeInfo::getEmployeeName, employeeName) + .eq(DingEmployeeInfo::getMainJob, "true") + .in(CollUtil.isNotEmpty(organizationCodeList), DingEmployeeInfo::getOrganizationCode, organizationCodeList) + ); + List resultOrganizationCodeList = dingEmployeeInfoList.stream() + .filter(r -> StringUtils.isNotBlank(r.getOrganizationCode())) + .map(DingEmployeeInfo::getOrganizationCode) + .distinct().collect(Collectors.toList()); + + if (CollectionUtil.isEmpty(resultOrganizationCodeList)) { + return new ArrayList<>(); + } + + List dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) + .in(DingOrganization::getOrganizationCode, resultOrganizationCodeList)); + + List orgKeyTreeVOList = dingOrganizationList.stream().map(r -> { + KeyTreeVO keyTreeVO = new KeyTreeVO(); + keyTreeVO.setTitle(r.getOrganizationName()); + keyTreeVO.setKey(r.getOrganizationCode()); + keyTreeVO.setType("ORGANIZATION"); + return keyTreeVO; + }).collect(Collectors.toList()); + + employeeNameSearcheTreeVOList(orgKeyTreeVOList, dingEmployeeInfoList); + return orgKeyTreeVOList; + } + + private void employeeNameSearcheTreeVOList(List basicOrgKeyTreeVOList, List allDingEmployeeInfoList) { + Map> orgCodeEmployeeMap = allDingEmployeeInfoList.stream() + .filter(r -> StringUtils.isNotBlank(r.getOrganizationCode())) + .collect(Collectors.groupingBy(DingEmployeeInfo::getOrganizationCode)); + + for (KeyTreeVO basicOrgKeyTreeVO : basicOrgKeyTreeVOList) { + String parentCode = basicOrgKeyTreeVO.getKey(); + + List dingEmployeeInfoList = orgCodeEmployeeMap.get(parentCode); + List memberChildren = dingEmployeeInfoList.stream().map(r -> { + KeyTreeVO child = new KeyTreeVO(); + child.setKey(r.getEmployeeCode()); + child.setTitle(r.getEmployeeName()); + child.setType("MEMBER"); + return child; + }).collect(Collectors.toList()); + basicOrgKeyTreeVO.setChildren(memberChildren); + } + } + + public void treeVOList(Boolean needMember, List basicOrgKeyTreeVOList) { for (KeyTreeVO basicOrgKeyTreeVO : basicOrgKeyTreeVOList) { String parentCode = basicOrgKeyTreeVO.getKey(); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java index b1cf79d..3f368c4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.basic.function.VUtils; +import com.ningdatech.pmapi.common.constant.RegionConst; import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.ningdatech.pmapi.organization.service.IDingOrganizationService; @@ -164,6 +165,21 @@ public class DefaultDeclaredProjectManage { orgInfoDTO.setOrgModelMap(orgModelsList.stream() .collect(Collectors.toMap(WflowOrgModels::getProcessDefId, v -> v))); orgMap.put(OrgTypeEnum.TARGET_LABEL.name(),orgInfoDTO); + + //如果有上级条线主管单位 并且 不是市本级 + if(!RegionConst.RC_LS.equals(userFullInfo.getRegionCode())){ + 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; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/ProjectStatusFlowTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/ProjectStatusFlowTask.java index d182e28..0f3025b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/ProjectStatusFlowTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/ProjectStatusFlowTask.java @@ -90,4 +90,12 @@ public class ProjectStatusFlowTask { } } } + +// @Scheduled(cron = "0 */1 * * * ?") + public void nonUserFinishFlowToNext() throws UnknownHostException { + //测试暂时用自己HOST + if (TaskContant.Host.HOST_ZPF.equals(InetAddress.getLocalHost().getHostName())) { + + } + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java index 8decebe..e4966b2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/WithDrawHandle.java @@ -52,7 +52,7 @@ public class WithDrawHandle { .processInstanceId(instanceId).singleResult(); UserInfoDetails userInfoDetails = LoginUserUtil.loginUserDetail(); String employeeCode = userInfoDetails.getEmployeeCode(); - //如果不是当前登录人 + //如果不是审核中 if(!ProcessStatusEnum.UNDER_REVIEW.getDesc() .equals(progressInstanceDetail.getStatus())){ return Boolean.FALSE; @@ -187,6 +187,8 @@ public class WithDrawHandle { if(beforeAndOr.isEmpty()){ //放入假设的那个点 beforeAndOr.add(beforeAndOrNode); + //如果 上个节点也是 会签|或签 那么就置为null + beforeNode = null; } beforeAndOr.add(progressNodes.get(i)); }