From 129f764499aed8f9c8c01fbcdafb10789e0db0d6 Mon Sep 17 00:00:00 2001 From: zzc <1278921369@qq.com> Date: Wed, 4 Sep 2024 00:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96=20?= =?UTF-8?q?=E5=8D=95=E8=AE=BE=E5=A4=87=E7=99=BB=E5=BD=95=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BC=80=E5=90=88=E6=96=87=E6=9C=AC=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=92=8C=E8=BF=90=E8=A1=8C=E7=8A=B6=E6=80=81=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/web/domain/vo/EqEquipmentVo.java | 59 +++++++++++++++++++ .../service/impl/EqEquipmentServiceImpl.java | 11 ++++ .../src/main/resources/application.yml | 2 +- 3 files changed, 71 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/EqEquipmentVo.java b/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/EqEquipmentVo.java index 368389164..480ee0e1c 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/EqEquipmentVo.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/domain/vo/EqEquipmentVo.java @@ -118,5 +118,64 @@ public class EqEquipmentVo implements Serializable { @ExcelProperty(value = "排序") private Integer orderNum; + /** + * 设备状态(开合度) + * 0.已关闭 + * 10.打开10% + * 20.打开20% + * 30.打开30% + * 40.打开40% + * 50.打开50% + * 60.打开60% + * 70.打开70% + * 80.打开80% + * 90.打开90% + * 100.打开100% + */ + @ExcelProperty(value = "设备状态 设备的打开状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "eq_status_type") + private Integer openStatus; + /** + * 设备状态(开合度) + * 0.已关闭 + * 10.打开10% + * 20.打开20% + * 30.打开30% + * 40.打开40% + * 50.打开50% + * 60.打开60% + * 70.打开70% + * 80.打开80% + * 90.打开90% + * 100.打开100% + * 故障状态 + */ + private String openStatusText; + + /** + * 设备运行状态 + * 0.停止中 stop + * 1.关闭中 closing + * 2.开启中 opening + * 11.红外故障 irException + * 12.电机运转故障 motorRunException + * 13.电机维护故障 motorMaintainException + * 14.设备故障 deviceException + */ + @ExcelProperty(value = "设备状态 设备的打开状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "eq_run_status_type") + private Integer runStatus; + + /** + * 设备运行状态文本 + * 0.停止中 stop + * 1.关闭中 closing + * 2.开启中 openning + * 11.红外故障 irException + * 12.电机运转故障 motorRunException + * 13.电机维护故障 motorMaintainException + * 14.设备故障 deviceException + */ + private String runStatusText; } diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/EqEquipmentServiceImpl.java b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/EqEquipmentServiceImpl.java index d20406f43..1cfe0622d 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/impl/EqEquipmentServiceImpl.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/impl/EqEquipmentServiceImpl.java @@ -92,6 +92,17 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService { } record.setStatus(telemetryMsg.getOpenPercentage()); record.setFaultStatus(telemetryMsg.getGarageException()); + + //开合状态 + record.setOpenStatus(telemetryMsg.getOpenPercentage()); + record.setOpenStatusText( + telemetryMsg.getOpenPercentage()==0 + ?MessageUtils.message("openStatus.name0") + :MessageUtils.message("openStatus.name1")+ telemetryMsg.getOpenPercentage()+"%"); + + //运行状态 + record.setRunStatus(telemetryMsg.getGarageException()==10?telemetryMsg.getWorkState():telemetryMsg.getGarageException()); + record.setRunStatusText(MessageUtils.message("runStatus.name"+record.getRunStatus())); }else{ // 离线不需要调用接口 也不更新状态 在线离线状态要在事件触发的时候更新 否则性能很差 } diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 2c6608260..4d646e5ae 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -100,7 +100,7 @@ sa-token: # token名称 (同时也是cookie名称) token-name: Authorization # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) - is-concurrent: true + is-concurrent: false # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) is-share: false # jwt秘钥