From 2bb79e773860c936f68f998911a2d4155fa9a3a6 Mon Sep 17 00:00:00 2001 From: "GukSang.Jin" Date: Wed, 4 Feb 2026 09:46:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=81=94=E7=BB=9C=E5=8D=95?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/rollback_scandata_split_columns.sql | 24 ++++ db/upgrade_scandata_split_columns.sql | 55 +++++++++ 全自动水压检测仪/DATA/ConductividyClass.cs | 16 ++- 全自动水压检测仪/ScanImport.Designer.cs | 129 +++++++++++++-------- 全自动水压检测仪/ScanImport.cs | 5 +- 5 files changed, 176 insertions(+), 53 deletions(-) create mode 100644 db/rollback_scandata_split_columns.sql create mode 100644 db/upgrade_scandata_split_columns.sql diff --git a/db/rollback_scandata_split_columns.sql b/db/rollback_scandata_split_columns.sql new file mode 100644 index 0000000..ed2d3db --- /dev/null +++ b/db/rollback_scandata_split_columns.sql @@ -0,0 +1,24 @@ +/* + 数据库回滚脚本 - 恢复联络单号和件号合并 + + 执行日期: 2026-02-04 + 目的: 如果需要回滚,删除ContactNumber和ItemNumber字段 + 影响表: scandata +*/ + +USE fullautowaterpressure; + +-- 1. 删除索引 +DROP INDEX IF EXISTS `idx_contact_number` ON `scandata`; +DROP INDEX IF EXISTS `idx_item_number` ON `scandata`; + +-- 2. 删除新增字段 +ALTER TABLE `scandata` +DROP COLUMN IF EXISTS `ContactNumber`, +DROP COLUMN IF EXISTS `ItemNumber`; + +-- 3. 验证回滚 +DESCRIBE `scandata`; + +-- 4. 显示回滚后的数据 +SELECT * FROM `scandata` ORDER BY Id DESC LIMIT 10; diff --git a/db/upgrade_scandata_split_columns.sql b/db/upgrade_scandata_split_columns.sql new file mode 100644 index 0000000..a176bab --- /dev/null +++ b/db/upgrade_scandata_split_columns.sql @@ -0,0 +1,55 @@ +/* + 数据库升级脚本 - 分离联络单号和件号 + + 执行日期: 2026-02-04 + 目的: 将barcode字段拆分为ContactNumber和ItemNumber两个独立字段 + 影响表: scandata +*/ + +USE fullautowaterpressure; + +-- 1. 添加新字段 +ALTER TABLE `scandata` +ADD COLUMN `ContactNumber` VARCHAR(100) NULL COMMENT '联络单号' AFTER `barcode`, +ADD COLUMN `ItemNumber` VARCHAR(100) NULL COMMENT '件号' AFTER `ContactNumber`; + +-- 2. 迁移现有数据(如果barcode包含"-"分隔符) +UPDATE `scandata` +SET + `ContactNumber` = SUBSTRING_INDEX(`barcode`, '-', 1), + `ItemNumber` = SUBSTRING_INDEX(`barcode`, '-', -1) +WHERE `barcode` IS NOT NULL AND `barcode` LIKE '%-%'; + +-- 3. 对于没有分隔符的数据,将整个barcode作为联络单号 +UPDATE `scandata` +SET + `ContactNumber` = `barcode`, + `ItemNumber` = '' +WHERE `barcode` IS NOT NULL AND `barcode` NOT LIKE '%-%'; + +-- 4. 添加索引以提高查询性能 +CREATE INDEX `idx_contact_number` ON `scandata`(`ContactNumber`); +CREATE INDEX `idx_item_number` ON `scandata`(`ItemNumber`); + +-- 5. 验证数据迁移 +SELECT + COUNT(*) as total_records, + COUNT(ContactNumber) as has_contact_number, + COUNT(ItemNumber) as has_item_number +FROM `scandata`; + +-- 6. 显示迁移后的示例数据 +SELECT + Id, + barcode as '原条码', + ContactNumber as '联络单号', + ItemNumber as '件号', + CreateTime +FROM `scandata` +ORDER BY Id DESC +LIMIT 10; + +-- 注意: +-- 1. barcode字段保留用于兼容性,不删除 +-- 2. 新数据将同时填充barcode、ContactNumber和ItemNumber +-- 3. 如果需要回滚,可以删除新增的两个字段 diff --git a/全自动水压检测仪/DATA/ConductividyClass.cs b/全自动水压检测仪/DATA/ConductividyClass.cs index ebb6644..df6c976 100644 --- a/全自动水压检测仪/DATA/ConductividyClass.cs +++ b/全自动水压检测仪/DATA/ConductividyClass.cs @@ -57,10 +57,20 @@ namespace 材料热传导系数 public int Id { get; set; } /// - /// 条码 + /// 条码(保留用于兼容性) /// public string barcode { get; set; } + /// + /// 联络单号 + /// + public string ContactNumber { get; set; } + + /// + /// 件号 + /// + public string ItemNumber { get; set; } + /// /// 压力 /// @@ -131,9 +141,9 @@ namespace 材料热传导系数 { connection.Open(); var sql = @"INSERT INTO scandata - (barcode,diffpressure,exit_temperature,temperature, dwelltime,CreateTime,TemperatureMode) + (barcode, ContactNumber, ItemNumber, diffpressure, exit_temperature, temperature, dwelltime, CreateTime, TemperatureMode) VALUES - (@barcode,@diffpressure,@exit_temperature,@temperature , @dwelltime , CURRENT_TIMESTAMP ,@TemperatureMode)"; + (@barcode, @ContactNumber, @ItemNumber, @diffpressure, @exit_temperature, @temperature, @dwelltime, CURRENT_TIMESTAMP, @TemperatureMode)"; connection.Execute(sql, data); } } diff --git a/全自动水压检测仪/ScanImport.Designer.cs b/全自动水压检测仪/ScanImport.Designer.cs index 089651a..020d4b8 100644 --- a/全自动水压检测仪/ScanImport.Designer.cs +++ b/全自动水压检测仪/ScanImport.Designer.cs @@ -37,7 +37,8 @@ this.uiDataGridView1 = new Sunny.UI.UIDataGridView(); this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.SerialNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnContactNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnItemNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -65,11 +66,13 @@ this.uiButton3 = new Sunny.UI.UIButton(); this.uiPanel2 = new Sunny.UI.UIPanel(); this.uiPanel1 = new Sunny.UI.UIPanel(); + this.uiPanelTop = new Sunny.UI.UIPanel(); ((System.ComponentModel.ISupportInitialize)(this.uiDataGridView1)).BeginInit(); this.uiTableLayoutPanel1.SuspendLayout(); this.uiPanel3.SuspendLayout(); this.uiPanel2.SuspendLayout(); this.uiPanel1.SuspendLayout(); + this.uiPanelTop.SuspendLayout(); this.SuspendLayout(); // // save @@ -115,7 +118,8 @@ this.uiDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Column1, this.SerialNumber, - this.Column2, + this.ColumnContactNumber, + this.ColumnItemNumber, this.Column3, this.Column4, this.Column7, @@ -178,14 +182,23 @@ this.SerialNumber.ReadOnly = true; this.SerialNumber.Width = 75; // - // Column2 + // ColumnContactNumber // - this.Column2.DataPropertyName = "barcode"; - this.Column2.HeaderText = "联络单号和件号"; - this.Column2.MinimumWidth = 6; - this.Column2.Name = "Column2"; - this.Column2.ReadOnly = true; - this.Column2.Width = 200; + this.ColumnContactNumber.DataPropertyName = "ContactNumber"; + this.ColumnContactNumber.HeaderText = "联络单号"; + this.ColumnContactNumber.MinimumWidth = 6; + this.ColumnContactNumber.Name = "ColumnContactNumber"; + this.ColumnContactNumber.ReadOnly = true; + this.ColumnContactNumber.Width = 150; + // + // ColumnItemNumber + // + this.ColumnItemNumber.DataPropertyName = "ItemNumber"; + this.ColumnItemNumber.HeaderText = "件号"; + this.ColumnItemNumber.MinimumWidth = 6; + this.ColumnItemNumber.Name = "ColumnItemNumber"; + this.ColumnItemNumber.ReadOnly = true; + this.ColumnItemNumber.Width = 150; // // Column3 // @@ -243,22 +256,22 @@ // // uiLabel50 // - this.uiLabel50.Font = new System.Drawing.Font("微软雅黑", 10.5F); + this.uiLabel50.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold); this.uiLabel50.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiLabel50.Location = new System.Drawing.Point(7, 27); + this.uiLabel50.Location = new System.Drawing.Point(200, 15); this.uiLabel50.Name = "uiLabel50"; - this.uiLabel50.Size = new System.Drawing.Size(80, 30); + this.uiLabel50.Size = new System.Drawing.Size(100, 35); this.uiLabel50.TabIndex = 31; this.uiLabel50.Text = "联络单号:"; this.uiLabel50.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // uiLabel51 // - this.uiLabel51.Font = new System.Drawing.Font("微软雅黑", 10.5F); + this.uiLabel51.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold); this.uiLabel51.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiLabel51.Location = new System.Drawing.Point(235, 27); + this.uiLabel51.Location = new System.Drawing.Point(540, 15); this.uiLabel51.Name = "uiLabel51"; - this.uiLabel51.Size = new System.Drawing.Size(50, 30); + this.uiLabel51.Size = new System.Drawing.Size(60, 35); this.uiLabel51.TabIndex = 32; this.uiLabel51.Text = "件号:"; this.uiLabel51.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -266,15 +279,15 @@ // uiTextBox2 // this.uiTextBox2.Cursor = System.Windows.Forms.Cursors.IBeam; - this.uiTextBox2.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox2.Location = new System.Drawing.Point(90, 24); + this.uiTextBox2.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiTextBox2.Location = new System.Drawing.Point(305, 13); this.uiTextBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox2.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox2.Name = "uiTextBox2"; this.uiTextBox2.Padding = new System.Windows.Forms.Padding(8, 5, 8, 5); this.uiTextBox2.RectSize = 2; this.uiTextBox2.ShowText = false; - this.uiTextBox2.Size = new System.Drawing.Size(138, 35); + this.uiTextBox2.Size = new System.Drawing.Size(200, 38); this.uiTextBox2.Style = Sunny.UI.UIStyle.Custom; this.uiTextBox2.TabIndex = 12; this.uiTextBox2.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; @@ -283,15 +296,15 @@ // uiTextBox11 // this.uiTextBox11.Cursor = System.Windows.Forms.Cursors.IBeam; - this.uiTextBox11.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox11.Location = new System.Drawing.Point(288, 24); + this.uiTextBox11.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiTextBox11.Location = new System.Drawing.Point(605, 13); this.uiTextBox11.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox11.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox11.Name = "uiTextBox11"; this.uiTextBox11.Padding = new System.Windows.Forms.Padding(8, 5, 8, 5); this.uiTextBox11.RectSize = 2; this.uiTextBox11.ShowText = false; - this.uiTextBox11.Size = new System.Drawing.Size(138, 35); + this.uiTextBox11.Size = new System.Drawing.Size(200, 38); this.uiTextBox11.Style = Sunny.UI.UIStyle.Custom; this.uiTextBox11.TabIndex = 33; this.uiTextBox11.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; @@ -301,7 +314,7 @@ // this.uiLabel48.Font = new System.Drawing.Font("微软雅黑", 10.5F); this.uiLabel48.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiLabel48.Location = new System.Drawing.Point(631, 27); + this.uiLabel48.Location = new System.Drawing.Point(631, 15); this.uiLabel48.Name = "uiLabel48"; this.uiLabel48.Size = new System.Drawing.Size(129, 30); this.uiLabel48.TabIndex = 29; @@ -312,7 +325,7 @@ // this.uiTextBox9.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox9.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox9.Location = new System.Drawing.Point(774, 28); + this.uiTextBox9.Location = new System.Drawing.Point(774, 16); this.uiTextBox9.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox9.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox9.Name = "uiTextBox9"; @@ -329,7 +342,7 @@ // this.uiTextBox5.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox5.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox5.Location = new System.Drawing.Point(526, 68); + this.uiTextBox5.Location = new System.Drawing.Point(526, 56); this.uiTextBox5.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox5.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox5.Name = "uiTextBox5"; @@ -346,7 +359,7 @@ // this.uiLabel41.Font = new System.Drawing.Font("微软雅黑", 10.5F); this.uiLabel41.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiLabel41.Location = new System.Drawing.Point(404, 73); + this.uiLabel41.Location = new System.Drawing.Point(404, 61); this.uiLabel41.Name = "uiLabel41"; this.uiLabel41.Size = new System.Drawing.Size(121, 30); this.uiLabel41.TabIndex = 17; @@ -357,7 +370,7 @@ // this.uiLabel4.Font = new System.Drawing.Font("微软雅黑", 10.5F); this.uiLabel4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiLabel4.Location = new System.Drawing.Point(404, 27); + this.uiLabel4.Location = new System.Drawing.Point(404, 15); this.uiLabel4.Name = "uiLabel4"; this.uiLabel4.Size = new System.Drawing.Size(121, 30); this.uiLabel4.TabIndex = 18; @@ -368,7 +381,7 @@ // this.uiTextBox4.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox4.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox4.Location = new System.Drawing.Point(526, 27); + this.uiTextBox4.Location = new System.Drawing.Point(526, 15); this.uiTextBox4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox4.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox4.Name = "uiTextBox4"; @@ -406,7 +419,7 @@ // this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 10.5F); this.uiLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiLabel1.Location = new System.Drawing.Point(631, 73); + this.uiLabel1.Location = new System.Drawing.Point(631, 61); this.uiLabel1.Name = "uiLabel1"; this.uiLabel1.Size = new System.Drawing.Size(148, 30); this.uiLabel1.TabIndex = 34; @@ -417,7 +430,7 @@ // this.uiTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam; this.uiTextBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F); - this.uiTextBox1.Location = new System.Drawing.Point(774, 68); + this.uiTextBox1.Location = new System.Drawing.Point(774, 56); this.uiTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTextBox1.MinimumSize = new System.Drawing.Size(1, 16); this.uiTextBox1.Name = "uiTextBox1"; @@ -435,7 +448,7 @@ this.uiCheckBox1.Cursor = System.Windows.Forms.Cursors.Hand; this.uiCheckBox1.Font = new System.Drawing.Font("微软雅黑", 10.5F); this.uiCheckBox1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiCheckBox1.Location = new System.Drawing.Point(58, 69); + this.uiCheckBox1.Location = new System.Drawing.Point(58, 57); this.uiCheckBox1.MinimumSize = new System.Drawing.Size(1, 1); this.uiCheckBox1.Name = "uiCheckBox1"; this.uiCheckBox1.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0); @@ -449,7 +462,7 @@ this.uiCheckBox2.Cursor = System.Windows.Forms.Cursors.Hand; this.uiCheckBox2.Font = new System.Drawing.Font("微软雅黑", 10.5F); this.uiCheckBox2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48))))); - this.uiCheckBox2.Location = new System.Drawing.Point(202, 68); + this.uiCheckBox2.Location = new System.Drawing.Point(202, 56); this.uiCheckBox2.MinimumSize = new System.Drawing.Size(1, 1); this.uiCheckBox2.Name = "uiCheckBox2"; this.uiCheckBox2.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0); @@ -483,16 +496,18 @@ // this.uiTableLayoutPanel1.ColumnCount = 1; this.uiTableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.uiTableLayoutPanel1.Controls.Add(this.uiPanel3, 0, 2); - this.uiTableLayoutPanel1.Controls.Add(this.uiPanel2, 0, 0); - this.uiTableLayoutPanel1.Controls.Add(this.uiPanel1, 0, 1); + this.uiTableLayoutPanel1.Controls.Add(this.uiPanel3, 0, 3); + this.uiTableLayoutPanel1.Controls.Add(this.uiPanel2, 0, 1); + this.uiTableLayoutPanel1.Controls.Add(this.uiPanel1, 0, 2); + this.uiTableLayoutPanel1.Controls.Add(this.uiPanelTop, 0, 0); this.uiTableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.uiTableLayoutPanel1.Location = new System.Drawing.Point(0, 35); this.uiTableLayoutPanel1.Name = "uiTableLayoutPanel1"; - this.uiTableLayoutPanel1.RowCount = 3; - this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); - this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 65F)); - this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F)); + this.uiTableLayoutPanel1.RowCount = 4; + this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 70F)); + this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 110F)); + this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.uiTableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 100F)); this.uiTableLayoutPanel1.Size = new System.Drawing.Size(1000, 705); this.uiTableLayoutPanel1.TabIndex = 39; this.uiTableLayoutPanel1.TagString = null; @@ -505,11 +520,11 @@ this.uiPanel3.Controls.Add(this.uiButton1); this.uiPanel3.Dock = System.Windows.Forms.DockStyle.Fill; this.uiPanel3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiPanel3.Location = new System.Drawing.Point(4, 604); + this.uiPanel3.Location = new System.Drawing.Point(4, 610); this.uiPanel3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiPanel3.MinimumSize = new System.Drawing.Size(1, 1); this.uiPanel3.Name = "uiPanel3"; - this.uiPanel3.Size = new System.Drawing.Size(992, 96); + this.uiPanel3.Size = new System.Drawing.Size(992, 90); this.uiPanel3.TabIndex = 2; this.uiPanel3.Text = null; this.uiPanel3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; @@ -535,13 +550,26 @@ this.uiButton3.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiButton3.Click += new System.EventHandler(this.uiButton3_Click); // + // uiPanelTop + // + this.uiPanelTop.Controls.Add(this.uiLabel50); + this.uiPanelTop.Controls.Add(this.uiTextBox2); + this.uiPanelTop.Controls.Add(this.uiLabel51); + this.uiPanelTop.Controls.Add(this.uiTextBox11); + this.uiPanelTop.Dock = System.Windows.Forms.DockStyle.Fill; + this.uiPanelTop.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiPanelTop.Location = new System.Drawing.Point(4, 5); + this.uiPanelTop.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.uiPanelTop.MinimumSize = new System.Drawing.Size(1, 1); + this.uiPanelTop.Name = "uiPanelTop"; + this.uiPanelTop.Size = new System.Drawing.Size(992, 60); + this.uiPanelTop.TabIndex = 3; + this.uiPanelTop.Text = null; + this.uiPanelTop.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; + // // uiPanel2 // - this.uiPanel2.Controls.Add(this.uiLabel50); - this.uiPanel2.Controls.Add(this.uiLabel51); this.uiPanel2.Controls.Add(this.uiLabel48); - this.uiPanel2.Controls.Add(this.uiTextBox2); - this.uiPanel2.Controls.Add(this.uiTextBox11); this.uiPanel2.Controls.Add(this.uiCheckBox2); this.uiPanel2.Controls.Add(this.uiTextBox9); this.uiPanel2.Controls.Add(this.uiCheckBox1); @@ -553,11 +581,11 @@ this.uiPanel2.Controls.Add(this.uiTextBox4); this.uiPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.uiPanel2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiPanel2.Location = new System.Drawing.Point(4, 5); + this.uiPanel2.Location = new System.Drawing.Point(4, 75); this.uiPanel2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiPanel2.MinimumSize = new System.Drawing.Size(1, 1); this.uiPanel2.Name = "uiPanel2"; - this.uiPanel2.Size = new System.Drawing.Size(992, 131); + this.uiPanel2.Size = new System.Drawing.Size(992, 100); this.uiPanel2.TabIndex = 1; this.uiPanel2.Text = null; this.uiPanel2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; @@ -567,11 +595,11 @@ this.uiPanel1.Controls.Add(this.uiDataGridView1); this.uiPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.uiPanel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.uiPanel1.Location = new System.Drawing.Point(4, 146); + this.uiPanel1.Location = new System.Drawing.Point(4, 185); this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1); this.uiPanel1.Name = "uiPanel1"; - this.uiPanel1.Size = new System.Drawing.Size(992, 448); + this.uiPanel1.Size = new System.Drawing.Size(992, 415); this.uiPanel1.TabIndex = 0; this.uiPanel1.Text = null; this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; @@ -591,6 +619,7 @@ this.uiPanel3.ResumeLayout(false); this.uiPanel2.ResumeLayout(false); this.uiPanel1.ResumeLayout(false); + this.uiPanelTop.ResumeLayout(false); this.ResumeLayout(false); } @@ -619,9 +648,11 @@ private Sunny.UI.UIPanel uiPanel3; private Sunny.UI.UIPanel uiPanel2; private Sunny.UI.UIPanel uiPanel1; + private Sunny.UI.UIPanel uiPanelTop; private System.Windows.Forms.DataGridViewTextBoxColumn Column1; private System.Windows.Forms.DataGridViewTextBoxColumn SerialNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn Column2; + private System.Windows.Forms.DataGridViewTextBoxColumn ColumnContactNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn ColumnItemNumber; private System.Windows.Forms.DataGridViewTextBoxColumn Column3; private System.Windows.Forms.DataGridViewTextBoxColumn Column4; private System.Windows.Forms.DataGridViewTextBoxColumn Column7; diff --git a/全自动水压检测仪/ScanImport.cs b/全自动水压检测仪/ScanImport.cs index 66dccec..a1437f1 100644 --- a/全自动水压检测仪/ScanImport.cs +++ b/全自动水压检测仪/ScanImport.cs @@ -78,7 +78,7 @@ namespace 全自动水压检测仪 temperatureMode = "高温模式"; } - // 组合联络单号和件号 + // 获取联络单号和件号 string contactNumber = uiTextBox2?.Text?.Trim() ?? ""; string itemNumber = uiTextBox11?.Text?.Trim() ?? ""; @@ -94,6 +94,7 @@ namespace 全自动水压检测仪 return; } + // 组合条码用于兼容性(可选) string barcode = $"{contactNumber}-{itemNumber}"; try @@ -101,6 +102,8 @@ namespace 全自动水压检测仪 _repository.InsertScanItems(new ScanData { barcode = barcode, + ContactNumber = contactNumber, + ItemNumber = itemNumber, diffpressure = diffpressure, exit_temperature = exit_temperature, dwelltime = dwelltime,