Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 years ago
parent
commit
6d5e97ca93

+ 80 - 67
UAS-MES/FunctionCode/Make/Make_FeedingCollection.Designer.cs

@@ -42,8 +42,8 @@
             this.sn_code_label = new System.Windows.Forms.Label();
             this.code_label = new System.Windows.Forms.Label();
             this.iflastsn = new System.Windows.Forms.CheckBox();
-            this.softwareversion_label = new System.Windows.Forms.CheckBox();
-            this.ecn_label = new System.Windows.Forms.CheckBox();
+            this.ma_softversion_label = new System.Windows.Forms.CheckBox();
+            this.ma_ecncode_label = new System.Windows.Forms.CheckBox();
             this.ClearSn_code = new System.Windows.Forms.PictureBox();
             this.ma_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -52,8 +52,8 @@
             this.ma_qty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.softwareversion = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ecn = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ma_softversion = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ma_ecncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -61,6 +61,7 @@
             this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.ma_craftcode = new System.Windows.Forms.Label();
             this.ma_bomversion = new System.Windows.Forms.Label();
+            this.ma_bomversion_label = new System.Windows.Forms.Label();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
@@ -217,29 +218,29 @@
             this.iflastsn.Text = "前一工单SN";
             this.iflastsn.UseVisualStyleBackColor = true;
             // 
-            // softwareversion_label
-            // 
-            this.softwareversion_label.AutoSize = true;
-            this.softwareversion_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.softwareversion_label.Location = new System.Drawing.Point(907, 186);
-            this.softwareversion_label.Margin = new System.Windows.Forms.Padding(4);
-            this.softwareversion_label.Name = "softwareversion_label";
-            this.softwareversion_label.Size = new System.Drawing.Size(114, 31);
-            this.softwareversion_label.TabIndex = 74;
-            this.softwareversion_label.Text = "软件版本";
-            this.softwareversion_label.UseVisualStyleBackColor = true;
-            // 
-            // ecn_label
-            // 
-            this.ecn_label.AutoSize = true;
-            this.ecn_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ecn_label.Location = new System.Drawing.Point(907, 278);
-            this.ecn_label.Margin = new System.Windows.Forms.Padding(4);
-            this.ecn_label.Name = "ecn_label";
-            this.ecn_label.Size = new System.Drawing.Size(94, 31);
-            this.ecn_label.TabIndex = 75;
-            this.ecn_label.Text = "ECN号";
-            this.ecn_label.UseVisualStyleBackColor = true;
+            // ma_softversion_label
+            // 
+            this.ma_softversion_label.AutoSize = true;
+            this.ma_softversion_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_softversion_label.Location = new System.Drawing.Point(907, 226);
+            this.ma_softversion_label.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_softversion_label.Name = "ma_softversion_label";
+            this.ma_softversion_label.Size = new System.Drawing.Size(114, 31);
+            this.ma_softversion_label.TabIndex = 74;
+            this.ma_softversion_label.Text = "软件版本";
+            this.ma_softversion_label.UseVisualStyleBackColor = true;
+            // 
+            // ma_ecncode_label
+            // 
+            this.ma_ecncode_label.AutoSize = true;
+            this.ma_ecncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_ecncode_label.Location = new System.Drawing.Point(907, 278);
+            this.ma_ecncode_label.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_ecncode_label.Name = "ma_ecncode_label";
+            this.ma_ecncode_label.Size = new System.Drawing.Size(94, 31);
+            this.ma_ecncode_label.TabIndex = 75;
+            this.ma_ecncode_label.Text = "ECN号";
+            this.ma_ecncode_label.UseVisualStyleBackColor = true;
             // 
             // ClearSn_code
             // 
@@ -343,39 +344,39 @@
             this.Clean.UseVisualStyleBackColor = true;
             this.Clean.Click += new System.EventHandler(this.Clean_Click);
             // 
-            // softwareversion
+            // ma_softversion
             // 
