update 重试运营商分账接口

This commit is contained in:
Lemon
2025-10-10 13:10:56 +08:00
parent 6a0547c596
commit 1489505e86

View File

@@ -1,5 +1,7 @@
package com.jsowell.service;
import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.jsowell.adapay.service.AdapayService;
import com.jsowell.common.constant.Constants;
import com.jsowell.pile.domain.OrderSplitRecord;
import com.jsowell.pile.dto.DebugOrderDTO;
@@ -22,20 +24,25 @@ public class SplitBillService {
@Autowired
private TempService tempService;
@Autowired
private AdapayService adapayService;
/**
* 重试运营商分账
* @param dto
*/
public void retryMerchantSplit(QueryOrderSplitRecordDTO dto) {
public void retryMerchantSplit(QueryOrderSplitRecordDTO dto) throws BaseAdaPayException {
// 首先根据 merchantId、startTime、endTime 查出日期区间内所有订单信息(包括 paymentId
List<OrderSplitRecord> recordList = orderBasicInfoService.getSplitOrders(dto);
// 获取 paymentIdList
List<String> paymentIdList = recordList.stream()
.map(OrderSplitRecord::getPaymentId)
.collect(Collectors.toList());
// 判断订单是否已经成功分账
// adapayService.checkOrderSplitStatus(list);
// 将未分账的订单进行筛选、汇总
List<String> paymenIdList = new ArrayList<>();
List<String> unSplitPaymentIdList = adapayService.getSplitInfoByPaymentIdList(paymentIdList);
// 将 paymentIdList 与 recordList 进行匹配,筛选出 orderCodeList
Set<String> paymentIdSet = new HashSet<>(paymenIdList);
Set<String> paymentIdSet = new HashSet<>(unSplitPaymentIdList);
List<String> orderCodeList = recordList.stream()
.filter(record -> paymentIdSet.contains(record.getPaymentId()))
.map(OrderSplitRecord::getOrderCode)