Browse Source

老化回流测试

章政 8 năm trước cách đây
mục cha
commit
a90528ec98
1 tập tin đã thay đổi với 9 bổ sung2 xóa
  1. 9 2
      UAS-MES/FunctionCode/Make/Make_Repair.cs

+ 9 - 2
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -224,7 +224,11 @@ namespace UAS_MES.Make
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
-                                cdstepcode = LogicHandler.GetNextStep(dt.Rows[0]["cm_craftcode"].ToString(), dt.Rows[0]["cm_stepcode"].ToString(), ms_prodcode.Text);
+                                //如果本工序包含老化则默认选择本工序,否则选择上料的后一道工序
+                                if (dh.getFieldDataByCondition("craft left join craftdetail on cr_id=cd_crid", "nvl(cd_ifburnin,0)", "cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_stepcode='" + dt.Rows[0]["cm_stepcode"].ToString() + "'").ToString() != "0")
+                                    cdstepcode = dt.Rows[0]["cm_stepcode"].ToString();
+                                else
+                                    cdstepcode = LogicHandler.GetNextStep(dt.Rows[0]["cm_craftcode"].ToString(), dt.Rows[0]["cm_stepcode"].ToString(), ms_prodcode.Text);
                             }
                             else
                             {
@@ -242,9 +246,12 @@ namespace UAS_MES.Make
                             }
                             if (cdstepcode == "")
                             {
+                                //序号小于等于当前不良的序号
+                                string currentdetno = dh.getFieldDataByCondition("craft left join craftdetail on cr_id=cd_crid", "cd_detno", "cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and cd_stepcode='" + ms_stepcode + "'").ToString();
                                 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 + "' and nvl(cd_ifburnin,0)<>0 order by cd_detno");
+                                sql.Append("cr_code='" + cr_code.Text + "' and cr_prodcode='" + ms_prodcode.Text + "' and  ");
+                                sql.Append("nvl(cd_ifburnin,0)<>0 and cd_detno <='" + currentdetno + "'");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 if (dt.Rows.Count > 0)
                                 {