-            this.softwareversion.AllPower = null;
-            this.softwareversion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            this.ma_softversion.AllPower = null;
+            this.ma_softversion.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.softwareversion.BackColor = System.Drawing.Color.White;
-            this.softwareversion.ID = null;
-            this.softwareversion.Location = new System.Drawing.Point(1029, 186);
-            this.softwareversion.Margin = new System.Windows.Forms.Padding(4);
-            this.softwareversion.Name = "softwareversion";
-            this.softwareversion.Power = null;
-            this.softwareversion.Size = new System.Drawing.Size(140, 25);
-            this.softwareversion.Str = null;
-            this.softwareversion.Str1 = null;
-            this.softwareversion.Str2 = null;
-            this.softwareversion.TabIndex = 78;
-            // 
-            // ecn
-            // 
-            this.ecn.AllPower = null;
-            this.ecn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            this.ma_softversion.BackColor = System.Drawing.Color.White;
+            this.ma_softversion.ID = null;
+            this.ma_softversion.Location = new System.Drawing.Point(1029, 226);
+            this.ma_softversion.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_softversion.Name = "ma_softversion";
+            this.ma_softversion.Power = null;
+            this.ma_softversion.Size = new System.Drawing.Size(140, 25);
+            this.ma_softversion.Str = null;
+            this.ma_softversion.Str1 = null;
+            this.ma_softversion.Str2 = null;
+            this.ma_softversion.TabIndex = 78;
+            // 
+            // ma_ecncode
+            // 
+            this.ma_ecncode.AllPower = null;
+            this.ma_ecncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.ecn.BackColor = System.Drawing.Color.White;
-            this.ecn.ID = null;
-            this.ecn.Location = new System.Drawing.Point(1029, 282);
-            this.ecn.Margin = new System.Windows.Forms.Padding(4);
-            this.ecn.Name = "ecn";
-            this.ecn.Power = null;
-            this.ecn.Size = new System.Drawing.Size(140, 25);
-            this.ecn.Str = null;
-            this.ecn.Str1 = null;
-            this.ecn.Str2 = null;
-            this.ecn.TabIndex = 77;
+            this.ma_ecncode.BackColor = System.Drawing.Color.White;
+            this.ma_ecncode.ID = null;
+            this.ma_ecncode.Location = new System.Drawing.Point(1029, 282);
+            this.ma_ecncode.Margin = new System.Windows.Forms.Padding(4);
+            this.ma_ecncode.Name = "ma_ecncode";
+            this.ma_ecncode.Power = null;
+            this.ma_ecncode.Size = new System.Drawing.Size(140, 25);
+            this.ma_ecncode.Str = null;
+            this.ma_ecncode.Str1 = null;
+            this.ma_ecncode.Str2 = null;
+            this.ma_ecncode.TabIndex = 77;
             // 
             // Confirm
             // 
@@ -479,18 +480,29 @@
             // 
             this.ma_bomversion.AutoSize = true;
             this.ma_bomversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_bomversion.Location = new System.Drawing.Point(1024, 114);
+            this.ma_bomversion.Location = new System.Drawing.Point(1024, 173);
             this.ma_bomversion.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ma_bomversion.Name = "ma_bomversion";
             this.ma_bomversion.Size = new System.Drawing.Size(0, 27);
             this.ma_bomversion.TabIndex = 143;
-            this.ma_bomversion.Visible = false;
+            // 
+            // ma_bomversion_label
+            // 
+            this.ma_bomversion_label.AutoSize = true;
+            this.ma_bomversion_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_bomversion_label.Location = new System.Drawing.Point(909, 173);
+            this.ma_bomversion_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_bomversion_label.Name = "ma_bomversion_label";
+            this.ma_bomversion_label.Size = new System.Drawing.Size(97, 27);
+            this.ma_bomversion_label.TabIndex = 144;
+            this.ma_bomversion_label.Text = "Bom版本";
             // 
             // Make_FeedingCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1197, 680);
+            this.Controls.Add(this.ma_bomversion_label);
             this.Controls.Add(this.ma_bomversion);
             this.Controls.Add(this.ma_craftcode);
             this.Controls.Add(this.ma_code);
@@ -503,10 +515,10 @@
             this.Controls.Add(this.ma_qty);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.Clean);
-            this.Controls.Add(this.softwareversion);
-            this.Controls.Add(this.ecn);
-            this.Controls.Add(this.ecn_label);
-            this.Controls.Add(this.softwareversion_label);
+            this.Controls.Add(this.ma_softversion);
+            this.Controls.Add(this.ma_ecncode);
+            this.Controls.Add(this.ma_ecncode_label);
+            this.Controls.Add(this.ma_softversion_label);
             this.Controls.Add(this.Confirm);
             this.Controls.Add(this.iflastsn);
             this.Controls.Add(this.code);
@@ -555,10 +567,10 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox code;
         private System.Windows.Forms.CheckBox iflastsn;
         private CustomControl.ButtonUtil.NormalButton Confirm;
-        private System.Windows.Forms.CheckBox softwareversion_label;
-        private System.Windows.Forms.CheckBox ecn_label;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ecn;
-        private CustomControl.TextBoxWithIcon.EnterTextBox softwareversion;
+        private System.Windows.Forms.CheckBox ma_softversion_label;
+        private System.Windows.Forms.CheckBox ma_ecncode_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ma_ecncode;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ma_softversion;
         private CustomControl.ButtonUtil.NormalButton Clean;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private CustomControl.ValueLabel.ValueLabel ma_qty;
@@ -571,5 +583,6 @@
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private System.Windows.Forms.Label ma_craftcode;
         private System.Windows.Forms.Label ma_bomversion;
+        private System.Windows.Forms.Label ma_bomversion_label;
     }
 }

+ 7 - 7
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -70,10 +70,10 @@ namespace UAS_MES.Make
 
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
-            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,ma_craftcode # 途程编号,pr_detail # 产品名称,ma_bomversion # Bom版本";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,ma_craftcode # 途程编号,pr_detail # 产品名称,ma_bomversion # Bom版本,ma_softversion # 软件版本,ma_ecncode # ECN号";
             ma_code.FormName = Name;
             ma_code.DBTitle = "工单查询";
