vince
2024-12-13 d3e48589ea2719cdde41b87fc1ad80f4ee509bac
src/main/java/com/fzzy/protocol/fzzy/analysis/AnalysisGrain.java
@@ -143,7 +143,7 @@
            }
            //数据优化
            if (curTemp > 35) {
            if (curTemp > 40) {
                curTemp = response.getTAvg();
            }
@@ -159,7 +159,11 @@
        }
        outPut.setTemperature(temperature);
        List<GrainTH> ths = new ArrayList<>();
        ths.add(new GrainTH(response.getTIn()!=null?response.getTIn()+"":"",response.getHIn()!=null?response.getHIn()+"":"","1"));
        outPut.setTemperatureAndhumidity(ths);
        //grain.setOutput(JSONObject.toJSONString(outPut));
        grain.setOutput(com.alibaba.fastjson2.JSONObject.toJSONString(outPut));
@@ -180,7 +184,7 @@
            weatherStation.setId(device.getDeviceId());
        }
        weatherStation.setAirPressure(weather.getPressure());
        weatherStation.setHumidity(weather.getHumidity());
        weatherStation.setHumidity(weather.getHumidity().replaceAll("%",""));
        weatherStation.setPm(weather.getAir_pm25());
        weatherStation.setRadiation("0");
        weatherStation.setRainfallAmount(weather.getWea());
@@ -195,10 +199,10 @@
        log.info("---粮情机械封装完成----开始执行推送");
        reqData.setData(JSONObject.toJSONString(grain));
        doPushGrain(reqData);
        doPushGrain(reqData,grain);
    }
    private void doPushGrain(BaseReqData reqData) {
    private void doPushGrain(BaseReqData reqData,GrainData grainData) {
        GatewayDeviceReportService reportService = gatewayRemoteManager.getDeviceReportService(reqData.getDevice().getPushProtocol());
        if (null == reportService) {
@@ -206,6 +210,8 @@
            return;
        }
        reportService.reportGrainData(reqData);
        reqData.setData(reportService.grainData2GatewayApiInfoKafka(grainData,reqData.getDevice()).getData());
        reportService.reportGrainDataByKafka(reqData);
    }
    private void returnMsg(ApiCommonDevice ser) {