更新获取历史订单详情抛出异常需要返回错误信息

This commit is contained in:
panshulin 2021-12-02 10:05:03 +08:00
parent c8b3a6944e
commit 318ebf37b0

View File

@ -182,9 +182,8 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService {
}
return AjaxResult.success(byId);
} catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
return AjaxResult.success();
}
@Override
@ -239,13 +238,13 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService {
}
xhpcChargeOrder.setEndSoc(cacheRealtimeData.getSoc() + "");
//充电时长
Long tiem = Long.valueOf(cacheRealtimeData.getChargingTime() / 1000);
if (tiem > 3600) {
long hours = tiem / 3600;
double mins = (double) ((tiem - (hours * 3600)) / 60);
long time = (long) (cacheRealtimeData.getChargingTime() / 1000);
if (time > 3600) {
long hours = time / 3600;
double mins = (double) ((time - (hours * 3600)) / 60);
xhpcChargeOrder.setChargingTime(hours + "" + new BigDecimal(mins).setScale(0) + "");
} else {
double mins = (double) (tiem / 60);
double mins = (double) (time / 60);
xhpcChargeOrder.setChargingTime(new BigDecimal(mins).setScale(0) + "");
}
BigDecimal decimal = new BigDecimal(10000);