-            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_detail", "ma_craftcode", "ma_bomversion" };
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_detail", "ma_craftcode", "ma_bomversion", "ma_softversion", "ma_ecncode" };
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DBChange;
             dh = new DataHelper();
@@ -204,7 +204,7 @@ namespace UAS_MES.Make
                 //将录入框的值给序列号
                 sn_code.Text = code.Text;
                 sql.Clear();
-                sql.Append("select ma_prodcode,ms_firstsn,ma_craftcode,ma_bomversion,ma_qty,ma_code,pr_detail,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
+                sql.Append("select ma_prodcode,ma_ecncode,ma_softversion,ms_firstsn,ma_craftcode,ma_bomversion,ma_qty,ma_code,pr_detail,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
                 sql.Append(",ms_prodcode,ms_makecode,ms_code,ms_stepname  from makeserial left join make on ma_code=ms_makecode ");
                 sql.Append("left join product on ms_prodcode=pr_code where ms_sncode='" + code.Text + "' order by ms_id desc");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -283,7 +283,7 @@ namespace UAS_MES.Make
                         ms_status = dt.Rows[0]["ms_status"].ToString();
                         sn_code.Text = code.Text;
                         sql.Clear();
-                        sql.Append("select ma_code,ma_prodcode,pr_detail,ma_qty from makeserial left join product ");
+                        sql.Append("select ma_code,ma_softversion,ma_ecncode,ma_prodcode,pr_detail,ma_qty from makeserial left join product ");
                         sql.Append(" on ms_prodcode=pr_code left join make on ms_makecode=ma_code left join ");
                         sql.Append("makecraftdetail on mcd_macode=ms_makecode where ms_id='" + oMsid + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -374,10 +374,10 @@ namespace UAS_MES.Make
                 dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode", "sp_id", "sp_id1" }, CollectDataSonCode.ToArray(), CollectData.ToArray(), SPID.ToArray(), SPID.ToArray());
                 //更新序列号半成品已被使用
                 dh.ExecuteSql("update makeserial set ms_nextmacode='" + ma_code + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode='" + sn_code.Text + "' and ms_makecode<>'" + ma_code + "')", "update");
-                if (ecn_label.Checked || softwareversion_label.Checked)
+                if (ma_ecncode_label.Checked || ma_softversion_label.Checked)
                 {
-                    string ecnText = ecn_label.Checked ? ecn.Text : "";
-                    string softversionText = softwareversion_label.Checked ? softwareversion.Text : "";
+                    string ecnText = ma_ecncode_label.Checked ? ma_ecncode.Text : "";
+                    string softversionText = ma_softversion_label.Checked ? ma_softversion.Text : "";
                     sql.Clear();
                     sql.Append("insert into SNRELATIONINFORECORD(SIR_ID,SIR_SNCODE,SIR_MSCODE,SIR_ECNCODE,SIR_SOFTVER,");
                     sql.Append("SIR_LINECODE,SIR_SOURCECODE,SIR_STEPCODE,SIR_MACODE,SIR_PRODCODE,SIR_INMAN,SIR_INDATE) select ");

+ 37 - 11
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.Designer.cs

@@ -44,6 +44,7 @@
             this.in_label = new System.Windows.Forms.Label();
             this.ClearSn_code = new System.Windows.Forms.PictureBox();
             this.sn_code_label = new System.Windows.Forms.Label();
+            this.ChangeResult = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.show_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ma_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -53,7 +54,8 @@
             this.TSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.SNLength = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.TSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
-            this.ChangeResult = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
+            this.ma_softversion = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
@@ -223,6 +225,18 @@
             this.sn_code_label.TabIndex = 142;
             this.sn_code_label.Text = "序列号";
             // 
+            // ChangeResult
+            // 
+            this.ChangeResult.AutoSize = true;
+            this.ChangeResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ChangeResult.Location = new System.Drawing.Point(414, 524);
+            this.ChangeResult.Name = "ChangeResult";
+            this.ChangeResult.Power = "ifspecial";
+            this.ChangeResult.Size = new System.Drawing.Size(136, 35);
+            this.ChangeResult.TabIndex = 145;
+            this.ChangeResult.Text = "重新转换";
+            this.ChangeResult.UseVisualStyleBackColor = true;
+            // 
             // show_sncode
             // 
             this.show_sncode.AllPower = null;
@@ -351,23 +365,33 @@
             this.TSNLength.Str2 = null;
             this.TSNLength.TabIndex = 14;
             // 
-            // ChangeResult
+            // ma_softversion
             // 
-            this.ChangeResult.AutoSize = true;
-            this.ChangeResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChangeResult.Location = new System.Drawing.Point(414, 524);
-            this.ChangeResult.Name = "ChangeResult";
-            this.ChangeResult.Power = "ifspecial";
-            this.ChangeResult.Size = new System.Drawing.Size(136, 35);
-            this.ChangeResult.TabIndex = 145;
-            this.ChangeResult.Text = "重新转换";
-            this.ChangeResult.UseVisualStyleBackColor = true;
+            this.ma_softversion.AutoSize = true;
+            this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_softversion.Location = new System.Drawing.Point(911, 56);
+            this.ma_softversion.Name = "ma_softversion";
+            this.ma_softversion.Size = new System.Drawing.Size(0, 31);
+            this.ma_softversion.TabIndex = 150;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(801, 56);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(110, 31);
+            this.label2.TabIndex = 149;
+            this.label2.Text = "软件版本";
             // 
             // Make_SeqProgramTransform
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1268, 591);
+            this.Controls.Add(this.ma_softversion);
+            this.Controls.Add(this.label2);
             this.Controls.Add(this.ChangeResult);
             this.Controls.Add(this.ClearSn_code);
             this.Controls.Add(this.show_sncode);
@@ -433,5 +457,7 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox show_sncode;
         private System.Windows.Forms.Label sn_code_label;
         private CustomControl.CustomCheckBox.CustomCheckBox ChangeResult;
+        private System.Windows.Forms.Label ma_softversion;
+        private System.Windows.Forms.Label label2;
     }
 }

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -99,7 +99,7 @@ namespace UAS_MES.Make
                                     {
                                         //按照out出的工单号查出工单相关信息,并赋值到相关控件
                                         sql.Clear();
-                                        sql.Append("select ma_code as ms_macode,mcd_okqty,ma_qty,ma_qty-mcd_inqty as remain_qty,pr_detail,pr_code as ma_prodcode ");
+                                        sql.Append("select ma_code as ms_macode,ma_softversion,mcd_okqty,ma_qty,ma_qty-mcd_inqty as remain_qty,pr_detail,pr_code as ma_prodcode ");
                                         sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on ");
                                         sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_id=:msid and mcd_stepcode='" + User.CurrentStepCode + "'");
                                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", oMsid);

+ 37 - 11
UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -44,6 +44,7 @@
             this.remain_qty_label = new System.Windows.Forms.Label();
             this.ClearSn_code = new System.Windows.Forms.PictureBox();
             this.sn_code_label = new System.Windows.Forms.Label();
+            this.ChangeResult = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.show_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.pr_detail = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ma_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -53,7 +54,8 @@
             this.beforeTransSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ChangeResult = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.ma_softversion = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
@@ -230,6 +232,18 @@
             this.sn_code_label.TabIndex = 139;
             this.sn_code_label.Text = "序列号";
             // 
+            // ChangeResult
+            // 
+            this.ChangeResult.AutoSize = true;
+            this.ChangeResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ChangeResult.Location = new System.Drawing.Point(420, 641);
+            this.ChangeResult.Name = "ChangeResult";
+            this.ChangeResult.Power = "ifspecial";
+            this.ChangeResult.Size = new System.Drawing.Size(136, 35);
+            this.ChangeResult.TabIndex = 146;
+            this.ChangeResult.Text = "重新转换";
+            this.ChangeResult.UseVisualStyleBackColor = true;
+            // 
             // show_sncode
             // 
             this.show_sncode.AllPower = null;
@@ -350,23 +364,33 @@
             this.sncode.Tag = "IfWrite";
             this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
             // 
-            // ChangeResult
+            // label2
             // 
-            this.ChangeResult.AutoSize = true;
-            this.ChangeResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChangeResult.Location = new System.Drawing.Point(420, 641);
-            this.ChangeResult.Name = "ChangeResult";
-            this.ChangeResult.Power = "ifspecial";
-            this.ChangeResult.Size = new System.Drawing.Size(136, 35);
-            this.ChangeResult.TabIndex = 146;
-            this.ChangeResult.Text = "重新转换";
-            this.ChangeResult.UseVisualStyleBackColor = true;
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(825, 76);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(110, 31);
+            this.label2.TabIndex = 147;
+            this.label2.Text = "软件版本";
+            // 
+            // ma_softversion
+            // 
+            this.ma_softversion.AutoSize = true;
+            this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_softversion.Location = new System.Drawing.Point(935, 76);
+            this.ma_softversion.Name = "ma_softversion";
+            this.ma_softversion.Size = new System.Drawing.Size(0, 31);
+            this.ma_softversion.TabIndex = 148;
             // 
             // Make_SeqTransform
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1274, 701);
+            this.Controls.Add(this.ma_softversion);
+            this.Controls.Add(this.label2);
             this.Controls.Add(this.ChangeResult);
             this.Controls.Add(this.ClearSn_code);
             this.Controls.Add(this.show_sncode);
@@ -433,5 +457,7 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox show_sncode;
         private System.Windows.Forms.Label sn_code_label;
         private CustomControl.CustomCheckBox.CustomCheckBox ChangeResult;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label ma_softversion;
     }
 }

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -98,7 +98,7 @@ namespace UAS_MES.Make
                                 {
                                     //按照out出的工单号查出工单相关信息,并赋值到相关控件
                                     sql.Clear();
-                                    sql.Append("select ma_code,ma_prodcode,pr_detail,ma_qty,ma_qty-mcd_inqty as remain_qty ");
+                                    sql.Append("select ma_code,ma_softversion,ma_prodcode,pr_detail,ma_qty,ma_qty-mcd_inqty as remain_qty ");
                                     sql.Append("from makeserial left join make on ms_makecode=ma_code left join product on ");
                                     sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_id=:msid and mcd_stepcode='" + User.CurrentStepCode + "'");
                                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select",oMsId);

+ 44 - 15
UAS-MES/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -83,6 +83,8 @@
             this.bc_remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bc_groupcode = new UAS_MES.CustomControl.ComBoxWithFocus.ComBoxWithFocus();
             this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.SNCodeEnterTextBox();
+            this.ma_softversion = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.ma_softversion_label = new System.Windows.Forms.Label();
             this.panel2.SuspendLayout();
             this.panel1.SuspendLayout();
             this.SuspendLayout();
@@ -93,7 +95,7 @@
             this.panel2.Controls.Add(this.label1);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel2.Location = new System.Drawing.Point(0, 0);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.panel2.Margin = new System.Windows.Forms.Padding(4);
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(1149, 36);
             this.panel2.TabIndex = 30;
@@ -172,7 +174,7 @@
             this.GoodProduct.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.GoodProduct.ForeColor = System.Drawing.Color.Blue;
             this.GoodProduct.Location = new System.Drawing.Point(8, 655);
-            this.GoodProduct.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.GoodProduct.Margin = new System.Windows.Forms.Padding(4);
             this.GoodProduct.Name = "GoodProduct";
             this.GoodProduct.Size = new System.Drawing.Size(83, 35);
             this.GoodProduct.TabIndex = 35;
@@ -187,7 +189,7 @@
             this.Reject.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Reject.ForeColor = System.Drawing.Color.Red;
             this.Reject.Location = new System.Drawing.Point(117, 655);
-            this.Reject.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Reject.Margin = new System.Windows.Forms.Padding(4);
             this.Reject.Name = "Reject";
             this.Reject.Size = new System.Drawing.Size(107, 35);
             this.Reject.TabIndex = 36;
@@ -205,7 +207,7 @@
             this.columnHeader2});
             this.WaitRejectList.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.WaitRejectList.Location = new System.Drawing.Point(5, 389);
