mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
update 小程序订单详情 已充电量字段 若是订单完成,则取交易记录中的电量
This commit is contained in:
@@ -524,10 +524,12 @@ public class OrderService {
|
||||
*/
|
||||
public UniAppOrderVO getUniAppOrderDetail(String orderCode) {
|
||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
UniAppOrderVO vo = new UniAppOrderVO();
|
||||
if (orderBasicInfo == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_QUERY_ORDER_INFO_IS_NULL);
|
||||
}
|
||||
UniAppOrderVO vo = new UniAppOrderVO();
|
||||
|
||||
vo.setOrderCode(orderBasicInfo.getOrderCode());
|
||||
vo.setPileSn(orderBasicInfo.getPileSn());
|
||||
vo.setConnectorCode(orderBasicInfo.getConnectorCode());
|
||||
@@ -590,9 +592,9 @@ public class OrderService {
|
||||
vo.setOutputCurrent(data.getOutputCurrent());
|
||||
vo.setOutputVoltage(data.getOutputVoltage());
|
||||
vo.setSOC(data.getSOC());
|
||||
BigDecimal chargingAmount = new BigDecimal(monitorData.getChargingAmount()).setScale(2, BigDecimal.ROUND_HALF_UP); // 充电金额
|
||||
BigDecimal chargingAmount = new BigDecimal(monitorData.getChargingAmount()).setScale(4, BigDecimal.ROUND_HALF_UP); // 充电金额
|
||||
vo.setChargingAmount(chargingAmount.toString());
|
||||
BigDecimal chargingDegree = new BigDecimal(monitorData.getChargingDegree()).setScale(2, BigDecimal.ROUND_HALF_UP); // 充电度数
|
||||
BigDecimal chargingDegree = new BigDecimal(monitorData.getChargingDegree()).setScale(4, BigDecimal.ROUND_HALF_UP); // 充电度数
|
||||
vo.setChargingDegree(chargingDegree.toString());
|
||||
vo.setSumChargingTime(monitorData.getSumChargingTime());
|
||||
vo.setTimeRemaining(monitorData.getTimeRemaining());
|
||||
@@ -602,12 +604,13 @@ public class OrderService {
|
||||
Collections.reverse(chargingDataList);
|
||||
vo.setChargingDataList(chargingDataList);
|
||||
}
|
||||
|
||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||
if (orderDetail != null) {
|
||||
OrderAmountDetailVO billingDetails = new OrderAmountDetailVO();
|
||||
BeanUtils.copyBeanProp(billingDetails, orderDetail);
|
||||
vo.setBillingDetails(billingDetails);
|
||||
if (StringUtils.equals(OrderStatusEnum.ORDER_COMPLETE.getValue(), orderStatus)) {
|
||||
vo.setChargingDegree(String.valueOf(orderDetail.getTotalUsedElectricity()));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user