| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.AirDataProcessor; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.LightDataProcessor; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.PoleMonitorDataProcessor; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.c3ChargingProcessor; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.*; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereHeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5C3CommonReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5C3ErrorCodeReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5C3HeartbeatReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonReportMessage; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5OrderEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3ChargingEnum; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.C3mRedisConstant; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.*; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.util.FrameUtils; |
| | | import com.sandu.ximon.admin.service.C3ChargingService; |
| | | import com.sandu.ximon.admin.service.C3mOrderService; |
| | |
| | | |
| | | |
| | | protected final static ExecutorService EXECUTOR_SERVICE = new ThreadPoolExecutor( |
| | | Runtime.getRuntime().availableProcessors(), |
| | | Runtime.getRuntime().availableProcessors() * 2, 60, TimeUnit.SECONDS, |
| | | Runtime.getRuntime().availableProcessors() * 2, |
| | | Runtime.getRuntime().availableProcessors() * 4, 60, TimeUnit.SECONDS, |
| | | new LinkedBlockingQueue<>(50000), new NameTreadFactory()); |
| | | |
| | | static class NameTreadFactory implements ThreadFactory { |
| | |
| | | String topic = message.getStringProperty("topic"); |
| | | String messageId = message.getStringProperty("messageId"); |
| | | |
| | | log.info("收到订阅" + topic + "," + messageId); |
| | | log.info(content); |
| | | // log.info("收到订阅" + topic + "," + messageId); |
| | | // log.info(content); |
| | | |
| | | if (null != map.get("status")) { |
| | | // 上下线上报处理 |
| | |
| | | if (frame == null) { |
| | | return; |
| | | } |
| | | log.info("处理订阅"); |
| | | log.info(frame.toString()); |
| | | // if (!deviceName.equals("3930364d485010ff803affff")){ |
| | | // return; |
| | | // } |
| | | log.info("处理订阅:\nmac:{},frame:{}",deviceName,frame.toString()); |
| | | if (frame.getFunctionCode().equals("A5")){ |
| | | log.info("A5"); |
| | | if (frame.getOrderType().equals(A5OrderEnum.RESPONSE_LIGHT_DATA.getCode())) { |
| | | // 单灯数据上报处理 |
| | | LightDataProcessor.getInstance().process(productKey, deviceName, frame); |
| | |
| | | } else if (frame.getOrderType().equals(A5OrderEnum.RESPONSE_POLE_MONITOR_DATA.getCode())) { |
| | | PoleMonitorDataProcessor.getInstance().process(productKey, deviceName, frame); |
| | | } |
| | | } else if (frame.getFunctionCode().equals("A7")) { |
| | | log.info("A7"); |
| | | |
| | | if (frame.getOrderType().equals(A7OrderEnum.RESPONSE_PLC_DATA.getCode())){ |
| | | // PLC |
| | | PlcDataProcessor.getInstance().process(productKey, deviceName,frame); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |