From 5d15287b2a06f978485ac6af71e33e1a82b43a65 Mon Sep 17 00:00:00 2001
From: kimi <kimi42345@gmail.com>
Date: 星期三, 15 四月 2020 16:29:55 +0800
Subject: [PATCH] fix  上传后生成版本连接池用完不释放问题

---
 src/main/java/com/highdatas/mdm/controller/ActivitiController.java |   32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/src/main/java/com/highdatas/mdm/controller/ActivitiController.java b/src/main/java/com/highdatas/mdm/controller/ActivitiController.java
index 10f7935..24d1173 100644
--- a/src/main/java/com/highdatas/mdm/controller/ActivitiController.java
+++ b/src/main/java/com/highdatas/mdm/controller/ActivitiController.java
@@ -12,6 +12,7 @@
 import com.highdatas.mdm.service.*;
 import com.highdatas.mdm.service.act.*;
 import com.highdatas.mdm.util.Constant;
+import com.highdatas.mdm.util.DbUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.activiti.engine.history.HistoricActivityInstance;
 import org.activiti.engine.history.HistoricProcessInstance;
@@ -65,8 +66,7 @@
 
     @Autowired
     IMaintainService maintainService;
-    @Autowired
-    ITUserService userService;
+
     @Autowired
     IMasterModifiedService masterModifiedService;
 
@@ -178,16 +178,16 @@
                 maintain.updateById();
                 return Result.success(flows.getId());
             }else if (type.equals(ActivitiBusinessType.exists)) {
-                HashMap<String, String> body=new HashMap();
+                HashMap<String, Object> body=new HashMap();
                 NextTaskUserInfo nestTaskAssignee = taskService.getNestTaskAssignee(flows.getWorkflowId());
 
                 body.put("activitiId", flows.getId());
                 if (nestTaskAssignee == null) {
-                    body.put("roleId", null);
-                    body.put("userId", null);
+                    body.put("roleIdList", null);
+                    body.put("userIdList", null);
                 } else {
-                    body.put("roleId", nestTaskAssignee.getRoleId());
-                    body.put("userId", nestTaskAssignee.getUserId());
+                    body.put("roleIdList", nestTaskAssignee.getRoleIdList());
+                    body.put("userIdList", nestTaskAssignee.getUserIdList());
                 }
                 return Result.success(body);
             }
@@ -248,7 +248,7 @@
             HashMap<String, Object> one = new HashMap<>();
             String workflowId = historicProcessInstance.getId();
             String startUserId = historicProcessInstance.getStartUserId();
-            TUser user = userService.selectById(startUserId);
+            TUser user = DbUtils.getUserById(startUserId);
             Flows flows = flowsService.selectOne(new EntityWrapper<Flows>().eq("workflow_id", workflowId));
             Maintain maintain = maintainService.selectById(flows.getBusinessId());
             one.put("userName", user.getUserName());
@@ -269,7 +269,7 @@
 
         JSONObject object = new JSONObject();
         object.fluentPut("total", page.getRecordCount());
-        object.fluentPut("size", page.getPageSize());
+        object.fluentPut("passiveQueueSize", page.getPageSize());
         object.fluentPut("pages", page.getPageCount());
         object.fluentPut("current", page.getPageNo());
         object.fluentPut("record", result);
@@ -340,8 +340,12 @@
         }
         if (taskId == null) {
             Task task = taskService.geTask(workflowId);
+            if (task == null) {
+                return Result.error(CodeMsg.ERROR_ACTIVITI_NEXTTASK);
+            }
             taskId = task.getId();
         }
+
         boolean completed = taskService.completeTask(taskId, pass, reason);
 
         if (completed) {
@@ -370,15 +374,15 @@
                     nextTaskDefinition = taskService.getNestTaskAssignee(workflowId);
 
                 }
-            HashMap<String, String> body=new HashMap();
+            HashMap<String, Object> body=new HashMap();
             if (flows.getBusinessType().equals(ActivitiBusinessType.exists)){
                 body.put("status", flows.getStatus().name());
                 if (nextTaskDefinition == null) {
-                    body.put("roleId", null);
-                    body.put("userId", null);
+                    body.put("roleIdList", null);
+                    body.put("userIdList", null);
                 } else {
-                    body.put("roleId", nextTaskDefinition.getRoleId());
-                    body.put("userId", nextTaskDefinition.getUserId());
+                    body.put("roleIdList", nextTaskDefinition.getRoleIdList());
+                    body.put("userIdList", nextTaskDefinition.getUserIdList());
                 }
             }
 

--
Gitblit v1.8.0