jiazx0107@163.com
2024-01-01 d454e51e06dbf7beb50551588fc58a5810295d7c
src/main/java/com/fzzy/gateway/hx2023/service/DeviceReportServiceImpl.java
@@ -44,7 +44,7 @@
        topic = topic.replace("${productId}", reqData.getProductId()).replace("${deviceId}", reqData.getDeviceId());
        //如果是测试模式不执行推送
        if(configData.getActive().indexOf("dev")>=0){
        if (configData.getActive().indexOf("dev") >= 0) {
            log.info("----------------------------推送MQTT粮情信息,注:调试模式不推送---------------------------");
            log.info("-----TOPIC-----{}", topic);
@@ -146,6 +146,16 @@
    @Override
    public BaseResp reportGrainDataByKafka(BaseReqData reqData) {
        String topic = ScConstant.TOPIC_MESSAGE_REPORT;
        //如果是测试模式不执行推送
        if (configData.getActive().indexOf("dev") >= 0) {
            log.info("----------------------------推送KAFKA粮情信息,注:调试模式不推送---------------------------");
            log.info("-----TOPIC-----{}", topic);
            log.info("-----Message-----{}", reqData.getData());
            return new BaseResp();
        }
        kafkaDeviceReportService.publishWithTopic(reqData.getData(), topic);
        return new BaseResp();
    }