mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-10 18:30:02 +08:00
update 小程序订单详情 已充电量字段 若是订单完成,则取交易记录中的电量
This commit is contained in:
@@ -524,10 +524,12 @@ public class OrderService {
|
|||||||
*/
|
*/
|
||||||
public UniAppOrderVO getUniAppOrderDetail(String orderCode) {
|
public UniAppOrderVO getUniAppOrderDetail(String orderCode) {
|
||||||
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||||
|
UniAppOrderVO vo = new UniAppOrderVO();
|
||||||
if (orderBasicInfo == null) {
|
if (orderBasicInfo == null) {
|
||||||
throw new BusinessException(ReturnCodeEnum.CODE_QUERY_ORDER_INFO_IS_NULL);
|
throw new BusinessException(ReturnCodeEnum.CODE_QUERY_ORDER_INFO_IS_NULL);
|
||||||
}
|
}
|
||||||
UniAppOrderVO vo = new UniAppOrderVO();
|
|
||||||
vo.setOrderCode(orderBasicInfo.getOrderCode());
|
vo.setOrderCode(orderBasicInfo.getOrderCode());
|
||||||
vo.setPileSn(orderBasicInfo.getPileSn());
|
vo.setPileSn(orderBasicInfo.getPileSn());
|
||||||
vo.setConnectorCode(orderBasicInfo.getConnectorCode());
|
vo.setConnectorCode(orderBasicInfo.getConnectorCode());
|
||||||
@@ -590,9 +592,9 @@ public class OrderService {
|
|||||||
vo.setOutputCurrent(data.getOutputCurrent());
|
vo.setOutputCurrent(data.getOutputCurrent());
|
||||||
vo.setOutputVoltage(data.getOutputVoltage());
|
vo.setOutputVoltage(data.getOutputVoltage());
|
||||||
vo.setSOC(data.getSOC());
|
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());
|
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.setChargingDegree(chargingDegree.toString());
|
||||||
vo.setSumChargingTime(monitorData.getSumChargingTime());
|
vo.setSumChargingTime(monitorData.getSumChargingTime());
|
||||||
vo.setTimeRemaining(monitorData.getTimeRemaining());
|
vo.setTimeRemaining(monitorData.getTimeRemaining());
|
||||||
@@ -602,12 +604,13 @@ public class OrderService {
|
|||||||
Collections.reverse(chargingDataList);
|
Collections.reverse(chargingDataList);
|
||||||
vo.setChargingDataList(chargingDataList);
|
vo.setChargingDataList(chargingDataList);
|
||||||
}
|
}
|
||||||
|
|
||||||
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
|
||||||
if (orderDetail != null) {
|
if (orderDetail != null) {
|
||||||
OrderAmountDetailVO billingDetails = new OrderAmountDetailVO();
|
OrderAmountDetailVO billingDetails = new OrderAmountDetailVO();
|
||||||
BeanUtils.copyBeanProp(billingDetails, orderDetail);
|
BeanUtils.copyBeanProp(billingDetails, orderDetail);
|
||||||
vo.setBillingDetails(billingDetails);
|
vo.setBillingDetails(billingDetails);
|
||||||
|
if (StringUtils.equals(OrderStatusEnum.ORDER_COMPLETE.getValue(), orderStatus)) {
|
||||||
|
vo.setChargingDegree(String.valueOf(orderDetail.getTotalUsedElectricity()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import lombok.Builder;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 联联平台推送站点信息
|
* 联联平台推送站点信息
|
||||||
*
|
*
|
||||||
@@ -47,4 +49,9 @@ public class PushStationInfoDTO {
|
|||||||
* 站点id
|
* 站点id
|
||||||
*/
|
*/
|
||||||
private Long stationId;
|
private Long stationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 要推送的第三方平台类型数组
|
||||||
|
*/
|
||||||
|
private List<String> thirdPartyTypes;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user