月卡修复

back_recharge
zhangshanxue 2019-09-19 21:16:27 +08:00
parent 1615f53a15
commit 35c64d19e7
2 changed files with 53 additions and 2 deletions

View File

@ -87,7 +87,7 @@ public class GmService implements RPCRequestGMIFace.Iface {
Map<Integer, Integer> buyGoodsTimes = rechargeInfo.getBuyGoodsTimes();
Integer buyCount = buyGoodsTimes.get(goodID);
if(buyCount == null){
buyCount =1;
buyCount =0;
}
buyCount++;
buyGoodsTimes.put(goodID,buyCount);

View File

@ -23,6 +23,7 @@ import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.logic.store.GiftGoodsType;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
@ -115,24 +116,74 @@ public class Cmd_changename extends GmRoleAbstract {
}
}
//月卡
boolean mulvip =false;
if((realBuyGoodsTimes.containsKey(9)&&realBuyGoodsTimes.get(9)>=1)||(realBuyGoodsTimes.containsKey(10)&&realBuyGoodsTimes.get(10)>=1)||(realBuyGoodsTimes.containsKey(11)&&realBuyGoodsTimes.get(11)>=1)){
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 <costItemArr.length ; i++) {
// if(costItemArr[i][0]==Global.SOULCRYSTAL){
// rechargeInfo.addSoulCrystalAmt(costItemArr[i][1]);
// }
// }
//充值金额
rechargeInfo.setSaveAmt(hotRechargeMoney+saveAmt);
//累计充值
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RechargeTotal,rechargeInfo.getSaveAmt());
//限时累计充值
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RECHARGE_NUM,hotRechargeMoney);
rechargeInfo.setHadBuyFound(rechargeInfoFile.getHadBuyFound());
Map<Integer, Integer> 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<Integer,Integer> 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);