wangwei 6 năm trước cách đây
mục cha
commit
075919a282
28 tập tin đã thay đổi với 1400 bổ sung1400 xóa
  1. 14 14
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamController.java
  2. 5 5
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamStudentController.java
  3. 1 1
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/CourseDomain.java
  4. 1 1
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamCourseGroupDomain.java
  5. 1 1
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamDomain.java
  6. 1 1
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamOrgSettingsDomain.java
  7. 1 1
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamStudentDomain.java
  8. 5 5
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/ExamCloudServiceProvider.java
  9. 408 408
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/ExamStudentCloudServiceProvider.java
  10. 139 139
      examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/HandleSyncCloudServiceProvider.java
  11. 35 35
      examcloud-core-examwork-base/src/main/java/cn/com/qmth/examcloud/core/examwork/base/enums/ExamProperty.java
  12. 1 1
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupRelationEntity.java
  13. 1 1
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupSettingsEntity.java
  14. 86 86
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseRelationEntity.java
  15. 1 1
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamEntity.java
  16. 1 1
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamOrgPropertyEntity.java
  17. 57 57
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamPaperTypeRelationEntity.java
  18. 1 1
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamPropertyEntity.java
  19. 1 1
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamSpecialSettingsEntity.java
  20. 357 357
      examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamStudentEntity.java
  21. 1 1
      examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/ExamService.java
  22. 1 1
      examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/bean/ExamInfo.java
  23. 1 1
      examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/bean/ExamSpecialSettingsInfo.java
  24. 8 8
      examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamServiceImpl.java
  25. 2 2
      examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamStudentServiceImpl.java
  26. 108 108
      examcloud-core-examwork-starter/src/main/java/cn/com/qmth/examcloud/core/examwork/starter/CoreExamWorkApp.java
  27. 39 39
      examcloud-core-examwork-starter/src/main/java/cn/com/qmth/examcloud/core/examwork/starter/config/AppSelfInspection.java
  28. 123 123
      examcloud-core-examwork-starter/src/main/java/cn/com/qmth/examcloud/core/examwork/starter/config/DefaultWebMvcConfigurerAdapter.java

+ 14 - 14
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamController.java

@@ -45,20 +45,14 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.base.helpers.DynamicEnum;
-import cn.com.qmth.examcloud.commons.base.helpers.DynamicEnumManager;
-import cn.com.qmth.examcloud.commons.base.helpers.poi.ExcelWriter;
-import cn.com.qmth.examcloud.commons.base.util.DateUtil;
-import cn.com.qmth.examcloud.commons.base.util.DateUtil.DatePatterns;
-import cn.com.qmth.examcloud.commons.base.util.JsonUtil;
-import cn.com.qmth.examcloud.commons.base.util.RegExpUtil;
-import cn.com.qmth.examcloud.commons.web.config.SystemConfig;
-import cn.com.qmth.examcloud.commons.web.enums.DataExecutionStatus;
-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.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.helpers.DynamicEnum;
+import cn.com.qmth.examcloud.commons.helpers.DynamicEnumManager;
+import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
+import cn.com.qmth.examcloud.commons.util.DateUtil;
+import cn.com.qmth.examcloud.commons.util.JsonUtil;
+import cn.com.qmth.examcloud.commons.util.RegExpUtil;
+import cn.com.qmth.examcloud.commons.util.DateUtil.DatePatterns;
 import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
 import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
 import cn.com.qmth.examcloud.core.basic.api.bean.OrgBean;
@@ -101,6 +95,12 @@ import cn.com.qmth.examcloud.core.oe.admin.api.request.CheckExamIsStartedReq;
 import cn.com.qmth.examcloud.core.oe.admin.api.response.CheckExamIsStartedResp;
 import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
 import cn.com.qmth.examcloud.task.api.request.SyncExamReq;
+import cn.com.qmth.examcloud.web.config.SystemConfig;
+import cn.com.qmth.examcloud.web.enums.DataExecutionStatus;
+import cn.com.qmth.examcloud.web.helpers.page.PageInfo;
+import cn.com.qmth.examcloud.web.redis.RedisClient;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.ApiOperation;
 
 /**

+ 5 - 5
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamStudentController.java

@@ -30,11 +30,8 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.google.common.collect.Lists;
 
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.base.util.PathUtil;
-import cn.com.qmth.examcloud.commons.web.helpers.page.PageInfo;
-import cn.com.qmth.examcloud.commons.web.security.bean.User;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.util.PathUtil;
 import cn.com.qmth.examcloud.core.basic.api.CourseCloudService;
 import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
 import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
@@ -56,6 +53,9 @@ import cn.com.qmth.examcloud.core.examwork.service.bean.ExamStudentInfo;
 import cn.com.qmth.examcloud.core.oe.admin.api.ExamRecordCloudService;
 import cn.com.qmth.examcloud.core.oe.admin.api.request.CheckExamIsStartedReq;
 import cn.com.qmth.examcloud.core.oe.admin.api.response.CheckExamIsStartedResp;
+import cn.com.qmth.examcloud.web.helpers.page.PageInfo;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.ApiOperation;
 
 /**

+ 1 - 1
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/CourseDomain.java

@@ -1,6 +1,6 @@
 package cn.com.qmth.examcloud.core.examwork.api.controller.bean;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
 
 /**
  * 类注释

+ 1 - 1
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamCourseGroupDomain.java

@@ -5,7 +5,7 @@ import java.util.List;
 
 import org.springframework.format.annotation.DateTimeFormat;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
 
 /**
  * 考试--课程组

+ 1 - 1
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamDomain.java

@@ -7,8 +7,8 @@ import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
 import javax.validation.constraints.NotNull;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
 import cn.com.qmth.examcloud.core.examwork.dao.enums.ExamType;
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
 
 /**
  * 类注释

+ 1 - 1
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamOrgSettingsDomain.java

@@ -3,7 +3,7 @@ package cn.com.qmth.examcloud.core.examwork.api.controller.bean;
 import java.util.Date;
 import java.util.Map;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
 
 /**
  * 考试--机构设置

+ 1 - 1
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/bean/ExamStudentDomain.java

@@ -2,7 +2,7 @@ package cn.com.qmth.examcloud.core.examwork.api.controller.bean;
 
 import java.util.Date;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
 
 /**
  * 考生

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

@@ -26,11 +26,9 @@ import org.springframework.web.bind.annotation.RestController;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.base.helpers.DynamicEnum;
-import cn.com.qmth.examcloud.commons.base.helpers.DynamicEnumManager;
-import cn.com.qmth.examcloud.commons.web.enums.DataExecutionStatus;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.helpers.DynamicEnum;
+import cn.com.qmth.examcloud.commons.helpers.DynamicEnumManager;
 import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseRelationRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamPaperTypeRelationRepo;
@@ -78,6 +76,8 @@ import cn.com.qmth.examcloud.examwork.api.response.LockExamStudentsResp;
 import cn.com.qmth.examcloud.examwork.api.response.SaveExamResp;
 import cn.com.qmth.examcloud.examwork.api.response.SetExamPropertyResp;
 import cn.com.qmth.examcloud.examwork.api.response.UnlockExamStudentsResp;
+import cn.com.qmth.examcloud.web.enums.DataExecutionStatus;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.ApiOperation;
 
 /**

+ 408 - 408
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/ExamStudentCloudServiceProvider.java

@@ -1,408 +1,408 @@
-package cn.com.qmth.examcloud.core.examwork.api.provider;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.persistence.criteria.Predicate;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.domain.Pageable;
-import org.springframework.data.domain.Sort;
-import org.springframework.data.domain.Sort.Direction;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.google.common.collect.Lists;
-
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.core.basic.api.CourseCloudService;
-import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
-import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
-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.dao.ExamCourseRelationRepo;
-import cn.com.qmth.examcloud.core.examwork.dao.ExamPaperTypeRelationRepo;
-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.ExamEntity;
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudentEntity;
-import cn.com.qmth.examcloud.core.examwork.service.ExamStudentService;
-import cn.com.qmth.examcloud.core.examwork.service.bean.ExamStudentInfo;
-import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
-import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean;
-import cn.com.qmth.examcloud.examwork.api.request.CopyExamStudentsReq;
-import cn.com.qmth.examcloud.examwork.api.request.GetExamStudentPageReq;
-import cn.com.qmth.examcloud.examwork.api.request.GetExamStudentReq;
-import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
-import cn.com.qmth.examcloud.examwork.api.response.CopyExamStudentsResp;
-import cn.com.qmth.examcloud.examwork.api.response.GetExamStudentPageResp;
-import cn.com.qmth.examcloud.examwork.api.response.GetExamStudentResp;
-import cn.com.qmth.examcloud.examwork.api.response.SaveExamStudentResp;
-import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年7月18日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Transactional
-@RestController
-@RequestMapping("${$rmp.cloud.examwork}" + "examStudent")
-public class ExamStudentCloudServiceProvider extends ControllerSupport
-		implements
-			ExamStudentCloudService {
-
-	private static final long serialVersionUID = -89062090947597841L;
-
-	@Autowired
-	ExamRepo examRepo;
-
-	@Autowired
-	OrgCloudService orgCloudService;
-
-	@Autowired
-	ExamStudentService examStudentService;
-
-	@Autowired
-	StudentCloudService studentCloudService;
-
-	@Autowired
-	ExamStudentRepo examStudentRepo;
-
-	@Autowired
-	CourseCloudService courseCloudService;
-
-	@Autowired
-	ExamCourseRelationRepo examCourseRelationRepo;
-
-	@Autowired
-	ExamPaperTypeRelationRepo examPaperTypeRelationRepo;
-
-	@Autowired
-	DataSyncCloudService dataSyncCloudService;
-
-	@ApiOperation(value = "保存考生")
-	@PostMapping("saveExamStudent")
-	@Override
-	public SaveExamStudentResp saveExamStudent(@RequestBody SaveExamStudentReq req) {
-		trim(req);
-		ExamStudentInfo info = new ExamStudentInfo();
-		info.setCourseCode(req.getCourseCode());
-		info.setCourseName(req.getCourseName());
-		info.setCourseLevel(req.getCourseLevel());
-		info.setCourseId(req.getCourseId());
-		info.setRootOrgId(req.getRootOrgId());
-		info.setExamId(req.getExamId());
-		info.setExamName(req.getExamName());
-		info.setIdentityNumber(req.getIdentityNumber());
-		info.setPaperType(req.getPaperType());
-		info.setStudentCode(req.getStudentCode());
-		info.setStudentName(req.getStudentName());
-		info.setInfoCollector(req.getInfoCollector());
-		info.setGrade(req.getGrade());
-		info.setExamSite(req.getExamSite());
-		info.setSpecialtyName(req.getSpecialtyName());
-		info.setRemark(req.getRemark());
-
-		info.setExt1(req.getExt1());
-		info.setExt2(req.getExt2());
-		info.setExt3(req.getExt3());
-		info.setExt4(req.getExt4());
-		info.setExt5(req.getExt5());
-
-		ExamStudentInfo saved = examStudentService.saveExamStudent(info);
-
-		SaveExamStudentResp resp = new SaveExamStudentResp();
-
-		ExamStudentBean examStudentBean = new ExamStudentBean();
-		examStudentBean.setId(saved.getId());
-		examStudentBean.setCourseCode(saved.getCourseCode());
-		examStudentBean.setCourseLevel(saved.getCourseLevel());
-		examStudentBean.setCourseName(saved.getCourseName());
-		examStudentBean.setExamId(saved.getExamId());
-		examStudentBean.setExamName(saved.getExamName());
-		examStudentBean.setIdentityNumber(saved.getIdentityNumber());
-		examStudentBean.setStudentCode(saved.getStudentCode());
-		examStudentBean.setPaperType(saved.getPaperType());
-		examStudentBean.setRootOrgId(saved.getRootOrgId());
-		examStudentBean.setStudentName(saved.getStudentName());
-		examStudentBean.setGrade(saved.getGrade());
-		examStudentBean.setCourseId(saved.getCourseId());
-		examStudentBean.setInfoCollector(saved.getInfoCollector());
-		examStudentBean.setExamSite(saved.getExamSite());
-		examStudentBean.setOrgId(saved.getOrgId());
-		examStudentBean.setOrgCode(saved.getOrgCode());
-		examStudentBean.setOrgName(saved.getOrgName());
-
-		resp.setExamStudentBean(examStudentBean);
-
-		return resp;
-	}
-
-	@ApiOperation(value = "复制考生")
-	@PostMapping("copyExamStudents")
-	@Override
-	public CopyExamStudentsResp copyExamStudents(@RequestBody CopyExamStudentsReq req) {
-
-		Long examId1 = req.getExamId1();
-		Long examId2 = req.getExamId2();
-
-		if (null == examId1) {
-			throw new StatusException("E-210001", "examId1 is null");
-		}
-		if (null == examId2) {
-			throw new StatusException("E-210002", "examId2 is null");
-		}
-
-		ExamEntity exam1 = examRepo.findOne(examId1);
-		ExamEntity exam2 = examRepo.findOne(examId2);
-		if (null == exam1) {
-			throw new StatusException("E-210003", "ExamEntity is null");
-		}
-		if (null == exam2) {
-			throw new StatusException("E-210004", "ExamEntity is null");
-		}
-
-		if (!exam1.getRootOrgId().equals(exam2.getRootOrgId())) {
-			throw new StatusException("E-210005", "examId1 and examId2  is not matched");
-		}
-
-		final Long rootOrgId = exam1.getRootOrgId();
-
-		final long start = null == req.getStart() ? 1 : req.getStart();
-
-		Pageable pageable = new PageRequest(0, 10, Sort.Direction.ASC, "id");
-
-		Specification<ExamStudentEntity> specification = (root, query, cb) -> {
-			List<Predicate> predicates = new ArrayList<>();
-			predicates.add(cb.equal(root.get("rootOrgId"), rootOrgId));
-			predicates.add(cb.greaterThanOrEqualTo(root.get("id"), start));
-			predicates.add(cb.equal(root.get("examId"), examId1));
-
-			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
-		};
-
-		Page<ExamStudentEntity> page = examStudentRepo.findAll(specification, pageable);
-
-		Iterator<ExamStudentEntity> iterator = page.iterator();
-
-		List<Long> examStudentIds = Lists.newArrayList();
-
-		long next = start;
-		while (iterator.hasNext()) {
-			ExamStudentEntity es = iterator.next();
-
-			ExamStudentEntity finded = examStudentRepo.findByExamIdAndStudentIdAndCourseId(examId2,
-					es.getStudentId(), es.getCourseId());
-
-			if (null != finded) {
-				continue;
-			}
-
-			ExamStudentInfo one = new ExamStudentInfo();
-			one.setExamId(examId2);
-			one.setRootOrgId(es.getRootOrgId());
-
-			one.setCourseId(es.getCourseId());
-			one.setCourseCode(es.getCourseCode());
-			one.setCourseLevel(es.getCourseLevel());
-			one.setCourseName(es.getCourseName());
-
-			one.setOrgId(es.getOrgId());
-			one.setOrgCode(es.getOrgCode());
-
-			one.setStudentName(es.getName());
-			one.setStudentCode(es.getStudentCode());
-			one.setStudentId(es.getStudentId());
-			one.setIdentityNumber(es.getIdentityNumber());
-
-			one.setExamSite(es.getExamSite());
-			one.setGrade(es.getGrade());
-			one.setPaperType(es.getPaperType());
-			one.setRemark(es.getRemark());
-			one.setSpecialtyName(es.getSpecialtyName());
-			one.setInfoCollector(es.getInfoCollector());
-
-			one.setExt1(es.getExt1());
-			one.setExt2(es.getExt2());
-			one.setExt3(es.getExt3());
-			one.setExt4(es.getExt4());
-			one.setExt5(es.getExt5());
-
-			ExamStudentInfo saved = examStudentService.saveExamStudent(one);
-			examStudentIds.add(saved.getId());
-
-			next = es.getId();
-		}
-
-		if (next != start)
-
-		{
-			next++;
-		}
-
-		CopyExamStudentsResp resp = new CopyExamStudentsResp();
-		resp.setNext(next);
-		resp.setExamStudentIds(examStudentIds);
-
-		return resp;
-	}
-
-	@ApiOperation(value = "获取考生")
-	@PostMapping("getExamStudent")
-	@Override
-	public GetExamStudentResp getExamStudent(@RequestBody GetExamStudentReq req) {
-		Long examStudentId = req.getExamStudentId();
-
-		ExamStudentEntity saved = examStudentRepo.findOne(examStudentId);
-
-		ExamStudentBean examStudentBean = new ExamStudentBean();
-		examStudentBean.setId(saved.getId());
-		examStudentBean.setCourseCode(saved.getCourseCode());
-		examStudentBean.setCourseLevel(saved.getCourseLevel());
-		examStudentBean.setCourseName(saved.getCourseName());
-		examStudentBean.setExamId(saved.getExamId());
-		examStudentBean.setIdentityNumber(saved.getIdentityNumber());
-		examStudentBean.setStudentCode(saved.getStudentCode());
-		examStudentBean.setPaperType(saved.getPaperType());
-		examStudentBean.setRootOrgId(saved.getRootOrgId());
-		examStudentBean.setGrade(saved.getGrade());
-		examStudentBean.setCourseId(saved.getCourseId());
-		examStudentBean.setInfoCollector(saved.getInfoCollector());
-		examStudentBean.setExamSite(saved.getExamSite());
-		examStudentBean.setOrgId(saved.getOrgId());
-		examStudentBean.setOrgCode(saved.getOrgCode());
-		examStudentBean.setStudentName(saved.getName());
-		examStudentBean.setSpecialtyName(saved.getSpecialtyName());
-
-		GetExamStudentResp resp = new GetExamStudentResp();
-		resp.setExamStudentBean(examStudentBean);
-		return resp;
-	}
-
-	@ApiOperation(value = " 分页查询考生")
-	@PostMapping("getExamStudentPage")
-	@Override
-	public GetExamStudentPageResp getExamStudentPage(@RequestBody GetExamStudentPageReq req) {
-		Long rootOrgId = req.getRootOrgId();
-		String courseCode = req.getCourseCode();
-		String courseLevel = req.getCourseLevel();
-		String courseName = req.getCourseName();
-		Integer curPage = req.getCurPage();
-		Long examId = req.getExamId();
-		String examSite = req.getExamSite();
-		String identityNumber = req.getIdentityNumber();
-		String infoCollector = req.getInfoCollector();
-		Long orgId = req.getOrgId();
-		String specialtyName = req.getSpecialtyName();
-		String studentCode = req.getStudentCode();
-		String studentName = req.getStudentName();
-		Integer pageSize = req.getPageSize();
-
-		if (null == rootOrgId) {
-			throw new StatusException("E-210005", "rootOrgId is null");
-		}
-
-		Specification<ExamStudentEntity> specification = (root, query, cb) -> {
-			List<Predicate> predicates = new ArrayList<>();
-			predicates.add(cb.equal(root.get("rootOrgId"), rootOrgId));
-
-			if (null != orgId) {
-				predicates.add(cb.equal(root.get("orgId"), orgId));
-			}
-
-			if (null != examId) {
-				predicates.add(cb.equal(root.get("examId"), examId));
-			}
-			if (StringUtils.isNotEmpty(studentName)) {
-				predicates.add(cb.like(root.get("name"), toSqlSearchPattern(studentName)));
-			}
-			if (StringUtils.isNotEmpty(studentCode)) {
-				predicates.add(cb.like(root.get("studentCode"), toSqlSearchPattern(studentCode)));
-			}
-			if (StringUtils.isNotEmpty(courseCode)) {
-				predicates.add(cb.equal(root.get("courseCode"), courseCode));
-			}
-			if (StringUtils.isNotEmpty(courseLevel)) {
-				predicates.add(cb.equal(root.get("courseLevel"), courseLevel));
-			}
-			if (StringUtils.isNotEmpty(courseName)) {
-				predicates.add(cb.like(root.get("courseName"), toSqlSearchPattern(courseName)));
-			}
-			if (!StringUtils.isEmpty(examSite)) {
-				predicates.add(cb.like(root.get("examSite"), toSqlSearchPattern(examSite)));
-			}
-			if (StringUtils.isNotEmpty(identityNumber)) {
-				predicates.add(
-						cb.like(root.get("identityNumber"), toSqlSearchPattern(identityNumber)));
-			}
-			if (StringUtils.isNotEmpty(specialtyName)) {
-				predicates
-						.add(cb.like(root.get("specialtyName"), toSqlSearchPattern(specialtyName)));
-			}
-			if (StringUtils.isNotEmpty(infoCollector)) {
-				predicates
-						.add(cb.like(root.get("infoCollector"), toSqlSearchPattern(infoCollector)));
-			}
-
-			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
-		};
-
-		PageRequest pageRequest = new PageRequest(curPage, pageSize,
-				new Sort(Direction.DESC, "updateTime"));
-
-		Page<ExamStudentEntity> examStudents = examStudentRepo.findAll(specification, pageRequest);
-
-		List<ExamStudentBean> list = Lists.newArrayList();
-
-		for (ExamStudentEntity cur : examStudents) {
-			ExamEntity exam = examRepo.findOne(cur.getExamId());
-
-			GetOrgReq getOrgReq = new GetOrgReq();
-			getOrgReq.setOrgId(cur.getOrgId());
-			GetOrgResp getOrgResp = orgCloudService.getOrg(getOrgReq);
-			OrgBean org = getOrgResp.getOrg();
-
-			ExamStudentBean bean = new ExamStudentBean();
-			bean.setId(cur.getId());
-			bean.setExamId(exam.getId());
-			bean.setExamName(exam.getName());
-			bean.setStudentId(cur.getStudentId());
-			bean.setStudentName(cur.getName());
-			bean.setStudentCode(cur.getStudentCode());
-			bean.setIdentityNumber(cur.getIdentityNumber());
-			bean.setCourseCode(cur.getCourseCode());
-			bean.setCourseName(cur.getCourseName());
-			bean.setInfoCollector(cur.getInfoCollector());
-			bean.setOrgId(cur.getOrgId());
-			bean.setOrgCode(org.getCode());
-			bean.setOrgName(org.getName());
-			bean.setPaperType(cur.getPaperType());
-			bean.setGrade(cur.getGrade());
-			bean.setSpecialtyName(cur.getSpecialtyName());
-			bean.setExamSite(cur.getExamSite());
-
-			list.add(bean);
-		}
-
-		GetExamStudentPageResp resp = new GetExamStudentPageResp();
-		resp.setList(list);
-		resp.setTotal(examStudents.getTotalElements());
-
-		return resp;
-	}
-
-}
+package cn.com.qmth.examcloud.core.examwork.api.provider;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.persistence.criteria.Predicate;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.domain.Sort.Direction;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.google.common.collect.Lists;
+
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.core.basic.api.CourseCloudService;
+import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
+import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
+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.dao.ExamCourseRelationRepo;
+import cn.com.qmth.examcloud.core.examwork.dao.ExamPaperTypeRelationRepo;
+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.ExamEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudentEntity;
+import cn.com.qmth.examcloud.core.examwork.service.ExamStudentService;
+import cn.com.qmth.examcloud.core.examwork.service.bean.ExamStudentInfo;
+import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
+import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean;
+import cn.com.qmth.examcloud.examwork.api.request.CopyExamStudentsReq;
+import cn.com.qmth.examcloud.examwork.api.request.GetExamStudentPageReq;
+import cn.com.qmth.examcloud.examwork.api.request.GetExamStudentReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
+import cn.com.qmth.examcloud.examwork.api.response.CopyExamStudentsResp;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamStudentPageResp;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamStudentResp;
+import cn.com.qmth.examcloud.examwork.api.response.SaveExamStudentResp;
+import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年7月18日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Transactional
+@RestController
+@RequestMapping("${$rmp.cloud.examwork}" + "examStudent")
+public class ExamStudentCloudServiceProvider extends ControllerSupport
+		implements
+			ExamStudentCloudService {
+
+	private static final long serialVersionUID = -89062090947597841L;
+
+	@Autowired
+	ExamRepo examRepo;
+
+	@Autowired
+	OrgCloudService orgCloudService;
+
+	@Autowired
+	ExamStudentService examStudentService;
+
+	@Autowired
+	StudentCloudService studentCloudService;
+
+	@Autowired
+	ExamStudentRepo examStudentRepo;
+
+	@Autowired
+	CourseCloudService courseCloudService;
+
+	@Autowired
+	ExamCourseRelationRepo examCourseRelationRepo;
+
+	@Autowired
+	ExamPaperTypeRelationRepo examPaperTypeRelationRepo;
+
+	@Autowired
+	DataSyncCloudService dataSyncCloudService;
+
+	@ApiOperation(value = "保存考生")
+	@PostMapping("saveExamStudent")
+	@Override
+	public SaveExamStudentResp saveExamStudent(@RequestBody SaveExamStudentReq req) {
+		trim(req);
+		ExamStudentInfo info = new ExamStudentInfo();
+		info.setCourseCode(req.getCourseCode());
+		info.setCourseName(req.getCourseName());
+		info.setCourseLevel(req.getCourseLevel());
+		info.setCourseId(req.getCourseId());
+		info.setRootOrgId(req.getRootOrgId());
+		info.setExamId(req.getExamId());
+		info.setExamName(req.getExamName());
+		info.setIdentityNumber(req.getIdentityNumber());
+		info.setPaperType(req.getPaperType());
+		info.setStudentCode(req.getStudentCode());
+		info.setStudentName(req.getStudentName());
+		info.setInfoCollector(req.getInfoCollector());
+		info.setGrade(req.getGrade());
+		info.setExamSite(req.getExamSite());
+		info.setSpecialtyName(req.getSpecialtyName());
+		info.setRemark(req.getRemark());
+
+		info.setExt1(req.getExt1());
+		info.setExt2(req.getExt2());
+		info.setExt3(req.getExt3());
+		info.setExt4(req.getExt4());
+		info.setExt5(req.getExt5());
+
+		ExamStudentInfo saved = examStudentService.saveExamStudent(info);
+
+		SaveExamStudentResp resp = new SaveExamStudentResp();
+
+		ExamStudentBean examStudentBean = new ExamStudentBean();
+		examStudentBean.setId(saved.getId());
+		examStudentBean.setCourseCode(saved.getCourseCode());
+		examStudentBean.setCourseLevel(saved.getCourseLevel());
+		examStudentBean.setCourseName(saved.getCourseName());
+		examStudentBean.setExamId(saved.getExamId());
+		examStudentBean.setExamName(saved.getExamName());
+		examStudentBean.setIdentityNumber(saved.getIdentityNumber());
+		examStudentBean.setStudentCode(saved.getStudentCode());
+		examStudentBean.setPaperType(saved.getPaperType());
+		examStudentBean.setRootOrgId(saved.getRootOrgId());
+		examStudentBean.setStudentName(saved.getStudentName());
+		examStudentBean.setGrade(saved.getGrade());
+		examStudentBean.setCourseId(saved.getCourseId());
+		examStudentBean.setInfoCollector(saved.getInfoCollector());
+		examStudentBean.setExamSite(saved.getExamSite());
+		examStudentBean.setOrgId(saved.getOrgId());
+		examStudentBean.setOrgCode(saved.getOrgCode());
+		examStudentBean.setOrgName(saved.getOrgName());
+
+		resp.setExamStudentBean(examStudentBean);
+
+		return resp;
+	}
+
+	@ApiOperation(value = "复制考生")
+	@PostMapping("copyExamStudents")
+	@Override
+	public CopyExamStudentsResp copyExamStudents(@RequestBody CopyExamStudentsReq req) {
+
+		Long examId1 = req.getExamId1();
+		Long examId2 = req.getExamId2();
+
+		if (null == examId1) {
+			throw new StatusException("E-210001", "examId1 is null");
+		}
+		if (null == examId2) {
+			throw new StatusException("E-210002", "examId2 is null");
+		}
+
+		ExamEntity exam1 = examRepo.findOne(examId1);
+		ExamEntity exam2 = examRepo.findOne(examId2);
+		if (null == exam1) {
+			throw new StatusException("E-210003", "ExamEntity is null");
+		}
+		if (null == exam2) {
+			throw new StatusException("E-210004", "ExamEntity is null");
+		}
+
+		if (!exam1.getRootOrgId().equals(exam2.getRootOrgId())) {
+			throw new StatusException("E-210005", "examId1 and examId2  is not matched");
+		}
+
+		final Long rootOrgId = exam1.getRootOrgId();
+
+		final long start = null == req.getStart() ? 1 : req.getStart();
+
+		Pageable pageable = new PageRequest(0, 10, Sort.Direction.ASC, "id");
+
+		Specification<ExamStudentEntity> specification = (root, query, cb) -> {
+			List<Predicate> predicates = new ArrayList<>();
+			predicates.add(cb.equal(root.get("rootOrgId"), rootOrgId));
+			predicates.add(cb.greaterThanOrEqualTo(root.get("id"), start));
+			predicates.add(cb.equal(root.get("examId"), examId1));
+
+			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
+		};
+
+		Page<ExamStudentEntity> page = examStudentRepo.findAll(specification, pageable);
+
+		Iterator<ExamStudentEntity> iterator = page.iterator();
+
+		List<Long> examStudentIds = Lists.newArrayList();
+
+		long next = start;
+		while (iterator.hasNext()) {
+			ExamStudentEntity es = iterator.next();
+
+			ExamStudentEntity finded = examStudentRepo.findByExamIdAndStudentIdAndCourseId(examId2,
+					es.getStudentId(), es.getCourseId());
+
+			if (null != finded) {
+				continue;
+			}
+
+			ExamStudentInfo one = new ExamStudentInfo();
+			one.setExamId(examId2);
+			one.setRootOrgId(es.getRootOrgId());
+
+			one.setCourseId(es.getCourseId());
+			one.setCourseCode(es.getCourseCode());
+			one.setCourseLevel(es.getCourseLevel());
+			one.setCourseName(es.getCourseName());
+
+			one.setOrgId(es.getOrgId());
+			one.setOrgCode(es.getOrgCode());
+
+			one.setStudentName(es.getName());
+			one.setStudentCode(es.getStudentCode());
+			one.setStudentId(es.getStudentId());
+			one.setIdentityNumber(es.getIdentityNumber());
+
+			one.setExamSite(es.getExamSite());
+			one.setGrade(es.getGrade());
+			one.setPaperType(es.getPaperType());
+			one.setRemark(es.getRemark());
+			one.setSpecialtyName(es.getSpecialtyName());
+			one.setInfoCollector(es.getInfoCollector());
+
+			one.setExt1(es.getExt1());
+			one.setExt2(es.getExt2());
+			one.setExt3(es.getExt3());
+			one.setExt4(es.getExt4());
+			one.setExt5(es.getExt5());
+
+			ExamStudentInfo saved = examStudentService.saveExamStudent(one);
+			examStudentIds.add(saved.getId());
+
+			next = es.getId();
+		}
+
+		if (next != start)
+
+		{
+			next++;
+		}
+
+		CopyExamStudentsResp resp = new CopyExamStudentsResp();
+		resp.setNext(next);
+		resp.setExamStudentIds(examStudentIds);
+
+		return resp;
+	}
+
+	@ApiOperation(value = "获取考生")
+	@PostMapping("getExamStudent")
+	@Override
+	public GetExamStudentResp getExamStudent(@RequestBody GetExamStudentReq req) {
+		Long examStudentId = req.getExamStudentId();
+
+		ExamStudentEntity saved = examStudentRepo.findOne(examStudentId);
+
+		ExamStudentBean examStudentBean = new ExamStudentBean();
+		examStudentBean.setId(saved.getId());
+		examStudentBean.setCourseCode(saved.getCourseCode());
+		examStudentBean.setCourseLevel(saved.getCourseLevel());
+		examStudentBean.setCourseName(saved.getCourseName());
+		examStudentBean.setExamId(saved.getExamId());
+		examStudentBean.setIdentityNumber(saved.getIdentityNumber());
+		examStudentBean.setStudentCode(saved.getStudentCode());
+		examStudentBean.setPaperType(saved.getPaperType());
+		examStudentBean.setRootOrgId(saved.getRootOrgId());
+		examStudentBean.setGrade(saved.getGrade());
+		examStudentBean.setCourseId(saved.getCourseId());
+		examStudentBean.setInfoCollector(saved.getInfoCollector());
+		examStudentBean.setExamSite(saved.getExamSite());
+		examStudentBean.setOrgId(saved.getOrgId());
+		examStudentBean.setOrgCode(saved.getOrgCode());
+		examStudentBean.setStudentName(saved.getName());
+		examStudentBean.setSpecialtyName(saved.getSpecialtyName());
+
+		GetExamStudentResp resp = new GetExamStudentResp();
+		resp.setExamStudentBean(examStudentBean);
+		return resp;
+	}
+
+	@ApiOperation(value = " 分页查询考生")
+	@PostMapping("getExamStudentPage")
+	@Override
+	public GetExamStudentPageResp getExamStudentPage(@RequestBody GetExamStudentPageReq req) {
+		Long rootOrgId = req.getRootOrgId();
+		String courseCode = req.getCourseCode();
+		String courseLevel = req.getCourseLevel();
+		String courseName = req.getCourseName();
+		Integer curPage = req.getCurPage();
+		Long examId = req.getExamId();
+		String examSite = req.getExamSite();
+		String identityNumber = req.getIdentityNumber();
+		String infoCollector = req.getInfoCollector();
+		Long orgId = req.getOrgId();
+		String specialtyName = req.getSpecialtyName();
+		String studentCode = req.getStudentCode();
+		String studentName = req.getStudentName();
+		Integer pageSize = req.getPageSize();
+
+		if (null == rootOrgId) {
+			throw new StatusException("E-210005", "rootOrgId is null");
+		}
+
+		Specification<ExamStudentEntity> specification = (root, query, cb) -> {
+			List<Predicate> predicates = new ArrayList<>();
+			predicates.add(cb.equal(root.get("rootOrgId"), rootOrgId));
+
+			if (null != orgId) {
+				predicates.add(cb.equal(root.get("orgId"), orgId));
+			}
+
+			if (null != examId) {
+				predicates.add(cb.equal(root.get("examId"), examId));
+			}
+			if (StringUtils.isNotEmpty(studentName)) {
+				predicates.add(cb.like(root.get("name"), toSqlSearchPattern(studentName)));
+			}
+			if (StringUtils.isNotEmpty(studentCode)) {
+				predicates.add(cb.like(root.get("studentCode"), toSqlSearchPattern(studentCode)));
+			}
+			if (StringUtils.isNotEmpty(courseCode)) {
+				predicates.add(cb.equal(root.get("courseCode"), courseCode));
+			}
+			if (StringUtils.isNotEmpty(courseLevel)) {
+				predicates.add(cb.equal(root.get("courseLevel"), courseLevel));
+			}
+			if (StringUtils.isNotEmpty(courseName)) {
+				predicates.add(cb.like(root.get("courseName"), toSqlSearchPattern(courseName)));
+			}
+			if (!StringUtils.isEmpty(examSite)) {
+				predicates.add(cb.like(root.get("examSite"), toSqlSearchPattern(examSite)));
+			}
+			if (StringUtils.isNotEmpty(identityNumber)) {
+				predicates.add(
+						cb.like(root.get("identityNumber"), toSqlSearchPattern(identityNumber)));
+			}
+			if (StringUtils.isNotEmpty(specialtyName)) {
+				predicates
+						.add(cb.like(root.get("specialtyName"), toSqlSearchPattern(specialtyName)));
+			}
+			if (StringUtils.isNotEmpty(infoCollector)) {
+				predicates
+						.add(cb.like(root.get("infoCollector"), toSqlSearchPattern(infoCollector)));
+			}
+
+			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
+		};
+
+		PageRequest pageRequest = new PageRequest(curPage, pageSize,
+				new Sort(Direction.DESC, "updateTime"));
+
+		Page<ExamStudentEntity> examStudents = examStudentRepo.findAll(specification, pageRequest);
+
+		List<ExamStudentBean> list = Lists.newArrayList();
+
+		for (ExamStudentEntity cur : examStudents) {
+			ExamEntity exam = examRepo.findOne(cur.getExamId());
+
+			GetOrgReq getOrgReq = new GetOrgReq();
+			getOrgReq.setOrgId(cur.getOrgId());
+			GetOrgResp getOrgResp = orgCloudService.getOrg(getOrgReq);
+			OrgBean org = getOrgResp.getOrg();
+
+			ExamStudentBean bean = new ExamStudentBean();
+			bean.setId(cur.getId());
+			bean.setExamId(exam.getId());
+			bean.setExamName(exam.getName());
+			bean.setStudentId(cur.getStudentId());
+			bean.setStudentName(cur.getName());
+			bean.setStudentCode(cur.getStudentCode());
+			bean.setIdentityNumber(cur.getIdentityNumber());
+			bean.setCourseCode(cur.getCourseCode());
+			bean.setCourseName(cur.getCourseName());
+			bean.setInfoCollector(cur.getInfoCollector());
+			bean.setOrgId(cur.getOrgId());
+			bean.setOrgCode(org.getCode());
+			bean.setOrgName(org.getName());
+			bean.setPaperType(cur.getPaperType());
+			bean.setGrade(cur.getGrade());
+			bean.setSpecialtyName(cur.getSpecialtyName());
+			bean.setExamSite(cur.getExamSite());
+
+			list.add(bean);
+		}
+
+		GetExamStudentPageResp resp = new GetExamStudentPageResp();
+		resp.setList(list);
+		resp.setTotal(examStudents.getTotalElements());
+
+		return resp;
+	}
+
+}

+ 139 - 139
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/provider/HandleSyncCloudServiceProvider.java

@@ -1,139 +1,139 @@
-package cn.com.qmth.examcloud.core.examwork.api.provider;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import cn.com.qmth.examcloud.commons.api.HandleSyncCloudService;
-import cn.com.qmth.examcloud.commons.api.request.SyncCourseReq;
-import cn.com.qmth.examcloud.commons.api.request.SyncExamReq;
-import cn.com.qmth.examcloud.commons.api.request.SyncExamStudentReq;
-import cn.com.qmth.examcloud.commons.api.request.SyncOrgReq;
-import cn.com.qmth.examcloud.commons.api.request.SyncSpecialtyReq;
-import cn.com.qmth.examcloud.commons.api.request.SyncStudentReq;
-import cn.com.qmth.examcloud.commons.api.request.SyncUserReq;
-import cn.com.qmth.examcloud.commons.api.response.SyncCourseResp;
-import cn.com.qmth.examcloud.commons.api.response.SyncExamResp;
-import cn.com.qmth.examcloud.commons.api.response.SyncExamStudentResp;
-import cn.com.qmth.examcloud.commons.api.response.SyncOrgResp;
-import cn.com.qmth.examcloud.commons.api.response.SyncSpecialtyResp;
-import cn.com.qmth.examcloud.commons.api.response.SyncStudentResp;
-import cn.com.qmth.examcloud.commons.api.response.SyncUserResp;
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseRelationRepo;
-import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年9月18日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Transactional
-@RestController
-@RequestMapping("${$rmp.cloud.examwork}" + "dataSync")
-public class HandleSyncCloudServiceProvider extends ControllerSupport
-		implements
-			HandleSyncCloudService {
-
-	private static final long serialVersionUID = 9122543745597481498L;
-
-	@Autowired
-	ExamStudentRepo examStudentRepo;
-
-	@Autowired
-	ExamCourseRelationRepo examCourseRelationRepo;
-
-	@ApiOperation(value = "同步课程")
-	@PostMapping("syncCourse")
-	@Override
-	public SyncCourseResp syncCourse(@RequestBody SyncCourseReq req) {
-		String courseName = req.getName();
-		Long courseId = req.getId();
-		String courseLevel = req.getLevel();
-		Long rootOrgId = req.getRootOrgId();
-		Boolean enable = req.getEnable();
-
-		if (StringUtils.isBlank(courseName)) {
-			throw new StatusException("B-100001", "courseName is null");
-		}
-		if (null == courseId) {
-			throw new StatusException("B-100002", "courseId is null");
-		}
-		if (StringUtils.isBlank(courseLevel)) {
-			throw new StatusException("B-100003", "courseLevel is null");
-		}
-		if (null == rootOrgId) {
-			throw new StatusException("B-100004", "rootOrgId is null");
-		}
-
-		examStudentRepo.updateCourse(courseName, courseLevel, courseId);
-
-		examCourseRelationRepo.updateCourse(courseName, courseLevel, enable, courseId);
-
-		SyncCourseResp resp = new SyncCourseResp();
-		return resp;
-	}
-
-	@ApiOperation(value = "同步机构")
-	@PostMapping("syncOrg")
-	@Override
-	public SyncOrgResp syncOrg(@RequestBody SyncOrgReq req) {
-		return null;
-	}
-
-	@ApiOperation(value = "同步学生")
-	@PostMapping("syncStudent")
-	@Override
-	public SyncStudentResp syncStudent(@RequestBody SyncStudentReq req) {
-		String name = req.getName();
-		Long id = req.getId();
-		String studentCode = req.getStudentCode();
-
-		if (StringUtils.isBlank(name)) {
-			throw new StatusException("B-100001", "name is null");
-		}
-		if (null == id) {
-			throw new StatusException("B-100002", "id is null");
-		}
-
-		examStudentRepo.updateStudent(name, studentCode, id);
-		return null;
-	}
-
-	@ApiOperation(value = "同步考生")
-	@PostMapping("syncExamStudent")
-	@Override
-	public SyncExamStudentResp syncExamStudent(@RequestBody SyncExamStudentReq req) {
-		return null;
-	}
-
-	@ApiOperation(value = "同步专业")
-	@PostMapping("syncSpecialty")
-	@Override
-	public SyncSpecialtyResp syncSpecialty(@RequestBody SyncSpecialtyReq req) {
-		return null;
-	}
-
-	@ApiOperation(value = "同步考试")
-	@PostMapping("syncExam")
-	@Override
-	public SyncExamResp syncExam(@RequestBody SyncExamReq req) {
-		return null;
-	}
-
-	@ApiOperation(value = "同步考试")
-	@PostMapping("syncUser")
-	@Override
-	public SyncUserResp syncUser(@RequestBody SyncUserReq req) {
-		return null;
-	}
-
-}
+package cn.com.qmth.examcloud.core.examwork.api.provider;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import cn.com.qmth.examcloud.commons.api.HandleSyncCloudService;
+import cn.com.qmth.examcloud.commons.api.request.SyncCourseReq;
+import cn.com.qmth.examcloud.commons.api.request.SyncExamReq;
+import cn.com.qmth.examcloud.commons.api.request.SyncExamStudentReq;
+import cn.com.qmth.examcloud.commons.api.request.SyncOrgReq;
+import cn.com.qmth.examcloud.commons.api.request.SyncSpecialtyReq;
+import cn.com.qmth.examcloud.commons.api.request.SyncStudentReq;
+import cn.com.qmth.examcloud.commons.api.request.SyncUserReq;
+import cn.com.qmth.examcloud.commons.api.response.SyncCourseResp;
+import cn.com.qmth.examcloud.commons.api.response.SyncExamResp;
+import cn.com.qmth.examcloud.commons.api.response.SyncExamStudentResp;
+import cn.com.qmth.examcloud.commons.api.response.SyncOrgResp;
+import cn.com.qmth.examcloud.commons.api.response.SyncSpecialtyResp;
+import cn.com.qmth.examcloud.commons.api.response.SyncStudentResp;
+import cn.com.qmth.examcloud.commons.api.response.SyncUserResp;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseRelationRepo;
+import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年9月18日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Transactional
+@RestController
+@RequestMapping("${$rmp.cloud.examwork}" + "dataSync")
+public class HandleSyncCloudServiceProvider extends ControllerSupport
+		implements
+			HandleSyncCloudService {
+
+	private static final long serialVersionUID = 9122543745597481498L;
+
+	@Autowired
+	ExamStudentRepo examStudentRepo;
+
+	@Autowired
+	ExamCourseRelationRepo examCourseRelationRepo;
+
+	@ApiOperation(value = "同步课程")
+	@PostMapping("syncCourse")
+	@Override
+	public SyncCourseResp syncCourse(@RequestBody SyncCourseReq req) {
+		String courseName = req.getName();
+		Long courseId = req.getId();
+		String courseLevel = req.getLevel();
+		Long rootOrgId = req.getRootOrgId();
+		Boolean enable = req.getEnable();
+
+		if (StringUtils.isBlank(courseName)) {
+			throw new StatusException("B-100001", "courseName is null");
+		}
+		if (null == courseId) {
+			throw new StatusException("B-100002", "courseId is null");
+		}
+		if (StringUtils.isBlank(courseLevel)) {
+			throw new StatusException("B-100003", "courseLevel is null");
+		}
+		if (null == rootOrgId) {
+			throw new StatusException("B-100004", "rootOrgId is null");
+		}
+
+		examStudentRepo.updateCourse(courseName, courseLevel, courseId);
+
+		examCourseRelationRepo.updateCourse(courseName, courseLevel, enable, courseId);
+
+		SyncCourseResp resp = new SyncCourseResp();
+		return resp;
+	}
+
+	@ApiOperation(value = "同步机构")
+	@PostMapping("syncOrg")
+	@Override
+	public SyncOrgResp syncOrg(@RequestBody SyncOrgReq req) {
+		return null;
+	}
+
+	@ApiOperation(value = "同步学生")
+	@PostMapping("syncStudent")
+	@Override
+	public SyncStudentResp syncStudent(@RequestBody SyncStudentReq req) {
+		String name = req.getName();
+		Long id = req.getId();
+		String studentCode = req.getStudentCode();
+
+		if (StringUtils.isBlank(name)) {
+			throw new StatusException("B-100001", "name is null");
+		}
+		if (null == id) {
+			throw new StatusException("B-100002", "id is null");
+		}
+
+		examStudentRepo.updateStudent(name, studentCode, id);
+		return null;
+	}
+
+	@ApiOperation(value = "同步考生")
+	@PostMapping("syncExamStudent")
+	@Override
+	public SyncExamStudentResp syncExamStudent(@RequestBody SyncExamStudentReq req) {
+		return null;
+	}
+
+	@ApiOperation(value = "同步专业")
+	@PostMapping("syncSpecialty")
+	@Override
+	public SyncSpecialtyResp syncSpecialty(@RequestBody SyncSpecialtyReq req) {
+		return null;
+	}
+
+	@ApiOperation(value = "同步考试")
+	@PostMapping("syncExam")
+	@Override
+	public SyncExamResp syncExam(@RequestBody SyncExamReq req) {
+		return null;
+	}
+
+	@ApiOperation(value = "同步考试")
+	@PostMapping("syncUser")
+	@Override
+	public SyncUserResp syncUser(@RequestBody SyncUserReq req) {
+		return null;
+	}
+
+}

+ 35 - 35
examcloud-core-examwork-base/src/main/java/cn/com/qmth/examcloud/core/examwork/base/enums/ExamProperty.java

@@ -1,35 +1,35 @@
-package cn.com.qmth.examcloud.core.examwork.base.enums;
-
-import cn.com.qmth.examcloud.commons.base.helpers.DynamicEnumManager;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年8月6日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class ExamProperty {
-
-	private static DynamicEnumManager manager;
-
-	/**
-	 * 启动初始化
-	 *
-	 * @author WANGWEI
-	 */
-	public static void init() {
-		manager = DynamicEnumManager.newInstance("exam-properties.xml");
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	public static DynamicEnumManager getDynamicEnumManager() {
-		return manager;
-	}
-
-}
+package cn.com.qmth.examcloud.core.examwork.base.enums;
+
+import cn.com.qmth.examcloud.commons.helpers.DynamicEnumManager;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年8月6日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class ExamProperty {
+
+	private static DynamicEnumManager manager;
+
+	/**
+	 * 启动初始化
+	 *
+	 * @author WANGWEI
+	 */
+	public static void init() {
+		manager = DynamicEnumManager.newInstance("exam-properties.xml");
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @return
+	 */
+	public static DynamicEnumManager getDynamicEnumManager() {
+		return manager;
+	}
+
+}

+ 1 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupRelationEntity.java

@@ -6,7 +6,7 @@ import javax.persistence.Id;
 import javax.persistence.IdClass;
 import javax.persistence.Table;
 
-import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
+import cn.com.qmth.examcloud.web.jpa.JpaEntity;
 
 /**
  * 课程组关联课程

+ 1 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseGroupSettingsEntity.java

@@ -11,7 +11,7 @@ import javax.persistence.Table;
 
 import org.springframework.format.annotation.DateTimeFormat;
 
-import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
+import cn.com.qmth.examcloud.web.jpa.JpaEntity;
 
 /**
  * 考试--课程组设置

+ 86 - 86
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamCourseRelationEntity.java

@@ -1,86 +1,86 @@
-package cn.com.qmth.examcloud.core.examwork.dao.entity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.IdClass;
-import javax.persistence.Index;
-import javax.persistence.Table;
-
-import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
-
-@Entity
-@Table(name = "EC_E_EXAM_COURSE_RELATION", indexes = {
-		@Index(name = "IDX_E_E_C_R_008001", columnList = "courseId", unique = false)})
-@IdClass(ExamCourseRelationPK.class)
-public class ExamCourseRelationEntity extends JpaEntity {
-
-	private static final long serialVersionUID = 757531976286006550L;
-
-	@Id
-	private Long examId;
-
-	@Id
-	private Long courseId;
-
-	@Column(nullable = false)
-	private String courseName;
-
-	@Column(nullable = false)
-	private String courseCode;
-
-	@Column(nullable = false)
-	private String courseLevel;
-
-	@Column(nullable = false)
-	private Boolean courseEnable;
-
-	public Long getExamId() {
-		return examId;
-	}
-
-	public void setExamId(Long examId) {
-		this.examId = examId;
-	}
-
-	public Long getCourseId() {
-		return courseId;
-	}
-
-	public void setCourseId(Long courseId) {
-		this.courseId = courseId;
-	}
-
-	public String getCourseName() {
-		return courseName;
-	}
-
-	public void setCourseName(String courseName) {
-		this.courseName = courseName;
-	}
-
-	public String getCourseCode() {
-		return courseCode;
-	}
-
-	public void setCourseCode(String courseCode) {
-		this.courseCode = courseCode;
-	}
-
-	public String getCourseLevel() {
-		return courseLevel;
-	}
-
-	public void setCourseLevel(String courseLevel) {
-		this.courseLevel = courseLevel;
-	}
-
-	public Boolean getCourseEnable() {
-		return courseEnable;
-	}
-
-	public void setCourseEnable(Boolean courseEnable) {
-		this.courseEnable = courseEnable;
-	}
-
-}
+package cn.com.qmth.examcloud.core.examwork.dao.entity;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Index;
+import javax.persistence.Table;
+
+import cn.com.qmth.examcloud.web.jpa.JpaEntity;
+
+@Entity
+@Table(name = "EC_E_EXAM_COURSE_RELATION", indexes = {
+		@Index(name = "IDX_E_E_C_R_008001", columnList = "courseId", unique = false)})
+@IdClass(ExamCourseRelationPK.class)
+public class ExamCourseRelationEntity extends JpaEntity {
+
+	private static final long serialVersionUID = 757531976286006550L;
+
+	@Id
+	private Long examId;
+
+	@Id
+	private Long courseId;
+
+	@Column(nullable = false)
+	private String courseName;
+
+	@Column(nullable = false)
+	private String courseCode;
+
+	@Column(nullable = false)
+	private String courseLevel;
+
+	@Column(nullable = false)
+	private Boolean courseEnable;
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+	public Long getCourseId() {
+		return courseId;
+	}
+
+	public void setCourseId(Long courseId) {
+		this.courseId = courseId;
+	}
+
+	public String getCourseName() {
+		return courseName;
+	}
+
+	public void setCourseName(String courseName) {
+		this.courseName = courseName;
+	}
+
+	public String getCourseCode() {
+		return courseCode;
+	}
+
+	public void setCourseCode(String courseCode) {
+		this.courseCode = courseCode;
+	}
+
+	public String getCourseLevel() {
+		return courseLevel;
+	}
+
+	public void setCourseLevel(String courseLevel) {
+		this.courseLevel = courseLevel;
+	}
+
+	public Boolean getCourseEnable() {
+		return courseEnable;
+	}
+
+	public void setCourseEnable(Boolean courseEnable) {
+		this.courseEnable = courseEnable;
+	}
+
+}

+ 1 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamEntity.java

@@ -13,8 +13,8 @@ import javax.persistence.Table;
 
 import org.springframework.format.annotation.DateTimeFormat;
 
-import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.enums.ExamType;
+import cn.com.qmth.examcloud.web.jpa.JpaEntity;
 
 /**
  * Created by songyue on 17/1/13.

+ 1 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamOrgPropertyEntity.java

@@ -8,7 +8,7 @@ import javax.persistence.Index;
 import javax.persistence.Lob;
 import javax.persistence.Table;
 
-import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
+import cn.com.qmth.examcloud.web.jpa.JpaEntity;
 
 /**
  * 考试--机构属性配置

+ 57 - 57
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamPaperTypeRelationEntity.java

@@ -1,57 +1,57 @@
-package cn.com.qmth.examcloud.core.examwork.dao.entity;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.IdClass;
-import javax.persistence.Table;
-
-import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年9月21日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Entity
-@Table(name = "EC_E_EXAM_PT_RELATION")
-@IdClass(ExamPaperTypeRelationPK.class)
-public class ExamPaperTypeRelationEntity extends JpaEntity {
-
-	private static final long serialVersionUID = -5192942623365129036L;
-
-	@Id
-	private Long examId;
-
-	@Id
-	private Long courseId;
-
-	@Id
-	private String paperType;
-
-	public Long getExamId() {
-		return examId;
-	}
-
-	public void setExamId(Long examId) {
-		this.examId = examId;
-	}
-
-	public Long getCourseId() {
-		return courseId;
-	}
-
-	public void setCourseId(Long courseId) {
-		this.courseId = courseId;
-	}
-
-	public String getPaperType() {
-		return paperType;
-	}
-
-	public void setPaperType(String paperType) {
-		this.paperType = paperType;
-	}
-
-}
+package cn.com.qmth.examcloud.core.examwork.dao.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+
+import cn.com.qmth.examcloud.web.jpa.JpaEntity;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年9月21日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Entity
+@Table(name = "EC_E_EXAM_PT_RELATION")
+@IdClass(ExamPaperTypeRelationPK.class)
+public class ExamPaperTypeRelationEntity extends JpaEntity {
+
+	private static final long serialVersionUID = -5192942623365129036L;
+
+	@Id
+	private Long examId;
+
+	@Id
+	private Long courseId;
+
+	@Id
+	private String paperType;
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+	public Long getCourseId() {
+		return courseId;
+	}
+
+	public void setCourseId(Long courseId) {
+		this.courseId = courseId;
+	}
+
+	public String getPaperType() {
+		return paperType;
+	}
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
+	}
+
+}

+ 1 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamPropertyEntity.java

@@ -8,7 +8,7 @@ import javax.persistence.Index;
 import javax.persistence.Lob;
 import javax.persistence.Table;
 
-import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
+import cn.com.qmth.examcloud.web.jpa.JpaEntity;
 
 /**
  * 考试属性配置

+ 1 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamSpecialSettingsEntity.java

@@ -13,8 +13,8 @@ import javax.persistence.Table;
 
 import org.springframework.format.annotation.DateTimeFormat;
 
-import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.enums.ExamType;
+import cn.com.qmth.examcloud.web.jpa.JpaEntity;
 
 /**
  * 考试--特殊设置

+ 357 - 357
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/entity/ExamStudentEntity.java

@@ -1,357 +1,357 @@
-package cn.com.qmth.examcloud.core.examwork.dao.entity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Index;
-import javax.persistence.Table;
-
-import cn.com.qmth.examcloud.commons.web.jpa.JpaEntity;
-
-@Entity
-@Table(name = "EC_E_EXAM_STUDENT", indexes = {
-		@Index(name = "IDX_E_E_S_001001", columnList = "studentId,examId,courseId", unique = true),
-		@Index(name = "IDX_E_E_S_001002", columnList = "rootOrgId,name", unique = false),
-		@Index(name = "IDX_E_E_S_001003", columnList = "rootOrgId,studentCode", unique = false),
-		@Index(name = "IDX_E_E_S_001004", columnList = "rootOrgId,identityNumber", unique = false),
-		@Index(name = "IDX_E_E_S_001005", columnList = "courseId", unique = false),
-		@Index(name = "IDX_E_E_S_001006", columnList = "studentId", unique = false)})
-public class ExamStudentEntity extends JpaEntity {
-
-	private static final long serialVersionUID = 757531976286006550L;
-
-	@Id
-	@GeneratedValue
-	private Long id;
-
-	/**
-	 * 考试
-	 */
-	@Column(nullable = false)
-	private Long examId;
-
-	/**
-	 * 学生用户id
-	 */
-	@Column(nullable = false)
-	private Long studentId;
-
-	/**
-	 * 身份证号
-	 */
-	@Column(nullable = false)
-	private String identityNumber;
-
-	/**
-	 * 学号
-	 */
-	private String studentCode;
-
-	/**
-	 * 考生姓名
-	 */
-	@Column(nullable = false)
-	private String name;
-
-	/**
-	 * 学校id
-	 */
-	@Column(nullable = false)
-	private Long rootOrgId;
-
-	/**
-	 * 学习中心id
-	 */
-	@Column(nullable = false)
-	private Long orgId;
-
-	/**
-	 * 学习中心编码
-	 */
-	@Column(nullable = false)
-	private String orgCode;
-
-	/**
-	 * 课程ID
-	 */
-	@Column(nullable = false)
-	private Long courseId;
-
-	/**
-	 * 课程名称
-	 */
-	@Column(nullable = false)
-	private String courseName;
-
-	/**
-	 * 课程ID
-	 */
-	@Column(nullable = false)
-	private String courseCode;
-
-	/**
-	 * 课程等级
-	 */
-	@Column(nullable = false)
-	private String courseLevel;
-
-	/**
-	 * 试卷类型
-	 */
-	private String paperType;
-
-	/**
-	 * 专业名称
-	 */
-	private String specialtyName;
-
-	/**
-	 * 年级
-	 */
-	private String grade;
-
-	/**
-	 * 备注
-	 */
-	private String remark;
-
-	/**
-	 * 考点
-	 */
-	private String examSite;
-
-	/**
-	 * 信息采集人
-	 */
-	private String infoCollector;
-
-	@Column(nullable = false)
-	private Boolean enable;
-
-	/**
-	 * 扩展属性1
-	 */
-	private String ext1;
-
-	/**
-	 * 扩展属性2
-	 */
-	private String ext2;
-
-	/**
-	 * 扩展属性3
-	 */
-	private String ext3;
-
-	/**
-	 * 扩展属性4
-	 */
-	private String ext4;
-
-	/**
-	 * 扩展属性5
-	 */
-	private String ext5;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Long getStudentId() {
-		return studentId;
-	}
-
-	public void setStudentId(Long studentId) {
-		this.studentId = studentId;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public Long getExamId() {
-		return examId;
-	}
-
-	public void setExamId(Long examId) {
-		this.examId = examId;
-	}
-
-	public Long getRootOrgId() {
-		return rootOrgId;
-	}
-
-	public void setRootOrgId(Long rootOrgId) {
-		this.rootOrgId = rootOrgId;
-	}
-
-	public Long getOrgId() {
-		return orgId;
-	}
-
-	public void setOrgId(Long orgId) {
-		this.orgId = orgId;
-	}
-
-	public String getStudentCode() {
-		return studentCode;
-	}
-
-	public void setStudentCode(String studentCode) {
-		this.studentCode = studentCode;
-	}
-
-	public String getIdentityNumber() {
-		return identityNumber;
-	}
-
-	public void setIdentityNumber(String identityNumber) {
-		this.identityNumber = identityNumber;
-	}
-
-	public Long getCourseId() {
-		return courseId;
-	}
-
-	public void setCourseId(Long courseId) {
-		this.courseId = courseId;
-	}
-
-	public String getPaperType() {
-		return paperType;
-	}
-
-	public void setPaperType(String paperType) {
-		this.paperType = paperType;
-	}
-
-	public String getSpecialtyName() {
-		return specialtyName;
-	}
-
-	public void setSpecialtyName(String specialtyName) {
-		this.specialtyName = specialtyName;
-	}
-
-	public String getGrade() {
-		return grade;
-	}
-
-	public void setGrade(String grade) {
-		this.grade = grade;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public String getExamSite() {
-		return examSite;
-	}
-
-	public void setExamSite(String examSite) {
-		this.examSite = examSite;
-	}
-
-	public String getInfoCollector() {
-		return infoCollector;
-	}
-
-	public void setInfoCollector(String infoCollector) {
-		this.infoCollector = infoCollector;
-	}
-
-	public Boolean getEnable() {
-		return enable;
-	}
-
-	public void setEnable(Boolean enable) {
-		this.enable = enable;
-	}
-
-	public String getCourseLevel() {
-		return courseLevel;
-	}
-
-	public void setCourseLevel(String courseLevel) {
-		this.courseLevel = courseLevel;
-	}
-
-	public String getCourseCode() {
-		return courseCode;
-	}
-
-	public void setCourseCode(String courseCode) {
-		this.courseCode = courseCode;
-	}
-
-	public String getCourseName() {
-		return courseName;
-	}
-
-	public void setCourseName(String courseName) {
-		this.courseName = courseName;
-	}
-
-	public String getOrgCode() {
-		return orgCode;
-	}
-
-	public void setOrgCode(String orgCode) {
-		this.orgCode = orgCode;
-	}
-
-	public String getExt1() {
-		return ext1;
-	}
-
-	public void setExt1(String ext1) {
-		this.ext1 = ext1;
-	}
-
-	public String getExt2() {
-		return ext2;
-	}
-
-	public void setExt2(String ext2) {
-		this.ext2 = ext2;
-	}
-
-	public String getExt3() {
-		return ext3;
-	}
-
-	public void setExt3(String ext3) {
-		this.ext3 = ext3;
-	}
-
-	public String getExt4() {
-		return ext4;
-	}
-
-	public void setExt4(String ext4) {
-		this.ext4 = ext4;
-	}
-
-	public String getExt5() {
-		return ext5;
-	}
-
-	public void setExt5(String ext5) {
-		this.ext5 = ext5;
-	}
-
-}
+package cn.com.qmth.examcloud.core.examwork.dao.entity;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.Table;
+
+import cn.com.qmth.examcloud.web.jpa.JpaEntity;
+
+@Entity
+@Table(name = "EC_E_EXAM_STUDENT", indexes = {
+		@Index(name = "IDX_E_E_S_001001", columnList = "studentId,examId,courseId", unique = true),
+		@Index(name = "IDX_E_E_S_001002", columnList = "rootOrgId,name", unique = false),
+		@Index(name = "IDX_E_E_S_001003", columnList = "rootOrgId,studentCode", unique = false),
+		@Index(name = "IDX_E_E_S_001004", columnList = "rootOrgId,identityNumber", unique = false),
+		@Index(name = "IDX_E_E_S_001005", columnList = "courseId", unique = false),
+		@Index(name = "IDX_E_E_S_001006", columnList = "studentId", unique = false)})
+public class ExamStudentEntity extends JpaEntity {
+
+	private static final long serialVersionUID = 757531976286006550L;
+
+	@Id
+	@GeneratedValue
+	private Long id;
+
+	/**
+	 * 考试
+	 */
+	@Column(nullable = false)
+	private Long examId;
+
+	/**
+	 * 学生用户id
+	 */
+	@Column(nullable = false)
+	private Long studentId;
+
+	/**
+	 * 身份证号
+	 */
+	@Column(nullable = false)
+	private String identityNumber;
+
+	/**
+	 * 学号
+	 */
+	private String studentCode;
+
+	/**
+	 * 考生姓名
+	 */
+	@Column(nullable = false)
+	private String name;
+
+	/**
+	 * 学校id
+	 */
+	@Column(nullable = false)
+	private Long rootOrgId;
+
+	/**
+	 * 学习中心id
+	 */
+	@Column(nullable = false)
+	private Long orgId;
+
+	/**
+	 * 学习中心编码
+	 */
+	@Column(nullable = false)
+	private String orgCode;
+
+	/**
+	 * 课程ID
+	 */
+	@Column(nullable = false)
+	private Long courseId;
+
+	/**
+	 * 课程名称
+	 */
+	@Column(nullable = false)
+	private String courseName;
+
+	/**
+	 * 课程ID
+	 */
+	@Column(nullable = false)
+	private String courseCode;
+
+	/**
+	 * 课程等级
+	 */
+	@Column(nullable = false)
+	private String courseLevel;
+
+	/**
+	 * 试卷类型
+	 */
+	private String paperType;
+
+	/**
+	 * 专业名称
+	 */
+	private String specialtyName;
+
+	/**
+	 * 年级
+	 */
+	private String grade;
+
+	/**
+	 * 备注
+	 */
+	private String remark;
+
+	/**
+	 * 考点
+	 */
+	private String examSite;
+
+	/**
+	 * 信息采集人
+	 */
+	private String infoCollector;
+
+	@Column(nullable = false)
+	private Boolean enable;
+
+	/**
+	 * 扩展属性1
+	 */
+	private String ext1;
+
+	/**
+	 * 扩展属性2
+	 */
+	private String ext2;
+
+	/**
+	 * 扩展属性3
+	 */
+	private String ext3;
+
+	/**
+	 * 扩展属性4
+	 */
+	private String ext4;
+
+	/**
+	 * 扩展属性5
+	 */
+	private String ext5;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getStudentId() {
+		return studentId;
+	}
+
+	public void setStudentId(Long studentId) {
+		this.studentId = studentId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	public Long getOrgId() {
+		return orgId;
+	}
+
+	public void setOrgId(Long orgId) {
+		this.orgId = orgId;
+	}
+
+	public String getStudentCode() {
+		return studentCode;
+	}
+
+	public void setStudentCode(String studentCode) {
+		this.studentCode = studentCode;
+	}
+
+	public String getIdentityNumber() {
+		return identityNumber;
+	}
+
+	public void setIdentityNumber(String identityNumber) {
+		this.identityNumber = identityNumber;
+	}
+
+	public Long getCourseId() {
+		return courseId;
+	}
+
+	public void setCourseId(Long courseId) {
+		this.courseId = courseId;
+	}
+
+	public String getPaperType() {
+		return paperType;
+	}
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
+	}
+
+	public String getSpecialtyName() {
+		return specialtyName;
+	}
+
+	public void setSpecialtyName(String specialtyName) {
+		this.specialtyName = specialtyName;
+	}
+
+	public String getGrade() {
+		return grade;
+	}
+
+	public void setGrade(String grade) {
+		this.grade = grade;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getExamSite() {
+		return examSite;
+	}
+
+	public void setExamSite(String examSite) {
+		this.examSite = examSite;
+	}
+
+	public String getInfoCollector() {
+		return infoCollector;
+	}
+
+	public void setInfoCollector(String infoCollector) {
+		this.infoCollector = infoCollector;
+	}
+
+	public Boolean getEnable() {
+		return enable;
+	}
+
+	public void setEnable(Boolean enable) {
+		this.enable = enable;
+	}
+
+	public String getCourseLevel() {
+		return courseLevel;
+	}
+
+	public void setCourseLevel(String courseLevel) {
+		this.courseLevel = courseLevel;
+	}
+
+	public String getCourseCode() {
+		return courseCode;
+	}
+
+	public void setCourseCode(String courseCode) {
+		this.courseCode = courseCode;
+	}
+
+	public String getCourseName() {
+		return courseName;
+	}
+
+	public void setCourseName(String courseName) {
+		this.courseName = courseName;
+	}
+
+	public String getOrgCode() {
+		return orgCode;
+	}
+
+	public void setOrgCode(String orgCode) {
+		this.orgCode = orgCode;
+	}
+
+	public String getExt1() {
+		return ext1;
+	}
+
+	public void setExt1(String ext1) {
+		this.ext1 = ext1;
+	}
+
+	public String getExt2() {
+		return ext2;
+	}
+
+	public void setExt2(String ext2) {
+		this.ext2 = ext2;
+	}
+
+	public String getExt3() {
+		return ext3;
+	}
+
+	public void setExt3(String ext3) {
+		this.ext3 = ext3;
+	}
+
+	public String getExt4() {
+		return ext4;
+	}
+
+	public void setExt4(String ext4) {
+		this.ext4 = ext4;
+	}
+
+	public String getExt5() {
+		return ext5;
+	}
+
+	public void setExt5(String ext5) {
+		this.ext5 = ext5;
+	}
+
+}

+ 1 - 1
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/ExamService.java

@@ -4,11 +4,11 @@ import java.io.File;
 import java.util.List;
 import java.util.Map;
 
-import cn.com.qmth.examcloud.commons.web.enums.DataExecutionStatus;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamSpecialSettingsEntity;
 import cn.com.qmth.examcloud.core.examwork.service.bean.ExamInfo;
 import cn.com.qmth.examcloud.core.examwork.service.bean.ExamSpecialSettingsInfo;
+import cn.com.qmth.examcloud.web.enums.DataExecutionStatus;
 
 /**
  * 类注释

+ 1 - 1
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/bean/ExamInfo.java

@@ -7,8 +7,8 @@ import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
 import javax.validation.constraints.NotNull;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
 import cn.com.qmth.examcloud.core.examwork.dao.enums.ExamType;
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
 
 /**
  * 类注释

+ 1 - 1
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/bean/ExamSpecialSettingsInfo.java

@@ -3,7 +3,7 @@ package cn.com.qmth.examcloud.core.examwork.service.bean;
 import java.util.Date;
 import java.util.Map;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
 
 /**
  * 考试机构设置

+ 8 - 8
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamServiceImpl.java

@@ -17,14 +17,13 @@ import org.springframework.stereotype.Service;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.base.helpers.DynamicEnum;
-import cn.com.qmth.examcloud.commons.base.helpers.DynamicEnumManager;
-import cn.com.qmth.examcloud.commons.base.helpers.poi.ExcelReader;
-import cn.com.qmth.examcloud.commons.base.util.DateUtil;
-import cn.com.qmth.examcloud.commons.base.util.DateUtil.DatePatterns;
-import cn.com.qmth.examcloud.commons.base.util.PathUtil;
-import cn.com.qmth.examcloud.commons.web.enums.DataExecutionStatus;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.helpers.DynamicEnum;
+import cn.com.qmth.examcloud.commons.helpers.DynamicEnumManager;
+import cn.com.qmth.examcloud.commons.helpers.poi.ExcelReader;
+import cn.com.qmth.examcloud.commons.util.DateUtil;
+import cn.com.qmth.examcloud.commons.util.PathUtil;
+import cn.com.qmth.examcloud.commons.util.DateUtil.DatePatterns;
 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;
@@ -44,6 +43,7 @@ import cn.com.qmth.examcloud.core.examwork.service.bean.ExamInfo;
 import cn.com.qmth.examcloud.core.examwork.service.bean.ExamSpecialSettingsInfo;
 import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
 import cn.com.qmth.examcloud.task.api.request.SyncExamReq;
+import cn.com.qmth.examcloud.web.enums.DataExecutionStatus;
 
 /**
  * 类注释

+ 2 - 2
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamStudentServiceImpl.java

@@ -6,8 +6,8 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.base.util.PropertiesUtil;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
 import cn.com.qmth.examcloud.core.basic.api.CourseCloudService;
 import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
 import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;

+ 108 - 108
examcloud-core-examwork-starter/src/main/java/cn/com/qmth/examcloud/core/examwork/starter/CoreExamWorkApp.java

@@ -1,108 +1,108 @@
-package cn.com.qmth.examcloud.core.examwork.starter;
-
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.domain.EntityScan;
-import org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.client.loadbalancer.LoadBalanced;
-import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
-import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
-import org.springframework.data.redis.serializer.StringRedisSerializer;
-import org.springframework.transaction.annotation.EnableTransactionManagement;
-import org.springframework.web.client.RestTemplate;
-import org.springframework.web.multipart.MultipartResolver;
-import org.springframework.web.multipart.commons.CommonsMultipartResolver;
-
-import com.fasterxml.jackson.annotation.JsonAutoDetect;
-import com.fasterxml.jackson.annotation.PropertyAccessor;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import cn.com.qmth.examcloud.commons.base.logging.ExamCloudLog;
-import cn.com.qmth.examcloud.commons.base.logging.ExamCloudLogFactory;
-import cn.com.qmth.examcloud.commons.base.logging.SLF4JImpl;
-import cn.com.qmth.examcloud.commons.web.boot.ExamCloudApp;
-import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
-import cn.com.qmth.examcloud.commons.web.redis.RedisClientImpl;
-import cn.com.qmth.examcloud.commons.web.support.CustomResponseErrorHandler;
-import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
-
-@ComponentScan(basePackages = {"cn.com.qmth"})
-@EntityScan(basePackages = {"cn.com.qmth"})
-@EnableJpaRepositories(basePackages = {"cn.com.qmth"})
-@EnableJpaAuditing
-@EnableTransactionManagement
-@SpringBootApplication
-@EnableEurekaClient
-@EnableDiscoveryClient
-@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class})
-public class CoreExamWorkApp {
-
-	private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(CoreExamWorkApp.class);
-
-	/**
-	 * main
-	 *
-	 * @author WANGWEI
-	 * @param args
-	 * @throws Exception
-	 */
-	public static void main(String[] args) throws Exception {
-		if (LOG instanceof SLF4JImpl) {
-			MDC.put("TRACE_ID", Thread.currentThread().getName());
-		}
-
-		ExamProperty.init();
-
-		ExamCloudApp.run(CoreExamWorkApp.class, "examwork", args);
-	}
-
-	@Bean
-	@LoadBalanced
-	public RestTemplate restTemplate() {
-		RestTemplate restTemplate = new RestTemplate();
-		restTemplate.setErrorHandler(new CustomResponseErrorHandler());
-		return restTemplate;
-	}
-
-	@Bean
-	public RedisTemplate<String, Object> redisTemplate(
-			RedisConnectionFactory redisConnectionFactory) {
-		RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
-		redisTemplate.setConnectionFactory(redisConnectionFactory);
-		Jackson2JsonRedisSerializer<?> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(
-				Object.class);
-		ObjectMapper objectMapper = new ObjectMapper();
-		objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
-		objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
-		jackson2JsonRedisSerializer.setObjectMapper(objectMapper);
-		redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
-		redisTemplate.setKeySerializer(new StringRedisSerializer());
-		redisTemplate.afterPropertiesSet();
-		return redisTemplate;
-	}
-
-	@Bean
-	@Autowired
-	public RedisClient redisClient(RedisTemplate<String, Object> redisTemplate) {
-		return new RedisClientImpl(redisTemplate);
-	}
-
-	@Bean(name = "multipartResolver")
-	public MultipartResolver multipartResolver() {
-		CommonsMultipartResolver resolver = new CommonsMultipartResolver();
-		resolver.setDefaultEncoding("UTF-8");
-		resolver.setResolveLazily(true);
-		resolver.setMaxInMemorySize(2);
-		resolver.setMaxUploadSize(200 * 1024 * 1024);
-		return resolver;
-	}
-}
+package cn.com.qmth.examcloud.core.examwork.starter;
+
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.domain.EntityScan;
+import org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.client.loadbalancer.LoadBalanced;
+import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.multipart.MultipartResolver;
+import org.springframework.web.multipart.commons.CommonsMultipartResolver;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
+import cn.com.qmth.examcloud.commons.logging.SLF4JImpl;
+import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
+import cn.com.qmth.examcloud.web.boot.ExamCloudApp;
+import cn.com.qmth.examcloud.web.redis.RedisClient;
+import cn.com.qmth.examcloud.web.redis.RedisClientImpl;
+import cn.com.qmth.examcloud.web.support.CustomResponseErrorHandler;
+
+@ComponentScan(basePackages = {"cn.com.qmth"})
+@EntityScan(basePackages = {"cn.com.qmth"})
+@EnableJpaRepositories(basePackages = {"cn.com.qmth"})
+@EnableJpaAuditing
+@EnableTransactionManagement
+@SpringBootApplication
+@EnableEurekaClient
+@EnableDiscoveryClient
+@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class})
+public class CoreExamWorkApp {
+
+	private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(CoreExamWorkApp.class);
+
+	/**
+	 * main
+	 *
+	 * @author WANGWEI
+	 * @param args
+	 * @throws Exception
+	 */
+	public static void main(String[] args) throws Exception {
+		if (LOG instanceof SLF4JImpl) {
+			MDC.put("TRACE_ID", Thread.currentThread().getName());
+		}
+
+		ExamProperty.init();
+
+		ExamCloudApp.run(CoreExamWorkApp.class, "examwork", args);
+	}
+
+	@Bean
+	@LoadBalanced
+	public RestTemplate restTemplate() {
+		RestTemplate restTemplate = new RestTemplate();
+		restTemplate.setErrorHandler(new CustomResponseErrorHandler());
+		return restTemplate;
+	}
+
+	@Bean
+	public RedisTemplate<String, Object> redisTemplate(
+			RedisConnectionFactory redisConnectionFactory) {
+		RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
+		redisTemplate.setConnectionFactory(redisConnectionFactory);
+		Jackson2JsonRedisSerializer<?> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(
+				Object.class);
+		ObjectMapper objectMapper = new ObjectMapper();
+		objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+		objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+		jackson2JsonRedisSerializer.setObjectMapper(objectMapper);
+		redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
+		redisTemplate.setKeySerializer(new StringRedisSerializer());
+		redisTemplate.afterPropertiesSet();
+		return redisTemplate;
+	}
+
+	@Bean
+	@Autowired
+	public RedisClient redisClient(RedisTemplate<String, Object> redisTemplate) {
+		return new RedisClientImpl(redisTemplate);
+	}
+
+	@Bean(name = "multipartResolver")
+	public MultipartResolver multipartResolver() {
+		CommonsMultipartResolver resolver = new CommonsMultipartResolver();
+		resolver.setDefaultEncoding("UTF-8");
+		resolver.setResolveLazily(true);
+		resolver.setMaxInMemorySize(2);
+		resolver.setMaxUploadSize(200 * 1024 * 1024);
+		return resolver;
+	}
+}

