|
|
@@ -24,6 +24,7 @@ import restcontroller.webmanage.sale.itemgroup.itemgroup;
|
|
|
import utility.ERPDocking;
|
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
@@ -327,8 +328,9 @@ public class Item extends Controller {
|
|
|
|
|
|
@API(title = "货品档案列表", apiversion = R.ID20220923140602.v1.class)
|
|
|
@CACHEING
|
|
|
- public String queryList() throws YosException {
|
|
|
+ public String queryList() throws YosException, IOException {
|
|
|
StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
+ boolean isExport = content.getBooleanValue("isExport");
|
|
|
if (content.containsKey("where")) {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
|
if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
@@ -396,7 +398,9 @@ public class Item extends Controller {
|
|
|
// Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
QuerySQL querySQL = queryList(where.toString());
|
|
|
querySQL.setOrderBy(pageSorting);
|
|
|
- querySQL.setPage(pageSize, pageNumber);
|
|
|
+ if (!isExport) {
|
|
|
+ querySQL.setPage(pageSize, pageNumber);
|
|
|
+ }
|
|
|
Rows rows = querySQL.query();
|
|
|
// 默认商品图片
|
|
|
Rows defaultImageRows = getAttachmentUrl("system", (long) 1, "defaultImage");
|
|
|
@@ -419,9 +423,82 @@ public class Item extends Controller {
|
|
|
row.put("itemclass", itemclassRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ if (isExport) {
|
|
|
+ //去除不需要导出项
|
|
|
+ rows.getFieldList().remove("itemid");
|
|
|
+ rows.getFieldList().remove("marketprice");
|
|
|
+ rows.getFieldList().remove("unitid");
|
|
|
+ rows.getFieldList().remove("createdate");
|
|
|
+ rows.getFieldList().remove("barcode");
|
|
|
+ rows.getFieldList().remove("skucontrol");
|
|
|
+ rows.getFieldList().remove("batchcontrol");
|
|
|
+ rows.getFieldList().remove("grossweight");
|
|
|
+ rows.getFieldList().remove("weight");
|
|
|
+ rows.getFieldList().remove("height");
|
|
|
+ rows.getFieldList().remove("width");
|
|
|
+ rows.getFieldList().remove("length");
|
|
|
+ rows.getFieldList().remove("delivery");
|
|
|
+ rows.getFieldList().remove("istool");
|
|
|
+ rows.getFieldList().remove("volume");
|
|
|
+ rows.getFieldList().remove("marketingcategory");
|
|
|
+ rows.getFieldList().remove("ismodule");
|
|
|
+ rows.getFieldList().remove("cheek");
|
|
|
+ rows.getFieldList().remove("material");
|
|
|
+ rows.getFieldList().remove("iswoodproducts");
|
|
|
+ rows.getFieldList().remove("financeclasstype");
|
|
|
+ rows.getFieldList().remove("delistingstatus");
|
|
|
+ rows.getFieldList().remove("stockno");
|
|
|
+ rows.getFieldList().remove("widthschemeid");
|
|
|
+ rows.getFieldList().remove("lengthschemeid");
|
|
|
+ rows.getFieldList().remove("iscustomsize");
|
|
|
+ rows.getFieldList().remove("customprice");
|
|
|
+ rows.getFieldList().remove("auxunitid");
|
|
|
+ rows.getFieldList().remove("unitgroupname");
|
|
|
+ rows.getFieldList().remove("axunitname");
|
|
|
+ rows.getFieldList().remove("caliber");
|
|
|
+ rows.getFieldList().remove("pressure");
|
|
|
+ rows.getFieldList().remove("butterflyplatedrive");
|
|
|
+ rows.getFieldList().remove("valveplatematerial");
|
|
|
+ rows.getFieldList().remove("bodymaterial");
|
|
|
+ rows.getFieldList().remove("actuatortype");
|
|
|
+ rows.getFieldList().remove("actuatorbrand");
|
|
|
+ rows.getFieldList().remove("isbutterfly");
|
|
|
+ rows.getFieldList().remove("erpitemno");
|
|
|
+ rows.getFieldList().remove("erpitemname");
|
|
|
+ rows.getFieldList().remove("specalnote");
|
|
|
+ rows.getFieldList().remove("prodline");
|
|
|
+ rows.getFieldList().remove("device");
|
|
|
+ rows.getFieldList().remove("widthschemename");
|
|
|
+ rows.getFieldList().remove("lengthschemename");
|
|
|
+ rows.getFieldList().remove("brand");
|
|
|
+
|
|
|
+ Rows uploadRows = uploadExcelToObs("item", "商品列表", rows, getTitleMap());
|
|
|
+ return getSucReturnObject().setData(uploadRows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
+ //返回导出的标题
|
|
|
+ public HashMap<String, String> getTitleMap() {
|
|
|
+ HashMap<String, String> titleMap = new HashMap<>();
|
|
|
+ titleMap.put("itemno", "产品编号");
|
|
|
+ titleMap.put("itemname", "产品名称");
|
|
|
+ titleMap.put("isonsale", "上/下架");
|
|
|
+ titleMap.put("tradefield", "领域");
|
|
|
+ titleMap.put("packageqty", "包装数量");
|
|
|
+ titleMap.put("itemclass", "营销类别");
|
|
|
+ titleMap.put("unitname", "单位");
|
|
|
+ titleMap.put("orderminqty", "起订量");
|
|
|
+ titleMap.put("orderaddqty", "增量");
|
|
|
+ titleMap.put("model", "型号");
|
|
|
+ titleMap.put("spec", "规格");
|
|
|
+ titleMap.put("color", "颜色");
|
|
|
+
|
|
|
+ return titleMap;
|
|
|
+ }
|
|
|
+
|
|
|
public QuerySQL queryList(String where) throws YosException {
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "plm_item");
|
|
|
querySQL.setTableAlias("t1");
|