Browse Source

箱号工装篮绑定

callm 1 month ago
parent
commit
66b8e11393

+ 45 - 44
UAS_MES_XMW/FunctionCode/Make/Make_BoxLotBind.Designer.cs

@@ -33,6 +33,10 @@
             this.pr_code_label = new System.Windows.Forms.Label();
             this.ms_makecode_label = new System.Windows.Forms.Label();
             this.LabelDataGridView = new System.Windows.Forms.DataGridView();
+            this.BI_PANELID = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.BI_BOXNAME = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.BI_PRODUCTSPECNAME = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.BI_UPDATETIME = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.label1 = new System.Windows.Forms.Label();
             this.quxiao = new System.Windows.Forms.CheckBox();
             this.label2 = new System.Windows.Forms.Label();
@@ -46,10 +50,6 @@
             this.ma_craftcode = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.agsum = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.boxcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
-            this.BI_PANELID = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.BI_BOXNAME = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.BI_PRODUCTSPECNAME = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.BI_UPDATETIME = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_code = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES_NEW.CustomControl.ValueLabel.ValueLabel();
             this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
@@ -116,7 +116,7 @@
             this.BI_PRODUCTSPECNAME,
             this.BI_UPDATETIME});
             this.LabelDataGridView.Location = new System.Drawing.Point(17, 148);
-            this.LabelDataGridView.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.LabelDataGridView.Margin = new System.Windows.Forms.Padding(5);
             this.LabelDataGridView.Name = "LabelDataGridView";
             this.LabelDataGridView.RowHeadersVisible = false;
             this.LabelDataGridView.RowHeadersWidth = 82;
@@ -124,6 +124,43 @@
             this.LabelDataGridView.Size = new System.Drawing.Size(1131, 609);
             this.LabelDataGridView.TabIndex = 200;
             // 
+            // BI_PANELID
+            // 
+            this.BI_PANELID.DataPropertyName = "BI_PANELID";
+            this.BI_PANELID.HeaderText = "PANELID";
+            this.BI_PANELID.MinimumWidth = 10;
+            this.BI_PANELID.Name = "BI_PANELID";
+            this.BI_PANELID.ReadOnly = true;
+            this.BI_PANELID.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.BI_PANELID.Width = 200;
+            // 
+            // BI_BOXNAME
+            // 
+            this.BI_BOXNAME.DataPropertyName = "BI_BOXNAME";
+            this.BI_BOXNAME.HeaderText = "BOXNAME";
+            this.BI_BOXNAME.MinimumWidth = 10;
+            this.BI_BOXNAME.Name = "BI_BOXNAME";
+            this.BI_BOXNAME.Width = 200;
+            // 
+            // BI_PRODUCTSPECNAME
+            // 
+            this.BI_PRODUCTSPECNAME.DataPropertyName = "BI_PRODUCTSPECNAME";
+            this.BI_PRODUCTSPECNAME.HeaderText = "产品名称";
+            this.BI_PRODUCTSPECNAME.MinimumWidth = 10;
+            this.BI_PRODUCTSPECNAME.Name = "BI_PRODUCTSPECNAME";
+            this.BI_PRODUCTSPECNAME.ReadOnly = true;
+            this.BI_PRODUCTSPECNAME.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.BI_PRODUCTSPECNAME.Width = 200;
+            // 
+            // BI_UPDATETIME
+            // 
+            this.BI_UPDATETIME.DataPropertyName = "BI_UPDATETIME";
+            this.BI_UPDATETIME.HeaderText = "更新时间";
+            this.BI_UPDATETIME.MinimumWidth = 300;
+            this.BI_UPDATETIME.Name = "BI_UPDATETIME";
+            this.BI_UPDATETIME.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.BI_UPDATETIME.Width = 300;
+            // 
             // label1
             // 
             this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
@@ -141,12 +178,13 @@
             // 
             this.quxiao.AutoSize = true;
             this.quxiao.Location = new System.Drawing.Point(656, 856);
-            this.quxiao.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.quxiao.Margin = new System.Windows.Forms.Padding(4);
             this.quxiao.Name = "quxiao";
             this.quxiao.Size = new System.Drawing.Size(138, 28);
             this.quxiao.TabIndex = 204;
             this.quxiao.Text = "取消采集";
             this.quxiao.UseVisualStyleBackColor = true;
+            this.quxiao.Visible = false;
             // 
             // label2
             // 
@@ -273,43 +311,6 @@
             this.boxcode.Tag = "ifread";
             this.boxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.snCollectionBox1_KeyDown);
             // 
