From c61f87029552f9fa21898cb05cec9ce4e97a6368 Mon Sep 17 00:00:00 2001 From: luozukai Date: Wed, 19 Jun 2019 10:27:04 +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=B6=88=E6=81=AF=E5=8F=91=E9=80=81]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxFlowServiceImpl.java | 96 ++++++++----------- 1 file changed, 40 insertions(+), 56 deletions(-) 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 fba23c87d..cbd7bd459 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -295,14 +295,9 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgRecord.setModelType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode()); wxMsgRecord.setReceiver(phone); wxMsgRecord.setTenantId(tenantId); - if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType) - ){ + if(isContract(flowType)){ dynamicContentMap.put("bustype","合同"); - }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ + }else if(isBill(flowType)){ dynamicContentMap.put("bustype","账单"); dynamicContentMap.put("contract", businessId.toString()); } @@ -376,21 +371,36 @@ public class WxFlowServiceImpl implements WxFlowService { mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); mailMsg.setTo(new String[]{email}); mailMsg.setTenantId(tenantId); - if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType) - ){ + if(isContract(flowType)){ dynamicContentMap.put("bustype","合同"); - }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ + }else if(isBill(flowType)){ dynamicContentMap.put("bustype","账单"); dynamicContentMap.put("contract", businessId.toString()); } mailMsg.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); } + } + + public boolean isContract(Integer flowType){ + if(EnumFlowKey.CONTRACT.getCode().equals(flowType) + ||EnumFlowKey.END_CONTRACT.getCode().equals(flowType) + || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) + || EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType) + || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) + || EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType) + ){ + return true; + } + return false; + } + public boolean isBill(Integer flowType){ + if(EnumFlowKey.BILL.getCode().equals(flowType) + ||EnumFlowKey.NEW_BILL_CHANGE.getCode().equals(flowType)){ + return true; + } + return false; } public String variablesToJson(List> variables){ @@ -526,6 +536,7 @@ public class WxFlowServiceImpl implements WxFlowService { WxFlowRecord wxFlowRecord = new WxFlowRecord(); wxFlowRecord.setUserName(userName.trim()); wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); + wxFlowRecord.setTaskKey(task.getTaskDefinitionKey()); resultList.add(0,wxFlowRecord); //不是最后一个节点,设置下一个待审批节点代办人 @@ -545,6 +556,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxFlowRecord = new WxFlowRecord(); wxFlowRecord.setUserName(userName.trim()); wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); + wxFlowRecord.setTaskKey(UUID.randomUUID().toString()); resultList.add(0,wxFlowRecord); break; } @@ -576,6 +588,7 @@ public class WxFlowServiceImpl implements WxFlowService { WxFlowRecord wxFlowRecord = new WxFlowRecord(); wxFlowRecord.setUserName(userName.trim()); wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); + wxFlowRecord.setTaskKey(assignee.getKey()); resultList.add(0,wxFlowRecord); //不是最后一个节点,设置下一个待审批节点代办人 @@ -597,6 +610,7 @@ public class WxFlowServiceImpl implements WxFlowService { wxFlowRecord = new WxFlowRecord(); wxFlowRecord.setUserName(userName.trim()); wxFlowRecord.setStatus(EnumFlowRecordStatus.ASSIGNEE.getCode()); + wxFlowRecord.setTaskKey(UUID.randomUUID().toString()); resultList.add(0,wxFlowRecord); break; } @@ -737,14 +751,9 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgRecord.setModelType(EnumMsgModel.FLOW_APPLY_NODIFY.getCode()); wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):""); wxMsgRecord.setTenantId(tenantId); - if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType) - ){ + if(isContract(flowType)){ msgReplaceMap.put("bustype","合同"); - }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ + }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); } @@ -761,14 +770,9 @@ public class WxFlowServiceImpl implements WxFlowService { mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); mailMsg.setTo(new String[]{email}); mailMsg.setTenantId(tenantId); - if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType) - ){ + if(isContract(flowType)){ msgReplaceMap.put("bustype","合同"); - }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ + }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); } @@ -795,14 +799,9 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgRecord.setModelType(EnumMsgModel.FLOW_PASS_NODIFY.getCode()); wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):""); wxMsgRecord.setTenantId(tenantId); - if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType) - ){ + if(isContract(flowType)){ msgReplaceMap.put("bustype","合同"); - }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ + }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); } @@ -819,14 +818,9 @@ public class WxFlowServiceImpl implements WxFlowService { mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); mailMsg.setTo(new String[]{email}); mailMsg.setTenantId(tenantId); - if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType) - ){ + if(isContract(flowType)){ msgReplaceMap.put("bustype","合同"); - }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ + }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); } @@ -940,14 +934,9 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgRecord.setModelType(EnumMsgModel.FLOW_REJECT_NODIFY.getCode()); wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):""); wxMsgRecord.setTenantId(tenantId); - if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType) - ){ + if(isContract(flowType)){ msgReplaceMap.put("bustype","合同"); - }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ + }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); } @@ -971,14 +960,9 @@ public class WxFlowServiceImpl implements WxFlowService { mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); mailMsg.setTo(new String[]{email}); mailMsg.setTenantId(tenantId); - if(EnumFlowKey.CONTRACT.getCode().equals(flowType) || EnumFlowKey.NEW_RENT_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_RENT_END_CONTRACT.getCode().equals(flowType) - || EnumFlowKey.NEW_SHOP_END_CONTRACT.getCode().equals(flowType) - ){ + if(isContract(flowType)){ msgReplaceMap.put("bustype","合同"); - }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ + }else if(isBill(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); }