-            this.WaitRejectList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.WaitRejectList.Margin = new System.Windows.Forms.Padding(4);
             this.WaitRejectList.Name = "WaitRejectList";
             this.WaitRejectList.Size = new System.Drawing.Size(353, 256);
             this.WaitRejectList.TabIndex = 37;
@@ -279,7 +281,7 @@
             this.columnHeader8});
             this.ChoosedRejectList.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ChoosedRejectList.Location = new System.Drawing.Point(491, 389);
-            this.ChoosedRejectList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ChoosedRejectList.Margin = new System.Windows.Forms.Padding(4);
             this.ChoosedRejectList.Name = "ChoosedRejectList";
             this.ChoosedRejectList.Size = new System.Drawing.Size(353, 256);
             this.ChoosedRejectList.TabIndex = 50;
@@ -572,7 +574,7 @@
             this.bc_code.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bc_code.ID = null;
             this.bc_code.Location = new System.Drawing.Point(125, 312);
-            this.bc_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.bc_code.Margin = new System.Windows.Forms.Padding(4);
             this.bc_code.Name = "bc_code";
             this.bc_code.Power = null;
             this.bc_code.Size = new System.Drawing.Size(233, 28);
@@ -590,7 +592,7 @@
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
             this.ma_code.Location = new System.Drawing.Point(124, 59);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
