|
@@ -11,6 +11,7 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.dromara.common.redis.utils.RedisUtils;
|
|
|
import org.dromara.system.domain.constant.GameEventConstant;
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.dromara.system.domain.bo.GameRefereeBo;
|
|
|
import org.dromara.system.domain.vo.GameRefereeVo;
|
|
@@ -55,8 +56,13 @@ public class GameRefereeServiceImpl implements IGameRefereeService {
|
|
|
*/
|
|
|
@Override
|
|
|
public TableDataInfo<GameRefereeVo> queryPageList(GameRefereeBo bo, PageQuery pageQuery) {
|
|
|
- if (bo.getEventId() == null){
|
|
|
- bo.setEventId(RedisUtils.getCacheObject(GameEventConstant.DEFAULT_EVENT_ID));
|
|
|
+ if (bo.getEventId() == null) {
|
|
|
+ Object cacheObject = RedisUtils.getCacheObject(GameEventConstant.DEFAULT_EVENT_ID);
|
|
|
+ if (cacheObject instanceof Integer) {
|
|
|
+ bo.setEventId(((Integer) cacheObject).longValue()); // 显式转换为 Long 类型
|
|
|
+ } else if (cacheObject instanceof Long) {
|
|
|
+ bo.setEventId((Long) cacheObject);
|
|
|
+ }
|
|
|
}
|
|
|
LambdaQueryWrapper<GameReferee> lqw = buildQueryWrapper(bo);
|
|
|
Page<GameRefereeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
@@ -71,8 +77,13 @@ public class GameRefereeServiceImpl implements IGameRefereeService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<GameRefereeVo> queryList(GameRefereeBo bo) {
|
|
|
- if (bo.getEventId() == null){
|
|
|
- bo.setEventId(RedisUtils.getCacheObject(GameEventConstant.DEFAULT_EVENT_ID));
|
|
|
+ if (bo.getEventId() == null) {
|
|
|
+ Object cacheObject = RedisUtils.getCacheObject(GameEventConstant.DEFAULT_EVENT_ID);
|
|
|
+ if (cacheObject instanceof Integer) {
|
|
|
+ bo.setEventId(((Integer) cacheObject).longValue()); // 显式转换为 Long 类型
|
|
|
+ } else if (cacheObject instanceof Long) {
|
|
|
+ bo.setEventId((Long) cacheObject);
|
|
|
+ }
|
|
|
}
|
|
|
LambdaQueryWrapper<GameReferee> lqw = buildQueryWrapper(bo);
|
|
|
return baseMapper.selectVoList(lqw);
|
|
@@ -96,8 +107,13 @@ public class GameRefereeServiceImpl implements IGameRefereeService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Boolean insertByBo(GameRefereeBo bo) {
|
|
|
- if (bo.getEventId() == null){
|
|
|
- bo.setEventId(RedisUtils.getCacheObject(GameEventConstant.DEFAULT_EVENT_ID));
|
|
|
+ if (bo.getEventId() == null) {
|
|
|
+ Object cacheObject = RedisUtils.getCacheObject(GameEventConstant.DEFAULT_EVENT_ID);
|
|
|
+ if (cacheObject instanceof Integer) {
|
|
|
+ bo.setEventId(((Integer) cacheObject).longValue()); // 显式转换为 Long 类型
|
|
|
+ } else if (cacheObject instanceof Long) {
|
|
|
+ bo.setEventId((Long) cacheObject);
|
|
|
+ }
|
|
|
}
|
|
|
GameReferee add = MapstructUtils.convert(bo, GameReferee.class);
|
|
|
validEntityBeforeSave(add);
|
|
@@ -116,8 +132,13 @@ public class GameRefereeServiceImpl implements IGameRefereeService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Boolean updateByBo(GameRefereeBo bo) {
|
|
|
- if (bo.getEventId() == null){
|
|
|
- bo.setEventId(RedisUtils.getCacheObject(GameEventConstant.DEFAULT_EVENT_ID));
|
|
|
+ if (bo.getEventId() == null) {
|
|
|
+ Object cacheObject = RedisUtils.getCacheObject(GameEventConstant.DEFAULT_EVENT_ID);
|
|
|
+ if (cacheObject instanceof Integer) {
|
|
|
+ bo.setEventId(((Integer) cacheObject).longValue()); // 显式转换为 Long 类型
|
|
|
+ } else if (cacheObject instanceof Long) {
|
|
|
+ bo.setEventId((Long) cacheObject);
|
|
|
+ }
|
|
|
}
|
|
|
GameReferee update = MapstructUtils.convert(bo, GameReferee.class);
|
|
|
validEntityBeforeSave(update);
|