| | |
| | | package com.sandu.ximon.admin.manager.iot.amqp; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.LightDataProcessor; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.*; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonReportMessage; |
| | |
| | | log.info(frame.toString()); |
| | | if (frame.getOrderType().equals(A5OrderEnum.RESPONSE_LIGHT_DATA.getCode())) { |
| | | // 单灯数据上报处理 |
| | | lightDataReportAnalysis(productKey, deviceName, frame); |
| | | LightDataProcessor.getInstance().process(productKey,deviceName,frame); |
| | | } else if (frame.getOrderType().equals(A5OrderEnum.RESPONSE_C3_DATA.getCode())) { |
| | | // C3充电桩上报处理 |
| | | c3ChargingReportAnalysis(productKey, deviceName, frame); |
| | |
| | | A5AtmosphereHeartbeatReportInnerFrame transformFrame = new A5AtmosphereHeartbeatReportInnerFrame().transformFrame(frame.getPayload()); |
| | | log.info("大气心跳上报"); |
| | | log.info(transformFrame.toString()); |
| | | } |
| | | |
| | | private void lightDataReportAnalysis(String productKey, String deviceName, CommonFrame frame) { |
| | | String functionCode = frame.getPayload().substring(2, 4); |
| | | if (A5LightReportEnum.HeartBeat_Data.getCode().equals(functionCode)) { |
| | | // log.info("心跳相应"); |
| | | A5LightHeartbeatReportInnerFrame heartbeatReportInnerFrame = new A5LightHeartbeatReportInnerFrame().transformFrame(frame.getPayload()); |
| | | // log.info(heartbeatReportInnerFrame.toString()); |
| | | } else if (A5LightReportEnum.Time_Synchronized.getCode().equals(functionCode)) { |
| | | // log.info("请求时间同步"); |
| | | A5LightTimeSyncReportInnerFrame syncRespInnerFrame = new A5LightTimeSyncReportInnerFrame().transformFrame(frame.getPayload()); |
| | | // log.info(syncRespInnerFrame.toString()); |
| | | } else if (A5LightReportEnum.Error_Code.getCode().equals(functionCode)) { |
| | | // log.info("故障码上报"); |
| | | A5LightErrorCodeReportInnerFrame codeRespInnerFrame = new A5LightErrorCodeReportInnerFrame().transformFrame(frame.getPayload()); |
| | | // log.info(codeRespInnerFrame.toString()); |
| | | } |
| | | } |
| | | } |