diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java index 8b87e0b01..31236bf09 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java @@ -653,7 +653,7 @@ public class WxProjectConfigController extends BaseController { List wxQuestionList = wxQuestionService.findList(wxQuestion); map.put("wxQuestionList",wxQuestionList); WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); - wxMsgValidationcodeModel.setTenantId(wxMall.getTenantId()); + //wxMsgValidationcodeModel.setTenantId(wxMall.getTenantId()); List wxMsgValidationcodeModelList = wxMsgValidationcodeModelService.findList(wxMsgValidationcodeModel); map.put("wxMsgValidationcodeModelList",wxMsgValidationcodeModelList); diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgValidationcodeModelController.java b/mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgValidationcodeModelController.java index 302b337b4..cd9a0814f 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgValidationcodeModelController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/msg/WxMsgValidationcodeModelController.java @@ -24,44 +24,44 @@ public class WxMsgValidationcodeModelController extends BaseController { @Autowired private WxMsgValidationcodeModelService wxMsgValidationcodeModelService; - @ApiOperation("消息模板-列表") - @GetMapping("list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) - @SystemControllerLog(description = "消息验证模板-列表") - public ResultData list(@ModelAttribute WxMsgValidationcodeModel wxMsgValidationcodeModel, Integer pageNum, Integer pageSize) { - logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::list"); - if (null == wxMsgValidationcodeModel) wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); - wxMsgValidationcodeModel.updateTenantInfo(getTenantInfo()); - PageInfo page = wxMsgValidationcodeModelService.listAsPage(wxMsgValidationcodeModel, pageNum, pageSize); - page.getList().forEach(m -> { - for (EnumMsgModelReplace e : EnumMsgModelReplace.values()) { - m.setContent(m.getContent().replace(e.getCode(),e.getMessage())); - } - }); - return new ResultData(page); - } - - @ApiOperation("消息模板-添加") - @PostMapping("add") - @SystemControllerLog(description = "消息验证模板-添加") - public ResultData add(@RequestBody WxMsgValidationcodeModel wxMsgValidationcodeModel) { - logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::add"); - //Assert.notNull(wxMsgValidationcodeModel.getName(), "角色名不能为空"); - //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); - wxMsgValidationcodeModel.updateTenantInfo(getTenantInfo()); - return wxMsgValidationcodeModelService.saveOrUpdate(wxMsgValidationcodeModel); - } - - @ApiOperation("消息模板-更新") - @PostMapping("update") - @SystemControllerLog(description = "消息验证模板-更新") - public ResultData update(@RequestBody WxMsgValidationcodeModel wxMsgValidationcodeModel) { - logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::update"); - wxMsgValidationcodeModelService.saveOrUpdate(wxMsgValidationcodeModel); - return new ResultData(); - } +// @ApiOperation("消息模板-列表") +// @GetMapping("list") +// @ApiImplicitParams({ +// @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), +// @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) +// @SystemControllerLog(description = "消息验证模板-列表") +// public ResultData list(@ModelAttribute WxMsgValidationcodeModel wxMsgValidationcodeModel, Integer pageNum, Integer pageSize) { +// logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::list"); +// if (null == wxMsgValidationcodeModel) wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); +// wxMsgValidationcodeModel.updateTenantInfo(getTenantInfo()); +// PageInfo page = wxMsgValidationcodeModelService.listAsPage(wxMsgValidationcodeModel, pageNum, pageSize); +// page.getList().forEach(m -> { +// for (EnumMsgModelReplace e : EnumMsgModelReplace.values()) { +// m.setContent(m.getContent().replace(e.getCode(),e.getMessage())); +// } +// }); +// return new ResultData(page); +// } +// +// @ApiOperation("消息模板-添加") +// @PostMapping("add") +// @SystemControllerLog(description = "消息验证模板-添加") +// public ResultData add(@RequestBody WxMsgValidationcodeModel wxMsgValidationcodeModel) { +// logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::add"); +// //Assert.notNull(wxMsgValidationcodeModel.getName(), "角色名不能为空"); +// //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); +// wxMsgValidationcodeModel.updateTenantInfo(getTenantInfo()); +// return wxMsgValidationcodeModelService.saveOrUpdate(wxMsgValidationcodeModel); +// } +// +// @ApiOperation("消息模板-更新") +// @PostMapping("update") +// @SystemControllerLog(description = "消息验证模板-更新") +// public ResultData update(@RequestBody WxMsgValidationcodeModel wxMsgValidationcodeModel) { +// logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::update"); +// wxMsgValidationcodeModelService.saveOrUpdate(wxMsgValidationcodeModel); +// return new ResultData(); +// } @ApiOperation("消息模板-打开/关闭发送") @PostMapping("updateOpen") diff --git a/mallinkAdmin/src/main/resources/db/migration/V202301200001__contract.sql b/mallinkAdmin/src/main/resources/db/migration/V202301200001__contract.sql index 80007add8..ac7dbf3f4 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202301200001__contract.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202301200001__contract.sql @@ -34,6 +34,12 @@ ADD COLUMN `operating_management_fee_ratio_way` int(1) COMMENT '营业管理费 ALTER TABLE `mallink`.`wx_rent_contract` ADD COLUMN `operating_management_fee_ratio` JSON COMMENT '营业管理费调整比率' ; +ALTER TABLE `mallink`.`wx_rent_contract` +ADD COLUMN `out_date_notify_days` INT(3) NOT NULL DEFAULT 0 COMMENT '到期提醒提前天数' ; + +ALTER TABLE `mallink`.`wx_rent_contract` +ADD COLUMN `out_date_notify_phone` varchar(30) COMMENT '到期提醒手机号' ; + ALTER TABLE `mallink`.`wx_bill_rent` ADD COLUMN `bussiness_manage_fee_need_pay` bigint(12) COMMENT '商业管理费应收' AFTER `need_pay`; @@ -41,3 +47,28 @@ ADD COLUMN `bussiness_manage_fee_need_pay` bigint(12) COMMENT '商业管理费 ALTER TABLE `mallink`.`wx_bill_rent` ADD COLUMN `operating_manage_fee_need_pay` bigint(12) COMMENT '营业管理费应收' AFTER `need_pay`; +#CREATE TABLE `wx_msg_validationcode_model_tenant` ( +# `id` bigint(20) NOT NULL COMMENT '主键ID', +# `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL, +# `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL, +# `model_id` bigint(20) NOT NULL COMMENT '关联的模板编号', +# `signature` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '签名', +# `model_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '模版code', +# `content` text COLLATE utf8mb4_unicode_ci COMMENT '如内容有修改,可设置', +# `sms_channel` int(1) NOT NULL COMMENT '发短信通道EnumSMSChannel', +# PRIMARY KEY (`id`), +# UNIQUE KEY `id_UNIQUE` (`id`), +# UNIQUE KEY `UNIQUE_T_T` (`tenant_id`,`model_id`) +#) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='短信模板'; +//金茂的短信加入到这个表记录中 + +delete from wx_msg_validationcode_model where tenant_id != '789'; +ALTER TABLE wx_msg_validationcode_model DROP COLUMN tenant_id; +ALTER TABLE wx_msg_validationcode_model DROP COLUMN parent_tenant_id; +ALTER TABLE wx_msg_validationcode_model DROP COLUMN model_id; + +ALTER TABLE wx_msg_model DROP COLUMN model_id; + + + + diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java index 4546016c5..f7536c141 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java @@ -4,7 +4,13 @@ import com.iformall.domain.po.WxMall; import com.iformall.domain.po.WxPropertyContract; import com.iformall.domain.po.WxRentContract; import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.po.msg.WxMsgRecord; +import com.iformall.enums.EnumMsgMqKey; +import com.iformall.enums.EnumMsgMqTag; +import com.iformall.enums.EnumMsgMqTopic; +import com.iformall.enums.EnumMsgRecordType; import com.iformall.mapper.WxMallMapper; +import com.iformall.mq.MqBaseProducer; import com.iformall.service.WxPropertyContractService; import com.iformall.service.WxRentContractService; import lombok.extern.slf4j.Slf4j; @@ -15,7 +21,9 @@ import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * @author gongbiao @@ -34,7 +42,8 @@ public class ContractSchedule { @Autowired private WxMallMapper wxMallMapper; - + @Autowired + private MqBaseProducer mqBaseProducer; /** * 凌晨5分 */ @@ -85,7 +94,7 @@ public class ContractSchedule { } /** - * 凌晨5分 + * 凌晨5分,定时终止租金合同 */ @Async @Scheduled(cron = "0 5 0 * * ?") @@ -107,7 +116,7 @@ public class ContractSchedule { } /** - * 凌晨5分 + * 凌晨5分,定时终止物业合同 */ @Async @Scheduled(cron = "0 5 0 * * ?") @@ -127,5 +136,35 @@ public class ContractSchedule { } } } + + /** + * 凌晨5分,定时过期提醒租金合同到期 + */ + @Async + @Scheduled(cron = "0 5 0 * * ?") + public void notifyRentContractOutDate() { + List wxMalls = wxMallMapper.findList(null); + for (WxMall wxMall : wxMalls) { + //物业合同 + List contractList = wxRentContractService.findToOutDateContracts(wxMall); + for (WxRentContract rent:contractList) { + try { + WxMsgRecord msgRecord = new WxMsgRecord(); + msgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); + msgRecord.updateTenantInfo(wxMall); + msgRecord.setReceiver(rent.getOutDateNotifyPhone()); + msgRecord.setModelType(32); + Map dynamicContentMap = new HashMap(); + dynamicContentMap.put("id", String.valueOf(rent.getId())); + dynamicContentMap.put("contractType", "租金"); + dynamicContentMap.put("contract", String.valueOf(rent.getId())); + msgRecord.setDynamicContentMap(dynamicContentMap); + mqBaseProducer.sendMessage(msgRecord, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(), EnumMsgMqKey.DEFAULT.getCode()); + }catch(Exception e) { + log.error("rentcontract outDate error.",e); + } + } + } + } } \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMsgModel.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMsgModel.java index d3139d6af..9612262cf 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMsgModel.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMsgModel.java @@ -30,13 +30,9 @@ public class WxMsgModel extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="reason",name="reason") private String reason; - - @io.swagger.annotations.ApiModelProperty(value="modelid",name="modelId") - private Integer modelId; - @io.swagger.annotations.ApiModelProperty(value="templateType",name="templateType") private Integer templateType; - @io.swagger.annotations.ApiModelProperty(value="aliyun模板code",name="modelCode") + @io.swagger.annotations.ApiModelProperty(value="通道模板code",name="modelCode") private String modelCode; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMsgValidationcodeModel.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMsgValidationcodeModel.java index 406fdef52..34d594f77 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMsgValidationcodeModel.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMsgValidationcodeModel.java @@ -1,7 +1,7 @@ package com.iformall.domain.po; import com.baomidou.mybatisplus.annotation.TableName; -import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.po.base.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -10,7 +10,7 @@ import java.util.Date; @TableName(value = "wx_msg_validationcode_model") @Data @EqualsAndHashCode(callSuper = true) -public class WxMsgValidationcodeModel extends TenantEntity { +public class WxMsgValidationcodeModel extends BaseEntity { protected Long id; @@ -26,9 +26,7 @@ public class WxMsgValidationcodeModel extends TenantEntity { private Integer status; @io.swagger.annotations.ApiModelProperty(value="有效分钟数",name="minutes") private Integer minutes; - @io.swagger.annotations.ApiModelProperty(value="",name="modelId") - private Integer modelId; - @io.swagger.annotations.ApiModelProperty(value="阿里云模板code",name="modelCode") + @io.swagger.annotations.ApiModelProperty(value="通道模板code",name="modelCode") private String modelCode; @io.swagger.annotations.ApiModelProperty(value="场景",name="type") private Integer type; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMsgValidationcodeModelTenant.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMsgValidationcodeModelTenant.java new file mode 100644 index 000000000..603fa58ce --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMsgValidationcodeModelTenant.java @@ -0,0 +1,30 @@ +package com.iformall.domain.po; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.iformall.domain.po.base.BaseEntity; +import com.iformall.domain.po.base.TenantEntity; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +@TableName(value = "wx_msg_validationcode_model_tenant") +@Data +@EqualsAndHashCode(callSuper = true) +public class WxMsgValidationcodeModelTenant extends TenantEntity { + + protected Long id; + + @io.swagger.annotations.ApiModelProperty(value="模板编号",name="modelId") + private Long modelId; + @io.swagger.annotations.ApiModelProperty(value="签名",name="signature") + private String signature; + @io.swagger.annotations.ApiModelProperty(value="如内容有修改,可设置",name="content") + private String content; + @io.swagger.annotations.ApiModelProperty(value="通道模板code",name="modelCode") + private String modelCode; + @io.swagger.annotations.ApiModelProperty(value="通道EnumSMSChannel",name="smsChannel") + private Integer smsChannel; +} + diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java index 08faa285f..b8d2df938 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -420,6 +420,15 @@ public class WxRentContract extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "营业管理费调整方式1按比例2按金额", name = "operatingManagementFeeRatio") private String operatingManagementFeeRatio; + @io.swagger.annotations.ApiModelProperty(value = "到期提醒提前天数", name = "outDateNotifyDays") + private Integer outDateNotifyDays; + + @io.swagger.annotations.ApiModelProperty(value = "到期提醒手机号", name = "outDateNotifyPhone") + private String outDateNotifyPhone; + + //查询过期提醒 + @TableField(exist = false) + private Integer outDateNofity; public void setAdjustPeriodHandle() { if(EnumPriceUnit.D.getCode().equals(this.getPriceUnit()) && EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode().equals(adjustPeriod)){ diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxMsgModelMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxMsgModelMapper.java index 2e10af59a..e55153234 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxMsgModelMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxMsgModelMapper.java @@ -11,9 +11,6 @@ public interface WxMsgModelMapper extends CommonMapper { List findAliYunList(WxMsgModel msgModel); - WxMsgModel findOneByModelId(WxMsgModel wxMsgModel); - - int updateByCode(WxMsgModel wxMsgModel); diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxMsgValidationcodeModelTenantMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxMsgValidationcodeModelTenantMapper.java new file mode 100644 index 000000000..a27a0c17c --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/WxMsgValidationcodeModelTenantMapper.java @@ -0,0 +1,15 @@ +package com.iformall.mapper; + +import java.util.*; +import com.iformall.common.CommonMapper; +import com.iformall.domain.po.WxMsgValidationcodeModel; +import com.iformall.domain.po.WxMsgValidationcodeModelTenant; + +import org.apache.ibatis.annotations.Param; + +public interface WxMsgValidationcodeModelTenantMapper extends CommonMapper { + + WxMsgValidationcodeModelTenant findByModelId(WxMsgValidationcodeModelTenant wxMsgValidationcodeModelTenant); + + List findList(WxMsgValidationcodeModelTenant wxMsgValidationcodeModelTenant); +} diff --git a/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java b/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java index 5f32d3100..2bfaee8e0 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxRentContractService.java @@ -110,6 +110,9 @@ public interface WxRentContractService { */ void outDateContract(WxMall wxMall); + //查询还有多少天到期的合同 + List findToOutDateContracts(TenantEntity tenantEntity); + /** * 已签约未计租 变为计租中 * @param wxMall diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgCallbackServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgCallbackServiceImpl.java index 7c3e081bc..c61f58693 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgCallbackServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgCallbackServiceImpl.java @@ -135,7 +135,7 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { if (checksign(tenantId, param)) { logger.info("短信营销模板回调SIGN校验成功"); WxMsgModel wxMsgModel = new WxMsgModel(); - wxMsgModel.setModelId(Integer.valueOf(param.get("id"))); + //wxMsgModel.setModelId(Integer.valueOf(param.get("id"))); wxMsgModel.setTenantId(tenantId); wxMsgModel = wxMsgModelMapper.findList(wxMsgModel).get(0); wxMsgModel.setStatus(param.get("status").equals("1")?Integer.valueOf(param.get("status")):0); @@ -149,17 +149,17 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { @Override public void receiveverifymodel(String tenantId, Map param) { - if(checksign(tenantId,param)) { - logger.info("短信模板回调SIGN校验成功"); - WxMsgValidationcodeModel wxMsgModel = new WxMsgValidationcodeModel(); - wxMsgModel.setModelId(Integer.valueOf(param.get("id"))); - wxMsgModel.setTenantId(tenantId); - wxMsgModel = wxMsgValidationcodeModelMapper.findList(wxMsgModel).get(0); - wxMsgModel.setStatus(param.get("status").equals("1")?Integer.valueOf(param.get("status")):0); - wxMsgValidationcodeModelMapper.updateById(wxMsgModel); - }else{ - logger.info("短信模板回调SIGN校验失败"); - } +// if(checksign(tenantId,param)) { +// logger.info("短信模板回调SIGN校验成功"); +// WxMsgValidationcodeModel wxMsgModel = new WxMsgValidationcodeModel(); +// wxMsgModel.setModelId(Integer.valueOf(param.get("id"))); +// wxMsgModel.setTenantId(tenantId); +// wxMsgModel = wxMsgValidationcodeModelMapper.findList(wxMsgModel).get(0); +// wxMsgModel.setStatus(param.get("status").equals("1")?Integer.valueOf(param.get("status")):0); +// wxMsgValidationcodeModelMapper.updateById(wxMsgModel); +// }else{ +// logger.info("短信模板回调SIGN校验失败"); +// } @@ -190,10 +190,10 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { wxMsgModel.setReason(reason); wxMsgModelMapper.updateByCode(wxMsgModel); - WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); - wxMsgValidationcodeModel.setModelCode(wxMsgModel.getModelCode()); - wxMsgValidationcodeModel.setStatus(wxMsgModel.getStatus()); - wxMsgValidationcodeModelMapper.updateByCode(wxMsgValidationcodeModel); +// WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); +// wxMsgValidationcodeModel.setModelCode(wxMsgModel.getModelCode()); +// wxMsgValidationcodeModel.setStatus(wxMsgModel.getStatus()); +// wxMsgValidationcodeModelMapper.updateByCode(wxMsgValidationcodeModel); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgModelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgModelServiceImpl.java index d356ac173..b4366e107 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgModelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgModelServiceImpl.java @@ -82,10 +82,10 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { if (wxMsgModel.getId() == null) { final IdWorker idWorker = IdWorker.get(); wxMsgModel.setId(idWorker.nextId()); - if(jsonObjectResult.get("data") != null){ - String data = jsonObjectResult.get("data").toString(); - wxMsgModel.setModelId(Integer.valueOf(data)); - } +// if(jsonObjectResult.get("data") != null){ +// String data = jsonObjectResult.get("data").toString(); +// wxMsgModel.setModelId(Integer.valueOf(data)); +// } if(jsonObjectResult.get("aliyunModelCode") != null){ wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); } @@ -93,10 +93,10 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { wxMsgModel.setStatus(EnumMsgModelStatus.AUDITING.getCode());//审核中 wxMsgModelMapper.insert(wxMsgModel); } else { - if(jsonObjectResult.get("data") != null){ - String data = jsonObjectResult.get("data").toString(); - wxMsgModel.setModelId(Integer.valueOf(data)); - } +// if(jsonObjectResult.get("data") != null){ +// String data = jsonObjectResult.get("data").toString(); +// wxMsgModel.setModelId(Integer.valueOf(data)); +// } if(jsonObjectResult.get("aliyunModelCode") != null){ wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java index 4f541c26b..fa2f7ceeb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMsgValidationcodeModelServiceImpl.java @@ -41,59 +41,59 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM @Override @Transactional(rollbackFor = {Exception.class}) public void wxMsgValidationcodeModelInit(String tenantId, String signature, String emailBgImg) { - DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String nowTimestr = format.format(new Date()); - final IdWorker idWorker = IdWorker.get(); - String initSql = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `msg_type`, `model_code`) values " + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '2', '代办通知', '富茂', '{userName}提交了一个{bustype}待您审批,电脑登陆管理后台查看您的待办。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900032')," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '3', '审批通知', '富茂', '{userName}同意编号{contract}的{bustype}审批,已呈送至{toUserName},登录{page}查看审批进度。', '" + nowTimestr + "', '1', '0', null, '1', null)," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '4', '通过审批通知', '富茂', '编号{contract}的合同已通过审批,请登录{page} 跟进后续工作。', '" + nowTimestr + "', '1', '0', null, '1', null)," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '5', '驳回通知', '富茂', '编号{contract}的合同审批被驳回,请登录{page} 查看审批明细。', '" + nowTimestr + "', '1', '0', null, '1', null)," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '6', '验证码', '富茂', '{s6}(动态验证码),请在5分钟内填写', '" + nowTimestr + "', '1', '5', null, '1', 'SMS_194910023')," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '7', '账单待缴模板', '富茂', '您当期的待缴账单为{price}元,截止日期为{date} ,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900024')," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '8', '账单欠缴模板', '富茂', '截止今日您的账单共计欠缴{price}元,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194910026')," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '9', '场景投放', '富茂', '亲爱的vip,悄悄地送您一张{title},请到{app}微信小程序中使用吧!', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194920015')," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '商户分账账户新增通知商户', '富茂', '您于{time}提交了{merchant}商户的收款账户[{account}]绑定,后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '商户分账账户变更通知商户', '富茂', '您于{time}将{merchant}商户的收款账户变更为[{account}],后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '商户分账账户不使用回执', '富茂', '商管已同意[{account}]作为{merchant}商户的收款账户。后续的销售分成及营销补贴将存入此账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '商户分账账户使用回执', '富茂', '商管拒绝将[{account}]作为{merchant}商户的收款账户。如有疑问请联系商管', '" + nowTimestr + "', '1', '0', null, '1', null)," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '16', '商户分账账户删除提醒', '富茂', '{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '17', '限时活动报名成功', '富茂', '亲爱的{person},您已成功报名{party},盼望您于{time}到场参加活动,谢谢。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900027')," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '18', '限时活动参加提醒', '富茂', '亲爱的{person},{party}活动将在{time}准时开始,感谢您能够抽出宝贵时间准时到活动现场参与,谢谢。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194920016')," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '28', '会员生日券开启', '富茂', '亲爱的{userName},在您的生日到来之际,我们精心的为您准备了一份生日礼物,并在生日当天消费领取{creditScale}倍积分,赶快打开{mallName}微信小程序领取您的专属生日礼物吧!', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194915025')," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '29', '会员生日券未开启', '富茂', '亲爱的{userName},在您的生日到来之际,我们精心的为您准备了一份生日礼物,赶快打开{mallName}微信小程序领取您的专属生日礼物吧!', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900031')," + - " ( '" + idWorker.nextId() + "', '" + tenantId + "', '30', '系统发卡', '富茂', '亲爱的,您收到一张【{title}】,兑换码:{pw}。请于30天内打开微信小程序:{app}兑换!进店详询。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194920021');"; - wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql); - String initSql1 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + - "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '10', '审批通过通知', '富茂', " + - " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n
\\n
审批通过通知
\\n
编号{contract}的{bustype}已经审批通过,请登录{page}跟进后续工作
\\n
\\n
\\n\\n\\n', " + - " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; - wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql1); - String initSql2 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + - "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '待缴账单通知', '富茂', " + - " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
待缴账单通知
\\n
您当前的待缴账单为{price}元,截止日期为{date}请登录您的商户端小程序查看账单并缴费
\\n
\\n
\\n
\\n 租金账单\\n
\\n
账单类型
\\n
账单金额(元)
\\n
缴费时间
\\n
\\n {billList}\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系商管负责人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + - " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; - wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql2); - String initSql3 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + - "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '12', '审批通知', '富茂', " + - "'\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n
\\n
审批通知
\\n
{userName}同意编号{contract}的{bustype}审批,已呈送{toUserName},请登录{page}查看审批进度
\\n
\\n
\\n\\n\\n', " + - "'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; - wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql3); - String initSql4 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + - "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '欠缴账单通知', '富茂', " + - " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
欠缴账单通知
\\n
您当前的欠缴账单为{price}元,截止日期为{date}请登录您的商户端小程序查看账单并缴费
\\n
\\n
\\n
\\n 租金账单\\n
\\n
账单类型
\\n
账单金额(元)
\\n
缴费时间
\\n
逾期天数
\\n
\\n {billList}\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系商管负责人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + - "'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; - wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql4); - String initSql5 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + - " values ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '待办通知', '富茂'," + - " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
待办通知
\\n
{name}提交了一个{bustype}待您审批,电脑登录{page}查看您的待办
\\n
\\n
\\n
\\n
申请时间:
\\n
{applyTime}
\\n
\\n
\\n
申请进度:
\\n
\\n \\n {taskList}\\n
\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系申请人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + - " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; - wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql5); - String initSql6 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + - " values ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '驳回通知', '富茂', " + - " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
审批通过通知
\\n
编号{contract}的{bustype}审批被驳回,请登录{page}查看审批明细
\\n
\\n
\\n
\\n 驳回人:\\n {name}\\n
\\n
\\n 驳回原因:\\n {remark}\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系驳回人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + - " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; - wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql6); +// DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); +// String nowTimestr = format.format(new Date()); +// final IdWorker idWorker = IdWorker.get(); +// String initSql = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `msg_type`, `model_code`) values " + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '2', '代办通知', '富茂', '{userName}提交了一个{bustype}待您审批,电脑登陆管理后台查看您的待办。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900032')," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '3', '审批通知', '富茂', '{userName}同意编号{contract}的{bustype}审批,已呈送至{toUserName},登录{page}查看审批进度。', '" + nowTimestr + "', '1', '0', null, '1', null)," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '4', '通过审批通知', '富茂', '编号{contract}的合同已通过审批,请登录{page} 跟进后续工作。', '" + nowTimestr + "', '1', '0', null, '1', null)," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '5', '驳回通知', '富茂', '编号{contract}的合同审批被驳回,请登录{page} 查看审批明细。', '" + nowTimestr + "', '1', '0', null, '1', null)," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '6', '验证码', '富茂', '{s6}(动态验证码),请在5分钟内填写', '" + nowTimestr + "', '1', '5', null, '1', 'SMS_194910023')," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '7', '账单待缴模板', '富茂', '您当期的待缴账单为{price}元,截止日期为{date} ,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900024')," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '8', '账单欠缴模板', '富茂', '截止今日您的账单共计欠缴{price}元,请登录{app}小程序查看账单并交费。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194910026')," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '9', '场景投放', '富茂', '亲爱的vip,悄悄地送您一张{title},请到{app}微信小程序中使用吧!', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194920015')," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '商户分账账户新增通知商户', '富茂', '您于{time}提交了{merchant}商户的收款账户[{account}]绑定,后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '商户分账账户变更通知商户', '富茂', '您于{time}将{merchant}商户的收款账户变更为[{account}],后续销售分成及营销补贴将存入该账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '商户分账账户不使用回执', '富茂', '商管已同意[{account}]作为{merchant}商户的收款账户。后续的销售分成及营销补贴将存入此账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '商户分账账户使用回执', '富茂', '商管拒绝将[{account}]作为{merchant}商户的收款账户。如有疑问请联系商管', '" + nowTimestr + "', '1', '0', null, '1', null)," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '16', '商户分账账户删除提醒', '富茂', '{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户', '" + nowTimestr + "', '1', '0', null, '1', null)," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '17', '限时活动报名成功', '富茂', '亲爱的{person},您已成功报名{party},盼望您于{time}到场参加活动,谢谢。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900027')," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '18', '限时活动参加提醒', '富茂', '亲爱的{person},{party}活动将在{time}准时开始,感谢您能够抽出宝贵时间准时到活动现场参与,谢谢。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194920016')," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '28', '会员生日券开启', '富茂', '亲爱的{userName},在您的生日到来之际,我们精心的为您准备了一份生日礼物,并在生日当天消费领取{creditScale}倍积分,赶快打开{mallName}微信小程序领取您的专属生日礼物吧!', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194915025')," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '29', '会员生日券未开启', '富茂', '亲爱的{userName},在您的生日到来之际,我们精心的为您准备了一份生日礼物,赶快打开{mallName}微信小程序领取您的专属生日礼物吧!', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194900031')," + +// " ( '" + idWorker.nextId() + "', '" + tenantId + "', '30', '系统发卡', '富茂', '亲爱的,您收到一张【{title}】,兑换码:{pw}。请于30天内打开微信小程序:{app}兑换!进店详询。', '" + nowTimestr + "', '1', '0', null, '1', 'SMS_194920021');"; +// wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql); +// String initSql1 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + +// "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '10', '审批通过通知', '富茂', " + +// " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n
\\n
审批通过通知
\\n
编号{contract}的{bustype}已经审批通过,请登录{page}跟进后续工作
\\n
\\n
\\n\\n\\n', " + +// " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; +// wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql1); +// String initSql2 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + +// "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '11', '待缴账单通知', '富茂', " + +// " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
待缴账单通知
\\n
您当前的待缴账单为{price}元,截止日期为{date}请登录您的商户端小程序查看账单并缴费
\\n
\\n
\\n
\\n 租金账单\\n
\\n
账单类型
\\n
账单金额(元)
\\n
缴费时间
\\n
\\n {billList}\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系商管负责人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + +// " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; +// wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql2); +// String initSql3 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + +// "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '12', '审批通知', '富茂', " + +// "'\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n
\\n
审批通知
\\n
{userName}同意编号{contract}的{bustype}审批,已呈送{toUserName},请登录{page}查看审批进度
\\n
\\n
\\n\\n\\n', " + +// "'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; +// wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql3); +// String initSql4 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + +// "values ( '" + idWorker.nextId() + "', '" + tenantId + "', '13', '欠缴账单通知', '富茂', " + +// " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
欠缴账单通知
\\n
您当前的欠缴账单为{price}元,截止日期为{date}请登录您的商户端小程序查看账单并缴费
\\n
\\n
\\n
\\n 租金账单\\n
\\n
账单类型
\\n
账单金额(元)
\\n
缴费时间
\\n
逾期天数
\\n
\\n {billList}\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系商管负责人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + +// "'" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; +// wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql4); +// String initSql5 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + +// " values ( '" + idWorker.nextId() + "', '" + tenantId + "', '14', '待办通知', '富茂'," + +// " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
待办通知
\\n
{name}提交了一个{bustype}待您审批,电脑登录{page}查看您的待办
\\n
\\n
\\n
\\n
申请时间:
\\n
{applyTime}
\\n
\\n
\\n
申请进度:
\\n
\\n \\n {taskList}\\n
\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系申请人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + +// " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; +// wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql5); +// String initSql6 = "insert into `mallink`.`wx_msg_validationcode_model` ( `id`, `tenant_id`, `type`, `name`, `signature`, `content`, `createtime`, `status`, `minutes`, `model_id`, `email_bg_img`, `msg_type`)" + +// " values ( '" + idWorker.nextId() + "', '" + tenantId + "', '15', '驳回通知', '富茂', " + +// " '\\n\\n\\n\\n \\n \\n \\n \\n \\n \\n 富茂审批邮件\\n \\n \\n\\n\\n\\n
\\n
\\n \\n
\\n \\n
\\n
审批通过通知
\\n
编号{contract}的{bustype}审批被驳回,请登录{page}查看审批明细
\\n
\\n
\\n
\\n 驳回人:\\n {name}\\n
\\n
\\n 驳回原因:\\n {remark}\\n
\\n
\\n
\\n
遇到问题?
\\n
\\n 请联系驳回人:\\n {linkName}{linkPhone}\\n
\\n
\\n
\\n
\\n\\n\\n'," + +// " '" + nowTimestr + "', '1', null, '500', '" + emailBgImg + "', '2');"; +// wxMsgValidationcodeModelMapper.wxMsgValidationcodeModelInit(initSql6); } @Override @@ -113,88 +113,88 @@ public class WxMsgValidationcodeModelServiceImpl implements WxMsgValidationcodeM @Override public ResultData saveOrUpdate(WxMsgValidationcodeModel wxMsgModel) { - - - //从短信配置中查询密钥 bid 等信息 - WxMsgConfig wxMsgConfig = new WxMsgConfig(); - wxMsgConfig.setTenantId(wxMsgModel.getTenantId()); - List wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig); - if(wxMsgConfigs.size()==0)return new ResultData(Result.SUCCESS, "您还未接入短信运营商,请联系平台管理员"); - wxMsgConfig = wxMsgConfigs.get(0); - - String secret = wxMsgConfig.getSecret(); - String bid = wxMsgConfig.getBid(); - - String signature = wxMsgModel.getSignature(); - String content = wxMsgModel.getContent(); - //查看用户最新数据是否存在 - List wxMsgModels = wxMsgValidationcodeModelMapper.findList(wxMsgModel); - if (wxMsgModel.getId() == null && wxMsgModels.size() == 1) { - return new ResultData(ErrorCode.MSG_TEMPLATE_REPEAT.getCode(), "您添加的短信模板已存在"); - } - - if (wxMsgModel.getId() != null && wxMsgModels.size() == 1) { - //ID相同 内容相同 不发送短信 不做修改 - WxMsgValidationcodeModel wxmsgmodel = wxMsgModels.get(0); - if(wxmsgmodel.getContent().equals(wxMsgModel.getContent()) && wxmsgmodel.getSignature().equals(wxMsgModel.getSignature())) { - return new ResultData(Result.SUCCESS, "修改成功"); - } - } - - String result = SMSFactory.addTemplate(wxMsgConfig, signature, content,EnumVerifyCode.YES.getCode().toString(), - wxMsgModel.getName(),1,wxMsgModel.getName()); - - JSONObject jsonObjectResult = JSONObject.parseObject(result); - String ret = jsonObjectResult.get("ret").toString(); - if (ret.equals(EnumMsgModelStatus.SUCCESS.getCode().toString())) { - if (wxMsgModel.getId() == null) { - final IdWorker idWorker = IdWorker.get(); - wxMsgModel.setId(idWorker.nextId()); - if(jsonObjectResult.get("data") != null){ - String data = jsonObjectResult.get("data").toString(); - wxMsgModel.setModelId(Integer.valueOf(data)); - } - if(jsonObjectResult.get("aliyunModelCode") != null){ - wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); - } - wxMsgModel.setCreatetime(new Date()); - wxMsgModel.setStatus(2);//审核中 - wxMsgValidationcodeModelMapper.insert(wxMsgModel); - } else { - if(jsonObjectResult.get("data") != null){ - String data = jsonObjectResult.get("data").toString(); - wxMsgModel.setModelId(Integer.valueOf(data)); - } - if(jsonObjectResult.get("aliyunModelCode") != null){ - wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); - } - wxMsgModel.setStatus(2);//审核中 - wxMsgValidationcodeModelMapper.updateById(wxMsgModel); - } - return new ResultData(Result.SUCCESS, "创建模板成功"); - } else if (ret.equals(EnumMsgModelStatus.REPEAT.getCode().toString())) { - if (wxMsgModel.getId() == null) { - final IdWorker idWorker = IdWorker.get(); - wxMsgModel.setId(idWorker.nextId()); - wxMsgModel.setCreatetime(new Date()); - wxMsgModel.setStatus(1); - wxMsgValidationcodeModelMapper.insert(wxMsgModel); - } else { - wxMsgValidationcodeModelMapper.updateById(wxMsgModel); - } - } else if (ret.equals(EnumMsgModelStatus.SINATURE_CONTENT_ERROR.getCode().toString())) { - return new ResultData(ErrorCode.MSG_SIGNATURE_CONTENT_ERROR.getCode(), "短信签名或内容错误"); - } else if (ret.equals(EnumMsgModelStatus.NOT_FOUND.getCode().toString())) { - return new ResultData(ErrorCode.MSG_TEMPLATE_NOT_FOUND.getCode(), "短信模板不存在"); - } else if (ret.equals(EnumMsgModelStatus.PARAMETERS_ERROR.getCode().toString())) { - return new ResultData(ErrorCode.MSG_REQUEST_PARAMS_ERROR.getCode(), "参数错误"); - } else if (ret.equals(EnumMsgModelStatus.MSG_SEND_FAIL.getCode().toString())) { - return new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(), "发送短信失败"); - } else if (ret.equals(EnumMsgModelStatus.INTERFACE_ERROR.getCode().toString())) { - return new ResultData(ErrorCode.MSG_METHOD_REQUEST_ERROR.getCode(), "接口请求错误"); - } - return new ResultData(ErrorCode.MSG_TEMPLATE_CREATE_ERROR.getCode(), "创建模板失败"); - +// +// +// //从短信配置中查询密钥 bid 等信息 +// WxMsgConfig wxMsgConfig = new WxMsgConfig(); +// wxMsgConfig.setTenantId(wxMsgModel.getTenantId()); +// List wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig); +// if(wxMsgConfigs.size()==0)return new ResultData(Result.SUCCESS, "您还未接入短信运营商,请联系平台管理员"); +// wxMsgConfig = wxMsgConfigs.get(0); +// +// String secret = wxMsgConfig.getSecret(); +// String bid = wxMsgConfig.getBid(); +// +// String signature = wxMsgModel.getSignature(); +// String content = wxMsgModel.getContent(); +// //查看用户最新数据是否存在 +// List wxMsgModels = wxMsgValidationcodeModelMapper.findList(wxMsgModel); +// if (wxMsgModel.getId() == null && wxMsgModels.size() == 1) { +// return new ResultData(ErrorCode.MSG_TEMPLATE_REPEAT.getCode(), "您添加的短信模板已存在"); +// } +// +// if (wxMsgModel.getId() != null && wxMsgModels.size() == 1) { +// //ID相同 内容相同 不发送短信 不做修改 +// WxMsgValidationcodeModel wxmsgmodel = wxMsgModels.get(0); +// if(wxmsgmodel.getContent().equals(wxMsgModel.getContent()) && wxmsgmodel.getSignature().equals(wxMsgModel.getSignature())) { +// return new ResultData(Result.SUCCESS, "修改成功"); +// } +// } +// +// String result = SMSFactory.addTemplate(wxMsgConfig, signature, content,EnumVerifyCode.YES.getCode().toString(), +// wxMsgModel.getName(),1,wxMsgModel.getName()); +// +// JSONObject jsonObjectResult = JSONObject.parseObject(result); +// String ret = jsonObjectResult.get("ret").toString(); +// if (ret.equals(EnumMsgModelStatus.SUCCESS.getCode().toString())) { +// if (wxMsgModel.getId() == null) { +// final IdWorker idWorker = IdWorker.get(); +// wxMsgModel.setId(idWorker.nextId()); +// if(jsonObjectResult.get("data") != null){ +// String data = jsonObjectResult.get("data").toString(); +// wxMsgModel.setModelId(Integer.valueOf(data)); +// } +// if(jsonObjectResult.get("aliyunModelCode") != null){ +// wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); +// } +// wxMsgModel.setCreatetime(new Date()); +// wxMsgModel.setStatus(2);//审核中 +// wxMsgValidationcodeModelMapper.insert(wxMsgModel); +// } else { +// if(jsonObjectResult.get("data") != null){ +// String data = jsonObjectResult.get("data").toString(); +// wxMsgModel.setModelId(Integer.valueOf(data)); +// } +// if(jsonObjectResult.get("aliyunModelCode") != null){ +// wxMsgModel.setModelCode(jsonObjectResult.get("aliyunModelCode").toString()); +// } +// wxMsgModel.setStatus(2);//审核中 +// wxMsgValidationcodeModelMapper.updateById(wxMsgModel); +// } +// return new ResultData(Result.SUCCESS, "创建模板成功"); +// } else if (ret.equals(EnumMsgModelStatus.REPEAT.getCode().toString())) { +// if (wxMsgModel.getId() == null) { +// final IdWorker idWorker = IdWorker.get(); +// wxMsgModel.setId(idWorker.nextId()); +// wxMsgModel.setCreatetime(new Date()); +// wxMsgModel.setStatus(1); +// wxMsgValidationcodeModelMapper.insert(wxMsgModel); +// } else { +// wxMsgValidationcodeModelMapper.updateById(wxMsgModel); +// } +// } else if (ret.equals(EnumMsgModelStatus.SINATURE_CONTENT_ERROR.getCode().toString())) { +// return new ResultData(ErrorCode.MSG_SIGNATURE_CONTENT_ERROR.getCode(), "短信签名或内容错误"); +// } else if (ret.equals(EnumMsgModelStatus.NOT_FOUND.getCode().toString())) { +// return new ResultData(ErrorCode.MSG_TEMPLATE_NOT_FOUND.getCode(), "短信模板不存在"); +// } else if (ret.equals(EnumMsgModelStatus.PARAMETERS_ERROR.getCode().toString())) { +// return new ResultData(ErrorCode.MSG_REQUEST_PARAMS_ERROR.getCode(), "参数错误"); +// } else if (ret.equals(EnumMsgModelStatus.MSG_SEND_FAIL.getCode().toString())) { +// return new ResultData(ErrorCode.MSG_SEND_ERROR.getCode(), "发送短信失败"); +// } else if (ret.equals(EnumMsgModelStatus.INTERFACE_ERROR.getCode().toString())) { +// return new ResultData(ErrorCode.MSG_METHOD_REQUEST_ERROR.getCode(), "接口请求错误"); +// } +// return new ResultData(ErrorCode.MSG_TEMPLATE_CREATE_ERROR.getCode(), "创建模板失败"); + return null; } @Override 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 feae58388..04099dabd 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -3046,4 +3046,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { return wxRentContractMapper.findToEndContractList(record); } + @Override + public List findToOutDateContracts(TenantEntity tenantEntity) { + WxRentContract wrc = new WxRentContract(); + wrc.setStatus(EnumRentContractStatus.PAING.getCode()); + wrc.setOutDateNofity(1); + return wxRentContractMapper.findList(wrc); + } + } diff --git a/mallinkService/src/main/java/com/iformall/service/msg/impl/SendCallBackSmsServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/msg/impl/SendCallBackSmsServiceImpl.java index e0ba00749..6c7ee9b16 100644 --- a/mallinkService/src/main/java/com/iformall/service/msg/impl/SendCallBackSmsServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/msg/impl/SendCallBackSmsServiceImpl.java @@ -80,10 +80,6 @@ public class SendCallBackSmsServiceImpl implements MsgSendService { String signature = record.getSignature(); String msg = record.getMsg(); WxMsgModel wxMsgModel = wxMsgModelMapper.selectById(record.getModelId()); - Integer modelId = null; - if (wxMsgModel != null) { - modelId = wxMsgModel.getModelId(); - } /* // 检查是否超限 WxMsgLimit msgLimit = new WxMsgLimit(); @@ -101,8 +97,7 @@ public class SendCallBackSmsServiceImpl implements MsgSendService { }catch(Exception e){} String result = SMSFactory.sendSms(wxMsgConfig, phone, signature, msg, - EnumVerifyCode.NO.getCode().toString(), modelId, - null,wxMsgModel.getModelCode(),outId); + EnumVerifyCode.NO.getCode().toString(),null,wxMsgModel.getModelCode(),outId); JSONObject jsonObjectResult = JSONObject.parseObject(result); String ret = jsonObjectResult.get("ret").toString(); diff --git a/mallinkService/src/main/java/com/iformall/service/msg/impl/SendEmailServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/msg/impl/SendEmailServiceImpl.java index b105d18d0..a19d1e21b 100644 --- a/mallinkService/src/main/java/com/iformall/service/msg/impl/SendEmailServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/msg/impl/SendEmailServiceImpl.java @@ -50,9 +50,8 @@ public class SendEmailServiceImpl implements MsgSendService { //根据模板替换动态内容 if(mailMsg.getModelId() != null){ WxMsgValidationcodeModel msgModel = new WxMsgValidationcodeModel(); - msgModel.updateTenantInfo(tenantEntity); msgModel.setType(mailMsg.getModelType()); - msgModel.setModelId(mailMsg.getModelId()); + msgModel.setModelCode(String.valueOf(mailMsg.getModelId())); msgModel.setOpen(EnumMsgOpen.OPEN.getCode()); List modelList = wxMsgValidationcodeModelMapper.findList(msgModel); if(CollectionUtils.isEmpty(modelList)){ diff --git a/mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java index 569769424..a936a1741 100644 --- a/mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java @@ -3,6 +3,7 @@ package com.iformall.service.msg.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; import com.iformall.common.ErrorCode; import com.iformall.common.IdWorker; import com.iformall.domain.po.*; @@ -15,6 +16,7 @@ import com.iformall.exception.MallinkException; import com.iformall.mapper.WxMsgConfigMapper; import com.iformall.mapper.WxMsgValidationcodeMapper; import com.iformall.mapper.WxMsgValidationcodeModelMapper; +import com.iformall.mapper.WxMsgValidationcodeModelTenantMapper; import com.iformall.service.msg.MsgSendService; import com.iformall.service.WxMsgValidationcodeService; import com.iformall.sms.SMSFactory; @@ -43,6 +45,8 @@ public class SendSmsServiceImpl implements MsgSendService { private WxMsgValidationcodeMapper wxMsgValidationcodeMapper; @Autowired private WxMsgValidationcodeService wxMsgValidationcodeService; + @Autowired + private WxMsgValidationcodeModelTenantMapper wxMsgValidationcodeModelTenantMapper; @Override public void send(BaseMsg baseMsg) throws Exception{ @@ -56,7 +60,6 @@ public class SendSmsServiceImpl implements MsgSendService { wxMsgValidationcode.setType(record.getModelType()); WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); - wxMsgValidationcodeModel.updateTenantInfo(wxMsgValidationcode); wxMsgValidationcodeModel.setType(record.getModelType()); wxMsgValidationcodeModel.setOpen(EnumMsgOpen.OPEN.getCode()); List modelList = wxMsgValidationcodeModelMapper.findList(wxMsgValidationcodeModel); @@ -66,18 +69,6 @@ public class SendSmsServiceImpl implements MsgSendService { wxMsgValidationcodeModel = wxMsgValidationcodeModelMapper.findList(wxMsgValidationcodeModel).get(0); - wxMsgValidationcode.setSignature(wxMsgValidationcodeModel.getSignature()); - //替换短信内容 - String msg = wxMsgValidationcodeModel.getContent(); - for (Map.Entry entry : record.getDynamicContentMap().entrySet()) { - msg = msg.replace("{"+entry.getKey()+"}", entry.getValue()); - } - - wxMsgValidationcode.setMsg(msg); - if(record.getDynamicContentMap() !=null) { - wxMsgValidationcode.setCode(record.getDynamicContentMap().get("s6")); - } - //3、从短信配置中查询密钥 bid 等信息 WxMsgConfig wxMsgConfig = new WxMsgConfig(); wxMsgConfig.updateTenantInfo(wxMsgValidationcode); @@ -89,19 +80,50 @@ public class SendSmsServiceImpl implements MsgSendService { if (wxMsgConfig.getRemains() <= 0L) { throw new MallinkException(ErrorCode.MSG_CONFIG_ACCOUNT); } + + //查询是否有自己的配置 + WxMsgValidationcodeModelTenant wxMsgValidationcodeModelTenant = new WxMsgValidationcodeModelTenant(); + wxMsgValidationcodeModelTenant.updateTenantInfo(wxMsgValidationcode); + wxMsgValidationcodeModelTenant.setModelId(wxMsgValidationcodeModel.getId()); + wxMsgValidationcodeModelTenant.setSmsChannel(wxMsgConfig.getSmsChannel()); + WxMsgValidationcodeModelTenant _vmt = wxMsgValidationcodeModelTenantMapper.findByModelId(wxMsgValidationcodeModelTenant); + if (null != _vmt) { + if (!StringUtils.isBlank(_vmt.getSignature())) { + wxMsgValidationcodeModel.setSignature(_vmt.getSignature()); + } + if (!StringUtils.isBlank(_vmt.getModelCode())) { + wxMsgValidationcodeModel.setModelCode(_vmt.getModelCode()); + } + if (!StringUtils.isBlank(_vmt.getContent())) { + wxMsgValidationcodeModel.setContent(_vmt.getContent()); + } + } + + wxMsgValidationcode.setSignature(wxMsgValidationcodeModel.getSignature()); + //替换短信内容 + String msg = wxMsgValidationcodeModel.getContent(); + for (Map.Entry entry : record.getDynamicContentMap().entrySet()) { + msg = msg.replace("{"+entry.getKey()+"}", entry.getValue()); + } + + wxMsgValidationcode.setMsg(msg); + if(record.getDynamicContentMap() !=null) { + wxMsgValidationcode.setCode(record.getDynamicContentMap().get("s6")); + } String secret = wxMsgConfig.getSecret(); String bid = wxMsgConfig.getBid(); String publickey = wxMsgConfig.getPublickey(); String phone = record.getReceiver(); int phoneLength = phone.split(",").length; - String signature = wxMsgValidationcodeModel.getSignature(); - + + + //如果有自己配置的model + String notifyUrl = wxMsgConfig.getNotifyurl(); - Integer modelId = wxMsgValidationcodeModel.getModelId(); String id = record.getDynamicContentMap().get("id"); - String result = SMSFactory.sendSms(wxMsgConfig, phone, signature, msg, - EnumVerifyCode.YES.getCode().toString(), modelId,JSON.toJSONString(record.getDynamicContentMap()), + String result = SMSFactory.sendSms(wxMsgConfig, phone, wxMsgValidationcodeModel.getSignature(), msg, + EnumVerifyCode.YES.getCode().toString(),JSON.toJSONString(record.getDynamicContentMap()), wxMsgValidationcodeModel.getModelCode(),id); JSONObject jsonObjectResult = JSONObject.parseObject(result); String ret = jsonObjectResult.get("ret").toString(); diff --git a/mallinkService/src/main/java/com/iformall/sms/SMSExcutor.java b/mallinkService/src/main/java/com/iformall/sms/SMSExcutor.java index 822a7c814..928d94cf2 100644 --- a/mallinkService/src/main/java/com/iformall/sms/SMSExcutor.java +++ b/mallinkService/src/main/java/com/iformall/sms/SMSExcutor.java @@ -5,7 +5,7 @@ import java.util.Date; public interface SMSExcutor { String sendMsg(String secret, String bid, String publickey,String phone, String signature, - String msg, String notifyUrl, String verifysms, Integer modelId,String templateParam, + String msg, String notifyUrl, String verifysms, String templateParam, String templateCode, String outId); String addTemplate(String secret, String bid, String publickey, String signature, String content, diff --git a/mallinkService/src/main/java/com/iformall/sms/SMSFactory.java b/mallinkService/src/main/java/com/iformall/sms/SMSFactory.java index 7da01499d..bd1b75903 100644 --- a/mallinkService/src/main/java/com/iformall/sms/SMSFactory.java +++ b/mallinkService/src/main/java/com/iformall/sms/SMSFactory.java @@ -50,11 +50,11 @@ public class SMSFactory { } public static String sendSms(WxMsgConfig wxMsgConfig,String phone, String signature, String msg, - String verifysms, Integer modelId, String templateParam, + String verifysms, String templateParam, String templateCode, String outId) { return getSendExcutor(wxMsgConfig).sendMsg(wxMsgConfig.getSecret(), wxMsgConfig.getBid(), wxMsgConfig.getPublickey(), phone, signature, msg, wxMsgConfig.getNotifyurl(), - verifysms, modelId,templateParam,templateCode,outId); + verifysms, templateParam,templateCode,outId); } public static String addTemplate(WxMsgConfig wxMsgConfig, String signature, String content, diff --git a/mallinkService/src/main/java/com/iformall/sms/aliyun/AliyunSMS.java b/mallinkService/src/main/java/com/iformall/sms/aliyun/AliyunSMS.java index 6a1f2a8ac..f290c6edc 100644 --- a/mallinkService/src/main/java/com/iformall/sms/aliyun/AliyunSMS.java +++ b/mallinkService/src/main/java/com/iformall/sms/aliyun/AliyunSMS.java @@ -34,7 +34,7 @@ public class AliyunSMS implements SMSExcutor { } @Override - public String sendMsg(String secret, String bid, String publickey, String phone, String signature, String msg, String notifyUrl, String verifysms, Integer modelId, String templateParam, String templateCode, String outId) { + public String sendMsg(String secret, String bid, String publickey, String phone, String signature, String msg, String notifyUrl, String verifysms, String templateParam, String templateCode, String outId) { SMSResult SMSResult = new SMSResult(); SMS sms = new SMS(); sms.setPhoneNumbers(phone); diff --git a/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideUtil.java b/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideUtil.java index 945c662fa..7341a163a 100644 --- a/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideUtil.java +++ b/mallinkService/src/main/java/com/iformall/sms/wiwide/WiwideUtil.java @@ -23,9 +23,9 @@ public class WiwideUtil implements SMSExcutor { @Override - public String sendMsg(String secret, String bid, String publickey, String phone, String signature, String msg, String notifyUrl, String verifysms, Integer modelId, String templateParam, String templateCode, String outId) { + public String sendMsg(String secret, String bid, String publickey, String phone, String signature, String msg, String notifyUrl, String verifysms, String templateParam, String templateCode, String outId) { return sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, - verifysms, modelId); + verifysms, Integer.parseInt(templateCode)); } @Override diff --git a/mallinkService/src/main/resources/mapper/WxMsgModelMapper.xml b/mallinkService/src/main/resources/mapper/WxMsgModelMapper.xml index 8fec430d3..cd7a952c1 100644 --- a/mallinkService/src/main/resources/mapper/WxMsgModelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMsgModelMapper.xml @@ -11,14 +11,13 @@ - - `id`,`tenant_id`,`parent_tenant_id`,`name`,`signature`,`content`,`createtime`,`status`,`reason`,`model_id`,`template_type`,`model_code` + `id`,`tenant_id`,`parent_tenant_id`,`name`,`signature`,`content`,`createtime`,`status`,`reason`,`template_type`,`model_code` @@ -54,9 +53,6 @@ and `status` = #{status} - - and `model_id` = #{modelId} - and `template_type` = #{templateType} @@ -88,23 +84,6 @@ and `status` = #{status} - - update wx_msg_model set status=#{status},reason=#{reason} where `model_code` = #{modelCode} diff --git a/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml b/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml index 6e2c6c347..5dc092546 100644 --- a/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelMapper.xml @@ -9,20 +9,16 @@ - - - - - `id`,`name`,`signature`,`content`,`createtime`,`status`,`minutes`,`model_id`,`model_code`,`type`,`tenant_id`,`parent_tenant_id`,email_bg_img,`open`,msg_type,role_type + `id`,`name`,`signature`,`content`,`createtime`,`status`,`minutes`,`model_code`,`type`,email_bg_img,`open`,msg_type,role_type @@ -34,15 +30,8 @@ and `createtime` = #{createtime} and `status` = #{status} and `minutes` = #{minutes} - and `model_id` = #{modelId} and `model_code` = #{modelCode} and `type` = #{type} - - and `tenant_id` = #{tenantId} - - - and `parent_tenant_id` = #{parentTenantId} - and `open` = #{open} and `msg_type` = #{msgType} and `role_type` = #{roleType} diff --git a/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelTenantMapper.xml b/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelTenantMapper.xml new file mode 100644 index 000000000..a89a11a8e --- /dev/null +++ b/mallinkService/src/main/resources/mapper/WxMsgValidationcodeModelTenantMapper.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + `id`,`tenant_id`,`parent_tenant_id`,`model_id`,`signature`,`content`,`model_code`,`sms_channel` + + + + where 1 = 1 + and `id` = #{id} + and `tenant_id` = #{tenantId} + and `model_id` = #{modelId} + and `signature` = #{signature} + and `content` = #{content} + and `model_code` = #{modelCode} + and `sms_channel` = #{smsChannel} + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + + + diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 5f5a57c9c..1e26d38c6 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -124,6 +124,9 @@ + + + @@ -141,7 +144,7 @@ `business_type`,`rent_info`, `file_names`,price_unit,rent_price,other_rent_price_info,`subject_name`,rent_start_type, `rent_input_way`,`adjust_ratio_way`,`operation_type`,late_pay_ratio,late_pay_day,bus_discount_ratio,bus_discount_time, bussiness_management_fee,bussiness_management_fee_ratio_way,bussiness_management_fee_ratio, - operating_management_fee,operating_management_fee_ratio_way,operating_management_fee_ratio + operating_management_fee,operating_management_fee_ratio_way,operating_management_fee_ratio,out_date_notify_days,out_date_notify_phone @@ -153,6 +156,7 @@ and `price` = #{price} and `rental_start_date` = #{rentalStartDate} and `rental_end_date` = #{rentalEndDate} + and (out_date_notify_phone is not null and out_date_notify_phone != '' and DATE_SUB(rental_end_date, INTERVAL out_date_notify_days DAY) <= NOW()) and `sign_date` = #{signDate} and `receive_period` = #{receivePeriod} @@ -510,7 +514,7 @@ rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type, rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,rc.bus_discount_ratio,rc.bus_discount_time, rc.bussiness_management_fee,rc.bussiness_management_fee_ratio_way,rc.bussiness_management_fee_ratio, - rc.operating_management_fee,rc.operating_management_fee_ratio_way,rc.operating_management_fee_ratio + rc.operating_management_fee,rc.operating_management_fee_ratio_way,rc.operating_management_fee_ratio,rc.out_date_notify_days,rc.out_date_notify_phone from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0 left join wx_merchant m on ms.merchant_id=m.id @@ -537,7 +541,7 @@ rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type, rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,rc.bus_discount_ratio,rc.bus_discount_time, rc.bussiness_management_fee,rc.bussiness_management_fee_ratio_way,rc.bussiness_management_fee_ratio, - rc.operating_management_fee,rc.operating_management_fee_ratio_way,rc.operating_management_fee_ratio + rc.operating_management_fee,rc.operating_management_fee_ratio_way,rc.operating_management_fee_ratio,rc.out_date_notify_days,rc.out_date_notify_phone from wx_rent_contract rc where rc.is_del = 0 diff --git a/mallinkTTAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java b/mallinkTTAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java index c2185a0dc..398c02df9 100644 --- a/mallinkTTAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java +++ b/mallinkTTAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java @@ -578,7 +578,7 @@ public class WxProjectConfigController extends BaseController { List wxQuestionList = wxQuestionService.findList(wxQuestion); map.put("wxQuestionList",wxQuestionList); WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); - wxMsgValidationcodeModel.setTenantId(wxMall.getTenantId()); + //wxMsgValidationcodeModel.setTenantId(wxMall.getTenantId()); List wxMsgValidationcodeModelList = wxMsgValidationcodeModelService.findList(wxMsgValidationcodeModel); map.put("wxMsgValidationcodeModelList",wxMsgValidationcodeModelList); diff --git a/mallinkTTAdmin/src/main/java/com/iformall/controller/msg/WxMsgValidationcodeModelController.java b/mallinkTTAdmin/src/main/java/com/iformall/controller/msg/WxMsgValidationcodeModelController.java index 302b337b4..cd9a0814f 100644 --- a/mallinkTTAdmin/src/main/java/com/iformall/controller/msg/WxMsgValidationcodeModelController.java +++ b/mallinkTTAdmin/src/main/java/com/iformall/controller/msg/WxMsgValidationcodeModelController.java @@ -24,44 +24,44 @@ public class WxMsgValidationcodeModelController extends BaseController { @Autowired private WxMsgValidationcodeModelService wxMsgValidationcodeModelService; - @ApiOperation("消息模板-列表") - @GetMapping("list") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), - @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) - @SystemControllerLog(description = "消息验证模板-列表") - public ResultData list(@ModelAttribute WxMsgValidationcodeModel wxMsgValidationcodeModel, Integer pageNum, Integer pageSize) { - logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::list"); - if (null == wxMsgValidationcodeModel) wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); - wxMsgValidationcodeModel.updateTenantInfo(getTenantInfo()); - PageInfo page = wxMsgValidationcodeModelService.listAsPage(wxMsgValidationcodeModel, pageNum, pageSize); - page.getList().forEach(m -> { - for (EnumMsgModelReplace e : EnumMsgModelReplace.values()) { - m.setContent(m.getContent().replace(e.getCode(),e.getMessage())); - } - }); - return new ResultData(page); - } - - @ApiOperation("消息模板-添加") - @PostMapping("add") - @SystemControllerLog(description = "消息验证模板-添加") - public ResultData add(@RequestBody WxMsgValidationcodeModel wxMsgValidationcodeModel) { - logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::add"); - //Assert.notNull(wxMsgValidationcodeModel.getName(), "角色名不能为空"); - //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); - wxMsgValidationcodeModel.updateTenantInfo(getTenantInfo()); - return wxMsgValidationcodeModelService.saveOrUpdate(wxMsgValidationcodeModel); - } - - @ApiOperation("消息模板-更新") - @PostMapping("update") - @SystemControllerLog(description = "消息验证模板-更新") - public ResultData update(@RequestBody WxMsgValidationcodeModel wxMsgValidationcodeModel) { - logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::update"); - wxMsgValidationcodeModelService.saveOrUpdate(wxMsgValidationcodeModel); - return new ResultData(); - } +// @ApiOperation("消息模板-列表") +// @GetMapping("list") +// @ApiImplicitParams({ +// @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), +// @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) +// @SystemControllerLog(description = "消息验证模板-列表") +// public ResultData list(@ModelAttribute WxMsgValidationcodeModel wxMsgValidationcodeModel, Integer pageNum, Integer pageSize) { +// logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::list"); +// if (null == wxMsgValidationcodeModel) wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); +// wxMsgValidationcodeModel.updateTenantInfo(getTenantInfo()); +// PageInfo page = wxMsgValidationcodeModelService.listAsPage(wxMsgValidationcodeModel, pageNum, pageSize); +// page.getList().forEach(m -> { +// for (EnumMsgModelReplace e : EnumMsgModelReplace.values()) { +// m.setContent(m.getContent().replace(e.getCode(),e.getMessage())); +// } +// }); +// return new ResultData(page); +// } +// +// @ApiOperation("消息模板-添加") +// @PostMapping("add") +// @SystemControllerLog(description = "消息验证模板-添加") +// public ResultData add(@RequestBody WxMsgValidationcodeModel wxMsgValidationcodeModel) { +// logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::add"); +// //Assert.notNull(wxMsgValidationcodeModel.getName(), "角色名不能为空"); +// //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); +// wxMsgValidationcodeModel.updateTenantInfo(getTenantInfo()); +// return wxMsgValidationcodeModelService.saveOrUpdate(wxMsgValidationcodeModel); +// } +// +// @ApiOperation("消息模板-更新") +// @PostMapping("update") +// @SystemControllerLog(description = "消息验证模板-更新") +// public ResultData update(@RequestBody WxMsgValidationcodeModel wxMsgValidationcodeModel) { +// logger.debug("[" + getIpAddr() + "] WxMsgValidationcodeModelController::update"); +// wxMsgValidationcodeModelService.saveOrUpdate(wxMsgValidationcodeModel); +// return new ResultData(); +// } @ApiOperation("消息模板-打开/关闭发送") @PostMapping("updateOpen")