|
@@ -35,6 +35,7 @@ import org.dromara.system.service.IGameEventService;
|
|
|
import org.dromara.system.service.IGameTeamService;
|
|
import org.dromara.system.service.IGameTeamService;
|
|
|
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.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -570,12 +571,15 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
|
|
|
* @return 是否删除成功
|
|
* @return 是否删除成功
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
if (isValid) {
|
|
if (isValid) {
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
}
|
|
}
|
|
|
//批量删除前,删除队伍中的关联数据
|
|
//批量删除前,删除队伍中的关联数据
|
|
|
removeAthleteFromTeams(ids);
|
|
removeAthleteFromTeams(ids);
|
|
|
|
|
+ //批量删除前,删除运动员的相关成绩
|
|
|
|
|
+ gameScoreMapper.deleteByAthleteIds(ids);
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -584,7 +588,8 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
|
|
|
*
|
|
*
|
|
|
* @param athleteIds 要移除的项目ID列表
|
|
* @param athleteIds 要移除的项目ID列表
|
|
|
*/
|
|
*/
|
|
|
- private void removeAthleteFromTeams(Collection<Long> athleteIds) {
|
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ public void removeAthleteFromTeams(Collection<Long> athleteIds) {
|
|
|
try {
|
|
try {
|
|
|
if (CollectionUtils.isEmpty(athleteIds)) {
|
|
if (CollectionUtils.isEmpty(athleteIds)) {
|
|
|
return;
|
|
return;
|