Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn
commit
3ba82851fd
|
@ -56,7 +56,7 @@ public class BuyGoodsToItemHandler extends BaseHandler<ActivityProto.BuyGoodsToI
|
|||
// 领取奖励
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, goodsConfig.getGoods(), goodsNum, BIReason.BUY_GOOD_ITEM_GET);
|
||||
// 消息发送
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),goodId,goodsNum));
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),goodId,goodsNum,2));
|
||||
// 返回
|
||||
ActivityProto.BuyGoodsToItemResponse build = ActivityProto.BuyGoodsToItemResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.BuyGoodsToItemResponse_VALUE,build,true);
|
||||
|
|
|
@ -61,7 +61,7 @@ public class ContinuousGiftActivity extends AbstractActivity {
|
|||
SuperBoxEvent event1 = (SuperBoxEvent) event;
|
||||
User user = UserManager.getUser(event1.getUserId());
|
||||
// 礼包处理
|
||||
giftHandle(user, event1.getGiftId(), event1.getNum());
|
||||
giftHandle(user, event1.getGiftId(), event1.getNum(), event1.getType());
|
||||
|
||||
// 客户端推送
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
|
@ -74,12 +74,11 @@ public class ContinuousGiftActivity extends AbstractActivity {
|
|||
* @param giftId
|
||||
* @param missionMap
|
||||
*/
|
||||
private void giftHandle(User user, int giftId, int giftNum){
|
||||
private void giftHandle(User user, int giftId, int giftNum, int type){
|
||||
if (giftId < 0 || giftNum <= 0){
|
||||
// 非礼包处理
|
||||
return;
|
||||
}
|
||||
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
return;
|
||||
|
@ -88,7 +87,7 @@ public class ContinuousGiftActivity extends AbstractActivity {
|
|||
Collection<SThemeActivityShop> themeShops = SThemeActivityShop.themeMap.getOrDefault(id, new HashMap<>(0)).values();
|
||||
|
||||
for (SThemeActivityShop theme : themeShops) {
|
||||
if (theme.getGoodId() == giftId){
|
||||
if (theme.getGoodId() == giftId && theme.getGoodType() == type){
|
||||
// 记录礼包购买次数
|
||||
ActivityProgressInfo current = missionMap.getOrDefault(theme.getId(),new ActivityProgressInfo());
|
||||
current.setProgrss(current.getProgrss() + giftNum);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
* @Date 2021/5/26 11:05
|
||||
|
@ -30,7 +32,11 @@ public class SuperBoxEvent implements IEvent {
|
|||
* 数量
|
||||
*/
|
||||
private int num;
|
||||
|
||||
/**
|
||||
* 礼包类别
|
||||
* 1:rmb礼包,2:妖晶礼包
|
||||
*/
|
||||
private int type;
|
||||
|
||||
public SuperBoxEvent(int userId, int giftId) {
|
||||
this.userId = userId;
|
||||
|
@ -38,10 +44,19 @@ public class SuperBoxEvent implements IEvent {
|
|||
this.num = 1;
|
||||
}
|
||||
|
||||
public SuperBoxEvent(int userId, int giftId, int num) {
|
||||
public SuperBoxEvent(int userId, int giftId, int num, int type) {
|
||||
this.userId = userId;
|
||||
this.giftId = giftId;
|
||||
this.num = num;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
|
|
|
@ -213,26 +213,21 @@ public class CrossYuxulundaoLogic {
|
|||
Set<ZSetOperations.TypedTuple<String>> matchRival= RedisUtil.getInstence().getZsetRangeWithScore(
|
||||
RedisUtil.getInstence().getKey(RedisKey.CROSS_YUXULUNDAO_RANK_PERSON,Integer.toString(crossGroup)),(double)con.getScoreLow1(),(double)con.getScoreUp1()
|
||||
);
|
||||
LOGGER.info("xuexinpeng crossGroup:"+crossGroup+"scoreLow1:"+con.getScoreLow1()+"scoreUp1:"+con.getScoreUp1());
|
||||
matchRival = matchRival.stream().filter(n->Integer.valueOf(n.getValue())!=user.getId()).collect(Collectors.toSet());
|
||||
LOGGER.info("xxp:size:" + arenaRank.size());
|
||||
if(matchRival.size() >0){
|
||||
if(matchRival.size()<5){
|
||||
//需要填充机器人
|
||||
matchRival.forEach(n->{ arenaRank.add(Integer.valueOf(n.getValue())); });
|
||||
arenaRank.addAll(SArenaRobotConfig.getSArenaRobotConfigsByRangeAndCount(con.getScoreLow1(),con.getScoreUp1(),5 - matchRival.size()));
|
||||
LOGGER.info("xxp1:size:" + arenaRank.size());
|
||||
}else{
|
||||
//随机出五个真人
|
||||
List<String> matchRivalList = new ArrayList<String>();
|
||||
matchRival.forEach(n->{matchRivalList.add(n.getValue());});
|
||||
Collections.shuffle(matchRivalList);
|
||||
matchRivalList.subList(0,5).forEach(n->arenaRank.add(Integer.valueOf(n)));
|
||||
LOGGER.info("xxp2:size:" + arenaRank.size());
|
||||
}
|
||||
}else{
|
||||
arenaRank.addAll(SArenaRobotConfig.getSArenaRobotConfigsByRangeAndCount(con.getScoreLow1(),con.getScoreUp1(),5));
|
||||
LOGGER.info("xxp3:size:" + arenaRank.size());
|
||||
}
|
||||
//没有高分段机器人 从相近的里面取机器人
|
||||
if(arenaRank.size() == 0){
|
||||
|
@ -243,7 +238,6 @@ public class CrossYuxulundaoLogic {
|
|||
break;
|
||||
}
|
||||
}
|
||||
LOGGER.info("xxp4:size:" + arenaRank.size());
|
||||
}
|
||||
arenaRank.forEach(n -> {
|
||||
if (n > 1000) {
|
||||
|
|
|
@ -236,7 +236,7 @@ public class BuyGoodsNewLogic {
|
|||
sendGiftGoodsWithoutJudge(uid);
|
||||
openPush(session,user, PushRechargeType.point_recharge.getType(),goodsId,1);
|
||||
// 惊喜礼盒,事件推送
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),config.getId()));
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),config.getId(),1,1));
|
||||
// 更新入库
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
// 扶持订单不需要上报
|
||||
|
|
Loading…
Reference in New Issue