KKSU
2024-02-20 d6ed2678974b2750fd3b552cd607f487fbac0927
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
package cc.mrbird.febs.rabbit.consumer;
 
import cc.mrbird.febs.mall.dto.OpenPrice;
import cc.mrbird.febs.mall.service.CJService;
import cc.mrbird.febs.rabbit.constants.QueueConstants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import java.util.Date;
 
/**
 * @author wzy
 * @date 2021-09-25
 **/
@Slf4j
@Component
public class AgentConsumer {
 
    @Autowired
    private CJService cjService;
 
    @RabbitListener(queues = QueueConstants.QUEUE_CHOU_JIANG_TIME)
    public void getChouJiangDelayMsg(String kjNo) {
 
        log.info("收到延时开奖信息消息,编号:{}",kjNo);
        try {
            cjService.getChouJiangDelayMsg(kjNo);
        } catch (Exception e) {
            log.error("延时开奖异常", e);
            // todo 更新表
 
        }
    }
 
    @RabbitListener(queues = QueueConstants.QUEUE_NO_TIME)
    public void getNoTimeDelayMsg(String kjNo) {
        log.info("收到停止下注消息,编号:{}",kjNo);
        try {
            cjService.getNoTimeDelayMsg(kjNo);
        } catch (Exception e) {
            log.error("停止下注异常", e);
            // todo 更新表
 
        }
    }
 
    @RabbitListener(queues = QueueConstants.QUEUE_OPEN_PRICE)
    public void getOpenPriceMsg(OpenPrice openPrice) {
        log.info("收到开奖信息:{}, {}", openPrice.getKjNo(), openPrice.getKjNum());
        try {
            cjService.getOpenPriceMsg(openPrice.getKjNo(), openPrice.getKjNum());
        } catch (Exception e) {
            log.error("开奖信息异常", e);
            // todo 更新表
 
        }
    }
}