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/mapper/AlbaniaMapper.java    |    7 ++-
 Albania_Mes-ui/src/views/home/index.vue                                           |    2 
 springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java |   14 ++----
 springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java    |   34 +++++++---------
 springboot-vue3/src/main/java/com/example/springboot/component/Plchome.java       |   38 +++++++++---------
 5 files changed, 44 insertions(+), 51 deletions(-)

diff --git a/Albania_Mes-ui/src/views/home/index.vue b/Albania_Mes-ui/src/views/home/index.vue
index aef672e..2863c80 100644
--- a/Albania_Mes-ui/src/views/home/index.vue
+++ b/Albania_Mes-ui/src/views/home/index.vue
@@ -488,7 +488,7 @@
                 <!--鏄剧ず-->
                 <div style="width:1000px;height: 720px;border: 2px solid #d1d1d1;float: left;">
                     <!--鐜荤拑鍥�  #81b337-->
-                    <div :style="'top:10px;bottom: 10px;left: 10px;right: 10px;margin:'+((720-(this.LastQueue.glasswidth / 25 * 7))/2)+'px auto;'+
+                    <div :style="'top:10px;bottom: 10px;left: 10px;right: 10px;margin:'+((1000-(this.LastQueue.glasswidth / 25 * 7))/2)+'px auto;'+
                         'width:'+ (this.LastQueue.glasswidth / 25 * 7) + 'px;'+
                         'height:'+ (this.LastQueue.glassheight / 25 * 7) + 'px;'+
                         'line-height: '+ (this.LastQueue.glassheight / 25 * 7) + 'px;'+
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);//娓呴櫎浠诲姟鍙戦�佸瓧
           }
           
         
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 727b9cb..f332474 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
@@ -135,27 +135,27 @@
 
                 // 鍖归厤
                 // System.err.println(PlcRequest+","+MesSend+","+width+","+height);
-                String PlcRequest = plcmes.getPlcParameter("GaToMES").getValue();// 璇锋眰
-                String MesSend = plcmes.getPlcParameter("MESToGaStatus").getValue();// 鍙戦��
-                double width = Double.valueOf(plcmes.getPlcParameter("width").getValue());// 瀹�
-                double height = Double.valueOf(plcmes.getPlcParameter("Height").getValue());// 楂�
-                if ("0".equals(PlcRequest) && istest) {
-                    S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 0);
-                }
-                if ("1".equals(PlcRequest) && "0".equals(MesSend)) {
-                    boolean is = HomeService.Normal(width, height, "1");
-                    if (is && istest) {
-                        // 娴嬮噺鎴愬姛
-                        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
-                                (short) 1);
+                // String PlcRequest = plcmes.getPlcParameter("GaToMES").getValue();// 璇锋眰
+                // String MesSend = plcmes.getPlcParameter("MESToGaStatus").getValue();// 鍙戦��
+                // double width = Double.valueOf(plcmes.getPlcParameter("width").getValue());// 瀹�
+                // double height = Double.valueOf(plcmes.getPlcParameter("Height").getValue());// 楂�
+                // if ("0".equals(PlcRequest) && istest) {
+                //     S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(), (short) 0);
+                // }
+                // if ("1".equals(PlcRequest) && "0".equals(MesSend)) {
+                //     boolean is = HomeService.Normal(width, height, "1");
+                //     if (is && istest) {
+                //         // 娴嬮噺鎴愬姛
+                //         S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
+                //                 (short) 1);
 
-                    } else if (istest) {
-                        // 閲嶆柊娴嬮噺
-                        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
-                                (short) 4);
-                    }
+                //     } else if (istest) {
+                //         // 閲嶆柊娴嬮噺
+                //         S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),
+                //                 (short) 4);
+                //     }
 
