|
@@ -249,4 +249,63 @@ public class StudentServiceImpl implements StudentService {
|
|
|
return saved;
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ * 实现
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ *
|
|
|
+ * @see
|
|
|
+ * cn.com.qmth.examcloud.core.basic.service.StudentService#getStudentInfo(
|
|
|
+ * java.lang.Long, java.lang.String, java.lang.String, java.lang.String)
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public StudentInfo getStudentInfo(Long rootOrgId, String identityNumber, String studentCode,
|
|
|
+ String securityPhone) {
|
|
|
+ Student s = null;
|
|
|
+ int count = 0;
|
|
|
+ if (StringUtils.isNotBlank(identityNumber)) {
|
|
|
+ count++;
|
|
|
+ s = studentRepo.findByIdentityNumberAndRootOrgId(identityNumber, rootOrgId);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(studentCode)) {
|
|
|
+ count++;
|
|
|
+ s = studentRepo.findByStudentCodeAndRootOrgId(studentCode, rootOrgId);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(securityPhone)) {
|
|
|
+ count++;
|
|
|
+ s = studentRepo.findBySecurityPhoneAndRootOrgId(securityPhone, rootOrgId);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (count > 1) {
|
|
|
+ throw new StatusException("B-160210",
|
|
|
+ "参数过多,只需要[identityNumber,studentCode,securityPhone]中的一个");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null == s) {
|
|
|
+ throw new StatusException("B-160211", "学生不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ StudentInfo info = new StudentInfo();
|
|
|
+ info.setId(s.getId());
|
|
|
+ info.setEnable(s.getEnable());
|
|
|
+ info.setIdentityNumber(s.getIdentityNumber());
|
|
|
+ info.setName(s.getName());
|
|
|
+ info.setOrgId(s.getOrgId());
|
|
|
+ if (null != s.getOrgId()) {
|
|
|
+ Org org = orgRepo.findOne(s.getOrgId());
|
|
|
+ if (null != org) {
|
|
|
+ info.setOrgCode(org.getCode());
|
|
|
+ info.setOrgName(org.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ info.setPhoneNumber(s.getPhoneNumber());
|
|
|
+ info.setPhotoPath(s.getPhotoPath());
|
|
|
+ info.setRemark(s.getRemark());
|
|
|
+ info.setRootOrgId(s.getRootOrgId());
|
|
|
+ info.setSecurityPhone(s.getSecurityPhone());
|
|
|
+ info.setStudentCode(s.getStudentCode());
|
|
|
+
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
}
|