|
|
@ -162,19 +162,22 @@ public class WarnServiceImpl implements WarnService { |
|
|
respVO.setLowlimit(originalLowlimit); |
|
|
respVO.setLowlimit(originalLowlimit); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//计算当前时间与create_time的时间差(单位:秒)
|
|
|
|
|
|
long totalSeconds = ChronoUnit.SECONDS.between(warnDO.getCreateTime(), LocalDateTime.now()); |
|
|
//当前时间
|
|
|
respVO.setTimeDiff(totalSeconds); |
|
|
// respVO.setCurrentTime(LocalDateTime.now());
|
|
|
// 转换为天、时、分、秒
|
|
|
// //计算当前时间与insert_time的时间差(单位:秒)
|
|
|
long days = totalSeconds / 86400; // 1天 = 86400秒
|
|
|
// long totalSeconds = ChronoUnit.SECONDS.between(warnDO.getInsertTime(), LocalDateTime.now());
|
|
|
long remainingSeconds = totalSeconds % 86400; |
|
|
// respVO.setTimeDiff(totalSeconds);
|
|
|
long hours = remainingSeconds / 3600; // 1小时 = 3600秒
|
|
|
// // 转换为天、时、分、秒
|
|
|
remainingSeconds %= 3600; |
|
|
// long days = totalSeconds / 86400; // 1天 = 86400秒
|
|
|
long minutes = remainingSeconds / 60; // 1分钟 = 60秒
|
|
|
// long remainingSeconds = totalSeconds % 86400;
|
|
|
long seconds = remainingSeconds % 60; |
|
|
// long hours = remainingSeconds / 3600; // 1小时 = 3600秒
|
|
|
// 格式化时间差字符串(例如:1天2小时3分4秒)
|
|
|
// remainingSeconds %= 3600;
|
|
|
String timeDiffStr = String.format("%d天%d小时%d分%d秒", days, hours, minutes, seconds); |
|
|
// long minutes = remainingSeconds / 60; // 1分钟 = 60秒
|
|
|
respVO.setTimeDiffStr(timeDiffStr); |
|
|
// long seconds = remainingSeconds % 60;
|
|
|
|
|
|
// // 格式化时间差字符串(例如:1天2小时3分4秒)
|
|
|
|
|
|
// String timeDiffStr = String.format("%d天%d小时%d分%d秒", days, hours, minutes, seconds);
|
|
|
|
|
|
// respVO.setTimeDiffStr(timeDiffStr);
|
|
|
return respVO; |
|
|
return respVO; |
|
|
}).collect(Collectors.toList()); |
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|