Quellcode durchsuchen

判断 能否通过 能否盖章

master
PoffyZhang vor 1 Jahr
Ursprung
Commit
ef633390f1
4 geänderte Dateien mit 100 neuen und 0 gelöschten Zeilen
  1. +73
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/PassHandle.java
  2. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  3. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ProcessDetailReq.java
  4. +19
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ProcessProgressDetailVo.java

+ 73
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/handle/PassHandle.java Datei anzeigen

@@ -0,0 +1,73 @@
package com.ningdatech.pmapi.todocenter.handle;

import cn.hutool.core.collection.CollUtil;
import com.ningdatech.pmapi.todocenter.model.vo.ProcessProgressDetailVo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.runtime.ActivityInstance;
import org.springframework.stereotype.Component;
import java.util.List;

/**
* @Classname PassHandle
* @Description
* @Date 2023/5/5 14:46
* @Author PoffyZhang
*/
@Component
@Slf4j
@AllArgsConstructor
public class PassHandle {

private final RuntimeService runtimeService;

/**
* 判断节点类型
* @param instanceId
* @param employeeCode
* @return
*/
public void checkCanPassOrSeal(String instanceId,String taskId,String employeeCode, ProcessProgressDetailVo res) {

List<ActivityInstance> activities = runtimeService.createActivityInstanceQuery()
.taskAssignee(employeeCode)
.processInstanceId(instanceId)
.unfinished()
.orderByActivityInstanceStartTime()
.asc()
.list();

if(CollUtil.isEmpty(activities)){
res.setCanPass(Boolean.FALSE);
res.setCanReject(Boolean.FALSE);
res.setCanSeal(Boolean.FALSE);
return;
}

for(ActivityInstance activity : activities){
if(StringUtils.isNotBlank(taskId)){
if(taskId.equals(activity.getTaskId())){
if(StringUtils.isNotBlank(activity.getActivityId())){
res.setCanReject(Boolean.TRUE);
if(activity.getActivityId().startsWith("node")){
res.setCanPass(Boolean.TRUE);
}else if(activity.getActivityId().startsWith("seal")){
res.setCanSeal(Boolean.TRUE);
}
}
}
}

if(StringUtils.isNotBlank(activity.getActivityId())){
res.setCanReject(Boolean.TRUE);
if(activity.getActivityId().startsWith("node")){
res.setCanPass(Boolean.TRUE);
}else if(activity.getActivityId().startsWith("seal")){
res.setCanSeal(Boolean.TRUE);
}
}
}
}
}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Datei anzeigen

@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.util.ObjectUtil;
import com.ningdatech.pmapi.projectdeclared.manage.DeclaredProjectManage;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterContant;
import com.ningdatech.pmapi.todocenter.handle.PassHandle;
import com.ningdatech.pmapi.todocenter.handle.WithDrawHandle;
import com.ningdatech.pmapi.todocenter.model.vo.TodoNumVO;
import com.wflow.workflow.enums.ProcessHandlerEnum;
@@ -141,6 +142,8 @@ public class TodoCenterManage {

private final WithDrawHandle withDrawHandle;

private final PassHandle passHandle;

/**
* 待办中心待我处理项目列表查询
*
@@ -462,6 +465,7 @@ public class TodoCenterManage {
* @return 流程进度及表单详情
*/
public ProcessProgressDetailVo getProcessDetail(ProcessDetailReq request) {
String employeeCode = LoginUserUtil.loginUserDetail().getEmployeeCode();
String instanceId = request.getInstanceId();
String nodeId = request.getNodeId();
Long projectId = request.getProjectId();
@@ -480,6 +484,7 @@ public class TodoCenterManage {
res.setStatus(progressInstanceDetail.getStatus());
res.setProjectId(projectId);
res.setCanWithdraw(withDrawHandle.checkCanWithdraw(instanceId,progressInstanceDetail));
passHandle.checkCanPassOrSeal(request.getInstanceId(),request.getTaskId(),employeeCode,res);
return res;
}



+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ProcessDetailReq.java Datei anzeigen

@@ -27,4 +27,7 @@ public class ProcessDetailReq {

@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("任务ID")
private String taskId;
}

+ 19
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/vo/ProcessProgressDetailVo.java Datei anzeigen

@@ -1,6 +1,7 @@
package com.ningdatech.pmapi.todocenter.model.vo;


import com.wflow.workflow.bean.process.enums.NodeTypeEnum;
import com.wflow.workflow.bean.vo.ProcessProgressVo;

import lombok.AllArgsConstructor;
@@ -33,5 +34,23 @@ public class ProcessProgressDetailVo {
*/
private Long projectId;

/**
* 能否撤回
*/
private Boolean canWithdraw = Boolean.FALSE;

/**
* 能否通过
*/
private Boolean canPass = Boolean.FALSE;

/**
* 能否盖章
*/
private Boolean canSeal = Boolean.FALSE;

/**
* 能否驳回
*/
private Boolean canReject = Boolean.FALSE;
}

Laden…
Abbrechen
Speichern