wangwei 7 vuotta sitten
vanhempi
commit
39612095de
62 muutettua tiedostoa jossa 674 lisäystä ja 686 poistoa
  1. 0 94
      exam-work-api/pom.xml
  2. 0 51
      exam-work-main/pom.xml
  3. 76 0
      examcloud-core-examwork-api/pom.xml
  4. 301 301
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamApi.java
  5. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamCourseApi.java
  6. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamOrgTimeApi.java
  7. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamPaperTypeApi.java
  8. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamScoreApi.java
  9. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamStudentApi.java
  10. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamCourseService.java
  11. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamOrgTimeService.java
  12. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamScoreService.java
  13. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamService.java
  14. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamStudentService.java
  15. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/CourseService.java
  16. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/OeService.java
  17. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/OrgService.java
  18. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/SpecialtyService.java
  19. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/StudentService.java
  20. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/CourseClient.java
  21. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/OeClient.java
  22. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/OrgClient.java
  23. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/SpecialtyClient.java
  24. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/StudentClient.java
  25. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/sync/DataReceiveService.java
  26. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/sync/DataSendService.java
  27. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/util/ExportUtils.java
  28. 0 0
      examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/util/ImportUtils.java
  29. 37 35
      examcloud-core-examwork-domain/pom.xml
  30. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/assembler/ExamStudentAssembler.java
  31. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/criteria/BasePageable.java
  32. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/criteria/ExamCourseCriteria.java
  33. 21 21
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/CourseGroupRepo.java
  34. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamOrgTimeRepo.java
  35. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamRepo.java
  36. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamScoreRepo.java
  37. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamStudentRepo.java
  38. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/ExamCourseDTO.java
  39. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/ExamPaperTypeDTO.java
  40. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/ExamStudentDTO.java
  41. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/OrgExamInfoDTO.java
  42. 108 108
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/CourseGroup.java
  43. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/Exam.java
  44. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamOrgTime.java
  45. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamScore.java
  46. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamStudent.java
  47. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/ExamType.java
  48. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/MarkingType.java
  49. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/PracticeType.java
  50. 0 0
      examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/isValid.java
  51. 55 0
      examcloud-core-examwork-main/pom.xml
  52. 0 0
      examcloud-core-examwork-main/src/main/java/cn/com/qmth/examcloud/service/examwork/AccessControlConfig.java
  53. 54 54
      examcloud-core-examwork-main/src/main/java/cn/com/qmth/examcloud/service/examwork/Application.java
  54. 0 0
      examcloud-core-examwork-main/src/main/java/cn/com/qmth/examcloud/service/examwork/Swagger2.java
  55. 15 15
      examcloud-core-examwork-main/src/main/resources/application-dev.properties
  56. 0 0
      examcloud-core-examwork-main/src/main/resources/application-prac.properties
  57. 0 0
      examcloud-core-examwork-main/src/main/resources/application-prod.properties
  58. 0 0
      examcloud-core-examwork-main/src/main/resources/application-prodvpc.properties
  59. 0 0
      examcloud-core-examwork-main/src/main/resources/application-test.properties
  60. 0 0
      examcloud-core-examwork-main/src/main/resources/application.properties
  61. 0 0
      examcloud-core-examwork-main/src/main/resources/logback-spring.xml
  62. 7 7
      pom.xml

+ 0 - 94
exam-work-api/pom.xml

@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>exam-work</artifactId>
-        <groupId>cn.com.qmth.examcloud.service</groupId>
-        <version>0.1.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>exam-work-api</artifactId>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-feign</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-eureka</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-redis</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger2</artifactId>
-            <version>2.6.1</version>
-        </dependency>
-        <dependency>
-            <groupId>io.springfox</groupId>
-            <artifactId>springfox-swagger-ui</artifactId>
-            <version>2.6.1</version>
-        </dependency>
-        
-		<dependency>
-            <artifactId>exam-work-domain</artifactId>
-            <groupId>cn.com.qmth.examcloud.service</groupId>
-            <version>0.1.0</version>
-        </dependency>
-		<dependency>
-            <groupId>cn.com.qmth.examcloud.common</groupId>
-            <artifactId>common-uac</artifactId>
-             <version>${examcloud.version}</version>
-        </dependency>
-        		<dependency>
-            <groupId>cn.com.qmth.examcloud.common</groupId>
-            <artifactId>common-dto</artifactId>
-             <version>${examcloud.version}</version>
-        </dependency>
-		<!--<dependency>-->
-            <!--<groupId>com.facepp</groupId>-->
-            <!--<artifactId>faceppsdk</artifactId>-->
-            <!--<version>1.0</version>-->
-        <!--</dependency>-->
-        <dependency>
-            <groupId>com.esotericsoftware</groupId>
-            <artifactId>reflectasm</artifactId>
-            <version>1.11.3</version>
-        </dependency>
-
-        <dependency>
-            <groupId>commons-fileupload</groupId>
-            <artifactId>commons-fileupload</artifactId>
-            <version>1.3.2</version>
-        </dependency>
-
-        <dependency>
-            <groupId>com.qmth.commons</groupId>
-            <artifactId>data-sync-rabbit</artifactId>
-            <version>1.0-SNAPSHOT</version>
-        </dependency>
-    </dependencies>
-    
-	<build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-		</plugins>
-    </build>
-
-</project>

+ 0 - 51
exam-work-main/pom.xml

