仙充卡线下返利

back_recharge
duhui 2023-02-01 14:18:07 +08:00
parent 5745c2f764
commit 1cdb30a18e
11 changed files with 126 additions and 110 deletions

View File

@ -5,6 +5,7 @@ import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.redis.RedisKey; import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil; import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.globals.Global; import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.GlobleSystemLogic; import com.ljsd.jieling.logic.GlobleSystemLogic;
import com.ljsd.jieling.logic.dao.GuilidManager; import com.ljsd.jieling.logic.dao.GuilidManager;
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction; import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
@ -16,6 +17,8 @@ import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank; import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
import config.SErrorCodeEerverConfig; import config.SErrorCodeEerverConfig;
import config.SWorldBossRewardConfig; import config.SWorldBossRewardConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.ZSetOperations; import org.springframework.data.redis.core.ZSetOperations;
import util.TimeUtils; import util.TimeUtils;
@ -25,6 +28,8 @@ import java.util.Set;
import java.util.TreeMap; import java.util.TreeMap;
public class CarDelayFunction implements FunctionManager { public class CarDelayFunction implements FunctionManager {
private static final Logger LOGGER = LoggerFactory.getLogger(CarDelayFunction.class);
@Override @Override
public void startAction(TimeControllerOfFunction timeControllerOfFunction) throws Exception { public void startAction(TimeControllerOfFunction timeControllerOfFunction) throws Exception {
@ -43,7 +48,7 @@ public class CarDelayFunction implements FunctionManager {
RedisUtil.getInstence().rename(60*60*16, backName, delKeys); RedisUtil.getInstence().rename(60*60*16, backName, delKeys);
// String userLevelGuild = RedisUtil.getInstence().getKey(RedisKey.USER_LEVEL_GUILD_INFO, ""); // String userLevelGuild = RedisUtil.getInstence().getKey(RedisKey.USER_LEVEL_GUILD_INFO, "");
// delKeys.add(userLevelGuild); // delKeys.add(userLevelGuild);
System.out.println("车迟斗法备份排行榜:"+ Arrays.asList(delKeys)); LOGGER.error("车迟斗法备份排行榜:{}",Arrays.asList(delKeys));
MongoUtil.getLjsdMongoTemplate().lastUpdate(); MongoUtil.getLjsdMongoTemplate().lastUpdate();
} }

View File

@ -16,7 +16,6 @@ import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.cross.CSPlayer; import com.ljsd.jieling.logic.dao.cross.CSPlayer;
import com.ljsd.jieling.logic.dao.root.GuildInfo; import com.ljsd.jieling.logic.dao.root.GuildInfo;
import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
import com.ljsd.jieling.logic.family.GuildFightLogic; import com.ljsd.jieling.logic.family.GuildFightLogic;
import com.ljsd.jieling.logic.fight.*; import com.ljsd.jieling.logic.fight.*;
import com.ljsd.jieling.logic.fight.result.FightResult; import com.ljsd.jieling.logic.fight.result.FightResult;
@ -86,7 +85,7 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
privilege = sWorldBossSetting.getPrivilege()[type - 1]; privilege = sWorldBossSetting.getPrivilege()[type - 1];
boolean b = PlayerLogic.getInstance().check(user, privilege, 1); boolean b = PlayerLogic.getInstance().check(user, privilege, 1);
if(!b){ if(!b){
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_DEFINE,"次数不足");
} }
} else { } else {
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);

View File

@ -82,7 +82,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
User user = UserManager.getUser(userId); User user = UserManager.getUser(userId);
QuestionLogic.getInstence().onLogin(user); QuestionLogic.getInstence().onLogin(user);
PlayerManager playerInfoManager = user.getPlayerInfoManager(); PlayerManager playerInfoManager = user.getPlayerInfoManager();
PlayerLogic.getInstance().checkOldMonthCard(user); // PlayerLogic.getInstance().checkOldMonthCard(user);
ActivityLogic.getInstance().flushForLogin(user,iSession); ActivityLogic.getInstance().flushForLogin(user,iSession);
GlobalDataManaager.checkNeedReFlush(iSession,user,null); GlobalDataManaager.checkNeedReFlush(iSession,user,null);
BuyGoodsNewLogic.refreshWelfareState(user); BuyGoodsNewLogic.refreshWelfareState(user);
@ -184,7 +184,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
remove.removeAll(user.getItemManager().getItemMap().keySet()); remove.removeAll(user.getItemManager().getItemMap().keySet());
remove.forEach(n->{ remove.forEach(n->{
try { try {
LOGGER.info("GET_PLAYERINFO_REQUEST uid n = {}", userId, n); LOGGER.info("GET_PLAYERINFO_REQUEST uid n = {}, {}", userId, n);
user.getItemManager().newItem(n, 0); user.getItemManager().newItem(n, 0);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();

View File

@ -4,8 +4,6 @@ import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException; import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.globals.BIReason; import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.handler.BaseHandler; import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.activity.event.AutoRechargeBackEvent;
import com.ljsd.jieling.logic.activity.event.Poster;
import com.ljsd.jieling.logic.dao.UserManager; import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic; import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
@ -56,11 +54,6 @@ public class GmBuyGoodHandler extends BaseHandler<PlayerInfoProto.GmBuyGoodReque
if (!cost){ if (!cost){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH); throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
} }
// 仙充记录线下返利
if (master.getType() == 8){
Poster.getPoster().dispatchEvent(new AutoRechargeBackEvent(user.getId(),goodsId,"gm_modifier"));
}
// 走礼包逻辑发送奖励 // 走礼包逻辑发送奖励
BuyGoodsNewLogic.gmBuyGoods(iSession, goodsId); BuyGoodsNewLogic.gmBuyGoods(iSession, goodsId);
} }

View File

@ -1,20 +1,11 @@
package com.ljsd.jieling.logic; package com.ljsd.jieling.logic;
import com.ljsd.GameApplication;
import com.ljsd.jieling.config.reportData.DataMessageUtils;
import com.ljsd.jieling.logic.dao.PlayerManager;
import com.ljsd.jieling.logic.dao.TeamEnum;
import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.util.http.HttpPool;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import util.TimeUtils;
import java.util.Map; import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
/** /**
* *
@ -50,35 +41,35 @@ public class AiWanPlayerInfoUpload {
* @param type * @param type
*/ */
public void upload(User user, String type){ public void upload(User user, String type){
// 只有爱玩的服务器需要上报 // // 只有爱玩的服务器需要上报
if (!app_id.equals(GameApplication.serverProperties.getAiwanAppId())){ // if (!app_id.equals(GameApplication.serverProperties.getAiwanAppId())){
return; // return;
} // }
PlayerManager playerInfoManager = user.getPlayerInfoManager(); // PlayerManager playerInfoManager = user.getPlayerInfoManager();
int force = user.getTeamPosManager().getTeamForceMap().getOrDefault(TeamEnum.FORMATION_NORMAL.getTeamId(),0L).intValue(); // int force = user.getTeamPosManager().getTeamForceMap().getOrDefault(TeamEnum.FORMATION_NORMAL.getTeamId(),0L).intValue();
int nowInt = TimeUtils.nowInt(); // int nowInt = TimeUtils.nowInt();
SortedMap<String, Object> extMap = new TreeMap<>(); // SortedMap<String, Object> extMap = new TreeMap<>();
extMap.put("power",force); // extMap.put("power",force);
extMap.put("stage",user.getMainLevelManager().getFightId()); // extMap.put("stage",user.getMainLevelManager().getFightId());
//
SortedMap<String, Object> map = new TreeMap<>(); // SortedMap<String, Object> map = new TreeMap<>();
map.put("appid",app_id); // map.put("appid",app_id);
map.put("serverid",String.valueOf(GameApplication.serverId)); // map.put("serverid",String.valueOf(GameApplication.serverId));
map.put("openid", playerInfoManager.getOpenId()); // map.put("openid", playerInfoManager.getOpenId());
map.put("roleid",String.valueOf(user.getId())); // map.put("roleid",String.valueOf(user.getId()));
map.put("posttime",nowInt); // map.put("posttime",nowInt);
map.put("level",playerInfoManager.getLevel()); // map.put("level",playerInfoManager.getLevel());
map.put("ext",DataMessageUtils.gson.toJson(extMap)); // map.put("ext",DataMessageUtils.gson.toJson(extMap));
// 制作sign // // 制作sign
String sign = getSign(map); // String sign = getSign(map);
map.put("sign",sign); // map.put("sign",sign);
// 以下3个参数不参加sign // // 以下3个参数不参加sign
map.put("eventtype",type); // map.put("eventtype",type);
map.put("nickname",playerInfoManager.getNickName()); // map.put("nickname",playerInfoManager.getNickName());
map.put("regtime",(playerInfoManager.getCreateTime()/1000)); // map.put("regtime",(playerInfoManager.getCreateTime()/1000));
// 请求url // // 请求url
String result = HttpPool.sendPost2(url, DataMessageUtils.gson.toJson(map)); // String result = HttpPool.sendPost2(url, DataMessageUtils.gson.toJson(map));
LOGGER.info("爱玩玩家信息上报 uid={} 返回结果={} 参数={}", user.getId(), result, map); // LOGGER.info("爱玩玩家信息上报 uid={} 返回结果={} 参数={}", user.getId(), result, map);
} }
private static String getSign(Map<String, Object> map){ private static String getSign(Map<String, Object> map){

View File

@ -30,7 +30,6 @@ import com.ljsd.jieling.logic.hardStage.HardStageLogic;
import com.ljsd.jieling.logic.help.HelpHeroLogic; import com.ljsd.jieling.logic.help.HelpHeroLogic;
import com.ljsd.jieling.logic.hero.HeroLogic; import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.home.ArchitectureUnLockHandler; import com.ljsd.jieling.logic.home.ArchitectureUnLockHandler;
import com.ljsd.jieling.logic.item.ItemLogic;
import com.ljsd.jieling.logic.mission.GameEvent; import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.mission.GameMisionType; import com.ljsd.jieling.logic.mission.GameMisionType;
import com.ljsd.jieling.logic.mission.data.DataManagerDistributor; import com.ljsd.jieling.logic.mission.data.DataManagerDistributor;
@ -571,7 +570,7 @@ public class GlobalDataManaager implements IManager {
} }
public TimeControllerOfFunction getOpenTimeOfFuntionCacheByType(FunctionIdEnum functionIdEnum ) { public TimeControllerOfFunction getOpenTimeOfFuntionCacheByType(FunctionIdEnum functionIdEnum) {
if (functionIdEnum == null){ if (functionIdEnum == null){
return null; return null;
} }

View File

@ -46,6 +46,8 @@ public class GmActivityLogic implements IEventHandler {
Poster.getPoster().listenEvent(this, AutoRechargeBackEvent.class); Poster.getPoster().listenEvent(this, AutoRechargeBackEvent.class);
} }
public static final String item_token = "item_token";
@Override @Override
public void onEvent(IEvent event) throws Exception { public void onEvent(IEvent event) throws Exception {
if (!(event instanceof AutoRechargeBackEvent)){ if (!(event instanceof AutoRechargeBackEvent)){
@ -55,10 +57,22 @@ public class GmActivityLogic implements IEventHandler {
if (rechargeBackEvent.getGiftId() <= 0){ if (rechargeBackEvent.getGiftId() <= 0){
return; return;
} }
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(rechargeBackEvent.getGiftId());
if (config == null){ double price = 0;
String method = rechargeBackEvent.getRechargeMethod();
if (method.equals(item_token)){
price = rechargeBackEvent.getGiftId();
}else {
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(rechargeBackEvent.getGiftId());
if (config != null){
price = config.getPrice();
}
}
if (price <= 0){
return; return;
} }
User user = UserManager.getUser(rechargeBackEvent.getUserId()); User user = UserManager.getUser(rechargeBackEvent.getUserId());
GmActivityManager manager = user.getGmActivityManager(); GmActivityManager manager = user.getGmActivityManager();
Map<String, ARBActivity> arbActivityMap = getArbActivity(); Map<String, ARBActivity> arbActivityMap = getArbActivity();
@ -76,16 +90,16 @@ public class GmActivityLogic implements IEventHandler {
GmActivity gmActivity = manager.getActivityMap().getOrDefault(entry.getKey(), new GmActivity(arbActivity)); GmActivity gmActivity = manager.getActivityMap().getOrDefault(entry.getKey(), new GmActivity(arbActivity));
switch (gmActivity.getType()){ switch (gmActivity.getType()){
case 1://单日累充 case 1://单日累充
getRewardToSingleTotalRecharge(user, gmActivity, config.getPrice()); getRewardToSingleTotalRecharge(user, gmActivity, price);
break; break;
case 2://妖晶返利 case 2://妖晶返利
getRewardToMonsterCurrencyBack(user, gmActivity, config.getPrice()); getRewardToMonsterCurrencyBack(user, gmActivity, price);
break; break;
case 4://单笔充值 case 4://单笔充值
getRewardToSingleRecharge(user, gmActivity, config.getPrice()); getRewardToSingleRecharge(user, gmActivity, price);
break; break;
default://3、5、6多日累充永久大充开服首日累充 default://3、5、6多日累充永久大充开服首日累充
getDefaultReward(user, gmActivity,config.getPrice()); getDefaultReward(user, gmActivity, price);
break; break;
} }
manager.putActivityMap(gmActivity.getId(),gmActivity); manager.putActivityMap(gmActivity.getId(),gmActivity);

View File

@ -33,4 +33,12 @@ public class AutoRechargeBackEvent implements IEvent {
public void setGiftId(int giftId) { public void setGiftId(int giftId) {
this.giftId = giftId; this.giftId = giftId;
} }
public void setRechargeMethod(String rechargeMethod) {
this.rechargeMethod = rechargeMethod;
}
public String getRechargeMethod() {
return rechargeMethod;
}
} }

View File

@ -47,7 +47,6 @@ import com.ljsd.jieling.logic.mission.event.MissionEventDistributor;
import com.ljsd.jieling.logic.mission.main.MissionStateChangeInfo; import com.ljsd.jieling.logic.mission.main.MissionStateChangeInfo;
import com.ljsd.jieling.logic.mission.main.ServenMissionIdsType; import com.ljsd.jieling.logic.mission.main.ServenMissionIdsType;
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic; import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.AbstractWelfareBag;
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.ReceiveWelfareBag; import com.ljsd.jieling.logic.store.newRechargeInfo.bean.ReceiveWelfareBag;
import com.ljsd.jieling.logic.store.newRechargeInfo.rechargeHandler.RechargeHandler; import com.ljsd.jieling.logic.store.newRechargeInfo.rechargeHandler.RechargeHandler;
import com.ljsd.jieling.network.session.ISession; import com.ljsd.jieling.network.session.ISession;
@ -67,8 +66,6 @@ import util.TimeUtils;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.ljsd.jieling.logic.store.BuyGoodsNewLogic.refreshUnitWF;
public class PlayerLogic { public class PlayerLogic {
private static final Logger LOGGER = LoggerFactory.getLogger(PlayerLogic.class); private static final Logger LOGGER = LoggerFactory.getLogger(PlayerLogic.class);
private PlayerLogic(){ private PlayerLogic(){
@ -1661,39 +1658,39 @@ public class PlayerLogic {
* @throws Exception * @throws Exception
*/ */
public void checkOldMonthCard(User user) throws Exception { public void checkOldMonthCard(User user) throws Exception {
PlayerManager playerInfoManager = user.getPlayerInfoManager(); // PlayerManager playerInfoManager = user.getPlayerInfoManager();
if (playerInfoManager.getOldMonthCardMark() == 1){ // if (playerInfoManager.getOldMonthCardMark() == 1){
return; // return;
} // }
//
double rmb = playerInfoManager.getNewRechargeInfo().getRr(); // double rmb = playerInfoManager.getNewRechargeInfo().getRr();
//
long createTime = playerInfoManager.getCreateTime(); // long createTime = playerInfoManager.getCreateTime();
long format2 = TimeUtils.dateFormat2("2022-06-14 00:00:00"); // long format2 = TimeUtils.dateFormat2("2022-06-14 00:00:00");
//
playerInfoManager.setMonthCard(new HashMap<>()); // playerInfoManager.setMonthCard(new HashMap<>());
if (createTime < format2 && rmb >= 100){ // if (createTime < format2 && rmb >= 100){
Map<Integer, SMonthcardConfig> configMap = STableManager.getConfig(SMonthcardConfig.class); // Map<Integer, SMonthcardConfig> configMap = STableManager.getConfig(SMonthcardConfig.class);
for (SMonthcardConfig config : configMap.values()) { // for (SMonthcardConfig config : configMap.values()) {
int goodId = config.getPrice(); // int goodId = config.getPrice();
SRechargeCommodityNewConfig newConfig = SRechargeCommodityNewConfig.getConfigById(goodId); // SRechargeCommodityNewConfig newConfig = SRechargeCommodityNewConfig.getConfigById(goodId);
RechargeHandler rechargeHandler = BuyGoodsNewLogic.getRechargeHandler(newConfig.getOtype()); // RechargeHandler rechargeHandler = BuyGoodsNewLogic.getRechargeHandler(newConfig.getOtype());
AbstractWelfareBag bag = rechargeHandler.getRechargeMap(user).get(goodId); // AbstractWelfareBag bag = rechargeHandler.getRechargeMap(user).get(goodId);
if (bag == null){ // if (bag == null){
bag = rechargeHandler.initUnitWF(user, newConfig); // bag = rechargeHandler.initUnitWF(user, newConfig);
refreshUnitWF(bag,user); // refreshUnitWF(bag,user);
rechargeHandler.addNew(user,bag); // rechargeHandler.addNew(user,bag);
} // }
boolean bol = bag.buy(); // boolean bol = bag.buy();
if (!bol){ // if (!bol){
LOGGER.error("老玩家月卡兼容报错礼包已购买uid{}goodid{}",user.getId(),goodId); // LOGGER.error("老玩家月卡兼容报错礼包已购买uid{}goodid{}",user.getId(),goodId);
continue; // continue;
} // }
BuyGoodsNewLogic.activePrivilege(user,newConfig); // BuyGoodsNewLogic.activePrivilege(user,newConfig);
BuyGoodsNewLogic.activeMonthCard(user,goodId); // BuyGoodsNewLogic.activeMonthCard(user,goodId);
} // }
} // }
playerInfoManager.setOldMonthCardMark(1); // playerInfoManager.setOldMonthCardMark(1);
} }
/** /**

View File

@ -1,12 +1,9 @@
package com.ljsd.jieling.logic.store; package com.ljsd.jieling.logic.store;
import com.ljsd.GameApplication; import com.ljsd.GameApplication;
import com.ljsd.jieling.config.json.ServerProperties;
import com.ljsd.jieling.core.HandlerLogicThread; import com.ljsd.jieling.core.HandlerLogicThread;
import com.ljsd.jieling.core.VipPrivilegeType; import com.ljsd.jieling.core.VipPrivilegeType;
import com.ljsd.jieling.db.mongo.MongoUtil; import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.exception.ErrorCode; import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException; import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.globals.BIReason; import com.ljsd.jieling.globals.BIReason;
@ -294,7 +291,7 @@ public class BuyGoodsNewLogic {
if(config.getPrice()!=0&&mail!=null&&mail.length>1){ if(config.getPrice()!=0&&mail!=null&&mail.length>1){
String title = SErrorCodeEerverConfig.getI18NMessage(SErrorCodeEerverConfig.errorMap.get(mail[0]).getkey()); String title = SErrorCodeEerverConfig.getI18NMessage(SErrorCodeEerverConfig.errorMap.get(mail[0]).getkey());
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert(SErrorCodeEerverConfig.errorMap.get(mail[1]).getkey(), new Object[]{config.getName()}, new int[]{1}, "#"); String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert(SErrorCodeEerverConfig.errorMap.get(mail[1]).getkey(), new Object[]{config.getName()}, new int[]{1}, "#");
MailLogic.getInstance().sendMail(uid,title,content,"",(int) (TimeUtils.now() / 1000),Global.MAIL_EFFECTIVE_TIME); MailLogic.getInstance().sendMail(uid,title,content,"",TimeUtils.nowInt(),Global.MAIL_EFFECTIVE_TIME);
} }
notifyPaySuccessFul(uid,goodsId,amount != -999); notifyPaySuccessFul(uid,goodsId,amount != -999);
@ -304,10 +301,11 @@ public class BuyGoodsNewLogic {
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),config.getId(),1,1)); Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),config.getId(),1,1));
// 更新入库 // 更新入库
MongoUtil.getLjsdMongoTemplate().lastUpdate(); MongoUtil.getLjsdMongoTemplate().lastUpdate();
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.RECHARGE_SUCCESS_INDICATION_VALUE,
PlayerInfoProto.RechargeSuccessIndication.newBuilder().setOrderId(orderId).build(), true);
// 扶持订单不需要上报 // 扶持订单不需要上报
if(price>0 && isRmbBuy(orderId)) { if(price>0 && isRmbBuy(orderId)) {
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.RECHARGE_SUCCESS_INDICATION_VALUE,
PlayerInfoProto.RechargeSuccessIndication.newBuilder().setOrderId(orderId).build(), true);
// 开天上报 // 开天上报
KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent, goodsId, orderId, resultRes.getResultCode(), price); KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent, goodsId, orderId, resultRes.getResultCode(), price);
} }
@ -514,15 +512,19 @@ public class BuyGoodsNewLogic {
//礼包开启活动 //礼包开启活动
if(type ==GiftGoodsType.DailyPreferentialGift){ if(type ==GiftGoodsType.DailyPreferentialGift){
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityById(ActivityType.DAILY_PREFERENTIAL_GIFT); AbstractActivity abstractActivity = ActivityTypeEnum.getActicityById(ActivityType.DAILY_PREFERENTIAL_GIFT);
abstractActivity.initActivity(user); if (abstractActivity != null){
abstractActivity.initActivity(user);
}
} }
if(type ==GiftGoodsType.WholeLife){ if(type == GiftGoodsType.WholeLife){
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityById(9901); AbstractActivity abstractActivity = ActivityTypeEnum.getActicityById(9901);
abstractActivity.initActivity(user); if (abstractActivity != null) {
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(9901); abstractActivity.initActivity(user);
activityMission.setV(2); ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(9901);
activityMission.setCreatTime(TimeUtils.now()); activityMission.setV(2);
user.getActivityManager().getActivityMissionMap().put(9901, activityMission); activityMission.setCreatTime(TimeUtils.now());
user.getActivityManager().getActivityMissionMap().put(9901, activityMission);
}
} }
if(drop!=null&&session!=null){ if(drop!=null&&session!=null){
PlayerInfoProto.DirectBuyIndication build = PlayerInfoProto.DirectBuyIndication.newBuilder().setDrop(drop).build(); PlayerInfoProto.DirectBuyIndication build = PlayerInfoProto.DirectBuyIndication.newBuilder().setDrop(drop).build();
@ -555,7 +557,7 @@ public class BuyGoodsNewLogic {
} }
sendneed=true; sendneed=true;
// 当天零点 // 当天零点
int beginOfDay = (int) (TimeUtils.getBeginOfDay(TimeUtils.now())/1000); int beginOfDay = (int) (TimeUtils.getBeginOfDay(TimeUtils.nowInt()));
user.getPlayerInfoManager().putMonthCard(monthcardConfig.getId(), beginOfDay); user.getPlayerInfoManager().putMonthCard(monthcardConfig.getId(), beginOfDay);
// 特殊处理 // 特殊处理
if (monthcardConfig.getId() == Global.LMONTHCARDID){ if (monthcardConfig.getId() == Global.LMONTHCARDID){
@ -591,7 +593,12 @@ public class BuyGoodsNewLogic {
// btVIP等级提升 // btVIP等级提升
if (getbTVIPlevel != null && getbTVIPlevel.length > 0){ if (getbTVIPlevel != null && getbTVIPlevel.length > 0){
for (int[] vip : getbTVIPlevel) { for (int[] vip : getbTVIPlevel) {
user.getPlayerInfoManager().putBtVipLevel(vip[0],vip[1]); int type = vip[0];
int value = vip[1];
Integer orDefault = user.getPlayerInfoManager().getBtVipLevel().getOrDefault(type, 0);
if (value > orDefault){
user.getPlayerInfoManager().putBtVipLevel(type, value);
}
} }
LOGGER.info("********************bt vip等级提升{}", StringUtil.parseArrayToString(getbTVIPlevel)); LOGGER.info("********************bt vip等级提升{}", StringUtil.parseArrayToString(getbTVIPlevel));
} }

View File

@ -18,6 +18,7 @@ import com.ljsd.jieling.ktbeans.ReportUtil;
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean; import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
import com.ljsd.jieling.logic.OnlineUserManager; import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.activity.ActivityType; import com.ljsd.jieling.logic.activity.ActivityType;
import com.ljsd.jieling.logic.activity.activityLogic.GmActivityLogic;
import com.ljsd.jieling.logic.activity.event.*; import com.ljsd.jieling.logic.activity.event.*;
import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.dao.root.User;
@ -1452,9 +1453,11 @@ public class ItemUtil {
combineRewardDropGroup(user,sItem.getRewardGroup(),1, itemMap); combineRewardDropGroup(user,sItem.getRewardGroup(),1, itemMap);
Poster.getPoster().dispatchEvent(new TotalItemEvent(user.getId(),itemMap)); Poster.getPoster().dispatchEvent(new TotalItemEvent(user.getId(),itemMap));
// 单笔充值
if (sItem.getItemType() == GlobalItemType.XIAN_RECHARGE_CARD || sItem.getItemType() == GlobalItemType.DAY_XIAN_RECHARGE_CARD){ if (sItem.getItemType() == GlobalItemType.XIAN_RECHARGE_CARD || sItem.getItemType() == GlobalItemType.DAY_XIAN_RECHARGE_CARD){
// 单笔充值
Poster.getPoster().dispatchEvent(new SingleRechargeEvent(user.getId(),num)); Poster.getPoster().dispatchEvent(new SingleRechargeEvent(user.getId(),num));
// 线下自动返利
Poster.getPoster().dispatchEvent(new AutoRechargeBackEvent(user.getId(),num, GmActivityLogic.item_token));
} }
return true; return true;
} }