|
|
@@ -565,6 +565,9 @@ public class Item extends Controller {
|
|
|
Rows itemRows = dbConnect.runSqlQuery("select itemid,itemno,itemname,sa_customschemeid,isonsale from plm_item where siteid='" + siteid + "'");
|
|
|
RowsMap itemRowsMap = itemRows.toRowsMap("itemid");
|
|
|
|
|
|
+ Rows itemclassRows = dbConnect.runSqlQuery("select itemid,itemclassid from sa_itemsaleclass where siteid='" + siteid + "'");
|
|
|
+ RowsMap itemclassRowsMap = itemclassRows.toRowsMap("itemid");
|
|
|
+
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
|
for (Object obj : jsonArray) {
|
|
|
int id = (int) obj;
|
|
|
@@ -573,6 +576,19 @@ public class Item extends Controller {
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("username", username);
|
|
|
sqlFactory.addParameter("status", status.equals("0") ? "新建" : "审核");
|
|
|
+
|
|
|
+ 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("itemclassname")+"' where siteid='"+siteid+"' and itemid="+id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (status.equals("0")) {
|
|
|
if (itemRowsMap.containsKey(String.valueOf(id))) {
|
|
|
if (!itemRowsMap.get(String.valueOf(id)).isEmpty()) {
|