| | |
| | | package com.stylefeng.guns.modular.account.schedule; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.BalanceAcctExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.CusApplicationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.SettleAcctExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.WithdrawalExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.BalanceAcctReq; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.UserBankAccountReq; |
| | | import com.stylefeng.guns.modular.system.model.ElectronicLedger; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.unionpay.upyzt.exception.UpyztException; |
| | | import com.unionpay.upyzt.resp.BalanceAcctStoreResp; |
| | | import com.unionpay.upyzt.resp.CusApplicationResp; |
| | | import com.unionpay.upyzt.resp.SettleAcctResp; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | |
| | | */ |
| | | @Scheduled(cron = "0 0/1 * * * ? ") |
| | | private void configureTasks() { |
| | | List<UserWithdrawal> userWithdrawals = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>() |
| | | .eq("userType", 2) |
| | | .ne("applicationStatus", "succeeded")); |
| | | if(!CollectionUtils.isEmpty(userWithdrawals)){ |
| | | for (UserWithdrawal userWithdrawal : userWithdrawals) { |
| | | try { |
| | | CusApplicationResp cusApplicationResp = CusApplicationExample.retrieveById(userWithdrawal.getCusApplicationId()); |
| | | // 开户将司机进件返回的信息进行保存 |
| | | userWithdrawalService.cusApplicationRespToUserWithdrawal(userWithdrawal,cusApplicationResp); |
| | | userWithdrawalService.updateById(userWithdrawal); |
| | | |
| | | // 开户成功,开通电子账户,绑定账户 |
| | | // 开通电子账簿 |
| | | /*BalanceAcctReq balanceAcctReq = electronicLedgerService.createBalanceAcctReq(userWithdrawal.getCusId(),password); |
| | | BalanceAcctStoreResp balanceAcctStoreResp = BalanceAcctExample.create(balanceAcctReq); |
| | | |
| | | // 开通电子账簿成功,封装实体 |
| | | ElectronicLedger electronicLedger = electronicLedgerService.createElectronicLedger(balanceAcctStoreResp,userWithdrawal,password); |
| | | electronicLedgerService.insert(electronicLedger); |
| | | |
| | | // 绑定银行卡 |
| | | UserBankAccountReq userBankAccountReq = electronicLedgerService.createUserBankAccountReq(bankCard,userWithdrawal.getCusId(),userWithdrawal.getCode()); |
| | | SettleAcctResp settleAcctResp = SettleAcctExample.create(userBankAccountReq); |
| | | |
| | | // 保存绑定银行卡返回信息 |
| | | bankCard.setVerifyStatus(settleAcctResp.getVerifyStatus()); |
| | | bankCard.setSettleAcctId(settleAcctResp.getSettleAcctId()); |
| | | bankCard.setAcctValidationFailureMsg(settleAcctResp.getAcctValidationFailureMsg()); |
| | | bankCard.setAcctValidationFinishedAt(settleAcctResp.getAcctValidationFinishedAt()); |
| | | bankCardService.updateById(bankCard);*/ |
| | | } catch (UpyztException e) { |
| | | log.error("个人用户进件状态查询(系统订单号)失败:{}",e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |