Ver Fonte

。。。

wangwei há 5 anos atrás
pai
commit
cadc9b469c

+ 3 - 7
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/ExamCloudServiceProvider.java

@@ -188,12 +188,6 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
 		String name = req.getName();
 		String code = req.getCode();
 
-		if (null == id && StringUtils.isBlank(name)) {
-			throw new StatusException("002002", "id,name不能都为空");
-		}
-		if (null != id && StringUtils.isNotBlank(name)) {
-			throw new StatusException("002003", "id,name不能都不为空");
-		}
 		ExamEntity exam = null;
 
 		if (null != id) {
@@ -205,9 +199,11 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
 			exam = examRepo.findByNameAndRootOrgId(name, rootOrgId);
 		} else if (StringUtils.isNotBlank(code)) {
 			if (null == rootOrgId) {
-				throw new StatusException("002004", "rootOrgId is null");
+				throw new StatusException("002003", "rootOrgId is null");
 			}
 			exam = examRepo.findByCodeAndRootOrgId(code, rootOrgId);
+		} else {
+			throw new StatusException("002002", "id,name,code are all null");
 		}
 
 		if (null == exam) {