Преглед на файлове

裂解炉炉管测温测压 - 数据提交校验(测压<=0,测温>=600,并且<=1300)

wangggziwen преди 1 година
родител
ревизия
6d9d9f5752
променени са 24 файла, в които са добавени 215 реда и са изтрити 115 реда
  1. 30 24
      master/src/main/java/com/ruoyi/project/production/controller/TFurnancePressureController.java
  2. 31 25
      master/src/main/java/com/ruoyi/project/production/controller/TFurnanceTemperatureController.java
  3. 7 3
      ui/src/views/production/pressure/h109.vue
  4. 7 3
      ui/src/views/production/pressure/h110.vue
  5. 7 3
      ui/src/views/production/pressure/h111.vue
  6. 7 3
      ui/src/views/production/pressure/h112.vue
  7. 7 3
      ui/src/views/production/pressure/h113.vue
  8. 7 3
      ui/src/views/production/pressure/h114.vue
  9. 7 3
      ui/src/views/production/pressure/h115.vue
  10. 7 3
      ui/src/views/production/pressure/h116.vue
  11. 7 3
      ui/src/views/production/pressure/h117.vue
  12. 7 3
      ui/src/views/production/pressure/h118.vue
  13. 7 3
      ui/src/views/production/pressure/h130.vue
  14. 7 3
      ui/src/views/production/temperature/h109.vue
  15. 7 3
      ui/src/views/production/temperature/h110.vue
  16. 7 3
      ui/src/views/production/temperature/h111.vue
  17. 7 3
      ui/src/views/production/temperature/h112.vue
  18. 7 3
      ui/src/views/production/temperature/h113.vue
  19. 7 3
      ui/src/views/production/temperature/h114.vue
  20. 7 3
      ui/src/views/production/temperature/h115.vue
  21. 7 3
      ui/src/views/production/temperature/h116.vue
  22. 7 3
      ui/src/views/production/temperature/h117.vue
  23. 7 3
      ui/src/views/production/temperature/h118.vue
  24. 7 3
      ui/src/views/production/temperature/h130.vue

+ 30 - 24
master/src/main/java/com/ruoyi/project/production/controller/TFurnancePressureController.java

@@ -3212,7 +3212,7 @@ public class TFurnancePressureController extends BaseController
         return toAjax(tFurnancePressureService.insertTFurnancePressure(tFurnancePressure));
     }
 
