Merge branch 'master_test_gn_push' into master_test_gn
commit
82dd1bd33e
|
@ -475,6 +475,8 @@ public class GlobalDataManaager implements IManager {
|
||||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),SuperBoxEvent.fund_zero_init));
|
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),SuperBoxEvent.fund_zero_init));
|
||||||
// 心愿格子信息刷新
|
// 心愿格子信息刷新
|
||||||
HeroLogic.getInstance().resetWishDrawCardInfoMap(user);
|
HeroLogic.getInstance().resetWishDrawCardInfoMap(user);
|
||||||
|
///清空当天推送的礼包次数
|
||||||
|
user.getPlayerInfoManager().getNewRechargeInfo().ClearDayPushMap();
|
||||||
}
|
}
|
||||||
user.getPlayerInfoManager().setLoginTime(TimeUtils.now());
|
user.getPlayerInfoManager().setLoginTime(TimeUtils.now());
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,6 +208,7 @@ public class BuyGoodsNewLogic {
|
||||||
info.setMaxSingleR(price);
|
info.setMaxSingleR(price);
|
||||||
}
|
}
|
||||||
info.setRr(MathUtils.doubleAdd(price,info.getRr()));
|
info.setRr(MathUtils.doubleAdd(price,info.getRr()));
|
||||||
|
info.setRechargeList(TimeUtils.now(),price);
|
||||||
//处理月卡
|
//处理月卡
|
||||||
user.getPlayerInfoManager().getMonthCard();
|
user.getPlayerInfoManager().getMonthCard();
|
||||||
activeMonthCard(user,price,info);
|
activeMonthCard(user,price,info);
|
||||||
|
@ -810,18 +811,32 @@ public class BuyGoodsNewLogic {
|
||||||
if(list == null){
|
if(list == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Collections.sort(list, new Comparator<SPackPushConfig>(){
|
||||||
|
@Override
|
||||||
|
public int compare(SPackPushConfig o1, SPackPushConfig o2) {
|
||||||
|
return Integer.compare(o1.getPriority(), o2.getPriority());
|
||||||
|
}
|
||||||
|
});
|
||||||
int popup = 0;
|
int popup = 0;
|
||||||
boolean push = false;
|
boolean push = false;
|
||||||
for(SPackPushConfig con : list){
|
for(SPackPushConfig con : list){
|
||||||
int bagId = judgePushCondition(user,con);
|
int bagId = judgePushCondition(user,con);
|
||||||
|
int conditionType=con.getConditionId()[0];
|
||||||
|
int pushId=con.getId();
|
||||||
|
if (con.getStatistics()>0&&info.getDayPushNum(pushId)>=con.getStatistics())continue;
|
||||||
|
if (con.getCount()>0&&info.getAllPuthNum(pushId)>=con.getCount())continue;
|
||||||
//条件成功
|
//条件成功
|
||||||
if(bagId > 0 && info.getNextPushTime() < System.currentTimeMillis()){
|
if(bagId > 0 && info.getNextPushTime() < System.currentTimeMillis()&& info.getTypePushTimeMap(conditionType) < System.currentTimeMillis()){
|
||||||
popup = bagId;
|
popup = bagId;
|
||||||
info.setNextPushTime(System.currentTimeMillis() + con.getcDTime() * TimeUtils.HOUR);
|
info.setNextPushTime(System.currentTimeMillis() + con.getcDTime() * TimeUtils.HOUR);
|
||||||
|
info.setTypePushTimeMap(conditionType,System.currentTimeMillis() + con.getPrivateCD() * TimeUtils.HOUR);
|
||||||
|
info.setDayPushNum(pushId,1);
|
||||||
|
info.setAllPuthNum(pushId,1);
|
||||||
boolean tempPush = createPushBag(bagId,user,num);
|
boolean tempPush = createPushBag(bagId,user,num);
|
||||||
if(!push){
|
if(!push){
|
||||||
push = tempPush;
|
push = tempPush;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityNewConfig.configMap.size());
|
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityNewConfig.configMap.size());
|
||||||
|
@ -861,12 +876,16 @@ public class BuyGoodsNewLogic {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}else if(scope[0] == 7){
|
}else if(scope[0] == 7){
|
||||||
double mxr = user.getPlayerInfoManager().getNewRechargeInfo().getMaxSingleR();
|
//此处根据需求改成指定天数内最大充值订单,之前的条件是历史充值最大订单
|
||||||
|
//double mxr = user.getPlayerInfoManager().getNewRechargeInfo().getMaxSingleR();
|
||||||
|
double mxr = user.getPlayerInfoManager().getNewRechargeInfo().GetSingleMaxRechargeNum(SSpecialConfig.getIntegerValue(SSpecialConfig.DAYS_FOR_RECHARGE_SINGLE));
|
||||||
if(mxr < scope[1]){
|
if(mxr < scope[1]){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
double rr = user.getPlayerInfoManager().getNewRechargeInfo().getRr();
|
//double rr = user.getPlayerInfoManager().getNewRechargeInfo().getRr();
|
||||||
|
//此处根据需求改成指定天数累计充值,之前的条件是历史累计充值
|
||||||
|
double rr = user.getPlayerInfoManager().getNewRechargeInfo().GetAllRechargeNum(SSpecialConfig.getIntegerValue(SSpecialConfig.DAYS_FOR_RECHARGE_SUM));
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for(int i = 1;i<con.getPersonas().length;i++){
|
for(int i = 1;i<con.getPersonas().length;i++){
|
||||||
if(con.getPersonas()[i] > rr){
|
if(con.getPersonas()[i] > rr){
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.store.newRechargeInfo;
|
||||||
|
|
||||||
import com.ljsd.common.mogodb.MongoBase;
|
import com.ljsd.common.mogodb.MongoBase;
|
||||||
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.*;
|
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.*;
|
||||||
|
import util.TimeUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -20,6 +21,8 @@ public class NewRechargeInfo extends MongoBase {
|
||||||
private long firstTime;//首冲时间
|
private long firstTime;//首冲时间
|
||||||
private int isDayFirst;
|
private int isDayFirst;
|
||||||
|
|
||||||
|
private Map<Long,Double>rechargeList=new HashMap<>();//充值记录
|
||||||
|
|
||||||
private Map<Integer,AbstractWelfareBag> perpetualMap = new HashMap<>();//永久礼包
|
private Map<Integer,AbstractWelfareBag> perpetualMap = new HashMap<>();//永久礼包
|
||||||
private Map<Integer,AbstractWelfareBag> timeLimitMap = new HashMap<>();//限时刷新礼包
|
private Map<Integer,AbstractWelfareBag> timeLimitMap = new HashMap<>();//限时刷新礼包
|
||||||
private Map<Integer,AbstractWelfareBag> receiveMap = new HashMap<>();//限时刷新礼包
|
private Map<Integer,AbstractWelfareBag> receiveMap = new HashMap<>();//限时刷新礼包
|
||||||
|
@ -30,6 +33,12 @@ public class NewRechargeInfo extends MongoBase {
|
||||||
private int towerLost; //记录爬塔失败次数
|
private int towerLost; //记录爬塔失败次数
|
||||||
private long nextPushTime; //上次推送时间
|
private long nextPushTime; //上次推送时间
|
||||||
|
|
||||||
|
private Map<Integer,Long>typePushTimeMap=new HashMap<>();//记录推送条件类型cd时间
|
||||||
|
|
||||||
|
private Map<Integer,Integer> dayPushNumMap =new HashMap<>();//记录当天推送次数
|
||||||
|
|
||||||
|
private Map<Integer,Integer> allPushNumMap =new HashMap<>();//记录历史推送次数
|
||||||
|
|
||||||
private long lastRefreshTime;
|
private long lastRefreshTime;
|
||||||
public static int FIVESTARLIMIT = 2;//临时五星成长礼每天最多两次
|
public static int FIVESTARLIMIT = 2;//临时五星成长礼每天最多两次
|
||||||
private Map<Integer,Integer> tempLimitMap = new HashMap<>();//五星成长礼每天购买次数
|
private Map<Integer,Integer> tempLimitMap = new HashMap<>();//五星成长礼每天购买次数
|
||||||
|
@ -254,12 +263,60 @@ public class NewRechargeInfo extends MongoBase {
|
||||||
public long getNextPushTime() {
|
public long getNextPushTime() {
|
||||||
return nextPushTime;
|
return nextPushTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNextPushTime(long nextPushTime) {
|
public void setNextPushTime(long nextPushTime) {
|
||||||
this.nextPushTime = nextPushTime;
|
this.nextPushTime = nextPushTime;
|
||||||
updateString("nextPushTime",nextPushTime);
|
updateString("nextPushTime",nextPushTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getTypePushTimeMap(int pushType) {
|
||||||
|
if (typePushTimeMap.containsKey(pushType)){
|
||||||
|
return typePushTimeMap.get(pushType);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTypePushTimeMap(int pushType,long nextPushTime) {
|
||||||
|
this.typePushTimeMap.put(pushType,nextPushTime);
|
||||||
|
updateString("typePushTimeMap."+pushType,nextPushTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDayPushNum(int pushId) {
|
||||||
|
if (dayPushNumMap.containsKey(pushId)){
|
||||||
|
return dayPushNumMap.get(pushId);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDayPushNum(int pushId,int addNum) {
|
||||||
|
int pushNum=addNum;
|
||||||
|
if (dayPushNumMap.containsKey(pushId)){
|
||||||
|
pushNum+= dayPushNumMap.get(pushId);
|
||||||
|
}
|
||||||
|
this.dayPushNumMap.put(pushId,pushNum);
|
||||||
|
updateString("dayPushNumMap."+pushId,pushNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ClearDayPushMap(){
|
||||||
|
dayPushNumMap.clear();
|
||||||
|
updateString("dayPushNumMap", dayPushNumMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAllPuthNum(int pushId) {
|
||||||
|
if (allPushNumMap.containsKey(pushId)){
|
||||||
|
return allPushNumMap.get(pushId);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllPuthNum(int pushId,int addNum) {
|
||||||
|
int pushNum=addNum;
|
||||||
|
if (allPushNumMap.containsKey(pushId)){
|
||||||
|
pushNum+= allPushNumMap.get(pushId);
|
||||||
|
}
|
||||||
|
this.allPushNumMap.put(pushId,pushNum);
|
||||||
|
updateString("allPushNumMap."+pushId,pushNum);
|
||||||
|
}
|
||||||
|
|
||||||
public long getLastRefreshTime() {
|
public long getLastRefreshTime() {
|
||||||
return lastRefreshTime;
|
return lastRefreshTime;
|
||||||
}
|
}
|
||||||
|
@ -278,6 +335,41 @@ public class NewRechargeInfo extends MongoBase {
|
||||||
updateString("maxSingleR",maxSingleR);
|
updateString("maxSingleR",maxSingleR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<Long, Double> getRechargeList() {
|
||||||
|
return rechargeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRechargeList(long _rechargeTime,double _rechargePrice) {
|
||||||
|
this.rechargeList.put(_rechargeTime,_rechargePrice);
|
||||||
|
updateString("rechargeList",this.rechargeList);
|
||||||
|
}
|
||||||
|
|
||||||
|
///获取指定天数内累计充值金额
|
||||||
|
public double GetAllRechargeNum(int _deyNum){
|
||||||
|
double rechargeNum=0;
|
||||||
|
long limitTime= TimeUtils.now()-TimeUtils.ONE_DAY*_deyNum;
|
||||||
|
for (Map.Entry<Long, Double> entry : rechargeList.entrySet()) {
|
||||||
|
if (entry.getKey()>limitTime) {
|
||||||
|
rechargeNum+=entry.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rechargeNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
///获取指定天数内单笔最大充值金额
|
||||||
|
public double GetSingleMaxRechargeNum(int _deyNum){
|
||||||
|
double rechargeNum=0;
|
||||||
|
long limitTime= TimeUtils.now()-TimeUtils.ONE_DAY*_deyNum;
|
||||||
|
for (Map.Entry<Long, Double> entry : rechargeList.entrySet()) {
|
||||||
|
if (entry.getKey()>limitTime) {
|
||||||
|
if (entry.getValue()>rechargeNum){
|
||||||
|
rechargeNum=entry.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rechargeNum;
|
||||||
|
}
|
||||||
|
|
||||||
public Map<Integer, Integer> getTempLimitMap() {
|
public Map<Integer, Integer> getTempLimitMap() {
|
||||||
return tempLimitMap;
|
return tempLimitMap;
|
||||||
}
|
}
|
||||||
|
@ -285,4 +377,5 @@ public class NewRechargeInfo extends MongoBase {
|
||||||
public void setTempLimitMap(Map<Integer, Integer> tempLimitMap) {
|
public void setTempLimitMap(Map<Integer, Integer> tempLimitMap) {
|
||||||
this.tempLimitMap = tempLimitMap;
|
this.tempLimitMap = tempLimitMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@ public class SPackPushConfig implements BaseConfig {
|
||||||
private int[] packs;
|
private int[] packs;
|
||||||
private int statistics;
|
private int statistics;
|
||||||
|
|
||||||
|
private int privateCD;
|
||||||
|
|
||||||
public static Map<Integer,SPackPushConfig> configMap;
|
public static Map<Integer,SPackPushConfig> configMap;
|
||||||
public static Map<Integer,Map<Integer,List<SPackPushConfig>>> conditionMap;
|
public static Map<Integer,Map<Integer,List<SPackPushConfig>>> conditionMap;
|
||||||
|
|
||||||
|
@ -66,79 +68,50 @@ public class SPackPushConfig implements BaseConfig {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(int id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDesc() {
|
public String getDesc() {
|
||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDesc(String desc) {
|
|
||||||
this.desc = desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] getScopeId() {
|
public int[] getScopeId() {
|
||||||
return scopeId;
|
return scopeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setScopeId(int[] scopeId) {
|
|
||||||
this.scopeId = scopeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] getConditionId() {
|
public int[] getConditionId() {
|
||||||
return conditionId;
|
return conditionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConditionId(int[] conditionId) {
|
|
||||||
this.conditionId = conditionId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getPriority() {
|
public int getPriority() {
|
||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPriority(int priority) {
|
|
||||||
this.priority = priority;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getcDTime() {
|
public int getcDTime() {
|
||||||
return cDTime;
|
return cDTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setcDTime(int cDTime) {
|
|
||||||
this.cDTime = cDTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCount(int count) {
|
|
||||||
this.count = count;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] getPersonas() {
|
public int[] getPersonas() {
|
||||||
return personas;
|
return personas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPersonas(int[] personas) {
|
|
||||||
this.personas = personas;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int[] getPacks() {
|
public int[] getPacks() {
|
||||||
return packs;
|
return packs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPacks(int[] packs) {
|
|
||||||
this.packs = packs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStatistics() {
|
public int getStatistics() {
|
||||||
return statistics;
|
return statistics;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatistics(int statistics) {
|
|
||||||
this.statistics = statistics;
|
public int getPrivateCD() {
|
||||||
|
return privateCD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,8 @@ public class SSpecialConfig implements BaseConfig {
|
||||||
|
|
||||||
public static final String QIJIEHOLYCONFIG = "QIJIEHOLYCONFIG";//七界试炼遗物开启层数
|
public static final String QIJIEHOLYCONFIG = "QIJIEHOLYCONFIG";//七界试炼遗物开启层数
|
||||||
public static final String LIKE_ABILITY = "LikeAbility";//好感度功能,每日赠予礼物次数上限
|
public static final String LIKE_ABILITY = "LikeAbility";//好感度功能,每日赠予礼物次数上限
|
||||||
|
public static final String DAYS_FOR_RECHARGE_SUM = "DaysForRechargeSum";//近期累计充值金额累计时长
|
||||||
|
public static final String DAYS_FOR_RECHARGE_SINGLE = "DaysForRechargeSingle";//近期最大单笔充值金额累计时长
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue