|
@@ -460,6 +460,13 @@ public class dispatchItems extends Controller {
|
|
|
Rows areaRows = dbConnect.runSqlQuery(areasqlFactory);
|
|
|
RowsMap areaRowsMap = areaRows.toRowsMap("sys_enterpriseid");
|
|
|
|
|
|
+ SQLFactory itemclasssqlFactory = new SQLFactory(this, "发货单明细关联商品营销类别查询");
|
|
|
+ itemclasssqlFactory.addParameter("siteid", siteid);
|
|
|
+ itemclasssqlFactory.addParameter_in("itemids", rows.toArrayList("itemid", new ArrayList<>()));
|
|
|
+ Rows itemclassRows = dbConnect.runSqlQuery(itemclasssqlFactory);
|
|
|
+ RowsMap itemclassRowsMap = itemclassRows.toRowsMap("itemid");
|
|
|
+
|
|
|
+
|
|
|
// SQLFactory itemsqlFactory = new SQLFactory(this, "发货单明细关联商品列表查询");
|
|
|
// itemsqlFactory.addParameter("siteid", siteid);
|
|
|
// itemsqlFactory.addParameter_in("itemids", rows.toArrayList("itemid", new ArrayList<>()));
|
|
@@ -512,6 +519,12 @@ public class dispatchItems extends Controller {
|
|
|
} else {
|
|
|
row.put("areaname", "");
|
|
|
}
|
|
|
+ if (itemclassRowsMap.containsKey(row.getString("itemid"))) {
|
|
|
+ row.put("itemclassname", itemclassRowsMap.get(row.getString("itemid")).get(0).getString("itemclassname"));
|
|
|
+ } else {
|
|
|
+ row.put("itemclassname", "");
|
|
|
+ }
|
|
|
+
|
|
|
if (!row.containsKey("delinvbalqty")) {
|
|
|
row.put("delinvbalqty", row.getBigDecimal("undeliqty").negate().doubleValue());
|
|
|
row.put("invbalqty", 0);
|
|
@@ -563,6 +576,7 @@ public class dispatchItems extends Controller {
|
|
|
"enterprisename", "sys_enterpriseid");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "plm_unit", "t11", "t11.unitid = t2.unitid and t11.siteid = t2.siteid",
|
|
|
"unitname");
|
|
|
+
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sa_accountclass", "t12", "t12.sa_accountclassid=t8.sa_accountclassid and t12.siteid=t8.siteid");
|
|
|
querySQL.addQueryFields("qty", "ifnull(t1.qty, 0)");
|
|
|
querySQL.addQueryFields("outwarehouseqty", "ifnull(t1.outwarehouseqty, 0)");
|