Browse Source

工单重置,站点重置逻辑修改

callm 1 day ago
parent
commit
d03e57d9b4

+ 4 - 0
UAS_MES_XMW/FunctionCode/Make/Make_TestCollection.cs

@@ -392,6 +392,7 @@ namespace UAS_MES_NEW.Make
                             {
                             {
                                 dh.ExecuteSql("update makeserial set ms_iftest=-1 where ms_id='" + oMSID + "'", "update");
                                 dh.ExecuteSql("update makeserial set ms_iftest=-1 where ms_id='" + oMSID + "'", "update");
                             }
                             }
+                            dh.UpdateByCondition("steppassed", "SP_REMARK='"+bc_remark.Text+"'", "sp_id=(select max(sp_id) from steppassed where sp_sncode='" + ms_sncode.Text + "')");
                             //提示正确返回时传递的信息
                             //提示正确返回时传递的信息
                             if (ErrorMessage.Contains("AFTERSUCCESS"))
                             if (ErrorMessage.Contains("AFTERSUCCESS"))
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n");
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n");
@@ -414,6 +415,7 @@ namespace UAS_MES_NEW.Make
                             if (ErrorMessage.Contains("AFTERSUCCESS"))
                             if (ErrorMessage.Contains("AFTERSUCCESS"))
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n");
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n");
                             LastSncode = ms_sncode.Text;
                             LastSncode = ms_sncode.Text;
+                            dh.UpdateByCondition("steppassed", "SP_REMARK='" + bc_remark.Text + "'", "sp_id=(select max(sp_id) from steppassed where sp_sncode='" + ms_sncode.Text + "')");
                             OperateResult.AppendText(">>" + ms_sncode.Text + "成功采集为良品\n", Color.Green, ms_sncode);
                             OperateResult.AppendText(">>" + ms_sncode.Text + "成功采集为良品\n", Color.Green, ms_sncode);
                             //记录操作日志
                             //记录操作日志
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "采集良品", "采集良品成功", LastSncode, ob_checkno.Text);
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "采集良品", "采集良品成功", LastSncode, ob_checkno.Text);
@@ -556,6 +558,7 @@ namespace UAS_MES_NEW.Make
                 if (LogicHandler.SetTestNGDetail(ms_sncode.Text, ma_code.Text, User.UserCode, User.UserSourceCode, "检查未通过", bgcode, bccode, bgname, bcname, bcremark, out ErrorMessage))
                 if (LogicHandler.SetTestNGDetail(ms_sncode.Text, ma_code.Text, User.UserCode, User.UserSourceCode, "检查未通过", bgcode, bccode, bgname, bcname, bcremark, out ErrorMessage))
                 {
                 {
                     //存在的不良代码和
                     //存在的不良代码和
+                    dh.UpdateByCondition("steppassed", "SP_REMARK='" + bc_remark.Text + "'", "sp_id=(select max(sp_id) from steppassed where sp_sncode='" + ms_sncode.Text + "')");
                     dt = (DataTable)dh.ExecuteSql("select sr_badcode from STEPRETURN where sr_stepcode='" + User.CurrentStepCode + "'", "select");
                     dt = (DataTable)dh.ExecuteSql("select sr_badcode from STEPRETURN where sr_stepcode='" + User.CurrentStepCode + "'", "select");
                     if (dt.Rows.Count > 0)
                     if (dt.Rows.Count > 0)
                     {
                     {
@@ -608,6 +611,7 @@ namespace UAS_MES_NEW.Make
                     //清除不良信息
                     //清除不良信息
                     bc_code.Text = "";
                     bc_code.Text = "";
                     ChoosedRejectList.Items.Clear();
                     ChoosedRejectList.Items.Clear();
+                    LoadBadGroupData();
                     LoadCollectedNum();
                     LoadCollectedNum();
                     WaitList.Clear();
                     WaitList.Clear();
                     ChoosedList.Clear();
                     ChoosedList.Clear();

+ 106 - 105
UAS_MES_YDCY/FunctionCode/Special/Special_ChangeMake.Designer.cs

@@ -42,17 +42,17 @@
             this.input = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.input = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Split = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.Split = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.ImportExcel1 = new System.Windows.Forms.OpenFileDialog();
             this.ImportExcel1 = new System.Windows.Forms.OpenFileDialog();
-            this.pr_detail = new System.Windows.Forms.Label();
+            this.prdetail = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
-            this.pr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.prcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.macode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.label2 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.label5 = new System.Windows.Forms.Label();
             this.label5 = new System.Windows.Forms.Label();
-            this.pr_detail1 = new System.Windows.Forms.Label();
+            this.pr_detail = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
-            this.pr_code1 = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.pr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label7 = new System.Windows.Forms.Label();
             this.label7 = new System.Windows.Forms.Label();
-            this.ma_code1 = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
@@ -216,15 +216,15 @@
             // 
             // 
             this.ImportExcel1.FileName = "ImportExcel";
             this.ImportExcel1.FileName = "ImportExcel";
             // 
             // 
-            // pr_detail
+            // prdetail
             // 
             // 
-            this.pr_detail.AutoSize = true;
-            this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(643, 149);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 41);
-            this.pr_detail.TabIndex = 253;
+            this.prdetail.AutoSize = true;
+            this.prdetail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.prdetail.Location = new System.Drawing.Point(643, 149);
+            this.prdetail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.prdetail.Name = "prdetail";
+            this.prdetail.Size = new System.Drawing.Size(0, 41);
+            this.prdetail.TabIndex = 253;
             // 
             // 
             // label6
             // label6
             // 
             // 
@@ -237,41 +237,42 @@
             this.label6.TabIndex = 252;
             this.label6.TabIndex = 252;
             this.label6.Text = "产品名称";
             this.label6.Text = "产品名称";
             // 
             // 
-            // pr_code
-            // 
-            this.pr_code.AllPower = null;
-            this.pr_code.BackColor = System.Drawing.Color.White;
-            this.pr_code.Enabled = false;
-            this.pr_code.ID = null;
-            this.pr_code.Location = new System.Drawing.Point(650, 93);
-            this.pr_code.Name = "pr_code";
-            this.pr_code.Power = null;
-            this.pr_code.Size = new System.Drawing.Size(312, 35);
-            this.pr_code.Str = null;
-            this.pr_code.Str1 = null;
-            this.pr_code.Str2 = null;
-            this.pr_code.TabIndex = 251;
-            // 
-            // ma_code
-            // 
-            this.ma_code.AllPower = "IFALL";
-            this.ma_code.Caller = null;
-            this.ma_code.Condition = null;
-            this.ma_code.DBTitle = "";
-            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(650, 26);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
-            this.ma_code.Name = "ma_code";
-            this.ma_code.Power = "";
-            this.ma_code.ReturnData = null;
-            this.ma_code.SelectField = null;
-            this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(323, 46);
-            this.ma_code.TabIndex = 250;
-            this.ma_code.TableName = null;
-            this.ma_code.Tag = "makecode";
-            this.ma_code.TextBoxEnable = true;
+            // prcode
+            // 
+            this.prcode.AllPower = null;
+            this.prcode.BackColor = System.Drawing.Color.White;
+            this.prcode.Enabled = false;
+            this.prcode.ID = null;
+            this.prcode.Location = new System.Drawing.Point(650, 93);
+            this.prcode.Name = "prcode";
+            this.prcode.Power = null;
+            this.prcode.Size = new System.Drawing.Size(312, 35);
+            this.prcode.Str = null;
+            this.prcode.Str1 = null;
+            this.prcode.Str2 = null;
+            this.prcode.TabIndex = 251;
+            // 
+            // macode
+            // 
+            this.macode.AllPower = "IFALL";
+            this.macode.Caller = null;
+            this.macode.Condition = null;
+            this.macode.DBTitle = "";
+            this.macode.Enabled = false;
+            this.macode.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.macode.FormName = null;
+            this.macode.Location = new System.Drawing.Point(650, 26);
+            this.macode.Margin = new System.Windows.Forms.Padding(6);
+            this.macode.Name = "macode";
+            this.macode.Power = "";
+            this.macode.ReturnData = null;
+            this.macode.SelectField = null;
+            this.macode.SetValueField = null;
+            this.macode.Size = new System.Drawing.Size(323, 46);
+            this.macode.TabIndex = 250;
+            this.macode.TableName = null;
+            this.macode.Tag = "makecode";
+            this.macode.TextBoxEnable = true;
             // 
             // 
             // label2
             // label2
             // 
             // 
@@ -295,15 +296,15 @@
             this.label5.TabIndex = 248;
             this.label5.TabIndex = 248;
             this.label5.Text = "产品代码";
             this.label5.Text = "产品代码";
             // 
             // 
-            // pr_detail1
+            // pr_detail
             // 
             // 
-            this.pr_detail1.AutoSize = true;
-            this.pr_detail1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail1.Location = new System.Drawing.Point(1280, 162);
-            this.pr_detail1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.pr_detail1.Name = "pr_detail1";
-            this.pr_detail1.Size = new System.Drawing.Size(0, 41);
-            this.pr_detail1.TabIndex = 259;
+            this.pr_detail.AutoSize = true;
+            this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail.Location = new System.Drawing.Point(1193, 162);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 41);
+            this.pr_detail.TabIndex = 259;
             // 
             // 
             // label4
             // label4
             // 
             // 
@@ -316,20 +317,20 @@
             this.label4.TabIndex = 258;
             this.label4.TabIndex = 258;
             this.label4.Text = "产品名称";
             this.label4.Text = "产品名称";
             // 
             // 
-            // pr_code1
-            // 
-            this.pr_code1.AllPower = null;
-            this.pr_code1.BackColor = System.Drawing.Color.White;
-            this.pr_code1.Enabled = false;
-            this.pr_code1.ID = null;
-            this.pr_code1.Location = new System.Drawing.Point(1184, 99);
-            this.pr_code1.Name = "pr_code1";
-            this.pr_code1.Power = null;
-            this.pr_code1.Size = new System.Drawing.Size(372, 35);
-            this.pr_code1.Str = null;
-            this.pr_code1.Str1 = null;
-            this.pr_code1.Str2 = null;
-            this.pr_code1.TabIndex = 257;
+            // pr_code
+            // 
+            this.pr_code.AllPower = null;
+            this.pr_code.BackColor = System.Drawing.Color.White;
+            this.pr_code.Enabled = false;
+            this.pr_code.ID = null;
+            this.pr_code.Location = new System.Drawing.Point(1184, 99);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Power = null;
+            this.pr_code.Size = new System.Drawing.Size(372, 35);
+            this.pr_code.Str = null;
+            this.pr_code.Str1 = null;
+            this.pr_code.Str2 = null;
+            this.pr_code.TabIndex = 257;
             // 
             // 
             // label7
             // label7
             // 
             // 
@@ -342,26 +343,26 @@
             this.label7.TabIndex = 256;
             this.label7.TabIndex = 256;
             this.label7.Text = "产品代码";
             this.label7.Text = "产品代码";
             // 
             // 
-            // ma_code1
-            // 
-            this.ma_code1.AllPower = "IFALL";
-            this.ma_code1.Caller = null;
-            this.ma_code1.Condition = null;
-            this.ma_code1.DBTitle = "";
-            this.ma_code1.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.ma_code1.FormName = null;
-            this.ma_code1.Location = new System.Drawing.Point(1187, 26);
-            this.ma_code1.Margin = new System.Windows.Forms.Padding(6);
-            this.ma_code1.Name = "ma_code1";
-            this.ma_code1.Power = "";
-            this.ma_code1.ReturnData = null;
-            this.ma_code1.SelectField = null;
-            this.ma_code1.SetValueField = null;
-            this.ma_code1.Size = new System.Drawing.Size(369, 46);
-            this.ma_code1.TabIndex = 255;
-            this.ma_code1.TableName = null;
-            this.ma_code1.Tag = "makecode";
-            this.ma_code1.TextBoxEnable = true;
+            // ma_code
+            // 
+            this.ma_code.AllPower = "IFALL";
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = "";
+            this.ma_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(1187, 26);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(6);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = "";
+            this.ma_code.ReturnData = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(369, 46);
+            this.ma_code.TabIndex = 255;
+            this.ma_code.TableName = null;
+            this.ma_code.Tag = "makecode";
+            this.ma_code.TextBoxEnable = true;
             // 
             // 
             // label1
             // label1
             // 
             // 
@@ -374,21 +375,21 @@
             this.label1.TabIndex = 254;
             this.label1.TabIndex = 254;
             this.label1.Text = "切换后工单";
             this.label1.Text = "切换后工单";
             // 
             // 
-            // Special_ChaneMake
+            // Special_ChangeMake
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1611, 1131);
             this.ClientSize = new System.Drawing.Size(1611, 1131);
-            this.Controls.Add(this.pr_detail1);
+            this.Controls.Add(this.pr_detail);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.label4);
-            this.Controls.Add(this.pr_code1);
+            this.Controls.Add(this.pr_code);
             this.Controls.Add(this.label7);
             this.Controls.Add(this.label7);
-            this.Controls.Add(this.ma_code1);
+            this.Controls.Add(this.ma_code);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.label1);
-            this.Controls.Add(this.pr_detail);
+            this.Controls.Add(this.prdetail);
             this.Controls.Add(this.label6);
             this.Controls.Add(this.label6);
-            this.Controls.Add(this.pr_code);
-            this.Controls.Add(this.ma_code);
+            this.Controls.Add(this.prcode);
+            this.Controls.Add(this.macode);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label5);
             this.Controls.Add(this.label5);
             this.Controls.Add(this.ImportExcel);
             this.Controls.Add(this.ImportExcel);
@@ -403,7 +404,7 @@
             this.Controls.Add(this.Split);
             this.Controls.Add(this.Split);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
             this.Margin = new System.Windows.Forms.Padding(4);
-            this.Name = "Special_ChaneMake";
+            this.Name = "Special_ChangeMake";
             this.Tag = "Special!Reset";
             this.Tag = "Special!Reset";
             this.Text = "重置站点";
             this.Text = "重置站点";
             this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
             this.Load += new System.EventHandler(this.Special_BoxSplit_Load);
@@ -428,17 +429,17 @@
         private CustomControl.ButtonUtil.NormalButton ImportExcel;
         private CustomControl.ButtonUtil.NormalButton ImportExcel;
         private System.Windows.Forms.FolderBrowserDialog ExportFileDialog;
         private System.Windows.Forms.FolderBrowserDialog ExportFileDialog;
         private System.Windows.Forms.OpenFileDialog ImportExcel1;
         private System.Windows.Forms.OpenFileDialog ImportExcel1;
-        private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.Label prdetail;
         private System.Windows.Forms.Label label6;
         private System.Windows.Forms.Label label6;
-        private CustomControl.TextBoxWithIcon.EnterTextBox pr_code;
-        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
+        private CustomControl.TextBoxWithIcon.EnterTextBox prcode;
+        private CustomControl.TextBoxWithIcon.SearchTextBox macode;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Label label5;
         private System.Windows.Forms.Label label5;
-        private System.Windows.Forms.Label pr_detail1;
+        private System.Windows.Forms.Label pr_detail;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.Label label4;
-        private CustomControl.TextBoxWithIcon.EnterTextBox pr_code1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox pr_code;
         private System.Windows.Forms.Label label7;
         private System.Windows.Forms.Label label7;
-        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code1;
+        private CustomControl.TextBoxWithIcon.SearchTextBox ma_code;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label1;
     }
     }
 }
 }

+ 42 - 36
UAS_MES_YDCY/FunctionCode/Special/Special_ChangeMake.cs

@@ -30,19 +30,19 @@ namespace UAS_MES_NEW.Special
 
 
         private void Special_BoxSplit_Load(object sender, EventArgs e)
         private void Special_BoxSplit_Load(object sender, EventArgs e)
         {
         {
+            macode.TableName = " make left join product on ma_prodcode=pr_code";
+            macode.SelectField = "ma_code # 工单编号,pr_code # 产品编号,pr_spec # 型号";
+            macode.FormName = Name;
+            macode.SetValueField = new string[] { "ma_code" };
+            macode.Condition = "ma_statuscode='STARTED'";
+            macode.DbChange += pr_code_DbChange;
+
             ma_code.TableName = " make left join product on ma_prodcode=pr_code";
             ma_code.TableName = " make left join product on ma_prodcode=pr_code";
             ma_code.SelectField = "ma_code # 工单编号,pr_code # 产品编号,pr_spec # 型号";
             ma_code.SelectField = "ma_code # 工单编号,pr_code # 产品编号,pr_spec # 型号";
             ma_code.FormName = Name;
             ma_code.FormName = Name;
             ma_code.SetValueField = new string[] { "ma_code" };
             ma_code.SetValueField = new string[] { "ma_code" };
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.Condition = "ma_statuscode='STARTED'";
-            ma_code.DbChange += pr_code_DbChange;
-
-            ma_code1.TableName = " make left join product on ma_prodcode=pr_code";
-            ma_code1.SelectField = "ma_code # 工单编号,pr_code # 产品编号,pr_spec # 型号";
-            ma_code1.FormName = Name;
-            ma_code1.SetValueField = new string[] { "ma_code ma_code1" };
-            ma_code1.Condition = "ma_statuscode='STARTED'";
-            ma_code1.DbChange += pr_code_DbChange1;
+            ma_code.DbChange += pr_code_DbChange1;
 
 
             dh = SystemInf.dh;
             dh = SystemInf.dh;
             //asc.controllInitializeSize(this);
             //asc.controllInitializeSize(this);
@@ -51,25 +51,25 @@ namespace UAS_MES_NEW.Special
 
 
         private void pr_code_DbChange(object sender, EventArgs e)
         private void pr_code_DbChange(object sender, EventArgs e)
         {
         {
-            Dbfind = ma_code.ReturnData;
+            Dbfind = macode.ReturnData;
             BaseUtil.SetFormValue(this.Controls, Dbfind);
             BaseUtil.SetFormValue(this.Controls, Dbfind);
-            DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail from make left join product on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail from make left join product on ma_prodcode=pr_code where ma_code='" + macode.Text + "'", "select");
             if (dt.Rows.Count > 0)
             if (dt.Rows.Count > 0)
             {
             {
-                pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
-                pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
+                prcode.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                prdetail.Text = dt.Rows[0]["pr_detail"].ToString();
             }
             }
         }
         }
 
 
         private void pr_code_DbChange1(object sender, EventArgs e)
         private void pr_code_DbChange1(object sender, EventArgs e)
         {
         {
-            Dbfind = ma_code1.ReturnData;
+            Dbfind = ma_code.ReturnData;
             BaseUtil.SetFormValue(this.Controls, Dbfind);
             BaseUtil.SetFormValue(this.Controls, Dbfind);
-            DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail from make left join product on ma_prodcode=pr_code where ma_code='" + ma_code1.Text + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail from make left join product on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'", "select");
             if (dt.Rows.Count > 0)
             if (dt.Rows.Count > 0)
             {
             {
-                pr_code1.Text = dt.Rows[0]["ma_prodcode"].ToString();
-                pr_detail1.Text = dt.Rows[0]["pr_detail"].ToString();
+                pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
+                pr_detail.Text = dt.Rows[0]["pr_detail"].ToString();
             }
             }
         }
         }
 
 
@@ -85,47 +85,47 @@ namespace UAS_MES_NEW.Special
             }
             }
             else
             else
             {
             {
-                if (dt.Rows[0]["ms_makecode"].ToString() != ma_code.Text)
+                if (dt.Rows[0]["ms_makecode"].ToString() != macode.Text)
                 {
                 {
-                    OperatResult.AppendText("" + sncode + "不存在工单" + ma_code.Text + "\n");
+                    OperatResult.AppendText("" + sncode + "不存在工单" + macode.Text + "\n");
                     return false;
                     return false;
                 }
                 }
                 sncode = dt.Rows[0]["ms_sncode"].ToString();
                 sncode = dt.Rows[0]["ms_sncode"].ToString();
             }
             }
 
 
-            if (ma_code.Text == "" || ma_code1.Text == "")
+            if (macode.Text == "" || ma_code.Text == "")
             {
             {
                 OperatResult.AppendText("工单号不允许为空\n");
                 OperatResult.AppendText("工单号不允许为空\n");
                 return false;
                 return false;
             }
             }
-            if (!dh.CheckExist("make", "ma_code='" + ma_code.Text + "'"))
+            if (!dh.CheckExist("make", "ma_code='" + macode.Text + "'"))
             {
             {
-                OperatResult.AppendText("工单号" + ma_code.Text + "不存在\n");
+                OperatResult.AppendText("工单号" + macode.Text + "不存在\n");
                 return false;
                 return false;
             }
             }
-            if (!dh.CheckExist("make", "ma_code='" + ma_code1.Text + "'"))
+            if (!dh.CheckExist("make", "ma_code='" + ma_code.Text + "'"))
             {
             {
-                OperatResult.AppendText("工单号" + ma_code1.Text + "不存在\n");
+                OperatResult.AppendText("工单号" + ma_code.Text + "不存在\n");
                 return false;
                 return false;
             }
             }
-            if (dh.getFieldDataByCondition("make", "ma_prodcode", "ma_code='" + ma_code.Text + "'").ToString() != dh.getFieldDataByCondition("make", "ma_prodcode", "ma_code='" + ma_code1.Text + "'").ToString())
+            if (dh.getFieldDataByCondition("make", "ma_prodcode", "ma_code='" + macode.Text + "'").ToString() != dh.getFieldDataByCondition("make", "ma_prodcode", "ma_code='" + ma_code.Text + "'").ToString())
             {
             {
                 OperatResult.AppendText("工单号产品编号不对应,不允许切换\n");
                 OperatResult.AppendText("工单号产品编号不对应,不允许切换\n");
                 return false;
                 return false;
             }
             }
             List<string> sqls = new List<string>();
             List<string> sqls = new List<string>();
-            sqls.Add("update CRAFTMATERIAL set cm_makecode='" + ma_code1.Text + "' where cm_makecode= '" + ma_code.Text + "' and cm_sncode='" + sncode + "'");
-            sqls.Add("update steppassed set sp_makecode='" + ma_code1.Text + "' where sp_makecode= '" + ma_code.Text + "' and sp_sncode='" + sncode + "'");
-            sqls.Add("update makeserial set ms_makecode='" + ma_code1.Text + "' where ms_makecode= '" + ma_code.Text + "' and ms_sncode='" + sncode + "'");
-            sqls.Add("update makeprocess set mp_makecode='" + ma_code1.Text + "' where mp_makecode= '" + ma_code.Text + "' and mp_sncode='" + sncode + "'");
-            sqls.Add("update commandlog set cl_makecode='" + ma_code1.Text + "' where cl_makecode= '" + ma_code.Text + "' and cl_sncode='" + sncode + "'");
-            sqls.Add("update makebad set mb_makecode='" + ma_code1.Text + "' where mb_makecode= '" + ma_code.Text + "' and mb_sncode='" + sncode + "'");
-            sqls.Add("update labelprintlog set lpl_makecode='" + ma_code1.Text + "' where lpl_makecode= '" + ma_code.Text + "' and lpl_value='" + sncode + "'");
-            sqls.Add("update make set ma_inqty=(select count(1) from makeserial where ms_makecode='" + ma_code1.Text + "') where ma_code='" + ma_code1.Text + "' ");
-            sqls.Add("update make set ma_endqty=(select count(1) from makeserial where ms_makecode='" + ma_code1.Text + "' and ms_status=2) where ma_code='" + ma_code1.Text + "'");
+            sqls.Add("update CRAFTMATERIAL set cm_makecode='" + ma_code.Text + "' where cm_makecode= '" + macode.Text + "' and cm_sncode='" + sncode + "'");
+            sqls.Add("update steppassed set sp_makecode='" + ma_code.Text + "' where sp_makecode= '" + macode.Text + "' and sp_sncode='" + sncode + "'");
+            sqls.Add("update makeserial set ms_makecode='" + ma_code.Text + "' where ms_makecode= '" + macode.Text + "' and ms_sncode='" + sncode + "'");
+            sqls.Add("update makeprocess set mp_makecode='" + ma_code.Text + "' where mp_makecode= '" + macode.Text + "' and mp_sncode='" + sncode + "'");
+            sqls.Add("update commandlog set cl_makecode='" + ma_code.Text + "' where cl_makecode= '" + macode.Text + "' and cl_sncode='" + sncode + "'");
+            sqls.Add("update makebad set mb_makecode='" + ma_code.Text + "' where mb_makecode= '" + macode.Text + "' and mb_sncode='" + sncode + "'");
+            sqls.Add("update labelprintlog set lpl_makecode='" + ma_code.Text + "' where lpl_makecode= '" + macode.Text + "' and lpl_value='" + sncode + "'");
+            sqls.Add("update make set ma_inqty=(select count(1) from makeserial where ms_makecode='" + ma_code.Text + "') where ma_code='" + ma_code.Text + "' ");
+            sqls.Add("update make set ma_endqty=(select count(1) from makeserial where ms_makecode='" + ma_code.Text + "' and ms_status=2) where ma_code='" + ma_code.Text + "'");
             dh.ExecuteSQLTran(sqls.ToArray());
             dh.ExecuteSQLTran(sqls.ToArray());
             OperatResult.AppendText("工单号切换成功\n");
             OperatResult.AppendText("工单号切换成功\n");
-            LogicHandler.DoCommandLog(Tag.ToString(), User.UserName, ma_code.Text, User.UserLineCode, User.UserSourceCode, "工单变更", "工单变更" + ma_code.Text + "切换到" + ma_code1.Text, sncode, "");
+            LogicHandler.DoCommandLog(Tag.ToString(), User.UserName, macode.Text, User.UserLineCode, User.UserSourceCode, "工单变更", "工单变更" + macode.Text + "切换到" + ma_code.Text, sncode, "");
             return true;
             return true;
         }
         }
 
 
@@ -137,7 +137,7 @@ namespace UAS_MES_NEW.Special
                 for (int i = 0; i < sb.Count; i++)
                 for (int i = 0; i < sb.Count; i++)
                 {
                 {
                     if (ReSN(sb[i].ToString()))
                     if (ReSN(sb[i].ToString()))
-                        OperatResult.AppendText("SN:" + sb[i].ToString() + "切换到工单" + ma_code1.Text + "完成\n", Color.Green);
+                        OperatResult.AppendText("SN:" + sb[i].ToString() + "切换到工单" + ma_code.Text + "完成\n", Color.Green);
                 }
                 }
                 WeighRecord.Clear();
                 WeighRecord.Clear();
                 sb.Clear();
                 sb.Clear();
