xiaoyong931011
2021-05-14 fd575f1971b145088b56c125f9f3ce3bf2429ebc
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
package com.xcong.excoin;
 
 
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.xcong.excoin.modules.coin.parameter.dto.CoinInListDto;
import com.xcong.excoin.modules.coin.service.CoinService;
import com.xcong.excoin.modules.yunding.dao.YdOrderDao;
import com.xcong.excoin.modules.yunding.entity.YdOrderEntity;
import com.xcong.excoin.modules.yunding.service.XchProfitService;
import com.xcong.excoin.quartz.job.YdPowerJob;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
 
import java.math.BigDecimal;
 
@SpringBootTest
public class XchTest {
 
    @Autowired
    private XchProfitService xchProfitService;
 
    @Test
    public void usdtReturnTest() {
        xchProfitService.agentUsdtProfitDistributor();
    }
 
    @Test
    public void dateUtilTest() {
        String day1 = "2021-05-12 22:00:00";
        String day2 = "2021-05-12 23:00:00";
        System.out.println(DateUtil.compare(DateUtil.parse(day1, "yyyy-MM-dd HH:mm:ss"), DateUtil.parse(day2, "yyyy-MM-dd HH:mm:ss")));
    }
 
    @Test
    public void becomeAgentTest() {
        xchProfitService.autoBeAgent(40L);
    }
 
    @Test
    public void orderUsdtProfitTest() {
        xchProfitService.usdtProfitDistributorByOrderId(7L);
    }
//
//    @Autowired
//    private YdPowerJob ydPowerJob;
//
//    @Test
//    public void ydPowerTest() {
//        ydPowerJob.orderWork();
//    }
 
    @Autowired
    private YdOrderDao ydOrderDao;
 
    @Test
    public void orderTest() {
        YdOrderEntity orderEntity = new YdOrderEntity();
        orderEntity.setType(YdOrderEntity.AGENT_ORDER);
        orderEntity.setMemberId(40L);
        orderEntity.setAmount(BigDecimal.TEN);
        ydOrderDao.insert(orderEntity);
    }
 
    @Test
    public void xchProfitTest() {
        xchProfitService.xchProfitDistributor(BigDecimal.valueOf(1));
    }
 
    @Autowired
    private CoinService coinService;
 
    @Test
    public void coinTest() {
        CoinInListDto coin = new CoinInListDto();
        coin.setType(4);
        coin.setPageNum(1);
        coin.setPageSize(10);
        coinService.coinInList(coin);
    }
}