From 6e84880174f50eaaec41f5b32259796f3166cb5b Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Wed, 17 Aug 2022 17:00:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E9=A2=84=E8=AD=A6--6?= =?UTF-8?q?=E4=B8=AA=E6=9C=88=E5=92=8C12=E4=B8=AA=E6=9C=88=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=A2=9C=E8=89=B2=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jero/modules/warn/service/LawsWarnService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 87662c695..9c43e54a2 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,10 @@ 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)){ + if((newCarTimeDate.after(new Date()) && newCarTimeDate.before(parseSix)) || newCarTime.equals(beforeTimeSix)){ record.put("new_colour","red"); } - if(newCarTimeDate.after(parseSix) && newCarTimeDate.before(parseTwelve)){ + if((newCarTimeDate.after(parseSix) && newCarTimeDate.before(parseTwelve)) || newCarTime.equals(beforeTimeTwelve)){ record.put("new_colour","yellow"); } } @@ -158,16 +158,16 @@ public class LawsWarnService { if(StringUtils.isNotBlank(implementTime) && !"null".equals(implementTime)){ try { if(Integer.parseInt(String.valueOf(parameter.get("flag"))) == 1){ - Date newCarTimeDate = sdf.parse(implementTime); + Date implementTimeDate = sdf.parse(implementTime); //当前时间的前6个月 String beforeTimeSix = beforeTime(6,new Date()); String beforeTimeTwelve = beforeTime(12,new Date()); Date parseSix = sdf.parse(beforeTimeSix); Date parseTwelve = sdf.parse(beforeTimeTwelve); - if(newCarTimeDate.after(new Date()) && newCarTimeDate.before(parseSix)){ + if((implementTimeDate.after(new Date()) && implementTimeDate.before(parseSix)) || implementTime.equals(beforeTimeSix)){ record.put("implement_colour","red"); } - if(newCarTimeDate.after(parseSix) && newCarTimeDate.before(parseTwelve)){ + if((implementTimeDate.after(parseSix) && implementTimeDate.before(parseTwelve)) || implementTime.equals(beforeTimeTwelve)){ record.put("implement_colour","yellow"); } }