+ 39 - 39
examcloud-core-examwork-starter/src/main/java/cn/com/qmth/examcloud/core/examwork/starter/config/AppSelfInspection.java

@@ -1,39 +1,39 @@
-package cn.com.qmth.examcloud.core.examwork.starter.config;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.core.annotation.Order;
-import org.springframework.stereotype.Component;
-
-import cn.com.qmth.examcloud.commons.web.support.RemoteProcedureCallTester;
-
-/**
- * 应用自检
- *
- * @author WANGWEI
- * @date 2018年6月21日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Component
-@Order(1)
-public class AppSelfInspection implements ApplicationRunner {
-
-	@Autowired
-	private RemoteProcedureCallTester remoteCallTester;
-
-	/**
-	 * 自检
-	 *
-	 * @author WANGWEI
-	 */
-	private void inspect() {
-		remoteCallTester.testRestTemplate("EC-CORE-BASIC", "EC-CORE-OE-ADMIN");
-	}
-
-	@Override
-	public void run(ApplicationArguments args) throws Exception {
-		inspect();
-	}
-
-}
+package cn.com.qmth.examcloud.core.examwork.starter.config;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.core.annotation.Order;
+import org.springframework.stereotype.Component;
+
+import cn.com.qmth.examcloud.web.support.RemoteProcedureCallTester;
+
+/**
+ * 应用自检
+ *
+ * @author WANGWEI
+ * @date 2018年6月21日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Component
+@Order(1)
+public class AppSelfInspection implements ApplicationRunner {
+
+	@Autowired
+	private RemoteProcedureCallTester remoteCallTester;
+
+	/**
+	 * 自检
+	 *
+	 * @author WANGWEI
+	 */
+	private void inspect() {
+		remoteCallTester.testRestTemplate("EC-CORE-BASIC", "EC-CORE-OE-ADMIN");
+	}
+
+	@Override
+	public void run(ApplicationArguments args) throws Exception {
+		inspect();
+	}
+
+}

+ 123 - 123
examcloud-core-examwork-starter/src/main/java/cn/com/qmth/examcloud/core/examwork/starter/config/DefaultWebMvcConfigurerAdapter.java

@@ -1,123 +1,123 @@
-package cn.com.qmth.examcloud.core.examwork.starter.config;
-
-import java.util.List;
-import java.util.Set;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
-
-import com.google.common.collect.Sets;
-
-import cn.com.qmth.examcloud.commons.base.util.PathUtil;
-import cn.com.qmth.examcloud.commons.base.util.PropertiesUtil;
-import cn.com.qmth.examcloud.commons.base.util.RegExpUtil;
-import cn.com.qmth.examcloud.commons.web.interceptor.FirstInterceptor;
-import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
-import cn.com.qmth.examcloud.commons.web.security.RequestPermissionInterceptor;
-import cn.com.qmth.examcloud.commons.web.security.SpringCloudInterceptor;
-import cn.com.qmth.examcloud.commons.web.security.bean.Role;
-import cn.com.qmth.examcloud.commons.web.security.bean.User;
-import cn.com.qmth.examcloud.commons.web.security.bean.UserType;
-import cn.com.qmth.examcloud.commons.web.security.enums.RoleMeta;
-
-/**
- * 默认WebMvcConfigurer
- *
- * @author WANGWEI
- * @date 2018年5月22日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Configuration
-public class DefaultWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {
-
-	@Autowired
-	RedisClient redisClient;
-
-	static {
-		PropertiesUtil.configure(PathUtil.getResoucePath("security-mapping.properties"));
-	}
-
-	@Override
-	public void addInterceptors(InterceptorRegistry registry) {
-		registry.addInterceptor(new FirstInterceptor()).addPathPatterns("/**");
-
-		SpringCloudInterceptor springCloudInterceptor = new SpringCloudInterceptor();
-		springCloudInterceptor.setRedisClient(redisClient);
-		registry.addInterceptor(springCloudInterceptor).addPathPatterns("/**");
-
-		RequestPermissionInterceptor requestPermissionInterceptor = getRequestPermissionInterceptor();
-		requestPermissionInterceptor.configure("security-exclusions.conf");
-		registry.addInterceptor(requestPermissionInterceptor).addPathPatterns("/**");
-
-		super.addInterceptors(registry);
-	}
-
-	@Bean
-	public RequestPermissionInterceptor getRequestPermissionInterceptor() {
-		return new RequestPermissionInterceptor(redisClient) {
-
-			@Override
-			public boolean hasPermission(String mappingPath, User user) {
-
-				// 学生鉴权
-				if (user.getUserType().equals(UserType.STUDENT)) {
-					String key = "[s]" + mappingPath;
-					return PropertiesUtil.getBoolean(key, false);
-				}
-
-				List<Role> roleList = user.getRoleList();
-
-				if (CollectionUtils.isEmpty(roleList)) {
-					return false;
-				}
-
-				for (Role role : roleList) {
-					if (role.getRoleCode().equals(RoleMeta.SUPER_ADMIN.name())) {
-						return true;
-					}
-				}
-
-				// 权限组集合
-				String privilegeGroups = PropertiesUtil.getString(mappingPath);
-				if (StringUtils.isBlank(privilegeGroups)) {
-					return true;
-				}
-
-				// 用户权限集合
-				Set<String> rolePrivilegeList = Sets.newHashSet();
-				Long rootOrgId = user.getRootOrgId();
-				for (Role role : roleList) {
-					String key = "$_P_" + rootOrgId + "_" + role.getRoleId();
-					String rolePrivileges = redisClient.get(key, String.class);
-
-					List<String> rpList = RegExpUtil.findAll(rolePrivileges, "\\w+");
-					rolePrivilegeList.addAll(rpList);
-				}
-
-				List<String> privilegeGroupList = RegExpUtil.findAll(privilegeGroups, "[^\\;]+");
-
-				for (String pg : privilegeGroupList) {
-					pg = pg.trim();
-					if (StringUtils.isBlank(pg)) {
-						continue;
-					}
-
-					List<String> pList = RegExpUtil.findAll(pg, "[^\\,]+");
-					if (rolePrivilegeList.containsAll(pList)) {
-						return true;
-					} else {
-						continue;
-					}
-				}
-
-				return false;
-			}
-
-		};
-	}
-}
+package cn.com.qmth.examcloud.core.examwork.starter.config;
+
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+import com.google.common.collect.Sets;
+
+import cn.com.qmth.examcloud.commons.util.PathUtil;
+import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
+import cn.com.qmth.examcloud.commons.util.RegExpUtil;
+import cn.com.qmth.examcloud.web.interceptor.FirstInterceptor;
+import cn.com.qmth.examcloud.web.redis.RedisClient;
+import cn.com.qmth.examcloud.web.security.RequestPermissionInterceptor;
+import cn.com.qmth.examcloud.web.security.SpringCloudInterceptor;
+import cn.com.qmth.examcloud.web.security.bean.Role;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.security.bean.UserType;
+import cn.com.qmth.examcloud.web.security.enums.RoleMeta;
+
+/**
+ * 默认WebMvcConfigurer
+ *
+ * @author WANGWEI
+ * @date 2018年5月22日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Configuration
+public class DefaultWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {
+
+	@Autowired
+	RedisClient redisClient;
+
+	static {
+		PropertiesUtil.configure(PathUtil.getResoucePath("security-mapping.properties"));
+	}
+
+	@Override
+	public void addInterceptors(InterceptorRegistry registry) {
+		registry.addInterceptor(new FirstInterceptor()).addPathPatterns("/**");
+
+		SpringCloudInterceptor springCloudInterceptor = new SpringCloudInterceptor();
+		springCloudInterceptor.setRedisClient(redisClient);
+		registry.addInterceptor(springCloudInterceptor).addPathPatterns("/**");
+
+		RequestPermissionInterceptor requestPermissionInterceptor = getRequestPermissionInterceptor();
+		requestPermissionInterceptor.configure("security-exclusions.conf");
+		registry.addInterceptor(requestPermissionInterceptor).addPathPatterns("/**");
+
+		super.addInterceptors(registry);
+	}
+
+	@Bean
+	public RequestPermissionInterceptor getRequestPermissionInterceptor() {
+		return new RequestPermissionInterceptor(redisClient) {
+
+			@Override
+			public boolean hasPermission(String mappingPath, User user) {
+
+				// 学生鉴权
+				if (user.getUserType().equals(UserType.STUDENT)) {
+					String key = "[s]" + mappingPath;
+					return PropertiesUtil.getBoolean(key, false);
+				}
+
+				List<Role> roleList = user.getRoleList();
+
+				if (CollectionUtils.isEmpty(roleList)) {
+					return false;
+				}
+
+				for (Role role : roleList) {
+					if (role.getRoleCode().equals(RoleMeta.SUPER_ADMIN.name())) {
+						return true;
+					}
+				}
+
+				// 权限组集合
+				String privilegeGroups = PropertiesUtil.getString(mappingPath);
+				if (StringUtils.isBlank(privilegeGroups)) {
+					return true;
+				}
+
+				// 用户权限集合
+				Set<String> rolePrivilegeList = Sets.newHashSet();
+				Long rootOrgId = user.getRootOrgId();
+				for (Role role : roleList) {
+					String key = "$_P_" + rootOrgId + "_" + role.getRoleId();
+					String rolePrivileges = redisClient.get(key, String.class);
+
+					List<String> rpList = RegExpUtil.findAll(rolePrivileges, "\\w+");
+					rolePrivilegeList.addAll(rpList);
+				}
+
+				List<String> privilegeGroupList = RegExpUtil.findAll(privilegeGroups, "[^\\;]+");
+
+				for (String pg : privilegeGroupList) {
+					pg = pg.trim();
+					if (StringUtils.isBlank(pg)) {
+						continue;
+					}
+
+					List<String> pList = RegExpUtil.findAll(pg, "[^\\,]+");
+					if (rolePrivilegeList.containsAll(pList)) {
+						return true;
+					} else {
+						continue;
+					}
+				}
+
+				return false;
+			}
+
+		};
+	}
+}