|
@@ -13,10 +13,7 @@ import com.zanxiang.manage.domain.dto.GameTagDTO;
|
|
import com.zanxiang.manage.domain.params.*;
|
|
import com.zanxiang.manage.domain.params.*;
|
|
import com.zanxiang.manage.domain.vo.*;
|
|
import com.zanxiang.manage.domain.vo.*;
|
|
import com.zanxiang.manage.service.*;
|
|
import com.zanxiang.manage.service.*;
|
|
-import com.zanxiang.mybatis.entity.Cp;
|
|
|
|
-import com.zanxiang.mybatis.entity.Game;
|
|
|
|
-import com.zanxiang.mybatis.entity.GameApplet;
|
|
|
|
-import com.zanxiang.mybatis.entity.GameCategory;
|
|
|
|
|
|
+import com.zanxiang.mybatis.entity.*;
|
|
import com.zanxiang.mybatis.mapper.GameMapper;
|
|
import com.zanxiang.mybatis.mapper.GameMapper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -408,6 +405,16 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
|
|
//查询游戏
|
|
//查询游戏
|
|
Map<Long, String> gameMap = this.choiceList().stream()
|
|
Map<Long, String> gameMap = this.choiceList().stream()
|
|
.collect(Collectors.toMap(GameChoiceVO::getId, GameChoiceVO::getName));
|
|
.collect(Collectors.toMap(GameChoiceVO::getId, GameChoiceVO::getName));
|
|
|
|
+ //分类标签
|
|
|
|
+ List<Long> tagIds = new ArrayList<>();
|
|
|
|
+ if (param.getGameClassifyId() != null) {
|
|
|
|
+ if (Objects.equals(param.getIsParentClassify(), Boolean.TRUE)) {
|
|
|
|
+ tagIds = gameTagService.list(new LambdaQueryWrapper<GameTag>()
|
|
|
|
+ .eq(GameTag::getParentId, param.getGameClassifyId()))
|
|
|
|
+ .stream().map(GameTag::getId).collect(Collectors.toList());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ final List<Long> tagIdList = tagIds;
|
|
//执行查询
|
|
//执行查询
|
|
return page(param.toPage(), new QueryWrapper<Game>().lambda()
|
|
return page(param.toPage(), new QueryWrapper<Game>().lambda()
|
|
.eq(param.getCpId() != null, Game::getCpId, param.getCpId())
|
|
.eq(param.getCpId() != null, Game::getCpId, param.getCpId())
|
|
@@ -423,8 +430,13 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements Ga
|
|
"FIND_IN_SET({0}, classify)", String.valueOf(param.getGameClassifyId()))
|
|
"FIND_IN_SET({0}, classify)", String.valueOf(param.getGameClassifyId()))
|
|
//父标签查询
|
|
//父标签查询
|
|
.and(param.getGameClassifyId() != null && Objects.equals(param.getIsParentClassify(), Boolean.TRUE),
|
|
.and(param.getGameClassifyId() != null && Objects.equals(param.getIsParentClassify(), Boolean.TRUE),
|
|
- qw -> qw.apply("FIND_IN_SET({0}, classify)", String.valueOf(param.getGameClassifyId()))
|
|
|
|
- .or().apply("FIND_IN_SET({0}, classify_parent)", String.valueOf(param.getGameClassifyId())))
|
|
|
|
|
|
+ qw -> {
|
|
|
|
+ qw.apply("FIND_IN_SET({0}, classify)", String.valueOf(param.getGameClassifyId()));
|
|
|
|
+ for (Long tagId : tagIdList) {
|
|
|
|
+ qw.or().apply("FIND_IN_SET({0}, classify)", String.valueOf(tagId));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ )
|
|
.orderByDesc(Game::getCreateTime)
|
|
.orderByDesc(Game::getCreateTime)
|
|
).convert(game -> this.toVo(game, cpMap, gameCategoryMap, gameMap, gameTagMap));
|
|
).convert(game -> this.toVo(game, cpMap, gameCategoryMap, gameMap, gameTagMap));
|
|
}
|
|
}
|