@@ -657,7 +659,7 @@
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OperateResult.Location = new System.Drawing.Point(859, 262);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(275, 383);
             this.OperateResult.TabIndex = 52;
@@ -671,7 +673,7 @@
             this.CleanInfo.Image = ((System.Drawing.Image)(resources.GetObject("CleanInfo.Image")));
             this.CleanInfo.IsShowBorder = true;
             this.CleanInfo.Location = new System.Drawing.Point(957, 658);
-            this.CleanInfo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CleanInfo.Margin = new System.Windows.Forms.Padding(4);
             this.CleanInfo.MoveImage = ((System.Drawing.Image)(resources.GetObject("CleanInfo.MoveImage")));
             this.CleanInfo.Name = "CleanInfo";
             this.CleanInfo.NormalImage = ((System.Drawing.Image)(resources.GetObject("CleanInfo.NormalImage")));
@@ -686,7 +688,7 @@
             // 
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
             this.ChooseedReject.Location = new System.Drawing.Point(389, 470);
-            this.ChooseedReject.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ChooseedReject.Margin = new System.Windows.Forms.Padding(4);
             this.ChooseedReject.Name = "ChooseedReject";
             this.ChooseedReject.Size = new System.Drawing.Size(67, 29);
             this.ChooseedReject.TabIndex = 45;