-                }
+                // }
                 // S7control.getinstance().WriteWord("DB14.170", (short)0);
                 Queue LastQueue = QueueMapper.selectLastQueue();
                 if (LastQueue == null) {
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java
index f2b5c34..ac95341 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/AlbaniaMapper.java
@@ -39,7 +39,7 @@
     @Select("select * from v_cagerelease2 where mateid not in(select mateid from v_cagerelease2 where surplus=0 group by mateid)LIMIT 1;")
     GlassInfo SelectOutGlass2();
     //娴佺▼鍗′换鍔℃煡璇�
-    @Select("select G.flowcard,G.glasstype,G.number,G.mateid,G.tier,G.starttime,G.finishnumber,IF((G.number-G.finishnumber-ku.KuCount)<0,G.number,ku.KuCount) as 'surplus',G.totaltier as id,G.width from (select Gfd.flowcard,Ggf.glasstype,Ggf.number,Ggf.mateid,Ggf.tier,Ggf.finishnumber,Gfd.starttime,Gfd.totaltier,Ggf.width  from flowcard as Gfd LEFT JOIN glassinfo as Ggf on Gfd.flowcard=Ggf.flowcard where Gfd.state=1 and Gfd.line=#{line}) as G left join (select glasstype,sum(number) AS KuCount from storage_cage where flowcard is not null group by glasstype) as ku on G.glasstype=ku.glasstype where G.mateid not in(select mateid from v_cagerelease1 where surplus=0 group by mateid)order by `g`.`starttime`,`g`.`mateid`,`g`.`finishnumber`,`g`.`tier`LIMIT 1;")
+    @Select("select G.flowcard,G.glasstype,G.number,G.mateid,G.tier,G.starttime,G.finishnumber,IF((G.number-G.finishnumber-ku.KuCount)<0,G.number,ku.KuCount) as 'surplus',G.totaltier as id,G.width,G.glassid from (select Gfd.flowcard,Ggf.glasstype,Ggf.number,Ggf.mateid,Ggf.tier,Ggf.finishnumber,Gfd.starttime,Gfd.totaltier,Ggf.width,Ggf.glassid  from flowcard as Gfd LEFT JOIN glassinfo as Ggf on Gfd.flowcard=Ggf.flowcard where Gfd.state=1 and Gfd.line=#{line}) as G left join (select glasstype,sum(number) AS KuCount from storage_cage where flowcard is not null group by glasstype) as ku on G.glasstype=ku.glasstype where G.mateid not in(select mateid from v_cagerelease1 where surplus=0 group by mateid)order by `g`.`starttime`,`g`.`mateid`,`g`.`finishnumber`,`g`.`tier`LIMIT 1;")
     GlassInfo SelectOutGlass(int line);
     //鑾峰彇璇ョ被鍨嬪湪搴撳瓨鐨勪綅缃�
     @Select("select * from storage_cage where glasstype=#{glasstype} and number>0 limit 1")
@@ -57,11 +57,12 @@
     @Select("select method from flowcard where state=1 and line=#{line} ORDER BY starttime LIMIT 1;")
     GlassInfo SelectMethod(int line);
     //鐩村嚭妯″紡浠诲姟鏌ヨ
-    @Select("select b.flowcard,b.glasstype,b.mateid,a.totaltier as id,IFNULL(c.number,0)as number from flowcard a  left join glassinfo b on a.flowcard=b.flowcard left join(select sum(number)as number,glasstype from storage_cage GROUP BY glasstype)c on b.glasstype=c.glasstype where a.line=#{line} and c.number>0")
+    @Select("select b.flowcard,b.glasstype,b.mateid,a.totaltier as id,IFNULL(c.number,0)as number,b.glassid from flowcard a  left join glassinfo b on a.flowcard=b.flowcard left join(select sum(number)as number,glasstype from storage_cage GROUP BY glasstype)c on b.glasstype=c.glasstype where a.line=#{line} and c.number>0")
     GlassInfo SelectOutGlass2(int line);
     @Select("update storage_cage a set a.glasswidth=#{width},a.glassheight=#{height} where id=#{id} ")
     void UpdateStorage(double width,double height,int id);
-
+    @Update("update queue set state=2 where glassid=#{glassid};")
+    void UpdateQueueState(String glassid);
 
 
 }
diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java b/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
index a8fd762..8ebfe3d 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/service/SpianServiceNew.java
@@ -28,7 +28,7 @@
     StorageCage cage;
     String glassid=glassInfo.getGlassid();
     Double width=glassInfo.getWidth();
-    //int mateid=glassInfo.getMateid();
+    Double height=glassInfo.getHeight();
     String flowcard=glassInfo.getFlowcard();
     int glasstype=glassInfo.getGlasstype();
     //鍒ゆ柇鏄惁鏈夊悓绫诲瀷鐨�
@@ -38,7 +38,6 @@
     if(cage!=null){
         //鍙戦�乸lc浠诲姟
         Mestast(glassid, 1001, cage.getId(), 1,"MESID1",1);
-        //浠诲姟鍙戦�佸瓧
         
     }else{ 
          //鍒ゆ柇鐜荤拑鏄惁杩涘叆澶х墖绗�
@@ -46,15 +45,13 @@
             cage=albaniaMapper.SelectNewCell(3,5);
         }else{
             cage=albaniaMapper.SelectNewCell(0,5);
-            //鍙戦�乸lc浠诲姟
         }
         //褰撹繑鍥炵殑鏍煎瓙鍙蜂负绌烘椂,杩斿洖400绗煎瓙宸叉弧
         if(cage!=null){
-            albaniaMapper.AddCage(cage.getId(), glassid, cage.getGlassWidth(), cage.getGlassHeight(), cage.getGlassWidthMm(), cage.getGlassHeightMm(), 1, cage.getGlasstype(), 0);
+            albaniaMapper.AddCage(cage.getId(), glassid,width, height, cage.getGlassWidthMm(), cage.getGlassHeightMm(), 1, cage.getGlasstype(), 0);
             Mestast(glassid,1001,cage.getId(),1,"MESID1",1);
-            albaniaMapper.UpdateStorage(cage.getGlassWidth(),cage.getGlassHeight(),cage.getId());
-            //鍙戦�乸lc浠诲姟
-            
+            albaniaMapper.UpdateStorage(width,height,cage.getId());
+            albaniaMapper.UpdateQueueState(glassid);
         }else{
             return(400);
         }
@@ -96,9 +93,8 @@
                         S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToPLC").getAddress(), (short)1);//鍑虹墖浠诲姟鍚姩
                         return (200);//缁撴潫
                       }
-                      
                     //鍙戦�侀厤鐗囨暟鎹�
-                    Mestast(glass.getGlassId(), glass.getId(),line, 0,"MESID"+i,i);
+                    Mestast(glass.getGlassId(), glass.getId(),40, 0,"MESID"+i,i);
                     albaniaMapper.AddFinishNumber(glassmate.getFlowcard(), glassmate.getMateid(), glassmate.getTier());
                     albaniaMapper.Inserttask(1, 0, glass.getId(), 2002, glassmate.getGlassid(), glassmate.getGlasstype(),glass.getFlowcard(),glassmate.getMateid(),glassmate.getTier());
                       if(glassmate.getTier()==glassmate.getId()){//褰撻厤鐗囨暟閲忕瓑浜庢垚鍝佸皬鐗囨�荤墖鏁版椂

--
Gitblit v1.8.0