From ced0655bb9f83906eb9986462c9641c15baa5918 Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期二, 09 四月 2024 14:18:03 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/Albania_Mes

---
 springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java |   34 +++++++++++++++-------------------
 1 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
index 3651989..28a0b49 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
@@ -4,13 +4,12 @@
 import com.example.springboot.service.StorageCageService;
 import com.example.springboot.entity.GlassInfo;
 import com.example.springboot.entity.device.PlcParameterObject;
-import com.example.springboot.mapper.AlarmMapper;
 import com.example.springboot.mapper.AlbaniaMapper;
 
 
 public class PlcHoldNew extends Thread {
 
-  private AlarmMapper alarmMapper;
+ 
 
   @Autowired
   private AlbaniaMapper albaniaMapper;
@@ -24,7 +23,7 @@
     while (this != null) {
       try {
 
-        Thread.sleep(100);
+        Thread.sleep(500);
       } catch (InterruptedException e) {
         e.printStackTrace();
       }
@@ -38,8 +37,8 @@
       PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
       if(plcmes.getPlcParameter("PLCToMES").getValue()!=null){
         
-      // spianService.Mestast("NG0001-1",0,3,1,"MESID1",1);
-      //  S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short)1);//鍑虹墖浠诲姟鍚姩
+      //spianService.Mestast("NG0001-1",1,4,1,"MESID1",1);
+
        
     
       String ExportTOMES1=plcmes.getPlcParameter("ExportTOMES1").getValue();//鍑虹墖璇锋眰涓�绾�
@@ -47,26 +46,27 @@
       String PLCToMES=plcmes.getPlcParameter("PLCToMES").getValue();//杩愰�佽溅璇锋眰
       String IDStatus1=plcmes.getPlcParameter("IDStatus1").getValue();//1鍙蜂换鍔″畬鎴�
       String MESToPLCStatus1=plcmes.getPlcParameter("MESToPLCStatus1").getValue();//1鍙风‘璁ゅ瓧
+      String MESToPLC=plcmes.getPlcParameter("MESToPLC").getValue();//鍙戦�佷换鍔″瓧
       
       //涓�鍙风嚎璇锋眰
-      if(ExportTOMES1!=null){
-      if (ExportTOMES1.equals("1") == true&&PLCToMES.equals("1")==true) {
+      if(ExportTOMES1!=null&&MESToPLC!=null){
+      if (ExportTOMES1.equals("1") == true&&MESToPLC.equals("0")==true) {
         //灏嗚繍杈撹溅鐘舵�佹敼涓哄繖纰�
         spianService.selectout(1);
       }
     }
       // //浜岀嚎鍙疯姹傛椂
-      if(ExportToMES2!=null ){
-      if (ExportToMES2.equals("1") == true&&PLCToMES.equals("1")==true) {
+      if(ExportToMES2!=null &&MESToPLC!=null){
+      if (ExportToMES2.equals("1") == true&&MESToPLC.equals("0")==true) {
         //灏嗚繍杈撹溅鐘舵�佹敼涓哄繖纰�
-        S7control.getinstance().WriteWord(plcmes.getPlcParameter("B01report").getAddress(), (short) 1);
+       
         spianService.selectout(2);
       }
     }
       //杩涚墖璇锋眰鏃�
       GlassInfo glass=albaniaMapper.SelectGlass();
-      if(PLCToMES!=null && glass!=null){
-      if(PLCToMES.equals("1")==true&&glass!=null){        
+      if(PLCToMES!=null && glass!=null&&MESToPLC!=null){
+      if(PLCToMES.equals("1")==true&&MESToPLC.equals("0")==true){        
         spianService.selectAll(glass);
       }
     }
@@ -79,18 +79,14 @@
           
           String Tastover=plcmes.getPlcParameter("IDStatus"+i).getValue();//PLC鐞嗙墖浠诲姟鐘舵�佹眹鎶�
           String Glassid=plcmes.getPlcParameter("MESID"+i).getValueString();//MES鐜荤拑ID
-          
-          GlassInfo id=albaniaMapper.SelectTaskId(Glassid);
-       
+          GlassInfo id=albaniaMapper.SelectTaskId(Glassid);       
             if(id!=null&&Tastover.equals("1")){
               //璋冪敤瀹屾垚浠诲姟 Glassid
               storageCageService.FinishTask(id.getId());
-            }    
-              S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 0);//娓呴櫎浠诲姟瀛�
+            }               
               S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLCStatus"+i).getAddress(), (short) 1);//瀹屾垚纭瀛�
-             
             }
-          
+              S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short) 0);//娓呴櫎浠诲姟鍙戦�佸瓧
           }
           
         

--
Gitblit v1.8.0