diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java index 9c43e54a2..302b9a27f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java @@ -144,10 +144,13 @@ public class LawsWarnService { String beforeTimeTwelve = beforeTime(12,new Date()); Date parseSix = sdf.parse(beforeTimeSix); 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"); } - 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"); } } @@ -164,10 +167,13 @@ public class LawsWarnService { String beforeTimeTwelve = beforeTime(12,new Date()); Date parseSix = sdf.parse(beforeTimeSix); 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"); } - 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"); } }