|
|
@@ -109,7 +109,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
MidDoc.PrintDocument();
|
|
|
}
|
|
|
|
|
|
- public static void OutPrint(Document OutBoxDoc, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2)
|
|
|
+ public static void OutPrint(Document OutBoxDoc, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2, bool iCustProdCode, bool iCustPo, bool iDC, bool iLotNo)
|
|
|
{
|
|
|
StringBuilder sql = new StringBuilder();
|
|
|
sql.Clear();
|
|
|
@@ -121,8 +121,30 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
sql.Append(dr1[0]["lp_sql"].ToString() + ",");
|
|
|
}
|
|
|
}
|
|
|
+ //界面设定的分组条件
|
|
|
+ string GroupByCondition = "";
|
|
|
+ if (iCustProdCode)
|
|
|
+ {
|
|
|
+ GroupByCondition += "pd_custprodcode,";
|
|
|
+ }
|
|
|
+ if (iCustPo)
|
|
|
+ {
|
|
|
+ GroupByCondition += "pd_pocode,";
|
|
|
+ }
|
|
|
+ if (iDC)
|
|
|
+ {
|
|
|
+ GroupByCondition += "pib_datecode,";
|
|
|
+ }
|
|
|
+ if (iLotNo)
|
|
|
+ {
|
|
|
+ GroupByCondition += "pib_lotno,";
|
|
|
+ }
|
|
|
+ if (iCustProdCode || iCustPo || iDC || iLotNo)
|
|
|
+ {
|
|
|
+ GroupByCondition = " group by " + (GroupByCondition.Substring(0, GroupByCondition.Length - 1));
|
|
|
+ }
|
|
|
sql.Append("1,");
|
|
|
- DataTable dt = (DataTable)SystemInf.sdh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno + "' and pib_outboxcode2=" + (pib_outboxcode2 == "" ? "0" : pib_outboxcode2), "select");
|
|
|
+ DataTable dt = (DataTable)SystemInf.sdh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno + "' and pib_outboxcode2=" + (pib_outboxcode2 == "" ? "0" : pib_outboxcode2) + GroupByCondition, "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
|