From a65b82e86951db8540d38141715be2444b12dc99 Mon Sep 17 00:00:00 2001
From: 严智鑫 <test>
Date: 星期一, 18 三月 2024 12:23:10 +0800
Subject: [PATCH] 更新

---
 springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java    |  122 ++++++++++++++++++++++++----------------
 Albania_Mes-ui/src/views/home/index.vue                                          |    8 +-
 springboot-vue3/src/main/java/com/example/springboot/entity/GlassInfo.java       |    1 
 springboot-vue3/src/main/java/com/example/springboot/entity/glassinfo.java       |    1 
 springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java      |   22 ------
 springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java |    6 +-
 6 files changed, 85 insertions(+), 75 deletions(-)

diff --git a/Albania_Mes-ui/src/views/home/index.vue b/Albania_Mes-ui/src/views/home/index.vue
index c7de164..e5e8330 100644
--- a/Albania_Mes-ui/src/views/home/index.vue
+++ b/Albania_Mes-ui/src/views/home/index.vue
@@ -253,18 +253,18 @@
             </div>
             <div style="display:flex;justify-content: space-around;width: 95%;margin: 0 auto;">
                 <el-button type="primary" @click="showform(1)" :disabled="SoftEmergencyStopState"
-                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
+                    :class="SoftEmergencyStopState == true ? 'hide' : ''" style="z-index: 999;">
                     {{ $t('Import order') }}</el-button>
                     
                 <el-button type="primary" @click="showform(2)" :disabled="SoftEmergencyStopState"
-                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
+                    :class="SoftEmergencyStopState == true ? 'hide' : ''" style="z-index: 999;">
                     {{ $t('Measure') }}</el-button>
 
                 <el-button type="primary" @click="showform(3)" :disabled="SoftEmergencyStopState"
-                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
+                    :class="SoftEmergencyStopState == true ? 'hide' : ''" style="z-index: 999;">
                     {{ $t('StorageCage') }}</el-button>
                 <el-button type="primary" @click="showform(4)" :disabled="SoftEmergencyStopState"
-                    :class="SoftEmergencyStopState == true ? 'hide' : ''">
+                    :class="SoftEmergencyStopState == true ? 'hide' : ''" style="z-index: 999;">
                     {{ $t('Task queue') }}</el-button>
             </div>
             <div style="display: flex;align-items: center;">
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
index 425009b..684d234 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java
@@ -144,27 +144,9 @@
                 double width = 402;
                 double height = 402;
                 
-                //鑾峰彇鍖归厤璁剧疆
+                //鍖归厤
                 if ("1".equals(PlcRequest)) {
-                    List<GlassInfo> Result=HomeService.NormalGlassInfo(width, height, "1");
-                    if(Result.size()==1){
-                        //鍖归厤鎴愬姛  灏变竴绉嶇被鍨�  娣诲姞鏁版嵁
-                        GlassInfo GlassInfo=Result.get(0);
-                        QueueMapper.insert(GlassInfo.getGlassid(),width,height,1);
-                        System.out.println("鍖归厤鎴愬姛");
-                        //S7control.getinstance().WriteWord(plcmes.getPlcParameter("GaToMES").getAddress(), (short) 1);
-                        System.out.println(GlassInfo.getGlassid());
-                    }else if(Result.size()>1){
-                        //鍖归厤澶辫触 鍖归厤鍒板鏉$鍚堢殑鏁版嵁  娣诲姞鏁版嵁
-                        QueueMapper.insert(null,width,height,2);
-                        System.out.println("鍖归厤澶辫触");
-                    }
-                    else{
-                        //鍖归厤澶辫触 鏈壘鍒扮鍚堢殑鏁版嵁 娣诲姞鏁版嵁
-                        QueueMapper.insert(null,width,height,3);
-                        System.out.println("鏈壘鍒扮鍚堢殑鏁版嵁");
-                    }
-                    
+                    boolean Result=HomeService.Normal(width, height, "1");                   
                 }
                 // String E01id = new String( S7controlLK.getinstance().ReadByte("DB17.0",16));
                 // String J01id = new String( S7controlLK.getinstance().ReadByte("DB17.22",14));
diff --git a/springboot-vue3/src/main/java/com/example/springboot/entity/GlassInfo.java b/springboot-vue3/src/main/java/com/example/springboot/entity/GlassInfo.java
index d375337..137e8c5 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/entity/GlassInfo.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/entity/GlassInfo.java
@@ -20,4 +20,5 @@
   private Double thickness;// 鍘�
   private Integer number;// 鏁伴噺
   private Integer finishnumber;// 瀹屾垚鏁伴噺
