|
|
@@ -314,18 +314,20 @@ public class Item extends Controller {
|
|
|
if (content.containsKey("itemclassids")) {
|
|
|
JSONArray itemclassids = content.getJSONArray("itemclassids");
|
|
|
if (!itemclassids.isEmpty()) {
|
|
|
- if (itemclassids.size() > 1) {
|
|
|
- return getErrReturnObject().setErrMsg("商品只能维护一个营销类别").toString();
|
|
|
- }
|
|
|
+// if (itemclassids.size() > 1) {
|
|
|
+// return getErrReturnObject().setErrMsg("商品只能维护一个营销类别").toString();
|
|
|
+// }
|
|
|
sqlList.add("delete from sa_itemsaleclass where itemid =" + itemid + " and siteid='" + siteid + "'");
|
|
|
for (Object obj : itemclassids) {
|
|
|
- int itemclassid = (int) obj;
|
|
|
+ JSONObject itemclass = (JSONObject) obj;
|
|
|
sqlFactory = new SQLFactory(this, "商品营销类别新增");
|
|
|
sqlFactory.addParameter("sa_itemsaleclassid", createTableID("sa_itemsaleclass"));
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("itemid", itemid);
|
|
|
sqlFactory.addParameter("itemno", itemno);
|
|
|
- sqlFactory.addParameter("itemclassid", itemclassid);
|
|
|
+ sqlFactory.addParameter("classtype", itemclass.getStringValue("classtype"));
|
|
|
+
|
|
|
+ sqlFactory.addParameter("itemclassid", itemclass.getLongValue("itemclassid"));
|
|
|
sqlList.add(sqlFactory.getSQL());
|
|
|
}
|
|
|
}
|
|
|
@@ -363,7 +365,9 @@ public class Item extends Controller {
|
|
|
// 品牌
|
|
|
RowsMap brandRowsMap = Brand.getBrandRowsMap(this, itemids);
|
|
|
// 营销类别
|
|
|
- RowsMap itemClassRowsMap = ItemClass.getAllItemClassRowsMap(this, itemids);
|
|
|
+ RowsMap itemSaleClassRowsMap = ItemClass.getAllItemClassRowsMap_new(this, itemids).get("营销").toRowsMap("itemid");
|
|
|
+ // 存货类别
|
|
|
+ RowsMap itemClassRowsMap = ItemClass.getAllItemClassRowsMap_new(this, itemids).get("存货").toRowsMap("itemid");
|
|
|
// 附件
|
|
|
RowsMap attRowsMap = getAttachmentUrl("plm_item", itemids);
|
|
|
// 商品领域
|
|
|
@@ -417,6 +421,7 @@ public class Item extends Controller {
|
|
|
}
|
|
|
row.put("brand", brandRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
row.put("itemclass", itemClassRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
+ row.put("itemsaleclass", itemSaleClassRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
row.put("tradefield", tradefieldRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
if (siteParameterRows.isNotEmpty()) {
|
|
|
row.put("defaultlevelprice",siteParameterRows.get(0).getString("defaultlevelprice"));
|
|
|
@@ -580,7 +585,11 @@ public class Item extends Controller {
|
|
|
RowsMap tradefieldRowsMap = beans.Item.Item.getTradefieldRowsMap(this, ids);
|
|
|
// 商品品牌
|
|
|
RowsMap brandRowsMap = Brand.getBrandRowsMap(this, ids);
|
|
|
- RowsMap itemclassRowsMap = ItemClass.getAllItemClassRowsMap(this, ids);
|
|
|
+ // 营销类别
|
|
|
+ RowsMap itemSaleClassRowsMap = ItemClass.getAllItemClassRowsMap_new(this, ids).get("营销").toRowsMap("itemid");
|
|
|
+ // 存货类别
|
|
|
+ RowsMap itemclassRowsMap = ItemClass.getAllItemClassRowsMap_new(this, ids).get("存货").toRowsMap("itemid");
|
|
|
+// RowsMap itemclassRowsMap = ItemClass.getAllItemClassRowsMap(this, ids);
|
|
|
for (Row row : rows) {
|
|
|
if (attRowsMapCover.getOrDefault(row.getString("itemid"), new Rows()).isNotEmpty()) {
|
|
|
row.put("attinfos", attRowsMapCover.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
@@ -595,6 +604,9 @@ public class Item extends Controller {
|
|
|
|
|
|
String[] itemclass = itemclassRowsMap.getOrDefault(row.getString("itemid"), new Rows()).toArray("itemclassname");
|
|
|
row.put("itemclass", StringUtils.join(itemclass, ","));
|
|
|
+
|
|
|
+ String[] itemsaleclass = itemSaleClassRowsMap.getOrDefault(row.getString("itemid"), new Rows()).toArray("itemclassname");
|
|
|
+ row.put("itemsaleclass", StringUtils.join(itemsaleclass, ","));
|
|
|
}
|
|
|
|
|
|
|