wuyouming666
2024-05-20 183c3ed6b30e3edf5e44c8bd2128d3be968bc1f4
springboot-vue3/src/main/java/com/example/springboot/service/JdbcConnections.java
@@ -11,7 +11,9 @@
import org.springframework.stereotype.Component;
import com.example.springboot.entity.Queue;
import com.example.springboot.entity.north_frame_buffer1_frames;
import com.example.springboot.entity.north_glass_buffer1;
import com.example.springboot.service.North_Glass_Buffer1Service.north_glass_buffer1Comparator;
@Component
public class JdbcConnections {
@@ -414,6 +416,36 @@
   }
   // 根据铝框id查询铝框信息
   public north_frame_buffer1_frames SelectFrameBarcode(String frameBarcode) throws SQLException {
      try {
         Connection conn = getConn();
         north_frame_buffer1_frames frame=new north_frame_buffer1_frames();
         String sql1 = "select * from north_glass_buffer1_frames where Barcode=? limit 1";
         ps = conn.prepareStatement(sql1);
         ps.setString(1, frameBarcode);
         ResultSet rs = ps.executeQuery();
         while (rs.next()) {
            frame.setId(rs.getInt("id"));
            frame.setlistnumber(rs.getString("listnumber"));
            frame.setordernumber(rs.getString("ordernumber"));
            frame.setboxnumber(rs.getString("boxnumber"));
            frame.setbarcode(rs.getString("barcode"));
            frame.setframelength(rs.getDouble("framelength"));
            frame.setframeheight(rs.getDouble("frameheight"));
            frame.setframelengthmm(rs.getDouble("framelength_mm"));
            frame.setframeheightmm(rs.getDouble("frameheight_mm"));
            frame.setflip(rs.getInt("flip"));
         }
         conn.close();
         return frame;
      } catch (Exception e) {
         // TODO: handle exception
         e.printStackTrace();
         return null;
      }
   }
   /**
    * 1. 加载驱动
    * 2. 获取连接 conn
@@ -434,12 +466,12 @@
   public static Connection getConn() throws SQLException {
      try {
         Connection conn = null;
         // conn =
         // DriverManager.getConnection("jdbc:mysql://localhost:3306/canadames?serverTimezone=GMT%2B8&characterEncoding=utf-8",
         // "root", "beibo.123/");
         conn = DriverManager.getConnection(
               "jdbc:mysql://192.168.102.9:3306/production?serverTimezone=GMT%2B8&characterEncoding=utf-8&useSSL=false",
               "northglass", "n0rthgla55");
         conn =
         DriverManager.getConnection("jdbc:mysql://localhost:3306/test?serverTimezone=GMT%2B8&characterEncoding=utf-8",
         "root", "beibo.123/");
         // conn = DriverManager.getConnection(
         //       "jdbc:mysql://192.168.102.9:3306/production?serverTimezone=GMT%2B8&characterEncoding=utf-8&useSSL=false",
         //       "northglass", "n0rthgla55");
         return conn;
      } catch (Exception e) {
         // TODO: handle exception