Procházet zdrojové kódy

业务提问模块

lizhenhao před 2 roky
rodič
revize
6144e4aed7

+ 19 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java

@@ -3,6 +3,7 @@
  */
 package com.jeeplus.flowable.controller;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
@@ -368,7 +369,25 @@ public class FlowableTaskController {
      */
     @RequestMapping(value = "/back")
     public ResponseEntity back(String backTaskDefKey, String taskId, TaskComment comment) {
+
         String procInsId = flowTaskService.backTask(backTaskDefKey, taskId, comment);
+        Task task = taskService.createTaskQuery().processInstanceId(procInsId).active().singleResult();
+        if (ObjectUtil.isNotEmpty(task)) {
+            if (com.jeeplus.sys.utils.StringUtils.isNotBlank(task.getId())){
+                if (ObjectUtil.isNotEmpty(comment)) {
+                    if (com.jeeplus.sys.utils.StringUtils.isNotBlank(comment.getCandidateUserList())) {
+                        String[] split = comment.getCandidateUserList().split(",");
+                        if (split.length == 1) {
+                            taskService.setAssignee(task.getId(),split[0]);
+                        }else{
+                            for (String i : split) {
+                                taskService.addCandidateUser(task.getId(),i);
+                            }
+                        }
+                    }
+                }
+            }
+        }
         return ResponseEntity.ok (procInsId);
     }
 

+ 0 - 8
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/FlowTaskService.java

@@ -676,14 +676,6 @@ public class FlowTaskService {
             managementService.executeCommand (new BackUserTaskCmd (runtimeService,
                     taskId, backTaskDefKey));
         }
-        if (ObjectUtil.isNotEmpty(comment)) {
-            if (StringUtils.isNotBlank(comment.getCandidateUserList())) {
-                String[] split = comment.getCandidateUserList().split(",");
-                for (String i : split) {
-                    taskService.addCandidateUser(task.getId(),i);
-                }
-            }
-        }
 
         return task.getProcessInstanceId ();
     }