From 0cc73a9ffcdd356e0b797e458b400acfb660da94 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期日, 15 六月 2025 02:26:06 +0800 Subject: [PATCH] 更新用户端功能 --- UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/account/server/impl/UserWithdrawalServiceImpl.java | 71 ++++++++--------------------------- 1 files changed, 17 insertions(+), 54 deletions(-) diff --git a/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/account/server/impl/UserWithdrawalServiceImpl.java b/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/account/server/impl/UserWithdrawalServiceImpl.java index b0eff41..cf47648 100644 --- a/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/account/server/impl/UserWithdrawalServiceImpl.java +++ b/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/account/server/impl/UserWithdrawalServiceImpl.java @@ -3,25 +3,13 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.shiro.ShiroKit; -import com.stylefeng.guns.core.util.ToolUtil; -import com.stylefeng.guns.modular.account.dao.UserBankAccountMapper; import com.stylefeng.guns.modular.account.dao.UserWithdrawalMapper; import com.stylefeng.guns.modular.account.model.ElectronicLedger; import com.stylefeng.guns.modular.account.server.ElectronicLedgerService; -import com.stylefeng.guns.modular.account.server.UserBankAccountService; import com.stylefeng.guns.modular.account.server.UserWithdrawalService; -import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; -import com.stylefeng.guns.modular.cloudPayment.example.WithdrawalExample; -import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; -import com.stylefeng.guns.modular.cloudPayment.req.WithdrawalReq; import com.stylefeng.guns.modular.system.model.Company; -import com.stylefeng.guns.modular.system.model.UserBankAccount; import com.stylefeng.guns.modular.system.model.UserWithdrawal; import com.stylefeng.guns.modular.system.service.ICompanyService; -import com.stylefeng.guns.modular.system.util.ResultUtil; -import com.unionpay.upyzt.resp.AllocationResp; -import com.unionpay.upyzt.resp.CusApplicationResp; -import com.unionpay.upyzt.resp.WithdrawalResp; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,39 +26,13 @@ private ElectronicLedgerService electronicLedgerService; @Override - public AllocationReq createAllocationReq(String balanceAcctId, String companyBalanceAcctId, Integer amount,String password) { - AllocationReq allocationReq = new AllocationReq(); - allocationReq.setOutOrderNo(ToolUtil.getRandomString(32)); - allocationReq.setPayBalanceAcctId(companyBalanceAcctId); - allocationReq.setRecvBalanceAcctId(balanceAcctId); - allocationReq.setAmount(amount*100); - allocationReq.setOrderNo(ToolUtil.getRandomString(32)); - allocationReq.setPassword(password); - allocationReq.setOrderAmount(Long.valueOf(amount)); - allocationReq.setProductName("用户提现"); - allocationReq.setProductCount(1); - return allocationReq; - } - - @Override - public WithdrawalReq createWithdrawalReq(String balanceAcctId, Integer amount, String password, String code) { - WithdrawalReq withdrawalReq = new WithdrawalReq(); - withdrawalReq.setOutOrderNo(ToolUtil.getRandomString(32)); - withdrawalReq.setBalanceAcctId(balanceAcctId); - withdrawalReq.setAmount(amount*100); - withdrawalReq.setBankAcctNo(code); - withdrawalReq.setPassword(password); - return withdrawalReq; - } - - @Override public Boolean withdrawDeposit(Integer amount, String bankAcctNo, String password) { // 查询当前操作电子用户 UserWithdrawal userWithdrawal = this.selectOne(new EntityWrapper<UserWithdrawal>() .eq("userId", Objects.requireNonNull(ShiroKit.getUser()).getId()) .eq("userType", 1) .last("LIMIT 1")); - + // 先从平台进行分账到用户电子账簿 // 查询平台账户 Company company = companyService.selectOne(new EntityWrapper<Company>() @@ -80,20 +42,21 @@ .eq("userId", company.getId()) .eq("userType", 3) .last("LIMIT 1")); - try { - // 进行平台分账到用户电子账簿 - log.info("平台分账到用户电子账簿========="); - AllocationResp allocationResp = AllocationExample.create(this.createAllocationReq(userWithdrawal.getBalanceAcctId(), electronicLedger.getBalanceAcctId(), amount,password)); - log.info("平台分账到用户电子账簿完成=========:{}",allocationResp); - - // 用户电子账簿进行提现操作 - WithdrawalResp withdrawalResp = WithdrawalExample.create(this.createWithdrawalReq(userWithdrawal.getBalanceAcctId(), amount, password, bankAcctNo)); - log.info("用户电子账簿提现完成=========:{}",withdrawalResp); - return true; - }catch (Exception e){ - log.info("用户提现失败=========:{}",e.getMessage()); - e.printStackTrace(); - return false; - } +// try { +// // 进行平台分账到用户电子账簿 +// log.info("平台分账到用户电子账簿========="); +// AllocationResp allocationResp = AllocationExample.create(this.createAllocationReq(userWithdrawal.getBalanceAcctId(), electronicLedger.getBalanceAcctId(), amount,password)); +// log.info("平台分账到用户电子账簿完成=========:{}",allocationResp); +// +// // 用户电子账簿进行提现操作 +// WithdrawalResp withdrawalResp = WithdrawalExample.create(this.createWithdrawalReq(userWithdrawal.getBalanceAcctId(), amount, password, bankAcctNo)); +// log.info("用户电子账簿提现完成=========:{}",withdrawalResp); +// return true; +// }catch (Exception e){ +// log.info("用户提现失败=========:{}",e.getMessage()); +// e.printStackTrace(); +// return false; +// } + return true; } } -- Gitblit v1.7.1