From 65763d38cf9b6b8067a293d9c99297efea0de3e3 Mon Sep 17 00:00:00 2001
From: 928255095 <928255095@qq.com>
Date: 星期二, 07 九月 2021 22:04:15 +0800
Subject: [PATCH] Merge branch 'xinghong-dev' into 'master'

---
 service-common/src/main/java/com/java110/common/smo/impl/GoodCollectionUserInnerServiceSMOImpl.java |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/service-common/src/main/java/com/java110/common/smo/impl/GoodCollectionUserInnerServiceSMOImpl.java b/service-common/src/main/java/com/java110/common/smo/impl/GoodCollectionUserInnerServiceSMOImpl.java
index dfe3dd8..76ee3e1 100755
--- a/service-common/src/main/java/com/java110/common/smo/impl/GoodCollectionUserInnerServiceSMOImpl.java
+++ b/service-common/src/main/java/com/java110/common/smo/impl/GoodCollectionUserInnerServiceSMOImpl.java
@@ -83,7 +83,7 @@
         variables.put("userId", purchaseApplyDto.getCurrentUserId());
         variables.put("startUserId", purchaseApplyDto.getCurrentUserId());
         //寮�鍚祦绋�
-        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getWorkflowDto(purchaseApplyDto.getStoreId()), purchaseApplyDto.getApplyOrderId(), variables);
+        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getWorkflowDto(purchaseApplyDto.getStoreId(),purchaseApplyDto.getCommunityId()), purchaseApplyDto.getApplyOrderId(), variables);
         //灏嗗緱鍒扮殑瀹炰緥娴佺▼id鍊艰祴缁欎箣鍓嶈缃殑鍙橀噺
         String processInstanceId = processInstance.getId();
         String processDefinitionId = processInstance.getProcessDefinitionId();
@@ -113,19 +113,20 @@
     }
 
 
-    private String getWorkflowDto(String storeId) {
+    private String getWorkflowDto(String storeId,String communityId) {
         //寮�鍚祦绋�
         //WorkflowDto.DEFAULT_PROCESS + workflowDto.getFlowId()
         WorkflowDto workflowDto = new WorkflowDto();
         workflowDto.setFlowType(WorkflowDto.FLOW_TYPE_COLLECTION);
         workflowDto.setStoreId(storeId);
+        workflowDto.setCommunityId(communityId);
         List<WorkflowDto> workflowDtos = workflowInnerServiceSMOImpl.queryWorkflows(workflowDto);
 
-        Assert.listOnlyOne(workflowDtos, "鏈壘鍒� 鎶曡瘔寤鸿娴佺▼鎴栨壘鍒板鏉★紝璇峰湪鐗╀笟璐﹀彿绯荤粺绠$悊涓嬫祦绋嬬鐞嗕腑閰嶇疆娴佺▼");
+        Assert.listOnlyOne(workflowDtos, "鏈壘鍒� 鐗╁搧棰嗙敤娴佺▼鎴栨壘鍒板鏉★紝璇峰湪鐗╀笟璐﹀彿绯荤粺绠$悊涓嬫祦绋嬬鐞嗕腑閰嶇疆娴佺▼");
 
         WorkflowDto tmpWorkflowDto = workflowDtos.get(0);
         if (StringUtil.isEmpty(tmpWorkflowDto.getProcessDefinitionKey())) {
-            throw new IllegalArgumentException("娴佺▼杩樻湭閮ㄧ讲");
+            throw new IllegalArgumentException("鐗╁搧棰嗙敤娴佺▼杩樻湭閮ㄧ讲");
         }
         return WorkflowDto.DEFAULT_PROCESS + tmpWorkflowDto.getFlowId();
     }
@@ -160,7 +161,7 @@
      */
     public long getUserTaskCount(@RequestBody AuditUser user) {
         TaskService taskService = processEngine.getTaskService();
-        TaskQuery query = taskService.createTaskQuery().processDefinitionKey(getWorkflowDto(user.getStoreId()));
+        TaskQuery query = taskService.createTaskQuery().processDefinitionKey(getWorkflowDto(user.getStoreId(),user.getCommunityId()));
         query.taskAssignee(user.getUserId());
         return query.count();
     }
@@ -172,7 +173,7 @@
      */
     public List<PurchaseApplyDto> getUserTasks(@RequestBody AuditUser user) {
         TaskService taskService = processEngine.getTaskService();
-        TaskQuery query = taskService.createTaskQuery().processDefinitionKey(getWorkflowDto(user.getStoreId()));
+        TaskQuery query = taskService.createTaskQuery().processDefinitionKey(getWorkflowDto(user.getStoreId(),user.getCommunityId()));
         query.taskAssignee(user.getUserId());
         query.orderByTaskCreateTime().desc();
         List<Task> list = null;
@@ -239,7 +240,7 @@
 //                .taskAssignee(user.getUserId());
 
         HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery()
-                .processDefinitionKey(getWorkflowDto(user.getStoreId()))
+                .processDefinitionKey(getWorkflowDto(user.getStoreId(),user.getCommunityId()))
                 .taskAssignee(user.getUserId())
                 .finished();
         if (!StringUtil.isEmpty(user.getAuditLink()) && "START".equals(user.getAuditLink())) {
@@ -261,7 +262,7 @@
         HistoryService historyService = processEngine.getHistoryService();
 
         HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery()
-                .processDefinitionKey(getWorkflowDto(user.getStoreId()))
+                .processDefinitionKey(getWorkflowDto(user.getStoreId(),user.getCommunityId()))
                 .taskAssignee(user.getUserId())
                 .finished();
 //        if (!StringUtil.isEmpty(user.getAuditLink()) && "START".equals(user.getAuditLink())) {

--
Gitblit v1.8.0