Просмотр исходного кода

feat(game): 添加运动员性别和项目信息到成绩服务

- 在数据映射中添加运动员性别、项目类型和项目名称字段
- 为计时类项目逻辑添加项目类型和名称信息
- 在Excel导出功能中添加性别列显示(男/女)
- 在Excel导出中添加项目类型和项目名称列
- 调整Excel表格列顺序以包含新增字段
- 实现性别值转换逻辑(1为男,其他为女)
zhou 3 дней назад
Родитель
Сommit
07e02bf2d2

+ 14 - 1
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/impl/GameScoreServiceImpl.java

@@ -364,6 +364,9 @@ public class GameScoreServiceImpl implements IGameScoreService {
             data.put("teamId", athlete.getTeamId());
             data.put("athleteCode", athlete.getAthleteCode());
             data.put("name", athlete.getName());
+            data.put("gender", athlete.getGender());
+            data.put("projectType", project.getProjectType());
+            data.put("projectName", project.getProjectName());
             data.put("unit", athlete.getUnit());
             data.put("groupType", athlete.getGroupType());
             // data.put("number", athlete.getNumber());
@@ -468,6 +471,8 @@ public class GameScoreServiceImpl implements IGameScoreService {
             // 获取项目信息,判断是否为计时类项目
             GameEventProjectVo project = gameEventProjectService.queryById(projectId);
             boolean isTiming = isTimingProject(project);
+            data.put("projectType", project.getProjectType());
+            data.put("projectName", project.getProjectName());
 
             if (score != null) {
                 data.put("scoreId", score.getScoreId());
@@ -1731,6 +1736,9 @@ public class GameScoreServiceImpl implements IGameScoreService {
             data.put("teamId", athlete.getTeamId());
             data.put("athleteCode", athlete.getAthleteCode());
             data.put("name", athlete.getName());
+            data.put("gender", athlete.getGender());
+            data.put("projectType", project.getProjectType());
+            data.put("projectName", project.getProjectName());
             data.put("unit", athlete.getUnit());
             data.put("groupType", athlete.getGroupType());
 
@@ -1909,8 +1917,11 @@ public class GameScoreServiceImpl implements IGameScoreService {
                 createCellWithStyle(dataRow, colIndex++, i + 1, currentRowStyle); // 序号
                 createCellWithStyle(dataRow, colIndex++, data.get("teamCode"), currentRowStyle); // 队伍编号
                 createCellWithStyle(dataRow, colIndex++, data.get("teamName"), currentRowStyle); // 队伍名称
-                createCellWithStyle(dataRow, colIndex++, data.get("name"), currentRowStyle); // 姓名
                 createCellWithStyle(dataRow, colIndex++, data.get("athleteCode"), currentRowStyle); // 号码
+                createCellWithStyle(dataRow, colIndex++, data.get("name"), currentRowStyle); // 姓名
+                createCellWithStyle(dataRow, colIndex++, data.get("gender") == null ?  "" : data.get("gender").equals("1") ? "男" : "女", currentRowStyle); // 性别
+                createCellWithStyle(dataRow, colIndex++, data.get("projectType"), currentRowStyle); // 项目类型
+                createCellWithStyle(dataRow, colIndex++, data.get("projectName"), currentRowStyle); // 项目名称
                 createCellWithStyle(dataRow, colIndex++, data.get("individualPerformance"), currentRowStyle); // 个人成绩
                 createCellWithStyle(dataRow, colIndex++, data.get("scorePoint"), currentRowStyle); // 积分
                 createCellWithStyle(dataRow, colIndex++, data.get("scoreRank"), currentRowStyle); // 排名
@@ -1920,6 +1931,8 @@ public class GameScoreServiceImpl implements IGameScoreService {
                 createCellWithStyle(dataRow, colIndex++, i + 1, currentRowStyle); // 序号
                 createCellWithStyle(dataRow, colIndex++, data.get("teamCode"), currentRowStyle); // 队伍编号
                 createCellWithStyle(dataRow, colIndex++, data.get("teamName"), currentRowStyle); // 队伍名称
+                createCellWithStyle(dataRow, colIndex++, data.get("projectType"), currentRowStyle); // 项目类型
+                createCellWithStyle(dataRow, colIndex++, data.get("projectName"), currentRowStyle); // 项目名称
                 createCellWithStyle(dataRow, colIndex++, data.get("teamPerformance"), currentRowStyle); // 团队成绩
                 createCellWithStyle(dataRow, colIndex++, data.get("scorePoint"), currentRowStyle); // 积分
                 createCellWithStyle(dataRow, colIndex++, data.get("scoreRank"), currentRowStyle); // 排名