|
@@ -4,6 +4,7 @@ import static org.springframework.data.domain.ExampleMatcher.GenericPropertyMatc
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
@@ -40,25 +41,34 @@ import com.google.common.collect.Maps;
|
|
|
|
|
|
import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.commons.base.util.JsonUtil;
|
|
|
+import cn.com.qmth.examcloud.commons.web.helpers.page.PageInfo;
|
|
|
import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
|
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.api.controller.bean.CourseGroupBean;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.bean.OrgBean;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.request.GetOrgReq;
|
|
|
+import cn.com.qmth.examcloud.core.basic.api.response.GetOrgResp;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.api.controller.bean.CourseGroupDomain;
|
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamDomain;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamOrgDomain;
|
|
|
import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.CourseGroupRelationRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.CourseGroupRepo;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgPropertyRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamPropertyRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.CourseGroupEntity;
|
|
|
-import cn.com.qmth.examcloud.core.examwork.dao.entity.CourseGroupRelation;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.dao.entity.CourseGroupRelationEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgEntity;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgPropertyEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamPropertyEntity;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.enums.ExamType;
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.bean.ExamInfo;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.service.bean.ExamOrgInfo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.impl.ExamServiceImpl;
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.impl.ExamStudentServiceImpl;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -102,6 +112,12 @@ public class ExamController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
CourseGroupRelationRepo courseGroupRelationRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ OrgCloudService orgCloudService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ExamOrgPropertyRepo examOrgPropertyRepo;
|
|
|
+
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|
|
@@ -254,7 +270,6 @@ public class ExamController extends ControllerSupport {
|
|
|
domain.setRemark(one.getRemark());
|
|
|
domain.setRootOrgId(one.getRootOrgId());
|
|
|
domain.setStarted(one.getBeginTime().before(new Date()));
|
|
|
-
|
|
|
return domain;
|
|
|
}
|
|
|
|
|
@@ -268,29 +283,7 @@ public class ExamController extends ControllerSupport {
|
|
|
@ApiOperation(value = "新增考试批次", notes = "新增")
|
|
|
@PostMapping()
|
|
|
public ExamEntity addExam(@RequestBody ExamDomain domain) {
|
|
|
- trim(domain, true);
|
|
|
-
|
|
|
- User accessUser = getAccessUser();
|
|
|
-
|
|
|
- ExamInfo examInfo = new ExamInfo();
|
|
|
-
|
|
|
- examInfo.setBeginTime(domain.getBeginTime());
|
|
|
- examInfo.setDuration(domain.getDuration());
|
|
|
- examInfo.setEnable(true);
|
|
|
- examInfo.setEndTime(domain.getEndTime());
|
|
|
- examInfo.setExamTimes(domain.getExamTimes());
|
|
|
- examInfo.setExamType(domain.getExamType());
|
|
|
- examInfo.setId(domain.getId());
|
|
|
- examInfo.setName(domain.getName());
|
|
|
- examInfo.setRemark(domain.getRemark());
|
|
|
- examInfo.setRootOrgId(accessUser.getRootOrgId());
|
|
|
-
|
|
|
- Map<String, String> properties = domain.getProperties();
|
|
|
- examInfo.setProperties(properties);
|
|
|
-
|
|
|
- ExamEntity saved = examService.saveExam(examInfo);
|
|
|
-
|
|
|
- return saved;
|
|
|
+ return saveExam(domain);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -303,6 +296,17 @@ public class ExamController extends ControllerSupport {
|
|
|
@ApiOperation(value = "更新考试批次", notes = "更新")
|
|
|
@PutMapping()
|
|
|
public ExamEntity updateExam(@RequestBody ExamDomain domain) {
|
|
|
+ return saveExam(domain);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param domain
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private ExamEntity saveExam(ExamDomain domain) {
|
|
|
trim(domain, true);
|
|
|
|
|
|
User accessUser = getAccessUser();
|
|
@@ -310,7 +314,7 @@ public class ExamController extends ControllerSupport {
|
|
|
ExamInfo examInfo = new ExamInfo();
|
|
|
examInfo.setBeginTime(domain.getBeginTime());
|
|
|
examInfo.setDuration(domain.getDuration());
|
|
|
- examInfo.setEnable(true);
|
|
|
+ examInfo.setEnable(domain.getEnable());
|
|
|
examInfo.setEndTime(domain.getEndTime());
|
|
|
examInfo.setExamTimes(domain.getExamTimes());
|
|
|
examInfo.setExamType(domain.getExamType());
|
|
@@ -320,6 +324,9 @@ public class ExamController extends ControllerSupport {
|
|
|
examInfo.setRootOrgId(accessUser.getRootOrgId());
|
|
|
|
|
|
Map<String, String> properties = domain.getProperties();
|
|
|
+ if (null == properties) {
|
|
|
+ properties = Maps.newHashMap();
|
|
|
+ }
|
|
|
examInfo.setProperties(properties);
|
|
|
|
|
|
ExamEntity saved = examService.saveExam(examInfo);
|
|
@@ -406,19 +413,28 @@ public class ExamController extends ControllerSupport {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param examId
|
|
|
+ * @param curPage
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value = "查询课程组集合", notes = "")
|
|
|
- @GetMapping("queryCourseGroupList/{examId}/{curPage}/{pageSize}")
|
|
|
- public List<CourseGroupBean> queryCourseGroupList(@PathVariable Long examId,
|
|
|
+ @GetMapping("getCourseGroupListByExamId/{examId}/{curPage}/{pageSize}")
|
|
|
+ public List<CourseGroupDomain> getCourseGroupListByExamId(@PathVariable Long examId,
|
|
|
@PathVariable Integer curPage, @PathVariable Integer pageSize) {
|
|
|
|
|
|
Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
|
|
|
"updateTime");
|
|
|
List<CourseGroupEntity> groupList = courseGroupRepo.findAllByExamId(examId, pageable);
|
|
|
|
|
|
- List<CourseGroupBean> ret = Lists.newArrayList();
|
|
|
+ List<CourseGroupDomain> ret = Lists.newArrayList();
|
|
|
|
|
|
for (CourseGroupEntity curCourseGroup : groupList) {
|
|
|
- CourseGroupBean bean = new CourseGroupBean();
|
|
|
+ CourseGroupDomain bean = new CourseGroupDomain();
|
|
|
bean.setBeginTime(curCourseGroup.getBeginTime());
|
|
|
bean.setCreationTime(curCourseGroup.getCreationTime());
|
|
|
bean.setDescription(curCourseGroup.getDescription());
|
|
@@ -431,10 +447,10 @@ public class ExamController extends ControllerSupport {
|
|
|
List<Long> courseIdList = Lists.newArrayList();
|
|
|
bean.setCourseIdList(courseIdList);
|
|
|
|
|
|
- List<CourseGroupRelation> relationList = courseGroupRelationRepo
|
|
|
+ List<CourseGroupRelationEntity> relationList = courseGroupRelationRepo
|
|
|
.findAllByGroupId(bean.getId());
|
|
|
|
|
|
- for (CourseGroupRelation cur : relationList) {
|
|
|
+ for (CourseGroupRelationEntity cur : relationList) {
|
|
|
courseIdList.add(cur.getCourseId());
|
|
|
}
|
|
|
|
|
@@ -444,16 +460,24 @@ public class ExamController extends ControllerSupport {
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param examId
|
|
|
+ * @param courseId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value = "通过课程ID查询课程组集合", notes = "")
|
|
|
- @GetMapping("queryCourseGroupList/{examId}/{courseId}")
|
|
|
- public List<CourseGroupBean> queryCourseGroupList(@PathVariable Long examId,
|
|
|
+ @GetMapping("getCourseGroupListByExamIdAndCourseId/{examId}/{courseId}")
|
|
|
+ public List<CourseGroupDomain> getCourseGroupListByExamIdAndCourseId(@PathVariable Long examId,
|
|
|
@PathVariable Long courseId) {
|
|
|
|
|
|
- List<CourseGroupRelation> relationList = courseGroupRelationRepo
|
|
|
+ List<CourseGroupRelationEntity> relationList = courseGroupRelationRepo
|
|
|
.findAllByCourseIdAndExamId(courseId, examId);
|
|
|
|
|
|
List<Long> groupIdList = Lists.newArrayList();
|
|
|
- for (CourseGroupRelation cur : relationList) {
|
|
|
+ for (CourseGroupRelationEntity cur : relationList) {
|
|
|
Long groupId = cur.getGroupId();
|
|
|
groupIdList.add(groupId);
|
|
|
}
|
|
@@ -461,10 +485,10 @@ public class ExamController extends ControllerSupport {
|
|
|
List<CourseGroupEntity> groupList = courseGroupRepo
|
|
|
.findAllByIdInOrderByUpdateTimeDesc(groupIdList);
|
|
|
|
|
|
- List<CourseGroupBean> ret = Lists.newArrayList();
|
|
|
+ List<CourseGroupDomain> ret = Lists.newArrayList();
|
|
|
|
|
|
for (CourseGroupEntity curCourseGroup : groupList) {
|
|
|
- CourseGroupBean bean = new CourseGroupBean();
|
|
|
+ CourseGroupDomain bean = new CourseGroupDomain();
|
|
|
bean.setBeginTime(curCourseGroup.getBeginTime());
|
|
|
bean.setCreationTime(curCourseGroup.getCreationTime());
|
|
|
bean.setDescription(curCourseGroup.getDescription());
|
|
@@ -477,10 +501,10 @@ public class ExamController extends ControllerSupport {
|
|
|
List<Long> courseIdList = Lists.newArrayList();
|
|
|
bean.setCourseIdList(courseIdList);
|
|
|
|
|
|
- List<CourseGroupRelation> curRelationList = courseGroupRelationRepo
|
|
|
+ List<CourseGroupRelationEntity> curRelationList = courseGroupRelationRepo
|
|
|
.findAllByGroupId(bean.getId());
|
|
|
|
|
|
- for (CourseGroupRelation cur : curRelationList) {
|
|
|
+ for (CourseGroupRelationEntity cur : curRelationList) {
|
|
|
courseIdList.add(cur.getCourseId());
|
|
|
}
|
|
|
}
|
|
@@ -488,9 +512,16 @@ public class ExamController extends ControllerSupport {
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param courseGroupBean
|
|
|
+ * @param request
|
|
|
+ */
|
|
|
@ApiOperation(value = "更新课程组", notes = "")
|
|
|
@PutMapping("courseGroup")
|
|
|
- public void updateCourseGroup(@RequestBody CourseGroupBean courseGroupBean,
|
|
|
+ public void updateCourseGroup(@RequestBody CourseGroupDomain courseGroupBean,
|
|
|
HttpServletRequest request) {
|
|
|
|
|
|
CourseGroupEntity courseGroup = new CourseGroupEntity();
|
|
@@ -506,12 +537,12 @@ public class ExamController extends ControllerSupport {
|
|
|
courseGroupRepo.save(courseGroup);
|
|
|
List<Long> courseIdList = courseGroupBean.getCourseIdList();
|
|
|
|
|
|
- List<CourseGroupRelation> relationList = Lists.newArrayList();
|
|
|
+ List<CourseGroupRelationEntity> relationList = Lists.newArrayList();
|
|
|
|
|
|
courseGroupRelationRepo.deleteByGroupId(courseGroup.getId());
|
|
|
|
|
|
for (Long cur : courseIdList) {
|
|
|
- CourseGroupRelation relation = new CourseGroupRelation();
|
|
|
+ CourseGroupRelationEntity relation = new CourseGroupRelationEntity();
|
|
|
relation.setCourseId(cur);
|
|
|
relation.setExamId(courseGroupBean.getExamId());
|
|
|
relation.setGroupId(courseGroup.getId());
|
|
@@ -520,46 +551,181 @@ public class ExamController extends ControllerSupport {
|
|
|
courseGroupRelationRepo.save(relationList);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param id
|
|
|
+ */
|
|
|
@ApiOperation(value = "删除课程组", notes = "")
|
|
|
@DeleteMapping("courseGroup/{id}")
|
|
|
- public void deleteSpecificExam(@PathVariable Long id, HttpServletRequest request) {
|
|
|
+ public void deleteCourseGroup(@PathVariable Long id) {
|
|
|
courseGroupRepo.delete(id);
|
|
|
courseGroupRelationRepo.deleteByGroupId(id);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param curPage
|
|
|
+ * @param pageSize
|
|
|
+ * @param examOrgDomain
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value = "查询考试相关的学习中心设置", notes = "")
|
|
|
- @GetMapping("getExamOrgList/{examId}/{curPage}/{pageSize}")
|
|
|
- public List<?> getExamOrgList(@PathVariable Long examId, @PathVariable Integer curPage,
|
|
|
- @PathVariable Integer pageSize) {
|
|
|
- Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
|
|
|
- "updateTime");
|
|
|
- List<ExamOrgEntity> allByExamId = examOrgRepo.findAllByExamId(examId, pageable);
|
|
|
- return allByExamId;
|
|
|
+ @GetMapping("getExamOrgList/{curPage}/{pageSize}")
|
|
|
+ public PageInfo<ExamOrgDomain> getExamOrgList(@PathVariable Integer curPage,
|
|
|
+ @PathVariable Integer pageSize, @ModelAttribute ExamOrgDomain examOrgDomain) {
|
|
|
+
|
|
|
+ Long examId = examOrgDomain.getExamId();
|
|
|
+ if (null == examOrgDomain.getExamId()) {
|
|
|
+ throw new StatusException("E-001210", "examId is null");
|
|
|
+ }
|
|
|
+ ExamEntity examEntity = examRepo.findOne(examId);
|
|
|
+ if (null == examEntity) {
|
|
|
+ throw new StatusException("E-001250", "examId is wrong");
|
|
|
+ }
|
|
|
+ validateRootOrgIsolation(examEntity.getRootOrgId());
|
|
|
+
|
|
|
+ Specification<ExamOrgEntity> specification = (root, query, cb) -> {
|
|
|
+ List<Predicate> predicates = new ArrayList<>();
|
|
|
+
|
|
|
+ predicates.add(cb.equal(root.get("examId"), examOrgDomain.getExamId()));
|
|
|
+
|
|
|
+ if (null != examOrgDomain.getOrgId()) {
|
|
|
+ predicates.add(cb.equal(root.get("orgId"), examOrgDomain.getOrgId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
+ };
|
|
|
+
|
|
|
+ Pageable pageable = new PageRequest(curPage, pageSize, Sort.Direction.DESC, "updateTime");
|
|
|
+ Page<ExamOrgEntity> page = examOrgRepo.findAll(specification, pageable);
|
|
|
+
|
|
|
+ Iterator<ExamOrgEntity> iterator = page.iterator();
|
|
|
+ List<ExamOrgDomain> domainList = Lists.newArrayList();
|
|
|
+
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ ExamOrgEntity next = iterator.next();
|
|
|
+ ExamOrgDomain bean = new ExamOrgDomain();
|
|
|
+ domainList.add(bean);
|
|
|
+
|
|
|
+ bean.setBeginTime(next.getBeginTime());
|
|
|
+ bean.setEndTime(next.getEndTime());
|
|
|
+ bean.setExamId(next.getExamId());
|
|
|
+ bean.setId(next.getId());
|
|
|
+ bean.setOrgId(next.getOrgId());
|
|
|
+ bean.setRootOrgId(next.getRootOrgId());
|
|
|
+
|
|
|
+ List<ExamOrgPropertyEntity> propList = examOrgPropertyRepo
|
|
|
+ .findByexamIdAndOrgId(next.getExamId(), next.getOrgId());
|
|
|
+
|
|
|
+ Map<String, String> map = Maps.newHashMap();
|
|
|
+ for (ExamOrgPropertyEntity cur : propList) {
|
|
|
+ ExamProperty ep = ExamProperty.getByKeyId(cur.getKeyId());
|
|
|
+ map.put(ep.name(), cur.getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ bean.setProperties(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ PageInfo<ExamOrgDomain> ret = new PageInfo<ExamOrgDomain>();
|
|
|
+ ret.setList(domainList);
|
|
|
+ ret.setTotal(page.getTotalElements());
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param examOrg
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value = "新增考试相关的学习中心设置", notes = "")
|
|
|
@PostMapping("examOrg")
|
|
|
- public ExamOrgEntity addExamOrg(@RequestBody ExamOrgEntity examOrg) {
|
|
|
- ExamOrgEntity ret = examOrgRepo.save(examOrg);
|
|
|
- return ret;
|
|
|
+ public ExamOrgEntity addExamOrg(@RequestBody ExamOrgDomain domain) {
|
|
|
+ return saveExamOrg(domain);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param examOrg
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value = "更新考试相关的学习中心设置", notes = "")
|
|
|
@PutMapping("examOrg")
|
|
|
- public ExamOrgEntity updateExamOrg(@RequestBody ExamOrgEntity examOrg) {
|
|
|
- ExamOrgEntity ret = examOrgRepo.save(examOrg);
|
|
|
+ public ExamOrgEntity updateExamOrg(@RequestBody ExamOrgDomain domain) {
|
|
|
+ return saveExamOrg(domain);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param domain
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private ExamOrgEntity saveExamOrg(ExamOrgDomain domain) {
|
|
|
+ Long examId = domain.getExamId();
|
|
|
+
|
|
|
+ ExamEntity examEntity = examRepo.findOne(examId);
|
|
|
+ if (null == examEntity) {
|
|
|
+ throw new StatusException("E-001250", "examId is wrong");
|
|
|
+ }
|
|
|
+ validateRootOrgIsolation(examEntity.getRootOrgId());
|
|
|
+
|
|
|
+ Long orgId = domain.getOrgId();
|
|
|
+
|
|
|
+ GetOrgReq getOrgReq = new GetOrgReq();
|
|
|
+ getOrgReq.setOrgId(orgId);
|
|
|
+ GetOrgResp getOrgResp = orgCloudService.getOrg(getOrgReq);
|
|
|
+ OrgBean org = getOrgResp.getOrg();
|
|
|
+ org.getRootId();
|
|
|
+ validateRootOrgIsolation(org.getRootId());
|
|
|
+
|
|
|
+ User accessUser = getAccessUser();
|
|
|
+ ExamOrgInfo info = new ExamOrgInfo();
|
|
|
+ info.setBeginTime(domain.getBeginTime());
|
|
|
+ info.setEndTime(domain.getEndTime());
|
|
|
+ info.setExamId(domain.getExamId());
|
|
|
+ info.setOrgId(domain.getOrgId());
|
|
|
+ info.setRootOrgId(accessUser.getRootOrgId());
|
|
|
+
|
|
|
+ Map<String, String> properties = domain.getProperties();
|
|
|
+ if (null == properties) {
|
|
|
+ properties = Maps.newHashMap();
|
|
|
+ }
|
|
|
+ info.setProperties(domain.getProperties());
|
|
|
+
|
|
|
+ ExamOrgEntity ret = examService.saveExamOrg(info);
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param examId
|
|
|
+ * @param orgId
|
|
|
+ */
|
|
|
@ApiOperation(value = "删除考试相关的学习中心设置", notes = "")
|
|
|
@DeleteMapping("examOrg/{examId}/{orgId}")
|
|
|
public void deleteExamOrg(@PathVariable Long examId, @PathVariable Long orgId) {
|
|
|
- ExamOrgEntity examOrg = new ExamOrgEntity();
|
|
|
- examOrg.setExamId(examId);
|
|
|
- examOrg.setOrgId(orgId);
|
|
|
- examOrgRepo.delete(examOrg);
|
|
|
+ examOrgRepo.deleteByExamIdAndOrgId(examId, orgId);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 方法注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @param request
|
|
|
+ * @param examId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@ApiOperation(value = "考试IP限制", notes = "")
|
|
|
@GetMapping("ipLimit/{examId}")
|
|
|
public Map<String, Object> ipLimit(HttpServletRequest request, @PathVariable Long examId) {
|