| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.WithdrawalReq; |
| | | import com.stylefeng.guns.modular.system.controller.util.Base64Util; |
| | | import com.stylefeng.guns.modular.system.dao.TBankMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserWithdrawalMapper; |
| | | import com.stylefeng.guns.modular.system.model.TBank; |
| | | import com.stylefeng.guns.modular.system.model.TPubWithdrawal; |
| | | import com.stylefeng.guns.modular.system.model.UserWithdrawal; |
| | | import com.stylefeng.guns.modular.system.service.ITBankService; |
| | | import com.stylefeng.guns.modular.system.service.IUserWithdrawalService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TUserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalMapper, UserWithdrawal> implements IUserWithdrawalService { |
| | | |
| | | @Override |
| | | public WithdrawalReq createInfo(UserWithdrawal userWithdrawal, TPubWithdrawal tPubWithdrawal) { |
| | | WithdrawalReq withdrawalReq = new WithdrawalReq(); |
| | | withdrawalReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | if(tPubWithdrawal.getUserType()==1){ |
| | | withdrawalReq.setAmount(tPubWithdrawal.getMoney().multiply(new BigDecimal(100)).intValue()); |
| | | }else { |
| | | withdrawalReq.setAmount(tPubWithdrawal.getRealGetMoney().multiply(new BigDecimal(100)).intValue()); |
| | | } |
| | | withdrawalReq.setBalanceAcctId(userWithdrawal.getBalanceAcctId()); |
| | | withdrawalReq.setBankAcctNo(userWithdrawal.getBankCardCode()); |
| | | withdrawalReq.setPassword(Base64Util.decode(userWithdrawal.getTransactionAuthorizationCode())); |
| | | return withdrawalReq; |
| | | } |
| | | } |