| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.data.ApiCommonDevice; |
| | | import com.fzzy.api.data.DepotType; |
| | | import com.fzzy.api.data.GatewayDeviceType; |
| | | import com.fzzy.api.utils.BytesUtil; |
| | | import com.fzzy.api.utils.NumberUtil; |
| | |
| | | contextMapGrain.put(key, null); |
| | | |
| | | |
| | | if (cableData.isCir()) { |
| | | |
| | | if(DepotType.TYPE_03.getCode().equals(device.getDepotType())){ |
| | | //筒仓 |
| | | analysisAndPush3(temps, reqData, thDto, cableData); |
| | | }else if(DepotType.TYPE_02.getCode().equals(device.getDepotType())){ |
| | | analysisAndPush2(temps, reqData, thDto, cableData); |
| | | } else { |
| | | }else if(DepotType.TYPE_04.getCode().equals(device.getDepotType())){ |
| | | analysisAndPush2(temps, reqData, thDto, cableData); |
| | | }else { |
| | | //平房仓 |
| | | analysisAndPush1(temps, reqData, thDto, cableData); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 筒仓解析,解析第二步,解析到坐标数据 |
| | | * 筒仓,解析第二步,解析到坐标数据 |
| | | * @param temps |
| | | * @param reqData |
| | | * @param thDto |
| | | * @param cableData |
| | | */ |
| | | private void analysisAndPush2(List<Double> temps, BaseReqData reqData, THDto thDto, GrainCableData cableData) { |
| | | //TODO |
| | | log.info("-------------------------暂未实现----------------"); |
| | | } |
| | | |
| | | /** |
| | | * 油罐仓,解析第二步,解析到坐标数据 |
| | | * |
| | | * @param temps |
| | | * @throws Exception |
| | | */ |
| | | private void analysisAndPush2(List<Double> temps, BaseReqData reqData, THDto thDto, GrainCableData cableData) { |
| | | private void analysisAndPush3(List<Double> temps, BaseReqData reqData, THDto thDto, GrainCableData cableData) { |
| | | |
| | | GatewayDevice device = reqData.getDevice(); |
| | | |
| | |
| | | |
| | | |
| | | JSONObject properties = new JSONObject(); |
| | | properties.put("data", JSONObject.toJSONString(outPut)); |
| | | properties.put("data", outPut); |
| | | properties.put("timestamp", grain.getTimestamp()); |
| | | |
| | | String height = this.getCacheHeight(device); |
| | | if (StringUtils.isEmpty(height)) height = "0.0"; |
| | | properties.put("liquidHeight", height); |
| | | |
| | | grain.setProperties(properties.toJSONString()); |
| | | grain.setProperties(properties); |
| | | |
| | | //封装好的数据 |
| | | log.info("---浅圆仓封装完成----开始执行推送"); |