fix
Helius
2022-06-17 5c5589c0d343437275563a1a84f3a415a4ea16d3
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package cc.mrbird.febs;
 
import cc.mrbird.febs.mall.entity.MallOrderItem;
import cc.mrbird.febs.mall.mapper.MallOrderInfoMapper;
import cc.mrbird.febs.mall.mapper.MallOrderItemMapper;
import cc.mrbird.febs.mall.service.IAgentService;
import cc.mrbird.febs.mall.service.IMallAchieveService;
import cc.mrbird.febs.mall.service.IMemberProfitService;
import cc.mrbird.febs.rabbit.consumer.AgentConsumer;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
 
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
/**
 * @author wzy
 * @date 2022-06-02
 **/
@SpringBootTest
public class ProfitTest {
 
    @Autowired
    private AgentConsumer agentConsumer;
 
    @Autowired
    private IAgentService agentService;
 
    @Autowired
    private IMemberProfitService memberProfitService;
 
    @Test
    public void dynamicProfit() {
        memberProfitService.dynamicProfit(21L);
    }
    @Test
    public void agentProfit() {
        memberProfitService.agentProfit(null);
    }
 
 
    @Test
    public void staticProfit() {
        memberProfitService.staticProfit();
    }
 
    @Test
    public void thankfulProfit() {
        memberProfitService.thankfulProfit();
    }
 
    @Test
    public void rankProfit() {
        memberProfitService.rankProfit();
    }
 
    @Autowired
    private MallOrderInfoMapper mallOrderInfoMapper;
 
    @Test
    public void directorProfitTest() {
        memberProfitService.storeAndDirectorProfit(null);
    }
 
    @Autowired
    private MallOrderItemMapper mallOrderItemMapper;
 
    @Autowired
    private IMallAchieveService mallAchieveService;
 
    @Test
    public void achieveTest() {
        List<MallOrderItem> items = mallOrderItemMapper.selectList(null);
        for (MallOrderItem item : items) {
            mallAchieveService.add(item.getId());
        }
    }
 
    @Test
    public void paramTest() {
        Map<String, Integer> map = new HashMap<>();
        BigDecimal amount = new BigDecimal("100");
        map.put("amount", 1);
        changeAmount(map);
        System.out.println(map.get("amount"));
    }
 
    public void changeAmount(Map<String, Integer> amount) {
        amount.put("amount", 2);
    }
}