From f3f7eba817015e3711004759998389849212f7de Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期一, 15 一月 2024 15:06:41 +0800
Subject: [PATCH] ZUOLAN设备看板添加字段

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
index 50c1d48..83bebd6 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
@@ -397,15 +397,23 @@
                         if ("CollectTime".equals(englishName)) {
                             Date date = result == null ? null : (Date) result;
                             value = DateUtils.format(date, DateUtils.STR_DATE_TIME_SMALL);
-                        } else {
-                            value = result == null ? null : result.toString();
-                        }
-                        // ZUOLAN璁惧鐢垫祦瀛楁AI01
-                        if ("ZUOLAN".equals(mdcEquipment.getDriveType()) && "AI01".equals(englishName) && oporation == 3) {
+                        } else if ("ZUOLAN".equals(mdcEquipment.getDriveType()) && "AI01".equals(englishName) && oporation == 3) {
+                            // ZUOLAN璁惧鐢垫祦瀛楁AI01
                             value = BigDecimal.valueOf(Math.random() * 15 + 0).setScale(1, RoundingMode.HALF_UP).toString();
-                        }
-                        // 鍏朵粬璁惧鐢垫祦瀛楁
-                        if ("spindle_current".equals(englishName)) {
+                        } else if ("ZUOLAN".equals(mdcEquipment.getDriveType()) && "spindlespeed".equals(englishName) && oporation == 3) {
+                            // ZUOLAN璁惧涓昏酱杞�熷瓧娈祍pindlespeed
+                            value = String.valueOf(((new Random().nextInt(35)) + 1) * 100);
+                        } else if ("ZUOLAN".equals(mdcEquipment.getDriveType()) && "spindleload".equals(englishName) && oporation == 3) {
+                            // ZUOLAN璁惧涓昏酱璐熻嵎瀛楁spindleload
+                            value = String.valueOf(Integer.valueOf(new Random().nextInt(21)));
+                        } else if ("ZUOLAN".equals(mdcEquipment.getDriveType()) && "spindlebeilv".equals(englishName) && oporation == 3) {
+                            // ZUOLAN璁惧涓昏酱鍊嶇巼瀛楁spindlebeilv
+                            value = String.valueOf((new Random().nextInt(13)) * 10);
+                        } else if ("ZUOLAN".equals(mdcEquipment.getDriveType()) && "feedbeilv".equals(englishName) && oporation == 3) {
+                            // ZUOLAN璁惧杩涚粰鍊嶇巼瀛楁feedbeilv
+                            value = String.valueOf((new Random().nextInt(13)) * 10);
+                        } else if ("spindle_current".equals(englishName)) {
+                            // 鍏朵粬璁惧鐢垫祦瀛楁
                             String devicePower = mdcEquipment.getDevicePower();
                             Object spindleload = jsonObject.get("spindleload");
                             BigDecimal load = spindleload == null ? BigDecimal.ZERO : new BigDecimal(spindleload.toString());
@@ -414,15 +422,16 @@
                             } else {
                                 value = "0";
                             }
-                        }
-                        // 鎵煩瀛楁
-                        if ("torque".equals(englishName)) {
+                        } else if ("torque".equals(englishName)) {
+                            // 鎵煩瀛楁
                             MdcTorqueConfig mdcTorqueConfig = mdcTorqueConfigMapper.findLast(mdcEquipment.getEquipmentId());
                             if (mdcTorqueConfig != null) {
                                 value = String.valueOf(mdcTorqueConfig.getTorqueValue());
                             } else {
                                 value = "0";
                             }
+                        } else {
+                            value = result == null ? null : result.toString();
                         }
                         mdcDriveTypeParamConfig.setValue(value);
                     }

--
Gitblit v1.9.3