@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>exam-work</artifactId>
-        <groupId>cn.com.qmth.examcloud.service</groupId>
-        <version>0.1.0</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>exam-work-main</artifactId>
-    <dependencies>
-        <dependency>
-            <groupId>cn.com.qmth.examcloud.service</groupId>
-            <artifactId>exam-work-api</artifactId>
-            <version>0.1.0</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-autoconfigure</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-                <configuration>
-                    <includeSystemScope>true</includeSystemScope>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 76 - 0
examcloud-core-examwork-api/pom.xml

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>cn.com.qmth.examcloud.core.examwork</groupId>
+		<artifactId>examcloud-core-examwork</artifactId>
+		<version>0.1.0</version>
+	</parent>
+
+	<artifactId>examcloud-core-examwork-api</artifactId>
+	<packaging>jar</packaging>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.springframework.cloud</groupId>
+			<artifactId>spring-cloud-starter-feign</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.cloud</groupId>
+			<artifactId>spring-cloud-starter-eureka</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-web</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-data-redis</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>io.springfox</groupId>
+			<artifactId>springfox-swagger2</artifactId>
+			<version>2.6.1</version>
+		</dependency>
+		<dependency>
+			<groupId>io.springfox</groupId>
+			<artifactId>springfox-swagger-ui</artifactId>
+			<version>2.6.1</version>
+		</dependency>
+
+		<dependency>
+			<groupId>cn.com.qmth.examcloud.core.examwork</groupId>
+			<artifactId>examcloud-core-examwork-domain</artifactId>
+			<version>${examcloud.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>cn.com.qmth.examcloud.commons</groupId>
+			<artifactId>examcloud-commons-uac</artifactId>
+			<version>${examcloud.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>cn.com.qmth.examcloud.commons</groupId>
+			<artifactId>examcloud-commons-dto</artifactId>
+			<version>${examcloud.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.esotericsoftware</groupId>
+			<artifactId>reflectasm</artifactId>
+			<version>1.11.3</version>
+		</dependency>
+
+		<dependency>
+			<groupId>commons-fileupload</groupId>
+			<artifactId>commons-fileupload</artifactId>
+			<version>1.3.2</version>
+		</dependency>
+
+		<dependency>
+			<groupId>com.qmth.commons</groupId>
+			<artifactId>data-sync-rabbit</artifactId>
+			<version>1.0-SNAPSHOT</version>
+		</dependency>
+	</dependencies>
+
+</project>

+ 301 - 301
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamApi.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamApi.java

@@ -1,301 +1,301 @@
-package cn.com.qmth.examcloud.service.examwork.api;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.domain.Sort;
-import org.springframework.data.domain.Sort.Direction;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.ModelAttribute;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.google.common.collect.Lists;
-
-import cn.com.qmth.examcloud.common.support.ControllerSupport;
-import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
-import cn.com.qmth.examcloud.common.util.ErrorMsg;
-import cn.com.qmth.examcloud.service.examwork.dao.CourseGroupRepo;
-import cn.com.qmth.examcloud.service.examwork.dao.ExamRepo;
-import cn.com.qmth.examcloud.service.examwork.dao.ExamStudentRepo;
-import cn.com.qmth.examcloud.service.examwork.entity.CourseGroup;
-import cn.com.qmth.examcloud.service.examwork.entity.Exam;
-import cn.com.qmth.examcloud.service.examwork.entity.ExamStudent;
-import cn.com.qmth.examcloud.service.examwork.enums.ExamType;
-import cn.com.qmth.examcloud.service.examwork.service.ExamService;
-import cn.com.qmth.examcloud.service.examwork.service.ExamStudentService;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 考试服务API Created by songyue on 17/1/13.
- */
-@RestController
-@RequestMapping("${app.api.root}")
-public class ExamApi extends ControllerSupport {
-
-	@Autowired
-	ExamRepo examRepo;
-
-	@Autowired
-	ExamService examService;
-
-	@Autowired
-	ExamStudentRepo examStudentRepo;
-
-	@Autowired
-	ExamStudentService examStudentService;
-
-	@Autowired
-	CourseGroupRepo courseGroupRepo;
-
-	@Autowired
-	private JdbcTemplate jdbcTemplate;
-
-	@ApiOperation(value = "查询所有考试批次", notes = "分页带查询")
-	@GetMapping("/exam/all/{curPage}/{pageSize}")
-	public ResponseEntity getAllExam(HttpServletRequest request, @ModelAttribute Exam examCriteria,
-			@PathVariable Integer curPage, @PathVariable Integer pageSize) {
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if (accessUser != null) {
-			examCriteria.setOrgId(accessUser.getRootOrgId());
-		} else {
-			return new ResponseEntity(HttpStatus.NOT_FOUND);
-		}
-		return new ResponseEntity(examService.getAllExam(examCriteria,
-				new PageRequest(curPage, pageSize, new Sort(Direction.DESC, "id"))), HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "查询所有考试批次(包含有效)", notes = "不分页带查询")
-	@GetMapping("/exam/all")
-	public ResponseEntity getEnableExam(HttpServletRequest request, @ModelAttribute Exam examCriteria) {
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if (accessUser != null) {
-			examCriteria.setOrgId(accessUser.getRootOrgId());
-		}
-		examCriteria.setEnable(true);
-		return new ResponseEntity(examService.getAllExam(examCriteria), HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "根据机构ID和考试类型查询所有有效考试批次", notes = "根据机构ID和考试类型查询所有有效考试批次")
-	@GetMapping("/exam/rootOrgId/{orgId}/{examType}")
-	public ResponseEntity getEnableExamByRootOrgId(@PathVariable Long orgId, @PathVariable String examType) {
-		if (orgId == null) {
-			return new ResponseEntity(new ErrorMsg("机构ID不能为空"), HttpStatus.OK);
-		}
-		Exam examCriteria = new Exam();
-		examCriteria.setOrgId(orgId);
-		if (StringUtils.isNotBlank(examType)) {
-			examCriteria.setExamType(ExamType.valueOf(examType));
-		}
-		examCriteria.setEnable(true);
-		return new ResponseEntity(examService.getAllExam(examCriteria), HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "查询所有考试批次(包含有效无效)", notes = "不分页带查询")
-	@GetMapping("/exam/all/both")
-	public ResponseEntity getAllExam(HttpServletRequest request, @ModelAttribute Exam examCriteria) {
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if (accessUser != null) {
-			examCriteria.setOrgId(accessUser.getRootOrgId());
-		}
-		return new ResponseEntity(examService.getAllExam(examCriteria), HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "按ID查询考试批次", notes = "ID查询")
-	@GetMapping("/exam/{id}")
-	public ResponseEntity<Exam> getExamById(@PathVariable Long id) {
-		return new ResponseEntity<Exam>(examService.getExamById(id), HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "新增考试批次", notes = "新增")
-	@PostMapping("/exam")
-	public ResponseEntity addExam(HttpServletRequest request, @RequestBody Exam exam) {
-		Map<String, String> errorMap = new HashMap<String, String>();
-		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
-		if (accessUser != null) {
-			exam.setOrgId(accessUser.getOrgId());
-			exam.setRootOrgId(accessUser.getRootOrgId());
-			exam.setCreateTime(new Date());
-			exam.setCanStuDel(true);
-			if (!examService.checkExamName(exam)) {
-				errorMap.put("errorMsg", "考试名称已存在,请重新填写");
-				return new ResponseEntity(errorMap, HttpStatus.INTERNAL_SERVER_ERROR);
-			}
-			return new ResponseEntity(examService.insertExam(exam, accessUser), HttpStatus.OK);
-		} else {
-			errorMap.put("errorMsg", "accessUser为空");
-			return new ResponseEntity(errorMap, HttpStatus.INTERNAL_SERVER_ERROR);
-		}
-	}
-
-	@ApiOperation(value = "更新考试批次", notes = "更新")
-	@PutMapping("/exam")
-	public ResponseEntity updateExam(@RequestBody Exam exam) {
-		Map<String, String> errorMap = new HashMap<String, String>();
-		if (!examService.checkExamName(exam)) {
-			errorMap.put("errorMsg", "考试名称已存在,请重新填写");
-			return new ResponseEntity(errorMap, HttpStatus.INTERNAL_SERVER_ERROR);
-		}
-		return new ResponseEntity(examService.saveExam(exam), HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "按ID删除考试批次", notes = "删除")
-	@DeleteMapping("/exam/{id}")
-	public ResponseEntity deleteExam(@PathVariable String id) {
-		try {
-			List<Long> examIds = Stream.of(id.split(",")).map(s -> Long.parseLong(s.trim()))
-					.collect(Collectors.toList());
-			examService.deleteExam(examIds);
-			return new ResponseEntity(HttpStatus.OK);
-		} catch (Exception e) {
-			log.error("删除失败:", e);
-			return new ResponseEntity(new ErrorMsg(e.getMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
-		}
-	}
-
-	@ApiOperation(value = "启用考试", notes = "启用考试")
-	@PutMapping("/exam/enable/{ids}")
-	public ResponseEntity enableUser(@PathVariable String ids) {
-		List<Long> examIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
-		for (Long examId : examIds) {
-			Exam exam = examRepo.findOne(examId);
-			exam.setEnable(true);
-			examRepo.save(exam);
-		}
-		return new ResponseEntity(HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "禁用考试", notes = "禁用考试")
-	@PutMapping("/exam/disable/{ids}")
-	public ResponseEntity disableUser(@PathVariable String ids) {
-		List<Long> examIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
-		for (Long examId : examIds) {
-			Exam exam = examRepo.findOne(examId);
-			exam.setEnable(false);
-			examRepo.save(exam);
-		}
-		return new ResponseEntity(HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "回填考生不可删除标志", notes = "回填考生不可删除标志")
-	@PutMapping("/exam/canNotDel/{id}")
-	public ResponseEntity disableUser(@PathVariable Long id) {
-		examRepo.canNotDel(id);
-		return new ResponseEntity(HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "网考初始化更新考务信息", notes = "网考初始化更新考务信息")
-	@PutMapping("/exam/updateExamInfo")
-	public ResponseEntity updateExamInfo(@RequestParam Long examId, @RequestParam Long examStuId) {
-		examRepo.canNotDel(examId);
-		examStudentService.updateExamStudentInfo(examStuId);
-		return new ResponseEntity(HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "网考更新考务信息", notes = "网考更新考务信息")
-	@PutMapping("/exam/updateExamStudent")
-	public ResponseEntity updateExamStudent(@RequestParam Long examId, @RequestParam Long examStuId) {
-		examRepo.canNotDel(examId);
-		ExamStudent examStudent = examStudentRepo.findOne(examStuId);
-		examStudent.setFinished(true);
-		examStudentRepo.save(examStudent);
-		return new ResponseEntity(HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "查询课程组", notes = "查询课程组")
-	@GetMapping("/exam/allCourseGroups/{examId}/{curPage}/{pageSize}")
-	public ResponseEntity<?> queryAllCourseGroups(@PathVariable Long examId, @PathVariable Integer curPage,
-			@PathVariable Integer pageSize) {
-
-		List<CourseGroup> groupList = courseGroupRepo.findByExamId(examId, (curPage - 1) * pageSize, pageSize);
-
-		for (CourseGroup courseGroup : groupList) {
-			List<Long> courseIdList = Lists.newArrayList();
-			courseGroup.setCourseIdList(courseIdList);
-
-			List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
-					"select t.course_id from ecs_exam_course_group_course t where t.group_id=?", courseGroup.getId());
-			if (CollectionUtils.isNotEmpty(queryList)) {
-				for (Map<String, Object> map : queryList) {
-					Long courseId = Long.valueOf(map.get("COURSE_ID").toString());
-					courseIdList.add(courseId);
-				}
-			}
-		}
-
-		return new ResponseEntity<List<CourseGroup>>(groupList, HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "查询课程组", notes = "查询课程组")
-	@GetMapping("/exam/queryCourseGroupsByCourseId/{courseId}")
-	public ResponseEntity<?> queryCourseGroupsByCourseId(@PathVariable Long courseId) {
-		List<CourseGroup> groupList = courseGroupRepo.queryCourseGroupsByCourseId(courseId);
-
-		for (CourseGroup courseGroup : groupList) {
-			List<Long> courseIdList = Lists.newArrayList();
-			courseGroup.setCourseIdList(courseIdList);
-
-			List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
-					"select t.course_id from ecs_exam_course_group_course t where t.group_id=?", courseGroup.getId());
-			if (CollectionUtils.isNotEmpty(queryList)) {
-				for (Map<String, Object> map : queryList) {
-					Long curCourseId = Long.valueOf(map.get("COURSE_ID").toString());
-					courseIdList.add(curCourseId);
-				}
-			}
-		}
-
-		return new ResponseEntity<Object>(groupList, HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "更新课程组", notes = "更新课程组")
-	@PutMapping("/exam/courseGroup")
-	public ResponseEntity<?> updateCourseGroup(@RequestBody CourseGroup courseGroup, HttpServletRequest request) {
-
-		courseGroupRepo.save(courseGroup);
-		Long groupId = courseGroup.getId();
-		Long examId = courseGroup.getExamId();
-
-		List<Long> courseIdList = courseGroup.getCourseIdList();
-		jdbcTemplate.update("delete from ecs_exam_course_group_course  where group_id=?", groupId);
-
-		if (CollectionUtils.isNotEmpty(courseIdList)) {
-			for (Long courseId : courseIdList) {
-				jdbcTemplate.update("delete from ecs_exam_course_group_course  where exam_id=? and course_id=?",
-						groupId, courseId);
-				jdbcTemplate.update(
-						"insert into ecs_exam_course_group_course(group_id,course_id,exam_id) values(?,?,?)", groupId,
-						courseId, examId);
-			}
-		}
-
-		return new ResponseEntity<Object>(HttpStatus.OK);
-	}
-
-	@ApiOperation(value = "删除课程组", notes = "添加课程组")
-	@DeleteMapping("/exam/courseGroup/{id}")
-	public ResponseEntity<?> CourseGroup(@PathVariable Long id, HttpServletRequest request) {
-		courseGroupRepo.delete(id);
-		jdbcTemplate.update("delete from ecs_exam_course_group_course  where group_id=?", id);
-		return new ResponseEntity<Object>(HttpStatus.OK);
-	}
-}
+package cn.com.qmth.examcloud.service.examwork.api;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.domain.Sort.Direction;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.google.common.collect.Lists;
+
+import cn.com.qmth.examcloud.common.support.ControllerSupport;
+import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
+import cn.com.qmth.examcloud.common.util.ErrorMsg;
+import cn.com.qmth.examcloud.service.examwork.dao.CourseGroupRepo;
+import cn.com.qmth.examcloud.service.examwork.dao.ExamRepo;
+import cn.com.qmth.examcloud.service.examwork.dao.ExamStudentRepo;
+import cn.com.qmth.examcloud.service.examwork.entity.CourseGroup;
+import cn.com.qmth.examcloud.service.examwork.entity.Exam;
+import cn.com.qmth.examcloud.service.examwork.entity.ExamStudent;
+import cn.com.qmth.examcloud.service.examwork.enums.ExamType;
+import cn.com.qmth.examcloud.service.examwork.service.ExamService;
+import cn.com.qmth.examcloud.service.examwork.service.ExamStudentService;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 考试服务API Created by songyue on 17/1/13.
+ */
+@RestController
+@RequestMapping("${app.api.root}")
+public class ExamApi extends ControllerSupport {
+
+	@Autowired
+	ExamRepo examRepo;
+
+	@Autowired
+	ExamService examService;
+
+	@Autowired
+	ExamStudentRepo examStudentRepo;
+
+	@Autowired
+	ExamStudentService examStudentService;
+
+	@Autowired
+	CourseGroupRepo courseGroupRepo;
+
+	@Autowired
+	private JdbcTemplate jdbcTemplate;
+
+	@ApiOperation(value = "查询所有考试批次", notes = "分页带查询")
+	@GetMapping("/exam/all/{curPage}/{pageSize}")
+	public ResponseEntity getAllExam(HttpServletRequest request, @ModelAttribute Exam examCriteria,
+			@PathVariable Integer curPage, @PathVariable Integer pageSize) {
+		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
+		if (accessUser != null) {
+			examCriteria.setOrgId(accessUser.getRootOrgId());
+		} else {
+			return new ResponseEntity(HttpStatus.NOT_FOUND);
+		}
+		return new ResponseEntity(examService.getAllExam(examCriteria,
+				new PageRequest(curPage, pageSize, new Sort(Direction.DESC, "id"))), HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "查询所有考试批次(包含有效)", notes = "不分页带查询")
+	@GetMapping("/exam/all")
+	public ResponseEntity getEnableExam(HttpServletRequest request, @ModelAttribute Exam examCriteria) {
+		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
+		if (accessUser != null) {
+			examCriteria.setOrgId(accessUser.getRootOrgId());
+		}
+		examCriteria.setEnable(true);
+		return new ResponseEntity(examService.getAllExam(examCriteria), HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "根据机构ID和考试类型查询所有有效考试批次", notes = "根据机构ID和考试类型查询所有有效考试批次")
+	@GetMapping("/exam/rootOrgId/{orgId}/{examType}")
+	public ResponseEntity getEnableExamByRootOrgId(@PathVariable Long orgId, @PathVariable String examType) {
+		if (orgId == null) {
+			return new ResponseEntity(new ErrorMsg("机构ID不能为空"), HttpStatus.OK);
+		}
+		Exam examCriteria = new Exam();
+		examCriteria.setOrgId(orgId);
+		if (StringUtils.isNotBlank(examType)) {
+			examCriteria.setExamType(ExamType.valueOf(examType));
+		}
+		examCriteria.setEnable(true);
+		return new ResponseEntity(examService.getAllExam(examCriteria), HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "查询所有考试批次(包含有效无效)", notes = "不分页带查询")
+	@GetMapping("/exam/all/both")
+	public ResponseEntity getAllExam(HttpServletRequest request, @ModelAttribute Exam examCriteria) {
+		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
+		if (accessUser != null) {
+			examCriteria.setOrgId(accessUser.getRootOrgId());
+		}
+		return new ResponseEntity(examService.getAllExam(examCriteria), HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "按ID查询考试批次", notes = "ID查询")
+	@GetMapping("/exam/{id}")
+	public ResponseEntity<Exam> getExamById(@PathVariable Long id) {
+		return new ResponseEntity<Exam>(examService.getExamById(id), HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "新增考试批次", notes = "新增")
+	@PostMapping("/exam")
+	public ResponseEntity addExam(HttpServletRequest request, @RequestBody Exam exam) {
+		Map<String, String> errorMap = new HashMap<String, String>();
+		AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
+		if (accessUser != null) {
+			exam.setOrgId(accessUser.getOrgId());
+			exam.setRootOrgId(accessUser.getRootOrgId());
+			exam.setCreateTime(new Date());
+			exam.setCanStuDel(true);
+			if (!examService.checkExamName(exam)) {
+				errorMap.put("errorMsg", "考试名称已存在,请重新填写");
+				return new ResponseEntity(errorMap, HttpStatus.INTERNAL_SERVER_ERROR);
+			}
+			return new ResponseEntity(examService.insertExam(exam, accessUser), HttpStatus.OK);
+		} else {
+			errorMap.put("errorMsg", "accessUser为空");
+			return new ResponseEntity(errorMap, HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+	}
+
+	@ApiOperation(value = "更新考试批次", notes = "更新")
+	@PutMapping("/exam")
+	public ResponseEntity updateExam(@RequestBody Exam exam) {
+		Map<String, String> errorMap = new HashMap<String, String>();
+		if (!examService.checkExamName(exam)) {
+			errorMap.put("errorMsg", "考试名称已存在,请重新填写");
+			return new ResponseEntity(errorMap, HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+		return new ResponseEntity(examService.saveExam(exam), HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "按ID删除考试批次", notes = "删除")
+	@DeleteMapping("/exam/{id}")
+	public ResponseEntity deleteExam(@PathVariable String id) {
+		try {
+			List<Long> examIds = Stream.of(id.split(",")).map(s -> Long.parseLong(s.trim()))
+					.collect(Collectors.toList());
+			examService.deleteExam(examIds);
+			return new ResponseEntity(HttpStatus.OK);
+		} catch (Exception e) {
+			log.error("删除失败:", e);
+			return new ResponseEntity(new ErrorMsg(e.getMessage()), HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+	}
+
+	@ApiOperation(value = "启用考试", notes = "启用考试")
+	@PutMapping("/exam/enable/{ids}")
+	public ResponseEntity enableUser(@PathVariable String ids) {
+		List<Long> examIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
+		for (Long examId : examIds) {
+			Exam exam = examRepo.findOne(examId);
+			exam.setEnable(true);
+			examRepo.save(exam);
+		}
+		return new ResponseEntity(HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "禁用考试", notes = "禁用考试")
+	@PutMapping("/exam/disable/{ids}")
+	public ResponseEntity disableUser(@PathVariable String ids) {
+		List<Long> examIds = Stream.of(ids.split(",")).map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
+		for (Long examId : examIds) {
+			Exam exam = examRepo.findOne(examId);
+			exam.setEnable(false);
+			examRepo.save(exam);
+		}
+		return new ResponseEntity(HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "回填考生不可删除标志", notes = "回填考生不可删除标志")
+	@PutMapping("/exam/canNotDel/{id}")
+	public ResponseEntity disableUser(@PathVariable Long id) {
+		examRepo.canNotDel(id);
+		return new ResponseEntity(HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "网考初始化更新考务信息", notes = "网考初始化更新考务信息")
+	@PutMapping("/exam/updateExamInfo")
+	public ResponseEntity updateExamInfo(@RequestParam Long examId, @RequestParam Long examStuId) {
+		examRepo.canNotDel(examId);
+		examStudentService.updateExamStudentInfo(examStuId);
+		return new ResponseEntity(HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "网考更新考务信息", notes = "网考更新考务信息")
+	@PutMapping("/exam/updateExamStudent")
+	public ResponseEntity updateExamStudent(@RequestParam Long examId, @RequestParam Long examStuId) {
+		examRepo.canNotDel(examId);
+		ExamStudent examStudent = examStudentRepo.findOne(examStuId);
+		examStudent.setFinished(true);
+		examStudentRepo.save(examStudent);
+		return new ResponseEntity(HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "查询课程组", notes = "查询课程组")
+	@GetMapping("/exam/allCourseGroups/{examId}/{curPage}/{pageSize}")
+	public ResponseEntity<?> queryAllCourseGroups(@PathVariable Long examId, @PathVariable Integer curPage,
+			@PathVariable Integer pageSize) {
+
+		List<CourseGroup> groupList = courseGroupRepo.findByExamId(examId, (curPage - 1) * pageSize, pageSize);
+
+		for (CourseGroup courseGroup : groupList) {
+			List<Long> courseIdList = Lists.newArrayList();
+			courseGroup.setCourseIdList(courseIdList);
+
+			List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
+					"select t.course_id from ecs_exam_course_group_course t where t.group_id=?", courseGroup.getId());
+			if (CollectionUtils.isNotEmpty(queryList)) {
+				for (Map<String, Object> map : queryList) {
+					Long courseId = Long.valueOf(map.get("COURSE_ID").toString());
+					courseIdList.add(courseId);
+				}
+			}
+		}
+
+		return new ResponseEntity<List<CourseGroup>>(groupList, HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "查询课程组", notes = "查询课程组")
+	@GetMapping("/exam/queryCourseGroupsByCourseId/{courseId}")
+	public ResponseEntity<?> queryCourseGroupsByCourseId(@PathVariable Long courseId) {
+		List<CourseGroup> groupList = courseGroupRepo.queryCourseGroupsByCourseId(courseId);
+
+		for (CourseGroup courseGroup : groupList) {
+			List<Long> courseIdList = Lists.newArrayList();
+			courseGroup.setCourseIdList(courseIdList);
+
+			List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
+					"select t.course_id from ecs_exam_course_group_course t where t.group_id=?", courseGroup.getId());
+			if (CollectionUtils.isNotEmpty(queryList)) {
+				for (Map<String, Object> map : queryList) {
+					Long curCourseId = Long.valueOf(map.get("COURSE_ID").toString());
+					courseIdList.add(curCourseId);
+				}
+			}
+		}
+
+		return new ResponseEntity<Object>(groupList, HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "更新课程组", notes = "更新课程组")
+	@PutMapping("/exam/courseGroup")
+	public ResponseEntity<?> updateCourseGroup(@RequestBody CourseGroup courseGroup, HttpServletRequest request) {
+
+		courseGroupRepo.save(courseGroup);
+		Long groupId = courseGroup.getId();
+		Long examId = courseGroup.getExamId();
+
+		List<Long> courseIdList = courseGroup.getCourseIdList();
+		jdbcTemplate.update("delete from ecs_exam_course_group_course  where group_id=?", groupId);
+
+		if (CollectionUtils.isNotEmpty(courseIdList)) {
+			for (Long courseId : courseIdList) {
+				jdbcTemplate.update("delete from ecs_exam_course_group_course  where exam_id=? and course_id=?",
+						groupId, courseId);
+				jdbcTemplate.update(
+						"insert into ecs_exam_course_group_course(group_id,course_id,exam_id) values(?,?,?)", groupId,
+						courseId, examId);
+			}
+		}
+
+		return new ResponseEntity<Object>(HttpStatus.OK);
+	}
+
+	@ApiOperation(value = "删除课程组", notes = "添加课程组")
+	@DeleteMapping("/exam/courseGroup/{id}")
+	public ResponseEntity<?> CourseGroup(@PathVariable Long id, HttpServletRequest request) {
+		courseGroupRepo.delete(id);
+		jdbcTemplate.update("delete from ecs_exam_course_group_course  where group_id=?", id);
+		return new ResponseEntity<Object>(HttpStatus.OK);
+	}
+}

+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamCourseApi.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamCourseApi.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamOrgTimeApi.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamOrgTimeApi.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamPaperTypeApi.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamPaperTypeApi.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamScoreApi.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamScoreApi.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamStudentApi.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/api/ExamStudentApi.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamCourseService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamCourseService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamOrgTimeService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamOrgTimeService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamScoreService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamScoreService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamStudentService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamStudentService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/CourseService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/CourseService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/OeService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/OeService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/OrgService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/OrgService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/SpecialtyService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/SpecialtyService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/StudentService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/StudentService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/CourseClient.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/CourseClient.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/OeClient.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/OeClient.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/OrgClient.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/OrgClient.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/SpecialtyClient.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/SpecialtyClient.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/StudentClient.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/rpc/client/StudentClient.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/sync/DataReceiveService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/sync/DataReceiveService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/sync/DataSendService.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/sync/DataSendService.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/util/ExportUtils.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/util/ExportUtils.java


+ 0 - 0
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/util/ImportUtils.java → examcloud-core-examwork-api/src/main/java/cn/com/qmth/examcloud/service/examwork/util/ImportUtils.java


+ 37 - 35
exam-work-domain/pom.xml → examcloud-core-examwork-domain/pom.xml

@@ -1,36 +1,38 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<parent>
-		<artifactId>exam-work</artifactId>
-		<groupId>cn.com.qmth.examcloud.service</groupId>
-		<version>0.1.0</version>
-	</parent>
-	<modelVersion>4.0.0</modelVersion>
-
-	<artifactId>exam-work-domain</artifactId>
-
-	<dependencies>
-		<dependency>
-			<groupId>mysql</groupId>
-			<artifactId>mysql-connector-java</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-data-jpa</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.hibernate</groupId>
-			<artifactId>hibernate-validator</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>cn.com.qmth.examcloud.common</groupId>
-			<artifactId>common-support</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>cn.com.qmth.examcloud.common</groupId>
-			<artifactId>common-util</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-	</dependencies>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>cn.com.qmth.examcloud.core.examwork</groupId>
+		<artifactId>examcloud-core-examwork</artifactId>
+		<version>0.1.0</version>
+	</parent>
+
+	<artifactId>examcloud-core-examwork-domain</artifactId>
+	<packaging>jar</packaging>
+
+	<dependencies>
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-data-jpa</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-validator</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>cn.com.qmth.examcloud.commons</groupId>
+			<artifactId>examcloud-commons-support</artifactId>
+			<version>${examcloud.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>cn.com.qmth.examcloud.commons</groupId>
+			<artifactId>examcloud-commons-util</artifactId>
+			<version>${examcloud.version}</version>
+		</dependency>
+	</dependencies>
 </project>

+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/assembler/ExamStudentAssembler.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/assembler/ExamStudentAssembler.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/criteria/BasePageable.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/criteria/BasePageable.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/criteria/ExamCourseCriteria.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/criteria/ExamCourseCriteria.java


+ 21 - 21
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/CourseGroupRepo.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/CourseGroupRepo.java

@@ -1,21 +1,21 @@
-package cn.com.qmth.examcloud.service.examwork.dao;
-
-import java.util.List;
-
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.repository.query.Param;
-import org.springframework.data.repository.query.QueryByExampleExecutor;
-
-import cn.com.qmth.examcloud.service.examwork.entity.CourseGroup;
-
-public interface CourseGroupRepo extends JpaRepository<CourseGroup, Long>, QueryByExampleExecutor<CourseGroup> {
-
-	@Query(value = "select * from ecs_exam_course_group t where t.exam_id=?1 order by id desc limit ?2,?3", nativeQuery = true)
-	List<CourseGroup> findByExamId(@Param("examId") Long examId, @Param("curPage") Integer curPage,
-			@Param("pageSize") Integer pageSize);
-
-	@Query(value = "select x.* from ecs_exam_course_group x,ecs_exam_course_group_course  y where x.id=y.group_id and y.course_id=?1", nativeQuery = true)
-	List<CourseGroup> queryCourseGroupsByCourseId(@Param("courseId") Long courseId);
-
-}
+package cn.com.qmth.examcloud.service.examwork.dao;
+
+import java.util.List;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.data.repository.query.QueryByExampleExecutor;
+
+import cn.com.qmth.examcloud.service.examwork.entity.CourseGroup;
+
+public interface CourseGroupRepo extends JpaRepository<CourseGroup, Long>, QueryByExampleExecutor<CourseGroup> {
+
+	@Query(value = "select * from ecs_exam_course_group t where t.exam_id=?1 order by id desc limit ?2,?3", nativeQuery = true)
+	List<CourseGroup> findByExamId(@Param("examId") Long examId, @Param("curPage") Integer curPage,
+			@Param("pageSize") Integer pageSize);
+
+	@Query(value = "select x.* from ecs_exam_course_group x,ecs_exam_course_group_course  y where x.id=y.group_id and y.course_id=?1", nativeQuery = true)
+	List<CourseGroup> queryCourseGroupsByCourseId(@Param("courseId") Long courseId);
+
+}

+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamOrgTimeRepo.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamOrgTimeRepo.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamRepo.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamRepo.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamScoreRepo.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamScoreRepo.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamStudentRepo.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dao/ExamStudentRepo.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/ExamCourseDTO.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/ExamCourseDTO.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/ExamPaperTypeDTO.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/ExamPaperTypeDTO.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/ExamStudentDTO.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/ExamStudentDTO.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/OrgExamInfoDTO.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/dto/OrgExamInfoDTO.java


+ 108 - 108
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/CourseGroup.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/CourseGroup.java

@@ -1,108 +1,108 @@
-package cn.com.qmth.examcloud.service.examwork.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-import org.springframework.format.annotation.DateTimeFormat;
-
-/**
- * 课程组
- * 
- * @author WANG
- *
- */
-@Entity
-@Table(name = "ecs_exam_course_group")
-public class CourseGroup implements Serializable {
-
-	private static final long serialVersionUID = -3335725218626631530L;
-
-	@Id
-	@GeneratedValue
-	private Long id;
-
-	private Long examId;
-
-	private String name;
-
-	private String description;
-
-	@Transient
-	private List<Long> courseIdList;
-
-	/**
-	 * 考试批次开始时间
-	 */
-	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	private Date beginTime;
-
-	/**
-	 * 考试批次结束时间
-	 */
-	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	private Date endTime;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Long getExamId() {
-		return examId;
-	}
-
-	public void setExamId(Long examId) {
-		this.examId = examId;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getDescription() {
-		return description;
-	}
-
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-	public List<Long> getCourseIdList() {
-		return courseIdList;
-	}
-
-	public void setCourseIdList(List<Long> courseIdList) {
-		this.courseIdList = courseIdList;
-	}
-
-	public Date getBeginTime() {
-		return beginTime;
-	}
-
-	public void setBeginTime(Date beginTime) {
-		this.beginTime = beginTime;
-	}
-
-	public Date getEndTime() {
-		return endTime;
-	}
-
-	public void setEndTime(Date endTime) {
-		this.endTime = endTime;
-	}
-
-}
+package cn.com.qmth.examcloud.service.examwork.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * 课程组
+ * 
+ * @author WANG
+ *
+ */
+@Entity
+@Table(name = "ecs_exam_course_group")
+public class CourseGroup implements Serializable {
+
+	private static final long serialVersionUID = -3335725218626631530L;
+
+	@Id
+	@GeneratedValue
+	private Long id;
+
+	private Long examId;
+
+	private String name;
+
+	private String description;
+
+	@Transient
+	private List<Long> courseIdList;
+
+	/**
+	 * 考试批次开始时间
+	 */
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date beginTime;
+
+	/**
+	 * 考试批次结束时间
+	 */
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date endTime;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public List<Long> getCourseIdList() {
+		return courseIdList;
+	}
+
+	public void setCourseIdList(List<Long> courseIdList) {
+		this.courseIdList = courseIdList;
+	}
+
+	public Date getBeginTime() {
+		return beginTime;
+	}
+
+	public void setBeginTime(Date beginTime) {
+		this.beginTime = beginTime;
+	}
+
+	public Date getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(Date endTime) {
+		this.endTime = endTime;
+	}
+
+}

+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/Exam.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/Exam.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamOrgTime.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamOrgTime.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamScore.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamScore.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamStudent.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/entity/ExamStudent.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/ExamType.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/ExamType.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/MarkingType.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/MarkingType.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/PracticeType.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/PracticeType.java


+ 0 - 0
exam-work-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/isValid.java → examcloud-core-examwork-domain/src/main/java/cn/com/qmth/examcloud/service/examwork/enums/isValid.java


+ 55 - 0
examcloud-core-examwork-main/pom.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>cn.com.qmth.examcloud.core.examwork</groupId>
+		<artifactId>examcloud-core-examwork</artifactId>
+		<version>0.1.0</version>
+	</parent>
+
+	<artifactId>examcloud-core-examwork-main</artifactId>
+	<packaging>jar</packaging>
+
+	<dependencies>
+		<dependency>
+			<groupId>cn.com.qmth.examcloud.core.examwork</groupId>
+			<artifactId>examcloud-core-examwork-api</artifactId>
+			<version>${examcloud.version}</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-autoconfigure</artifactId>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+				<configuration><!-- 指定该Main Class为全局的唯一入口 -->
+					<mainClass>cn.com.qmth.examcloud.service.examwork.Application</mainClass>
+					<layout>ZIP</layout>
+					<includeSystemScope>true</includeSystemScope>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.8</source>
+					<target>1.8</target>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>

+ 0 - 0
exam-work-main/src/main/java/cn/com/qmth/examcloud/service/examwork/AccessControlConfig.java → examcloud-core-examwork-main/src/main/java/cn/com/qmth/examcloud/service/examwork/AccessControlConfig.java


+ 54 - 54
exam-work-main/src/main/java/cn/com/qmth/examcloud/service/examwork/Application.java → examcloud-core-examwork-main/src/main/java/cn/com/qmth/examcloud/service/examwork/Application.java

@@ -1,54 +1,54 @@
-package cn.com.qmth.examcloud.service.examwork;
-
-import com.qmth.commons.query.dao.impl.BaseQueryDaoImpl;
-
-import cn.com.qmth.examcloud.common.support.logging.ExamCloudLog;
-import cn.com.qmth.examcloud.common.support.logging.ExamCloudLogFactory;
-import cn.com.qmth.examcloud.common.support.logging.SLF4JImpl;
-
-import org.slf4j.MDC;
-import org.springframework.boot.SpringApplication;
-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.netflix.eureka.EnableEurekaClient;
-import org.springframework.cloud.netflix.feign.EnableFeignClients;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
-import org.springframework.web.multipart.MultipartResolver;
-import org.springframework.web.multipart.commons.CommonsMultipartResolver;
-
-@ComponentScan(basePackages = {"com.qmth.commons","cn.com.qmth"})
-@EntityScan(basePackages = {"com.qmth.commons","cn.com.qmth"})
-@EnableJpaRepositories(basePackages = {"com.qmth.commons","cn.com.qmth"},repositoryBaseClass = BaseQueryDaoImpl.class)
-@SpringBootApplication
-@EnableEurekaClient
-@EnableFeignClients
-@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class})
-public class Application {
-	
-	private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(Application.class);
-
-	public static void main(String[] args) throws Exception {
-		if (LOG instanceof SLF4JImpl) {
-			// 设置主线程埋点跟踪链
-			MDC.put("TRACE_ID", Thread.currentThread().getName());
-		}
-		SpringApplication.run(Application.class, args);
-	}
-
-	// 显示声明CommonsMultipartResolver为mutipartResolver
-	@Bean(name = "multipartResolver")
-	public MultipartResolver multipartResolver() {
-		CommonsMultipartResolver resolver = new CommonsMultipartResolver();
-		resolver.setDefaultEncoding("UTF-8");
-		resolver.setResolveLazily(true);// resolveLazily属性启用是为了推迟文件解析,以在在UploadAction中捕获文件大小异常
-		resolver.setMaxInMemorySize(40960);
-		resolver.setMaxUploadSize(200 * 1024 * 1024);// 上传文件大小 200M 50*1024*1024
-		return resolver;
-	}
-}
-
-
+package cn.com.qmth.examcloud.service.examwork;
+
+import com.qmth.commons.query.dao.impl.BaseQueryDaoImpl;
+
+import cn.com.qmth.examcloud.common.support.logging.ExamCloudLog;
+import cn.com.qmth.examcloud.common.support.logging.ExamCloudLogFactory;
+import cn.com.qmth.examcloud.common.support.logging.SLF4JImpl;
+
+import org.slf4j.MDC;
+import org.springframework.boot.SpringApplication;
+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.netflix.eureka.EnableEurekaClient;
+import org.springframework.cloud.netflix.feign.EnableFeignClients;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.web.multipart.MultipartResolver;
+import org.springframework.web.multipart.commons.CommonsMultipartResolver;
+
+@ComponentScan(basePackages = {"com.qmth.commons","cn.com.qmth"})
+@EntityScan(basePackages = {"com.qmth.commons","cn.com.qmth"})
+@EnableJpaRepositories(basePackages = {"com.qmth.commons","cn.com.qmth"},repositoryBaseClass = BaseQueryDaoImpl.class)
+@SpringBootApplication
+@EnableEurekaClient
+@EnableFeignClients
+@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class})
+public class Application {
+	
+	private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(Application.class);
+
+	public static void main(String[] args) throws Exception {
+		if (LOG instanceof SLF4JImpl) {
+			// 设置主线程埋点跟踪链
+			MDC.put("TRACE_ID", Thread.currentThread().getName());
+		}
+		SpringApplication.run(Application.class, args);
+	}
+
+	// 显示声明CommonsMultipartResolver为mutipartResolver
+	@Bean(name = "multipartResolver")
+	public MultipartResolver multipartResolver() {
+		CommonsMultipartResolver resolver = new CommonsMultipartResolver();
+		resolver.setDefaultEncoding("UTF-8");
+		resolver.setResolveLazily(true);// resolveLazily属性启用是为了推迟文件解析,以在在UploadAction中捕获文件大小异常
+		resolver.setMaxInMemorySize(40960);
+		resolver.setMaxUploadSize(200 * 1024 * 1024);// 上传文件大小 200M 50*1024*1024
+		return resolver;
+	}
+}
+
+

+ 0 - 0
exam-work-main/src/main/java/cn/com/qmth/examcloud/service/examwork/Swagger2.java → examcloud-core-examwork-main/src/main/java/cn/com/qmth/examcloud/service/examwork/Swagger2.java


+ 15 - 15
exam-work-main/src/main/resources/application-dev.properties → examcloud-core-examwork-main/src/main/resources/application-dev.properties

@@ -1,16 +1,16 @@
-spring.datasource.url=jdbc:mysql://192.168.10.30:3306/exam_cloud_test?useUnicode=true&characterEncoding=UTF-8&useSSL=false
-spring.datasource.username=root
-spring.datasource.password=root
-
-
-spring.redis.host=192.168.10.30
-spring.redis.port=6379
-
-
-eureka.client.serviceUrl.defaultZone=http://192.168.10.30:1111/eureka/
-
-spring.rabbitmq.host=192.168.10.30
-spring.rabbitmq.port=5672
-spring.rabbitmq.username=examcloud
-spring.rabbitmq.password=examcloud
+spring.datasource.url=jdbc:mysql://192.168.10.30:3306/exam_cloud_test?useUnicode=true&characterEncoding=UTF-8&useSSL=false
+spring.datasource.username=root
+spring.datasource.password=root
+
+
+spring.redis.host=192.168.10.30
+spring.redis.port=6379
+
+
+eureka.client.serviceUrl.defaultZone=http://192.168.10.30:1111/eureka/
+
+spring.rabbitmq.host=192.168.10.30
+spring.rabbitmq.port=5672
+spring.rabbitmq.username=examcloud
+spring.rabbitmq.password=examcloud
 spring.rabbitmq.listener.acknowledgeMode=MANUAL

+ 0 - 0
exam-work-main/src/main/resources/application-prac.properties → examcloud-core-examwork-main/src/main/resources/application-prac.properties


+ 0 - 0
exam-work-main/src/main/resources/application-prod.properties → examcloud-core-examwork-main/src/main/resources/application-prod.properties


+ 0 - 0
exam-work-main/src/main/resources/application-prodvpc.properties → examcloud-core-examwork-main/src/main/resources/application-prodvpc.properties


+ 0 - 0
exam-work-main/src/main/resources/application-test.properties → examcloud-core-examwork-main/src/main/resources/application-test.properties


+ 0 - 0
exam-work-main/src/main/resources/application.properties → examcloud-core-examwork-main/src/main/resources/application.properties


+ 0 - 0
exam-work-main/src/main/resources/logback-spring.xml → examcloud-core-examwork-main/src/main/resources/logback-spring.xml


+ 7 - 7
pom.xml

@@ -1,20 +1,20 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>cn.com.qmth.examcloud</groupId>
 		<artifactId>examcloud-parent</artifactId>
 		<version>0.1.0</version>
 	</parent>
-	<groupId>cn.com.qmth.examcloud.service</groupId>
-	<artifactId>exam-work</artifactId>
-	<name>ExamCloud-service-exam-work</name>
+	<groupId>cn.com.qmth.examcloud.core.examwork</groupId>
+	<artifactId>examcloud-core-examwork</artifactId>
 	<packaging>pom</packaging>
 
 	<modules>
-		<module>exam-work-domain</module>
-		<module>exam-work-api</module>
-		<module>exam-work-main</module>
+		<module>examcloud-core-examwork-domain</module>
+		<module>examcloud-core-examwork-api</module>
+		<module>examcloud-core-examwork-main</module>
 	</modules>
 
 </project>