From 2ec71485cd6acd71ec2f9790a9ff0d2548b5b2ca Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 18 Jun 2019 15:04:16 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=A1=E6=89=B9][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=9A=E7=AD=BE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V201906181444__L_ALTER_BILL.sql | 2 ++ .../service/impl/WxFlowServiceImpl.java | 28 +++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201906181444__L_ALTER_BILL.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906181444__L_ALTER_BILL.sql b/mallinkAdmin/src/main/resources/db/migration/V201906181444__L_ALTER_BILL.sql new file mode 100644 index 000000000..1ac2fffe4 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906181444__L_ALTER_BILL.sql @@ -0,0 +1,2 @@ +ALTER TABLE `wx_bill_other` MODIFY COLUMN `comments` varchar(255) COLLATE utf8mb4_unicode_ci; +ALTER TABLE `wx_bill_other_deposit` MODIFY COLUMN `comments` varchar(255) COLLATE utf8mb4_unicode_ci; \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java index 7722fe192..7fc1e5a9f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -84,7 +84,6 @@ public class WxFlowServiceImpl implements WxFlowService { @Autowired private WxBillAllService wxBillAllService; - /** * 获取流程key * @param flowType @@ -234,6 +233,10 @@ public class WxFlowServiceImpl implements WxFlowService { map.put("variables",variables); map.put("supplement",supplement); map.put("taskAssignee",flowModel.getFlow()); + List assigneeList = new ArrayList<>(); + assigneeList.add("243650055783841792"); + assigneeList.add("204398756307664896"); + map.put("assigneeList",assigneeList); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(flowModel.getFlowId(), map); logger.debug("流程启动,流程id:{}",processInstance.getId()); @@ -396,7 +399,7 @@ public class WxFlowServiceImpl implements WxFlowService { } } - int total = taskQuery.taskCandidateUser(userId.toString()).list().size(); + int total = taskQuery.taskCandidateOrAssigned(userId.toString()).list().size(); int pages; if(total % pageSize == 0){ pages = total / pageSize; @@ -1102,13 +1105,26 @@ public class WxFlowServiceImpl implements WxFlowService { userTask.setName("节点" + (i + 1)); userTask.setId("userTask" + (i + 1)); List userIdList = new ArrayList<>(); - for (FlowUserVo userVo:taskVo.getUserList()) { + String collection = ""; + for (int j = 0; j < taskVo.getUserList().size(); j++) { + FlowUserVo userVo = taskVo.getUserList().get(j); userIdList.add(userVo.getId() + ""); + if(j==taskVo.getUserList().size()-1){ + collection += userVo.getId(); + }else{ + collection += userVo.getId()+","; + } } - userTask.setCandidateUsers(userIdList); - if (EnumTaskType.AND.getCode().equals(taskVo.getType())) { + collection += ""; + + if(EnumTaskType.NORMAL.getCode().equals(taskVo.getType()) || EnumTaskType.OR.getCode().equals(taskVo.getType())){ + userTask.setCandidateUsers(userIdList); + }else if (EnumTaskType.AND.getCode().equals(taskVo.getType())) { + userTask.setAssignee("${assignee}"); MultiInstanceLoopCharacteristics mi = new MultiInstanceLoopCharacteristics(); - mi.setLoopCardinality("1"); + mi.setLoopCardinality(userIdList.size()+""); + mi.setInputDataItem("${assigneeList}"); + mi.setElementVariable("assignee"); userTask.setLoopCharacteristics(mi); }