zainali5120
2020-09-25 286ea89f5f6cade73276f865effa5dcd2b19406d
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
package com.xcong.excoin.utils;
 
import com.xcong.excoin.modules.coin.dao.MemberAccountFlowEntityDao;
import com.xcong.excoin.modules.coin.dao.MemberAccountMoneyChangeDao;
import com.xcong.excoin.modules.coin.entity.MemberAccountFlowEntity;
import com.xcong.excoin.modules.coin.entity.MemberAccountMoneyChange;
 
import java.math.BigDecimal;
 
/**
 * 日志记录工具类
 *
 * @author wzy
 * @date 2020-07-02
 **/
public class LogRecordUtils {
 
    public static void insertMemberAccountMoneyChange(Long memberId,String content, BigDecimal amount, String symbol, Integer status, Integer type) {
        MemberAccountMoneyChange accountRecord = new MemberAccountMoneyChange();
        accountRecord.setContent(content);
        accountRecord.setMemberId(memberId);
        accountRecord.setAmount(amount);
        accountRecord.setStatus(status);
        accountRecord.setSymbol(symbol);
        accountRecord.setType(type);
        SpringContextHolder.getBean(MemberAccountMoneyChangeDao.class).insert(accountRecord);
    }
 
    public static void insertMemberAccountFlow(Long memberId, BigDecimal price, BigDecimal balance, String symbol, String source, String remark) {
        MemberAccountFlowEntity memberAccountFlowEntity = new MemberAccountFlowEntity();
        memberAccountFlowEntity.setMemberId(memberId);
        memberAccountFlowEntity.setPrice(price);
        memberAccountFlowEntity.setBalance(balance);
        memberAccountFlowEntity.setSymbol(symbol);
        memberAccountFlowEntity.setSource(source);
        memberAccountFlowEntity.setRemark(remark);
        SpringContextHolder.getBean(MemberAccountFlowEntityDao.class).insert(memberAccountFlowEntity);
    }
}