Browse Source

手动复核模式扫描两次数据

章政 6 years ago
parent
commit
936fb4b1c3
1 changed files with 23 additions and 9 deletions
  1. 23 9
      UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

+ 23 - 9
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -492,6 +492,7 @@ namespace UAS_LabelMachine
                             }
                         }
                     }
+                    //如果品牌不对应的话则不能使用本次的匹配规则
                     if (ErrorMsg == "" && ItemStr.Contains("QTY") && LabelInf.Rows[CurrentRowIndex].Cells["pib_qty"].Value.ToString() != QTY.ToString())
                     {
                         ErrorMsg = "数量不匹配";
@@ -500,10 +501,13 @@ namespace UAS_LabelMachine
                     {
                         ErrorMsg = "订单号不匹配";
                     }
-                    //如果品牌不对应的话则不能使用本次的匹配规则
-                    if (LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"].Value.ToString() == sg_brand && rownum != 0)
+                    if (LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"].Value.ToString() != sg_brand)
                     {
                         ErrorMsg = "";
+                        continue;
+                    }
+                    else
+                    {
                         break;
                     }
                 }
@@ -755,17 +759,17 @@ namespace UAS_LabelMachine
                         CheckItem.Add("唯一条码");
                         CheckItem.Add("原厂型号");
                     }
-                    if (RegexMatch("BackCheck", msgArr[i], out ErrorMsg))
+                    pibid = back_adh.getFieldDataByCondition("prodiobarcode", "min(pib_id)", "pib_inoutno='" + pi_inoutno.Text + "' and pib_custbarcode='" + msgArr[i] + "' and pib_ifrecheck=0").ToString();
+                    if (pibid != "")
                     {
-                        CheckItem.Remove("原厂型号");
+                        pibid1 = pibid;
+                        CheckItem.Remove("唯一条码");
                     }
                     else
                     {
-                        pibid = back_adh.getFieldDataByCondition("prodiobarcode", "min(pib_id)", "pib_inoutno='" + pi_inoutno.Text + "' and pib_custbarcode='" + msgArr[i] + "' and pib_ifrecheck=0").ToString();
-                        if (pibid != "")
+                        if (RegexMatch("BackCheck", msgArr[i], out ErrorMsg))
                         {
-                            pibid1 = pibid;
-                            CheckItem.Remove("唯一条码");
+                            CheckItem.Remove("原厂型号");
                         }
                     }
                 }
@@ -797,7 +801,16 @@ namespace UAS_LabelMachine
                 {
                     Item += CheckItem[i].ToString() + " ";
                 }
-                ErrorMsg = Item + "复核不通过";
+                //如果通过正则校验,则不需要传递出来的错误信息了
+                if (!CheckItem.Contains("原厂型号"))
+                {
+                    ErrorMsg = "";
+                }
+                else
+                {
+                    ErrorMsg = "【" + ErrorMsg + "】";
+                }
+                ErrorMsg += Item + "复核不通过";
                 return false;
             }
             if (CheckItem.Count == 0 || (ManualCheckCount.Count == 1 && CheckItem.Count == 1))
@@ -1655,6 +1668,7 @@ namespace UAS_LabelMachine
         /// <param name="e"></param>
         private void LoadGridData(object sender, EventArgs e)
         {
+            ManualCheckCount.Clear();
             sql.Clear();
             sql.Append("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum ");
             sql.Append("between " + ((CurrentPage - 1) * PageSize + 1) + " and  " + CurrentPage * PageSize + " ");