法规预警

新车型实施日期,在产车实施日期, 到期当天发消息
This commit is contained in:
zhn
2022-09-25 09:47:59 +08:00
parent 7c21fe9f95
commit 19aa3fb757
@@ -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