|
@@ -9,7 +9,6 @@ import com.zanxiang.game.module.manage.pojo.dto.UserDTO;
|
|
import com.zanxiang.game.module.manage.service.*;
|
|
import com.zanxiang.game.module.manage.service.*;
|
|
import com.zanxiang.game.module.mybatis.entity.*;
|
|
import com.zanxiang.game.module.mybatis.entity.*;
|
|
import com.zanxiang.game.module.mybatis.mapper.PushMsgStrategyMapper;
|
|
import com.zanxiang.game.module.mybatis.mapper.PushMsgStrategyMapper;
|
|
-import com.zanxiang.module.util.JsonUtil;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.logging.log4j.util.Strings;
|
|
import org.apache.logging.log4j.util.Strings;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -60,42 +59,27 @@ public class PushMsgStrategyServiceImpl extends ServiceImpl<PushMsgStrategyMappe
|
|
) <= 0) {
|
|
) <= 0) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- log.error("消息推送执行策略, pushMsgStrategyId : {}, param : {}", pushMsgStrategy.getId(), JsonUtil.toString(param));
|
|
|
|
//查询玩家
|
|
//查询玩家
|
|
UserDTO userDTO = userService.getById(param.getUserId());
|
|
UserDTO userDTO = userService.getById(param.getUserId());
|
|
//不存在等级策略, 或者玩家为空
|
|
//不存在等级策略, 或者玩家为空
|
|
if (userDTO == null) {
|
|
if (userDTO == null) {
|
|
- log.error("消息推送玩家信息为空, pushMsgStrategyId : {}, param : {}", pushMsgStrategy.getId(), JsonUtil.toString(param));
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
- log.error("查询到的用户信息, userDTO : {}", JsonUtil.toString(userDTO));
|
|
|
|
-
|
|
|
|
//判断是否满足策略执行条件
|
|
//判断是否满足策略执行条件
|
|
if (!this.strategyCheck(pushMsgStrategy, param, userDTO)) {
|
|
if (!this.strategyCheck(pushMsgStrategy, param, userDTO)) {
|
|
- log.error("消息推送不满足策略条件, pushMsgStrategyId : {}, param : {}", pushMsgStrategy.getId(), JsonUtil.toString(param));
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
- log.error("策略条件判断完成, 判断通过!!!!");
|
|
|
|
-
|
|
|
|
//查询策略执行角色
|
|
//查询策略执行角色
|
|
GameUserRole gameUserRole = gameUserRoleService.getOne(new LambdaQueryWrapper<GameUserRole>()
|
|
GameUserRole gameUserRole = gameUserRoleService.getOne(new LambdaQueryWrapper<GameUserRole>()
|
|
.eq(GameUserRole::getGameId, param.getGameId())
|
|
.eq(GameUserRole::getGameId, param.getGameId())
|
|
.eq(GameUserRole::getUserId, param.getUserId())
|
|
.eq(GameUserRole::getUserId, param.getUserId())
|
|
.eq(GameUserRole::getRoleId, param.getRoleId()));
|
|
.eq(GameUserRole::getRoleId, param.getRoleId()));
|
|
-
|
|
|
|
- log.error("查询执行策略的角色, gameUserRole : {}", JsonUtil.toString(gameUserRole));
|
|
|
|
-
|
|
|
|
//查询策略执行文本
|
|
//查询策略执行文本
|
|
String strategyText = pushMsgTextStrategy.getStrategyText(gameUserRole);
|
|
String strategyText = pushMsgTextStrategy.getStrategyText(gameUserRole);
|
|
- log.error("消息推送查询到文本, param : {}, strategyText : {}", JsonUtil.toString(param), strategyText);
|
|
|
|
if (Strings.isBlank(strategyText)) {
|
|
if (Strings.isBlank(strategyText)) {
|
|
- log.error("消息推送文本内容为空, pushMsgStrategyId : {}, param : {}", pushMsgStrategy.getId(), JsonUtil.toString(param));
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
//执行发送
|
|
//执行发送
|
|
- log.error("执行消息推送, param : {}", JsonUtil.toString(param));
|
|
|
|
pushMsgSendLogService.pushMsg(param.getGameId(), pushMsgStrategy.getId(), strategyText, Collections.singletonList(gameUserRole));
|
|
pushMsgSendLogService.pushMsg(param.getGameId(), pushMsgStrategy.getId(), strategyText, Collections.singletonList(gameUserRole));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -148,7 +132,7 @@ public class PushMsgStrategyServiceImpl extends ServiceImpl<PushMsgStrategyMappe
|
|
.eq(RoleOperate::getGameId, param.getGameId())
|
|
.eq(RoleOperate::getGameId, param.getGameId())
|
|
.eq(RoleOperate::getServerId, param.getServerId())
|
|
.eq(RoleOperate::getServerId, param.getServerId())
|
|
.eq(RoleOperate::getRoleId, param.getRoleId()));
|
|
.eq(RoleOperate::getRoleId, param.getRoleId()));
|
|
- if (Objects.equals(roleOperate.getIsAddCorpWechat(), 1)) {
|
|
|
|
|
|
+ if (roleOperate != null && Objects.equals(roleOperate.getIsAddCorpWechat(), 1)) {
|
|
return Boolean.FALSE;
|
|
return Boolean.FALSE;
|
|
}
|
|
}
|
|
}
|
|
}
|