lin 3 лет назад
Родитель
Сommit
49d61595e2
3 измененных файлов: 15 добавлений и 2 удалений
  1. +13
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java
  2. +1
    -1
      mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml
  3. +1
    -1
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml

+ 13
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java Просмотреть файл

@@ -13,6 +13,8 @@ import com.iformall.mapper.WxMallMapper;
import com.iformall.mq.MqBaseProducer;
import com.iformall.service.WxPropertyContractService;
import com.iformall.service.WxRentContractService;
import com.iformall.utils.DateUtils;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -21,6 +23,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -144,10 +147,15 @@ public class ContractSchedule {
@Scheduled(cron = "0 5 0 * * ?")
public void notifyRentContractOutDate() {
List<WxMall> wxMalls = wxMallMapper.findList(null);
Date date = new Date();
for (WxMall wxMall : wxMalls) {
//物业合同
List<WxRentContract> contractList = wxRentContractService.findToOutDateContracts(wxMall);
for (WxRentContract rent:contractList) {
Date endDate = DateUtils.stringToDate(DateUtils.getTimeBefore(rent.getOutDateNotifyDays(),rent.getRentalEndDate()), DateUtils.DATE_TIME_PATTERN);
if (endDate.after(date)) {
continue;
}
try {
WxMsgRecord msgRecord = new WxMsgRecord();
msgRecord.setMsgType(EnumMsgRecordType.SMS.getCode());
@@ -174,10 +182,15 @@ public class ContractSchedule {
@Scheduled(cron = "0 5 0 * * ?")
public void notifyPropertyContractOutDate() {
List<WxMall> wxMalls = wxMallMapper.findList(null);
Date date = new Date();
for (WxMall wxMall : wxMalls) {
//物业合同
List<WxPropertyContract> contractList = wxPropertyContractService.findToOutDateContracts(wxMall);
for (WxPropertyContract rent:contractList) {
Date endDate = DateUtils.stringToDate(DateUtils.getTimeBefore(rent.getOutDateNotifyDays(),rent.getRentalEndDate()), DateUtils.DATE_TIME_PATTERN);
if (endDate.after(date)) {
continue;
}
try {
WxMsgRecord msgRecord = new WxMsgRecord();
msgRecord.setMsgType(EnumMsgRecordType.SMS.getCode());


+ 1
- 1
mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml Просмотреть файл

@@ -72,7 +72,7 @@
<if test=" null != price ">and `price` = #{price}</if>
<if test=" null != rentalStartDate ">and `rental_start_date` = #{rentalStartDate}</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) &lt;= NOW())</if>
<if test=" null != outDateNofity ">and out_date_notify_phone is not null and out_date_notify_phone != '' and and out_date_notify_days is not null and out_date_notify_days &gt; 0 and rental_end_date &lt;= NOW()</if>
<if test=" null != signDate ">and `sign_date` = #{signDate}</if>
<if test=" null != receivePeriod ">and `receive_period` = #{receivePeriod}</if>
<if test=" null != tenantId and '' != tenantId">


+ 1
- 1
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml Просмотреть файл

@@ -156,7 +156,7 @@
<if test=" null != price and '' != price">and `price` = #{price}</if>
<if test=" null != rentalStartDate and '' != rentalStartDate">and `rental_start_date` = #{rentalStartDate}</if>
<if test=" null != rentalEndDate and '' != 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) &lt;= NOW())</if>
<if test=" null != outDateNofity ">and out_date_notify_phone is not null and out_date_notify_phone != '' and out_date_notify_days is not null and out_date_notify_days &gt; 0 and rental_end_date &lt;= NOW()</if>
<if test=" null != signDate and '' != signDate">and `sign_date` = #{signDate}</if>
<if test=" null != receivePeriod and '' != receivePeriod">and `receive_period` = #{receivePeriod}</if>
<if test=" null != tenantId and '' != tenantId">


Загрузка…
Отмена
Сохранить