|
|
@@ -5,6 +5,8 @@ import cn.idev.excel.event.AnalysisEventListener;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.dromara.business.domain.bo.BlindLevelsBo;
|
|
|
import org.dromara.business.domain.vo.BlindLevelsImportVo;
|
|
|
+import org.dromara.business.domain.vo.TournamentBlindStructuresVo;
|
|
|
+import org.dromara.business.mapper.TournamentBlindStructuresMapper;
|
|
|
import org.dromara.business.service.IBlindLevelsService;
|
|
|
import org.dromara.business.utils.BlindLevelsValidatorUtils;
|
|
|
import org.dromara.common.core.domain.R;
|
|
|
@@ -50,6 +52,9 @@ public class BlindStructuresServiceImpl implements IBlindStructuresService {
|
|
|
private final IBlindLevelsService blindLevelsService;
|
|
|
|
|
|
private final UserService userService;
|
|
|
+
|
|
|
+ private final TournamentBlindStructuresMapper tournamentBlindStructuresMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询【请填写功能名称】
|
|
|
*
|
|
|
@@ -201,6 +206,13 @@ public class BlindStructuresServiceImpl implements IBlindStructuresService {
|
|
|
//@Transactional(rollbackFor = Exception.class) // 开启事务
|
|
|
public R<Boolean> updateByBo(BlindStructuresBo bo, MultipartFile file) {
|
|
|
try {
|
|
|
+
|
|
|
+ TournamentBlindStructuresVo tournamentBlindStructuresVo = tournamentBlindStructuresMapper.selectTournamentBlindStructureByBlindStructureId(bo.getId());
|
|
|
+ //TODO已经在比赛中使用的盲注禁止删除和修改
|
|
|
+ if(tournamentBlindStructuresVo!=null){
|
|
|
+ return R.fail("该盲注正在使用中,请勿修改");
|
|
|
+ }
|
|
|
+
|
|
|
// 1. 转换 BO -> PO
|
|
|
BlindStructures update = MapstructUtils.convert(bo, BlindStructures.class);
|
|
|
validEntityBeforeSave(update);
|
|
|
@@ -282,6 +294,13 @@ public class BlindStructuresServiceImpl implements IBlindStructuresService {
|
|
|
if(isValid){
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
}
|
|
|
+ for (Long id : ids) {
|
|
|
+ TournamentBlindStructuresVo tournamentBlindStructuresVo = tournamentBlindStructuresMapper.selectTournamentBlindStructureByBlindStructureId(id);
|
|
|
+ //TODO已经在比赛中使用的盲注禁止删除和修改
|
|
|
+ if(tournamentBlindStructuresVo!=null){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
return baseMapper.deleteBlindStructuresByIds(ids) > 0;
|
|
|
}
|
|
|
|