jiazx0107@163.com
2023-11-18 41cd6c8db40bceb08290828ae0d4fc5caeea7147
src/main/java/com/fzzy/gateway/hx2023/service/ScGatewayTestServiceImpl.java
@@ -235,6 +235,8 @@
    public BaseResp testLpr(BaseReqData reqData) {
        GatewayDevice device = reqData.getDevice();
        WebSocketPacket packet = new WebSocketPacket();
        WebSocketPacketHeader header = new WebSocketPacketHeader();
        header.setDeviceName(reqData.getDeviceName());
@@ -250,7 +252,7 @@
        lpr.setCarNumber(reqData.getCarNumber());
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("carNumber", reqData.getCarNumber());
        jsonObject.put("position", "big");
        jsonObject.put("position", device.getPosition());
        packet.setProperties(jsonObject);
        packet.setTimestamp(System.currentTimeMillis());
@@ -289,7 +291,7 @@
        headers.setDeviceName(device.getDeviceName());
        headers.setProductId(device.getProductId());
        headers.setOrgId(device.getOrgId());
        headers.setMsgId(ScConstant.getMessageId());
        headers.setMsgId(reqData.getMessageId());
        grain.setHeaders(headers);
        GrainOutPut outPut = new GrainOutPut();
@@ -342,7 +344,7 @@
        outPut.setTemperature(temperature);
        grain.setOutput(outPut);
        grain.setOutput(JSONObject.toJSONString(outPut));
        GatewayDevice gatewayDeviceWeather = GatewayUtils.getCacheByDeviceTypeOne(GatewayDeviceType.TYPE_09.getCode());
@@ -350,6 +352,7 @@
        //气象信息
        GrainWeather weatherStation = new GrainWeather();
        weatherStation.setMessageId(ScConstant.getMessageId());
        weatherStation.setMessgeId(weatherStation.getMessageId());
        if (null != gatewayDeviceWeather) {
            weatherStation.setId(gatewayDeviceWeather.getDeviceId());
@@ -365,7 +368,7 @@
        weatherStation.setWindDirection(weather.getWin());
        weatherStation.setWindPower(weather.getWin_meter());
        weatherStation.setWindSpeed(weather.getWin_speed());
        grain.setWeatherStation(weatherStation);
        grain.setWeatherStation(JSONObject.toJSONString(weatherStation));
        return new BaseResp(JSONObject.toJSONString(grain));
    }