+  private Integer measurenumber;// 娴嬮噺瀹屾垚鏁伴噺
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/entity/glassinfo.java b/springboot-vue3/src/main/java/com/example/springboot/entity/glassinfo.java
index d375337..137e8c5 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/entity/glassinfo.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/entity/glassinfo.java
@@ -20,4 +20,5 @@
   private Double thickness;// 鍘�
   private Integer number;// 鏁伴噺
   private Integer finishnumber;// 瀹屾垚鏁伴噺
+  private Integer measurenumber;// 娴嬮噺瀹屾垚鏁伴噺
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java
index da2a843..8814052 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/GlassInfoMapper.java
@@ -15,15 +15,15 @@
 @Repository
 public interface GlassInfoMapper extends BaseMapper<GlassInfo> {
 
-    @Select("SELECT * FROM glassinfo where width<=#{maxwidth} and width>=#{minwidth} and height<=#{maxheight} and height>=#{minheight}")
+    @Select("SELECT * FROM glassinfo where width<=#{maxwidth} and width>=#{minwidth} and height<=#{maxheight} and height>=#{minheight} and measurenumber<number")
     List<GlassInfo> selectGlassInfos(@Param("maxwidth") double maxwidth, @Param("minwidth") double minwidth, @Param("maxheight") double maxheight, @Param("minheight") double minheight);
 
     // @Select("SELECT COUNT(*) FROM role_permission WHERE role_id = #{roleId} AND permission_id = #{permissionId}")
     // boolean checkExists(@Param("roleId") int roleId, @Param("permissionId") int permissionId);
 
 
-    // @Update("UPDATE role_permission SET state = #{state} WHERE role_id = #{roleId} AND permission_id = #{permissionId}")
-    // void updateState(@Param("roleId") int roleId, @Param("permissionId") int permissionId, @Param("state") int state);
+    @Update("UPDATE glassinfo SET measurenumber = measurenumber+1 WHERE id = #{id}")
+    void updatemeasurenumber(@Param("id") int roleId);
 
     // @Insert("INSERT INTO role_permission (role_id, permission_id, state) VALUES (#{roleId}, #{permissionId}, #{state})")
     // void insert(@Param("roleId") int roleId, @Param("permissionId") int permissionId, @Param("state") int state);
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java b/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java
index dda7048..4842b26 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java
@@ -61,64 +61,90 @@
         return Results;
     }
 
