|
@@ -1,7 +1,10 @@
|
|
package cn.com.qmth.examcloud.core.basic.service.impl;
|
|
package cn.com.qmth.examcloud.core.basic.service.impl;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.core.basic.dao.ExamSiteRepo;
|
|
|
|
-import cn.com.qmth.examcloud.core.basic.dao.entity.ExamSite;
|
|
|
|
|
|
+import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
|
|
|
|
+import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.exact;
|
|
|
|
+
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.Example;
|
|
import org.springframework.data.domain.Example;
|
|
@@ -9,11 +12,10 @@ import org.springframework.data.domain.ExampleMatcher;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
|
-import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.contains;
|
|
|
|
-import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatchers.exact;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.ExamSiteRepo;
|
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.entity.ExamSite;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class ExamSiteService {
|
|
public class ExamSiteService {
|
|
@@ -43,7 +45,7 @@ public class ExamSiteService {
|
|
private void checkCode(Long orgId, String code) {
|
|
private void checkCode(Long orgId, String code) {
|
|
ExamSite old = examSiteRepo.findFirstByOrgIdAndCode(orgId, code);
|
|
ExamSite old = examSiteRepo.findFirstByOrgIdAndCode(orgId, code);
|
|
if (old != null) {
|
|
if (old != null) {
|
|
- throw new RuntimeException("代码已存在");
|
|
|
|
|
|
+ throw new StatusException("B-710002", "考点代码已存在");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|