zainali5120
2020-09-25 286ea89f5f6cade73276f865effa5dcd2b19406d
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
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;
 
 
/**
 * 用户修改止损止盈价格、提价限价委托、下单爆仓价等消息
 * 后台打包开启 APP 不开启
 * @author helius
 */
@Component
//@ConditionalOnProperty(prefix = "app", name = "newest-price-update-job-contract", 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);
    }
 
 
}