Helius
2021-05-13 44d9363f288cab8336e1ddba0e14ef336bf5c994
modify
1 files added
1 files modified
28 ■■■■■ changed files
src/main/java/com/xcong/excoin/rabbit/consumer/YunDingConsumer.java 27 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/platform/PlatformSymbolsCoinDao.xml 1 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/rabbit/consumer/YunDingConsumer.java
New file
@@ -0,0 +1,27 @@
package com.xcong.excoin.rabbit.consumer;
import com.rabbitmq.client.Channel;
import com.xcong.excoin.configurations.RabbitMqConfig;
import com.xcong.excoin.modules.yunding.service.XchProfitService;
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;
@Slf4j
@Component
@ConditionalOnProperty(prefix = "app", name = "yunding-consumer", havingValue = "true")
public class YunDingConsumer {
    @Autowired
    private XchProfitService xchProfitService;
    @RabbitListener(queues = RabbitMqConfig.QUEUE_XCH_USDT_PRIFIT)
    public void addFollowOrder(Message message, Channel channel) {
        String content = new String(message.getBody());
        log.info("USDT返利 : {}", content);
        xchProfitService.usdtProfitDistributorByOrderId(Long.parseLong(content));
    }
}
src/main/resources/mapper/platform/PlatformSymbolsCoinDao.xml
@@ -11,6 +11,7 @@
            platform_symbols_coin a
        LEFT JOIN member_coin_address b ON a.id = b.symbolscoin_id
        AND member_id = #{memberId}
        where a.name in ('USDT', 'XCH')
        GROUP BY
            a.id,
            a. NAME