| | |
| | | private IDryEquipmentService dryEquipmentService; |
| | | |
| | | |
| | | |
| | | @ApiOperation(value="测试", notes="返回Hello") |
| | | @GetMapping("/hello") |
| | | public Result<?> sayHello() { |
| | |
| | | @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和设备编码获取实时数据") |
| | |
| | | |
| | | /** |
| | | * 根据设备和租户查询该设备类型的干燥配方,将配方转成xml格式,以字符串方式返回 |
| | | * |
| | | * @param tenantId |
| | | * @param eqpCode |
| | | * @return |