From abc8a9f83b954bd2ff5cf6705d3b226f59ac45b6 Mon Sep 17 00:00:00 2001 From: xiepeng Date: Wed, 29 May 2024 14:06:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E9=80=9A=E6=8F=90=E9=86=92=20?= =?UTF-8?q?=E5=88=B0=E6=9C=9F=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trafficRemind/TrafficRemindScheduled.java | 14 ++++++++++++-- .../mybatis/datasource/traffic/CompassMapper.xml | 2 +- .../datasource/traffic/InspectAnnuallyMapper.xml | 2 +- .../mybatis/datasource/traffic/InsuranceMapper.xml | 2 +- .../datasource/traffic/MaintenanceMapper.xml | 2 +- .../mybatis/datasource/traffic/OperationMapper.xml | 2 +- .../mybatis/datasource/traffic/TankInspection.xml | 2 +- .../mybatis/datasource/traffic/TaxationMapper.xml | 2 +- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/zcloud/scheduled/trafficRemind/TrafficRemindScheduled.java b/src/main/java/com/zcloud/scheduled/trafficRemind/TrafficRemindScheduled.java index 72b77dc..00e1d88 100644 --- a/src/main/java/com/zcloud/scheduled/trafficRemind/TrafficRemindScheduled.java +++ b/src/main/java/com/zcloud/scheduled/trafficRemind/TrafficRemindScheduled.java @@ -4,6 +4,7 @@ import com.zcloud.entity.PageData; import com.zcloud.service.traffic.*; import com.zcloud.service.notice.NoticeManagementService; import com.zcloud.util.SendMessageUtil; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -44,8 +45,8 @@ public class TrafficRemindScheduled { - /*@Scheduled(cron ="0/5 * * * * ?")*/ // 测试5秒 - @Scheduled(cron ="0 0 8 * * ?") // 每天8点 + @Scheduled(cron ="0/5 * * * * ?") // 测试5秒 + /*@Scheduled(cron ="0 0 8 * * ?")*/ // 每天8点 public void Scheduled(){ try { System.out.println("============定时发送今日交通到期提醒=========="); @@ -100,6 +101,15 @@ public class TrafficRemindScheduled { params2.put("name", "vehicle_model");// 存入短信模板中的参数名称 params2.put("value", h.get("VEHICLEMODEL").toString());// 存入上面参数名称所传递的值 paramsList.add(params2); + + // 第3个参数 + PageData params3 = new PageData(); + params3.put("name", "due_date");// 存入短信模板中的参数名称 + if(!StringUtils.isEmpty(h.getString("EXPIRE_DATE"))) { + h.put("DUE_DATE", h.getString("EXPIRE_DATE")); + } + params3.put("value", h.get("DUE_DATE").toString());// 存入上面参数名称所传递的值 + paramsList.add(params3); try { sendMessageUtil.sendTrafficNotice(mes, paramsList); } catch (Exception e) { diff --git a/src/main/resources/mybatis/datasource/traffic/CompassMapper.xml b/src/main/resources/mybatis/datasource/traffic/CompassMapper.xml index 3eb4f90..64ac511 100644 --- a/src/main/resources/mybatis/datasource/traffic/CompassMapper.xml +++ b/src/main/resources/mybatis/datasource/traffic/CompassMapper.xml @@ -114,7 +114,7 @@ where f.ISDELETE = '0' AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0') AND f.DUE_DATE != '' - AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0 + AND TO_DAYS( NOW() ) - TO_DAYS( f.REMINDER_DATE ) = 0 AND f.REMINDER_STATUS = '1' diff --git a/src/main/resources/mybatis/datasource/traffic/InspectAnnuallyMapper.xml b/src/main/resources/mybatis/datasource/traffic/InspectAnnuallyMapper.xml index ad309c2..9ff39c1 100644 --- a/src/main/resources/mybatis/datasource/traffic/InspectAnnuallyMapper.xml +++ b/src/main/resources/mybatis/datasource/traffic/InspectAnnuallyMapper.xml @@ -254,7 +254,7 @@ where f.ISDELETE = '0' AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0') AND f.DUE_DATE != '' - AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0 + AND TO_DAYS( NOW() ) - TO_DAYS( f.REMINDER_DATE ) = 0 AND f.REMINDER_STATUS = '1' diff --git a/src/main/resources/mybatis/datasource/traffic/InsuranceMapper.xml b/src/main/resources/mybatis/datasource/traffic/InsuranceMapper.xml index 2d105d7..8c8e641 100644 --- a/src/main/resources/mybatis/datasource/traffic/InsuranceMapper.xml +++ b/src/main/resources/mybatis/datasource/traffic/InsuranceMapper.xml @@ -79,7 +79,7 @@ where f.ISDELETE = '0' AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0') AND f.DUE_DATE != '' - AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0 + AND TO_DAYS( NOW() ) - TO_DAYS( f.REMINDER_DATE ) = 0 AND f.REMINDER_STATUS = '1' diff --git a/src/main/resources/mybatis/datasource/traffic/MaintenanceMapper.xml b/src/main/resources/mybatis/datasource/traffic/MaintenanceMapper.xml index df6c2fb..438b252 100644 --- a/src/main/resources/mybatis/datasource/traffic/MaintenanceMapper.xml +++ b/src/main/resources/mybatis/datasource/traffic/MaintenanceMapper.xml @@ -113,7 +113,7 @@ where f.ISDELETE = '0' AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0') AND f.DUE_DATE != '' - AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0 + AND TO_DAYS( NOW() ) - TO_DAYS( f.REMINDER_DATE ) = 0 AND f.REMINDER_STATUS = '1' diff --git a/src/main/resources/mybatis/datasource/traffic/OperationMapper.xml b/src/main/resources/mybatis/datasource/traffic/OperationMapper.xml index be9dadd..2bdff96 100644 --- a/src/main/resources/mybatis/datasource/traffic/OperationMapper.xml +++ b/src/main/resources/mybatis/datasource/traffic/OperationMapper.xml @@ -107,7 +107,7 @@ where f.ISDELETE = '0' AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0') AND f.DUE_DATE != '' - AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0 + AND TO_DAYS( NOW() ) - TO_DAYS( f.REMINDER_DATE ) = 0 AND f.REMINDER_STATUS = '1' diff --git a/src/main/resources/mybatis/datasource/traffic/TankInspection.xml b/src/main/resources/mybatis/datasource/traffic/TankInspection.xml index 0107850..5d4246a 100644 --- a/src/main/resources/mybatis/datasource/traffic/TankInspection.xml +++ b/src/main/resources/mybatis/datasource/traffic/TankInspection.xml @@ -75,7 +75,7 @@ where f.ISDELETE = '0' AND (bto.ISSCRAP = '0' OR btmf.ISSCRAP = '0') AND f.DUE_DATE != '' - AND TO_DAYS( NOW() ) - TO_DAYS( f.DUE_DATE ) = 0 + AND TO_DAYS( NOW() ) - TO_DAYS( f.REMINDER_DATE ) = 0 AND f.REMINDER_STATUS = '1' diff --git a/src/main/resources/mybatis/datasource/traffic/TaxationMapper.xml b/src/main/resources/mybatis/datasource/traffic/TaxationMapper.xml index 2289d73..5920bcc 100644 --- a/src/main/resources/mybatis/datasource/traffic/TaxationMapper.xml +++ b/src/main/resources/mybatis/datasource/traffic/TaxationMapper.xml @@ -154,7 +154,7 @@ WHERE f.ISDELETE = '0' AND btmf.ISSCRAP = '0' AND f.EXPIRE_DATE != '' - AND TO_DAYS( NOW() ) - TO_DAYS( f.EXPIRE_DATE ) = 0 + AND TO_DAYS( NOW() ) - TO_DAYS( f.REMINDER_DATA ) = 0 AND f.REMINDER_STATUS = '0'