mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
定时任务处理未分帐订单
This commit is contained in:
@@ -67,6 +67,8 @@ public class AdapayService {
|
||||
@Value("${adapay.callback}")
|
||||
private String ADAPAY_CALLBACK_URL;
|
||||
|
||||
String wechatAppId1 = "wxbb3e0d474569481d"; // 万车充
|
||||
|
||||
@Autowired
|
||||
private AdapayMemberAccountService adapayMemberAccountService;
|
||||
|
||||
@@ -1214,6 +1216,8 @@ public class AdapayService {
|
||||
|
||||
/**
|
||||
* 查询支付确认对象列表
|
||||
* paymentId 必传
|
||||
* wechatAppId 必传
|
||||
*/
|
||||
public QueryPaymentConfirmDetailResponse queryPaymentConfirmList(QueryPaymentConfirmDTO dto) {
|
||||
QueryPaymentConfirmDetailResponse response = null;
|
||||
@@ -1439,4 +1443,60 @@ public class AdapayService {
|
||||
settleAccountDTO.setAreaCode(dto.getAreaCode());
|
||||
this.createSettleAccountRequest(settleAccountDTO, adapayMemberId, wechatAppId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询支付撤销状态
|
||||
* @param confirm
|
||||
* @return
|
||||
* @throws BaseAdaPayException
|
||||
*/
|
||||
public boolean queryConfirmReverseStatus(PaymentConfirmInfo confirm) throws BaseAdaPayException {
|
||||
boolean result = false;
|
||||
QueryConfirmReverseDTO dto = QueryConfirmReverseDTO.builder()
|
||||
.paymentConfirmId(confirm.getId())
|
||||
.wechatAppId(wechatAppId1)
|
||||
.build();
|
||||
ConfirmReverseResponse confirmReverseResponse = this.queryConfirmReverse(dto);
|
||||
if (confirmReverseResponse.isSuccess()) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据paymentId查询总分账金额
|
||||
* 万车充专用
|
||||
* @param paymentId
|
||||
* @return
|
||||
* @throws BaseAdaPayException
|
||||
*/
|
||||
public BigDecimal getTotalSplitAmountByPaymentId(String paymentId) throws BaseAdaPayException {
|
||||
BigDecimal totalSplitAmount = BigDecimal.ZERO;
|
||||
// 查询支付确认id
|
||||
QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO();
|
||||
dto.setPaymentId(paymentId);
|
||||
dto.setWechatAppId(wechatAppId1);
|
||||
// 查询分账信息
|
||||
QueryPaymentConfirmDetailResponse response = this.queryPaymentConfirmList(dto);
|
||||
if (response == null) {
|
||||
return totalSplitAmount;
|
||||
}
|
||||
|
||||
List<PaymentConfirmInfo> confirms = response.getPaymentConfirms();
|
||||
if (CollectionUtils.isEmpty(confirms)) {
|
||||
return totalSplitAmount;
|
||||
}
|
||||
|
||||
for (PaymentConfirmInfo confirm : confirms) {
|
||||
if (queryConfirmReverseStatus(confirm)) {
|
||||
log.info("支付确认id:{}撤销了。。。", confirm.getId());
|
||||
continue;
|
||||
}
|
||||
BigDecimal confirmedAmt = new BigDecimal(confirm.getConfirmedAmt()); // 已确认金额
|
||||
// 汇总已确认金额
|
||||
totalSplitAmount = totalSplitAmount.add(confirmedAmt);
|
||||
}
|
||||
|
||||
return totalSplitAmount;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user