Browse Source

调整装中盒BUG

章政 7 years ago
parent
commit
48a311ac96
1 changed files with 7 additions and 3 deletions
  1. 7 3
      UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

+ 7 - 3
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -420,7 +420,8 @@ namespace UAS_LabelMachine
                         }
                     }
                 }
-                SingleReport.Load(SingleLabelCombox.Text);
+                if(!SingleLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                    SingleReport.Load(SingleLabelCombox.SelectedValue.ToString());
                 DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiosingleinfo_view where 主键ID in (" + pibid + ")", "select");
                 SingleReport.RegisterData(dt, "prodiosingleinfo_view");
                 SingleReport.GetDataSource("prodiosingleinfo_view").Enabled = true;
@@ -1579,15 +1580,18 @@ namespace UAS_LabelMachine
                     List<string> MidBoxCode = new List<string>();
                     List<string> PIBID = new List<string>();
                     List<string> PIBOUTBOXCODE1 = new List<string>();
-                    DataTable dt1 = (DataTable)dh.ExecuteSql("select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + dt.Rows[i]["pib_outboxcode2"].ToString() + "' and pib_outboxcode1 is null order by  to_number(pib_id)", "select");
+                    DataTable dt1 = (DataTable)dh.ExecuteSql("select pib_id,pib_prodcode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + dt.Rows[i]["pib_outboxcode2"].ToString() + "' and pib_outboxcode1 is null order by  to_number(pib_id)", "select");
                     //如果不是10的整数倍则为尾盒
+                    int tencount = 0;
                     for (int j = 0; j < dt1.Rows.Count; j++)
                     {
-                        if (j % 10 == 0)
+                        if (tencount % 10 == 0||(dt1.Rows[j]["pib_prodcode"].ToString()!=dt1.Rows[j-1]["pib_prodcode"].ToString()))
                         {
                             pib_outboxcode1 = pib_outboxcode1 + 1;
                             MaxNum = MaxNum + 1;
+                            tencount = 0;
                         }
+                        tencount = tencount + 1;
                         string serialcode = BaseUtil.DToAny(MaxNum, Radix);
                         for (int k = serialcode.ToString().Length; k < NumLength; k++)
                         {