xuhy
2025-01-09 712f70b2936079a131ecb1e63c6d337171618cad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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>
 *  服务实现类
 * </p>
 *
 * @author stylefeng
 * @since 2023-03-28
 */
@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;
    }
}