|
|
@@ -235,8 +235,24 @@ public class Item extends Controller {
|
|
|
sqlFactory.addParameter("outplace", content.getStringValue("outplace"));
|
|
|
sqlFactory.addParameter("repairattribute", content.getStringValue("repairattribute"));
|
|
|
sqlFactory.addParameter("shapesize", content.getStringValue("shapesize"));
|
|
|
- sqlFactory.addParameter("topclassnum", content.getStringValue("topclassnum"));
|
|
|
|
|
|
+ String topclassnum="";
|
|
|
+ if (content.containsKey("itemclassids")) {
|
|
|
+ JSONArray itemclassids = content.getJSONArray("itemclassids");
|
|
|
+ for (Object obj : itemclassids) {
|
|
|
+ JSONObject itemclass = (JSONObject) obj;
|
|
|
+ if(itemclass.getStringValue("classtype").equals("存货")){
|
|
|
+ SQLFactory sqlFactory1 = new SQLFactory(this, "获取最上级营销类别名称");
|
|
|
+ sqlFactory1.addParameter_in("itemclassid", itemclass.getLongValue("itemclassid"));
|
|
|
+ sqlFactory1.addParameter("siteid", siteid);
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sqlFactory1.getSQL());
|
|
|
+ if (rows.isNotEmpty()) {
|
|
|
+ topclassnum=rows.get(0).getString("itemclassname");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter("topclassnum", topclassnum);
|
|
|
|
|
|
sqlList.add(sqlFactory.getSQL());
|
|
|
// 货品档案扩展属性字段表
|
|
|
@@ -326,8 +342,8 @@ public class Item extends Controller {
|
|
|
sqlFactory.addParameter("itemid", itemid);
|
|
|
sqlFactory.addParameter("itemno", itemno);
|
|
|
sqlFactory.addParameter("classtype", itemclass.getStringValue("classtype"));
|
|
|
-
|
|
|
sqlFactory.addParameter("itemclassid", itemclass.getLongValue("itemclassid"));
|
|
|
+
|
|
|
sqlList.add(sqlFactory.getSQL());
|
|
|
}
|
|
|
}
|
|
|
@@ -651,8 +667,8 @@ public class Item extends Controller {
|
|
|
querySQL.addQueryFields("price4", "t12.price ");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sa_itemprice", "t13", "t13.itemid = t1.itemid AND t13.siteid = t1.siteid and t13.pricegrade=5");
|
|
|
querySQL.addQueryFields("price5", "t13.price ");
|
|
|
- querySQL.addJoinTable(JOINTYPE.left, "plm_itemclass", "t14", "t14.itemclassid = t1.marketingcategory AND t14.siteid = t1.siteid",
|
|
|
- "itemclassname");
|
|
|
+// querySQL.addJoinTable(JOINTYPE.left, "plm_itemclass", "t14", "t14.itemclassid = t1.marketingcategory AND t14.siteid = t1.siteid",
|
|
|
+// "itemclassname");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sys_department", "t16", "t16.departmentid = t1.departmentid AND t16.siteid = t1.siteid",
|
|
|
"depno","depname");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "st_stock", "t17", "t17.stockno = t1.stockno AND t17.siteid = t1.siteid",
|
|
|
@@ -836,17 +852,17 @@ public class Item extends Controller {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if (itemclassRowsMap.containsKey(String.valueOf(id))) {
|
|
|
- if (itemclassRowsMap.get(String.valueOf(id)).isNotEmpty()) {
|
|
|
- SQLFactory sqlFactory1 = new SQLFactory(this, "获取最上级营销类别名称");
|
|
|
- sqlFactory1.addParameter_in("itemclassid", itemclassRowsMap.get(String.valueOf(id)).get(0).getLong("itemclassid"));
|
|
|
- sqlFactory1.addParameter("siteid", siteid);
|
|
|
- Rows rows = dbConnect.runSqlQuery(sqlFactory1.getSQL());
|
|
|
- if (rows.isNotEmpty()) {
|
|
|
- sqlList.add("update plm_item set marketingcategory='" + rows.get(0).getString("itemclassid") + "' where siteid='" + siteid + "' and itemid=" + id);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// if (itemclassRowsMap.containsKey(String.valueOf(id))) {
|
|
|
+// if (itemclassRowsMap.get(String.valueOf(id)).isNotEmpty()) {
|
|
|
+// SQLFactory sqlFactory1 = new SQLFactory(this, "获取最上级营销类别名称");
|
|
|
+// sqlFactory1.addParameter_in("itemclassid", itemclassRowsMap.get(String.valueOf(id)).get(0).getLong("itemclassid"));
|
|
|
+// sqlFactory1.addParameter("siteid", siteid);
|
|
|
+// Rows rows = dbConnect.runSqlQuery(sqlFactory1.getSQL());
|
|
|
+// if (rows.isNotEmpty()) {
|
|
|
+// sqlList.add("update plm_item set marketingcategory='" + rows.get(0).getString("itemclassid") + "' where siteid='" + siteid + "' and itemid=" + id);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
if (status.equals("0")) {
|