diff --git a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_changename.java b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_changename.java index 02d60de2b..ed1d423c3 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_changename.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/kefu/Cmd_changename.java @@ -85,118 +85,7 @@ public class Cmd_changename extends GmRoleAbstract { } } if("recharge".equals(args[2])){ - Gson gson = new Gson(); - Map rechargeInfoMap = new HashMap<>(); - - Map realBuyGoodsTimes = new HashMap<>(); - Map hotGoods = new HashMap<>(); - rechargeInfoMap= gson.fromJson(args[3],rechargeInfoMap.getClass()); - String rechargeInfoFileStr = rechargeInfoMap.get(String.valueOf(user.getId())); - if(rechargeInfoFileStr == null){ - return false; - } - RechargeInfo rechargeInfoFile = gson.fromJson(rechargeInfoFileStr,RechargeInfo.class); - realBuyGoodsTimes = rechargeInfoFile.getBuyGoodsTimes(); - hotGoods=new HashMap<>(realBuyGoodsTimes); - Map oldBuyGoodsTimes = user.getPlayerInfoManager().getRechargeInfo().getBuyGoodsTimes(); - - for (Map.Entry entry:oldBuyGoodsTimes.entrySet() ) { - if(realBuyGoodsTimes.containsKey(entry.getKey())){ - int finalvalue = realBuyGoodsTimes.get(entry.getKey())-entry.getValue(); - - if(finalvalue==0){ - realBuyGoodsTimes.remove(entry.getKey()); - }else if(finalvalue>0){ - realBuyGoodsTimes.put(entry.getKey(),finalvalue); - }else { - //日志记录不对 - LOGGER.info("cmd_________recharge:err"); - return false; - } - - } - } - - int hotRechargeMoney = 0; - for (Map.Entry entry:realBuyGoodsTimes.entrySet()) { - if(entry.getKey()==1||entry.getKey()==2||entry.getKey()==3||entry.getKey()==4||entry.getKey()==5||entry.getKey()==13||entry.getKey()==14||entry.getKey()==15||entry.getKey()==16){ - SRechargeCommodityConfig sRechargeCommodityConfig = SRechargeCommodityConfig.rechargeCommodityConfigMap.get(entry.getKey()); - int price =sRechargeCommodityConfig.getPrice(); - hotRechargeMoney+=entry.getValue()*price; - } - } - - //月卡 - boolean mulvip =false; - if(realBuyGoodsTimes.containsKey(9)||realBuyGoodsTimes.containsKey(10)||realBuyGoodsTimes.containsKey(11)){ - mulvip =true; - } - - - RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo(); - int saveAmt = rechargeInfo.getSaveAmt(); - - - //成长礼金 - if(realBuyGoodsTimes.containsKey(7)||realBuyGoodsTimes.containsKey(8)){ - // if(!user.getActivityManager().getActivityMissionMap().containsKey(6)){ - ActivityLogic.getInstance().openActivityReallyOpen(user, ActivityType.GrowthFund); - //} - } -// int[][] costItemArr = StringUtil.parseFiledInt2(rewardStr); -// for (int i = 0; i goodsDurationMap = user.getPlayerInfoManager().getRechargeInfo().getGoodsDurationMap(); - Integer nowTime =(int)(System.currentTimeMillis()/1000); - for(Integer goodsId : hotGoods.keySet()){ - if(goodsDurationMap.containsKey(goodsId)){ - LOGGER.info("the uid={} already send the goods={}",user.getId(),goodsId); - continue; - } - SRechargeCommodityConfig sRechargeCommodityConfig = SRechargeCommodityConfig.rechargeCommodityConfigMap.get(goodsId); - int goodsType = sRechargeCommodityConfig.getType(); - if(goodsType == GiftGoodsType.MONTHCARD || goodsType == GiftGoodsType.LUXURYMONTHCARD || goodsType == GiftGoodsType.WEEKCARD){ - Integer endTime = null; - boolean needSendMail = false; - for(Map.Entry goodsDurationItem : goodsDurationMap.entrySet()){ - if(SRechargeCommodityConfig.rechargeCommodityConfigMap.get(goodsDurationItem.getKey()).getType() == goodsType){ - endTime = goodsDurationItem.getValue(); - } - } - if(endTime == null || nowTime>endTime){ - endTime = nowTime; - needSendMail = true; - } - - endTime +=sRechargeCommodityConfig.getContiueDays() * 24 * 3600; - rechargeInfo.updateGoodsTypeDuration(sRechargeCommodityConfig.getId(),endTime); - if(needSendMail){ - int[] openPrivilege = sRechargeCommodityConfig.getOpenPrivilege(); - if(openPrivilege!=null && openPrivilege.length>0){ - for(int privilege:openPrivilege){ - user.getPlayerInfoManager().addVipInfo(privilege); - } - } - } - } - } - - - - user.getPlayerInfoManager().getRechargeInfo().setBuyGoodsTimes(hotGoods); - - LOGGER.info("cmd_________recharge:hotRechargeMoney"+hotRechargeMoney+"重复月卡:"+mulvip); } }