Răsfoiți Sursa

feat(tournaments): 添加项目名称字段并实现配置关联查询

- 在TournamentsVo中新增projectName字段用于存储项目名称
- 注入ITournamentConfigService服务依赖
- 在查询tournament列表时通过configId关联查询配置表获取项目名称
- 将查询到的项目名称设置到返回记录中展示
fugui001 1 săptămână în urmă
părinte
comite
b0d173e186

+ 5 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/vo/TournamentsVo.java

@@ -315,4 +315,9 @@ public class TournamentsVo implements Serializable {
     private  String categoryNameIds;
     private String remark;
 
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
 }

+ 7 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/service/impl/TournamentsServiceImpl.java

@@ -12,6 +12,7 @@ import org.dromara.business.domain.enums.GameStatus;
 import org.dromara.business.domain.vo.*;
 import org.dromara.business.mapper.*;
 import org.dromara.business.service.IBlindLevelsService;
+import org.dromara.business.service.ITournamentConfigService;
 import org.dromara.business.utils.DateTimeRangeUtils;
 import org.dromara.business.utils.RedisKeys;
 import org.dromara.business.utils.RedisUtil;
@@ -101,6 +102,8 @@ public class TournamentsServiceImpl implements ITournamentsService {
 
     private final TournamentCategoryTagMapper tournamentCategoryTagMapper;
 
+    private final ITournamentConfigService tournamentConfigService;
+
     @Autowired
     RedisUtil redisUtil;
 
@@ -243,6 +246,10 @@ public class TournamentsServiceImpl implements ITournamentsService {
             record.setCategoryName(category);
             record.setTagName(tag);
 
+            TournamentConfigVo tournamentConfigVo = tournamentConfigService.queryById(record.getConfigId());
+            if(tournamentConfigVo!=null){
+                record.setProjectName(tournamentConfigVo.getName());
+            }
         }
 
         return TableDataInfo.build(result);