-    public boolean isNegative(TFurnancePressure tFurnancePressure) {
+    public boolean isNegativeOrNull(TFurnancePressure tFurnancePressure) {
         String pass1 = tFurnancePressure.getPass1();
         String pass2 = tFurnancePressure.getPass2();
         String pass3 = tFurnancePressure.getPass3();
@@ -3229,56 +3229,62 @@ public class TFurnancePressureController extends BaseController
         String pass14 = tFurnancePressure.getPass14();
         String pass15 = tFurnancePressure.getPass15();
         String pass16 = tFurnancePressure.getPass16();
-        if (this.isPassNegative(pass1)) {
+        if (this.isPassNegativeOrNull(pass1)) {
             return true;
-        } else if (this.isPassNegative(pass2)) {
+        } else if (this.isPassNegativeOrNull(pass2)) {
             return true;
-        } else if (this.isPassNegative(pass3)) {
+        } else if (this.isPassNegativeOrNull(pass3)) {
             return true;
-        } else if (this.isPassNegative(pass4)) {
+        } else if (this.isPassNegativeOrNull(pass4)) {
             return true;
-        } else if (this.isPassNegative(pass5)) {
+        } else if (this.isPassNegativeOrNull(pass5)) {
             return true;
-        } else if (this.isPassNegative(pass6)) {
+        } else if (this.isPassNegativeOrNull(pass6)) {
             return true;
-        } else if (this.isPassNegative(pass7)) {
+        } else if (this.isPassNegativeOrNull(pass7)) {
             return true;
-        } else if (this.isPassNegative(pass8)) {
+        } else if (this.isPassNegativeOrNull(pass8)) {
             return true;
-        } else if (this.isPassNegative(pass9)) {
+        } else if (this.isPassNegativeOrNull(pass9)) {
             return true;
-        } else if (this.isPassNegative(pass10)) {
+        } else if (this.isPassNegativeOrNull(pass10)) {
             return true;
-        } else if (this.isPassNegative(pass11)) {
+        } else if (this.isPassNegativeOrNull(pass11)) {
             return true;
-        } else if (this.isPassNegative(pass12)) {
+        } else if (this.isPassNegativeOrNull(pass12)) {
             return true;
-        } else if (this.isPassNegative(pass13)) {
+        } else if (this.isPassNegativeOrNull(pass13)) {
             return true;
-        } else if (this.isPassNegative(pass14)) {
+        } else if (this.isPassNegativeOrNull(pass14)) {
             return true;
-        } else if (this.isPassNegative(pass15)) {
+        } else if (this.isPassNegativeOrNull(pass15)) {
             return true;
-        } else if (this.isPassNegative(pass16)) {
+        } else if (this.isPassNegativeOrNull(pass16)) {
             return true;
+        } else {
+            return false;
         }
-        return false;
     }
 
-    public boolean isPassNegative(String pass) {
+    public boolean isPassNegativeOrNull(String pass) {
         boolean flag = false;
         if (StringUtils.isNotNull(pass) && StringUtils.isNotEmpty(pass)) {
             String[] split = pass.split(",");
             for (int i = 0; i < split.length; i++) {
-                int element = Integer.parseInt(split[i]);
-                if (element < 0) {
+                if (StringUtils.isNull(split[i]) || StringUtils.isEmpty(split[i])) {
                     flag = true;
                     break;
+                } else {
+                    int element = Integer.parseInt(split[i]);
+                    if (element < 0) {
+                        flag = true;
+                        break;
+                    }
                 }
             }
             return flag;
         } else {
-            return false;
+            return true;
         }
     }
 
@@ -3290,8 +3296,8 @@ public class TFurnancePressureController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody TFurnancePressure tFurnancePressure)
     {
-        // 检查数据是否包含负值
-        if (!this.isNegative(tFurnancePressure)) {
+        // 检查数据是否包含负值或为Null
+        if (!this.isNegativeOrNull(tFurnancePressure)) {
             //更新
             tFurnancePressureService.updateTFurnancePressure(tFurnancePressure);
             //计算ratio

+ 31 - 25
master/src/main/java/com/ruoyi/project/production/controller/TFurnanceTemperatureController.java

@@ -1408,15 +1408,15 @@ public class TFurnanceTemperatureController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody TFurnanceTemperature tFurnanceTemperature)
     {
-        // 检查数据是否包含负值
-        if (!this.isNegative(tFurnanceTemperature)) {
+        // 检查数据是否包含负值或为Null
+        if (!this.isNegativeOrNull(tFurnanceTemperature)) {
             return toAjax(tFurnanceTemperatureService.updateTFurnanceTemperature(tFurnanceTemperature));
         } else {
-            return AjaxResult.error("提交失败,数据必须>=0!");
+            return AjaxResult.error("提交失败,数据必须>=600,并且<=1300!");
         }
     }
 
-    public boolean isNegative(TFurnanceTemperature tFurnanceTemperature) {
+    public boolean isNegativeOrNull(TFurnanceTemperature tFurnanceTemperature) {
         String pass1 = tFurnanceTemperature.getPass1();
         String pass2 = tFurnanceTemperature.getPass2();
         String pass3 = tFurnanceTemperature.getPass3();
@@ -1433,56 +1433,62 @@ public class TFurnanceTemperatureController extends BaseController
         String pass14 = tFurnanceTemperature.getPass14();
         String pass15 = tFurnanceTemperature.getPass15();
         String pass16 = tFurnanceTemperature.getPass16();
-        if (this.isPassNegative(pass1)) {
+        if (this.isPassNegativeOrNull(pass1)) {
             return true;
-        } else if (this.isPassNegative(pass2)) {
+        } else if (this.isPassNegativeOrNull(pass2)) {
             return true;
-        } else if (this.isPassNegative(pass3)) {
+        } else if (this.isPassNegativeOrNull(pass3)) {
             return true;
-        } else if (this.isPassNegative(pass4)) {
+        } else if (this.isPassNegativeOrNull(pass4)) {
             return true;
-        } else if (this.isPassNegative(pass5)) {
+        } else if (this.isPassNegativeOrNull(pass5)) {
             return true;
-        } else if (this.isPassNegative(pass6)) {
+        } else if (this.isPassNegativeOrNull(pass6)) {
             return true;
-        } else if (this.isPassNegative(pass7)) {
+        } else if (this.isPassNegativeOrNull(pass7)) {
             return true;
-        } else if (this.isPassNegative(pass8)) {
+        } else if (this.isPassNegativeOrNull(pass8)) {
             return true;
-        } else if (this.isPassNegative(pass9)) {
+        } else if (this.isPassNegativeOrNull(pass9)) {
             return true;
-        } else if (this.isPassNegative(pass10)) {
+        } else if (this.isPassNegativeOrNull(pass10)) {
             return true;
-        } else if (this.isPassNegative(pass11)) {
+        } else if (this.isPassNegativeOrNull(pass11)) {
             return true;
-        } else if (this.isPassNegative(pass12)) {
+        } else if (this.isPassNegativeOrNull(pass12)) {
             return true;
-        } else if (this.isPassNegative(pass13)) {
+        } else if (this.isPassNegativeOrNull(pass13)) {
             return true;
-        } else if (this.isPassNegative(pass14)) {
+        } else if (this.isPassNegativeOrNull(pass14)) {
             return true;
-        } else if (this.isPassNegative(pass15)) {
+        } else if (this.isPassNegativeOrNull(pass15)) {
             return true;
-        } else if (this.isPassNegative(pass16)) {
+        } else if (this.isPassNegativeOrNull(pass16)) {
             return true;
+        } else {
+            return false;
         }
-        return false;
     }
 
-    public boolean isPassNegative(String pass) {
+    public boolean isPassNegativeOrNull(String pass) {
         boolean flag = false;
         if (StringUtils.isNotNull(pass) && StringUtils.isNotEmpty(pass)) {
             String[] split = pass.split(",");
             for (int i = 0; i < split.length; i++) {
-                int element = Integer.parseInt(split[i]);
-                if (element < 0) {
+                if (StringUtils.isNull(split[i]) || StringUtils.isEmpty(split[i])) {
                     flag = true;
                     break;
+                } else {
+                    int element = Integer.parseInt(split[i]);
+                    if (element <= 600 || element >= 1300) {
+                        flag = true;
+                        break;
+                    }
                 }
             }
             return flag;
         } else {
-            return false;
+            return true;
         }
     }
 

+ 7 - 3
ui/src/views/production/pressure/h109.vue

@@ -1886,9 +1886,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/pressure/h110.vue

@@ -1250,9 +1250,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/pressure/h111.vue

@@ -1250,9 +1250,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/pressure/h112.vue

@@ -1250,9 +1250,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/pressure/h113.vue

@@ -1250,9 +1250,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/pressure/h114.vue

@@ -1250,9 +1250,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/pressure/h115.vue

@@ -1250,9 +1250,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/pressure/h116.vue

@@ -1250,9 +1250,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/pressure/h117.vue

@@ -1250,9 +1250,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/pressure/h118.vue

@@ -1250,9 +1250,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/pressure/h130.vue

@@ -1122,9 +1122,13 @@
           if (valid) {
             if (this.form.id != null) {
               updatePressure(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addPressure(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h109.vue

@@ -710,9 +710,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h110.vue

@@ -582,9 +582,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h111.vue

@@ -582,9 +582,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h112.vue

@@ -582,9 +582,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h113.vue

@@ -581,9 +581,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h114.vue

@@ -582,9 +582,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h115.vue

@@ -582,9 +582,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h116.vue

@@ -582,9 +582,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h117.vue

@@ -582,9 +582,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h118.vue

@@ -582,9 +582,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {

+ 7 - 3
ui/src/views/production/temperature/h130.vue

@@ -646,9 +646,13 @@
           if (valid) {
             if (this.form.id != null) {
               updateTemperature(this.form).then(response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
+                if (response.code == 200) {
+                  this.msgSuccess("修改成功");
+                  this.open = false;
+                  this.getList();
+                } else {
+                  this.msgInfo(response.msg);
+                }
               });
             } else {
               addTemperature(this.form).then(response => {