From 19aa3fb757cc9dc8dc4bb119605a22981e4c2ab5 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Sun, 25 Sep 2022 09:47:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E9=A2=84=E8=AD=A6=20?= =?UTF-8?q?=E6=96=B0=E8=BD=A6=E5=9E=8B=E5=AE=9E=E6=96=BD=E6=97=A5=E6=9C=9F?= =?UTF-8?q?,=E5=9C=A8=E4=BA=A7=E8=BD=A6=E5=AE=9E=E6=96=BD=E6=97=A5?= =?UTF-8?q?=E6=9C=9F,=20=E5=88=B0=E6=9C=9F=E5=BD=93=E5=A4=A9=E5=8F=91?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jero/modules/warn/service/TimedTaskWarn.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java index 25083ab1e..86300e2b0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java @@ -53,6 +53,13 @@ public class TimedTaskWarn implements Job { @Value(value = "${jero.backUrl}") private String backUrl; + /** + * 法规预警定时任务 + * 新车型实施日期,在产车实施日期,提前6个月和提前12个月发消息 + * 新车型实施日期,在产车实施日期, 到期当天发消息 + * @param jobExecutionContext + * @throws JobExecutionException + */ @Override public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { //获取所有的法规 @@ -110,12 +117,13 @@ public class TimedTaskWarn implements Job { //The implementation date of the standard GB 7258 new model you subscribed to is 2022-01-01, // please pay attention to check if(ObjectUtils.isNotEmpty(xin1Che1Xing2Shi2Shi1Ri4Qi1)){ + String xin1Che1Xing2Shi2Shi1Ri4Qi1Str = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1); //当前时间的前6个月 String beforeTimeSix = beforeTime(6,xin1Che1Xing2Shi2Shi1Ri4Qi1); //当前时间的前12个月 String beforeTimeSixTen = beforeTime(12,xin1Che1Xing2Shi2Shi1Ri4Qi1); - if(currentTime.equals(beforeTimeSix) || currentTime.equals(beforeTimeSixTen)){ + if(currentTime.equals(beforeTimeSix) || currentTime.equals(beforeTimeSixTen) || currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){ //发送站内消息和飞书消息 String format = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1); String content = "The implementation date of the " + category +" "+ serialNumber @@ -131,11 +139,12 @@ public class TimedTaskWarn implements Job { //The implementation date of the standard GB 7258 in production vehicle you subscribed to is 2022-01-01, // please pay attention to check if(ObjectUtils.isNotEmpty(implementTime)){ + String implementTimeStr = sdf.format(implementTime); //当前时间的前6个月 String beforeTimeSix = beforeTime(6,implementTime); //当前时间的前12个月 String beforeTimeSixTen = beforeTime(12,implementTime); - if(currentTime.equals(beforeTimeSix) || currentTime.equals(beforeTimeSixTen)){ + if(currentTime.equals(beforeTimeSix) || currentTime.equals(beforeTimeSixTen) || currentTime.equals(implementTimeStr)){ //发送站内消息和飞书消息 String format = sdf.format(implementTime); String content = "The implementation date of the " + category +" "+ serialNumber