From 5d4062b4caf6af878db6049f8dbefe8ffe41a57e Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期二, 23 四月 2024 09:48:13 +0800
Subject: [PATCH] 删除多余代码

---
 /dev/null                                                                        |   27 ---------------------------
 springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java |    2 +-
 springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java      |   10 +++++-----
 springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java     |    6 +++---
 4 files changed, 9 insertions(+), 36 deletions(-)

diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/ModuleA.java b/springboot-vue3/src/main/java/com/example/springboot/component/ModuleA.java
deleted file mode 100644
index 5a3d2f9..0000000
--- a/springboot-vue3/src/main/java/com/example/springboot/component/ModuleA.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.example.springboot.component;
-
-import com.rabbitmq.client.*;
-
-public class ModuleA {
-    private final static String QUEUE_NAME = "hangzhoumes";
-
-   public static void main(String[] argv) throws Exception {
-        // 鍒涘缓杩炴帴宸ュ巶
-        ConnectionFactory factory = new ConnectionFactory();
-        factory.setHost("localhost");
-
-        try (Connection connection = factory.newConnection();
-             //channel 鏄�氳繃 connection 鍒涘缓鐨勪竴涓� AMQP 淇¢亾瀵硅薄
-             Channel channel = connection.createChannel()) {
-            // `channel.queueDeclare(QUEUE_NAME, false, false, false, null);` 鏄敤鏉ュ0鏄庝竴涓槦鍒楃殑鏂规硶
-            //璇ユ柟娉曟湁浜斾釜鍙傛暟锛�
-            //1. `QUEUE_NAME`锛氭寚瀹氶槦鍒楃殑鍚嶇О锛岃繖閲屼娇鐢ㄤ簡涔嬪墠澹版槑鐨勫父閲廯"module_queue"`浣滀负闃熷垪鍚嶇О銆�
-            //2. `false`锛氭寚瀹氶槦鍒楁槸鍚︿负鎸佷箙鍖栫殑銆傚湪杩欓噷璁剧疆涓篳false`锛岃〃绀轰笉灏嗛槦鍒楁寔涔呭寲鍒扮鐩橈紝涓�鏃abbitMQ鏈嶅姟鍋滄鎴栧穿婧冿紝闃熷垪灏嗕細涓㈠け銆�
-            //3. `false`锛氭寚瀹氭槸鍚﹀彧鍏佽褰撳墠杩炴帴澹版槑姝ら槦鍒椼�傚湪杩欓噷璁剧疆涓篳false`锛岃〃绀哄彲鍏佽鍏朵粬杩炴帴涔熷0鏄庡悓鍚嶇殑闃熷垪銆�
-            //4. `false`锛氭寚瀹氭槸鍚﹀湪涓嶅啀浣跨敤鏃惰嚜鍔ㄥ垹闄ら槦鍒椼�傚湪杩欓噷璁剧疆涓篳false`锛岃〃绀哄綋娌℃湁娑堣垂鑰呮垨鑰呮墍鏈夋秷璐硅�呮柇寮�杩炴帴鍚庯紝闃熷垪涓嶄細鑷姩鍒犻櫎銆�
-            //5. `null`锛氭寚瀹氬叾浠栭槦鍒楀睘鎬х殑鍙傛暟銆傚湪杩欓噷璁剧疆涓篳null`锛岃〃绀烘病鏈夊叾浠栧睘鎬ч渶瑕佽缃��
-            //鎵ц`channel.queueDeclare()`鏂规硶鍚庯紝濡傛灉闃熷垪涓嶅瓨鍦紝灏嗕細鍒涘缓涓�涓柊鐨勯槦鍒楋紝濡傛灉闃熷垪宸茬粡瀛樺湪锛屽垯涓嶅仛浠讳綍鎿嶄綔銆�
-            channel.queueDeclare(QUEUE_NAME, false, false, false, null);
-
-
-
-            String message = "浣犲ソ妯″潡A2";
-
-            for ( int i=1;i< 10000;i++)
-            {
-                message+="浣犲ソ妯″潡A2";
-
-            }
-
-            message+="b";
-
-
-
-            //  灏嗘秷鎭彂甯冨埌鎸囧畾鐨勯槦鍒椾腑銆傜┖瀛楃涓�""琛ㄧず榛樿鐨勪氦鎹㈡満锛孮UEUE_NAME鎸囧畾浜嗙洰鏍囬槦鍒楀悕绉帮紝null琛ㄧず娌℃湁鎸囧畾鍏朵粬灞炴�э紝message.getBytes()灏嗘秷鎭唴瀹硅浆鎹负瀛楄妭鏁扮粍杩涜浼犺緭銆�
-            channel.basicPublish("", QUEUE_NAME, null, message.getBytes());
-            System.out.println(" [x] Sent '" + message + "'");
-        }
-    }
-}
-
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/ModuleB.java b/springboot-vue3/src/main/java/com/example/springboot/component/ModuleB.java
deleted file mode 100644
index e4d6b44..0000000
--- a/springboot-vue3/src/main/java/com/example/springboot/component/ModuleB.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.example.springboot.component;
-
-import com.rabbitmq.client.*;
-
-public class ModuleB {
-    private final static String QUEUE_NAME = "hangzhoumes";
-
-    public static void main(String[] argv) throws Exception {
-        // 鍒涘缓杩炴帴宸ュ巶
-        ConnectionFactory factory = new ConnectionFactory();
-        factory.setHost("localhost");
-        try (Connection connection = factory.newConnection();
-             Channel channel = connection.createChannel()) {
-            // 澹版槑闃熷垪
-            channel.queueDeclare(QUEUE_NAME, false, false, false, null);
-            // 鍒涘缓娑堣垂鑰�
-            DeliverCallback deliverCallback = (consumerTag, delivery) -> {
-                String receivedMessage = new String(delivery.getBody(), "UTF-8");
-                System.out.println(" [x] Received '" + receivedMessage + "'");
-            };
-            // 寮�濮嬫秷璐规秷鎭�
-            channel.basicConsume(QUEUE_NAME, true, deliverCallback, consumerTag -> {
-            });
-        }
-    }
-}
-
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
index 30061c1..d0996cf 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -5,7 +5,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import com.example.springboot.service.JdbcConnections;
 import com.example.springboot.service.SpianService;
