admin
2025-05-09 6159dc58f50d3e4680779b7989bbd4d49a76bad5
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
package com.taoke.autopay;
 
import com.taoke.autopay.dao.agent.ChannelAgentSettleDetailMapper;
import com.taoke.autopay.dao.agent.ChannelAgentSettleRecordMapper;
import com.taoke.autopay.dao.agent.ChannelAgentSharingRatioMapper;
import com.taoke.autopay.entity.agent.ChannelAgent;
import com.taoke.autopay.entity.agent.ChannelAgentSettings;
import com.taoke.autopay.entity.agent.ChannelAgentSettleRecord;
import com.taoke.autopay.exception.ChannelAgentException;
import com.taoke.autopay.exception.ChannelAgentSettleException;
import com.taoke.autopay.service.agent.ChannelAgentService;
import com.taoke.autopay.service.agent.ChannelAgentSettingService;
import com.taoke.autopay.service.agent.ChannelAgentSettleService;
import com.taoke.autopay.utils.StringUtil;
import com.taoke.autopay.utils.TimeUtil;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * @author hxh
 * @title: AgentTest
 * @description: TODO
 * @date 2024/7/26 0:07
 */
@SpringBootTest
public class AgentTest {
 
    @Resource
    private ChannelAgentService channelAgentService;
 
    @Resource
    private ChannelAgentSharingRatioMapper channelAgentSharingRatioMapper;
    @Resource
    private ChannelAgentSettleService channelAgentSettleService;
 
    @Resource
    private ChannelAgentSettleRecordMapper channelAgentSettleRecordMapper;
 
 
    @Resource
    private ChannelAgentSettleDetailMapper channelAgentSettleDetailMapper;
 
 
    @Test
    public void test1() throws ChannelAgentException {
        channelAgentService.addChannelAgent(ChannelAgent.builder().account("test123").pwd("123123").name("测试1").build());
    }
 
    @Test
    public void test2(){
//        ChannelAgentSharingRatio
    }
 
    @Test
    public void testSettle() throws ChannelAgentSettleException {
 
        channelAgentSettleService.startSettle("2024-07-28");
 
    }
 
    @Test
    public void testGetSettle() throws ChannelAgentSettleException {
//        channelAgentSettleDetailMapper.listBySettleId(1L);
//        channelAgentSettleRecordMapper.selectByPrimaryKey(1L);
 
        ChannelAgentSettleRecordMapper.DaoQuery daoQuery= new  ChannelAgentSettleRecordMapper.DaoQuery();
        daoQuery.count=100;
//
        List<ChannelAgentSettleRecord> records = channelAgentSettleService.list(daoQuery);
        System.out.println(records);
 
    }
 
    @Resource
    private ChannelAgentSettingService channelAgentSettingService;
 
    @Test
    public void testSettings(){
        ChannelAgentSettings settings = channelAgentSettingService.selectByAgentId(16L);
        if(settings!=null&&!StringUtil.isNullOrEmpty(settings.getStartSubmitTime())&&!StringUtil.isNullOrEmpty(settings.getEndSubmitTime())){
            String now = TimeUtil.getGernalTime(System.currentTimeMillis(), "HHmmss");
            String startTime = settings.getStartSubmitTime().replace(":","");
            String endTime = settings.getEndSubmitTime().replace(":","");
            if (Integer.parseInt(now) < Integer.parseInt(startTime) || Integer.parseInt(now) > Integer.parseInt(endTime)) {
              System.out.println("");
            }
        }
 
    }
 
}