| | |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberWalletService; |
| | | import cc.mrbird.febs.mall.service.IMallMoneyFlowService; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cc.mrbird.febs.pay.model.SinglePayDto; |
| | | import cc.mrbird.febs.pay.service.UnipayService; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | |
| | | private final MallShopApplyMapper mallShopApplyMapper; |
| | | |
| | | private final IMallMoneyFlowService mallMoneyFlowService; |
| | | private final UnipayService unipayService; |
| | | private final MallMemberBankMapper mallMemberBankMapper; |
| | | |
| | | @Override |
| | | public IPage<MallMember> getMallMemberList(MallMember mallMember, QueryRequest request) { |
| | |
| | | if(1 != mallMemberWithdraw.getStatus()){ |
| | | return new FebsResponse().fail().message("当前状态不是提现中"); |
| | | } |
| | | mallMemberWithdraw.setStatus(2); |
| | | mallMemberWithdrawMapper.updateById(mallMemberWithdraw); |
| | | |
| | | QueryWrapper<MallMoneyFlow> objectQueryWrapper = new QueryWrapper<>(); |
| | | objectQueryWrapper.eq("order_no",mallMemberWithdraw.getWithdrawNo()); |
| | | objectQueryWrapper.eq("type",MoneyFlowTypeEnum.WITHDRAWAL.getValue()); |
| | | MallMoneyFlow mallMoneyFlow = mallMoneyFlowMapper.selectOne(objectQueryWrapper); |
| | | mallMoneyFlow.setStatus(2); |
| | | mallMoneyFlowMapper.updateById(mallMoneyFlow); |
| | | Long wtihdrawTypeId = mallMemberWithdraw.getWtihdrawTypeId(); |
| | | MallMemberBank mallMemberBank = mallMemberBankMapper.selectById(wtihdrawTypeId); |
| | | /** |
| | | * 调用汇聚代付 |
| | | */ |
| | | SinglePayDto singlePayDto = new SinglePayDto(); |
| | | singlePayDto.setMerchantOrderNo(mallMemberWithdraw.getWithdrawNo()); |
| | | singlePayDto.setReceiverAccountNoEncBankNo(mallMemberBank.getBankNo()); |
| | | singlePayDto.setReceiverAccountNoEncName(mallMemberBank.getName()); |
| | | singlePayDto.setReceiverAccountType("201"); |
| | | BigDecimal paidAmount = mallMemberWithdraw.getAmount().subtract(mallMemberWithdraw.getAmountFee()).setScale(2, BigDecimal.ROUND_DOWN); |
| | | singlePayDto.setPaidAmount(paidAmount); |
| | | singlePayDto.setCurrency("201"); |
| | | singlePayDto.setIsChecked("202"); |
| | | singlePayDto.setPaidDesc("用户提现"); |
| | | singlePayDto.setPaidUse("202"); |
| | | String singlePayRep = unipayService.singlePay(singlePayDto); |
| | | if(!mallMemberWithdraw.getWithdrawNo().equals(singlePayRep)){ |
| | | return new FebsResponse().fail().message("提现失败,请稍后查看错误信息一览"); |
| | | } |
| | | |
| | | return new FebsResponse().success(); |
| | | } |
| | |
| | | if(1 != mallMemberWithdraw.getStatus()){ |
| | | return new FebsResponse().fail().message("当前状态不是提现中"); |
| | | } |
| | | |
| | | mallMemberWithdraw.setStatus(3); |
| | | mallMemberWithdrawMapper.updateById(mallMemberWithdraw); |
| | | |
| | |
| | | mallMoneyFlow.setStatus(3); |
| | | mallMoneyFlowMapper.updateById(mallMoneyFlow); |
| | | |
| | | //用户钱包增加对应的余额 |
| | | iApiMallMemberWalletService.addBalance(mallMoneyFlow.getAmount().negate(),mallMoneyFlow.getMemberId()); |
| | | //用户佣金增加对应的余额 |
| | | iApiMallMemberWalletService.add(mallMemberWithdraw.getAmount(),mallMemberWithdraw.getMemberId(),"commission"); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateShopApply(MallShopApply apply) { |
| | | MallShopApply mallShopApply = mallShopApplyMapper.selectById(apply.getId()); |
| | | mallShopApply.setName(apply.getName()); |
| | | mallShopApply.setPhone(apply.getPhone()); |
| | | mallShopApply.setIdcard(apply.getIdcard()); |
| | | mallShopApply.setBusinessLicense(apply.getBusinessLicense()); |
| | | mallShopApply.setSaleArea(apply.getSaleArea()); |
| | | mallShopApply.setShopName(apply.getShopName()); |
| | | mallShopApplyMapper.updateById(mallShopApply); |
| | | } |
| | | |
| | | @Override |
| | | public AdminMallMemberPaymentVo getMallBankInfoById(long id) { |
| | | |
| | | MallMemberWithdraw mallMemberWithdraw = mallMemberWithdrawMapper.selectById(id); |
| | | Long wtihdrawTypeId = mallMemberWithdraw.getWtihdrawTypeId(); |
| | | MallMemberBank mallMemberBank = mallMemberBankMapper.selectById(wtihdrawTypeId); |
| | | AdminMallMemberPaymentVo adminMallMemberPaymentVo = new AdminMallMemberPaymentVo(); |
| | | if(ObjectUtil.isNotEmpty(mallMemberBank)){ |
| | | adminMallMemberPaymentVo.setBankNo(mallMemberBank.getBankNo()); |
| | | adminMallMemberPaymentVo.setBankName(mallMemberBank.getName()); |
| | | } |
| | | return adminMallMemberPaymentVo; |
| | | } |
| | | |
| | | private String refererIds(String parentId) { |
| | | boolean flag = false; |
| | | if (StrUtil.isBlank(parentId)) { |