From c1d88895501846c4ad1ba2b16f4a8ae10ca2b061 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期二, 26 三月 2024 15:32:35 +0800
Subject: [PATCH] 代码更新

---
 springboot-vue3/src/main/java/com/example/springboot/service/HomeService.java |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

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 4842b26..54bf11e 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
@@ -21,6 +21,7 @@
 
 import com.example.springboot.entity.GlassInfo;
 import com.example.springboot.entity.MeasureSetting;
+import com.example.springboot.entity.Queue;
 import com.example.springboot.mapper.GlassInfoMapper;
 import com.example.springboot.mapper.MeasureSettingMapper;
 import com.example.springboot.mapper.QueueMapper;
@@ -63,6 +64,11 @@
 
     // 鍖归厤閫昏緫
     public boolean Normal(double width, double height, String line) {
+        List<Queue> ErrowQueues= QueueMapper.selectErrorQueues();
+        if (ErrowQueues.size()>0) {
+            //System.out.println("鏈夊尮閰嶅け璐ユ暟鎹湭鍘婚櫎");
+            return false;
+        }
         List<GlassInfo> Result = NormalGlassInfo(width, height, "1");
         if (Result.size() == 1) {
             // 鍖归厤鎴愬姛 灏变竴绉嶇被鍨� 娣诲姞鏁版嵁
@@ -70,22 +76,19 @@
             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);
+            QueueMapper.insertMatchFailure(width, height, 0);
             System.out.println("鍖归厤澶辫触");
-            return false;
+            
         } else {
             // 鍖归厤澶辫触 鏈壘鍒扮鍚堢殑鏁版嵁 娣诲姞鏁版嵁
-            QueueMapper.insert(null, width, height, 3);
+            QueueMapper.insertMatchFailure(width, height, -1);
             System.out.println("鏈壘鍒扮鍚堢殑鏁版嵁");
-            return false;
         }
+        return false;
     }
 
     // Execl琛ㄦ牸 浼犲叆鏂囦欢璺緞
@@ -93,6 +96,10 @@
         try {
             // 鍒涘缓鏂囦欢瀵硅薄
             File file = new File(filename);
+            if (!file.exists()) {
+                System.out.println("鏂囦欢涓嶅瓨鍦紒 "+filename);
+                return new ArrayList<>();
+            }
             // 鍒涘缓鏂囦欢杈撳叆娴佸璞�
             FileInputStream inputStream = new FileInputStream(file);
             // 鍒涘缓宸ヤ綔绨垮璞�

--
Gitblit v1.8.0