|
@@ -117,14 +117,6 @@ public class GameEventServiceImpl implements IGameEventService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public List<GameEventVo> queryList(GameEventBo bo) {
|
|
public List<GameEventVo> queryList(GameEventBo bo) {
|
|
- 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<GameEvent> lqw = buildQueryWrapper(bo);
|
|
LambdaQueryWrapper<GameEvent> lqw = buildQueryWrapper(bo);
|
|
return baseMapper.selectVoList(lqw);
|
|
return baseMapper.selectVoList(lqw);
|
|
}
|
|
}
|
|
@@ -151,14 +143,6 @@ public class GameEventServiceImpl implements IGameEventService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public Long insertByBo(GameEventBo bo) {
|
|
public Long insertByBo(GameEventBo bo) {
|
|
- 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);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
GameEvent add = MapstructUtils.convert(bo, GameEvent.class);
|
|
GameEvent add = MapstructUtils.convert(bo, GameEvent.class);
|
|
validEntityBeforeSave(add);
|
|
validEntityBeforeSave(add);
|
|
boolean flag = baseMapper.insert(add) > 0;
|
|
boolean flag = baseMapper.insert(add) > 0;
|
|
@@ -176,14 +160,6 @@ public class GameEventServiceImpl implements IGameEventService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public Boolean updateByBo(GameEventBo bo) {
|
|
public Boolean updateByBo(GameEventBo bo) {
|
|
- 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);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
GameEvent update = MapstructUtils.convert(bo, GameEvent.class);
|
|
GameEvent update = MapstructUtils.convert(bo, GameEvent.class);
|
|
validEntityBeforeSave(update);
|
|
validEntityBeforeSave(update);
|
|
boolean result = baseMapper.updateById(update) > 0;
|
|
boolean result = baseMapper.updateById(update) > 0;
|
|
@@ -1081,19 +1057,19 @@ public class GameEventServiceImpl implements IGameEventService {
|
|
// 没有组别,直接返回项目开始时间
|
|
// 没有组别,直接返回项目开始时间
|
|
return project.getStartTime();
|
|
return project.getStartTime();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// 有组别,找到最早的组别开始时间
|
|
// 有组别,找到最早的组别开始时间
|
|
Date earliestGroupTime = project.getGroups().stream()
|
|
Date earliestGroupTime = project.getGroups().stream()
|
|
.map(GroupProgressVo::getBeginTime)
|
|
.map(GroupProgressVo::getBeginTime)
|
|
.filter(Objects::nonNull)
|
|
.filter(Objects::nonNull)
|
|
.min(Date::compareTo)
|
|
.min(Date::compareTo)
|
|
.orElse(null);
|
|
.orElse(null);
|
|
-
|
|
|
|
|
|
+
|
|
// 如果组别时间存在,与项目时间比较,返回较早的时间
|
|
// 如果组别时间存在,与项目时间比较,返回较早的时间
|
|
if (earliestGroupTime != null && project.getStartTime() != null) {
|
|
if (earliestGroupTime != null && project.getStartTime() != null) {
|
|
return earliestGroupTime.before(project.getStartTime()) ? earliestGroupTime : project.getStartTime();
|
|
return earliestGroupTime.before(project.getStartTime()) ? earliestGroupTime : project.getStartTime();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// 如果组别时间不存在,返回项目时间
|
|
// 如果组别时间不存在,返回项目时间
|
|
return earliestGroupTime != null ? earliestGroupTime : project.getStartTime();
|
|
return earliestGroupTime != null ? earliestGroupTime : project.getStartTime();
|
|
}
|
|
}
|