From 64018c538e599444dde7b0952e8c4ff0b7f45449 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 18 Apr 2024 16:13:28 +0800 Subject: [PATCH] =?UTF-8?q?#=E8=BF=90=E8=A1=8C=E6=9C=88=E6=8A=A53=E6=9C=88?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operation/report/impl/ReportServiceImpl.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java index c478920..771db81 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/report/impl/ReportServiceImpl.java @@ -630,8 +630,8 @@ public class ReportServiceImpl implements ReportService { run.setStationCode(station.getCode()); run.setStationName(station.getName()); Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); - calendar.add(Calendar.DAY_OF_MONTH,-1); + calendar.setTime(DateUtil.parse("2024-04-01 00:00:00",DateUtil.PATTERN_DATETIME)); + //calendar.add(Calendar.DAY_OF_MONTH,-1); run.setMonth(DateUtil.format(calendar.getTime(),"yyyy-MM")); List stationDevices = devices.stream().filter(device->device.getDepartment().equals(station.getRefDept())).collect(Collectors.toList()); if(CollectionUtil.isEmpty(stationDevices)){ @@ -686,7 +686,8 @@ public class ReportServiceImpl implements ReportService { */ private Double generate(int type,String deviceCode,double ride) { Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); + calendar.setTime(DateUtil.parse("2024-04-01 00:00:00",DateUtil.PATTERN_DATETIME)); + //calendar.setTime(new Date()); String end = null,start = null; int cycleType = 5; switch (type){ @@ -722,7 +723,8 @@ public class ReportServiceImpl implements ReportService { */ private Double planGenerate(int type, String stationCode,List plans) { Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); + calendar.setTime(DateUtil.parse("2024-04-01 00:00:00",DateUtil.PATTERN_DATETIME)); + //calendar.setTime(new Date()); if(type == 0){ calendar.add(Calendar.DAY_OF_MONTH,-1); calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY) + 1); @@ -759,7 +761,8 @@ public class ReportServiceImpl implements ReportService { // 确定查询时间范围: 年、月 Date startDate,endDate; Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); + calendar.setTime(DateUtil.parse("2024-04-01 00:00:00",DateUtil.PATTERN_DATETIME)); + //calendar.setTime(new Date()); endDate = calendar.getTime(); calendar.add(Calendar.MONTH, -calendar.get(Calendar.MONTH)); calendar.add(Calendar.DATE, -calendar.get(Calendar.DATE) + 1); @@ -832,7 +835,8 @@ public class ReportServiceImpl implements ReportService { */ private String alarmData(String code) { Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); + calendar.setTime(DateUtil.parse("2024-04-01 00:00:00",DateUtil.PATTERN_DATETIME)); + //calendar.setTime(new Date()); calendar.add(Calendar.DAY_OF_MONTH,-1); String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); calendar.add(Calendar.MONTH,-1); @@ -939,7 +943,8 @@ public class ReportServiceImpl implements ReportService { */ private List curve(List attributes, String deviceCode) { Calendar calendar = Calendar.getInstance(); - calendar.setTime(new Date()); + calendar.setTime(DateUtil.parse("2024-04-01 23:59:59",DateUtil.PATTERN_DATETIME)); + //calendar.setTime(DateUtil.parse(DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 23:59:59",DateUtil.PATTERN_DATETIME)); calendar.add(Calendar.DAY_OF_MONTH,-1); String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); calendar.add(Calendar.MONTH,-1);