From c007f0ca1785db093d48f4846cda82fe8e955765 Mon Sep 17 00:00:00 2001
From: kimi <kimi42345@gmail.com>
Date: 星期三, 27 五月 2020 09:59:29 +0800
Subject: [PATCH] merage

---
 src/main/java/com/highdatas/mdm/service/impl/FlowsServiceImpl.java |   74 +++++++++++++++++++++++++++++-------
 1 files changed, 59 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/highdatas/mdm/service/impl/FlowsServiceImpl.java b/src/main/java/com/highdatas/mdm/service/impl/FlowsServiceImpl.java
index 8ca941e..1ed36ab 100644
--- a/src/main/java/com/highdatas/mdm/service/impl/FlowsServiceImpl.java
+++ b/src/main/java/com/highdatas/mdm/service/impl/FlowsServiceImpl.java
@@ -13,6 +13,7 @@
 import com.highdatas.mdm.service.act.IdentityService;
 import com.highdatas.mdm.service.act.TaskService;
 import com.highdatas.mdm.util.DbUtils;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -28,6 +29,7 @@
  * @since 2019-12-19
  */
 @Service
+@Slf4j
 public class FlowsServiceImpl extends ServiceImpl<FlowsMapper, Flows> implements IFlowsService {
     @Autowired
     IMaintainFieldService maintainFieldService;
@@ -35,8 +37,6 @@
     TaskService taskService;
     @Autowired
     SysFieldMapper fieldMapper;
-    @Autowired
-    ITUserRoleService userRoleService;
     @Autowired
     IMasterModifiedService masterModifiedService;
     @Autowired
@@ -47,7 +47,19 @@
     ISysViewService viewService;
     @Autowired
     IMasterAuthorSubscribeService subscribeService;
+    @Autowired
+    ISysMenuService menuService;
 
+    /**
+     *
+     * @description:  鍒涘缓鏂板瓧娈电増鏈�
+     * @param userId 鐢ㄦ埛id
+     * @param maintainId 鏁版嵁鐗堟湰id
+     * @param tableName 琛ㄥ悕
+     *
+     * @return: maintainfielid 瀛楁鐗堟湰瀵硅薄
+     *
+     */
     @Override
     public MaintainField createNowVerion(String tableName, String maintainId, String userId) {
         MaintainField nowMaintain = maintainFieldService.getNextMaintain(tableName, userId);
@@ -66,7 +78,13 @@
 
         return nowMaintain;
     }
-
+    /**
+     *
+     * @description:  閫氳繃涓氬姟id鑾峰彇瀹℃壒鐘舵��
+     * @param businessId 涓氬姟id
+     * @return: status
+     *
+     */
     @Override
     public ActivitiStatus getStatusByBusinessId(String businessId) {
         Flows flows = selectOne(new EntityWrapper<Flows>().eq("business_id", businessId).orderBy("create_time desc"));
@@ -75,7 +93,14 @@
         }
         return flows.getStatus();
     }
-
+    /**
+     *
+     * @description:  鍒ゆ柇鏄惁涓轰笅涓�鑺傜偣瀹℃壒浜�
+     * @param flows 娴佺▼
+     * @param userId 鐢ㄦ埛id
+     * @return: status
+     *
+     */
     @Override
     public boolean isNextAudit(Flows flows, String userId) {
         NextTaskUserInfo nestTaskAssignee = taskService.getNestTaskAssignee(flows.getWorkflowId());
@@ -104,18 +129,37 @@
         }
     }
 
+    /**
+     *
+     * @description:  娴佺▼瀹屾垚鍚庣殑鎿嶄綔
+     * @param flows 娴佺▼瀹炰緥
+     *
+     */
+
     @Override
     public void aduitFinish(Flows flows) {
-        if (flows.getBusinessType().equals(ActivitiBusinessType.maintain)){
-            String maintainId = flows.getBusinessId();
-            masterModifiedService.dealFlow(maintainId, flows.getStatus());
-            maintainService.dealFlow(maintainId, flows.getStatus());
-            viewService.dealFlow(maintainId, flows.getStatus());
-            subscribeService.dealFlow(maintainId, flows.getStatus());
-        }
-        if (flows.getBusinessType().equals(ActivitiBusinessType.field)){
-            String maintainId = flows.getBusinessId();
-            maintainFieldService.dealFlow(maintainId, flows.getStatus());
-        }
+        // 鏂板绾跨▼
+        new Thread(() -> {
+            log.info("澶勭悊 鐢熸垚鐗堟湰鍚庣殑鎿嶄綔");
+            if (flows.getBusinessType().equals(ActivitiBusinessType.maintain)){
+                String maintainId = flows.getBusinessId();
+                log.info("flow-maintain:" + maintainId);
+                masterModifiedService.dealFlow(maintainId, flows.getStatus());
+                log.info("flow-masterModifiedService end");
+                maintainService.dealFlow(maintainId, flows.getStatus());
+                log.info("flow-maintainService end");
+                viewService.dealFlow(maintainId, flows.getStatus());
+                log.info("flow-viewService end");
+                subscribeService.dealFlow(maintainId, flows.getStatus());
+                log.info("flow-subscribeService end");
+                menuService.dealFlow(maintainId, flows.getStatus(), flows.getUserId());
+                log.info("flow-menuService end");
+            }
+            if (flows.getBusinessType().equals(ActivitiBusinessType.field)){
+                String maintainId = flows.getBusinessId();
+                maintainFieldService.dealFlow(maintainId, flows.getStatus());
+
+            }
+        }).start();
     }
 }

--
Gitblit v1.8.0