Pu Zhibing
7 天以前 638e7deedf01e2fa276d38f2215003e43996c54f
DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/WithdrawalController.java
@@ -5,7 +5,6 @@
import com.stylefeng.guns.modular.account.model.TBankNext;
import com.stylefeng.guns.modular.account.service.ITBankNextService;
import com.stylefeng.guns.modular.account.service.UserWithdrawalService;
import com.stylefeng.guns.modular.cloudPayment.example.CusApplicationExample;
import com.stylefeng.guns.modular.system.model.BankCard;
import com.stylefeng.guns.modular.system.model.Driver;
import com.stylefeng.guns.modular.system.model.UserWithdrawal;
@@ -15,7 +14,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;
@@ -30,7 +28,9 @@
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * 提现控制器
@@ -107,32 +107,32 @@
            if(Objects.isNull(userWithdrawal)){
                return ResultUtil.error("请先进行个人用户进件信息填写");
            }
            TBankNext bankNext = bankNextService.selectOne(new EntityWrapper<TBankNext>()
                    .eq("bankName", bankName)
                    .last("LIMIT 1"));
            userWithdrawal.setBankName(bankName);
            userWithdrawal.setBankCode(bankNext.getDrecCode());
            userWithdrawal.setBankBranchCode(bankNext.getBankCode());
            userWithdrawal.setBankCardCode(code);
            userWithdrawal.setCode(smsCode);
            CusApplicationResp renew = CusApplicationExample.renew(userWithdrawal);
            System.err.println("修改个人用户进件信息返回"+renew);
            if("succeeded".equals(renew.getApplicationStatus())){
                // 修改银行卡信息
                bankCard.setVerifyStatus("succeeded");
                bankCard.setSettleAcctId(renew.getSettleAcctId());
                bankCardService.updateById(bankCard);
                userWithdrawal.setBankCardCode(code);
                userWithdrawal.setBankName(bankCard.getBank());
                userWithdrawal.setSettleAcctId(renew.getSettleAcctId());
                userWithdrawal.setBalanceAcctId(renew.getBalanceAcctId());
                userWithdrawal.setBankCode(bankCard.getBankCode());
                userWithdrawal.setBankBranchCode(bankCard.getBankBranchCode());
                userWithdrawalService.updateById(userWithdrawal);
            }
//            CusApplicationResp renew = CusApplicationExample.renew(userWithdrawal);
//            System.err.println("修改个人用户进件信息返回"+renew);
//            if("succeeded".equals(renew.getApplicationStatus())){
//                // 修改银行卡信息
//                bankCard.setVerifyStatus("succeeded");
//                bankCard.setSettleAcctId(renew.getSettleAcctId());
//                bankCardService.updateById(bankCard);
//
//                userWithdrawal.setBankCardCode(code);
//                userWithdrawal.setBankName(bankCard.getBank());
//                userWithdrawal.setSettleAcctId(renew.getSettleAcctId());
//                userWithdrawal.setBalanceAcctId(renew.getBalanceAcctId());
//                userWithdrawal.setBankCode(bankCard.getBankCode());
//                userWithdrawal.setBankBranchCode(bankCard.getBankBranchCode());
//                userWithdrawalService.updateById(userWithdrawal);
//            }
            return withdrawalService.withdrawal(money, bankName, code, name, uid, type);
        }catch (Exception e){
            e.printStackTrace();