From 8dfb37b10ffb2fcb41c85b3fa266d1ef2874aebc Mon Sep 17 00:00:00 2001 From: wuyouming666 <2265557248@qq.com> Date: 星期四, 30 十一月 2023 08:53:27 +0800 Subject: [PATCH] 修改电气管理PLC通讯逻辑 --- springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java | 68 ++++++++++++++++++++++++++++++++++ 1 files changed, 68 insertions(+), 0 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java b/springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java index f032d87..30c135e 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java +++ b/springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java @@ -5,6 +5,8 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; import org.springframework.stereotype.Component; @@ -38,6 +40,72 @@ conn.close(); return glass; } + + public north_glass_buffer1 SelectGlassByGlassIdOrderIdFrameId(String glassid,String orderid,String frameid) throws SQLException { + conn = getConn(); + north_glass_buffer1 north_glass_buffer1s=new north_glass_buffer1(); + String sql = "select * from north_glass_buffer1 where barcode=? or ordernumber=? or FrameBarcode=?"; + ps = conn.prepareStatement(sql); + ps.setString(1, glassid); + ps.setString(2, orderid); + ps.setString(3, frameid); + rs= ps.executeQuery(); + while (rs.next()) { + north_glass_buffer1s.setId(rs.getInt("Id")); + north_glass_buffer1s.setordernumber(rs.getString("ordernumber")); + north_glass_buffer1s.setlistnumber(rs.getString("listnumber")); + north_glass_buffer1s.setboxnumber(rs.getString("boxnumber")); + north_glass_buffer1s.setbarcode(rs.getString("barcode")); + north_glass_buffer1s.setglasslength(rs.getDouble("glasslength")); + north_glass_buffer1s.setglassheight(rs.getDouble("glassheight")); + north_glass_buffer1s.setglasslengthmm(rs.getDouble("glasslength_mm")); + north_glass_buffer1s.setglassheightmm(rs.getDouble("glassheight_mm")); + north_glass_buffer1s.setitemtype(rs.getString("itemtype")); + north_glass_buffer1s.setslotnumber(rs.getString("slotnumber")); + north_glass_buffer1s.setdatemodified(rs.getString("datemodified")); + north_glass_buffer1s.setdatecreated(rs.getString("datecreated")); + north_glass_buffer1s.setFrameBarcode(rs.getString("FrameBarcode")); + } + // conn.close(); + return north_glass_buffer1s; + } + + public List<north_glass_buffer1> SelectGlassByGlassIdOrderIdFrameIds(String glassid,String orderid,String frameid) throws SQLException { + conn = getConn(); + // north_glass_buffer1 glass=new north_glass_buffer1(); + List<north_glass_buffer1> glass=new ArrayList<north_glass_buffer1>(); + String sql = "select * from north_glass_buffer1 where barcode=? or ordernumber=? or FrameBarcode=?"; + ps = conn.prepareStatement(sql); + ps.setString(1, glassid); + ps.setString(2, orderid); + ps.setString(3, frameid); + rs= ps.executeQuery(); + while (rs.next()) { + north_glass_buffer1 north_glass_buffer1s=new north_glass_buffer1(); + + north_glass_buffer1s.setId(rs.getInt("Id")); + north_glass_buffer1s.setordernumber(rs.getString("ordernumber")); + north_glass_buffer1s.setlistnumber(rs.getString("listnumber")); + north_glass_buffer1s.setboxnumber(rs.getString("boxnumber")); + north_glass_buffer1s.setbarcode(rs.getString("barcode")); + north_glass_buffer1s.setglasslength(rs.getDouble("glasslength")); + north_glass_buffer1s.setglassheight(rs.getDouble("glassheight")); + north_glass_buffer1s.setglasslengthmm(rs.getDouble("glasslength_mm")); + north_glass_buffer1s.setglassheightmm(rs.getDouble("glassheight_mm")); + north_glass_buffer1s.setitemtype(rs.getString("itemtype")); + north_glass_buffer1s.setslotnumber(rs.getString("slotnumber")); + north_glass_buffer1s.setdatemodified(rs.getString("datemodified")); + north_glass_buffer1s.setdatecreated(rs.getString("datecreated")); + north_glass_buffer1s.setFrameBarcode(rs.getString("FrameBarcode")); + + + glass.add(north_glass_buffer1s); + + } + // conn.close(); + return glass; + } + /** * 1. 鍔犺浇椹卞姩 * 2. 鑾峰彇杩炴帴 conn -- Gitblit v1.8.0