| | |
| | | return dryRealTimeDataService.realTimeDataHandle(realTimeDataVo); |
| | | } |
| | | |
| | | @ApiOperation(value="接收实时数据Json", notes="设备实时数据上传") |
| | | @PostMapping("/sendRealTimeDataJson2") |
| | | public Result<?> realTimeDataJson2(@RequestBody RealTimeDataParentVo realTimeDataParentVo) { |
| | | try { |
| | | if (mqttConfig.isEnable() && "user".equals(mqttConfig.getRole())){ |
| | | MqttMessage mqttMessage = new MqttMessage(); |
| | | mqttMessage.setQos(0); |
| | | mqttMessage.setPayload(JSONObject.toJSONString(realTimeDataParentVo).getBytes()); |
| | | mqttUtil.getMqttClient().publish(MqttConstant.TENANT_UP_PREFIX_REALTIME_DATA,mqttMessage); |
| | | //处理故障信息 |
| | | dryRealTimeDataService.fitFaultRecord(realTimeDataParentVo); |
| | | } |
| | | |
| | | if ("user".equals(mqttConfig.getRole()) && realTimeDataParentVo.getFault() != null){ |
| | | //处理故障信息 |
| | | dryRealTimeDataService.fitFaultRecord(realTimeDataParentVo); |
| | | } |
| | | |
| | | } catch (MqttException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return dryRealTimeDataService.realTimeDataHandle(realTimeDataParentVo); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value="获取设备实时数据", notes="通过租户ID和设备编码获取实时数据") |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value="获取所有机台", notes="通过租户ID获取所有机台数据") |
| | | @GetMapping("/queryAllEqps") |
| | | public Result<?> queryAllEqps(DryEquipment equipment) { |
| | | List<DryEquipment> dryEquipments = dryEquipmentService.queryEqusByTenantId(equipment); |
| | | return Result.OK(dryEquipments); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 1001 风箱升 1002 风箱降 |
| | | * 1003 滚筒升 1004 滚筒降 |