Helius
2021-06-11 50d4789eab5944b1b400f17ff00e3219228c5b79
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
package com.xcong.excoin.rabbit.consumer;
 
import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.Channel;
import com.xcong.excoin.configurations.RabbitMqConfig;
import com.xcong.excoin.modules.blackchain.model.RocTransferDetail;
import com.xcong.excoin.modules.coin.service.BlockCoinService;
import com.xcong.excoin.modules.member.dao.MemberCoinAddressDao;
import com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity;
import com.xcong.excoin.rabbit.pricequeue.OrderModel;
import com.xcong.excoin.rabbit.pricequeue.OrderOperatePriceService;
import org.apache.commons.lang.StringUtils;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
 
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
 
 
/**
 * ROC币种同步
 */
@Component
@ConditionalOnProperty(prefix = "app", name = "block-job", havingValue = "true")
public class RocBlockUpdateConsumer {
 
    @Resource
    private BlockCoinService blockCoinService;
    /**
     * ROC币种同步
     *
     * @param message 消息体
     * @param channel 信道
     * @date 2019年4月19日
     */
    @RabbitListener(queues = RabbitMqConfig.QUEUE_ROC)
    public void onMessageMorePro(Message message, Channel channel) {
        String content = new String(message.getBody());
        // 操作前的map
        // 转为model
        RocTransferDetail transferDetail = JSONObject.parseObject(content, RocTransferDetail.class);
        blockCoinService.updateRoc(transferDetail);
    }
 
 
}