This commit is contained in:
2023-03-15 15:05:58 +08:00
parent a701f53ae1
commit 385f96f101

View File

@@ -471,9 +471,11 @@ public class OrderService {
String chargingTime = "0分钟";
if (orderVO.getStartTime() != null) {
Date startTimeDate = DateUtils.parseDate(orderVO.getStartTime());
Date endTimeDate = new Date();
Date endTimeDate;
if (orderVO.getEndTime() != null) {
endTimeDate = DateUtils.parseDate(orderVO.getEndTime());
} else {
endTimeDate = new Date();
}
// 计算出两个时间差
chargingTime = DateUtils.getDatePoor(endTimeDate, startTimeDate);