From 42536733ddfce247d5671d321ea1ec1c8b37f36a Mon Sep 17 00:00:00 2001
From: whyczh <hzjl@qq.com>
Date: 星期三, 07 四月 2021 16:29:33 +0800
Subject: [PATCH] 更新试验计划参数配置接口

---
 src/main/java/com/whyc/controller/TestConfigController.java |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/whyc/controller/TestConfigController.java b/src/main/java/com/whyc/controller/TestConfigController.java
index a03cef2..72e3cab 100644
--- a/src/main/java/com/whyc/controller/TestConfigController.java
+++ b/src/main/java/com/whyc/controller/TestConfigController.java
@@ -56,18 +56,34 @@
         }
         return new Response().set(1,deviceInfList);
     }
-    //璁惧id鑾峰彇璁惧绫诲瀷id锛屽皢璁惧绫诲瀷鐨勯粯璁ゅ弬鏁板鍒跺埌璁惧绫昏繑鍥�
+    //璁惧id鑾峰彇璁惧绫诲瀷id锛屽鏋滆澶囨湁鍙傛暟鏄剧ず鏈韩鍙傛暟锛屽鏋滄病鏈夊皢璁惧绫诲瀷鐨勯粯璁ゅ弬鏁板鍒跺埌璁惧绫昏繑鍥�
     public DeviceInf getDefaultConfig(Integer deviceId){
         DeviceInf deviceInf = deviceInfService.getOneByDeviceId(deviceId);
         DeviceType deviceType = deviceTypeService.getOneByDeviceTypeId(deviceInf.getSystemId());
-        deviceInf.setLoadStartType(deviceType.getLoadStartType());
-        deviceInf.setLoadRuntimeHour(deviceType.getLoadRuntimeHour());
-        deviceInf.setLoadRuntimeMin(deviceType.getLoadRuntimeMin());
-        deviceInf.setLoadCurrStd(deviceType.getLoadCurrStd());
-        deviceInf.setLoadVolStd(deviceType.getLoadVolStd());
-        deviceInf.setLoadRpm(deviceType.getLoadRpm());
-        deviceInf.setLoadTorque(deviceType.getLoadTorque());
-        deviceInf.setLoadPropulsionShaft(deviceType.getLoadPropulsionShaft());
+        if (deviceInf.getLoadStartType() == null) {
+            deviceInf.setLoadStartType(deviceType.getLoadStartType());
+        }
+        if (deviceInf.getLoadRuntimeHour() == null) {
+            deviceInf.setLoadRuntimeHour(deviceType.getLoadRuntimeHour());
+        }
+        if (deviceInf.getLoadRuntimeMin() == null) {
+            deviceInf.setLoadRuntimeMin(deviceType.getLoadRuntimeMin());
+        }
+        if (deviceInf.getLoadCurrStd() == null) {
+            deviceInf.setLoadCurrStd(deviceType.getLoadCurrStd());
+        }
+        if (deviceInf.getLoadVolStd() == null) {
+            deviceInf.setLoadVolStd(deviceType.getLoadVolStd());
+        }
+        if (deviceInf.getLoadRpm() == null) {
+            deviceInf.setLoadRpm(deviceType.getLoadRpm());
+        }
+        if (deviceInf.getLoadTorque() == null) {
+            deviceInf.setLoadTorque(deviceType.getLoadTorque());
+        }
+        if (deviceInf.getLoadPropulsionShaft() == null) {
+            deviceInf.setLoadPropulsionShaft(deviceType.getLoadPropulsionShaft());
+        }
         return deviceInf;
     }
 

--
Gitblit v1.9.1