update临时接口条件统计订单数量

This commit is contained in:
YAS\29473
2025-07-07 08:23:41 +08:00
parent 2933816266
commit caf20dc6ec
5 changed files with 160 additions and 12 deletions

View File

@@ -602,8 +602,17 @@ public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
BigDecimal totalElectricityAmount = orderDetail.getTotalElectricityAmount() == null ? BigDecimal.ZERO : orderDetail.getTotalElectricityAmount();
BigDecimal totalServiceAmount = orderDetail.getTotalServiceAmount() == null ? BigDecimal.ZERO : orderDetail.getTotalServiceAmount();
// 通过订单号查询实时数据
List<RealTimeMonitorData> realTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
RealTimeMonitorData data = realTimeData.get(0);
if (CollectionUtils.isEmpty(realTimeData)) {
throw new BusinessException(ReturnCodeEnum.valueOf("没有实时记录"));
}
String chargingAmount = data.getChargingAmount() == null ? Constants.ZERO : data.getChargingAmount();
String chargingDegree = data.getChargingDegree() == null ? Constants.ZERO : data.getChargingDegree();
Integer orderStatus = OrderStatusEnum.convertToNewStatus(orderInfo.getOrderStatus());
Integer connectorStatus = info.getStatus();
if(connectorStatus == Integer.parseInt(PileConnectorDataBaseStatusEnum.OFF_NETWORK.getValue())){
@@ -619,10 +628,10 @@ public class ChangZhouPlatformServiceImpl implements ThirdPartyPlatformService {
.soc(new BigDecimal(soc))
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) // 开始时间
.endTime(DateUtils.getDateTime()) // 本次采样时间
.totalPower(info.getChargingDegree()) // 累计充电量
.totalPower(new BigDecimal(chargingDegree).setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计充电量
.elecMoney(totalElectricityAmount.setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计电费
.seviceMoney(totalServiceAmount.setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计服务费
.totalMoney(info.getChargingAmount()) // 已充金额
.totalMoney(new BigDecimal(chargingAmount).setScale(2, BigDecimal.ROUND_HALF_UP)) // 已充金额
.build();
String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_EQUIP_CHARGE_STATUS.getValue();

View File

@@ -826,6 +826,35 @@ public class WeiWangKuaiDianPlatformServiceImpl implements ThirdPartyPlatformSer
BigDecimal totalElectricityAmount = orderDetail.getTotalElectricityAmount() == null ? BigDecimal.ZERO : orderDetail.getTotalElectricityAmount();
BigDecimal totalServiceAmount = orderDetail.getTotalServiceAmount() == null ? BigDecimal.ZERO : orderDetail.getTotalServiceAmount();
// 通过订单号查询实时数据
String orderStatus = orderInfo.getOrderStatus();
int connectorStatus = 0;
List<RealTimeMonitorData> realTimeData = orderBasicInfoService.getChargingRealTimeData(orderInfo.getTransactionCode());
RealTimeMonitorData data = realTimeData.get(0);
if (CollectionUtils.isEmpty(realTimeData)) {
throw new BusinessException(ReturnCodeEnum.valueOf("没有实时记录"));
} else {
if (StringUtils.equals(orderStatus , OrderStatusEnum.IN_THE_CHARGING.getValue())) {
// 充电中
orderStatus = "2";
} else if (StringUtils.equals(orderStatus , OrderStatusEnum.ORDER_COMPLETE.getValue())) {
// 充电完成
orderStatus = "4";
} else {
// 直接给 5-未知
orderStatus = "5";
}
String status = data.getConnectorStatus();
if (StringUtils.isBlank(status)) {
// 查询当前枪口状态
PileConnectorInfoVO connectorInfoVO = pileConnectorInfoService.getPileConnectorInfoByConnectorCode(orderInfo.getPileConnectorCode());
connectorStatus = connectorInfoVO.getStatus();
} else {
connectorStatus = Integer.parseInt(status);
}
}
String chargingAmount = data.getChargingAmount() == null ? Constants.ZERO : data.getChargingAmount();
String chargingDegree = data.getChargingDegree() == null ? Constants.ZERO : data.getChargingDegree();
QueryChargingStatusVO vo = QueryChargingStatusVO.builder()
.startChargeSeq(orderInfo.getOrderCode()) // 订单号
@@ -837,10 +866,10 @@ public class WeiWangKuaiDianPlatformServiceImpl implements ThirdPartyPlatformSer
.soc(new BigDecimal(soc))
.startTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, orderInfo.getChargeStartTime())) // 开始时间
.endTime(DateUtils.getDateTime()) // 本次采样时间
.totalPower(info.getChargingDegree()) // 累计充电量
.totalPower(new BigDecimal(chargingDegree).setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计充电量
.elecMoney(totalElectricityAmount.setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计电费
.seviceMoney(totalServiceAmount.setScale(2, BigDecimal.ROUND_HALF_UP)) // 累计服务费
.totalMoney(info.getChargingAmount()) // 已充金额
.totalMoney(new BigDecimal(chargingAmount).setScale(2, BigDecimal.ROUND_HALF_UP)) // 已充金额
.build();
String url = urlAddress + BusinessInformationExchangeEnum.NOTIFICATION_EQUIP_CHARGE_STATUS.getValue();