|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.dromara.common.core.exception.ServiceException;
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
@@ -337,6 +338,14 @@ public class GameAthleteServiceImpl implements IGameAthleteService {
|
|
*/
|
|
*/
|
|
private void validEntityBeforeSave(GameAthlete entity) {
|
|
private void validEntityBeforeSave(GameAthlete entity) {
|
|
//TODO 做一些数据校验,如唯一约束
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
|
+ //校验运动员编号是否存在重复值
|
|
|
|
+ if (entity.getAthleteCode() != null){
|
|
|
|
+ List<GameAthlete> list = baseMapper.selectList(new LambdaQueryWrapper<GameAthlete>()
|
|
|
|
+ .eq(GameAthlete::getAthleteCode, entity.getAthleteCode()));
|
|
|
|
+ if (!list.isEmpty()){
|
|
|
|
+ throw new ServiceException(entity.getName()+"的编号已存在!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|