Joburgess %!s(int64=5) %!d(string=hai) anos
pai
achega
31241004c7

+ 0 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamRegistrationDao.java

@@ -182,7 +182,6 @@ public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {
      * @describe 统计合作单位的招生人数
      * @author Joburgess
      * @date 2020.08.12
-     * @param organIds:
      * @return com.keao.edu.user.dto.OrganExamRegistStatisticsDto
      */
     List<OrganExamRegistStatisticsDto> getOrganExamRegistStatistics(Map<String, Object> params);

+ 8 - 2
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamSubjectSongServiceImpl.java

@@ -3,7 +3,6 @@ package com.keao.edu.user.service.impl;
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.common.exception.BizException;
 import com.keao.edu.common.page.PageInfo;
-import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.dao.ExamSongDao;
@@ -20,7 +19,6 @@ import com.keao.edu.user.page.ExamSubjectSongQueryInfo;
 import com.keao.edu.user.service.ExamSubjectSongService;
 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.transaction.annotation.Isolation;
@@ -65,6 +63,14 @@ public class ExamSubjectSongServiceImpl extends BaseServiceImpl<Long, ExamSubjec
 			throw new BizException("此状态考级项目不支持添加考级内容");
 		}
 
+		examSubjectSongs.stream()
+				.collect(Collectors.groupingBy(ExamSubjectSong::getExamSubjectId)).values().forEach(e->{
+			Set<Integer> levels = e.stream().map(ExamSubjectSong::getLevel).collect(Collectors.toSet());
+			if(levels.size()!=e.size()){
+				throw new BizException("考级内容等级重复");
+			}
+		});
+
 		List<ExamSubjectSong> existExamSubjectSongs=examSubjectSongDao.findByExam(examSubjectSongs.get(0).getExaminationBasicId());
 		Map<Long, List<Integer>> subjectLevelMap = new HashMap<>();
 		Set<Long> existSubjectIds = new HashSet<>();

+ 6 - 7
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -655,14 +655,13 @@
 			SUM(CASE WHEN YEAR(er.create_time_)!=YEAR(NOW()) THEN 1 ELSE 0 END) 'historyRegistStudentNum'
 		FROM
 			organization o
-			LEFT JOIN exam_registration er ON er.organ_id_ = o.id_
-		WHERE er.status_ IN ('AUDIT_WAIT', 'AUDIT_PASS', 'AUDIT_REJECT')
-		AND o.id_ IN
-		<foreach collection="organIds" item="organId" separator="," open="(" close=")">
-			#{organId}
-		</foreach>
+			LEFT JOIN exam_registration er ON er.organ_id_ = o.id_ AND er.status_ IN ('AUDIT_WAIT', 'AUDIT_PASS', 'AUDIT_REJECT')
+		WHERE o.id_ IN
+			<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+				#{organId}
+			</foreach>
 		GROUP BY
-			er.organ_id_
+			o.id_
 		ORDER BY o.id_
 		<include refid="global.limit"/>
 	</select>