|
@@ -6,7 +6,9 @@ import java.util.List;
|
|
|
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.common.dto.core.*;
|
|
|
import cn.com.qmth.examcloud.common.util.BeanCopierUtil;
|
|
|
+import cn.com.qmth.examcloud.service.examwork.service.rpc.SpecialtyService;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -16,10 +18,6 @@ import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.common.dto.core.Course;
|
|
|
-import cn.com.qmth.examcloud.common.dto.core.Org;
|
|
|
-import cn.com.qmth.examcloud.common.dto.core.Student;
|
|
|
-import cn.com.qmth.examcloud.common.dto.core.User;
|
|
|
import cn.com.qmth.examcloud.common.dto.core.enums.UserType;
|
|
|
import cn.com.qmth.examcloud.common.util.ErrorMsg;
|
|
|
import cn.com.qmth.examcloud.common.util.excel.ExcelError;
|
|
@@ -62,6 +60,9 @@ public class ExamStudentService {
|
|
|
@Autowired
|
|
|
OrgService orgService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ SpecialtyService specialtyService;
|
|
|
+
|
|
|
|
|
|
// @Value("${app.em.photo.path}")
|
|
|
// private String PHOTO_PATH ;
|
|
@@ -247,6 +248,16 @@ public class ExamStudentService {
|
|
|
if(StringUtils.isEmpty(dto.getOrgCode())){
|
|
|
return new ExcelError("学习中心代码不能为空");
|
|
|
}
|
|
|
+// if(StringUtils.isEmpty(dto.getSpecialtyCode())){
|
|
|
+// return new ExcelError("专业代码不能为空");
|
|
|
+// }
|
|
|
+//
|
|
|
+// Specialty specialty = specialtyService.findByOrgIdAndCode(dto.getOrgId(),dto.getSpecialtyCode());
|
|
|
+// if(specialty == null || !specialty.getEnable()){
|
|
|
+// return new ExcelError("专业代码不存在/被禁用");
|
|
|
+// }
|
|
|
+// dto.setSpecialtyName(specialty.getName());
|
|
|
+
|
|
|
Course course = courseService.findByOrgIdAndCode(dto.getRootOrgId(), dto.getCourseCode());
|
|
|
if(course == null || !course.getEnable()){
|
|
|
return new ExcelError("课程不存在/被禁用");
|
|
@@ -349,7 +360,7 @@ public class ExamStudentService {
|
|
|
predicates.add(cb.like(root.get("examSite"),"%"+examCriteria.getExamSite()+"%"));
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(examCriteria.getIdentityNumber())){
|
|
|
- predicates.add(cb.equal(root.get("identityNumber"),examCriteria.getIdentityNumber()));
|
|
|
+ predicates.add(cb.like(root.get("identityNumber"),"%"+examCriteria.getIdentityNumber()+"%"));
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(examCriteria.getSpecialtyName())){
|
|
|
predicates.add(cb.like(root.get("specialtyName"),"%"+examCriteria.getSpecialtyName()+"%"));
|