-            // BI_PANELID
-            // 
-            this.BI_PANELID.DataPropertyName = "BI_PANELID";
-            this.BI_PANELID.HeaderText = "PANELID";
-            this.BI_PANELID.MinimumWidth = 10;
-            this.BI_PANELID.Name = "BI_PANELID";
-            this.BI_PANELID.ReadOnly = true;
-            this.BI_PANELID.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.BI_PANELID.Width = 200;
-            // 
-            // BI_BOXNAME
-            // 
-            this.BI_BOXNAME.DataPropertyName = "BI_BOXNAME";
-            this.BI_BOXNAME.HeaderText = "BOXNAME";
-            this.BI_BOXNAME.MinimumWidth = 10;
-            this.BI_BOXNAME.Name = "BI_BOXNAME";
-            this.BI_BOXNAME.Width = 200;
-            // 
-            // BI_PRODUCTSPECNAME
-            // 
-            this.BI_PRODUCTSPECNAME.DataPropertyName = "BI_PRODUCTSPECNAME";
-            this.BI_PRODUCTSPECNAME.HeaderText = "产品名称";
-            this.BI_PRODUCTSPECNAME.MinimumWidth = 10;
-            this.BI_PRODUCTSPECNAME.Name = "BI_PRODUCTSPECNAME";
-            this.BI_PRODUCTSPECNAME.ReadOnly = true;
-            this.BI_PRODUCTSPECNAME.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.BI_PRODUCTSPECNAME.Width = 200;
-            // 
-            // BI_UPDATETIME
-            // 
-            this.BI_UPDATETIME.DataPropertyName = "BI_UPDATETIME";
-            this.BI_UPDATETIME.HeaderText = "更新时间";
-            this.BI_UPDATETIME.MinimumWidth = 300;
-            this.BI_UPDATETIME.Name = "BI_UPDATETIME";
-            this.BI_UPDATETIME.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.BI_UPDATETIME.Width = 300;
-            // 
             // pr_code
             // 
             this.pr_code.AutoSize = true;
@@ -409,7 +410,7 @@
             this.Controls.Add(this.pr_code_label);
             this.Controls.Add(this.ms_makecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_BoxLotBind";
             this.Tag = "Make!Aging";
             this.Text = "老化采集";

+ 18 - 21
UAS_MES_XMW/FunctionCode/Make/Make_BoxLotBind.cs

@@ -1,11 +1,7 @@
 using NPOI.SS.Formula.Functions;
 using System;
-using System.Collections.Generic;
-using System.ComponentModel;
 using System.Data;
 using System.Drawing;
-using System.Linq;
-using System.Text;
 using System.Windows.Forms;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.Entity;
@@ -16,24 +12,12 @@ namespace UAS_MES_NEW.Make
     public partial class Make_BoxLotBind : Form
     {
         DataHelper dh;
+
         AutoSizeFormClass asc = new AutoSizeFormClass();
-        LogStringBuilder sql = new LogStringBuilder();
-        DataTable dt;
 
-        //当前序列号记录
-        string sn_code;
-        //制造单号
-        string macode;
-        //采集网标号
-        float net_code;
-        //网标查询条件ms_id
-        string oMsID;
-        //打印计数
-        int printcount = 0;
-        int ma_unlimitin;
+        LogStringBuilder sql = new LogStringBuilder();
 
-        string ErrorMessage = "";
-        string LastSncode;
+        DataTable dt;
 
         public Make_BoxLotBind()
         {
@@ -80,13 +64,25 @@ namespace UAS_MES_NEW.Make
                     OperateResult.AppendText(">>该岗位资源对应的工序不是当前工单途程中的第一道工序,请切换资源编号\n", Color.Red);
                     return;
                 }
+                string makecode = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_boxcode='" + sncode.Text + "'").ToString();
+                if (makecode != "")
+                {
+                    OperateResult.AppendText(">>工装篮已使用到工单" + makecode + "\n", Color.Red);
+                    return;
+                }
+                string lotno = DateTime.Now.ToString("yyyyMMddHHmmss");
                 sql.Clear();
                 sql.Append("insert into MakeSerial(ms_id,ms_code,ms_sncode,ms_prodcode,ms_indate,ms_wccode");
                 sql.Append(",ms_craftcode,ms_craftname,ms_nextstepcode,ms_status,ms_makecode,ms_linecode");
-                sql.Append(",ms_sourcecode,ms_maid,ms_firstsn,ms_salecode)select MakeSerial_seq.nextval,BI_PANELID,BI_PANELID,'" + pr_code.Text + "',");
+                sql.Append(",ms_sourcecode,ms_maid,ms_firstsn,ms_salecode,MS_LOTNO,ms_boxcode)select MakeSerial_seq.nextval,BI_PANELID,BI_PANELID,'" + pr_code.Text + "',");
                 sql.Append("sysdate,'" + ma_wccode.Text + "','" + ma_craftcode.Text + "',ma_craftname,'" + User.CurrentStepCode + "',1,'" + ma_code.Text + "','" + User.UserLineCode + "'");
-                sql.Append(",'" + User.UserSourceCode + "',ma_id,bi_panelid,ma_salecode from boxinfo,make  where BI_BOXNAME='" + boxcode.Text + "' and ma_code='" + ma_code.Text + "'");
+                sql.Append(",'" + User.UserSourceCode + "',ma_id,bi_panelid,ma_salecode,'" + lotno + "','" + sncode.Text + "' from boxinfo,make  where BI_BOXNAME='" + boxcode.Text + "' and ma_code='" + ma_code.Text + "'");
                 dh.ExecuteSql(sql.GetString(), "insert");
+                OperateResult.AppendText(">>箱号" + boxcode.Text + "绑定工装篮" + sncode.Text + "成功\n", Color.Green);
+                BaseUtil.CleanDGVData(LabelDataGridView);
+                sncode.Text = "";
+                boxcode.Text = "";
+                boxcode.Focus();
             }
         }
 
@@ -111,6 +107,7 @@ namespace UAS_MES_NEW.Make
                     return;
                 }
                 BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt);
+                agsum.Text = dt.Rows.Count.ToString();
                 sncode.Focus();
             }
         }