Parcourir la source

erp商品档案同步时,若是单品信息变更则自动同步单品的商品组信息

hu il y a 2 mois
Parent
commit
6795618149
1 fichiers modifiés avec 11 ajouts et 0 suppressions
  1. 11 0
      src/custom/service/AutoDockItemService.java

+ 11 - 0
src/custom/service/AutoDockItemService.java

@@ -205,6 +205,17 @@ public class AutoDockItemService extends ServiceController {
                                 }
                             }
                         }
+
+                        if (itemRowsMapAll.get(jsonObject.getString("fitemno")).get(0).getLong("sa_customschemeid")==0) {
+                            Rows rows = dbConnect.runSqlQuery("SELECT sa_itemgroupid from sa_itemgroupmx WHERE itemid=" + itemid + " and siteid='" + siteid + "' ");
+                            ArrayList<Long> sa_itemgroupids = rows.toArrayList("sa_itemgroupid", new ArrayList<>());
+                            for (Long sa_itemgroupid : sa_itemgroupids) {
+                                int count = dbConnect.runSqlQuery(0, "SELECT count(0) count from sa_itemgroupmx WHERE sa_itemgroupid=" + sa_itemgroupid + " and siteid='" + siteid + "' ").getInteger("count");
+                                if (count == 1) {
+                                    sqlList.add("update sa_itemgroup set groupname='"+jsonObject.getString("fitemname")+"' where sa_itemgroupid=" + sa_itemgroupid + " and siteid='" + siteid + "' ");
+                                }
+                            }
+                        }
                         boolean iscustomsize = false;
                         if (spec.equals("custom") || cheek.equals("custom") || material.equals("custom") || color.equals("custom")) {
                             iscustomsize = true;