Browse Source

单位树 改造

tags/24080901
PoffyZhang 1 year ago
parent
commit
5c028c2db9
3 changed files with 88 additions and 7 deletions
  1. +37
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java
  2. +46
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  3. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ProcessProgressDetailVo.java

+ 37
- 6
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java View File

@@ -168,18 +168,20 @@ public class HandlerManage {
//然后入库暂存库
projectStagingService.addByProject(declaredProject, "暂存入库 待提交部门联审");
break;
// 当前项目状态是单位内部审核中
case UNDER_INTERNAL_AUDIT:
// 当前项目状态是部门联审中
case DEPARTMENT_JOINT_REVIEW:
//如果是 区县 并且 500万及以上要推送省局重大项目
if (!StateMachineUtils.isCityProject(declaredProject) &&
log.info("部门联审成功后 要判断是否是 区县重大项目");

Boolean isImport = !StateMachineUtils.isCityProject(declaredProject) &&
StateMachineUtils.judgeDeclareAmount(declaredProject,
ProjectDeclareConst.Number.DECLARE_COUNTY_AMOUNT_JUDGEMENT)) {
ProjectDeclareConst.Number.DECLARE_COUNTY_AMOUNT_JUDGEMENT);
log.info("isImport :{}",isImport);
//如果是 区县 并且 500万及以上要推送省局重大项目
if (isImport) {
try {
List<ProjectApplication> applications = projectApplicationService
.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, declaredProject.getId()));
.eq(ProjectApplication::getProjectCode, declaredProject.getProjectCode()));
joinReviewProvincialBureauService.pushImportProject(
ApplicationConverter.convertProject(declaredProject, applications, fileService));
updatePassProjectStatus(userId, declaredProject);
@@ -188,7 +190,10 @@ public class HandlerManage {
log.info("区县推送省级联审失败[{}],{}", declaredProject.getProjectName(), e.getMessage());
log.error("区县推送省级联审失败:" + e);
}
break;
}
// 当前项目状态是单位内部审核中
case UNDER_INTERNAL_AUDIT:
// 当前项目状态是方案评审中
case SCHEME_UNDER_REVIEW:
// 当前项目状态是终验审核中
@@ -457,4 +462,30 @@ public class HandlerManage {
}
}
}

/**
* 判断是否包含 此任务
* @param progressNodes
* @param taskId
* @return
*/
public Boolean checkIsContainsTask(List<ProgressNode> progressNodes, String taskId) {
if(CollUtil.isEmpty(progressNodes)){
return Boolean.FALSE;
}

final Boolean[] res = {Boolean.FALSE};
progressNodes.forEach(p -> {
if(p.getTaskId().equals(taskId)){
res[0] = Boolean.TRUE;
return;
}
if(CollUtil.isNotEmpty(p.getChildren()) &&
(checkIsContainsTask(p.getChildren(),taskId))){
res[0] = Boolean.TRUE;
return;
}
});
return res[0];
}
}

+ 46
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -24,8 +24,10 @@ import com.ningdatech.pmapi.todocenter.handle.PassHandle;
import com.ningdatech.pmapi.todocenter.handle.WithDrawHandle;
import com.ningdatech.pmapi.todocenter.model.dto.*;
import com.ningdatech.pmapi.todocenter.model.vo.TodoNumVO;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.wflow.contants.HisProInsEndActId;
import com.wflow.workflow.bean.process.ProcessComment;
import com.wflow.workflow.bean.process.enums.NodeTypeEnum;
import com.wflow.workflow.utils.ProcessTaskUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
@@ -541,25 +543,68 @@ public class TodoCenterManage {
String instanceId = request.getInstanceId();
String nodeId = request.getNodeId();
Long projectId = request.getProjectId();
ProcessProgressVo progressInstanceDetail = processInstanceService.getProgressInstanceDetail(nodeId, instanceId);
String taskId = request.getTaskId();
ProcessProgressVo progressInstanceDetail = processInstanceService.getProgressInstanceDetail(nodeId, instanceId,taskId);

if(Objects.isNull(progressInstanceDetail)){
return null;
}

List<ProgressNode> progressInfo = progressInstanceDetail.getProgressInfo();
Boolean isHighLine = Boolean.FALSE;
if (CollUtil.isNotEmpty(progressInfo)){
buildUserUtils.buildUserByProcessInfo(progressInfo);
isHighLine = checkHighLine(progressInfo,taskId,LoginUserUtil.loginUserDetail());
}
ProcessProgressDetailVo res = new ProcessProgressDetailVo();
res.setProcessProgressVo(progressInstanceDetail);
res.setStatus(progressInstanceDetail.getStatus());
res.setProjectId(projectId);
res.setCanWithdraw(withDrawHandle.checkCanWithdraw(instanceId,progressInstanceDetail,request.getTaskId()));
res.setIsHighLine(isHighLine);
passHandle.checkCanPassOrSeal(request.getInstanceId(),request.getTaskId(),employeeCode,res);
return res;
}

/**
* 筛选 当前登录人 是不是 上级条线单位的审批
* @param progressInfo
* @param taskId
* @param user
* @return
*/
private Boolean checkHighLine(List<ProgressNode> progressInfo, String taskId, UserInfoDetails user) {
if(CollUtil.isEmpty(progressInfo)){
return Boolean.FALSE;
}

final Boolean[] res = {Boolean.FALSE};
progressInfo.forEach(p -> {
//如果是 子流程
if(Objects.nonNull(p.getNodeType()) && NodeTypeEnum.SUB.name().equals(p.getNodeType().name())){
//如果不是上级条线单位 根本不用理
if(!p.getIsHighLine()){
return;
}
List<ProgressNode> children = p.getChildren();
ProgressNode progressNode = children.get(0);
String userId = progressNode.getUserId();
UserFullInfoDTO userFullInfoDTO = userInfoHelper.getUserFullInfoByEmployeeCode(userId);
if(Objects.nonNull(userFullInfoDTO) && user.getEmpPosUnitCode()
.equals(userFullInfoDTO.getEmpPosUnitCode())){
//说明是此单位的人
//那么要去看 taskId 是不是 在这个单位内的任务
Boolean isContainsTask = handlerManage.checkIsContainsTask(children,taskId);
if(isContainsTask){
res[0] = Boolean.TRUE;
return;
}
}
}
});
return res[0];
}


/**
* 待办中心我已处理项目列表查询


+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ProcessProgressDetailVo.java View File

@@ -53,4 +53,9 @@ public class ProcessProgressDetailVo {
* 能否驳回
*/
private Boolean canReject = Boolean.FALSE;

/**
* 当前审批人 是不是流程配置里的 上级条线主管
*/
private Boolean isHighLine = Boolean.FALSE;
}

Loading…
Cancel
Save