Przeglądaj źródła

实时获取 当前用户下一个taskId

master
PoffyZhang 1 rok temu
rodzic
commit
e7a31194ed
2 zmienionych plików z 49 dodań i 20 usunięć
  1. +8
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java
  2. +41
    -20
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 8
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/controller/TodoCenterController.java Wyświetl plik

@@ -40,6 +40,14 @@ public class TodoCenterController {
private final TodoCenterManage todoCenterManage;

/**
* 实时取当前操作人 某个工作流的下一个操作taskId
*/
@GetMapping("/todo/taskId/{instanceId}")
public String todoTaskId(@PathVariable String instanceId){
return todoCenterManage.todoTaskId(instanceId);
}

/**
* 待办中心-待我处理项目列表查询
* @param param
* @return


+ 41
- 20
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Wyświetl plik

@@ -388,26 +388,6 @@ public class TodoCenterManage {
}

/**
* 寻找下一个审核task
* @param instance
* @return
*/
private String findNextTaskId(HistoricProcessInstance instance,String employeeCode) {
List<ActivityInstance> userTasks = runtimeService.createActivityInstanceQuery()
.activityType("userTask")
.processInstanceId(instance.getId())
.taskAssignee(employeeCode)
.orderByActivityInstanceStartTime()
.desc()
.unfinished()
.list();
if(CollUtil.isEmpty(userTasks)){
return "处理成功";
}
return userTasks.get(0).getTaskId();
}

/**
* 调用IRS接口,获取盖章后的pdf文件,上传到OSS,并保存文件ID到项目库中
* @param req
* @param declaredProject
@@ -1223,4 +1203,45 @@ public class TodoCenterManage {
}
return todoNumVo;
}

/**
* 寻找下一个审核task
* @param instance
* @return
*/
private String findNextTaskId(HistoricProcessInstance instance,String employeeCode) {
List<ActivityInstance> userTasks = runtimeService.createActivityInstanceQuery()
.activityType("userTask")
.processInstanceId(instance.getId())
.taskAssignee(employeeCode)
.orderByActivityInstanceStartTime()
.asc()
.unfinished()
.list();
if(CollUtil.isEmpty(userTasks)){
return "处理成功";
}
return userTasks.get(0).getTaskId();
}

/**
* 取当前用户的下一个taskId
* @param instanceId
* @return
*/
public String todoTaskId(String instanceId) {
String employeeCode = LoginUserUtil.loginUserDetail().getEmployeeCode();
List<ActivityInstance> userTasks = runtimeService.createActivityInstanceQuery()
.activityType("userTask")
.processInstanceId(instanceId)
.taskAssignee(employeeCode)
.orderByActivityInstanceStartTime()
.asc()
.unfinished()
.list();
if(CollUtil.isEmpty(userTasks)){
return null;
}
return userTasks.get(0).getTaskId();
}
}

Ładowanie…
Anuluj
Zapisz