From 851286cf66870345d8b13c2711bb1dd2754318d4 Mon Sep 17 00:00:00 2001 From: luozukai Date: Wed, 19 Jun 2019 22:29:24 +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=E6=B5=81=E7=A8=8B=E5=B1=95=E7=A4=BA]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iformall/domain/po/WxFlowRecord.java | 4 +++ .../service/impl/WxFlowServiceImpl.java | 30 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java b/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java index 54e9fae3e..bd86e526f 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxFlowRecord.java @@ -57,6 +57,10 @@ public class WxFlowRecord implements Serializable { private Integer isLastStart; @Transient private Integer limit; + //1普通 2会签 3或签 + @Transient + private Integer taskType; + public WxFlowRecord(){} public WxFlowRecord(Long businessId){ 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 eaaedca00..9c938a750 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -588,6 +588,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxFlowRecord.setUserName(userName.trim()); wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); wxFlowRecord.setTaskKey(assignee.getKey()); + wxFlowRecord.setTaskType(assignee.getType()); resultList.add(0,wxFlowRecord); //不是最后一个节点,设置下一个待审批节点代办人 @@ -610,6 +611,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxFlowRecord.setUserName(userName.trim()); wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); wxFlowRecord.setTaskKey(UUID.randomUUID().toString()); + wxFlowRecord.setTaskType(assignee.getType()); resultList.add(0,wxFlowRecord); break; } @@ -635,10 +637,20 @@ public class WxFlowServiceImpl implements WxFlowService { if(r.getTaskKey() == null) r.setTaskKey(r.getTaskName()); WxFlowRecord mapR = map.get(r.getTaskKey()); - if(mapR != null) - mapR.setUserName(mapR.getUserName()+","+r.getUserName()); - else - map.put(r.getTaskKey(),r); + if(mapR != null) { + //如果是会签代办,合并后去掉已经完成的 + if(EnumTaskType.AND.getCode().equals(mapR.getTaskType()) + && EnumFlowRecordStatus.ASSIGNEE.getCode().equals(mapR.getStatus()) + && r.getTaskKey().equals(mapR.getTaskKey()) + ){ + String newName = mapR.getUserName().replace(r.getUserName(),""); + mapR.setUserName(subUserName(newName)); + continue; + } + mapR.setUserName(mapR.getUserName() + "," + r.getUserName()); + }else{ + map.put(r.getTaskKey(), r); + } } List flowRecordList = new ArrayList<>(); @@ -649,6 +661,16 @@ public class WxFlowServiceImpl implements WxFlowService { return new ResultData(flowRecordList); } + public String subUserName(String name){ + if(name.startsWith(",")){ + return name.substring(1,name.length()); + } + if(name.endsWith(",")){ + return name.substring(0,name.length()-1); + } + return name.replace(",,",","); + } + @Override @Transactional(propagation = Propagation.REQUIRED,rollbackFor = {Exception.class}) public ResultData apply(Map params,Long userId,String userName,String tenantId) {