From 0501404fed634f1fbf5f1cc23eeefb0696dea406 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期一, 18 七月 2022 22:50:32 +0800
Subject: [PATCH] 优化 投诉建议 修改为cmd 方式

---
 service-common/src/main/java/com/java110/common/smo/impl/ComplaintUserInnerServiceSMOImpl.java |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/service-common/src/main/java/com/java110/common/smo/impl/ComplaintUserInnerServiceSMOImpl.java b/service-common/src/main/java/com/java110/common/smo/impl/ComplaintUserInnerServiceSMOImpl.java
index 477482e..f18bbba 100755
--- a/service-common/src/main/java/com/java110/common/smo/impl/ComplaintUserInnerServiceSMOImpl.java
+++ b/service-common/src/main/java/com/java110/common/smo/impl/ComplaintUserInnerServiceSMOImpl.java
@@ -78,8 +78,13 @@
         Map<String, Object> variables = new HashMap<String, Object>();
         //variables.put("complaintDto", complaintDto);
         variables.put("startUserId", complaintDto.getCurrentUserId());
+        String key = getWorkflowDto(complaintDto.getCommunityId());
 
-        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getWorkflowDto(complaintDto.getCommunityId()), complaintDto.getComplaintId(), variables);
+        if(StringUtil.isEmpty(key)){
+            return null;
+        }
+
+        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(key, complaintDto.getComplaintId(), variables);
         //灏嗗緱鍒扮殑瀹炰緥娴佺▼id鍊艰祴缁欎箣鍓嶈缃殑鍙橀噺
         String processInstanceId = processInstance.getId();
         // System.out.println("娴佺▼寮�鍚垚鍔�.......瀹炰緥娴佺▼id:" + processInstanceId);
@@ -98,11 +103,13 @@
         workflowDto.setCommunityId(communityId);
         List<WorkflowDto> workflowDtos = workflowInnerServiceSMOImpl.queryWorkflows(workflowDto);
 
-        Assert.listOnlyOne(workflowDtos, "鏈壘鍒� 鎶曡瘔寤鸿娴佺▼鎴栨壘鍒板鏉★紝璇峰湪鐗╀笟璐﹀彿绯荤粺绠$悊涓嬫祦绋嬬鐞嗕腑閰嶇疆娴佺▼");
+        if(workflowDtos == null || workflowDtos.size() < 1){
+            return "";
+        }
 
         WorkflowDto tmpWorkflowDto = workflowDtos.get(0);
         if (StringUtil.isEmpty(tmpWorkflowDto.getProcessDefinitionKey())) {
-            throw new IllegalArgumentException("鎶曡瘔寤鸿娴佺▼杩樻湭閮ㄧ讲");
+            return "";
         }
         return WorkflowDto.DEFAULT_PROCESS + tmpWorkflowDto.getFlowId();
     }
@@ -312,6 +319,7 @@
      */
     public boolean deleteTask(@RequestBody ComplaintDto complaintDto){
         String taskId = complaintDto.getTaskId();
+
         Task task = taskService.createTaskQuery().taskId(complaintDto.getTaskId()).singleResult();
         String processInstanceId = task.getProcessInstanceId();
         ProcessInstance pi = runtimeService.createProcessInstanceQuery()

--
Gitblit v1.8.0