| @@ -70,5 +70,9 @@ ALTER TABLE wx_msg_validationcode_model DROP COLUMN model_id; | |||||
| ALTER TABLE wx_msg_model DROP COLUMN model_id; | ALTER TABLE wx_msg_model DROP COLUMN model_id; | ||||
| ALTER TABLE `mallink`.`wx_property_contract` | |||||
| ADD COLUMN `out_date_notify_days` INT(3) NOT NULL DEFAULT 0 COMMENT '到期提醒提前天数' ; | |||||
| ALTER TABLE `mallink`.`wx_property_contract` | |||||
| ADD COLUMN `out_date_notify_phone` varchar(30) COMMENT '到期提醒手机号' ; | |||||
| @@ -166,5 +166,35 @@ public class ContractSchedule { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * 凌晨5分,定时过期提醒物业合同到期 | |||||
| */ | |||||
| @Async | |||||
| @Scheduled(cron = "0 5 0 * * ?") | |||||
| public void notifyPropertyContractOutDate() { | |||||
| List<WxMall> wxMalls = wxMallMapper.findList(null); | |||||
| for (WxMall wxMall : wxMalls) { | |||||
| //物业合同 | |||||
| List<WxPropertyContract> contractList = wxPropertyContractService.findToOutDateContracts(wxMall); | |||||
| for (WxPropertyContract rent:contractList) { | |||||
| try { | |||||
| WxMsgRecord msgRecord = new WxMsgRecord(); | |||||
| msgRecord.setMsgType(EnumMsgRecordType.SMS.getCode()); | |||||
| msgRecord.updateTenantInfo(wxMall); | |||||
| msgRecord.setReceiver(rent.getOutDateNotifyPhone()); | |||||
| msgRecord.setModelType(32); | |||||
| Map<String,String> dynamicContentMap = new HashMap<String,String>(); | |||||
| 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); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -196,6 +196,16 @@ public class WxPropertyContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "是否有工作流 1:有 0:无", name = "flowHas") | @io.swagger.annotations.ApiModelProperty(value = "是否有工作流 1:有 0:无", name = "flowHas") | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Integer flowHas; | private Integer flowHas; | ||||
| @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 Integer getAdjustPeriod() { | // public Integer getAdjustPeriod() { | ||||
| @@ -9,6 +9,7 @@ import com.iformall.domain.po.WxMall; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| @@ -99,5 +100,8 @@ public interface WxPropertyContractService { | |||||
| void setEndContractTime(WxPropertyContract proertyContract); | void setEndContractTime(WxPropertyContract proertyContract); | ||||
| List<WxPropertyContract> findToEndContractList(WxPropertyContract record); | List<WxPropertyContract> findToEndContractList(WxPropertyContract record); | ||||
| //查询还有多少天到期的合同 | |||||
| List<WxPropertyContract> findToOutDateContracts(TenantEntity tenantEntity); | |||||
| } | } | ||||
| @@ -11,6 +11,7 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.BillTimeVo; | import com.iformall.domain.vo.BillTimeVo; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| @@ -1202,6 +1203,14 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| public List<WxPropertyContract> findToEndContractList(WxPropertyContract record) { | public List<WxPropertyContract> findToEndContractList(WxPropertyContract record) { | ||||
| return wxPropertyContractMapper.findToEndContractList(record); | return wxPropertyContractMapper.findToEndContractList(record); | ||||
| } | } | ||||
| @Override | |||||
| public List<WxPropertyContract> findToOutDateContracts(TenantEntity tenantEntity) { | |||||
| WxPropertyContract wrc = new WxPropertyContract(); | |||||
| wrc.setStatus(EnumRentContractStatus.PAING.getCode()); | |||||
| wrc.setOutDateNofity(1); | |||||
| return wxPropertyContractMapper.findList(wrc); | |||||
| } | |||||
| } | } | ||||
| @@ -50,6 +50,9 @@ | |||||
| <result column="late_pay_day" property="latePayDay"/> | <result column="late_pay_day" property="latePayDay"/> | ||||
| <result column="end_contract_time" jdbcType="TIMESTAMP" property="endContractTime"/> | <result column="end_contract_time" jdbcType="TIMESTAMP" property="endContractTime"/> | ||||
| <result column="out_date_notify_days" jdbcType="INTEGER" property="outDateNotifyDays"/> | |||||
| <result column="out_date_notify_phone" jdbcType="VARCHAR" property="outDateNotifyPhone"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| @@ -59,7 +62,7 @@ | |||||
| `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`, | `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`, | ||||
| `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`, | `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`, | ||||
| `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`,fixed_price, | `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`,fixed_price, | ||||
| `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day,end_contract_time | |||||
| `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day,end_contract_time,out_date_notify_days,out_date_notify_phone | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -69,6 +72,7 @@ | |||||
| <if test=" null != price ">and `price` = #{price}</if> | <if test=" null != price ">and `price` = #{price}</if> | ||||
| <if test=" null != rentalStartDate ">and `rental_start_date` = #{rentalStartDate}</if> | <if test=" null != rentalStartDate ">and `rental_start_date` = #{rentalStartDate}</if> | ||||
| <if test=" null != rentalEndDate ">and `rental_end_date` = #{rentalEndDate}</if> | <if test=" null != rentalEndDate ">and `rental_end_date` = #{rentalEndDate}</if> | ||||
| <if test=" null != outDateNofity ">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())</if> | |||||
| <if test=" null != signDate ">and `sign_date` = #{signDate}</if> | <if test=" null != signDate ">and `sign_date` = #{signDate}</if> | ||||
| <if test=" null != receivePeriod ">and `receive_period` = #{receivePeriod}</if> | <if test=" null != receivePeriod ">and `receive_period` = #{receivePeriod}</if> | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||