|
|
@@ -158,9 +158,9 @@ public class TournamentsServiceImpl implements ITournamentsService {
|
|
|
tournamentsVo.setIsComplaints(false);
|
|
|
}
|
|
|
//查询类目和标签ID
|
|
|
- Long category = tournamentCategoryTagMapper.selectCategoryOrTagId("CATEGORY", tournamentId);
|
|
|
+ List<Long> category = tournamentCategoryTagMapper.selectCategoryOrTagId("CATEGORY", tournamentId);
|
|
|
tournamentsVo.setCategoryId(category);
|
|
|
- Long tag = tournamentCategoryTagMapper.selectCategoryOrTagId("TAG", tournamentId);
|
|
|
+ List<Long> tag = tournamentCategoryTagMapper.selectCategoryOrTagId("TAG", tournamentId);
|
|
|
tournamentsVo.setTagId(tag);
|
|
|
return tournamentsVo;
|
|
|
}
|
|
|
@@ -226,6 +226,12 @@ public class TournamentsServiceImpl implements ITournamentsService {
|
|
|
|
|
|
int totalSignNum = participantsMapper.selectParticipantsTotal(tournamentId);
|
|
|
record.setSignNum(totalSignNum);
|
|
|
+
|
|
|
+ List<String> category = tournamentCategoryTagMapper.selectNameCategoryOrTagId("CATEGORY", tournamentId);
|
|
|
+ List<String> tag = tournamentCategoryTagMapper.selectNameCategoryOrTagId("TAG", tournamentId);
|
|
|
+ record.setCategoryName(category);
|
|
|
+ record.setTagName(tag);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return TableDataInfo.build(result);
|
|
|
@@ -299,6 +305,17 @@ public class TournamentsServiceImpl implements ITournamentsService {
|
|
|
|
|
|
int totalSignNum = participantsMapper.selectParticipantsTotal(tournamentId);
|
|
|
record.setSignNum(totalSignNum);
|
|
|
+
|
|
|
+ List<String> category = tournamentCategoryTagMapper.selectNameCategoryOrTagId("CATEGORY", tournamentId);
|
|
|
+ List<String> tag = tournamentCategoryTagMapper.selectNameCategoryOrTagId("TAG", tournamentId);
|
|
|
+ if(!category.isEmpty()){
|
|
|
+ String categoryStr = String.join(",", category);
|
|
|
+ record.setCategoryNameIds(categoryStr);
|
|
|
+ }
|
|
|
+ if(!tag.isEmpty()){
|
|
|
+ String tagStr = String.join(",", tag);
|
|
|
+ record.setTagNameIds(tagStr);
|
|
|
+ }
|
|
|
}
|
|
|
return tournamentsVos;
|
|
|
}
|
|
|
@@ -510,26 +527,31 @@ public class TournamentsServiceImpl implements ITournamentsService {
|
|
|
}
|
|
|
|
|
|
//
|
|
|
- private void addCategoryTag(Long tournamentId, Long categoryId,Long tagId) {
|
|
|
- // 如果 categoryId 有值,则插入一条记录
|
|
|
- if (categoryId != null) {
|
|
|
- TournamentCategoryTag categoryTag = new TournamentCategoryTag();
|
|
|
- categoryTag.setTournamentId(tournamentId);
|
|
|
- categoryTag.setCategoryTagId(categoryId);
|
|
|
- tournamentCategoryTagMapper.insertTournamentCategoryTag(categoryTag);
|
|
|
+ private void addCategoryTag(Long tournamentId, List<Long> categoryIds, List<Long> tagIds) {
|
|
|
+ // 如果 categoryIds 有值,则为每个 categoryId 插入一条记录
|
|
|
+ if (CollectionUtils.isNotEmpty(categoryIds)) {
|
|
|
+ for (Long categoryId : categoryIds) {
|
|
|
+ TournamentCategoryTag categoryTag = new TournamentCategoryTag();
|
|
|
+ categoryTag.setTournamentId(tournamentId);
|
|
|
+ categoryTag.setCategoryTagId(categoryId);
|
|
|
+ tournamentCategoryTagMapper.insertTournamentCategoryTag(categoryTag);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- // 如果 tagId 有值,则插入一条记录
|
|
|
- if (tagId != null) {
|
|
|
- TournamentCategoryTag tag = new TournamentCategoryTag();
|
|
|
- tag.setTournamentId(tournamentId);
|
|
|
- tag.setCategoryTagId(tagId);
|
|
|
- tournamentCategoryTagMapper.insertTournamentCategoryTag(tag);
|
|
|
+ // 如果 tagIds 有值,则为每个 tagId 插入一条记录
|
|
|
+ if (CollectionUtils.isNotEmpty(tagIds)) {
|
|
|
+ for (Long tagId : tagIds) {
|
|
|
+ TournamentCategoryTag tag = new TournamentCategoryTag();
|
|
|
+ tag.setTournamentId(tournamentId);
|
|
|
+ tag.setCategoryTagId(tagId);
|
|
|
+ tournamentCategoryTagMapper.insertTournamentCategoryTag(tag);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
private void processPrizeDistributions(Long tournamentId, List<ItemsPrizeDto> itemsPrizeList) {
|
|
|
// 排序(按排名正序)
|
|
|
Collections.sort(itemsPrizeList, Comparator.comparing(ItemsPrizeDto::getRanking));
|