diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java index 10e9e3507..bce27b86d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/store/BuyGoodsLogic.java @@ -204,7 +204,13 @@ public class BuyGoodsLogic { int temptype = discountType[0]; int tempvalue = discountType[1]; if(temptype == 4&&tempvalue==5){ - rechargeInfo.removeTypeBagMap(tempvalue); + if (rechargeInfo.getTypeBagMap().containsKey(tempvalue)){ + rechargeInfo.removeTypeBagMap(tempvalue); + } + if (rechargeInfo.getCacheSendedTypes().containsKey(tempvalue)){ + rechargeInfo.getCacheSendedTypes().remove(temptype); + } + List goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size()); BuyGoodsLogic.getGoodsBagInfo(uid, goodsBagInfo,false); PlayerInfoProto.AllGiftGoodsIndication build = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo).build(); @@ -346,18 +352,18 @@ public class BuyGoodsLogic { } endTime = startTime + addtime * 3600 * 1000; - if (rechargeInfo.getCacheSendedTypes().containsKey(5)) { - long lasttime = rechargeInfo.getCacheSendedTypes().get(5); + if (rechargeInfo.getCacheSendedTypes().containsKey(value)) { + long lasttime = rechargeInfo.getCacheSendedTypes().get(value); if(lasttime != startTime){ needChange = true; int diffHourTemp = (int) ((now - lasttime) / 3600 / 1000); if (diffHourTemp < addtime) { startTime =0; } - rechargeInfo.getCacheSendedTypes().put(5, System.currentTimeMillis()); + rechargeInfo.getCacheSendedTypes().put(value, System.currentTimeMillis()); } }else { - rechargeInfo.getCacheSendedTypes().put(5, System.currentTimeMillis()); + rechargeInfo.getCacheSendedTypes().put(value, System.currentTimeMillis()); } }