diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index 212a9aae6..38b5ab9ca 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -494,9 +494,10 @@ public class SpringBootTestController { public void queryPaymentConfirmListTest() { QueryPaymentConfirmDTO dto = new QueryPaymentConfirmDTO(); dto.setWechatAppId("wxbb3e0d474569481d"); - dto.setPaymentId("002212023090917453610546519740849975296"); - QueryPaymentConfirmDetailResponse queryPaymentConfirmDetailResponse = adapayService.queryPaymentConfirmList(dto); - System.out.println(JSON.toJSONString(queryPaymentConfirmDetailResponse)); + // dto.setPaymentId("0022120230910032226990546664907296944128"); + dto.setPaymentConfirmId("0022120230910032226990546664907296944128"); + QueryPaymentConfirmDetailResponse.PaymentConfirmInfo paymentConfirmInfo = adapayService.queryPaymentConfirmDetail(dto); + System.out.println(JSON.toJSONString(paymentConfirmInfo)); } @Test diff --git a/jsowell-pile/src/main/java/com/jsowell/adapay/dto/QueryPaymentConfirmDTO.java b/jsowell-pile/src/main/java/com/jsowell/adapay/dto/QueryPaymentConfirmDTO.java index 8ffe3a59a..dd64e02a1 100644 --- a/jsowell-pile/src/main/java/com/jsowell/adapay/dto/QueryPaymentConfirmDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/adapay/dto/QueryPaymentConfirmDTO.java @@ -19,4 +19,9 @@ public class QueryPaymentConfirmDTO { * Adapay生成的支付对象id */ private String paymentId; + + /** + * Adapay生成的支付确认对象id + */ + private String paymentConfirmId; } diff --git a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java index b1df11ab8..58a40550b 100644 --- a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java +++ b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java @@ -1019,6 +1019,27 @@ public class AdapayService { return queryPaymentConfirmDetailResponse; } + /** + * 查询支付确认对象详情 + */ + public QueryPaymentConfirmDetailResponse.PaymentConfirmInfo queryPaymentConfirmDetail(QueryPaymentConfirmDTO dto) { + AbstractAdapayConfig config = AdapayConfigFactory.getConfig(dto.getWechatAppId()); + if (config == null) { + throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_CONFIG_IS_NULL_ERROR); + } + Map confirmParams = Maps.newHashMap(); + confirmParams.put("payment_confirm_id", dto.getPaymentConfirmId()); + + QueryPaymentConfirmDetailResponse.PaymentConfirmInfo result = null; + try { + Map paymentConfirm = PaymentConfirm.query(confirmParams, config.getWechatAppId()); + result = JSON.parseObject(JSON.toJSONString(paymentConfirm), QueryPaymentConfirmDetailResponse.PaymentConfirmInfo.class); + } catch (BaseAdaPayException e) { + throw new RuntimeException(e); + } + return result; + } + /** * 查询账务流水 */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index 6f7ede398..bae0da757 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java @@ -1558,7 +1558,8 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService { JSONObject jsonObject = JSON.parseObject(confirm.getDescription()); if (StringUtils.equals(jsonObject.getString("orderCode"), orderCode)) { // 订单号对的上,累计分账金额 - confirmAmt = confirmAmt.add(new BigDecimal(confirm.getConfirmedAmt())); + BigDecimal amount = new BigDecimal(confirm.getConfirmedAmt()); + confirmAmt = confirmAmt.add(amount); feeAmt = feeAmt.add(new BigDecimal(confirm.getFeeAmt())); } }