diff --git a/src/main/java/com/yn/bftl/thirdparty/modules/business/service/impl/SubaccountServiceImpl.java b/src/main/java/com/yn/bftl/thirdparty/modules/business/service/impl/SubaccountServiceImpl.java index 12f54be..53e47a5 100644 --- a/src/main/java/com/yn/bftl/thirdparty/modules/business/service/impl/SubaccountServiceImpl.java +++ b/src/main/java/com/yn/bftl/thirdparty/modules/business/service/impl/SubaccountServiceImpl.java @@ -36,6 +36,7 @@ import com.yn.bftl.thirdparty.modules.business.service.SubaccountService; import com.yn.bftl.thirdparty.modules.business.abstracts.AbstractBusinessService; import com.yn.bftl.thirdparty.modules.chinaums.dto.BrandAuthFeeDTO; +import com.yn.bftl.thirdparty.modules.chinaums.dto.byx.ByxChinaumsGuaranteePayConfirmsDTO; import com.yn.bftl.thirdparty.modules.chinaums.dto.chinaums.ChinaumsAllocationsDTO; import com.yn.bftl.thirdparty.modules.chinaums.dto.chinaums.ChinaumsGuaranteePayConfirmsDTO; import com.yn.bftl.thirdparty.modules.chinaums.dto.chinaums.ChinaumsGuaranteePayExtraDTO; @@ -1430,6 +1431,7 @@ } private void handleSubaccountStatusSuccess(Subaccount subaccount, String finishedAt) { + // 服务费 if (subaccount.getSubaccountType().equals(SubaccountType.SERVICE_FEE)) { handleSubaccountTypeServiceFee(subaccount); } @@ -1440,7 +1442,6 @@ // 货款、品牌费、策划费 else { handleSubaccountTypeOtherFee(subaccount, finishedAt); - } subaccount.setSubaccountState(SubaccountState.SEPARATE_SUCC); subaccount.setSeparateTime(DateTimeUtils.getLocalDateTimeByRFC3339(finishedAt)); @@ -2377,11 +2378,22 @@ .amount(platformServiceFee.multiply(new BigDecimal(100)).intValue()) .extra(chinaumsGuaranteePayExtraDTO) .build(); + ByxChinaumsGuaranteePayConfirmsDTO byxChinaumsGuaranteePayConfirmsDTO = ByxChinaumsGuaranteePayConfirmsDTO + .builder() + .mctOrderNo(platformSubaccountList.get(0).getSubaccountNo()) + .oriTransOrderNo(chinaumsPayment.getGuaranteePaymentId()) + .platformWalletId(balanceAcctId) + .settAmt(platformServiceFee.multiply(new BigDecimal(100)).longValue()) + .isFinished("N") + .bizType("030001") //担保支付 030001 + .build(); + + try { - ChinaumsGuaranteePayConfirmsVO chinaumsGuaranteePayConfirmsVO = walletService.paySettlement(chinaumsGuaranteePayConfirmsDTO); - writeSeparateLog(String.format("[分账][生成][普通订单][%s],生成分账单成功,银联结算单号[%s]。", order.getSn(), chinaumsGuaranteePayConfirmsVO.getCombinedGuaranteeConfirmId())); + String externalId = walletService.paySettlementConfirms(byxChinaumsGuaranteePayConfirmsDTO); + writeSeparateLog(String.format("[分账][生成][普通订单][%s],生成分账单成功,银联结算单号[%s]。", order.getSn(), externalId)); for (Subaccount subaccount : platformSubaccountList) { - subaccount.setExternalId(chinaumsGuaranteePayConfirmsVO.getCombinedGuaranteeConfirmId()); + subaccount.setExternalId(externalId); subaccountRepository.saveAndFlush(subaccount); handleSubaccountStatus(subaccount, false); }