Browse Source

导入的时候按照DC排序

章政 6 years ago
parent
commit
92d4335dcc

+ 2 - 1
UAS-出货标签管理(贸易版)/PublicMethod/LogicHandler.cs

@@ -138,7 +138,6 @@ namespace UAS_LabelMachine.PublicMethod
             sql.Append("insert into prodiobarcode (pib_id,pib_piid,pib_inoutno,pib_pdno,pib_custbarcode,pib_gk,pib_weigh,pib_qty,pib_outboxcode1,pib_prodcode) values(prodiobarcode_seq.nextval,'" + iPiID + "',");
             sql.Append("'" + iInOutNo + "',:pib_pdno,:pib_lotno,:pib_gk,:pib_weiht,:pib_qty,:pib_outboxcode1,'" + prcode + "')");
             dh.BatchInsert(sql.ToString(), new string[] { "pib_pdno", "pib_lotno", "pib_gk", "pib_weiht", "pib_qty", "pib_outboxcode1" }, detno.ToArray(), batch.ToArray(), gk.ToArray(), weigh.ToArray(), qty.ToArray(), outboxcode1.ToArray());
-
         }
 
         //海创的导入方法
@@ -196,6 +195,8 @@ namespace UAS_LabelMachine.PublicMethod
                 //累计Excel该型号的数量
                 sumqty[pr_spec] += decimal.Parse(qty);
             }
+            dt.DefaultView.Sort = "箱号,DC ";
+            dt = dt.DefaultView.ToTable();
             for (int i = 0; i < dt1.Rows.Count; i++)
             {
                 //不包含型号则进行添加

+ 14 - 13
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -1591,11 +1591,12 @@ namespace UAS_LabelMachine
                         }
                     }
                 }
-                //Print.BarTender.OutPrint(OutFormat, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked, cu_print_ordercode.Checked);
-                //if (LabelSpace.Checked)
-                //{
-                //    Print.BarTender.OutPrint(EmptyOutFormat, OutLabelParam, pi_inoutno.Text, pib_id, "-1", cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked, cu_print_ordercode.Checked);
-                //}
+                LoadGridData(true);
+                Print.BarTender.OutPrint(OutFormat, OutLabelParam, pi_inoutno.Text, pib_id, pib_outboxcode2, cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked, cu_print_ordercode.Checked);
+                if (LabelSpace.Checked)
+                {
+                    Print.BarTender.OutPrint(EmptyOutFormat, OutLabelParam, pi_inoutno.Text, pib_id, "-1", cu_print_outprod.Checked, cu_print_outpo.Checked, cu_print_outdc.Checked, cu_print_outlotno.Checked, cu_print_ordercode.Checked);
+                }
             }
         }
 
@@ -1677,9 +1678,9 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void LoadGridData()
+        private void LoadGridData(bool AllCollect)
         {
-            LoadGridData(new object(), new EventArgs());
+            LoadGridData(AllCollect, new EventArgs());
         }
         DataTable LabelInfDataTable;
         /// <summary>
@@ -1689,10 +1690,10 @@ namespace UAS_LabelMachine
         /// <param name="e"></param>
         private void LoadGridData(object sender, EventArgs e)
         {
-            AllCollect = false;
+            AllCollect = sender.Equals(true);
             //查询Oracle数据库
             sql.Clear();
-            sql.Append("select t.*,rownum from prodiobarcode_view t where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_id)");
+            sql.Append("select t.*,rownum from prodiobarcode_view t where pib_inoutno='" + pi_inoutno.Text + "' ");
             LabelInfDataTable = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             //查询本地数据库
             sql.Clear();
@@ -1729,7 +1730,7 @@ namespace UAS_LabelMachine
                 sdh.BatchInsert("prodiobarcode", LabelInfDataTable);
             }
             sql.Clear();
-            sql.Append("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by pib_id ");
+            sql.Append("select * from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by pib_id");
             LabelInfDataTable = (DataTable)sdh.ExecuteSql(sql.ToString(), "select");
             bindingsource(LabelInf, LabelInfDataTable);
             //有数据的话默认取第一条的品牌去取采集策略
@@ -2611,7 +2612,7 @@ namespace UAS_LabelMachine
             {
                 GetCustRule();
                 LogicHandler.ImportExcel(SystemInf.Master, ImportExcel.FileName, PI_ID, pi_inoutno.Text, cu_code.Text);
-                LoadGridData();
+                LoadGridData(false);
             }
             catch (Exception ex)
             {
@@ -2665,7 +2666,7 @@ namespace UAS_LabelMachine
                 sql += " limit 0," + nums + ")";
             }
             sdh.ExecuteSql(sql, "update");
-            LoadGridData();
+            LoadGridData(false);
             setvalue.FindForm().Close();
         }
 
@@ -2725,7 +2726,7 @@ namespace UAS_LabelMachine
             string SQL = "";
             LogicHandler.CustBarCode(pi_inoutno.Text, out SQL);
             sdh.ExecuteSql(SQL, "update");
-            LoadGridData();
+            LoadGridData(false);
         }
 
         private void GetMidBoxCode_Click(object sender, EventArgs e)