diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java b/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java new file mode 100644 index 000000000..2dd615579 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumMsgModel.java @@ -0,0 +1,39 @@ +package com.iformall.enums; + +/** + * Created by luozukai + * 短信模板 + */ +public enum EnumMsgModel { + // type,name + FLOW_ASSIGNEE_NODIFY(2, "代办通知"), + FLOW_APPLY_NODIFY(3, "审批通知"), + FLOW_PASS_NODIFY(4, "通过审批通知"), + FLOW_REJECT_NODIFY(5, "驳回通知") + ; + + public static EnumMsgModel getEnum(Integer code) { + for (EnumMsgModel value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumMsgModel(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java index b1b83af35..3bd4b81bc 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java @@ -41,4 +41,5 @@ public interface WxRentContractMapper extends CommonMapper getRentInvalidList(WxRentContract wxRentContract); + void updateStatus(WxRentContract wxRentContract); } 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 95dc023fa..507b1c4af 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java @@ -5,10 +5,7 @@ import com.github.pagehelper.PageInfo; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.*; -import com.iformall.enums.EnumFlowKey; -import com.iformall.enums.EnumFlowRecordStatus; -import com.iformall.enums.EnumMsgModelType; -import com.iformall.enums.EnumRentContractAppStatus; +import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxRentContractMapper; @@ -167,12 +164,11 @@ public class WxFlowServiceImpl implements WxFlowService { Map content = new HashedMap(); content.put("userName",starterInfo.getName()); content.put("page", Constant.adminPage); - content.put("modelName","代办通知"); WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setTenantId(tenantId); wxMsgValidationcode.setPhone(mallUserInfo.getPhone()); - wxMsgValidationcode.setType(EnumMsgModelType.FLOW.getCode()); + wxMsgValidationcode.setType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,content); } @@ -377,10 +373,10 @@ public class WxFlowServiceImpl implements WxFlowService { for (MallUserInfo mallUserInfo:mallUserInfoList) { msgReplaceMap.put("userName",mallUserInfo.getName()); msgReplaceMap.put("page",Constant.adminPage); - msgReplaceMap.put("modelName","代办通知"); assignee += mallUserInfo.getName()+" "; wxMsgValidationcode.setPhone(mallUserInfo.getPhone()); + wxMsgValidationcode.setType(EnumMsgModel.FLOW_ASSIGNEE_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); } @@ -388,12 +384,12 @@ public class WxFlowServiceImpl implements WxFlowService { msgReplaceMap = new HashedMap(); msgReplaceMap.put("userName",userName); msgReplaceMap.put("page",Constant.adminPage); - msgReplaceMap.put("modelName","审批通知"); msgReplaceMap.put("contract",businessId+""); msgReplaceMap.put("toUserName",assignee.trim()); wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setPhone(starter.getPhone()); + wxMsgValidationcode.setType(EnumMsgModel.FLOW_APPLY_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); }else{ //需要测下三节点 @@ -417,11 +413,11 @@ public class WxFlowServiceImpl implements WxFlowService { // 给发起人发送审批通过消息 msgReplaceMap = new HashedMap(); - msgReplaceMap.put("modelName","通过审批通知"); msgReplaceMap.put("contract",businessId+""); msgReplaceMap.put("page",Constant.adminPage); wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setPhone(starter.getPhone()); + wxMsgValidationcode.setType(EnumMsgModel.FLOW_PASS_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); } } @@ -503,12 +499,12 @@ public class WxFlowServiceImpl implements WxFlowService { WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setTenantId(tenantId); wxMsgValidationcode.setType(EnumMsgModelType.FLOW.getCode()); - msgReplaceMap.put("modelName","驳回通知"); msgReplaceMap.put("contract",businessId+""); msgReplaceMap.put("page",Constant.adminPage); wxMsgValidationcode = new WxMsgValidationcode(); wxMsgValidationcode.setPhone(starter.getPhone()); + wxMsgValidationcode.setType(EnumMsgModel.FLOW_REJECT_NODIFY.getCode()); wxMsgValidationcodeService.sendWorkFlowNodify(wxMsgValidationcode,msgReplaceMap); return new ResultData(); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java index c675bd359..f012a334f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeServiceImpl.java @@ -60,7 +60,6 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); wxMsgValidationcodeModel.setTenantId(wxMsgConfig.getTenantId()); wxMsgValidationcodeModel.setType(wxMsgValidationcode.getType()); - wxMsgValidationcodeModel.setName(dynamicContentMap.get("modelName")); wxMsgValidationcodeModel = wxMsgValidationcodeModelMapper.findList(wxMsgValidationcodeModel).get(0); wxMsgValidationcode.setSignature(wxMsgValidationcodeModel.getSignature()); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 821a9adfa..fa9b6c24e 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -196,6 +196,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { record.getFlowParams().put("businessId",record.getId().toString()); record.getFlowParams().put("supplement",true); wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); + + // 合同状态改成待签约 + WxRentContract updateRentContract = new WxRentContract(); + updateRentContract.setId(record.getId()); + updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); + wxRentContractMapper.updateStatus(updateRentContract); } } catch (Exception e) { logger.error("启动审批流失败,e:" + e.getMessage()); diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 48bfb65d7..7825d71c3 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -168,6 +168,9 @@ update wx_rent_contract set apply_status=#{applyStatus} where id=#{id} + + update wx_rent_contract set status=#{status} where id=#{id} + update wx_rent_contract set status=#{status} where shop_id in (