@@ -697,7 +699,7 @@
             // 
             this.WaitReject.Image = ((System.Drawing.Image)(resources.GetObject("WaitReject.Image")));
             this.WaitReject.Location = new System.Drawing.Point(389, 549);
-            this.WaitReject.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.WaitReject.Margin = new System.Windows.Forms.Padding(4);
             this.WaitReject.Name = "WaitReject";
             this.WaitReject.Size = new System.Drawing.Size(67, 29);
             this.WaitReject.TabIndex = 44;
@@ -710,7 +712,7 @@
             this.bc_remark.BackColor = System.Drawing.Color.White;
             this.bc_remark.ID = null;
             this.bc_remark.Location = new System.Drawing.Point(493, 264);
-            this.bc_remark.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.bc_remark.Margin = new System.Windows.Forms.Padding(4);
             this.bc_remark.Multiline = true;
             this.bc_remark.Name = "bc_remark";
             this.bc_remark.Power = null;
@@ -725,7 +727,7 @@
             this.bc_groupcode.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bc_groupcode.FormattingEnabled = true;
             this.bc_groupcode.Location = new System.Drawing.Point(125, 264);
-            this.bc_groupcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.bc_groupcode.Margin = new System.Windows.Forms.Padding(4);
             this.bc_groupcode.Name = "bc_groupcode";
             this.bc_groupcode.Size = new System.Drawing.Size(233, 26);
             this.bc_groupcode.TabIndex = 21;
@@ -738,7 +740,7 @@
             this.ms_sncode.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ms_sncode.ID = null;
             this.ms_sncode.Location = new System.Drawing.Point(400, 659);
-            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Power = null;
             this.ms_sncode.Size = new System.Drawing.Size(240, 28);
@@ -749,12 +751,37 @@
             this.ms_sncode.Tag = "IfWrite";
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_code_KeyDown);
             // 
+            // ma_softversion
+            // 
+            this.ma_softversion.AutoSize = true;
+            this.ma_softversion.CutLength = null;
+            this.ma_softversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_softversion.Location = new System.Drawing.Point(125, 183);
+            this.ma_softversion.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_softversion.MaximumSize = new System.Drawing.Size(200, 0);
+            this.ma_softversion.Name = "ma_softversion";
+            this.ma_softversion.Size = new System.Drawing.Size(0, 27);
+            this.ma_softversion.TabIndex = 73;
+            // 
+            // ma_softversion_label
+            // 
+            this.ma_softversion_label.AutoSize = true;
+            this.ma_softversion_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_softversion_label.Location = new System.Drawing.Point(4, 183);
+            this.ma_softversion_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_softversion_label.Name = "ma_softversion_label";
+            this.ma_softversion_label.Size = new System.Drawing.Size(92, 27);
+            this.ma_softversion_label.TabIndex = 72;
+            this.ma_softversion_label.Text = "软件版本";
+            // 
             // Make_TestCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
             this.ClientSize = new System.Drawing.Size(1149, 700);
+            this.Controls.Add(this.ma_softversion);
+            this.Controls.Add(this.ma_softversion_label);
             this.Controls.Add(this.panel1);
             this.Controls.Add(this.Save);
             this.Controls.Add(this.AutoBadCode);
@@ -790,7 +817,7 @@
             this.Controls.Add(this.ma_prodcode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.KeyPreview = true;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_TestCollection";
             this.Tag = "Make!TestCollection";
             this.Text = " ";
@@ -861,5 +888,7 @@
         private System.Windows.Forms.ColumnHeader columnHeader8;
         private CustomControl.ValueLabel.ValueLabel ob_sendqty;
         private System.Windows.Forms.Label label7;
+        private CustomControl.ValueLabel.ValueLabel ma_softversion;
+        private System.Windows.Forms.Label ma_softversion_label;
     }
 }

+ 4 - 4
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -63,9 +63,9 @@ namespace UAS_MES.Make
 
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
-            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_detail # 产品名称";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_detail # 产品名称,ma_softversion # 软件版本";
             ma_code.FormName = Name;
-            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_detail" };
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_detail", "ma_softversion" };
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DbChange;
         }
