Pu Zhibing
4 天以前 0cc73a9ffcdd356e0b797e458b400acfb660da94
UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/WithdrawalController.java
@@ -6,7 +6,6 @@
import com.stylefeng.guns.modular.account.model.TBankNext;
import com.stylefeng.guns.modular.account.server.UserBankAccountService;
import com.stylefeng.guns.modular.account.server.UserWithdrawalService;
import com.stylefeng.guns.modular.cloudPayment.example.CusApplicationExample;
import com.stylefeng.guns.modular.system.model.UserBankAccount;
import com.stylefeng.guns.modular.system.model.UserInfo;
import com.stylefeng.guns.modular.system.model.UserWithdrawal;
@@ -14,7 +13,6 @@
import com.stylefeng.guns.modular.system.service.IWithdrawalService;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.WithdrawalWarpper;
import com.unionpay.upyzt.resp.CusApplicationResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -98,7 +96,7 @@
            UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>()
                    .eq("phone", userInfo.getPhone())
                    .last("LIMIT 1"));
            if(Objects.isNull(userWithdrawal)){
            if (Objects.isNull(userWithdrawal)) {
                return ResultUtil.error("请先进行个人用户进件信息填写");
            }
            TBankNext bankName1 = tBankNextMapper.selectList(new EntityWrapper<TBankNext>().eq("bankName", bankName)).get(0);
@@ -106,26 +104,26 @@
            userWithdrawal.setBankCode(bankName1.getDrecCode());
            userWithdrawal.setBankBranchCode(bankName1.getBankCode());
            userWithdrawal.setCode(smsCode);
            CusApplicationResp renew = CusApplicationExample.renew(userWithdrawal);
            System.err.println("修改个人用户进件信息返回"+renew);
            if("succeeded".equals(renew.getApplicationStatus())){
                // 修改银行卡信息
                bankCard.setSettleAcctId(renew.getSettleAcctId());
                bankAccountService.updateById(bankCard);
                userWithdrawal.setBankCardCode(code);
                userWithdrawal.setBankCode(bankCard.getBankCode());
                userWithdrawal.setBankBranchCode(bankCard.getBankBranchCode());
                userWithdrawal.setBankName(bankCard.getBankName());
                userWithdrawal.setSettleAcctId(renew.getSettleAcctId());
                userWithdrawal.setBalanceAcctId(renew.getBalanceAcctId());
                userWithdrawalService.updateById(userWithdrawal);
                return withdrawalService.withdrawal(money, bankName, code, name, uid);
            }else {
                return ResultUtil.error(renew.getFailureMsgs().get(0).getReason());
            }
//            CusApplicationResp renew = CusApplicationExample.renew(userWithdrawal);
//            System.err.println("修改个人用户进件信息返回"+renew);
//            if("succeeded".equals(renew.getApplicationStatus())){
//                // 修改银行卡信息
//                bankCard.setSettleAcctId(renew.getSettleAcctId());
//                bankAccountService.updateById(bankCard);
//
//                userWithdrawal.setBankCardCode(code);
//                userWithdrawal.setBankCode(bankCard.getBankCode());
//                userWithdrawal.setBankBranchCode(bankCard.getBankBranchCode());
//                userWithdrawal.setBankName(bankCard.getBankName());
//                userWithdrawal.setSettleAcctId(renew.getSettleAcctId());
//                userWithdrawal.setBalanceAcctId(renew.getBalanceAcctId());
//                userWithdrawalService.updateById(userWithdrawal);
//                return withdrawalService.withdrawal(money, bankName, code, name, uid);
//            }else {
//                return ResultUtil.error(renew.getFailureMsgs().get(0).getReason());
//            }
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();