wangwei 6 tahun lalu
induk
melakukan
c3afa40858

+ 4 - 6
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/StudentServiceImpl.java

@@ -48,8 +48,6 @@ public class StudentServiceImpl implements StudentService {
 	@Autowired
 	OrgService orgService;
 
-	private static final String JPG = ".jpg";
-
 	/**
 	 * 获取所有学生(分页)
 	 *
@@ -103,17 +101,17 @@ public class StudentServiceImpl implements StudentService {
 		if (null != orgId) {
 			Org org = orgRepo.findOne(orgId);
 			if (!org.getParentId().equals(rootOrgId)) {
-				throw new StatusException("B-160002", "机构错误");
+				throw new StatusException("B-160002", "orgId is wrong");
 			}
 		} else {
-			if (StringUtils.isBlank(orgName)) {
-				throw new StatusException("B-160003", "orgName is blank");
-			}
 			if (StringUtils.isBlank(orgCode)) {
 				throw new StatusException("B-160004", "orgCode is blank");
 			}
 			Org org = orgRepo.findByRootIdAndCode(rootOrgId, orgCode);
 			if (null == org) {
+				if (StringUtils.isBlank(orgName)) {
+					throw new StatusException("B-160003", "orgName is blank");
+				}
 				org = new Org();
 				org.setParentId(rootOrgId);
 				org.setCode(orgCode);