From 5cbbf46bfe2a7abdd8a48f806ea9a202c57c0fcc Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期四, 17 十月 2024 10:51:37 +0800
Subject: [PATCH] statistic workload change
---
pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportCtrl.java | 5 -----
pms-parent/pms-global/src/main/resources/mapper/OthStatisticWorkloadMapper.xml | 6 +++---
pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/task/WorkloadTask.java | 11 ++---------
3 files changed, 5 insertions(+), 17 deletions(-)
diff --git a/pms-parent/pms-global/src/main/resources/mapper/OthStatisticWorkloadMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/OthStatisticWorkloadMapper.xml
index 0d42749..42d0ad4 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/OthStatisticWorkloadMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/OthStatisticWorkloadMapper.xml
@@ -29,9 +29,9 @@
<select id="selectMaxDate" resultType="java.lang.String">
SELECT COALESCE(
- (SELECT DATE_ADD(MAX(statistic_date), INTERVAL 1 DAY) FROM oth_statistic_device),
- (SELECT DATE_FORMAT(MIN(out_line_time),'%Y-%m-%d') FROM sta_device_last where status =2 and out_line_time is not null),
- DATE_FORMAT(NOW() ,'%Y-%m-%d') -- 濡傛灉涓や釜琛ㄩ兘娌℃湁鏁版嵁锛岃繑鍥炲綋鍓嶆椂闂�
+ (SELECT DATE_ADD(MAX(statistic_date), INTERVAL 1 DAY) FROM oth_statistic_workload),
+ (SELECT DATE_FORMAT(MIN(out_time),'%Y-%m-%d') FROM sta_device_last),
+ DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY),'%Y-%m-%d') -- 濡傛灉涓や釜琛ㄩ兘娌℃湁鏁版嵁锛岃繑鍥炲墠涓�澶╂椂闂� 鏃犵敤
) AS max_date;
</select>
diff --git a/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportCtrl.java b/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportCtrl.java
index 5621eda..8ddcc73 100644
--- a/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportCtrl.java
+++ b/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportCtrl.java
@@ -54,9 +54,4 @@
List<JSONObject> list = sv.queryPlanList();
return BaseResponseUtils.buildSuccess(list);
}
- @GetMapping(path="test")
- public BaseResponse test(){
- sv.test();
- return BaseResponseUtils.buildSuccess();
- }
}
\ No newline at end of file
diff --git a/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/task/WorkloadTask.java b/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/task/WorkloadTask.java
index 28154a0..b1114d1 100644
--- a/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/task/WorkloadTask.java
+++ b/pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/task/WorkloadTask.java
@@ -27,19 +27,12 @@
//today 0鐐�5鍒� 缁熻before today
log.info("鍚姩缁熻浜哄憳宸ヤ綔閲忎换鍔�");
OthStatisticWorkloadMapper workloadMapper = SpringContextUtil.getBean(OthStatisticWorkloadMapper.class);
- //鎵惧埌鏈�澶т竴鏉℃棩鏈熻褰�
+ //搴旇缁熻鐨勬棩鏈�
DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE;
LocalDate maxLocalDate = LocalDate.parse(workloadMapper.selectMaxDate(), formatter);
- //寰�鍚庡惊鐜ぉ鏁版眹鎬� //寰幆缁熻
- /* LocalDate maxLocalDate = null;
- if (maxDate == null) {
- maxLocalDate = LocalDate.now().minusDays(2);
- } else {
- maxLocalDate = maxDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
- }*/
LocalDate today = LocalDate.now();
- LocalDate statisticDate = maxLocalDate.plusDays(1);
+ LocalDate statisticDate = maxLocalDate;
long daysBetween = ChronoUnit.DAYS.between(maxLocalDate, today);
if (daysBetween > 30) {
daysBetween = 30;
--
Gitblit v1.8.0