@@ -170,7 +170,7 @@ namespace UAS_MES.Make
                     {
                         if (ma_code.Text != oMakeCode && oMakeCode != null)
                         {
-                            dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,pr_detail,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");
+                            dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,ma_softversion,pr_detail,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");
                             if (dt.Rows.Count > 0)
                             {
                                 BaseUtil.SetFormValue(this.Controls, dt);
@@ -394,7 +394,7 @@ namespace UAS_MES.Make
                     }
                     if (LogicHandler.CheckStepSNAndMacode(ma_code.Text == "" ? oMakeCode : ma_code.Text, User.UserSourceCode, ms_sncode.Text, User.UserCode, out oMakeCode, out oMSID, out ErrorMessage))
                     {
-                        dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,pr_detail,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");
+                        dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,ma_softversion,pr_detail,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");
                         if (dt.Rows.Count > 0)
                         {
                             BaseUtil.SetFormValue(this.Controls, dt);

+ 66 - 56
UAS_AutoPass/AutoAnalysisXml.cs

@@ -186,6 +186,9 @@ namespace UAS_AutoPass
             string test_result = "";
             string test_sn = "";
             string imageurl = "";
+            string oMakeCode = "";
+            string oMSID = "";
+            string oErrMessage = "";
             XmlReader myReader = XmlReader.Create(FolderPath.Text + @"\" + e.Name);
             OperateResult.AppendText("读取文件" + e.Name + "\n");
             //获取采集的项目名称
@@ -234,14 +237,18 @@ namespace UAS_AutoPass
                     makecode = dt.Rows[0]["ms_makecode"].ToString();
                     sncode = dt.Rows[0]["ms_sncode"].ToString();
                 }
+                //-2-NG2017/10/2514:46:29.xml取第二位版号
                 string combinecode = e.Name.Substring(1, 1);
-                LogicHandler.AutoPassLog(sncode,isource,makecode,test_date,istepcode,ilinecode,"0");
-                //sql.Clear();
-                //sql.Append("insert into AUTOSCAN_REJUDGE(asr_id,asr_indate,asr_filename,asr_combinecode,asr_sourcecode,");
-                //sql.Append("asr_linecode,asr_makecode,asr_sncode) values(AUTOSCAN_REJUDGE_seq.nextval,sysdate,'" + e.Name + "'");
-                //sql.Append(",'" + combinecode + "','" + isource + "','" + ilinecode + "','" + makecode + "','" + sncode + "')");
-                //dh.ExecuteSql(sql.ToString(), "insert");
-                if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out ErrMessage))
+                if (LogicHandler.CheckStepSNAndMacode(makecode, isource, sncode, iusercode, out oMakeCode, out oMSID, out oErrMessage))
+                {
+                    LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, e.Name, "0");
+                    if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out ErrMessage))
+                    {
+                        OperateResult.AppendText(ErrMessage + "\n");
+                        return;
+                    }
+                }
+                else
                 {
                     OperateResult.AppendText(ErrMessage + "\n");
                     return;
@@ -250,63 +257,66 @@ namespace UAS_AutoPass
             //没有条码并且不良进行记录
             else if (sncode == "" && test_result == "NG")
             {
-                //-2-NG2017/10/2514:46:29.xml取第二位版号
-                string combinecode = e.Name.Substring(1, 1);
-                LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, "0");
-                //sql.Clear();
-                //sql.Append("insert into AUTOSCAN_REJUDGE(asr_id,asr_indate,asr_filename,asr_combinecode,asr_sourcecode,");
-                //sql.Append("asr_linecode) values(AUTOSCAN_REJUDGE_seq.nextval,sysdate,'" + e.Name + "','" + combinecode + "','" + isource + "','" + ilinecode + "')");
-                //dh.ExecuteSql(sql.ToString(), "insert");
+                LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, e.Name, "1");
             }
             else if (sncode != "")
             {
-                //获取序列号ID最大的工单
-                string msid = "";
-                dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_id from makeserial where ms_sncode='" + sncode + "' order by ms_id desc", "select");
-                if (dt.Rows.Count > 0)
+                if (LogicHandler.CheckStepSNAndMacode(makecode, isource, sncode, iusercode, out oMakeCode, out oMSID, out oErrMessage))
                 {
-                    msid = dt.Rows[0]["ms_id"].ToString();
-                    makecode = dt.Rows[0]["ms_makecode"].ToString();
-                    switch (test_result)
+                    //获取序列号ID最大的工单
+                    string msid = "";
+                    dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_id from makeserial where ms_sncode='" + sncode + "' order by ms_id desc", "select");
+                    if (dt.Rows.Count > 0)
                     {
-                        case "OK":
-                            if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out ErrMessage))
-                            {
-                                OperateResult.AppendText(ErrMessage + "\n");
-                                return;
-                            }
-                            break;
-                        case "NG":
-                            sql.Clear();
-                            sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
-                            sql.Append(",mb_sourcecode,mb_badcode,mb_badtable,mb_soncode,mb_status) select makebad_seq.nextval");
-                            sql.Append(",ma_code,ms_code,ms_sncode,'" + iusercode + "',sysdate,'" + istepcode + "','" + isource + "',:bc_code,'',");
-                            sql.Append("sp_soncode,'0' from make left join makeSerial on ms_makecode=ma_code left join stepProduct on sp_mothercode");
-                            sql.Append("=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + sncode + "' and ms_makecode='" + makecode + "'");
-                            dh.BatchInsert(sql.ToString(), new string[] { "bc_code" }, badcode.ToArray());
-                            //更新序列号不良状态
-                            dh.UpdateByCondition("makeserial", "ms_status=3", "ms_id='" + msid + "'");
-                            for (int i = 0; i < badcode.Count; i++)
-                            {
-                                //保存不良位置
-                                string[] location = badlocation[i].Split(',');
+                        msid = dt.Rows[0]["ms_id"].ToString();
+                        makecode = dt.Rows[0]["ms_makecode"].ToString();
+                        switch (test_result)
+                        {
+                            case "OK":
+                                if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out ErrMessage))
+                                {
+                                    OperateResult.AppendText(ErrMessage + "\n");
+                                    return;
+                                }
+                                break;
+                            case "NG":
                                 sql.Clear();
-                                sql.Append("insert into makebadrsloc(mbl_id,mbl_loc,mbl_badcode,mbl_sncode,mbl_makecode,");
-                                sql.Append("mbl_indate ,mbl_inman) select makebadrsloc_seq.nextval,");
-                                sql.Append(":location,'" + badcode[i] + "','" + sncode + "','" + makecode + "',");
-                                sql.Append("sysdate,'" + iusercode + "' from dual");
-                                dh.BatchInsert(sql.ToString(), new string[] { "location" }, location);
-                            }
-                            if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out ErrMessage))
-                            {
-                                OperateResult.AppendText(ErrMessage + "\n");
-                                return;
-                            }
-                            break;
-                        default:
-                            break;
+                                sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
+                                sql.Append(",mb_sourcecode,mb_badcode,mb_badtable,mb_soncode,mb_status) select makebad_seq.nextval");
+                                sql.Append(",ma_code,ms_code,ms_sncode,'" + iusercode + "',sysdate,'" + istepcode + "','" + isource + "',:bc_code,'',");
+                                sql.Append("sp_soncode,'0' from make left join makeSerial on ms_makecode=ma_code left join stepProduct on sp_mothercode");
+                                sql.Append("=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + sncode + "' and ms_makecode='" + makecode + "'");
+                                dh.BatchInsert(sql.ToString(), new string[] { "bc_code" }, badcode.ToArray());
+                                //更新序列号不良状态
+                                dh.UpdateByCondition("makeserial", "ms_status=3", "ms_id='" + msid + "'");
+                                for (int i = 0; i < badcode.Count; i++)
+                                {
+                                    //保存不良位置
+                                    string[] location = badlocation[i].Split(',');
+                                    sql.Clear();
+                                    sql.Append("insert into makebadrsloc(mbl_id,mbl_loc,mbl_badcode,mbl_sncode,mbl_makecode,");
+                                    sql.Append("mbl_indate ,mbl_inman) select makebadrsloc_seq.nextval,");
+                                    sql.Append(":location,'" + badcode[i] + "','" + sncode + "','" + makecode + "',");
+                                    sql.Append("sysdate,'" + iusercode + "' from dual");
+                                    dh.BatchInsert(sql.ToString(), new string[] { "location" }, location);
+                                }
+                                if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out ErrMessage))
+                                {
+                                    OperateResult.AppendText(ErrMessage + "\n");
+                                    return;
+                                }
+                                break;
+                            default:
+                                break;
+                        }
+                        LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, e.Name, "0");
                     }
                 }
