mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
add添加临时接口批量处理白名单异常订单接口
This commit is contained in:
@@ -1035,4 +1035,21 @@ public class TempController extends BaseController {
|
||||
util.exportExcel(response, list, "某运营商财务报表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量结算白名单异常订单
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public RestApiResponse<?> whiteListSettlement(@RequestBody QueryOrderDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
tempService.whiteListSettlement(dto);
|
||||
response = new RestApiResponse<>();
|
||||
} catch (Exception e){
|
||||
logger.error("白名单异常订单结算 error", e);
|
||||
response = new RestApiResponse<>("00300002", "白名单异常订单结算异常");
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user