-import com.example.springboot.service.SpianServiceNew;
+
 import com.example.springboot.entity.north_glass_buffer1;
 import com.example.springboot.mapper.AlarmMapper;
 import com.example.springboot.mapper.SpianMapper;
@@ -18,7 +18,7 @@
   private JdbcConnections jdbcConnections;
   private SpianMapper spianMapper;
   private SpianService spianService;
-  private SpianServiceNew spianServiceNew;
+
   int aaa;
 
   @Override
@@ -32,11 +32,11 @@
         // \\ TODO Auto-generated catch block
         e.printStackTrace();
       }
-
+      
       // if (S7control.getinstance().CheckConnected() == false) {
       spianService = WebSocketServer.applicationContext.getBean(SpianService.class);
       spianMapper = WebSocketServer.applicationContext.getBean(SpianMapper.class);
-      spianServiceNew = WebSocketServer.applicationContext.getBean(SpianServiceNew.class);
+      
       jdbcConnections = WebSocketServer.applicationContext.getBean(JdbcConnections.class);
       // 鏍规嵁鐜荤拑id鑾峰彇璁㈠崟鍙�,鍗曠嫭鏁版嵁婧�
       // try {
@@ -48,7 +48,7 @@
       // }
 
       // 鍑虹墖浠诲姟////////////////////////////////
-      spianServiceNew.selectout2("X21942613103GV");
+     spianService.selectout2("X21942613103GV");
 
       List<Short> outlist = S7control.getinstance().ReadWord("DB106.20", 1); // 鍑虹墖杞︾姸鎬�
       List<Short> outlist1 = S7control.getinstance().ReadWord("DB105.18", 1); // 鍑虹墖浠诲姟鏄惁鍚姩
diff --git a/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java b/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
index e3d0611..92f2554 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -17,7 +17,7 @@
         //
         System.out.println("鍚姩瀹屾垚");
 
