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()); }