add添加临时接口批量处理白名单异常订单接口

This commit is contained in:
YAS\29473
2025-11-14 14:15:17 +08:00
parent 564f6f16b4
commit 82ed8539e5
2 changed files with 50 additions and 0 deletions

View File

@@ -139,6 +139,9 @@ public class TempService {
@Autowired
private MemberWalletInfoService memberWalletInfoService;
@Autowired
private OrderService orderService;
/**
* 计算订单耗电量
* 内蒙古站点
@@ -1495,5 +1498,35 @@ public class TempService {
return list;
}
public void whiteListSettlement(QueryOrderDTO dto) {
if (dto == null || dto.getOrderCodeList() == null || dto.getOrderCodeList().isEmpty()) {
throw new RuntimeException("请添加要结算的白名单订单");
}
for (String orderCode : dto.getOrderCodeList()) {
OrderBasicInfo orderBasicInfo = orderBasicInfoMapper.getOrderInfoByOrderCode(orderCode);
if (orderBasicInfo == null) {
throw new RuntimeException("订单号不存在:" + orderCode);
}
if (!Objects.equals(orderBasicInfo.getOrderStatus(), OrderStatusEnum.ABNORMAL.getValue())) {
throw new RuntimeException("订单不是异常订单:" + orderCode);
}
if (!Objects.equals(orderBasicInfo.getPayMode(), PayModeEnum.PAYMENT_OF_WHITELIST.getValue())) {
throw new RuntimeException("订单不是白名单支付方式:" + orderCode);
}
ManualSettlementDTO build = ManualSettlementDTO.builder()
.chargingDegree("0")
.chargingAmount("0")
.orderCode(orderCode)
.build();
orderService.manualSettlementOrder(build);
}
}
}