fix(ops): 修正工作台客流趋势返回
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user