xiaoyong931011
2021-08-04 ea868a98b776b9e89db429a195704a1412ca8905
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
package com.xzx.gc.user.service;
 
import com.xzx.gc.common.constant.PayEnum;
import com.xzx.gc.common.utils.IdUtils;
import com.xzx.gc.entity.AccountInfo;
import com.xzx.gc.entity.PayRequestInfo;
import com.xzx.gc.user.mapper.AccountMapper;
import com.xzx.gc.user.mapper.PayRequestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
@Service
@Transactional
public class PayRequestService {
 
    @Autowired
    private PayRequestMapper payRequestMapper;
 
    @Autowired
    private IdUtils idUtils;
 
    @Autowired
    private AccountMapper accountMapper;
 
    @Autowired
    private AccountService accountService;
 
 
    public void add(PayRequestInfo payRequestInfo){
        String payOrderId = idUtils.generate("ZF",0);
        payRequestInfo.setPayOrderId(payOrderId);
        payRequestInfo.setStatus(PayEnum.待审核.getValue());
        AccountInfo accountInfo1 = accountService.findByUserId(payRequestInfo.getCreateUserId());
        if(accountInfo1!=null){
            payRequestInfo.setAccountId(accountInfo1.getAccountId());
        }
        payRequestMapper.insertSelective(payRequestInfo);
    }
}