xiaoyong931011
2023-07-28 c10d97a689669d464e0bc7f0dc81544ba73d4dda
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package cc.mrbird.febs.rabbit.consumer;
 
import cc.mrbird.febs.dapp.service.DappSystemService;
import cc.mrbird.febs.rabbit.QueueConstants;
import cn.hutool.core.date.DateUtil;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
 
/**
 * @author wzy
 * @date 2022-05-31
 **/
@Slf4j
@Component
@ConditionalOnProperty(prefix = "system", name = "online-transfer", havingValue = "true")
public class ChainConsumer {
 
    @Autowired
    private DappSystemService dappSystemService;
 
//    @RabbitListener(queues = QueueConstants.ACHIEVE_TREE)
//    public void achieveTree(String id) {
//        log.info("收到业绩树消息");
//        dappSystemService.achieveTree(Long.parseLong(id));
//    }
//
//    /**
//     * 生产者在tfc应用
//     * @param data
//     */
//    @RabbitListener(queues = QueueConstants.TFC_NEW_PRICE)
//    public void tfcNewPrice(String data) {
////        dappSystemService.tfcNewPrice(data);
//    }
//
//    /**
//     * @param data
//     */
//    @RabbitListener(queues = QueueConstants.DISTRIB_PROFIT)
//    public void feeDistribute(String data) {
//        dappSystemService.feeDistribute(data);
//    }
 
    /**层级奖励分发消息
     * @param id
     */
//    @RabbitListener(queues = QueueConstants.QUEUE_LEVEL_PROFIT)
//    public void levelProfit(Long id) {
//        log.info("消费层级奖励分发消息:{}", id);
//        dappSystemService.levelProfit(id);
//    }
 
    /**计算是否有人出局分发消息
     * @param id
     */
//    @RabbitListener(queues = QueueConstants.QUEUE_MEMBER_OUT)
//    public void memberOut(Long id) {
//        log.info("消费计算是否有人出局:{}", id);
//        dappSystemService.memberOut(id);
//    }
 
    /**转账拨币
     * @param id
     */
    @RabbitListener(queues = QueueConstants.QUEUE_BNB_TRANSFER)
    public void bnbTransfer(Long id) {
        log.info("消费转账拨币第一步:{}", id);
        dappSystemService.bnbTransfer(id);
    }
 
    /**转账拨币
     * @param id
     */
    @RabbitListener(queues = QueueConstants.QUEUE_BNB_TRANSFER_TEST)
    public void bnbTransferTest(Long id) {
        log.info("消费转账拨币第二步:{}", id);
        dappSystemService.bnbTransferTest(id);
    }
//
//    /**代理升级
//     * @param id
//     */
//    @RabbitListener(queues = QueueConstants.QUEUE_BNB_AGENT_UP)
//    public void agentUp(Long id) {
//        log.info("代理升级:{}", id);
//        dappSystemService.agentUp(id);
//    }
 
    /**
     * 消费---A 入金的消息
     * @param id
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ANT_A_CION_IN)
    public void AntACoinInMsg(Long id) {
        log.info("消费---A 入金的消息:{}", id);
        dappSystemService.AntACoinInMsg(id);
    }
 
    /**
     * 消费---A 入金,转入A底池
     * @param id
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ANT_A_CION_IN_A_POOL)
    public void AntACoinAPollInMsg(Long id) {
        log.info("消费---A 入金,转入A底池:{}", id);
        dappSystemService.AntACoinAPollInMsg(id);
    }
 
    /**
     * 消费---A 入金,转入B底池
     * @param id
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ANT_A_CION_IN_B_POOL)
    public void AntACoinBPollInMsg(Long id) {
        log.info("消费---A 入金,转入B底池:{}", id);
        dappSystemService.AntACoinBPollInMsg(id);
    }
 
    /**
     * 消费---A 入金,5%节点
     * @param id
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ANT_A_CION_IN_NODE)
    public void antACoinInNodeMsg(Long id) {
        log.info("消费---A 入金,转入5%节点:{}", id);
        dappSystemService.antACoinInNodeMsg(id);
    }
 
    /**
     * 消费---A 入金,10%极差奖
     * @param id
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ANT_A_CION_IN_LEVEL)
    public void antACoinInLevelMsg(Long id) {
        log.info("消费---A 入金,转入10%极差奖:{}", id);
        dappSystemService.antACoinInLevelMsg(id);
    }
 
    /**
     * 提现
     * @param id
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ANT_A_CION_OUT)
    public void antACoinOutMsg(Long id) {
        log.info("消费---A 提现:{}", id);
        dappSystemService.antACoinOutMsg(id);
    }
 
    /**
     *  A 代理升级
     * @param memberId
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ANT_MEMBER_LEVEL)
    public void antMemberLevelMsg(Long memberId) {
        log.info("消费---A 代理升级:{}", memberId);
        dappSystemService.antMemberLevelMsg(memberId);
    }
 
    /**
     *  A k线数据
     * @param type
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ANT_K_LINE)
    public void antKLineMsg(int type) {
        log.info("消费---A k线数据:{}", type);
        dappSystemService.antKLineMsg(type);
    }
 
    /**转账拨币
     * @param id
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ANT_K_LINE_AB)
    public void antKLineABMsg(Long id) {
        log.info("消费转账拨币第二步:{}", id);
        dappSystemService.antKLineABMsg(id);
    }
 
    /**转账拨币
     * @param id
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ALL_MEMBER_PERK_AVA)
    public void allMemberPerkAvaMsg(Long id) {
        log.info("全体平分:{}", id);
        dappSystemService.allMemberPerkAvaMsg(id);
    }
 
    /**合约铸造ANDAO
     * @param flowId
     */
    @RabbitListener(queues = QueueConstants.QUEUE_CONTRACT_AN_DAO)
    public void contractAnDaoMsg(Long flowId) {
        log.info("1-消费合约铸造ANDAO:{}", flowId);
        dappSystemService.contractAnDaoMsg(flowId);
    }
 
    /**合约铸造ANDAO
     * @param flowId
     */
    @RabbitListener(queues = QueueConstants.QUEUE_ANT_A_CION_IN_CONTRACT)
    public void contractAnDaoInMsg(Long flowId) {
        log.info("2-消费合约铸造ANDAO:{}", flowId);
        dappSystemService.contractAnDaoInMsg(flowId);
    }
}