diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/bt/GmBuyGoodHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/bt/GmBuyGoodHandler.java index 5c62b0bfd..5bdf04584 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/bt/GmBuyGoodHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/bt/GmBuyGoodHandler.java @@ -7,7 +7,6 @@ import com.ljsd.jieling.handler.BaseHandler; import com.ljsd.jieling.logic.dao.UserManager; import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.store.BuyGoodsNewLogic; -import com.ljsd.jieling.logic.store.newRechargeInfo.bean.AbstractWelfareBag; import com.ljsd.jieling.logic.store.newRechargeInfo.rechargeHandler.RechargeHandler; import com.ljsd.jieling.network.session.ISession; import com.ljsd.jieling.util.ItemUtil; @@ -46,7 +45,7 @@ public class GmBuyGoodHandler extends BaseHandler config = STableManager.getConfig(SGMMaster.class); + Map config = SGMMaster.getMap(); SGMMaster master = config.get(id); if (master == null){ return false; @@ -96,11 +95,8 @@ public class GmBuyGoodHandler extends BaseHandler> typeMap = new HashMap<>(); - + + private static Map map = new HashMap<>(); + @Override public void init() throws Exception { Map config = STableManager.getConfig(SGMMaster.class); - Map> map = new HashMap<>(); + Map> map1 = new HashMap<>(); + Map map2 = new HashMap<>(); for (SGMMaster master : config.values()) { - List list = map.get(master.getType()); + List list = map1.get(master.getType()); if (list == null){ List masters = config.values().stream().filter(v -> v.getType() == master.getType()).collect(Collectors.toList()); - map.put(master.getType(), masters); + map1.put(master.getType(), masters); } + + map2.put(master.getPackID(), master); } typeMap.clear(); - typeMap = map; + typeMap = map1; + map.clear(); + map = map2; } public static Map> getTypeMap() { return typeMap; } + public static Map getMap() { + return map; + } + public int getId() { return id; }