法规预警

This commit is contained in:
zhn
2022-08-25 16:51:57 +08:00
parent 4b789803fc
commit 5784e4715a
@@ -144,10 +144,13 @@ public class LawsWarnService {
String beforeTimeTwelve = beforeTime(12,new Date()); String beforeTimeTwelve = beforeTime(12,new Date());
Date parseSix = sdf.parse(beforeTimeSix); Date parseSix = sdf.parse(beforeTimeSix);
Date parseTwelve = sdf.parse(beforeTimeTwelve); Date parseTwelve = sdf.parse(beforeTimeTwelve);
if((newCarTimeDate.after(new Date()) && newCarTimeDate.before(parseSix)) || newCarTime.equals(beforeTimeSix)){ if((newCarTimeDate.after(new Date()) && newCarTimeDate.before(parseSix))
|| newCarTime.equals(beforeTimeSix)
||newCarTime.equals(sdf.format(new Date()))){
record.put("new_colour","red"); record.put("new_colour","red");
} }
if((newCarTimeDate.after(parseSix) && newCarTimeDate.before(parseTwelve)) || newCarTime.equals(beforeTimeTwelve)){ if((newCarTimeDate.after(parseSix) && newCarTimeDate.before(parseTwelve))
|| newCarTime.equals(beforeTimeTwelve)){
record.put("new_colour","yellow"); record.put("new_colour","yellow");
} }
} }
@@ -164,10 +167,13 @@ public class LawsWarnService {
String beforeTimeTwelve = beforeTime(12,new Date()); String beforeTimeTwelve = beforeTime(12,new Date());
Date parseSix = sdf.parse(beforeTimeSix); Date parseSix = sdf.parse(beforeTimeSix);
Date parseTwelve = sdf.parse(beforeTimeTwelve); Date parseTwelve = sdf.parse(beforeTimeTwelve);
if((implementTimeDate.after(new Date()) && implementTimeDate.before(parseSix)) || implementTime.equals(beforeTimeSix)){ if((implementTimeDate.after(new Date()) && implementTimeDate.before(parseSix))
|| implementTime.equals(beforeTimeSix)
|| implementTime.equals(sdf.format(new Date()))){
record.put("implement_colour","red"); record.put("implement_colour","red");
} }
if((implementTimeDate.after(parseSix) && implementTimeDate.before(parseTwelve)) || implementTime.equals(beforeTimeTwelve)){ if((implementTimeDate.after(parseSix) && implementTimeDate.before(parseTwelve))
|| implementTime.equals(beforeTimeTwelve)){
record.put("implement_colour","yellow"); record.put("implement_colour","yellow");
} }
} }