Browse Source

添加外箱合并规则

章政 7 years ago
parent
commit
fdabfa3bc5
1 changed files with 33 additions and 5 deletions
  1. 33 5
      UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

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

@@ -368,16 +368,14 @@ namespace UAS_LabelMachine
             int outboxcode1 = int.Parse(boxcode == "" ? "1" : boxcode);
             boxcode = adh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode2)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
             int outboxcode2 = int.Parse(boxcode == "" ? "1" : boxcode);
+            //超过中盒容量中盒号+1
             if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
             {
                 outboxcode1 = outboxcode1 + 1;
             }
-            if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
-            {
-                outboxcode2 = outboxcode2 + 1;
-            }
             else if (CurrentRowIndex - 1 >= 0)
             {
+                //或者不符合合并条件中盒号+1
                 if (cu_print_midlotno.Checked)
                 {
                     if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
@@ -399,6 +397,36 @@ namespace UAS_LabelMachine
                         outboxcode1 = outboxcode1 + 1;
                 }
             }
+            if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + outboxcode2) >= OutBoxCapacity.Value)
+            {
+                outboxcode2 = outboxcode2 + 1;
+            }
+            else if (CurrentRowIndex - 1 >= 0)
+            {
+                //if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_outboxcode1"].Value.ToString() != outboxcode1.ToString())
+                //    outboxcode2 = outboxcode2 + 1;
+                //或者不符合合并条件中盒号+1
+                if (cu_print_outlotno.Checked)
+                {
+                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_lotno"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString())
+                        outboxcode2 = outboxcode2 + 1;
+                }
+                else if (cu_print_outpo.Checked)
+                {
+                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_pocode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_pocode"].Value.ToString())
+                        outboxcode2 = outboxcode2 + 1;
+                }
+                else if (cu_print_outprod.Checked)
+                {
+                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodcode"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodcode"].Value.ToString())
+                        outboxcode2 = outboxcode2 + 1;
+                }
+                else if (cu_print_outspec.Checked)
+                {
+                    if (LabelInf.Rows[CurrentRowIndex - 1].Cells["pd_custprodspec"].Value.ToString() != LabelInf.Rows[CurrentRowIndex].Cells["pd_custprodspec"].Value.ToString())
+                        outboxcode2 = outboxcode2 + 1;
+                }
+            }
             LabelInfDataTable.Rows[CurrentRowIndex]["pib_outboxcode1"] = outboxcode1;
             LabelInfDataTable.Rows[CurrentRowIndex]["pib_outboxcode2"] = outboxcode2;
             adh.ExecuteSql("update prodiobarcode set pib_outboxcode2=" + outboxcode2 + ",pib_outboxcode1=" + outboxcode1 + ",pib_lotno='" + LotNo + "',pib_datecode='" + DateCode + "',pib_ifpick=-1 where pib_id=" + pib_id, "update");
@@ -1201,7 +1229,7 @@ namespace UAS_LabelMachine
                 Process_midboxcode.Text = midboxcode;
                 Process_outboxcode.Text = outboxcode;
                 //设置当前总数和已采集数量
-                CollectedCount.Text = Count + "/" + PageNum.Text.Replace("总数","");
+                CollectedCount.Text = Count + "/" + PageNum.Text.Replace("总数", "");
             }
         }