Commit 589646f2 authored by yanzg's avatar yanzg

修改MQ请求尸体,防止出错

parent ded5437b
......@@ -880,10 +880,15 @@ public class DateHelper {
if (dateTime == null) {
return null;
}
// 获取当前小时,用于累加
Date hour = DateHelper.getDateTime(DateHelper.getDateTimeString("yyyy-MM-dd HH:00:00.000", dateTime));
// 获取当前小时毫秒数量
long totalMill = dateTime.getTime() - hour.getTime();
// 计算分钟单位
long unit = totalMill / MINUTE_UNIT / minute;
// 计算四舍五入后的时间
Date to = new Date(hour.getTime() + unit * MINUTE_UNIT * minute);
// 将时间转换为字符串
return DateHelper.getDateTimeString(to);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment