浏览代码

如果有老化则回到老化工序

章政 8 年之前
父节点
当前提交
c62695ba90
共有 2 个文件被更改,包括 53 次插入44 次删除
  1. 36 36
      UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs
  2. 17 8
      UAS-MES/FunctionCode/Make/Make_Repair.cs

+ 36 - 36
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -106,7 +106,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ma_craftcode_label.AutoSize = true;
             this.ma_craftcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_craftcode_label.Location = new System.Drawing.Point(20, 85);
+            this.ma_craftcode_label.Location = new System.Drawing.Point(20, 84);
             this.ma_craftcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ma_craftcode_label.Name = "ma_craftcode_label";
             this.ma_craftcode_label.Size = new System.Drawing.Size(92, 27);
@@ -119,7 +119,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.st_rstepcode_label.AutoSize = true;
             this.st_rstepcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.st_rstepcode_label.Location = new System.Drawing.Point(353, 85);
+            this.st_rstepcode_label.Location = new System.Drawing.Point(353, 84);
             this.st_rstepcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.st_rstepcode_label.Name = "st_rstepcode_label";
             this.st_rstepcode_label.Size = new System.Drawing.Size(92, 27);
@@ -132,7 +132,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_prodcode_label.AutoSize = true;
             this.ms_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_prodcode_label.Location = new System.Drawing.Point(544, 38);
+            this.ms_prodcode_label.Location = new System.Drawing.Point(544, 37);
             this.ms_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_prodcode_label.Name = "ms_prodcode_label";
             this.ms_prodcode_label.Size = new System.Drawing.Size(92, 27);
@@ -179,7 +179,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_sncode_label.AutoSize = true;
             this.ms_sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode_label.Location = new System.Drawing.Point(20, 36);
+            this.ms_sncode_label.Location = new System.Drawing.Point(20, 35);
             this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_sncode_label.Name = "ms_sncode_label";
             this.ms_sncode_label.Size = new System.Drawing.Size(72, 27);
@@ -192,7 +192,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(271, 38);
+            this.ms_makecode_label.Location = new System.Drawing.Point(271, 37);
             this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(72, 27);
@@ -347,7 +347,7 @@
             this.nr_code.AutoSize = true;
             this.nr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.nr_code.ForeColor = System.Drawing.Color.Black;
-            this.nr_code.Location = new System.Drawing.Point(1120, 76);
+            this.nr_code.Location = new System.Drawing.Point(1120, 75);
             this.nr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.nr_code.Name = "nr_code";
             this.nr_code.Size = new System.Drawing.Size(0, 27);
@@ -357,7 +357,7 @@
             // mb_badremark
             // 
             this.mb_badremark.Location = new System.Drawing.Point(977, 179);
-            this.mb_badremark.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
+            this.mb_badremark.Margin = new System.Windows.Forms.Padding(5);
             this.mb_badremark.Name = "mb_badremark";
             this.mb_badremark.Size = new System.Drawing.Size(187, 26);
             this.mb_badremark.TabIndex = 127;
@@ -371,7 +371,7 @@
             this.ms_sncode.AutoSize = true;
             this.ms_sncode.CutLength = null;
             this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode.Location = new System.Drawing.Point(120, 38);
+            this.ms_sncode.Location = new System.Drawing.Point(120, 37);
             this.ms_sncode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_sncode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_sncode.Name = "ms_sncode";
@@ -501,7 +501,7 @@
             this.GetSNCode.BackColor = System.Drawing.Color.White;
             this.GetSNCode.ID = null;
             this.GetSNCode.Location = new System.Drawing.Point(325, 668);
-            this.GetSNCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.GetSNCode.Margin = new System.Windows.Forms.Padding(4);
             this.GetSNCode.Name = "GetSNCode";
             this.GetSNCode.Power = null;
             this.GetSNCode.Size = new System.Drawing.Size(249, 25);
@@ -520,7 +520,7 @@
             this.NewRepairInf.Image = null;
             this.NewRepairInf.IsShowBorder = true;
             this.NewRepairInf.Location = new System.Drawing.Point(367, 616);
-            this.NewRepairInf.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.NewRepairInf.Margin = new System.Windows.Forms.Padding(4);
             this.NewRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.MoveImage")));
             this.NewRepairInf.Name = "NewRepairInf";
             this.NewRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.NormalImage")));
@@ -540,7 +540,7 @@
             this.SaveRepairInf.Image = null;
             this.SaveRepairInf.IsShowBorder = true;
             this.SaveRepairInf.Location = new System.Drawing.Point(1061, 321);
-            this.SaveRepairInf.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.SaveRepairInf.Margin = new System.Windows.Forms.Padding(4);
             this.SaveRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.MoveImage")));
             this.SaveRepairInf.Name = "SaveRepairInf";
             this.SaveRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("SaveRepairInf.NormalImage")));
@@ -561,7 +561,7 @@
             this.DeleteRepairInf.Image = null;
             this.DeleteRepairInf.IsShowBorder = true;
             this.DeleteRepairInf.Location = new System.Drawing.Point(513, 616);
-            this.DeleteRepairInf.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.DeleteRepairInf.Margin = new System.Windows.Forms.Padding(4);
             this.DeleteRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.MoveImage")));
             this.DeleteRepairInf.Name = "DeleteRepairInf";
             this.DeleteRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("DeleteRepairInf.NormalImage")));
@@ -581,7 +581,7 @@
             this.mbl_loc.BackColor = System.Drawing.Color.White;
             this.mbl_loc.ID = null;
             this.mbl_loc.Location = new System.Drawing.Point(349, 361);
-            this.mbl_loc.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.mbl_loc.Margin = new System.Windows.Forms.Padding(4);
             this.mbl_loc.Name = "mbl_loc";
             this.mbl_loc.Power = null;
             this.mbl_loc.Size = new System.Drawing.Size(161, 25);
@@ -601,7 +601,7 @@
             this.mbr_solutioncode.Enabled = false;
             this.mbr_solutioncode.ID = null;
             this.mbr_solutioncode.Location = new System.Drawing.Point(669, 286);
-            this.mbr_solutioncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.mbr_solutioncode.Margin = new System.Windows.Forms.Padding(4);
             this.mbr_solutioncode.Name = "mbr_solutioncode";
             this.mbr_solutioncode.Power = null;
             this.mbr_solutioncode.Size = new System.Drawing.Size(160, 25);
@@ -620,7 +620,7 @@
             this.mbc_component.Enabled = false;
             this.mbc_component.ID = null;
             this.mbc_component.Location = new System.Drawing.Point(349, 288);
-            this.mbc_component.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.mbc_component.Margin = new System.Windows.Forms.Padding(4);
             this.mbc_component.Name = "mbc_component";
             this.mbc_component.Power = null;
             this.mbc_component.Size = new System.Drawing.Size(160, 25);
@@ -639,7 +639,7 @@
             this.mbr_dutycode.Enabled = false;
             this.mbr_dutycode.ID = null;
             this.mbr_dutycode.Location = new System.Drawing.Point(977, 236);
-            this.mbr_dutycode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.mbr_dutycode.Margin = new System.Windows.Forms.Padding(4);
             this.mbr_dutycode.Name = "mbr_dutycode";
             this.mbr_dutycode.Power = null;
             this.mbr_dutycode.Size = new System.Drawing.Size(160, 25);
@@ -658,7 +658,7 @@
             this.nr_name.Enabled = false;
             this.nr_name.ID = null;
             this.nr_name.Location = new System.Drawing.Point(669, 236);
-            this.nr_name.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.nr_name.Margin = new System.Windows.Forms.Padding(4);
             this.nr_name.Name = "nr_name";
             this.nr_name.Power = null;
             this.nr_name.Size = new System.Drawing.Size(160, 25);
@@ -678,7 +678,7 @@
             this.nrg_name.Enabled = false;
             this.nrg_name.ID = null;
             this.nrg_name.Location = new System.Drawing.Point(349, 236);
-            this.nrg_name.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.nrg_name.Margin = new System.Windows.Forms.Padding(4);
             this.nrg_name.Name = "nrg_name";
             this.nrg_name.Power = null;
             this.nrg_name.Size = new System.Drawing.Size(160, 25);
@@ -697,7 +697,7 @@
             this.bc_name.Enabled = false;
             this.bc_name.ID = null;
             this.bc_name.Location = new System.Drawing.Point(669, 179);
-            this.bc_name.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.bc_name.Margin = new System.Windows.Forms.Padding(4);
             this.bc_name.Name = "bc_name";
             this.bc_name.Power = null;
             this.bc_name.Size = new System.Drawing.Size(160, 25);
@@ -717,7 +717,7 @@
             this.bg_name.ForeColor = System.Drawing.Color.Red;
             this.bg_name.ID = null;
             this.bg_name.Location = new System.Drawing.Point(349, 180);
-            this.bg_name.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.bg_name.Margin = new System.Windows.Forms.Padding(4);
             this.bg_name.Name = "bg_name";
             this.bg_name.Power = null;
             this.bg_name.Size = new System.Drawing.Size(160, 25);
@@ -731,7 +731,7 @@
             // 
             this.OperatResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OperatResult.Location = new System.Drawing.Point(977, 359);
-            this.OperatResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperatResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperatResult.Name = "OperatResult";
             this.OperatResult.Size = new System.Drawing.Size(208, 312);
             this.OperatResult.TabIndex = 87;
@@ -744,7 +744,7 @@
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.CutLength = null;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(377, 38);
+            this.ms_makecode.Location = new System.Drawing.Point(377, 37);
             this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_makecode.Name = "ms_makecode";
@@ -758,7 +758,7 @@
             this.ms_prodcode.AutoSize = true;
             this.ms_prodcode.CutLength = null;
             this.ms_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_prodcode.Location = new System.Drawing.Point(672, 38);
+            this.ms_prodcode.Location = new System.Drawing.Point(672, 37);
             this.ms_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_prodcode.Name = "ms_prodcode";
@@ -773,7 +773,7 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             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(977, 38);
+            this.pr_detail.Location = new System.Drawing.Point(977, 37);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_detail.Name = "pr_detail";
@@ -788,7 +788,7 @@
             this.Clean.Image = null;
             this.Clean.IsShowBorder = true;
             this.Clean.Location = new System.Drawing.Point(1043, 678);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
@@ -809,7 +809,7 @@
             this.cd_stepcode.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.cd_stepcode.FormName = null;
             this.cd_stepcode.Location = new System.Drawing.Point(475, 86);
-            this.cd_stepcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.cd_stepcode.Margin = new System.Windows.Forms.Padding(4);
             this.cd_stepcode.Name = "cd_stepcode";
             this.cd_stepcode.Power = "ifspecial";
             this.cd_stepcode.ReturnData = null;
@@ -818,7 +818,7 @@
             this.cd_stepcode.Size = new System.Drawing.Size(200, 28);
             this.cd_stepcode.TabIndex = 68;
             this.cd_stepcode.TableName = null;
-            this.cd_stepcode.Tag = "ms_stepcode";
+            this.cd_stepcode.Tag = "";
             this.cd_stepcode.TextBoxEnable = false;
             // 
             // cr_code
@@ -830,7 +830,7 @@
             this.cr_code.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.cr_code.FormName = null;
             this.cr_code.Location = new System.Drawing.Point(121, 86);
-            this.cr_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.cr_code.Margin = new System.Windows.Forms.Padding(4);
             this.cr_code.Name = "cr_code";
             this.cr_code.Power = "ifspecial";
             this.cr_code.ReturnData = null;
@@ -851,7 +851,7 @@
             this.NewBadCode.Image = null;
             this.NewBadCode.IsShowBorder = true;
             this.NewBadCode.Location = new System.Drawing.Point(219, 616);
-            this.NewBadCode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.NewBadCode.Margin = new System.Windows.Forms.Padding(4);
             this.NewBadCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.MoveImage")));
             this.NewBadCode.Name = "NewBadCode";
             this.NewBadCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewBadCode.NormalImage")));
@@ -872,7 +872,7 @@
             this.SaveBadLocation.Image = null;
             this.SaveBadLocation.IsShowBorder = true;
             this.SaveBadLocation.Location = new System.Drawing.Point(513, 359);
-            this.SaveBadLocation.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.SaveBadLocation.Margin = new System.Windows.Forms.Padding(4);
             this.SaveBadLocation.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveBadLocation.MoveImage")));
             this.SaveBadLocation.Name = "SaveBadLocation";
             this.SaveBadLocation.NormalImage = ((System.Drawing.Image)(resources.GetObject("SaveBadLocation.NormalImage")));
@@ -893,7 +893,7 @@
             this.Scrap.Image = null;
             this.Scrap.IsShowBorder = true;
             this.Scrap.Location = new System.Drawing.Point(841, 82);
-            this.Scrap.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Scrap.Margin = new System.Windows.Forms.Padding(4);
             this.Scrap.MoveImage = ((System.Drawing.Image)(resources.GetObject("Scrap.MoveImage")));
             this.Scrap.Name = "Scrap";
             this.Scrap.NormalImage = ((System.Drawing.Image)(resources.GetObject("Scrap.NormalImage")));
@@ -914,7 +914,7 @@
             this.RepairComplete.Image = null;
             this.RepairComplete.IsShowBorder = true;
             this.RepairComplete.Location = new System.Drawing.Point(715, 82);
-            this.RepairComplete.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.RepairComplete.Margin = new System.Windows.Forms.Padding(4);
             this.RepairComplete.MoveImage = ((System.Drawing.Image)(resources.GetObject("RepairComplete.MoveImage")));
             this.RepairComplete.Name = "RepairComplete";
             this.RepairComplete.NormalImage = ((System.Drawing.Image)(resources.GetObject("RepairComplete.NormalImage")));
@@ -932,7 +932,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(849, 38);
+            this.pr_detail_label.Location = new System.Drawing.Point(849, 37);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
@@ -945,7 +945,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_checkno.AutoSize = true;
             this.ms_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_checkno.Location = new System.Drawing.Point(1055, 36);
+            this.ms_checkno.Location = new System.Drawing.Point(1055, 35);
             this.ms_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_checkno.Name = "ms_checkno";
             this.ms_checkno.Size = new System.Drawing.Size(92, 27);
@@ -959,7 +959,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.ms_reworkcheckno.AutoSize = true;
             this.ms_reworkcheckno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_reworkcheckno.Location = new System.Drawing.Point(1057, 76);
+            this.ms_reworkcheckno.Location = new System.Drawing.Point(1057, 75);
             this.ms_reworkcheckno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_reworkcheckno.Name = "ms_reworkcheckno";
             this.ms_reworkcheckno.Size = new System.Drawing.Size(92, 27);
@@ -1041,7 +1041,7 @@
             this.Controls.Add(this.bc_name_label);
             this.Controls.Add(this.bg_name_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_Repair";
             this.Tag = "Make!Repair";
             this.Text = "维修作业";

+ 17 - 8
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -202,10 +202,10 @@ namespace UAS_MES.Make
                     {
                         //验证makeserial或者ms_firstsn表序列号是否存在
                         sql.Clear();
-                        sql.Append("select max(ms_id) ms_id,ms_makecode,ms_stepcode,ms_firstsn,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno ");
+                        sql.Append("select max(ms_id) ms_id,ms_makecode,ms_stepcode,ms_firstsn,ms_prodcode,ms_sncode,pr_detail,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno ");
                         sql.Append("from makeserial left join product on pr_code=ms_prodcode where ms_makecode ='" + macode + "' and(ms_sncode");
                         sql.Append("='" + GetSNCode.Text + "' or ms_firstsn in (select firstsn from makesnrelation where ");
-                        sql.Append("sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_stepcode,ms_prodcode,ms_sncode,pr_detail,ms_firstsn,ms_stepcode,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno");
+                        sql.Append("sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_stepcode,ms_prodcode,ms_sncode,pr_detail,ms_firstsn,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dt.Rows.Count > 0)
                         {
@@ -214,6 +214,7 @@ namespace UAS_MES.Make
                             BaseUtil.SetFormValue(this.Controls, dt);
                             //判断是否当前工单途程的上料记录
                             firstsn = dt.Rows[0]["ms_firstsn"].ToString();
+                            string cdstepcode = "";
                             sql.Clear();
                             sql.Append("select cm_craftcode,cm_stepcode,cm_soncode,min(cm_indate)cm_indate,sum(case when cm_status=-1 ");
                             sql.Append("then 0 else 1 end)qty from craftmaterial left join product on pr_code=cm_soncode where(cm_sncode ");
@@ -223,7 +224,7 @@ namespace UAS_MES.Make
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
-                                cd_stepcode.Text = LogicHandler.GetNextStep(dt.Rows[0]["cm_craftcode"].ToString(), dt.Rows[0]["cm_stepcode"].ToString(), ms_prodcode.Text);
+                                cdstepcode = LogicHandler.GetNextStep(dt.Rows[0]["cm_craftcode"].ToString(), dt.Rows[0]["cm_stepcode"].ToString(), ms_prodcode.Text);
                             }
                             else
                             {
@@ -236,18 +237,26 @@ namespace UAS_MES.Make
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 if (dt.Rows.Count > 0)
                                 {
-                                    cd_stepcode.Text = dt.Rows[0]["cm_stepcode"].ToString();
+                                    cdstepcode = dt.Rows[0]["cm_stepcode"].ToString();
                                 }
                             }
-                            //如果ms_stepcode和扣料工序均没有查到返修的工序
-                            if (cd_stepcode.Text == "")
+                            if (cdstepcode == "")
                             {
                                 sql.Clear();
                                 sql.Append("select cd_stepcode from craft left join craftdetail on cr_id =cd_crid where ");
-                                sql.Append("cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' order by cd_detno");
+                                sql.Append("cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and nvl(cd_ifburnin,0)<>0 order by cd_detno");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                cd_stepcode.Text = dt.Rows[0][0].ToString();
+                                if (dt.Rows.Count > 0)
+                                {
+                                    cdstepcode = dt.Rows[0][0].ToString();
+                                }
+                            }
+                            //如果ms_stepcode和扣料工序均没有查到返修的工序
+                            if (cdstepcode == "")
+                            {
+                                cdstepcode = ms_stepcode;
                             }
+                            cd_stepcode.Text = cdstepcode;
                             LoadBadInfTree(sender, e);
                         }
                         else OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);