update 贵州平台推送数据

This commit is contained in:
Lemon
2025-07-15 11:47:48 +08:00
parent 5b8bbac7d1
commit 827070f75d
2 changed files with 30 additions and 19 deletions

View File

@@ -88,4 +88,15 @@ public class SupChargeDetails {
*/
@JSONField(name = "DetailSeviceMoney")
private BigDecimal detailSeviceMoney;
/**
* 时段服务费
* DetailServiceMoney
* 时段服务费金额单位小数点后4位
* 否
* 浮点数
* ≤8字符小数点后4位
*/
@JSONField(name = "DetailServiceMoney")
private BigDecimal detailServiceMoney;
}

View File

@@ -655,12 +655,12 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
// 拼装成平台所需格式对象
ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail);
// List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
// 先将list按照 尖、峰、平、谷 时段排序
// List<BillingPriceVO> collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList());
List<BillingPriceVO> collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList());
// 再循环该list拼装对应的充电价格、费率
// List<SupChargeDetails> chargeDetails = transformSupChargeDetails(orderDetail, billingList);
// orderInfo.setChargeDetails(chargeDetails);
List<SupChargeDetails> chargeDetails = transformSupChargeDetails(orderDetail, collect);
orderInfo.setChargeDetails(chargeDetails);
// 获取令牌
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
@@ -699,12 +699,12 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
ChargeOrderInfo orderInfo = transformChargeOrderInfo(orderBasicInfo, orderDetail);
// List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
List<BillingPriceVO> billingList = pileBillingTemplateService.queryBillingPrice(orderBasicInfo.getStationId());
// 先将list按照 尖、峰、平、谷 时段排序
// List<BillingPriceVO> collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList());
List<BillingPriceVO> collect = billingList.stream().sorted(Comparator.comparing(BillingPriceVO::getTimeType)).collect(Collectors.toList());
// 再循环该list拼装对应的充电价格、费率
// List<SupChargeDetails> chargeDetails = transformSupChargeDetails(orderDetail, billingList);
// orderInfo.setChargeDetails(chargeDetails);
List<SupChargeDetails> chargeDetails = transformSupChargeDetails(orderDetail, collect);
orderInfo.setChargeDetails(chargeDetails);
// 获取令牌
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
@@ -801,7 +801,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
connectorStatsInfo.setConnectorId(pileConnectorCode);
connectorStatsInfo.setEquipmentClassification(1);
connectorStatsInfo.setConnectorElectricity((vo.getTotalPower() != null) ? vo.getTotalPower() : BigDecimal.ZERO);
connectorStatsInfo.setConnectorElectricity((vo.getTotalPower() != null) ? vo.getTotalPower().setScale(2, RoundingMode.HALF_UP) : BigDecimal.ZERO);
connectorStatsInfo.setConnectorTotalChargeTime((vo.getChargingTime() != null) ? vo.getChargingTime() : Constants.zero);
connectorStatsInfo.setConnectorTotalChargeNum(orderVOS.size());
connectorStatsInfo.setConnectorTotalWarningNum(0);
@@ -834,7 +834,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
pileTotalPower = pileTotalPower.add((vo.getTotalPower() != null) ? vo.getTotalPower() : BigDecimal.ZERO);
pileChargeTime += (vo.getChargingTime() != null) ? vo.getChargingTime() : Constants.zero;
equipmentStatsInfo.setEquipmentElectricity(pileTotalPower); // 第一次判断时一定不会进入到这里,所以不用判断 equipmentStatsInfo 是否为 null
equipmentStatsInfo.setEquipmentElectricity(pileTotalPower.setScale(2, RoundingMode.HALF_UP)); // 第一次判断时一定不会进入到这里,所以不用判断 equipmentStatsInfo 是否为 null
equipmentStatsInfo.setEquipmentTotalChargeTime(pileChargeTime);
connectorStatsInfoList.add(connectorStatsInfo);
@@ -858,7 +858,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
.startTime(startTime)
.endTime(endTime)
.stationElectricity(stationTotalElectricity)
.stationTotalChargeEnergy(stationTotalElectricity)
.stationTotalChargeEnergy(stationTotalElectricity.setScale(2, RoundingMode.HALF_UP))
.stationTotalChargeNum(orderVOS.size())
.stationTotalChargeTime(stationChargeTime)
.stationTotalWarningNum(0)
@@ -1051,10 +1051,10 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
.flatElect(orderDetail.getFlatUsedElectricity())
.valleyElect(orderDetail.getValleyUsedElectricity())
.pushTimeStamp(DateUtils.getDateTime())
.totalElecMoney(orderDetail.getTotalElectricityAmount())
.totalSeviceMoney(orderDetail.getTotalServiceAmount())
.totalServiceMoney(orderDetail.getTotalServiceAmount())
.totalMoney(orderDetail.getTotalOrderAmount())
.totalElecMoney(orderDetail.getTotalElectricityAmount().setScale(2, RoundingMode.HALF_UP))
.totalSeviceMoney(orderDetail.getTotalServiceAmount().setScale(2, RoundingMode.HALF_UP))
.totalServiceMoney(orderDetail.getTotalServiceAmount().setScale(2, RoundingMode.HALF_UP))
.totalMoney(orderDetail.getTotalOrderAmount().setScale(2, RoundingMode.HALF_UP))
.stopReason(2)
.stopDesc(orderBasicInfo.getReason())
.sumPeriod(0)
@@ -1095,7 +1095,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setDetailPower(orderDetail.getSharpUsedElectricity());
detail.setDetailElecMoney(orderDetail.getSharpElectricityPrice());
detail.setDetailSeviceMoney(orderDetail.getSharpServicePrice());
detail.setDetailServiceMoney(orderDetail.getSharpServicePrice());
} else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.PEAK.getValue())) {
// 峰时段
detail.setDetailStartTime(DateUtils.getDateTime());
@@ -1104,7 +1104,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setDetailPower(orderDetail.getPeakUsedElectricity());
detail.setDetailElecMoney(orderDetail.getPeakElectricityPrice());
detail.setDetailSeviceMoney(orderDetail.getPeakServicePrice());
detail.setDetailServiceMoney(orderDetail.getPeakServicePrice());
} else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.FLAT.getValue())) {
// 平时段
detail.setDetailStartTime(DateUtils.getDateTime());
@@ -1113,7 +1113,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setDetailPower(orderDetail.getFlatUsedElectricity());
detail.setDetailElecMoney(orderDetail.getFlatElectricityPrice());
detail.setDetailSeviceMoney(orderDetail.getFlatServicePrice());
detail.setDetailServiceMoney(orderDetail.getFlatServicePrice());
} else if (StringUtils.equals(billingPriceVO.getTimeType(), BillingTimeTypeEnum.VALLEY.getValue())) {
// 谷时段
detail.setDetailStartTime(DateUtils.getDateTime());
@@ -1122,7 +1122,7 @@ public class GuiZhouPlatformServiceImpl implements ThirdPartyPlatformService {
detail.setSevicePrice(new BigDecimal(billingPriceVO.getServicePrice()).setScale(4, BigDecimal.ROUND_HALF_UP));
detail.setDetailPower(orderDetail.getValleyUsedElectricity());
detail.setDetailElecMoney(orderDetail.getValleyElectricityPrice());
detail.setDetailSeviceMoney(orderDetail.getValleyServicePrice());
detail.setDetailServiceMoney(orderDetail.getValleyServicePrice());
}
resultList.add(detail);
}