-        //  new PlcHold().start();
+          new PlcHold().start();
         // new PLCAutoMes().start();
 
         // new Plchome().start();
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
index aef8585..b005c0a 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -15,10 +15,10 @@
     @Select("select COUNT(if(a.state1=0,cell,0))as cell,ROUND(id/2)as id from (select *,max(state)as state1 from storage_cage a  GROUP BY cage,cell)as a where (a.cage=#{cage1}-1 or a.cage=#{cage1}+1)and if(a.cage<6,a.cage>0 and a.cage<6,a.cage>5) and disabled=0 GROUP BY cage ORDER BY cell desc LIMIT 1")
     int selectCage(int cage1);
     // 鑾峰彇绗煎瓙鍙疯鍗曞彿鎺掑簭鐨勭┖璁㈠崟绗煎瓙
-    @Select("select a.cage,FrameBarcode,COUNT(if(a.order_id=#{orderids},a.order_id,null))as orderid,b.shu,c.shu2,a.cell,min(a.state)as state1,max(a.state)as state2,disabled,FrameBarcode from storage_cage a left join (select COUNT(*)shu,cage from storage_cage  where order_id=#{orderids} GROUP BY cage)as b on a.cage=b.cage left join(select cage ,COUNT(glass_id)as shu2 from storage_cage GROUP BY cage)c  on a.cage=c.cage where (order_id=#{orderids} or ''='') GROUP BY cage,cell HAVING state1=0 ORDER BY shu desc,shu2,state2 asc,cage asc;")
+    @Select("select a.cage,FrameBarcode,COUNT(if(a.order_id=#{orderids},a.order_id,null))as orderid,b.shu,c.shu2,a.cell,min(a.state)as state1,max(a.state)as state2,disabled,FrameBarcode from storage_cage a left join (select COUNT(*)shu,cage from storage_cage  where order_id=#{orderids} GROUP BY cage)as b on a.cage=b.cage left join(select cage ,COUNT(glass_id)as shu2 from storage_cage GROUP BY cage)c  on a.cage=c.cage where (order_id=#{orderids} or ''='') and a.disabled=0 GROUP BY cage,cell HAVING state1=0 ORDER BY shu desc,shu2,state2 asc,cage asc;")
     List<StorageCage> selectAll(String orderids,String Fbarcode);
     //浼樺厛鍒ゆ柇涓�娆℃槸鍚︽湁鍚岄摑妗嗙殑绌轰綅
-    @Select("select *,min(state) state1 from storage_cage where width>=(#{width}+#{width2})  GROUP BY cage,cell HAVING state1=0 and  FrameBarcode=#{Fbarcode} ORDER BY width desc LIMIT 1;")
+    @Select("select *,min(state) state1 from storage_cage where width>=(#{width}+#{width2})  GROUP BY cage,cell HAVING state1=0 and  FrameBarcode=#{Fbarcode} and disabled=0 ORDER BY width desc LIMIT 1;")
     List<StorageCage> selectAllFbarcode(String Fbarcode,double width,double width2);
     // 鑾峰彇鍒ゆ柇璇ユ牸瀛愭槸鍚﹂渶瑕佹妸澶栫墖鎺ㄥ叆鍐呯墖浣嶇疆
     @Select("select state from storage_cage where  cage=#{cage} and cell=#{cell} and tier=1;")
@@ -63,7 +63,7 @@
     int selectGlassState(int cage, int cell);
 
     // 鍒ゆ柇璇ヨ皟鎷ㄧ殑绗煎瓙
-    @Select("select glass_id,cage,cell,max(state)as shu,ROUND(id/2)as prcid,id,abs(#{cell}-cell)as xuhao from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} GROUP BY cage,cell HAVING shu=0 order by abs(#{cage} - cage),xuhao desc  limit 1;")
+    @Select("select glass_id,cage,cell,max(state)as shu,ROUND(id/2)as prcid,id,abs(#{cell}-cell)as xuhao from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} and  disabled=0 GROUP BY cage,cell HAVING shu=0 order by abs(#{cage} - cage),xuhao desc  limit 1;")
     StorageCage selectGlassCage(int cage, double width, int cage1, int cage2,int cell);
 
     // 鍒犻櫎绗煎瓙淇℃伅(鍑虹墖)

--
Gitblit v1.8.0