Explorar o código

优化不良状态不允许抽检

callm hai 1 día
pai
achega
ac74f3a4da

+ 6 - 1
UAS_MES_YDCY/FunctionCode/Special/Special_NeedCheck.cs

@@ -45,7 +45,7 @@ namespace UAS_MES_NEW.Special
         {
             if (ms_id == "") { OperateResult.AppendText(">>请先获取SN\n"); return; }
             if (cd_stepcode.Text == "") { OperateResult.AppendText(">>请选择回流工序\n"); return; }
-            DataTable dt = (DataTable)dh.ExecuteSql("select ms_makecode,nvl(ms_qctest,0)ms_qctest,ms_firstsn,ms_sncode,ms_prodcode,ms_checkno,ms_craftcode,ms_outboxcode from makeserial where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select ms_makecode,nvl(ms_qctest,0)ms_qctest,ms_status,ms_firstsn,ms_sncode,ms_prodcode,ms_checkno,ms_craftcode,ms_outboxcode from makeserial where ms_id='" + ms_id + "' and instr(ms_paststep,'" + cd_stepcode.Text + "')>0 ", "select");
             string ms_qctest = dt.Rows[0]["ms_qctest"].ToString();
             if (ms_qctest != "1") { OperateResult.AppendText(">>" + SN.Text + "未抽检或者不需要回流,不允许回流\n", System.Drawing.Color.Red, SN); return; }
 
@@ -57,10 +57,15 @@ namespace UAS_MES_NEW.Special
             string ms_sncode = dt.Rows[0]["ms_sncode"].ToString();
             string ms_craftcode = dt.Rows[0]["ms_craftcode"].ToString();
             string ms_outboxcode = dt.Rows[0]["ms_outboxcode"].ToString();
+            string ms_status = dt.Rows[0]["ms_status"].ToString();
             if (ms_outboxcode != "")
             {
                 OperateResult.AppendText(">>序列号已经装箱" + ms_outboxcode + "\n"); return;
             }
+            if (ms_status == "3")
+            {
+                OperateResult.AppendText(">>序列号处于不良待维修状态,不允许回流\n"); return;
+            }
             if (cr_code.Text != "" && cr_code.Text != ms_craftcode) { OperateResult.AppendText(">>序列号途程和所选途程不一致\n"); return; }
 
             dt = (DataTable)dh.ExecuteSql("select cd_id from craft left join craftdetail on cr_id=cd_crid where cr_prodcode='" + ms_prodcode + "' and cr_code='" + ms_craftcode + "' and cd_stepcode='" + cd_stepcode.Text + "'", "select");

+ 7 - 1
UAS_MES_YDCY/FunctionCode/Special/Special_QCCheck.cs

@@ -95,7 +95,7 @@ namespace UAS_MES_NEW.Special
         {
             if (e.KeyCode == Keys.Enter)
             {
-                DataTable dt = (DataTable)dh.ExecuteSql("select ms_ifqccheck,ms_sncode,ms_makecode,ms_outboxcode,ms_id,ma_prodcode,pr_detail from makeserial left join make on ms_makecode=ma_code left join product on pr_code=ma_prodcode where ms_sncode='" + SN.Text + "' or  ms_imei1='" + SN.Text + "' or ms_imei2='" + SN.Text + "' order by ms_id desc", "select");
+                DataTable dt = (DataTable)dh.ExecuteSql("select ms_ifqccheck,ms_sncode,ms_status,ms_makecode,ms_outboxcode,ms_id,ma_prodcode,pr_detail from makeserial left join make on ms_makecode=ma_code left join product on pr_code=ma_prodcode where ms_sncode='" + SN.Text + "' or  ms_imei1='" + SN.Text + "' or ms_imei2='" + SN.Text + "' order by ms_id desc", "select");
                 if (dt.Rows.Count == 0)
                 {
                     OperateResult.AppendText("序列号" + SN.Text + "不存在", System.Drawing.Color.Red);
@@ -105,6 +105,7 @@ namespace UAS_MES_NEW.Special
                 string ms_id = dt.Rows[0]["ms_id"].ToString();
                 string ms_outboxcode = dt.Rows[0]["ms_outboxcode"].ToString();
                 string ms_ifqccheck = dt.Rows[0]["ms_ifqccheck"].ToString();
+                string ms_status = dt.Rows[0]["ms_status"].ToString();
                 if (ms_outboxcode != "")
                 {
                     OperateResult.AppendText("序列号已装箱" + ms_outboxcode + ",不允许抽检", System.Drawing.Color.Red);
@@ -115,6 +116,11 @@ namespace UAS_MES_NEW.Special
                     OperateResult.AppendText("序列号处于抽检状态,不允许抽检", System.Drawing.Color.Red);
                     return;
                 }
+                if (ms_status == "3")
+                {
+                    OperateResult.AppendText("序列号处于不良状态,不允许抽检", System.Drawing.Color.Red);
+                    return;
+                }
                 SN.Text = dt.Rows[0]["ms_sncode"].ToString();
                 LoadBadCodeListView();
                 if (OK.Checked)