From 5784e4715a2669b52eceb88639bb95cf583c7d88 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 25 Aug 2022 16:51:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E9=A2=84=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jero/modules/warn/service/LawsWarnService.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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"); } }