From 2d52133d69b1c08461754906f1f79970777e3949 Mon Sep 17 00:00:00 2001
From: lsh <lsh@163.com>
Date: 星期二, 24 十二月 2024 16:45:09 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/asrs/controller/BasQualityTestingController.java    |   10 +++++++++-
 src/main/resources/mapper/BasQualityTestingMapper.xml                    |    2 +-
 src/main/java/com/zy/asrs/controller/BasProcessProceduresController.java |    9 +++++++++
 src/main/java/com/zy/asrs/entity/BasQualityTesting.java                  |    3 +++
 src/main/java/com/zy/asrs/entity/BasProcessProcedures.java               |    3 +++
 src/main/resources/mapper/BasProcessProceduresMapper.xml                 |    2 +-
 src/main/webapp/views/basProcessProcedures/basProcessProcedures.html     |    4 ++--
 src/main/webapp/views/basQualityTesting/basQualityTesting.html           |    4 ++--
 8 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/BasProcessProceduresController.java b/src/main/java/com/zy/asrs/controller/BasProcessProceduresController.java
index a997828..c74936a 100644
--- a/src/main/java/com/zy/asrs/controller/BasProcessProceduresController.java
+++ b/src/main/java/com/zy/asrs/controller/BasProcessProceduresController.java
@@ -62,6 +62,10 @@
     @RequestMapping(value = "/basProcessProcedures/add/auth")
     @ManagerAuth
     public R add(BasProcessProcedures basProcessProcedures) {
+        BasProcessProcedures boxType = basProcessProceduresService.selectOne(new EntityWrapper<BasProcessProcedures>().eq("box_type", basProcessProcedures.getBoxType()));
+        if (!Cools.isEmpty(boxType)){
+            return R.error("鏍囪瘑鍙烽噸澶�,璇锋鏌�!!!");
+        }
         basProcessProceduresService.insert(basProcessProcedures);
         return R.ok();
     }
@@ -72,6 +76,11 @@
         if (Cools.isEmpty(basProcessProcedures) || null==basProcessProcedures.getId()){
             return R.error();
         }
+        BasProcessProcedures boxType = basProcessProceduresService.selectOne(new EntityWrapper<BasProcessProcedures>().eq("box_type", basProcessProcedures.getBoxType()));
+        BasProcessProcedures basProcessProcedures1 = basProcessProceduresService.selectById(basProcessProcedures.getId());
+        if (!Cools.isEmpty(boxType) && !basProcessProcedures1.equals(boxType)){
+            return R.error("鏍囪瘑鍙烽噸澶�,璇锋鏌�!!!");
+        }
         basProcessProceduresService.updateById(basProcessProcedures);
         return R.ok();
     }
diff --git a/src/main/java/com/zy/asrs/controller/BasQualityTestingController.java b/src/main/java/com/zy/asrs/controller/BasQualityTestingController.java
index 31ac263..41f3f6b 100644
--- a/src/main/java/com/zy/asrs/controller/BasQualityTestingController.java
+++ b/src/main/java/com/zy/asrs/controller/BasQualityTestingController.java
@@ -1,6 +1,5 @@
 package com.zy.asrs.controller;
 
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
@@ -62,6 +61,10 @@
     @RequestMapping(value = "/basQualityTesting/add/auth")
     @ManagerAuth
     public R add(BasQualityTesting basQualityTesting) {
+        BasQualityTesting boxType = basQualityTestingService.selectOne(new EntityWrapper<BasQualityTesting>().eq("box_type", basQualityTesting.getBoxType()));
+        if (!Cools.isEmpty(boxType)){
+            return R.error("鏍囪瘑鍙烽噸澶�,璇锋鏌�!!!");
+        }
         basQualityTestingService.insert(basQualityTesting);
         return R.ok();
     }
@@ -72,6 +75,11 @@
         if (Cools.isEmpty(basQualityTesting) || null==basQualityTesting.getId()){
             return R.error();
         }
+        BasQualityTesting boxType = basQualityTestingService.selectOne(new EntityWrapper<BasQualityTesting>().eq("box_type", basQualityTesting.getBoxType()));
+        BasQualityTesting basQualityTesting1 = basQualityTestingService.selectById(basQualityTesting.getId());
+        if (!Cools.isEmpty(boxType) && !basQualityTesting1.equals(boxType)){
+            return R.error("鏍囪瘑鍙烽噸澶�,璇锋鏌�!!!");
+        }
         basQualityTestingService.updateById(basQualityTesting);
         return R.ok();
     }
