From a1212b98eb8bcfd353040e17431e1d6cf51c7552 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 14 Jun 2019 14:08:32 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=A1=E6=89=B9][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9F=AD=E4=BF=A1]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxFlowServiceImpl.java | 80 ++++++++++++++----- 1 file changed, 60 insertions(+), 20 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 b634cead5..7903a9d71 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -254,7 +254,7 @@ public class WxFlowServiceImpl implements WxFlowService { Boolean supplement = (Boolean)params.get("supplement"); WxFlowModel flowModel = getModelByType(flowType,tenantId); - if(StringUtils.isBlank(flowModel.getFlowId())){ + if(flowModel== null || StringUtils.isBlank(flowModel.getFlowId())){ return new ResultData(ResultData.ERROR, "您尚未设置审批模板,请先设置。"); } @@ -310,9 +310,14 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgRecord.setModelType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode()); wxMsgRecord.setReceiver(phone); wxMsgRecord.setTenantId(tenantId); - if(1 == flowType.intValue() || 3 == flowType.intValue()){ + 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) + ){ dynamicContentMap.put("bustype","合同"); - }else if(2 == flowType.intValue()){ + }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ dynamicContentMap.put("bustype","账单"); dynamicContentMap.put("contract", businessId.toString()); } @@ -386,11 +391,16 @@ public class WxFlowServiceImpl implements WxFlowService { mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); mailMsg.setTo(new String[]{email}); mailMsg.setTenantId(tenantId); - if(1 == flowType.intValue() || 3 == flowType.intValue()){ - msgReplaceMap.put("bustype","合同"); - }else if(2 == flowType.intValue()){ - msgReplaceMap.put("bustype","账单"); - msgReplaceMap.put("contract", businessId.toString()); + 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) + ){ + dynamicContentMap.put("bustype","合同"); + }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ + dynamicContentMap.put("bustype","账单"); + dynamicContentMap.put("contract", businessId.toString()); } mailMsg.setDynamicContentMap(msgReplaceMap); mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); @@ -706,9 +716,14 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgRecord.setModelType(EnumMsgModel.FLOW_APPLY_NODIFY.getCode()); wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):""); wxMsgRecord.setTenantId(tenantId); - if(1 == flowType.intValue() || 3 == flowType.intValue()){ + 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) + ){ msgReplaceMap.put("bustype","合同"); - }else if(2 == flowType.intValue()){ + }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); } @@ -725,9 +740,14 @@ public class WxFlowServiceImpl implements WxFlowService { mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); mailMsg.setTo(new String[]{email}); mailMsg.setTenantId(tenantId); - if(1 == flowType.intValue() || 3 == flowType.intValue()){ + 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) + ){ msgReplaceMap.put("bustype","合同"); - }else if(2 == flowType.intValue()){ + }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); } @@ -754,9 +774,14 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgRecord.setModelType(EnumMsgModel.FLOW_PASS_NODIFY.getCode()); wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):""); wxMsgRecord.setTenantId(tenantId); - if(1 == flowType.intValue() || 3 == flowType.intValue()){ + 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) + ){ msgReplaceMap.put("bustype","合同"); - }else if(2 == flowType.intValue()){ + }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); } @@ -773,9 +798,14 @@ public class WxFlowServiceImpl implements WxFlowService { mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); mailMsg.setTo(new String[]{email}); mailMsg.setTenantId(tenantId); - if(1 == flowType.intValue() || 3 == flowType.intValue()){ + 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) + ){ msgReplaceMap.put("bustype","合同"); - }else if(2 == flowType.intValue()){ + }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); } @@ -888,9 +918,14 @@ public class WxFlowServiceImpl implements WxFlowService { wxMsgRecord.setModelType(EnumMsgModel.FLOW_REJECT_NODIFY.getCode()); wxMsgRecord.setReceiver(userMap!=null?(String)userMap.get("phone"):""); wxMsgRecord.setTenantId(tenantId); - if(1 == flowType.intValue() || 3 == flowType.intValue()){ + 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) + ){ msgReplaceMap.put("bustype","合同"); - }else if(2 == flowType.intValue()){ + }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); } @@ -914,9 +949,14 @@ public class WxFlowServiceImpl implements WxFlowService { mailMsg.setModelId(EnumMsgModelId.MAIL_MSG_FLOW.getCode()); mailMsg.setTo(new String[]{email}); mailMsg.setTenantId(tenantId); - if(1 == flowType.intValue() || 3 == flowType.intValue()){ + 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) + ){ msgReplaceMap.put("bustype","合同"); - }else if(2 == flowType.intValue()){ + }else if(EnumFlowKey.BILL.getCode().equals(flowType)){ msgReplaceMap.put("bustype","账单"); msgReplaceMap.put("contract", businessId.toString()); }