@@ -150,9 +150,15 @@ namespace UAS_MES_NEW.Special
             {
             {
                 if (serBtn.Checked)
                 if (serBtn.Checked)
                 {
                 {
-                    dt = (DataTable)dh.ExecuteSql("select ms_sncode, ms_makecode,ms_prodcode,ms_sncode,ms_craftcode cr_code,ms_status,ms_outboxcode from makeserial where ms_sncode='" + input.Text + "' order by ms_id desc", "select");
+                    dt = (DataTable)dh.ExecuteSql("select ms_sncode, ms_makecode,ms_prodcode,ms_sncode,ms_craftcode cr_code,ms_status,ms_outboxcode,pr_detail from makeserial left join product on pr_code=ms_prodcode where ms_sncode='" + input.Text + "' order by ms_id desc", "select");
                     if (dt.Rows.Count > 0)
                     if (dt.Rows.Count > 0)
                     {
                     {
+                        if (macode.Text == "")
+                        {
+                            macode.Text = dt.Rows[0]["ms_makecode"].ToString();
+                            prcode.Text = dt.Rows[0]["ms_prodcode"].ToString();
+                            prdetail.Text = dt.Rows[0]["pr_detail"].ToString();
+                        }
                         if (dt.Rows[0]["ms_status"].ToString() == "3")
                         if (dt.Rows[0]["ms_status"].ToString() == "3")
                         {
                         {
                             OperatResult.AppendText("SN:" + input.Text + "为不良品,不允许采集\n", Color.Red, input);
                             OperatResult.AppendText("SN:" + input.Text + "为不良品,不允许采集\n", Color.Red, input);

+ 2 - 2
UAS_MES_YDCY/FunctionCode/Special/Special_Reset.cs

@@ -50,7 +50,7 @@ namespace UAS_MES_NEW.Special
 
 
         private bool ReSN(string sncode, string stepcode)
         private bool ReSN(string sncode, string stepcode)
         {
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select ms_paststep,nvl(ms_qccheck,0)ms_qccheck,nvl(ms_ifqccheck,0)ms_ifqccheck,ms_makecode,nvl(ms_outstatus,0)ms_outstatus from makeserial where ms_sncode ='" + sncode + "' order by ms_id desc", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select ms_paststep,nvl(ms_qccheck,0)ms_qccheck,nvl(ms_ifqccheck,0)ms_ifqccheck,ms_makecode,nvl(ms_outstatus,0)ms_outstatus,nvl(pr_ifrepaircheck,0)pr_ifrepaircheck from makeserial left join product on pr_code=ms_prodcode where ms_sncode ='" + sncode + "' order by ms_id desc", "select");
             if (!dt.Rows[0]["ms_paststep"].ToString().Contains(cd_stepcode.Text))
             if (!dt.Rows[0]["ms_paststep"].ToString().Contains(cd_stepcode.Text))
             {
             {
                 OperatResult.AppendText(">>序列号" + sncode + "不允许回流到未执行工序\n", Color.Red);
                 OperatResult.AppendText(">>序列号" + sncode + "不允许回流到未执行工序\n", Color.Red);
@@ -61,7 +61,7 @@ namespace UAS_MES_NEW.Special
                 OperatResult.AppendText(">>序列号" + sncode + "已出货不允许回流\n", Color.Red);
                 OperatResult.AppendText(">>序列号" + sncode + "已出货不允许回流\n", Color.Red);
                 return false;
                 return false;
             }
             }
-            if (dt.Rows[0]["ms_qccheck"].ToString() == "-1" || dt.Rows[0]["ms_ifqccheck"].ToString() == "-1")
+            if ((dt.Rows[0]["ms_qccheck"].ToString() == "-1"&& dt.Rows[0]["pr_ifrepaircheck"].ToString() == "-1") || dt.Rows[0]["ms_ifqccheck"].ToString() == "-1")
             {
             {
                 OperatResult.AppendText(">>序列号" + sncode + "处于抽检状态,不允许重置站点\n", Color.Red);
                 OperatResult.AppendText(">>序列号" + sncode + "处于抽检状态,不允许重置站点\n", Color.Red);
                 return false;
                 return false;