feat(harmonic): 新增移动端线路详情功能并优化波形数据处理
- 添加 AppLineDetailVo 数据传输对象,支持移动端线路详情展示 - 增加 report 服务中的 buildHarmonic 相关方法重构,支持移动端线路详情查询 - 优化波形数据处理逻辑,新增波形数据抽点和裁剪功能,减少移动端数据传输量 - 修改 CommonStatisticalQueryParam 参数类,增加数据模型字段和电度事件类型支持 - 调整统计查询相关接口,支持全量和增量查询模式 - 移除 CredentialReqDTO 类,清理相关依赖 - 优化 CsAppReportServiceImpl 中的越限描述构建逻辑,使用时间转换工具 - 更新数据查询相关 Mapper XML 文件,调整数据过滤条件 - 修改设备用户服务实现,完善当前工程数据显示逻辑 - 优化 CsEquipmentDeliveryServiceImpl 中的数据集添加逻辑,支持电度数据类型 - 重构 CsEventController 和相关服务类,支持移动端波形数据分析 - 添加 Nacos 配置参数控制波形数据抽点和间隔区域处理行为
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package com.njcn.cssystem.utils;
|
||||
|
||||
public class TimeUtil {
|
||||
|
||||
/**
|
||||
* 将分钟数转换为友好显示格式
|
||||
* @param totalMinutes 总分钟数
|
||||
* @return 格式化后的字符串
|
||||
*/
|
||||
public static String convertMinutes(int totalMinutes) {
|
||||
if (totalMinutes < 0) {
|
||||
return "0分钟";
|
||||
}
|
||||
|
||||
int days = 0;
|
||||
int hours = 0;
|
||||
int minutes = totalMinutes;
|
||||
|
||||
// 计算天数(超过24小时)
|
||||
if (minutes >= 1440) { // 24 * 60 = 1440
|
||||
days = minutes / 1440;
|
||||
minutes = minutes % 1440;
|
||||
}
|
||||
|
||||
// 计算小时数(剩余分钟超过60分钟)
|
||||
if (minutes >= 60) {
|
||||
hours = minutes / 60;
|
||||
minutes = minutes % 60;
|
||||
}
|
||||
|
||||
// 构建返回字符串
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
if (days > 0) {
|
||||
result.append(days).append("天");
|
||||
}
|
||||
if (hours > 0) {
|
||||
result.append(hours).append("小时");
|
||||
}
|
||||
if (minutes > 0) {
|
||||
result.append(minutes).append("分钟");
|
||||
}
|
||||
|
||||
// 如果全部为0
|
||||
if (result.length() == 0) {
|
||||
result.append("0分钟");
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user