ソースを参照

feat(physical): 更新盲注级别字段类型并优化查询逻辑

- 将 PhysicalBlindLevels 实体中的 isBreak 字段类型从 Long 修改为 Boolean
- 同步更新 PhysicalBlindLevelsBo 和 PhysicalBlindLevelsVo 中的 isBreak 字段类型
- 优化 PhysicalBlindLevelsMapper.xml 中的 SQL 查询语句,明确指定返回字段
- 修复 PhysicalBlindStructuresServiceImpl 中布尔值转换逻辑
- 简化 PhysicalTournamentsServiceImpl 中的导入语句并优化盲注级别查询逻辑
- 在 PhysicalBlindLevelsServiceImpl 中调整条件判断逻辑以适配新的 Boolean 类型
- 保留 PhysicalBlindLevelsMapper.xml 中 selectPhysicalBlindLevelsInfoObj 查询的结果类型映射
fugui001 1 ヶ月 前
コミット
85e5e3f40a

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

@@ -81,7 +81,7 @@ public class PhysicalBlindLevels extends BaseEntity {
     /**
      * 是否休息  true 1 是  false  0  否
      */
-    private Long isBreak;
+    private Boolean isBreak;
 
     /**
      * 休息时长

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

@@ -87,7 +87,7 @@ public class PhysicalBlindLevelsBo extends BaseEntity {
     /**
      * 是否休息  true 1 是  false  0  否
      */
-    private Long isBreak;
+    private Boolean isBreak;
 
     /**
      * 休息时长

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

@@ -100,7 +100,7 @@ public class PhysicalBlindLevelsVo implements Serializable {
      * 是否休息  true 1 是  false  0  否
      */
     //@ExcelProperty(value = "是否休息")
-    private Long isBreak;
+    private Boolean isBreak;
 
 
     @ExcelProperty(value = "是否休息")

+ 4 - 3
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/service/impl/PhysicalBlindLevelsServiceImpl.java

@@ -69,8 +69,8 @@ public class PhysicalBlindLevelsServiceImpl implements IPhysicalBlindLevelsServi
         LambdaQueryWrapper<PhysicalBlindLevels> lqw = buildQueryWrapper(bo);
         List<PhysicalBlindLevelsVo> physicalBlindLevelsVoList = baseMapper.selectPhysicalBlindLevelList(lqw);
         for (PhysicalBlindLevelsVo physicalBlindLevelsVo : physicalBlindLevelsVoList) {
-            Long isBreak = physicalBlindLevelsVo.getIsBreak();
-            if (isBreak == 1L) {
+            Boolean isBreak = physicalBlindLevelsVo.getIsBreak();
+            if (isBreak) {
                 physicalBlindLevelsVo.setIsBreakName("是");
             } else {
                 physicalBlindLevelsVo.setIsBreakName("否");
@@ -153,7 +153,8 @@ public class PhysicalBlindLevelsServiceImpl implements IPhysicalBlindLevelsServi
 
     @Override
     public List<PhysicalBlindLevelsVo> selectPhysicalBlindLevelsById(Long blindStructureId) {
-        return baseMapper.selectPhysicalBlindLevelsById(blindStructureId);
+        List<PhysicalBlindLevelsVo> physicalBlindLevelsVoList = baseMapper.selectPhysicalBlindLevelsById(blindStructureId);
+        return physicalBlindLevelsVoList;
     }
 
     @Override

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/service/impl/PhysicalBlindStructuresServiceImpl.java

@@ -184,7 +184,7 @@ public class PhysicalBlindStructuresServiceImpl implements IPhysicalBlindStructu
             levelBo.setDurationMinutes(vo.getDurationMinutes());
             levelBo.setCreateUserId(userId);
             levelBo.setDisplayOrder(vo.getDisplayOrder());
-            levelBo.setIsBreak(vo.getIsBreak());
+            levelBo.setIsBreak(vo.getIsBreak()==1?true:false);
             levelBo.setBreakDurationMinutes(vo.getBreakDurationMinutes());
             physicalBlindLevelsService.insertByBo(levelBo);
         }

+ 10 - 12
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/physical/service/impl/PhysicalTournamentsServiceImpl.java

@@ -20,10 +20,7 @@ import org.dromara.physical.domain.*;
 import org.dromara.physical.domain.bo.PhysicalTournamentsBo;
 import org.dromara.physical.domain.dto.PhysicalItemsPrizeDto;
 import org.dromara.physical.domain.dto.PhysicalTournamentsDto;
-import org.dromara.physical.domain.vo.PhysicalPrizeDistributionItemsVo;
-import org.dromara.physical.domain.vo.PhysicalPrizeDistributionsVo;
-import org.dromara.physical.domain.vo.PhysicalTournamentEntryConditionsVo;
-import org.dromara.physical.domain.vo.PhysicalTournamentsVo;
+import org.dromara.physical.domain.vo.*;
 import org.dromara.physical.mapper.*;
 import org.dromara.physical.service.IPhysicalTournamentsService;
 import org.springframework.beans.BeanUtils;
@@ -376,14 +373,11 @@ public class PhysicalTournamentsServiceImpl implements IPhysicalTournamentsServi
             //比赛ID
             add.setTournamentsBiId(getCurrentDateTime()+bo.getGameType()+getRandomFourDigitNumber());
             //取出对应盲注 本级别持续时间
-        /*    List<PhysicalBlindLevelsVo> blindLevelsVos = physicalBlindLevelsService.selectPhysicalBlindLevelsInfoObj(bo.getBlindStructureId());
-            if(blindLevelsVos.size()>0){
-                Long test = blindLevelsVos.get(0).getDurationMinutes();
-                add.setLevelDuration(blindLevelsVos.get(0).getDurationMinutes());
-            }*/
+            List<PhysicalBlindLevelsVo> blindLevelsVosList = physicalBlindLevelsService.selectPhysicalBlindLevelsInfoObj(bo.getBlindStructureId());
+            if(blindLevelsVosList.size()>0){
+                 add.setLevelDuration(blindLevelsVosList.get(0).getDurationMinutes());
+            }
             add.setIsDelete(false);
-
-
             // 插入赛事主表
             boolean flag = baseMapper.insertPhysicalTournaments(add) > 0;
             if (!flag) {
@@ -437,7 +431,11 @@ public class PhysicalTournamentsServiceImpl implements IPhysicalTournamentsServi
                log.error("奖励列表为空");
                return false;
            }
-
+            //取出对应盲注 本级别持续时间
+           List<PhysicalBlindLevelsVo> blindLevelsVosList = physicalBlindLevelsService.selectPhysicalBlindLevelsInfoObj(bo.getBlindStructureId());
+           if(blindLevelsVosList.size()>0){
+              update.setLevelDuration(blindLevelsVosList.get(0).getDurationMinutes());
+           }
            Long userId = LoginHelper.getUserId();
            update.setUpdateUserId(userId);
            // 处理开始时间

+ 6 - 2
ruoyi-modules/ruoyi-system/src/main/resources/mapper/physical/PhysicalBlindLevelsMapper.xml

@@ -154,13 +154,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ante,
             duration_minutes,
             created_at,
-            updated_at
+            updated_at,
+            is_break,
+            break_duration_minutes,
+            remark,
+            display_order
         FROM
             physical_blind_levels WHERE blind_structure_id =  #{blindStructureId}
     </select>
 
 
-    <select id="selectPhysicalBlindLevelsInfoObj" resultType="org.dromara.business.domain.vo.BlindLevelsVo">
+    <select id="selectPhysicalBlindLevelsInfoObj" resultType="org.dromara.physical.domain.vo.PhysicalBlindLevelsVo">
         select * from physical_blind_levels where blind_structure_id = #{blindStructureId} order by display_order asc
     </select>