法规预警
新车型实施日期,在产车实施日期, 到期当天发消息
This commit is contained in:
+11
-2
@@ -53,6 +53,13 @@ public class TimedTaskWarn implements Job {
|
|||||||
@Value(value = "${jero.backUrl}")
|
@Value(value = "${jero.backUrl}")
|
||||||
private String backUrl;
|
private String backUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法规预警定时任务
|
||||||
|
* 新车型实施日期,在产车实施日期,提前6个月和提前12个月发消息
|
||||||
|
* 新车型实施日期,在产车实施日期, 到期当天发消息
|
||||||
|
* @param jobExecutionContext
|
||||||
|
* @throws JobExecutionException
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
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,
|
//The implementation date of the standard GB 7258 new model you subscribed to is 2022-01-01,
|
||||||
// please pay attention to check
|
// please pay attention to check
|
||||||
if(ObjectUtils.isNotEmpty(xin1Che1Xing2Shi2Shi1Ri4Qi1)){
|
if(ObjectUtils.isNotEmpty(xin1Che1Xing2Shi2Shi1Ri4Qi1)){
|
||||||
|
String xin1Che1Xing2Shi2Shi1Ri4Qi1Str = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1);
|
||||||
//当前时间的前6个月
|
//当前时间的前6个月
|
||||||
String beforeTimeSix = beforeTime(6,xin1Che1Xing2Shi2Shi1Ri4Qi1);
|
String beforeTimeSix = beforeTime(6,xin1Che1Xing2Shi2Shi1Ri4Qi1);
|
||||||
//当前时间的前12个月
|
//当前时间的前12个月
|
||||||
String beforeTimeSixTen = beforeTime(12,xin1Che1Xing2Shi2Shi1Ri4Qi1);
|
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 format = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1);
|
||||||
String content = "The implementation date of the " + category +" "+ serialNumber
|
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,
|
//The implementation date of the standard GB 7258 in production vehicle you subscribed to is 2022-01-01,
|
||||||
// please pay attention to check
|
// please pay attention to check
|
||||||
if(ObjectUtils.isNotEmpty(implementTime)){
|
if(ObjectUtils.isNotEmpty(implementTime)){
|
||||||
|
String implementTimeStr = sdf.format(implementTime);
|
||||||
//当前时间的前6个月
|
//当前时间的前6个月
|
||||||
String beforeTimeSix = beforeTime(6,implementTime);
|
String beforeTimeSix = beforeTime(6,implementTime);
|
||||||
//当前时间的前12个月
|
//当前时间的前12个月
|
||||||
String beforeTimeSixTen = beforeTime(12,implementTime);
|
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 format = sdf.format(implementTime);
|
||||||
String content = "The implementation date of the " + category +" "+ serialNumber
|
String content = "The implementation date of the " + category +" "+ serialNumber
|
||||||
|
|||||||
Reference in New Issue
Block a user