|
@@ -1,6 +1,7 @@
|
|
|
package restcontroller.webmanage.sale.u8;
|
|
package restcontroller.webmanage.sale.u8;
|
|
|
|
|
|
|
|
import beans.data.BatchDeleteErr;
|
|
import beans.data.BatchDeleteErr;
|
|
|
|
|
+import beans.itemclass.ItemClass;
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import common.Controller;
|
|
import common.Controller;
|
|
@@ -8,9 +9,8 @@ import common.YosException;
|
|
|
import common.annotation.API;
|
|
import common.annotation.API;
|
|
|
import common.annotation.CACHEING;
|
|
import common.annotation.CACHEING;
|
|
|
import common.annotation.CACHEING_CLEAN;
|
|
import common.annotation.CACHEING_CLEAN;
|
|
|
-import common.data.QuerySQL;
|
|
|
|
|
-import common.data.Rows;
|
|
|
|
|
-import common.data.SQLFactory;
|
|
|
|
|
|
|
+import common.data.*;
|
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import restcontroller.R;
|
|
import restcontroller.R;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -39,6 +39,7 @@ public class u8itemprice extends Controller {
|
|
|
}
|
|
}
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "u8itemprice","*");
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "u8itemprice","*");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "plm_item", "t2", "t1.siteid = t2.siteid and t1.itemid = t2.itemid","itemno","itemname","spec","model");
|
|
querySQL.addJoinTable(JOINTYPE.left, "plm_item", "t2", "t1.siteid = t2.siteid and t1.itemid = t2.itemid","itemno","itemname","spec","model");
|
|
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "st_stock", "t3", "t1.siteid = t3.siteid and t1.stockid = t3.stockid","stockno");
|
|
|
querySQL.setTableAlias("t1");
|
|
querySQL.setTableAlias("t1");
|
|
|
querySQL.setWhere("t1.siteid", siteid);
|
|
querySQL.setWhere("t1.siteid", siteid);
|
|
|
querySQL.setWhere("t1.u8id", u8id);
|
|
querySQL.setWhere("t1.u8id", u8id);
|
|
@@ -46,6 +47,18 @@ public class u8itemprice extends Controller {
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
Rows rows = querySQL.query();
|
|
Rows rows = querySQL.query();
|
|
|
|
|
|
|
|
|
|
+ ArrayList<Long> ids = rows.toArrayList("itemid", new ArrayList<>());
|
|
|
|
|
+ // 存货类别
|
|
|
|
|
+ RowsMap itemclassRowsMap = ItemClass.getAllItemUpperClassRowsMap_new(this, ids).get("存货").toRowsMap("itemid");
|
|
|
|
|
+ for (Row row : rows) {
|
|
|
|
|
+ String[] itemclass = itemclassRowsMap.getOrDefault(row.getString("itemid"), new Rows()).toArray("itemclassname");
|
|
|
|
|
+ row.put("itemclass", StringUtils.join(itemclass, ","));
|
|
|
|
|
+
|
|
|
|
|
+ String[] itemclassnum = itemclassRowsMap.getOrDefault(row.getString("itemid"), new Rows()).toArray("itemclassnum");
|
|
|
|
|
+ row.put("itemclassnum", StringUtils.join(itemclassnum, ","));
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
}
|
|
|
|
|
|