update 批量订单退款接口

This commit is contained in:
2023-08-31 17:31:19 +08:00
parent 7fe676efdb
commit fa5ecb02dd
4 changed files with 42 additions and 3 deletions

View File

@@ -404,4 +404,18 @@ public class TempController extends BaseController {
orderService.adapayRefund(dto);
return new RestApiResponse<>();
}
/**
* 批量订单退款
* 支持在线支付/余额支付
*/
@PostMapping("/batchRefundOrder")
public RestApiResponse<?> batchRefundOrder(@RequestBody QueryOrderDTO dto) {
try {
tempService.batchRefundOrder(dto.getOrderCodeList());
} catch (Exception e) {
logger.error("批量订单退款error", e);
}
return new RestApiResponse<>();
}
}

View File

@@ -428,4 +428,17 @@ public class TempService {
resultMap.put("unClearingList", unClearingList);
return resultMap;
}
public void batchRefundOrder(List<String> orderCodeList) throws BaseAdaPayException {
List<OrderBasicInfo> orderBasicInfos = orderBasicInfoService.queryOrderList(orderCodeList);
for (OrderBasicInfo orderBasicInfo : orderBasicInfos) {
String payMode = orderBasicInfo.getPayMode();
if (StringUtils.equals(payMode, OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) {
orderBasicInfoService.retryRefundOrder(orderBasicInfo);
} else {
orderBasicInfoService.orderPaymentSettlementAndRefund(orderBasicInfo);
}
// logger.info("批量进行问题订单退款orderCode:{}, result:{}", orderBasicInfo.getOrderCode(), JSON.toJSONString(result));
}
}
}