fix(ops): 修正工作台客流趋势返回
Some checks failed
Java CI with Maven / build (11) (push) Has been cancelled
Java CI with Maven / build (17) (push) Has been cancelled
Java CI with Maven / build (8) (push) Has been cancelled

This commit is contained in:
lzh
2026-02-11 10:02:03 +08:00
parent 16441e7c25
commit b851484e4e

View File

@@ -651,8 +651,7 @@ public class OpsStatisticsServiceImpl implements OpsStatisticsService {
List<String> hours = new ArrayList<>();
List<Long> inData = new ArrayList<>();
List<Long> outData = new ArrayList<>();
// 每2小时显示一个点避免横坐标太挤
for (int h = 0; h < 24; h += 2) {
for (int h = 0; h < 24; h++) {
hours.add(String.format("%02d:00", h));
inData.add(hourIn[h]);
outData.add(hourOut[h]);
@@ -665,7 +664,7 @@ public class OpsStatisticsServiceImpl implements OpsStatisticsService {
* 构建今日工单趋势(按小时)-- 使用 GROUP BY HOUR 查询
*/
/**
* 构建今日工单趋势(按小时优化展示每2小时
* 构建今日工单趋势(按小时)
*/
private WorkOrderTrend buildWorkOrderTrend(String orderType,
LocalDateTime todayStart,
@@ -686,18 +685,11 @@ public class OpsStatisticsServiceImpl implements OpsStatisticsService {
List<String> hours = new ArrayList<>();
List<Integer> data = new ArrayList<>();
// 每2小时显示一个点避免横坐标太挤
for (int h = 0; h <= currentHour; h += 2) {
for (int h = 0; h <= currentHour; h++) {
hours.add(String.format("%02d:00", h));
data.add(hourBuckets[h]);
}
// 如果当前小时是奇数,补充最后一个点
if (currentHour % 2 == 1 && currentHour > 0) {
hours.add(String.format("%02d:00", currentHour));
data.add(hourBuckets[currentHour]);
}
return WorkOrderTrend.builder().hours(hours).data(data).build();
}