|
|
@@ -14,7 +14,6 @@ import org.dromara.business.domain.bo.TournamentBlindStructuresBo;
|
|
|
import org.dromara.business.domain.bo.TournamentsBo;
|
|
|
import org.dromara.business.domain.dto.ItemsPrizeDto;
|
|
|
import org.dromara.business.domain.dto.TournamentsDto;
|
|
|
-import org.dromara.business.domain.enums.GameTemplateStatus;
|
|
|
import org.dromara.business.domain.vo.*;
|
|
|
import org.dromara.business.mapper.*;
|
|
|
import org.dromara.business.service.ITournamentsTemplateService;
|
|
|
@@ -63,6 +62,8 @@ public class TournamentsTemplateServiceImpl implements ITournamentsTemplateServi
|
|
|
|
|
|
private final ParticipantsMapper participantsMapper;
|
|
|
|
|
|
+ private final ScheduleConfigMapper scheduleConfigMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询【请填写功能名称】
|
|
|
*
|
|
|
@@ -112,8 +113,11 @@ public class TournamentsTemplateServiceImpl implements ITournamentsTemplateServi
|
|
|
}
|
|
|
tournamentsVo.setItemsPrizeList(itemsPrizeList);
|
|
|
|
|
|
- String statusText= GameTemplateStatus.getDescriptionFromCode(tournamentsVo.getStatus());
|
|
|
- tournamentsVo.setStatusText(statusText);
|
|
|
+ if(tournamentsVo.getStatus()==1L){
|
|
|
+ tournamentsVo.setStatusText("使用中");
|
|
|
+ }else if(tournamentsVo.getStatus()==2L){
|
|
|
+ tournamentsVo.setStatusText("未使用");
|
|
|
+ }
|
|
|
}
|
|
|
int totalSignNum = participantsMapper.selectParticipantsTotal(tournamentId);
|
|
|
tournamentsVo.setSignNum(totalSignNum);
|
|
|
@@ -124,7 +128,7 @@ public class TournamentsTemplateServiceImpl implements ITournamentsTemplateServi
|
|
|
* 分页查询【请填写功能名称】列表
|
|
|
*
|
|
|
* @param bo 查询条件
|
|
|
- * @param pageQuery 分页参数
|
|
|
+ * @param pageQuery 分页参数2
|
|
|
* @return 【请填写功能名称】分页列表
|
|
|
*/
|
|
|
@Override
|
|
|
@@ -134,8 +138,13 @@ public class TournamentsTemplateServiceImpl implements ITournamentsTemplateServi
|
|
|
List<TournamentsVo> records = result.getRecords();
|
|
|
for (TournamentsVo record : records) {
|
|
|
Long tournamentId = record.getId();
|
|
|
- String statusText= GameTemplateStatus.getDescriptionFromCode(record.getStatus());
|
|
|
- record.setStatusText(statusText);
|
|
|
+
|
|
|
+ if(record.getStatus()==1L){
|
|
|
+ record.setStatusText("使用中");
|
|
|
+ }else if(record.getStatus()==2L){
|
|
|
+ record.setStatusText("未使用");
|
|
|
+ }
|
|
|
+
|
|
|
//赛事报名条件
|
|
|
TournamentEntryConditionsVo tournamentEntryConditionsVo = tournamentEntryConditionsMapper.selectByTournamentInfoTemplate(tournamentId);
|
|
|
if(tournamentEntryConditionsVo!=null){
|
|
|
@@ -272,6 +281,7 @@ public class TournamentsTemplateServiceImpl implements ITournamentsTemplateServi
|
|
|
|
|
|
//比赛ID
|
|
|
add.setTournamentsBiId(getCurrentDateTime()+bo.getGameType()+getRandomFourDigitNumber());
|
|
|
+ //未使用
|
|
|
add.setStatus(2L);
|
|
|
// 插入赛事主表
|
|
|
boolean flag = baseMapper.insertTournamentTemplate(add) > 0;
|
|
|
@@ -402,6 +412,10 @@ public class TournamentsTemplateServiceImpl implements ITournamentsTemplateServi
|
|
|
public Boolean updateByBo(TournamentsDto bo) {
|
|
|
try {
|
|
|
|
|
|
+ if(scheduleConfigMapper.selExitConfigByTemplateId(bo.getId())>0){
|
|
|
+ throw new RuntimeException("该模版已经被自动化配置了");
|
|
|
+ }
|
|
|
+
|
|
|
// 转换 BO -> Entity
|
|
|
TournamentsTemplate update = new TournamentsTemplate();
|
|
|
BeanUtils.copyProperties(bo, update);
|
|
|
@@ -469,8 +483,11 @@ public class TournamentsTemplateServiceImpl implements ITournamentsTemplateServi
|
|
|
*/
|
|
|
@Override
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
- if(isValid){
|
|
|
- //TODO 做一些业务上的校验,判断是否需要校验
|
|
|
+ // todo 删除模版 需要校验是否已经被 自动化配置了
|
|
|
+ for (Long templateId : ids) {
|
|
|
+ if(scheduleConfigMapper.selExitConfigByTemplateId(templateId)>0){
|
|
|
+ throw new RuntimeException("该模版已经被自动化配置了");
|
|
|
+ }
|
|
|
}
|
|
|
return baseMapper.deleteTournamentByIdsTemplate(ids) > 0;
|
|
|
}
|