|
@@ -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,6 +41,7 @@ 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;
|
|
@@ -53,6 +55,7 @@ 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;
|
|
@@ -61,6 +64,7 @@ import cn.com.qmth.examcloud.core.examwork.dao.entity.CourseGroupEntity;
|
|
|
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;
|
|
@@ -111,6 +115,9 @@ public class ExamController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
OrgCloudService orgCloudService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ExamOrgPropertyRepo examOrgPropertyRepo;
|
|
|
+
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|
|
@@ -568,7 +575,7 @@ public class ExamController extends ControllerSupport {
|
|
|
*/
|
|
|
@ApiOperation(value = "查询考试相关的学习中心设置", notes = "")
|
|
|
@GetMapping("getExamOrgList/{curPage}/{pageSize}")
|
|
|
- public Page<ExamOrgEntity> getExamOrgList(@PathVariable Integer curPage,
|
|
|
+ public PageInfo<ExamOrgDomain> getExamOrgList(@PathVariable Integer curPage,
|
|
|
@PathVariable Integer pageSize, @ModelAttribute ExamOrgDomain examOrgDomain) {
|
|
|
|
|
|
if (null == examOrgDomain.getExamId()) {
|
|
@@ -590,7 +597,38 @@ public class ExamController extends ControllerSupport {
|
|
|
Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
|
|
|
"updateTime");
|
|
|
Page<ExamOrgEntity> page = examOrgRepo.findAll(specification, pageable);
|
|
|
- return page;
|
|
|
+
|
|
|
+ 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;
|
|
|
}
|
|
|
|
|
|
/**
|