From 901a05d4dcf6a61f3387715f7074831a7ce04ead Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期一, 15 一月 2024 16:46:16 +0800 Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/mdc_430 into develop --- 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