Bladeren bron

feat(physical): 更新比赛实体字段类型并添加游戏变体支持

- 将报名时间字段从Long类型改为String类型
- 在DTO中添加游戏变体(gameVariant)字段
- 在数据库查询中添加game_variant字段支持
- 在插入和更新操作中添加game_variant字段映射
- 优化比赛任务中的注释说明
fugui001 1 week geleden
bovenliggende
commit
e2a4c34212

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/job/business/TournamentTask.java

@@ -60,7 +60,7 @@ public class TournamentTask {
             if (tournament == null) {
                 continue;
             }
-            //校验状态是否是未开始的 防止重复进入 // 检查是否到达开始时间
+            //校验状态是否是未开始的 防止重复进入 // 检查是否到达开始时间 1
            // 获取 startTime 并转换为 LocalDateTime
             LocalDateTime startTime = tournament.getStartTime().toInstant()
                 .atZone(java.time.ZoneId.systemDefault())

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/domain/PhysicalTournaments.java

@@ -106,7 +106,7 @@ public class PhysicalTournaments extends BaseEntity {
     /**
      * 报名时间
      */
-    private Long signTime;
+    private String signTime;
 
     /**
      * 比赛图标

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/domain/dto/PhysicalTournamentsDto.java

@@ -23,6 +23,8 @@ public class PhysicalTournamentsDto {
     private Long gameType;
     private Long startingChips;
     private Long levelDuration;
+    private Long gameVariant;
+
 
     @NotNull(message = "报名截止等级不能为空")
     private Long lateRegistrationLevel;

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/domain/vo/PhysicalTournamentsVo.java

@@ -132,7 +132,7 @@ public class PhysicalTournamentsVo implements Serializable {
      * 报名时间
      */
     @ExcelProperty(value = "报名时间")
-    private Long signTime;
+    private String signTime;
 
     /**
      * 比赛图标

+ 6 - 3
ruoyi-modules/ruoyi-system/src/main/resources/mapper/physical/PhysicalTournamentsMapper.xml

@@ -11,11 +11,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectPhysicalTournamentsVoList" resultType="org.dromara.physical.domain.vo.PhysicalTournamentsVo">
-        SELECT id, name, start_time, end_time,game_type, starting_chips, level_duration, late_registration_level, max_players, status, created_at, updated_at,sign_time,competition_icon,tournaments_bi_id,robot_count,is_delete,delay_card_time,delay_card_num,action_time,competition_bg,min_players,competition_location,tournaments_introduction,league_tournament_id,league_tournament_region FROM physical_tournaments  ${ew.customSqlSegment}
+        SELECT id, name, start_time, end_time,game_type, starting_chips, level_duration, late_registration_level, max_players, status, created_at, updated_at,sign_time,competition_icon,tournaments_bi_id,robot_count,is_delete,delay_card_time,delay_card_num,action_time,competition_bg,min_players,competition_location,tournaments_introduction,league_tournament_id,league_tournament_region,game_variant FROM physical_tournaments  ${ew.customSqlSegment}
     </select>
 
     <select id="selectPhysicalTournamentsByIdInfo" resultType="org.dromara.physical.domain.vo.PhysicalTournamentsVo">
-        SELECT id, name, start_time, end_time,game_type, starting_chips, level_duration, late_registration_level, max_players, status, created_at, updated_at,sign_time,competition_icon,tournaments_bi_id,robot_count,is_delete,delay_card_time,delay_card_num,action_time,competition_bg,min_players,competition_location,tournaments_introduction,league_tournament_id,league_tournament_region FROM physical_tournaments WHERE id =  #{id}
+        SELECT id, name, start_time, end_time,game_type, starting_chips, level_duration, late_registration_level, max_players, status, created_at, updated_at,sign_time,competition_icon,tournaments_bi_id,robot_count,is_delete,delay_card_time,delay_card_num,action_time,competition_bg,min_players,competition_location,tournaments_introduction,league_tournament_id,league_tournament_region,game_variant FROM physical_tournaments WHERE id =  #{id}
     </select>
 
 
@@ -46,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="competitionLocation != null">competition_location = #{competitionLocation},</if>
             <if test="leagueTournamentId != null">league_tournament_id = #{leagueTournamentId},</if>
             <if test="leagueTournamentRegion != null">league_tournament_region = #{leagueTournamentRegion},</if>
+            <if test="gameVariant != null">game_variant = #{gameVariant},</if>
             <if test="tournamentsIntroduction != null">tournaments_introduction = #{tournamentsIntroduction}</if>
         </set>
         WHERE id = #{id}
@@ -79,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tournamentsIntroduction != null">tournaments_introduction,</if>
             <if test="leagueTournamentId != null">league_tournament_id,</if>
             <if test="leagueTournamentRegion != null">league_tournament_region,</if>
+            <if test="gameVariant != null">game_variant,</if>
         </trim>
         VALUES
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -106,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tournamentsIntroduction != null">#{tournamentsIntroduction},</if>
             <if test="leagueTournamentId != null">#{leagueTournamentId},</if>
             <if test="leagueTournamentRegion != null">#{leagueTournamentRegion},</if>
+            <if test="gameVariant != null">#{gameVariant},</if>
         </trim>
     </insert>
 
@@ -124,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectPhysicalTournamentsLeagueId" resultType="org.dromara.physical.domain.vo.PhysicalTournamentsVo">
-        SELECT id, name, start_time, end_time,game_type, starting_chips, level_duration, late_registration_level, max_players, status, created_at, updated_at,sign_time,competition_icon,tournaments_bi_id,robot_count,is_delete,delay_card_time,delay_card_num,action_time,competition_bg,min_players,competition_location,tournaments_introduction,league_tournament_id,league_tournament_region FROM physical_tournaments WHERE league_tournament_id =  #{leagueTournamentId}
+        SELECT id, name,game_variant,start_time, end_time,game_type, starting_chips, level_duration, late_registration_level, max_players, status, created_at, updated_at,sign_time,competition_icon,tournaments_bi_id,robot_count,is_delete,delay_card_time,delay_card_num,action_time,competition_bg,min_players,competition_location,tournaments_introduction,league_tournament_id,league_tournament_region FROM physical_tournaments WHERE league_tournament_id =  #{leagueTournamentId}
     </select>
 
 </mapper>