|
@@ -14,9 +14,13 @@ import org.dromara.system.domain.GameEventProject;
|
|
import org.dromara.system.domain.GameScore;
|
|
import org.dromara.system.domain.GameScore;
|
|
import org.dromara.system.domain.GameTeam;
|
|
import org.dromara.system.domain.GameTeam;
|
|
import org.dromara.system.domain.vo.AthleteScoreVo;
|
|
import org.dromara.system.domain.vo.AthleteScoreVo;
|
|
|
|
+import org.dromara.system.domain.vo.GameEventProjectVo;
|
|
|
|
+import org.dromara.system.domain.vo.GameEventVo;
|
|
import org.dromara.system.mapper.GameEventProjectMapper;
|
|
import org.dromara.system.mapper.GameEventProjectMapper;
|
|
import org.dromara.system.mapper.GameScoreMapper;
|
|
import org.dromara.system.mapper.GameScoreMapper;
|
|
import org.dromara.system.mapper.GameTeamMapper;
|
|
import org.dromara.system.mapper.GameTeamMapper;
|
|
|
|
+import org.dromara.system.service.IGameEventProjectService;
|
|
|
|
+import org.dromara.system.service.IGameEventService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.dromara.system.domain.bo.GameAthleteBo;
|
|
import org.dromara.system.domain.bo.GameAthleteBo;
|
|
@@ -48,6 +52,10 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
|
|
@Autowired
|
|
@Autowired
|
|
private GameScoreMapper gameScoreMapper;
|
|
private GameScoreMapper gameScoreMapper;
|
|
|
|
|
|
|
|
+ private final IGameEventProjectService gameEventProjectService;
|
|
|
|
+
|
|
|
|
+ private final IGameEventService gameEventService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 根据赛事ID查询参赛者积分信息列表
|
|
* 根据赛事ID查询参赛者积分信息列表
|
|
*
|
|
*
|
|
@@ -129,7 +137,7 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
|
|
* @return 参赛队员
|
|
* @return 参赛队员
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public GameAthleteVo queryById(Long athleteId){
|
|
|
|
|
|
+ public GameAthleteVo queryById(Long athleteId) {
|
|
return baseMapper.selectVoById(athleteId);
|
|
return baseMapper.selectVoById(athleteId);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -144,6 +152,24 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
|
|
public TableDataInfo<GameAthleteVo> queryPageList(GameAthleteBo bo, PageQuery pageQuery) {
|
|
public TableDataInfo<GameAthleteVo> queryPageList(GameAthleteBo bo, PageQuery pageQuery) {
|
|
LambdaQueryWrapper<GameAthlete> lqw = buildQueryWrapper(bo);
|
|
LambdaQueryWrapper<GameAthlete> lqw = buildQueryWrapper(bo);
|
|
Page<GameAthleteVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
Page<GameAthleteVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
+ result.getRecords().stream()
|
|
|
|
+ .filter(vo -> StringUtils.isNotBlank(vo.getProjectValue())) // 过滤null和空字符串
|
|
|
|
+ .map(vo -> {
|
|
|
|
+ String[] projectIds = vo.getProjectValue().split(",");
|
|
|
|
+ List<GameEventProjectVo> projects =
|
|
|
|
+ gameEventProjectService.listProjectsByEventIdAndProjectIndex(
|
|
|
|
+ vo.getEventId(),
|
|
|
|
+ projectIds);
|
|
|
|
+ String projectNames = projects.stream()
|
|
|
|
+ .map(GameEventProjectVo::getProjectName)
|
|
|
|
+ .filter(StringUtils::isNotBlank) // 过滤项目名为空的情况
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
+ vo.setProjectValue(projectNames);
|
|
|
|
+ GameEventVo gameEventVo = gameEventService.queryById(vo.getEventId());
|
|
|
|
+ vo.setEventName(gameEventVo.getEventName());
|
|
|
|
+ return vo;
|
|
|
|
+ })
|
|
|
|
+ .collect(Collectors.toList()); // 收集结果
|
|
return TableDataInfo.build(result);
|
|
return TableDataInfo.build(result);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -205,7 +231,7 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
|
|
/**
|
|
/**
|
|
* 保存前的数据校验
|
|
* 保存前的数据校验
|
|
*/
|
|
*/
|
|
- private void validEntityBeforeSave(GameAthlete entity){
|
|
|
|
|
|
+ private void validEntityBeforeSave(GameAthlete entity) {
|
|
//TODO 做一些数据校验,如唯一约束
|
|
//TODO 做一些数据校验,如唯一约束
|
|
}
|
|
}
|
|
|
|
|
|
@@ -218,7 +244,7 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
- if(isValid){
|
|
|
|
|
|
+ if (isValid) {
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
}
|
|
}
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
return baseMapper.deleteByIds(ids) > 0;
|