|
|
@@ -300,7 +300,7 @@ namespace UAS_LabelMachine.PublicMethod
|
|
|
MidFormat.Print();
|
|
|
}
|
|
|
|
|
|
- public static void OutPrint(LabelFormatDocument OutFormat, DataTable OutLabelParam, string pi_inoutno, string pib_id, string pib_outboxcode2)
|
|
|
+ public static void OutPrint(LabelFormatDocument OutFormat, 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();
|
|
|
@@ -312,16 +312,38 @@ 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) + " limit 0,1", "select");
|
|
|
- if (dt.Rows.Count > 0)
|
|
|
+ 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");
|
|
|
+ for (int m = 0; m < dt.Rows.Count; m++)
|
|
|
{
|
|
|
for (int j = 0; j < OutFormat.SubStrings.Count; j++)
|
|
|
{
|
|
|
DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
|
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串" && dr1[0]["lp_sql"].ToString() != "")
|
|
|
{
|
|
|
- OutFormat.SubStrings[j].Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
+ OutFormat.SubStrings[j].Value = dt.Rows[m][dr1[0]["lp_sql"].ToString()].ToString();
|
|
|
}
|
|
|
//SQL判断多个值的时候
|
|
|
if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")
|