定时任务处理未分帐订单

This commit is contained in:
Guoqs
2025-04-17 10:03:33 +08:00
parent ba92e1317b
commit ed98a6bebe
4 changed files with 92 additions and 29 deletions

View File

@@ -10,10 +10,8 @@ import com.jsowell.JsowellApplication;
import com.jsowell.adapay.common.DivMember;
import com.jsowell.adapay.common.PaymentConfirmInfo;
import com.jsowell.adapay.dto.PaymentConfirmParam;
import com.jsowell.adapay.dto.QueryConfirmReverseDTO;
import com.jsowell.adapay.dto.QueryPaymentConfirmDTO;
import com.jsowell.adapay.operation.PaymentReverseOperation;
import com.jsowell.adapay.response.ConfirmReverseResponse;
import com.jsowell.adapay.response.PaymentConfirmResponse;
import com.jsowell.adapay.response.PaymentReverseResponse;
import com.jsowell.adapay.response.QueryPaymentConfirmDetailResponse;
@@ -349,6 +347,17 @@ public class PaymentTestController {
}
}
@Test
public void getTotalSplitAmountByPaymentIdTest() {
String paymentId = "002212023102523235110563274707384705024";
try {
BigDecimal amount = adapayService.getTotalSplitAmountByPaymentId(paymentId);
System.out.println("分账金额: " + amount);
} catch (BaseAdaPayException e) {
throw new RuntimeException(e);
}
}
/**
* 查询分账信息
@@ -385,7 +394,7 @@ public class PaymentTestController {
} else {
splitList.add(paymentId);
for (PaymentConfirmInfo confirm : confirms) {
if (queryConfirmReverseStatus(confirm)) {
if (adapayService.queryConfirmReverseStatus(confirm)) {
System.out.println("支付确认id:" + confirm.getId() + "撤销了。。。");
continue;
}
@@ -431,26 +440,6 @@ public class PaymentTestController {
System.out.println("===================自己:" + JSON.toJSONString(selfList) + ", 数量:" + selfList.size());
}
/**
* 查询支付撤销状态
* @param confirm
* @return
* @throws BaseAdaPayException
*/
private boolean queryConfirmReverseStatus(PaymentConfirmInfo confirm) throws BaseAdaPayException {
boolean result = false;
QueryConfirmReverseDTO dto = QueryConfirmReverseDTO.builder()
.paymentConfirmId(confirm.getId())
.wechatAppId(wechatAppId1)
.build();
ConfirmReverseResponse confirmReverseResponse = adapayService.queryConfirmReverse(dto);
if (confirmReverseResponse.isSuccess()) {
result = true;
}
return result;
}
/**
* 批量支付确认撤销
* @throws BaseAdaPayException