修复不骚的操作吃掉的代码
This commit is contained in:
parent
38920f3b80
commit
43145f12ab
@ -228,17 +228,19 @@ public class XhpcPileOrderController extends BaseController {
|
|||||||
|
|
||||||
DateTime startTime = DateUtil.parse(cacheOrderData.getStartTime());
|
DateTime startTime = DateUtil.parse(cacheOrderData.getStartTime());
|
||||||
DateTime endTime = DateUtil.parse(cacheOrderData.getEndTime());
|
DateTime endTime = DateUtil.parse(cacheOrderData.getEndTime());
|
||||||
|
xhpcChargeOrder.setStartTime(startTime);
|
||||||
xhpcChargeOrder.setEndTime(endTime);
|
xhpcChargeOrder.setEndTime(endTime);
|
||||||
|
System.out.println(endTime.getTime());
|
||||||
|
System.out.println(startTime.getTime());
|
||||||
//充电时长
|
//充电时长
|
||||||
Long tiem = (endTime.getTime() - startTime.getTime()) % 1000;
|
Long tiem = (endTime.getTime() - startTime.getTime()) / 1000;
|
||||||
if (tiem > 60) {
|
if (tiem > 3600) {
|
||||||
long mins = tiem % 60;
|
long hours = tiem / 3600;
|
||||||
long hours = tiem / 60;
|
double mins = (double) ((tiem - (hours * 3600)) / 60);
|
||||||
xhpcChargeOrder.setChargingTime(hours + "时" + mins + "分");
|
xhpcChargeOrder.setChargingTime(hours + "时" + new BigDecimal(mins).setScale(0) + "分");
|
||||||
} else {
|
} else {
|
||||||
long mins = tiem % 60;
|
double mins = (double) (tiem / 60);
|
||||||
xhpcChargeOrder.setChargingTime(mins + "分");
|
xhpcChargeOrder.setChargingTime(new BigDecimal(mins).setScale(0) + "分");
|
||||||
}
|
}
|
||||||
xhpcChargeOrder.setChargingTimeNumber(tiem.intValue());
|
xhpcChargeOrder.setChargingTimeNumber(tiem.intValue());
|
||||||
BigDecimal divide = new BigDecimal(cacheOrderData.getTotalPowerQuantity()).divide(bigDecimal);
|
BigDecimal divide = new BigDecimal(cacheOrderData.getTotalPowerQuantity()).divide(bigDecimal);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user