mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
新增 后管批量手动退款临时接口
This commit is contained in:
@@ -727,4 +727,25 @@ public class TempController extends BaseController {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 重试订单退款接口/重试退款按钮 (批量)
|
||||
* http://localhost:8080/order/retryRefundOrderBatch
|
||||
*/
|
||||
@PostMapping("/retryRefundOrderBatch")
|
||||
public RestApiResponse<?> retryRefundOrderBatch(@RequestBody ApplyRefundDTO dto) {
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
orderBasicInfoService.retryRefundOrderList(dto.getOrderCoderList());
|
||||
response = new RestApiResponse<>();
|
||||
} catch (BusinessException e) {
|
||||
logger.error("批量重试订单退款接口 error,", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("批量重试订单退款接口 error,", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,4 +51,6 @@ public class ApplyRefundDTO {
|
||||
* 钱包编号
|
||||
*/
|
||||
private String walletCode;
|
||||
|
||||
private List<String> orderCoderList;
|
||||
}
|
||||
|
||||
@@ -541,4 +541,6 @@ public interface OrderBasicInfoService{
|
||||
* @return
|
||||
*/
|
||||
List<String> tempGetOrderCodes(QueryOrderDTO dto);
|
||||
|
||||
void retryRefundOrderList(List<String> orderCoderList);
|
||||
}
|
||||
|
||||
@@ -2328,7 +2328,23 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
if (CollectionUtils.isEmpty(orderCodeList)) {
|
||||
return resultList;
|
||||
}
|
||||
return orderBasicInfoMapper.queryOrderList(orderCodeList);
|
||||
List<OrderBasicInfo> orderBasicInfos = orderBasicInfoMapper.queryOrderList(orderCodeList);
|
||||
for (OrderBasicInfo orderBasicInfo : orderBasicInfos) {
|
||||
String orderCode = orderBasicInfo.getOrderCode();
|
||||
// 给每个订单查询结果设置缓存
|
||||
// 如果orderCode是00000000000000000000000000000000,直接continue
|
||||
if (StringUtils.equals(Constants.ILLEGAL_TRANSACTION_CODE, orderCode)) {
|
||||
continue;
|
||||
}
|
||||
// 查缓存
|
||||
String redisKey = CacheConstants.GET_ORDER_INFO_BY_ORDER_CODE + orderCode;
|
||||
OrderBasicInfo redisInfo = redisCache.getCacheObject(redisKey);
|
||||
// 如果该订单缓存为空,重新设置缓存
|
||||
if (redisInfo == null) {
|
||||
redisCache.setCacheObject(redisKey, orderBasicInfo, 5, TimeUnit.MINUTES);
|
||||
}
|
||||
}
|
||||
return orderBasicInfos;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3997,6 +4013,20 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
}
|
||||
}
|
||||
|
||||
public void retryRefundOrderList(List<String> orderCodeList) {
|
||||
// 批量查订单信息
|
||||
List<OrderBasicInfo> orderBasicInfos = queryOrderList(orderCodeList);
|
||||
if (CollectionUtils.isNotEmpty(orderBasicInfos)) {
|
||||
orderBasicInfos.forEach(orderBasicInfo -> {
|
||||
try {
|
||||
retryRefundOrder(orderBasicInfo);
|
||||
} catch (BaseAdaPayException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void retryRefundOrder(OrderBasicInfo orderBasicInfo) throws BaseAdaPayException {
|
||||
if (orderBasicInfo == null) {
|
||||
|
||||
Reference in New Issue
Block a user