+                else
+                {
+                    OperateResult.AppendText(ErrMessage + "\n");
+                    return;
+                }
             }
             FileInfo file = new FileInfo(FolderPath.Text + @"\" + e.Name);
             if (file.Exists)

+ 3 - 3
UAS_AutoPass/ToolClass/LogicHandler.cs

@@ -29,13 +29,13 @@ namespace UAS_AutoPass.ToolClass
                 return false;
         }
 
-        public static void AutoPassLog(string iSN,string iSource,string iMakeCode,string iDate,string iStepCode,string iLineCode,string iIFNG)
+        public static void AutoPassLog(string iSN,string iSource,string iMakeCode,string iDate,string iStepCode,string iLineCode,string iFileName,string iIFNG)
         {
             sql.Clear();
             sql.Append("insert into AUTOSCANLOG(as_id,as_indate,as_testdate,as_sourcecode,as_stepcode,");
             sql.Append("as_linecode,as_makecode,as_sncode,as_filename,as_ifng)values(AUTOSCANLOG_seq.nextval,");
-            sql.Append("sysdate,'"+ iDate + "','"+iSource+"','"+iStepCode+"','"+iLineCode+"','"+iMakeCode+"',");
-            sql.Append("'"+iSN+"','"+ iIFNG + "'");
+            sql.Append("sysdate,to_date('"+ iDate + "','yyyy-mm-dd,hh24:mi:ss'),'" + iSource+"','"+iStepCode+"','"+iLineCode+"','"+iMakeCode+"',");
+            sql.Append("'"+iSN+"','"+ iFileName + "','"+ iIFNG + "')");
             dh.ExecuteSql(sql.ToString(), "select");
         }