|
@@ -9,9 +9,11 @@ import com.keao.edu.user.dao.ExamSongDao;
|
|
|
import com.keao.edu.user.entity.ExamSong;
|
|
|
import com.keao.edu.user.service.ExamSongService;
|
|
|
import com.keao.edu.util.collection.MapUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
@@ -27,6 +29,21 @@ public class ExamSongServiceImpl extends BaseServiceImpl<Integer, ExamSong> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public long insert(ExamSong examSong) {
|
|
|
+ if(StringUtils.isBlank(examSong.getSubjectList())){
|
|
|
+ throw new BizException("请选择专业");
|
|
|
+ }
|
|
|
+ if(Objects.isNull(examSong.getType())){
|
|
|
+ throw new BizException("请选择曲库类别");
|
|
|
+ }
|
|
|
+ List<ExamSong> existsExamSongs = examSongDao.getWithLevelAndType(examSong.getTenantId(), examSong.getLevelList(), examSong.getType());
|
|
|
+ if(!CollectionUtils.isEmpty(existsExamSongs)){
|
|
|
+ throw new BizException("{}级别的{}已存在",examSong.getLevelList(), examSong.getType().getMsg());
|
|
|
+ }
|
|
|
+ return super.insert(examSong);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public PageInfo<ExamSong> queryPage(QueryInfo queryInfo) {
|
|
|
PageInfo<ExamSong> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|