| | |
| | | private final GuideWithdrawalAccountMapper accountMapper; |
| | | private final GuideUserService guideUserService; |
| | | private final DouGongBasicDataBiz douGongBasicDataBiz; |
| | | private final GuideWithdrawableBalanceService balanceService; |
| | | |
| | | public GuideElectronicLedgerService(GuideWithdrawalAccountMapper accountMapper, |
| | | GuideUserService guideUserService, |
| | | DouGongBasicDataBiz douGongBasicDataBiz) { |
| | | DouGongBasicDataBiz douGongBasicDataBiz, |
| | | GuideWithdrawableBalanceService balanceService) { |
| | | this.accountMapper = accountMapper; |
| | | this.guideUserService = guideUserService; |
| | | this.douGongBasicDataBiz = douGongBasicDataBiz; |
| | | this.balanceService = balanceService; |
| | | } |
| | | |
| | | public GuideElectronicLedgerResponse create(Long guideId, GuideElectronicLedgerRequest request) { |
| | |
| | | if (!StringUtils.hasText(account.getHuifuId())) { |
| | | throw new BusinessException(409, "请先完成斗拱进件"); |
| | | } |
| | | try { |
| | | return douGongBasicDataBiz.balanceQuery(account.getHuifuId()); |
| | | } catch (Exception exception) { |
| | | throw new BusinessException(502, "斗拱账户余额查询失败"); |
| | | } |
| | | return balanceService.getAvailableAmount(guideId); |
| | | } |
| | | |
| | | private GuideWithdrawalAccount findCurrent(Long guideId) { |