Selaa lähdekoodia

feat(tournaments): 添加机器人数量字段并更新相关映射和接口- 在 Tournaments 和 TournamentsTemplate 模型中添加 robotCount 字段
- 更新 TournamentsDto 和 TournamentsVo 中的 robotCount 字段
- 修改 TournamentsMapper 和 TournamentsTemplateMapper 的 XML 映射文件,包含 robotCount 字段
- 在 ScheduleTask 中设置机器人数量
- 注释掉 TournamentsTemplateServiceImpl 中的开始时间处理逻辑

fugui001 4 kuukautta sitten
vanhempi
commit
4504a774f0

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/Tournaments.java

@@ -102,4 +102,6 @@ public class Tournaments extends BaseEntity {
 
     private String tournamentsBiId;
 
+    private int robotCount;
+
 }

+ 2 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/TournamentsTemplate.java

@@ -102,4 +102,6 @@ public class TournamentsTemplate extends BaseEntity {
 
     private String tournamentsBiId;
 
+    private int robotCount;
+
 }

+ 6 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/dto/TournamentsDto.java

@@ -19,7 +19,7 @@ public class TournamentsDto {
     @NotBlank(message = "赛事名称不能为空")
     private String name;
 
-    @NotNull(message = "比赛开始时间不能为空")
+/*    @NotNull(message = "比赛开始时间不能为空")*/
     private String startTime;
 
     @NotBlank(message = "比赛类型不能为空")
@@ -58,4 +58,9 @@ public class TournamentsDto {
      */
     private int rewardPlayers;
 
+    /**
+     * 机器人数量
+     */
+    private int robotCount;
+
 }

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

@@ -189,4 +189,9 @@ public class TournamentsVo implements Serializable {
      */
     private int weekDaySize;
 
+    /**
+     * 机器人数量
+     */
+    private int robotCount;
+
 }

+ 2 - 2
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/service/impl/TournamentsTemplateServiceImpl.java

@@ -268,7 +268,7 @@ public class TournamentsTemplateServiceImpl implements ITournamentsTemplateServi
             Long userId = LoginHelper.getUserId();
             add.setCreateUserId(userId);
             // 处理开始时间
-            add.setStartTime(parseDateTime(bo.getStartTime()));
+            //add.setStartTime(parseDateTime(bo.getStartTime()));
 
             //比赛ID
             add.setTournamentsBiId(getCurrentDateTime()+bo.getGameType()+getRandomFourDigitNumber());
@@ -417,7 +417,7 @@ public class TournamentsTemplateServiceImpl implements ITournamentsTemplateServi
             Long userId = LoginHelper.getUserId();
             update.setUpdateUserId(userId);
             // 处理开始时间
-            update.setStartTime(parseDateTime(bo.getStartTime()));
+            //update.setStartTime(parseDateTime(bo.getStartTime()));
 
             // 插入赛事主表
             boolean flag = baseMapper.updateTournamentsByIdTemplate(update) > 0;

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

@@ -132,7 +132,7 @@ public class ScheduleTask {
                 bo.setCompetitionIcon(tournamentsVo.getCompetitionIcon());
                 bo.setRewardPlayers(tournamentsVo.getRewardPlayers());
                 bo.setSignTime(tournamentsVo.getSignTime());
-
+                bo.setRobotCount(tournamentsVo.getRobotCount());
                 //查询模版 赛事对应盲注
                 TournamentBlindStructuresVo tournamentBlindStructuresVo = tournamentBlindStructuresMapper.selectTournamentBlindStructureByTournamentIdTemplate(tournamentsVo.getId());
 

+ 8 - 4
ruoyi-modules/ruoyi-system/src/main/resources/mapper/business/TournamentsMapper.xml

@@ -10,11 +10,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectTournamentsVoList" resultType="org.dromara.business.domain.vo.TournamentsVo">
-        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 FROM 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 FROM tournaments  ${ew.customSqlSegment}
     </select>
 
     <select id="selectVoByIdInfo" resultType="org.dromara.business.domain.vo.TournamentsVo">
-       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 FROM 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 FROM tournaments WHERE id =  #{id}
     </select>
 
 
@@ -34,8 +34,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedAt != null">updated_at = #{updatedAt},</if>
             <if test="signTime != null">sign_time = #{signTime},</if>
             <if test="competitionIcon != null">competition_icon = #{competitionIcon},</if>
-            <if test="updateUserId != null">update_user_id = #{updateUserId}</if>
-            <if test="tournamentsBiId != null">tournaments_bi_id = #{tournamentsBiId}</if>
+            <if test="updateUserId != null">update_user_id = #{updateUserId},</if>
+            <if test="tournamentsBiId != null">tournaments_bi_id = #{tournamentsBiId},</if>
+            <if test="robotCount != null">robot_count = #{robotCount}</if>
+
         </set>
         WHERE id = #{id}
     </update>
@@ -57,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createUserId != null">create_user_id,</if>
             <if test="endTime != null">end_time,</if>
             <if test="tournamentsBiId != null">tournaments_bi_id,</if>
+            <if test="robotCount != null">robot_count,</if>
         </trim>
         VALUES
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -73,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createUserId != null">#{createUserId},</if>
             <if test="endTime != null">#{endTime},</if>
             <if test="tournamentsBiId != null">#{tournamentsBiId},</if>
+            <if test="robotCount != null">#{robotCount},</if>
         </trim>
     </insert>
 

+ 5 - 2
ruoyi-modules/ruoyi-system/src/main/resources/mapper/business/TournamentsTemplateMapper.xml

@@ -34,8 +34,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedAt != null">updated_at = #{updatedAt},</if>
             <if test="signTime != null">sign_time = #{signTime},</if>
             <if test="competitionIcon != null">competition_icon = #{competitionIcon},</if>
-            <if test="updateUserId != null">update_user_id = #{updateUserId}</if>
-            <if test="tournamentsBiId != null">tournaments_bi_id = #{tournamentsBiId}</if>
+            <if test="updateUserId != null">update_user_id = #{updateUserId},</if>
+            <if test="tournamentsBiId != null">tournaments_bi_id = #{tournamentsBiId},</if>
+            <if test="robotCount != null">robot_count = #{robotCount}</if>
         </set>
         WHERE id = #{id}
     </update>
@@ -57,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createUserId != null">create_user_id,</if>
             <if test="endTime != null">end_time,</if>
             <if test="tournamentsBiId != null">tournaments_bi_id,</if>
+            <if test="robotCount != null">robot_count,</if>
         </trim>
         VALUES
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -73,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createUserId != null">#{createUserId},</if>
             <if test="endTime != null">#{endTime},</if>
             <if test="tournamentsBiId != null">#{tournamentsBiId},</if>
+            <if test="robotCount != null">#{robotCount},</if>
         </trim>
     </insert>