正在显示
6 个修改的文件
包含
72 行增加
和
3 行删除
| @@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
| 47 | 以下为设备的标准命名前缀、示例及说明(采用区域 A 示例): | 47 | 以下为设备的标准命名前缀、示例及说明(采用区域 A 示例): |
| 48 | 48 | ||
| 49 | | 设备名称 | 前缀(大写) | 示例 | 示例说明 | | 49 | | 设备名称 | 前缀(大写) | 示例 | 示例说明 | |
| 50 | -|--------|--------|-----------------|------------------------------| | 50 | +|--------|--------|------------------|----------------------------| |
| 51 | | 系统级别参数 | SYS | A_SYS_0_SZGD | A 区 市政电源供电信号,<br/>这里的编号0表示不是plc下挂 | | 51 | | 系统级别参数 | SYS | A_SYS_0_SZGD | A 区 市政电源供电信号,<br/>这里的编号0表示不是plc下挂 | |
| 52 | | 喂料机 | TLJ | A_TLJ_1_RUN | A 区 1 号喂料机运行状态 | | 52 | | 喂料机 | TLJ | A_TLJ_1_RUN | A 区 1 号喂料机运行状态 | |
| 53 | | 增氧机 | ZYJ | A_ZYJ_2_ALARM | A 区 2 号增氧机告警状态 | | 53 | | 增氧机 | ZYJ | A_ZYJ_2_ALARM | A 区 2 号增氧机告警状态 | |
| @@ -73,10 +73,19 @@ | @@ -73,10 +73,19 @@ | ||
| 73 | | 变频控制柜 | BPKZG | A_BPKZG_1_STATUS | A 区 1 号变频控制柜状态 | | 73 | | 变频控制柜 | BPKZG | A_BPKZG_1_STATUS | A 区 1 号变频控制柜状态 | |
| 74 | | 液位计 | YWJ | A_YWJ_1_VALUE | A 区 1 号液位计读数 | | 74 | | 液位计 | YWJ | A_YWJ_1_VALUE | A 区 1 号液位计读数 | |
| 75 | | 热泵 | RB | A_RB_1_RUN | A 区 1 号热泵运行状态 | | 75 | | 热泵 | RB | A_RB_1_RUN | A 区 1 号热泵运行状态 | |
| 76 | +| 吸污 | XW | A_XW_1_RUN | A 区 1 号吸污泵设备运行状态 | | ||
| 77 | +| 循环水供水泵 | XHSGSB | A_XHSGSB_1_RUN | A 区 1 号循环水供水泵运行状态 | | ||
| 78 | +| 循环水回水泵 | XHSHSB | A_XHSHSB_1_RUN | A 区 1 号循环水回水泵运行状态 | | ||
| 79 | +| 转鼓电机 | ZGDJ | A_ZGDJ_1_RUN | A 区 1 号转鼓电机运行状态 | | ||
| 80 | +| 冲洗水泵 | CXSB | A_CXSB_1_RUN | A 区 1 号冲洗水泵运行状态 | | ||
| 81 | +| 臭氧发生器 | CYFSQ | A_CYFSQ_1_RUN | A 区 1 号臭氧发生器运行状态 | | ||
| 82 | +| 紫外线杀菌器 | ZWXSJQ | A_ZWXSJQ_1_RUN | A 区 1 号紫外线杀菌器运行状态 | | ||
| 83 | +| 鼓风机 | GFJ | A_GFJ_1_RUN | A 区 1 号鼓风机运行状态 | | ||
| 84 | +| 车间供水泵 | CJGSB | A_CJGSB_1_RUN | A 区 1 号车间供水泵运行状态 | | ||
| 76 | --- | 85 | --- |
| 77 | 86 | ||
| 78 | ## 三、命名示例说明 | 87 | ## 三、命名示例说明 |
| 79 | - | 88 | +`` |
| 80 | ### 1. 状态型 | 89 | ### 1. 状态型 |
| 81 | 90 | ||
| 82 | ``` | 91 | ``` |
| @@ -51,6 +51,7 @@ public class SysCommandListenService implements RocketMQReplyListener<MessageExt | @@ -51,6 +51,7 @@ public class SysCommandListenService implements RocketMQReplyListener<MessageExt | ||
| 51 | return new Message(MessageCode.DEFAULT_SUCCESS_CODE,"指令发送成功"); | 51 | return new Message(MessageCode.DEFAULT_SUCCESS_CODE,"指令发送成功"); |
| 52 | case upIotThingsModel: | 52 | case upIotThingsModel: |
| 53 | iotThingsModelService.upIotThingsModel(deviceCommand.getData().get("product_id").getAsInt()); | 53 | iotThingsModelService.upIotThingsModel(deviceCommand.getData().get("product_id").getAsInt()); |
| 54 | + log.info("更新产品模型成功:{}",IotThingsModelService.getIotProductTranslateMap()); | ||
| 54 | return new Message(MessageCode.DEFAULT_SUCCESS_CODE,"指令发送成功"); | 55 | return new Message(MessageCode.DEFAULT_SUCCESS_CODE,"指令发送成功"); |
| 55 | case upIotThingsModelTranslate: | 56 | case upIotThingsModelTranslate: |
| 56 | iotThingsModelService.upIotThingsModelTranslate(deviceCommand.getData().get("product_id").getAsInt()); | 57 | iotThingsModelService.upIotThingsModelTranslate(deviceCommand.getData().get("product_id").getAsInt()); |
| @@ -334,4 +334,11 @@ public class IotThingsModelService { | @@ -334,4 +334,11 @@ public class IotThingsModelService { | ||
| 334 | return thingsModel; | 334 | return thingsModel; |
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | + public static Map<Integer, Map<String, String>> getIotProductTranslateMap() { | ||
| 338 | + return iotProductTranslateMap; | ||
| 339 | + } | ||
| 340 | + | ||
| 341 | + public static Map<Integer, Map<String, IotThingsModel>> getIotThingsModelMap() { | ||
| 342 | + return iotThingsModelMap; | ||
| 343 | + } | ||
| 337 | } | 344 | } |
| 1 | +package com.zhonglai.luhui.mqtt.service.proxy.controller; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.core.domain.AjaxResult; | ||
| 4 | +import com.zhonglai.luhui.device.domain.IotThingsModel; | ||
| 5 | +import com.zhonglai.luhui.device.protocol.factory.config.DeviceCach; | ||
| 6 | +import com.zhonglai.luhui.device.protocol.factory.control.DeviceCommandListenService; | ||
| 7 | +import com.zhonglai.luhui.device.protocol.factory.service.IotThingsModelService; | ||
| 8 | +import io.swagger.annotations.Api; | ||
| 9 | +import io.swagger.annotations.ApiOperation; | ||
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 11 | +import org.springframework.stereotype.Controller; | ||
| 12 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 13 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 14 | + | ||
| 15 | +import java.util.Map; | ||
| 16 | + | ||
| 17 | +@Api(tags = "系统运行接口") | ||
| 18 | +@Controller | ||
| 19 | +@RequestMapping("/sys") | ||
| 20 | +public class SysConfigController { | ||
| 21 | + | ||
| 22 | + @Autowired | ||
| 23 | + private IotThingsModelService thingsModelService; | ||
| 24 | + @ApiOperation("获取缓存物模型") | ||
| 25 | + @RequestMapping(value = "getIotThingsModelMap",method = RequestMethod.GET) | ||
| 26 | + public AjaxResult getIotThingsModelMap() | ||
| 27 | + { | ||
| 28 | + return AjaxResult.success(thingsModelService.getIotThingsModelMap()); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + @ApiOperation("获取翻译缓存物模型") | ||
| 32 | + @RequestMapping(value = "getIotProductTranslateMap",method = RequestMethod.GET) | ||
| 33 | + public AjaxResult getIotProductTranslateMap() | ||
| 34 | + { | ||
| 35 | + return AjaxResult.success(thingsModelService.getIotProductTranslateMap()); | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + @ApiOperation("获取缓存设备") | ||
| 39 | + @RequestMapping(value = "getDeviceInfo",method = RequestMethod.GET) | ||
| 40 | + public AjaxResult getDeviceInfo(String deviceInfoId) | ||
| 41 | + { | ||
| 42 | + return AjaxResult.success(DeviceCach.getDeviceInfo(deviceInfoId)); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @ApiOperation("获取缓存主机") | ||
| 46 | + @RequestMapping(value = "getDeviceHost",method = RequestMethod.GET) | ||
| 47 | + public AjaxResult getDeviceHost(String deviceId) | ||
| 48 | + { | ||
| 49 | + return AjaxResult.success(DeviceCach.getDeviceHost(deviceId)); | ||
| 50 | + } | ||
| 51 | +} |
-
请 注册 或 登录 后发表评论