-    //Execl琛ㄦ牸 浼犲叆鏂囦欢璺緞  
+    // 鍖归厤閫昏緫
+    public boolean Normal(double width, double height, String line) {
+        List<GlassInfo> Result = NormalGlassInfo(width, height, "1");
+        if (Result.size() == 1) {
+            // 鍖归厤鎴愬姛 灏变竴绉嶇被鍨� 娣诲姞鏁版嵁
+            GlassInfo GlassInfo = Result.get(0);
+            QueueMapper.insert(GlassInfo.getGlassid(), width, height, 1);
+            GlassInfoMapper.updatemeasurenumber(GlassInfo.getId());
+            System.out.println("鍖归厤鎴愬姛");
+            
+            // S7control.getinstance().WriteWord(plcmes.getPlcParameter("GaToMES").getAddress(),
+            // (short) 1);
+            System.out.println(GlassInfo.getGlassid());
+            return true;
+        } else if (Result.size() > 1) {
+            // 鍖归厤澶辫触 鍖归厤鍒板鏉$鍚堢殑鏁版嵁 娣诲姞鏁版嵁
+            QueueMapper.insert(null, width, height, 2);
+            System.out.println("鍖归厤澶辫触");
+            return false;
+        } else {
+            // 鍖归厤澶辫触 鏈壘鍒扮鍚堢殑鏁版嵁 娣诲姞鏁版嵁
+            QueueMapper.insert(null, width, height, 3);
+            System.out.println("鏈壘鍒扮鍚堢殑鏁版嵁");
+            return false;
+        }
+    }
+
+    // Execl琛ㄦ牸 浼犲叆鏂囦欢璺緞
     public List ReadExecl(String filename) {
         try {
-             // 鍒涘缓鏂囦欢瀵硅薄
-        File file = new File(filename);
-        // 鍒涘缓鏂囦欢杈撳叆娴佸璞�
-        FileInputStream inputStream = new FileInputStream(file);
-        // 鍒涘缓宸ヤ綔绨垮璞�
-        Workbook workbook = WorkbookFactory.create(inputStream);
-        // 鑾峰彇绗竴涓伐浣滆〃瀵硅薄
-        Sheet sheet = workbook.getSheetAt(0);
-        // 鍒涘缓涓�涓疄浣撶被闆嗗悎锛岀敤浜庡瓨鍌‥xcel鏁版嵁
-        
-        List Results=new ArrayList();  
-        int i=0;  
-        // 閬嶅巻琛�
-        for (Row row : sheet) {
-            // 閬嶅巻鍗曞厓鏍�
-            List ResultRow=new ArrayList(); 
-            //System.out.println();
-            for (Cell cell : row) {
-                String LastCellvalue="";
-                // 鍒ゆ柇鍗曞厓鏍肩被鍨嬫槸鍚︿负鍏紡绫诲瀷
-                if (cell.getCellType() == CellType.FORMULA) {
-                    // 浣跨敤鍏紡璁$畻鍣ㄨ绠楀崟鍏冩牸鐨勫��
-                    FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
-                    CellValue cellValue = evaluator.evaluate(cell);
-                    // 璁$畻鍚庣殑鍗曞厓鏍煎��
-                    LastCellvalue=cellValue.getNumberValue()+"";
-                }else if(cell.getCellType() == CellType.NUMERIC){
-                    double value = cell.getNumericCellValue();
-                    if (value%1==0) {
-                        LastCellvalue=Math.round(value)+"";
-                    }else{
-                        LastCellvalue=value+"";
+            // 鍒涘缓鏂囦欢瀵硅薄
+            File file = new File(filename);
+            // 鍒涘缓鏂囦欢杈撳叆娴佸璞�
+            FileInputStream inputStream = new FileInputStream(file);
+            // 鍒涘缓宸ヤ綔绨垮璞�
+            Workbook workbook = WorkbookFactory.create(inputStream);
+            // 鑾峰彇绗竴涓伐浣滆〃瀵硅薄
+            Sheet sheet = workbook.getSheetAt(0);
+            // 鍒涘缓涓�涓疄浣撶被闆嗗悎锛岀敤浜庡瓨鍌‥xcel鏁版嵁
+
+            List Results = new ArrayList();
+            int i = 0;
+            // 閬嶅巻琛�
+            for (Row row : sheet) {
+                // 閬嶅巻鍗曞厓鏍�
+                List ResultRow = new ArrayList();
+                // System.out.println();
+                for (Cell cell : row) {
+                    String LastCellvalue = "";
+                    // 鍒ゆ柇鍗曞厓鏍肩被鍨嬫槸鍚︿负鍏紡绫诲瀷
+                    if (cell.getCellType() == CellType.FORMULA) {
+                        // 浣跨敤鍏紡璁$畻鍣ㄨ绠楀崟鍏冩牸鐨勫��
+                        FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();
+                        CellValue cellValue = evaluator.evaluate(cell);
+                        // 璁$畻鍚庣殑鍗曞厓鏍煎��
+                        LastCellvalue = cellValue.getNumberValue() + "";
+                    } else if (cell.getCellType() == CellType.NUMERIC) {
+                        double value = cell.getNumericCellValue();
+                        if (value % 1 == 0) {
+                            LastCellvalue = Math.round(value) + "";
+                        } else {
+                            LastCellvalue = value + "";
+                        }
+                    } else {
+                        // 鍗曞厓鏍煎��
+                        LastCellvalue = cell.toString();
                     }
-                } else {
-                    // 鍗曞厓鏍煎��
-                    LastCellvalue=cell.toString(); 
+                    ResultRow.add(LastCellvalue);
+                    // System.out.print(LastCellvalue+" ");
                 }
-                ResultRow.add(LastCellvalue);
-                //System.out.print(LastCellvalue+"  ");
+                Results.add(ResultRow);
+                i++;
             }
-            Results.add(ResultRow);
-            i++;
-        }
-        System.out.println(i);
-        // 鍏抽棴宸ヤ綔绨垮拰杈撳叆娴佸璞�
-        workbook.close();
-        inputStream.close();
-        return Results;
+            System.out.println(i);
+            // 鍏抽棴宸ヤ綔绨垮拰杈撳叆娴佸璞�
+            workbook.close();
+            inputStream.close();
+            return Results;
         } catch (Exception e) {
             // TODO: handle exception
             System.out.println("寮傚父");
             return new ArrayList();
         }
-       
-    }
 
+    }
 
 }

--
Gitblit v1.8.0