| | |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.admin.utils.StringUtil; |
| | | import com.sandu.ximon.admin.vo.EquipmentInfomation; |
| | | import com.sandu.ximon.dao.bo.AirEquipmentBo; |
| | | import com.sandu.ximon.dao.domain.AirEquipment; |
| | |
| | | * 查询大气设备心跳包时间 |
| | | */ |
| | | public String QueryHeartBeatTime(String mac) { |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("灯杆mac参数错误!"); |
| | | } |
| | | AirEquipment airEquipment = SpringContextHolder.getBean(AirEquipmentService.class). |
| | | getOne(Wrappers.lambdaQuery(AirEquipment.class).eq(AirEquipment::getMac, mac).last("limit 1")); |
| | | |
| | |
| | | * @param time |
| | | */ |
| | | public String setHeartBeatTime(String mac, Integer time) { |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("灯杆mac参数错误!"); |
| | | } |
| | | if (time == null) { |
| | | throw new BusinessException("心跳包间隔时间不能为空!"); |
| | | } |
| | | |
| | | if (time < 30) { |
| | | throw new BusinessException("心跳包间隔时间不能少于30s!"); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public A5AtmosphereQuerySensorInfoReportInnerFrame.SensorInfoPackage QuerySensorInfo(String mac) { |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("灯杆mac参数错误!"); |
| | | } |
| | | |
| | | AirEquipment airEquipment = SpringContextHolder.getBean(AirEquipmentService.class). |
| | | getOne(Wrappers.lambdaQuery(AirEquipment.class).eq(AirEquipment::getMac, mac).last("limit 1")); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public void 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")); |
| | |
| | | * @return |
| | | */ |
| | | public String Reboot(String mac) { |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("灯杆mac参数错误!"); |
| | | } |
| | | |
| | | AirEquipment airEquipment = SpringContextHolder.getBean(AirEquipmentService.class). |
| | | getOne(Wrappers.lambdaQuery(AirEquipment.class).eq(AirEquipment::getMac, mac).last("limit 1")); |
| | | if (airEquipment == null) { |
| | |
| | | throw new BusinessException("数据校验异常!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置数据修正值 |
| | | * |
| | | * @param mac 灯杆MAC |
| | | * @param type 数据修正设备类型 |
| | | * @param valueOfReal 传感器数值 |
| | | * @param valueOfStandard 标准仪器数值 |
| | | */ |
| | | public void ModifiedData(String mac, String type, Double valueOfReal, Double valueOfStandard) { |
| | | //TODO |
| | | if (StringUtil.strIsNullOrEmpty(mac)) { |
| | | throw new BusinessException("灯杆mac参数错误!"); |
| | | } |
| | | if (StringUtil.strIsNullOrEmpty(type)) { |
| | | throw new BusinessException("数据修正设备类型错误!"); |
| | | } |
| | | if (valueOfReal == null || valueOfStandard == null) { |
| | | throw new BusinessException("传感器数值或标准仪器数值错误!"); |
| | | } |
| | | AirEquipment airEquipment = SpringContextHolder.getBean(AirEquipmentService.class). |
| | | getOne(Wrappers.lambdaQuery(AirEquipment.class).eq(AirEquipment::getMac, mac).last("limit 1")); |
| | | if (airEquipment == null) { |
| | | throw new BusinessException("大气设备不存在!"); |
| | | } |
| | | AtmosphereModifiedDataReqInnerFrame atmosphereModifiedDataReqInnerFrame = new AtmosphereModifiedDataReqInnerFrame(type, valueOfReal, valueOfStandard); |
| | | A5Frame a5Frame = new A5Frame(A5OrderEnum.REQUEST_ATMOSPHERE_DATA.getCode(), atmosphereModifiedDataReqInnerFrame); |
| | | System.out.println(a5Frame + " --------a5Frame"); |
| | | CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance().sendRRPC(mac, a5Frame); |
| | | System.out.println(commonFrame + " -----------commonFrame"); |
| | | |
| | | |
| | | } |
| | | } |