| | |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereHeartBeatTimeReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereOperationReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereQuerySensorInfoReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5AtmosphereQueryVersionReportInnerFrame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.request.*; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame; |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5OrderEnum; |
| | |
| | | */ |
| | | public void addAirEquipment(AirEquipment airEquipment) { |
| | | AirEquipment one = getOne(Wrappers.lambdaQuery(AirEquipment.class).eq(AirEquipment::getMac, airEquipment.getMac())); |
| | | // //存储设备状态到缓存 |
| | | // RedisUtils.getBean().set(AtmoFunctionCode.AIR_EQUIPMENT_STATE.getCode() + airEquipment.getMac() |
| | | // , 1, 300L); |
| | | |
| | | if (one == null) { |
| | | save(airEquipment); |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | public A5AtmosphereQuerySensorInfoReportInnerFrame.SensorInfoPackage QuerySensorInfo(String mac) { |
| | | //TODO |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("灯杆mac参数错误!"); |
| | | } |
| | |
| | | * @param mac |
| | | * @return |
| | | */ |
| | | public void QueryVersion(String mac) { |
| | | public String QueryVersion(String mac) { |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("灯杆mac参数错误!"); |
| | | } |
| | | //TODO |
| | | AirEquipment airEquipment = SpringContextHolder.getBean(AirEquipmentService.class). |
| | | getOne(Wrappers.lambdaQuery(AirEquipment.class).eq(AirEquipment::getMac, mac).last("limit 1")); |
| | | |
| | |
| | | System.out.println(commonFrame + " -----------commonFrame"); |
| | | |
| | | // FEA504000AFE040002FFFF8E00974C --------a5Frame |
| | | // FEA584000BFE040003FFFFFF38586A49EE3EAF62 -----------commonFrame |
| | | // FEA584000CFE040004FFFF0105954FAA7F1123C0CB -----------commonFrame |
| | | A5AtmosphereQueryVersionReportInnerFrame a5AtmosphereQueryVersionReportInnerFrame = |
| | | new A5AtmosphereQueryVersionReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (a5AtmosphereQueryVersionReportInnerFrame.isValidate()) { |
| | | return a5AtmosphereQueryVersionReportInnerFrame.getVersion(); |
| | | } else { |
| | | throw new BusinessException("数据校验异常!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param valueOfReal 传感器数值 |
| | | * @param valueOfStandard 标准仪器数值 |
| | | */ |
| | | public void ModifiedData(String mac, String type, Double valueOfReal, Double valueOfStandard) { |
| | | //TODO |
| | | public String ModifiedData(String mac, String type, String valueOfReal, String valueOfStandard) { |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("灯杆mac参数错误!"); |
| | | } |
| | |
| | | System.out.println(commonFrame + " -----------commonFrame"); |
| | | |
| | | |
| | | A5AtmosphereOperationReportInnerFrame a5AtmosphereOperationReportInnerFrame |
| | | = new A5AtmosphereOperationReportInnerFrame().transformFrame(commonFrame.getPayload()); |
| | | if (a5AtmosphereOperationReportInnerFrame.isValidate()) { |
| | | return a5AtmosphereOperationReportInnerFrame.getState(); |
| | | } else { |
| | | throw new BusinessException("数据校验异常!"); |
| | | } |
| | | } |
| | | } |