首充改为累计充值触发
parent
3da44b7d3b
commit
dee16fd384
|
|
@ -9,8 +9,10 @@ import com.ljsd.jieling.logic.activity.event.ActivityStateChangeEvent;
|
|||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.NewRechargeInfo;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
|
|
@ -26,9 +28,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 直购首冲活动-bt版
|
||||
* 2022-9-6
|
||||
* 首充活动
|
||||
*/
|
||||
public class RechargeFirstActivity extends AbstractActivity {
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ public class RechargeFirstActivity extends AbstractActivity {
|
|||
ActivityMission mission = new ActivityMission();
|
||||
ActivityLogic.getInstance().initOtherMission(mission, new ArrayList<>());
|
||||
user.getActivityManager().getActivityMissionMap().put(id, mission);
|
||||
LOGGER.info("直购首冲活动-bt版...uid={},activityId={}",user.getId(), id);
|
||||
LOGGER.info("直购首冲活动(改为累充激活)...uid={},activityId={}",user.getId(), id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -53,29 +53,29 @@ public class RechargeFirstActivity extends AbstractActivity {
|
|||
if (!(event instanceof SuperBoxEvent)) {
|
||||
return;
|
||||
}
|
||||
// 获取信息
|
||||
// // 获取信息
|
||||
SuperBoxEvent event1 = (SuperBoxEvent) event;
|
||||
User user = UserManager.getUser(event1.getUserId());
|
||||
// 活动数据处理
|
||||
updateValue(user, event1.getGiftId());
|
||||
updateValue(user);
|
||||
// 状态推送
|
||||
sendActivityProgress(user, null);
|
||||
LOGGER.info("superbox-直购首冲活动:{},耗时:{}",id,TimeUtils.now()-now);
|
||||
LOGGER.info("直购首冲活动(改为累充激活):{},耗时:{}",id,TimeUtils.now()-now);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数
|
||||
* @param giftId
|
||||
* @param user
|
||||
*/
|
||||
private void updateValue(User user, int giftId){
|
||||
if (giftId <= 0){
|
||||
return;
|
||||
}
|
||||
private void updateValue(User user){
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
NewRechargeInfo newRechargeInfo = playerInfoManager.getNewRechargeInfo();
|
||||
int amount = (int)newRechargeInfo.getRr();
|
||||
Map<Integer, ActivityProgressInfo> missionMap = user.getActivityManager().getActivityMissionMap().get(id).getActivityMissionMap();
|
||||
List<SActivityRewardConfig> rewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||
for (SActivityRewardConfig reward : rewardConfigs) {
|
||||
// 礼包id相等并且库里没有,那么则创建一条新的
|
||||
if (reward.getValues()[0][0] == giftId && missionMap.get(reward.getId()) == null){
|
||||
// 礼包金额满足并且库里没有,那么则创建一条新的
|
||||
if (reward.getValues()[0][0] <= amount && missionMap.get(reward.getId()) == null){
|
||||
ActivityProgressInfo progressInfo = new ActivityProgressInfo();
|
||||
progressInfo.setProgrss(TimeUtils.nowInt());
|
||||
progressInfo.setState(0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue