xiaoyong931011
2021-07-16 886265d9085ce5324f98e52c1826cfee99637045
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.xzx.gc.user.service;
 
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import com.xzx.gc.entity.AccountInfo;
import com.xzx.gc.entity.AccountLog;
import com.xzx.gc.user.mapper.AccountLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import java.util.List;
 
@Service
@Transactional
public class AccountLogService {
 
    @Autowired
    private AccountLogMapper accountLogMapper;
 
    @Autowired
    private AccountService accountService;
 
    public void add(AccountLog accountLog){
        accountLog.setCreateTime(DateUtil.now());
        accountLogMapper.insertSelective(accountLog);
    }
 
 
    public AccountLog findByUserIdAndOrderId(String userId,String flowNo){
        AccountInfo byUserIdForbidden = accountService.findByUserIdForbidden(userId);
        if(byUserIdForbidden!=null){
            AccountLog accountLog=new AccountLog();
            accountLog.setAccountId(byUserIdForbidden.getAccountId());
            accountLog.setOrderId(flowNo);
            List<AccountLog> select = accountLogMapper.select(accountLog);
            if(CollUtil.isNotEmpty(select)){
                return select.get(0);
            }
        }
        return null;
    }
}