diff --git a/src/main/java/com/zy/asrs/entity/BasProcessProcedures.java b/src/main/java/com/zy/asrs/entity/BasProcessProcedures.java
index b6dac0f..841a599 100644
--- a/src/main/java/com/zy/asrs/entity/BasProcessProcedures.java
+++ b/src/main/java/com/zy/asrs/entity/BasProcessProcedures.java
@@ -1,5 +1,7 @@
 package com.zy.asrs.entity;
 
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
 import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableField;
 
 import io.swagger.annotations.ApiModelProperty;
@@ -17,6 +19,7 @@
      * ID
      */
     @ApiModelProperty(value= "ID")
+    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
diff --git a/src/main/java/com/zy/asrs/entity/BasQualityTesting.java b/src/main/java/com/zy/asrs/entity/BasQualityTesting.java
index ea5961e..708c647 100644
--- a/src/main/java/com/zy/asrs/entity/BasQualityTesting.java
+++ b/src/main/java/com/zy/asrs/entity/BasQualityTesting.java
@@ -1,5 +1,7 @@
 package com.zy.asrs.entity;
 
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
 import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableField;
 
 import io.swagger.annotations.ApiModelProperty;
@@ -17,6 +19,7 @@
      * ID
      */
     @ApiModelProperty(value= "ID")
+    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
diff --git a/src/main/resources/mapper/BasProcessProceduresMapper.xml b/src/main/resources/mapper/BasProcessProceduresMapper.xml
index 1793bdc..bcf6db4 100644
--- a/src/main/resources/mapper/BasProcessProceduresMapper.xml
+++ b/src/main/resources/mapper/BasProcessProceduresMapper.xml
@@ -4,7 +4,7 @@
 
     <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
     <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasProcessProcedures">
-        <id column="id" property="id" />
+        <result column="id" property="id" />
         <result column="box_specs" property="boxSpecs" />
         <result column="box_type" property="boxType" />
 
diff --git a/src/main/resources/mapper/BasQualityTestingMapper.xml b/src/main/resources/mapper/BasQualityTestingMapper.xml
index c450cb8..c7d02a2 100644
--- a/src/main/resources/mapper/BasQualityTestingMapper.xml
+++ b/src/main/resources/mapper/BasQualityTestingMapper.xml
@@ -4,7 +4,7 @@
 
     <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
     <resultMap id="BaseResultMap" type="com.zy.asrs.entity.BasQualityTesting">
-        <id column="id" property="id" />
+        <result column="id" property="id" />
         <result column="box_specs" property="boxSpecs" />
         <result column="box_type" property="boxType" />
 
diff --git a/src/main/webapp/views/basProcessProcedures/basProcessProcedures.html b/src/main/webapp/views/basProcessProcedures/basProcessProcedures.html
index d91d322..95640d6 100644
--- a/src/main/webapp/views/basProcessProcedures/basProcessProcedures.html
+++ b/src/main/webapp/views/basProcessProcedures/basProcessProcedures.html
@@ -81,9 +81,9 @@
                     </div>
                 </div>
                 <div class="layui-form-item">
-                    <label class="layui-form-label">宸ュ簭鍙�: </label>
+                    <label class="layui-form-label layui-form-required">宸ュ簭鍙�: </label>
                     <div class="layui-input-block">
-                        <input class="layui-input" name="boxType" placeholder="璇疯緭鍏ュ伐搴忓彿">
+                        <input class="layui-input" name="boxType" placeholder="璇疯緭鍏ュ伐搴忓彿" lay-vertype="tips" lay-verify="required">
                     </div>
                 </div>
 
diff --git a/src/main/webapp/views/basQualityTesting/basQualityTesting.html b/src/main/webapp/views/basQualityTesting/basQualityTesting.html
index 6320d71..e60a271 100644
--- a/src/main/webapp/views/basQualityTesting/basQualityTesting.html
+++ b/src/main/webapp/views/basQualityTesting/basQualityTesting.html
@@ -81,9 +81,9 @@
                     </div>
                 </div>
                 <div class="layui-form-item">
-                    <label class="layui-form-label">鐘舵�佸彿: </label>
+                    <label class="layui-form-label  layui-form-required">鐘舵�佸彿: </label>
                     <div class="layui-input-block">
-                        <input class="layui-input" name="boxType" placeholder="璇疯緭鍏ョ姸鎬佸彿">
+                        <input class="layui-input" name="boxType" placeholder="璇疯緭鍏ョ姸鎬佸彿" lay-vertype="tips" lay-verify="required">
                     </div>
                 </div>
 

--
Gitblit v1.9.1