wangwei 6 yıl önce
ebeveyn
işleme
4b6dbf299e
83 değiştirilmiş dosya ile 4609 ekleme ve 4609 silme
  1. 71 71
      examcloud-exchange-inner-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/inner/api/controller/UpyunController.java
  2. 2 2
      examcloud-exchange-inner-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/inner/api/provider/SendSmsProvider.java
  3. 62 62
      examcloud-exchange-inner-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/inner/api/provider/UpyunCloudServiceProvider.java
  4. 1 1
      examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/bean/CaptureFailedAlarmInfo.java
  5. 68 68
      examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/bean/UpyunPathEnvironmentInfo.java
  6. 2 2
      examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/impl/SendSmsServiceImpl.java
  7. 53 53
      examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/impl/UpyunServiceImpl.java
  8. 268 268
      examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/upyun/UpYunClient.java
  9. 66 66
      examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/upyun/UpyunSite.java
  10. 109 109
      examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/upyun/UpyunSiteManager.java
  11. 2 2
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/CommonGainScoreController.java
  12. 178 178
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/FaceController.java
  13. 90 90
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/ExamController.java
  14. 51 51
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/ExamVerifyPhotoController.java
  15. 114 114
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/StudentInfoController.java
  16. 93 93
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/bean/ExamReq.java
  17. 251 251
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/bean/StudentInfoReq.java
  18. 103 103
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/sydx/ScoreController.java
  19. 246 246
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/sydx/StudentExamInfoController.java
  20. 33 33
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/sydx/bean/ExamStudentImportRequest.java
  21. 3 3
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/CourseGroupOuterServiceProvider.java
  22. 3 3
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/ExamOuterServiceProvider.java
  23. 3 3
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/ExamStudentOuterServiceProvider.java
  24. 216 216
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/FaceOuterServiceProvider.java
  25. 3 3
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/GetExamRecordAuditInfoServiceProvider.java
  26. 3 3
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/GetScoreDataServiceProvider.java
  27. 3 3
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/QueryCapturePhotoServiceProvider.java
  28. 3 3
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/ScoreQueueServiceProvider.java
  29. 197 197
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/StudentOuterServiceProvider.java
  30. 196 196
      examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/cug/CugOuterServiceProvider.java
  31. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/CourseGroupOuterService.java
  32. 26 26
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/CugOuterService.java
  33. 36 36
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/ExamOuterService.java
  34. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/ExamStudentOuterService.java
  35. 29 29
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/FaceOuterService.java
  36. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/GetExamRecordAuditInfoService.java
  37. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/GetScoreDataService.java
  38. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/QueryCapturePhotoService.java
  39. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/ScoreQueueService.java
  40. 27 27
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/StudentOuterService.java
  41. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/bean/CourseBean.java
  42. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/bean/ExamStudent4BatchBean.java
  43. 159 159
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/bean/OuterExamStudentBean.java
  44. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/bean/OuterGetCapturePhotoBean.java
  45. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/bean/OuterScoreDataBean.java
  46. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterBatchSaveExamStudentReq.java
  47. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterBatchSaveStudentReq.java
  48. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterDeleteScoreQueueTopReq.java
  49. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterGetCourseListReq.java
  50. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterGetExamRecordAuditInfoReq.java
  51. 61 61
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterGetExamReq.java
  52. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterGetScoreDataReq.java
  53. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterGetScoreQueueTopReq.java
  54. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterQueryCapturePhotoReq.java
  55. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterQueryScoreDataReq.java
  56. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterSaveExamReq.java
  57. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterSaveExamStudentReq.java
  58. 171 171
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterSaveStudentReq.java
  59. 171 171
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/cug/OuterSaveCugStudentAndExamStudentReq.java
  60. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/BatchOuterSaveExamStudentResp.java
  61. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/BatchOuterSaveStudentResp.java
  62. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterDeleteScoreQueueTopResp.java
  63. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterGetCourseListResp.java
  64. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterGetExamRecordAuditInfoResp.java
  65. 159 159
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterGetExamResp.java
  66. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterGetScoreDataResp.java
  67. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterGetScoreQueueTopResp.java
  68. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterQueryCapturePhotoResp.java
  69. 1 1
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterQueryScoreDataResp.java
  70. 28 28
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterSaveExamResp.java
  71. 29 29
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterSaveExamStudentResp.java
  72. 16 16
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterSaveStudentPhotoResp.java
  73. 54 54
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterSaveStudentResp.java
  74. 74 74
      examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/cug/SaveCugStudentAndExamStudentResp.java
  75. 46 46
      examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/bean/Course.java
  76. 38 38
      examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/bean/CourseGroup.java
  77. 5 5
      examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/CourseGroupServiceImpl.java
  78. 279 279
      examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/FaceServiceImpl.java
  79. 386 386
      examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/OutletScoreServiceImpl.java
  80. 109 109
      examcloud-exchange-starter/src/main/java/cn/com/qmth/examcloud/exchange/ExchangeApp.java
  81. 39 39
      examcloud-exchange-starter/src/main/java/cn/com/qmth/examcloud/exchange/config/AppSelfInspection.java
  82. 134 134
      examcloud-exchange-starter/src/main/java/cn/com/qmth/examcloud/exchange/config/DefaultWebMvcConfigurerAdapter.java
  83. 10 10
      examcloud-exchange-starter/src/main/java/cn/com/qmth/examcloud/exchange/config/ThirdPartyAccessInterceptor.java

+ 71 - 71
examcloud-exchange-inner-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/inner/api/controller/UpyunController.java

@@ -1,71 +1,71 @@
-package cn.com.qmth.examcloud.exchange.inner.api.controller;
-
-import java.io.IOException;
-
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.poi.util.IOUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import cn.com.qmth.examcloud.commons.base.exception.ExamCloudRuntimeException;
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.base.util.AES;
-import cn.com.qmth.examcloud.commons.web.security.bean.User;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.exchange.inner.service.UpyunService;
-import cn.com.qmth.examcloud.exchange.inner.service.bean.UpyunPathEnvironmentInfo;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * Upyun服务
- *
- * @author WANGWEI
- * @date 2018年11月21日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@RestController
-@RequestMapping("${$rmp.ctr.exchange.inner}/upyun")
-public class UpyunController extends ControllerSupport {
-
-	@Autowired
-	UpyunService upyunService;
-
-	AES aes = new AES();
-
-	@ApiOperation(value = "保存照片")
-	@PutMapping("put/{siteId}/{fileSuffix}")
-	public String putFile(@PathVariable String siteId, @PathVariable String fileSuffix,
-			HttpServletRequest req) {
-
-		User accessUser = getAccessUser();
-
-		if (!fileSuffix.matches("\\w+")) {
-			throw new StatusException("EX-600100", "fileSuffix is wrong");
-		}
-
-		fileSuffix = "." + fileSuffix;
-
-		ServletInputStream in = null;
-		try {
-			in = req.getInputStream();
-
-			UpyunPathEnvironmentInfo env = new UpyunPathEnvironmentInfo();
-			env.setRootOrgId(String.valueOf(accessUser.getRootOrgId()));
-			env.setUserId(String.valueOf(accessUser.getUserId()));
-			env.setFileSuffix(fileSuffix);
-			String url = upyunService.writeFile(siteId, env, in);
-			url = aes.encrypt(url);
-			return url;
-		} catch (IOException e) {
-			throw new ExamCloudRuntimeException(e);
-		} finally {
-			IOUtils.closeQuietly(in);
-		}
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.inner.api.controller;
+
+import java.io.IOException;
+
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.poi.util.IOUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.util.AES;
+import cn.com.qmth.examcloud.exchange.inner.service.UpyunService;
+import cn.com.qmth.examcloud.exchange.inner.service.bean.UpyunPathEnvironmentInfo;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * Upyun服务
+ *
+ * @author WANGWEI
+ * @date 2018年11月21日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@RestController
+@RequestMapping("${$rmp.ctr.exchange.inner}/upyun")
+public class UpyunController extends ControllerSupport {
+
+	@Autowired
+	UpyunService upyunService;
+
+	AES aes = new AES();
+
+	@ApiOperation(value = "保存照片")
+	@PutMapping("put/{siteId}/{fileSuffix}")
+	public String putFile(@PathVariable String siteId, @PathVariable String fileSuffix,
+			HttpServletRequest req) {
+
+		User accessUser = getAccessUser();
+
+		if (!fileSuffix.matches("\\w+")) {
+			throw new StatusException("EX-600100", "fileSuffix is wrong");
+		}
+
+		fileSuffix = "." + fileSuffix;
+
+		ServletInputStream in = null;
+		try {
+			in = req.getInputStream();
+
+			UpyunPathEnvironmentInfo env = new UpyunPathEnvironmentInfo();
+			env.setRootOrgId(String.valueOf(accessUser.getRootOrgId()));
+			env.setUserId(String.valueOf(accessUser.getUserId()));
+			env.setFileSuffix(fileSuffix);
+			String url = upyunService.writeFile(siteId, env, in);
+			url = aes.encrypt(url);
+			return url;
+		} catch (IOException e) {
+			throw new ExamCloudRuntimeException(e);
+		} finally {
+			IOUtils.closeQuietly(in);
+		}
+	}
+
+}

+ 2 - 2
examcloud-exchange-inner-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/inner/api/provider/SendSmsProvider.java

@@ -11,8 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.google.gson.JsonObject;
 
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.exchange.inner.api.SendSmsCloudService;
 import cn.com.qmth.examcloud.exchange.inner.api.request.CaptureFailedAlarmReq;
 import cn.com.qmth.examcloud.exchange.inner.api.request.CheckSmsCodeReq;
@@ -22,6 +21,7 @@ import cn.com.qmth.examcloud.exchange.inner.api.response.SendSmsResp;
 import cn.com.qmth.examcloud.exchange.inner.service.SendSmsService;
 import cn.com.qmth.examcloud.exchange.inner.service.bean.CaptureFailedAlarmInfo;
 import cn.com.qmth.examcloud.exchange.inner.service.bean.SendSmsInfo;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
 
 /**
  * 

+ 62 - 62
examcloud-exchange-inner-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/inner/api/provider/UpyunCloudServiceProvider.java

@@ -1,62 +1,62 @@
-package cn.com.qmth.examcloud.exchange.inner.api.provider;
-
-import java.io.File;
-
-import org.apache.commons.fileupload.disk.DiskFileItem;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
-
-import cn.com.qmth.examcloud.commons.base.util.AES;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.exchange.inner.api.UpyunCloudService;
-import cn.com.qmth.examcloud.exchange.inner.api.request.PutFileReq;
-import cn.com.qmth.examcloud.exchange.inner.api.response.PutFileResp;
-import cn.com.qmth.examcloud.exchange.inner.service.UpyunService;
-import cn.com.qmth.examcloud.exchange.inner.service.bean.UpyunPathEnvironmentInfo;
-
-/**
- * Upyun服务
- *
- * @author WANGWEI
- * @date 2018年11月21日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@RestController
-@RequestMapping("${$rmp.cloud.exchange.inner}/upyun")
-public class UpyunCloudServiceProvider extends ControllerSupport implements UpyunCloudService {
-
-	private static final long serialVersionUID = -6911335293165224994L;
-
-	@Autowired
-	UpyunService upyunService;
-
-	AES aes = new AES();
-
-	@PostMapping("putFile")
-	@Override
-	public PutFileResp putFile(PutFileReq req) {
-		String fileSuffix = req.getFileSuffix();
-		Long rootOrgId = req.getRootOrgId();
-		Long userId = req.getUserId();
-		String siteId = req.getSiteId();
-		CommonsMultipartFile file = req.getFile();
-		DiskFileItem item = (DiskFileItem) file.getFileItem();
-		File storeLocation = item.getStoreLocation();
-
-		UpyunPathEnvironmentInfo env = new UpyunPathEnvironmentInfo();
-		env.setRootOrgId(String.valueOf(rootOrgId));
-		env.setUserId(String.valueOf(userId));
-		env.setFileSuffix(fileSuffix);
-
-		String url = upyunService.writeFile(siteId, env, storeLocation);
-		url = aes.encrypt(url);
-
-		PutFileResp resp = new PutFileResp();
-		resp.setUrl(url);
-		return resp;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.inner.api.provider;
+
+import java.io.File;
+
+import org.apache.commons.fileupload.disk.DiskFileItem;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import cn.com.qmth.examcloud.commons.util.AES;
+import cn.com.qmth.examcloud.exchange.inner.api.UpyunCloudService;
+import cn.com.qmth.examcloud.exchange.inner.api.request.PutFileReq;
+import cn.com.qmth.examcloud.exchange.inner.api.response.PutFileResp;
+import cn.com.qmth.examcloud.exchange.inner.service.UpyunService;
+import cn.com.qmth.examcloud.exchange.inner.service.bean.UpyunPathEnvironmentInfo;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+
+/**
+ * Upyun服务
+ *
+ * @author WANGWEI
+ * @date 2018年11月21日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@RestController
+@RequestMapping("${$rmp.cloud.exchange.inner}/upyun")
+public class UpyunCloudServiceProvider extends ControllerSupport implements UpyunCloudService {
+
+	private static final long serialVersionUID = -6911335293165224994L;
+
+	@Autowired
+	UpyunService upyunService;
+
+	AES aes = new AES();
+
+	@PostMapping("putFile")
+	@Override
+	public PutFileResp putFile(PutFileReq req) {
+		String fileSuffix = req.getFileSuffix();
+		Long rootOrgId = req.getRootOrgId();
+		Long userId = req.getUserId();
+		String siteId = req.getSiteId();
+		CommonsMultipartFile file = req.getFile();
+		DiskFileItem item = (DiskFileItem) file.getFileItem();
+		File storeLocation = item.getStoreLocation();
+
+		UpyunPathEnvironmentInfo env = new UpyunPathEnvironmentInfo();
+		env.setRootOrgId(String.valueOf(rootOrgId));
+		env.setUserId(String.valueOf(userId));
+		env.setFileSuffix(fileSuffix);
+
+		String url = upyunService.writeFile(siteId, env, storeLocation);
+		url = aes.encrypt(url);
+
+		PutFileResp resp = new PutFileResp();
+		resp.setUrl(url);
+		return resp;
+	}
+
+}

+ 1 - 1
examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/bean/CaptureFailedAlarmInfo.java

@@ -1,6 +1,6 @@
 package cn.com.qmth.examcloud.exchange.inner.service.bean;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 
 public class CaptureFailedAlarmInfo extends BaseRequest{
 

+ 68 - 68
examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/bean/UpyunPathEnvironmentInfo.java

@@ -1,68 +1,68 @@
-package cn.com.qmth.examcloud.exchange.inner.service.bean;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
-
-/**
- * 又拍云路径变量
- *
- * @author WANGWEI
- * @date 2018年11月21日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class UpyunPathEnvironmentInfo implements JsonSerializable {
-
-	private static final long serialVersionUID = -3579995914084929142L;
-
-	/**
-	 * 顶级机构
-	 */
-	private String rootOrgId;
-
-	/**
-	 * 用户ID
-	 */
-	private String userId;
-
-	/**
-	 * 时间戳
-	 */
-	private String currentTimeMillis;
-
-	/**
-	 * 文件后缀(以"."开头,如 ".jpg",".zip")
-	 */
-	private String fileSuffix;
-
-	public String getRootOrgId() {
-		return rootOrgId;
-	}
-
-	public void setRootOrgId(String rootOrgId) {
-		this.rootOrgId = rootOrgId;
-	}
-
-	public String getUserId() {
-		return userId;
-	}
-
-	public void setUserId(String userId) {
-		this.userId = userId;
-	}
-
-	public String getCurrentTimeMillis() {
-		return currentTimeMillis;
-	}
-
-	public void setCurrentTimeMillis(String currentTimeMillis) {
-		this.currentTimeMillis = currentTimeMillis;
-	}
-
-	public String getFileSuffix() {
-		return fileSuffix;
-	}
-
-	public void setFileSuffix(String fileSuffix) {
-		this.fileSuffix = fileSuffix;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.inner.service.bean;
+
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
+
+/**
+ * 又拍云路径变量
+ *
+ * @author WANGWEI
+ * @date 2018年11月21日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class UpyunPathEnvironmentInfo implements JsonSerializable {
+
+	private static final long serialVersionUID = -3579995914084929142L;
+
+	/**
+	 * 顶级机构
+	 */
+	private String rootOrgId;
+
+	/**
+	 * 用户ID
+	 */
+	private String userId;
+
+	/**
+	 * 时间戳
+	 */
+	private String currentTimeMillis;
+
+	/**
+	 * 文件后缀(以"."开头,如 ".jpg",".zip")
+	 */
+	private String fileSuffix;
+
+	public String getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(String rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String getCurrentTimeMillis() {
+		return currentTimeMillis;
+	}
+
+	public void setCurrentTimeMillis(String currentTimeMillis) {
+		this.currentTimeMillis = currentTimeMillis;
+	}
+
+	public String getFileSuffix() {
+		return fileSuffix;
+	}
+
+	public void setFileSuffix(String fileSuffix) {
+		this.fileSuffix = fileSuffix;
+	}
+
+}

+ 2 - 2
examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/impl/SendSmsServiceImpl.java

@@ -18,12 +18,12 @@ import com.aliyuncs.exceptions.ServerException;
 import com.aliyuncs.profile.DefaultProfile;
 import com.aliyuncs.profile.IClientProfile;
 
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.exchange.inner.service.SendSmsService;
 import cn.com.qmth.examcloud.exchange.inner.service.bean.CaptureFailedAlarmInfo;
 import cn.com.qmth.examcloud.exchange.inner.service.bean.SendSmsInfo;
 import cn.com.qmth.examcloud.exchange.inner.service.bean.SmsCodeRedisInfo;
+import cn.com.qmth.examcloud.web.redis.RedisClient;
 
 @Service("sendSmsService")
 public class SendSmsServiceImpl implements SendSmsService {

+ 53 - 53
examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/impl/UpyunServiceImpl.java

@@ -1,53 +1,53 @@
-package cn.com.qmth.examcloud.exchange.inner.service.impl;
-
-import java.io.File;
-import java.io.InputStream;
-
-import org.springframework.stereotype.Service;
-
-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.util.FreeMarkerUtil;
-import cn.com.qmth.examcloud.exchange.inner.service.UpyunService;
-import cn.com.qmth.examcloud.exchange.inner.service.bean.UpyunPathEnvironmentInfo;
-import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpYunClient;
-import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpyunSite;
-import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpyunSiteManager;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年9月4日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Service
-public class UpyunServiceImpl implements UpyunService {
-
-	protected ExamCloudLog log = ExamCloudLogFactory.getLog(this.getClass());
-
-	@Override
-	public String writeFile(String siteId, UpyunPathEnvironmentInfo env, InputStream in) {
-		env.setCurrentTimeMillis(String.valueOf(System.currentTimeMillis()));
-
-		UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
-		UpYunClient upYunClient = UpyunSiteManager.getUpYunClient(siteId);
-
-		String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
-		String url = upYunClient.writeFile(path, in);
-		return url;
-	}
-
-	@Override
-	public String writeFile(String siteId, UpyunPathEnvironmentInfo env, File file) {
-		env.setCurrentTimeMillis(String.valueOf(System.currentTimeMillis()));
-
-		UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
-		UpYunClient upYunClient = UpyunSiteManager.getUpYunClient(siteId);
-
-		String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
-		String url = upYunClient.writeFile(path, file);
-		return url;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.inner.service.impl;
+
+import java.io.File;
+import java.io.InputStream;
+
+import org.springframework.stereotype.Service;
+
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
+import cn.com.qmth.examcloud.commons.util.FreeMarkerUtil;
+import cn.com.qmth.examcloud.exchange.inner.service.UpyunService;
+import cn.com.qmth.examcloud.exchange.inner.service.bean.UpyunPathEnvironmentInfo;
+import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpYunClient;
+import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpyunSite;
+import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpyunSiteManager;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年9月4日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Service
+public class UpyunServiceImpl implements UpyunService {
+
+	protected ExamCloudLog log = ExamCloudLogFactory.getLog(this.getClass());
+
+	@Override
+	public String writeFile(String siteId, UpyunPathEnvironmentInfo env, InputStream in) {
+		env.setCurrentTimeMillis(String.valueOf(System.currentTimeMillis()));
+
+		UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
+		UpYunClient upYunClient = UpyunSiteManager.getUpYunClient(siteId);
+
+		String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
+		String url = upYunClient.writeFile(path, in);
+		return url;
+	}
+
+	@Override
+	public String writeFile(String siteId, UpyunPathEnvironmentInfo env, File file) {
+		env.setCurrentTimeMillis(String.valueOf(System.currentTimeMillis()));
+
+		UpyunSite upyunSite = UpyunSiteManager.getUpyunSite(siteId);
+		UpYunClient upYunClient = UpyunSiteManager.getUpYunClient(siteId);
+
+		String path = FreeMarkerUtil.process(upyunSite.getPath(), env);
+		String url = upYunClient.writeFile(path, file);
+		return url;
+	}
+
+}

+ 268 - 268
examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/upyun/UpYunClient.java

@@ -1,268 +1,268 @@
-package cn.com.qmth.examcloud.exchange.inner.service.upyun;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-import java.util.TimeZone;
-
-import org.apache.commons.compress.utils.IOUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.HttpStatus;
-import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPut;
-import org.apache.http.entity.InputStreamEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
-import org.apache.http.util.EntityUtils;
-
-import com.upyun.UpException;
-import com.upyun.UpYunUtils;
-
-import cn.com.qmth.examcloud.commons.base.exception.ExamCloudRuntimeException;
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-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.util.PropertiesUtil;
-
-/**
- * upyun SDK定制版
- *
- * @author WANGWEI
- * @date 2018年11月21日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class UpYunClient {
-
-	protected ExamCloudLog log = ExamCloudLogFactory.getLog(this.getClass());
-
-	/**
-	 * 空间名
-	 */
-	protected String bucketName = null;
-
-	/**
-	 * 操作员名
-	 */
-	protected String userName = null;
-
-	/**
-	 * 操作员密码
-	 */
-	protected String password = null;
-
-	protected String md5Password = null;
-
-	public static final String API_DOMAIN = "v0.api.upyun.com";
-
-	private static final String MKDIR = "mkdir";
-
-	private final String METHOD_PUT = "PUT";
-
-	private final String DATE = "Date";
-
-	private final String AUTHORIZATION = "Authorization";
-
-	private final String SEPARATOR = "/";
-
-	private CloseableHttpClient httpclient;
-
-	private RequestConfig requestConfig;
-
-	private String testUrl;
-
-	private String base64Auth = null;
-
-	private boolean unsafe;
-
-	/**
-	 * 构造函数
-	 *
-	 * @param bucketName
-	 * @param userName
-	 * @param password
-	 */
-	public UpYunClient(String bucketName, String userName, String password) {
-		PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
-		cm.setMaxTotal(1000);
-		httpclient = HttpClients.custom().setConnectionManager(cm).disableAutomaticRetries()
-				.build();
-		requestConfig = RequestConfig.custom().setConnectionRequestTimeout(10000)
-				.setSocketTimeout(10000).setConnectTimeout(10000).build();
-
-		this.bucketName = bucketName;
-		this.userName = userName;
-		this.password = password;
-		this.md5Password = md5(password);
-
-		base64Auth = "Basic " + org.apache.commons.codec.binary.Base64
-				.encodeBase64String((userName + ":" + password).getBytes());
-		unsafe = false;
-
-		testUrl = PropertiesUtil.getString("$upyun.testUrl");
-	}
-
-	/**
-	 * 上传文件
-	 *
-	 * @author WANGWEI
-	 * @param filePath
-	 * @param file
-	 * @return
-	 */
-	public String writeFile(String filePath, File file) {
-
-		InputStream in = null;
-		try {
-			in = new FileInputStream(file);
-			return writeFile(filePath, in);
-		} catch (FileNotFoundException e) {
-			throw new ExamCloudRuntimeException(e);
-		} finally {
-			IOUtils.closeQuietly(in);
-		}
-	}
-
-	/**
-	 * 上传文件
-	 *
-	 * @author WANGWEI
-	 * @param filePath
-	 * @param in
-	 * @return
-	 */
-	public String writeFile(String filePath, InputStream in) {
-		String path = formatPath(filePath);
-		String url = "http://" + API_DOMAIN + path;
-		if (filePath.endsWith(".test")) {
-			url = testUrl;
-		}
-
-		HttpPut httpPut = new HttpPut(url);
-		httpPut.setConfig(this.requestConfig);
-		CloseableHttpResponse response = null;
-
-		long s = System.currentTimeMillis();
-		try {
-
-			String date = getGMTDate();
-			httpPut.addHeader(DATE, date);
-
-			if (unsafe) {
-				httpPut.addHeader(AUTHORIZATION, base64Auth);
-			} else {
-				httpPut.addHeader(AUTHORIZATION, UpYunUtils
-						.sign(METHOD_PUT, date, path, userName, this.md5Password, null).trim());
-			}
-
-			httpPut.addHeader(MKDIR, "true");
-
-			httpPut.setEntity(new InputStreamEntity(in));
-			response = httpclient.execute(httpPut);
-			int statusCode = response.getStatusLine().getStatusCode();
-
-			if (HttpStatus.SC_OK != statusCode) {
-				log.error("[upyun error] " + EntityUtils.toString(response.getEntity(), "UTF-8"));
-				throw new StatusException("EX-100001", "upyun upload failure");
-			}
-		} catch (StatusException e) {
-			throw e;
-		} catch (UpException e) {
-			throw new ExamCloudRuntimeException(e);
-		} catch (Exception e) {
-			throw new ExamCloudRuntimeException(e);
-		} finally {
-			IOUtils.closeQuietly(in);
-			IOUtils.closeQuietly(response);
-			httpPut.releaseConnection();
-		}
-
-		if (log.isDebugEnabled()) {
-			log.debug("[upyun]. path=" + path + "; cost " + (System.currentTimeMillis() - s)
-					+ " ms.");
-		}
-
-		String fileUrl = "http://" + bucketName + ".b0.upaiyun.com" + filePath;
-		return fileUrl;
-	}
-
-	/**
-	 * 格式化路径参数,去除前后的空格并确保以"/"开头,最后添加"/空间名"
-	 * <p>
-	 * 最终构成的格式:"/空间名/文件路径"
-	 *
-	 * @param path
-	 *            目录路径或文件路径
-	 * @return 格式化后的路径
-	 */
-	private String formatPath(String path) {
-
-		if (StringUtils.isNotBlank(path)) {
-
-			// 去除前后的空格
-			path = path.trim();
-
-			// 确保路径以"/"开头
-			if (!path.startsWith(SEPARATOR)) {
-				return SEPARATOR + bucketName + SEPARATOR + path;
-			}
-		}
-
-		return SEPARATOR + bucketName + path;
-	}
-
-	/**
-	 * 对字符串进行 MD5 加密
-	 *
-	 * @param str
-	 *            待加密字符串
-	 * @return 加密后字符串
-	 */
-	private static String md5(String str) {
-		char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd',
-				'e', 'f'};
-		MessageDigest md5 = null;
-		try {
-			md5 = MessageDigest.getInstance("MD5");
-			md5.update(str.getBytes("UTF-8"));
-		} catch (NoSuchAlgorithmException e) {
-			e.printStackTrace();
-			throw new RuntimeException(e.getMessage());
-		} catch (UnsupportedEncodingException e) {
-			e.printStackTrace();
-			throw new RuntimeException(e.getMessage());
-		}
-		byte[] encodedValue = md5.digest();
-		int j = encodedValue.length;
-		char finalValue[] = new char[j * 2];
-		int k = 0;
-		for (int i = 0; i < j; i++) {
-			byte encoded = encodedValue[i];
-			finalValue[k++] = hexDigits[encoded >> 4 & 0xf];
-			finalValue[k++] = hexDigits[encoded & 0xf];
-		}
-
-		return new String(finalValue);
-	}
-
-	/**
-	 * 获取 GMT 格式时间戳
-	 *
-	 * @return GMT 格式时间戳
-	 */
-	private String getGMTDate() {
-		SimpleDateFormat formater = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'",
-				Locale.US);
-		formater.setTimeZone(TimeZone.getTimeZone("GMT"));
-		return formater.format(new Date());
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.inner.service.upyun;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+import java.util.TimeZone;
+
+import org.apache.commons.compress.utils.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.entity.InputStreamEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.util.EntityUtils;
+
+import com.upyun.UpException;
+import com.upyun.UpYunUtils;
+
+import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
+import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
+
+/**
+ * upyun SDK定制版
+ *
+ * @author WANGWEI
+ * @date 2018年11月21日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class UpYunClient {
+
+	protected ExamCloudLog log = ExamCloudLogFactory.getLog(this.getClass());
+
+	/**
+	 * 空间名
+	 */
+	protected String bucketName = null;
+
+	/**
+	 * 操作员名
+	 */
+	protected String userName = null;
+
+	/**
+	 * 操作员密码
+	 */
+	protected String password = null;
+
+	protected String md5Password = null;
+
+	public static final String API_DOMAIN = "v0.api.upyun.com";
+
+	private static final String MKDIR = "mkdir";
+
+	private final String METHOD_PUT = "PUT";
+
+	private final String DATE = "Date";
+
+	private final String AUTHORIZATION = "Authorization";
+
+	private final String SEPARATOR = "/";
+
+	private CloseableHttpClient httpclient;
+
+	private RequestConfig requestConfig;
+
+	private String testUrl;
+
+	private String base64Auth = null;
+
+	private boolean unsafe;
+
+	/**
+	 * 构造函数
+	 *
+	 * @param bucketName
+	 * @param userName
+	 * @param password
+	 */
+	public UpYunClient(String bucketName, String userName, String password) {
+		PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
+		cm.setMaxTotal(1000);
+		httpclient = HttpClients.custom().setConnectionManager(cm).disableAutomaticRetries()
+				.build();
+		requestConfig = RequestConfig.custom().setConnectionRequestTimeout(10000)
+				.setSocketTimeout(10000).setConnectTimeout(10000).build();
+
+		this.bucketName = bucketName;
+		this.userName = userName;
+		this.password = password;
+		this.md5Password = md5(password);
+
+		base64Auth = "Basic " + org.apache.commons.codec.binary.Base64
+				.encodeBase64String((userName + ":" + password).getBytes());
+		unsafe = false;
+
+		testUrl = PropertiesUtil.getString("$upyun.testUrl");
+	}
+
+	/**
+	 * 上传文件
+	 *
+	 * @author WANGWEI
+	 * @param filePath
+	 * @param file
+	 * @return
+	 */
+	public String writeFile(String filePath, File file) {
+
+		InputStream in = null;
+		try {
+			in = new FileInputStream(file);
+			return writeFile(filePath, in);
+		} catch (FileNotFoundException e) {
+			throw new ExamCloudRuntimeException(e);
+		} finally {
+			IOUtils.closeQuietly(in);
+		}
+	}
+
+	/**
+	 * 上传文件
+	 *
+	 * @author WANGWEI
+	 * @param filePath
+	 * @param in
+	 * @return
+	 */
+	public String writeFile(String filePath, InputStream in) {
+		String path = formatPath(filePath);
+		String url = "http://" + API_DOMAIN + path;
+		if (filePath.endsWith(".test")) {
+			url = testUrl;
+		}
+
+		HttpPut httpPut = new HttpPut(url);
+		httpPut.setConfig(this.requestConfig);
+		CloseableHttpResponse response = null;
+
+		long s = System.currentTimeMillis();
+		try {
+
+			String date = getGMTDate();
+			httpPut.addHeader(DATE, date);
+
+			if (unsafe) {
+				httpPut.addHeader(AUTHORIZATION, base64Auth);
+			} else {
+				httpPut.addHeader(AUTHORIZATION, UpYunUtils
+						.sign(METHOD_PUT, date, path, userName, this.md5Password, null).trim());
+			}
+
+			httpPut.addHeader(MKDIR, "true");
+
+			httpPut.setEntity(new InputStreamEntity(in));
+			response = httpclient.execute(httpPut);
+			int statusCode = response.getStatusLine().getStatusCode();
+
+			if (HttpStatus.SC_OK != statusCode) {
+				log.error("[upyun error] " + EntityUtils.toString(response.getEntity(), "UTF-8"));
+				throw new StatusException("EX-100001", "upyun upload failure");
+			}
+		} catch (StatusException e) {
+			throw e;
+		} catch (UpException e) {
+			throw new ExamCloudRuntimeException(e);
+		} catch (Exception e) {
+			throw new ExamCloudRuntimeException(e);
+		} finally {
+			IOUtils.closeQuietly(in);
+			IOUtils.closeQuietly(response);
+			httpPut.releaseConnection();
+		}
+
+		if (log.isDebugEnabled()) {
+			log.debug("[upyun]. path=" + path + "; cost " + (System.currentTimeMillis() - s)
+					+ " ms.");
+		}
+
+		String fileUrl = "http://" + bucketName + ".b0.upaiyun.com" + filePath;
+		return fileUrl;
+	}
+
+	/**
+	 * 格式化路径参数,去除前后的空格并确保以"/"开头,最后添加"/空间名"
+	 * <p>
+	 * 最终构成的格式:"/空间名/文件路径"
+	 *
+	 * @param path
+	 *            目录路径或文件路径
+	 * @return 格式化后的路径
+	 */
+	private String formatPath(String path) {
+
+		if (StringUtils.isNotBlank(path)) {
+
+			// 去除前后的空格
+			path = path.trim();
+
+			// 确保路径以"/"开头
+			if (!path.startsWith(SEPARATOR)) {
+				return SEPARATOR + bucketName + SEPARATOR + path;
+			}
+		}
+
+		return SEPARATOR + bucketName + path;
+	}
+
+	/**
+	 * 对字符串进行 MD5 加密
+	 *
+	 * @param str
+	 *            待加密字符串
+	 * @return 加密后字符串
+	 */
+	private static String md5(String str) {
+		char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd',
+				'e', 'f'};
+		MessageDigest md5 = null;
+		try {
+			md5 = MessageDigest.getInstance("MD5");
+			md5.update(str.getBytes("UTF-8"));
+		} catch (NoSuchAlgorithmException e) {
+			e.printStackTrace();
+			throw new RuntimeException(e.getMessage());
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+			throw new RuntimeException(e.getMessage());
+		}
+		byte[] encodedValue = md5.digest();
+		int j = encodedValue.length;
+		char finalValue[] = new char[j * 2];
+		int k = 0;
+		for (int i = 0; i < j; i++) {
+			byte encoded = encodedValue[i];
+			finalValue[k++] = hexDigits[encoded >> 4 & 0xf];
+			finalValue[k++] = hexDigits[encoded & 0xf];
+		}
+
+		return new String(finalValue);
+	}
+
+	/**
+	 * 获取 GMT 格式时间戳
+	 *
+	 * @return GMT 格式时间戳
+	 */
+	private String getGMTDate() {
+		SimpleDateFormat formater = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'",
+				Locale.US);
+		formater.setTimeZone(TimeZone.getTimeZone("GMT"));
+		return formater.format(new Date());
+	}
+
+}

+ 66 - 66
examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/upyun/UpyunSite.java

@@ -1,66 +1,66 @@
-package cn.com.qmth.examcloud.exchange.inner.service.upyun;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年11月21日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class UpyunSite implements JsonSerializable {
-
-	private static final long serialVersionUID = -1754474062438702321L;
-
-	private String id;
-
-	private String name;
-
-	private String upyunId;
-
-	private String maxSize;
-
-	private String path;
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getUpyunId() {
-		return upyunId;
-	}
-
-	public void setUpyunId(String upyunId) {
-		this.upyunId = upyunId;
-	}
-
-	public String getMaxSize() {
-		return maxSize;
-	}
-
-	public void setMaxSize(String maxSize) {
-		this.maxSize = maxSize;
-	}
-
-	public String getPath() {
-		return path;
-	}
-
-	public void setPath(String path) {
-		this.path = path;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.inner.service.upyun;
+
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年11月21日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class UpyunSite implements JsonSerializable {
+
+	private static final long serialVersionUID = -1754474062438702321L;
+
+	private String id;
+
+	private String name;
+
+	private String upyunId;
+
+	private String maxSize;
+
+	private String path;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getUpyunId() {
+		return upyunId;
+	}
+
+	public void setUpyunId(String upyunId) {
+		this.upyunId = upyunId;
+	}
+
+	public String getMaxSize() {
+		return maxSize;
+	}
+
+	public void setMaxSize(String maxSize) {
+		this.maxSize = maxSize;
+	}
+
+	public String getPath() {
+		return path;
+	}
+
+	public void setPath(String path) {
+		this.path = path;
+	}
+
+}

+ 109 - 109
examcloud-exchange-inner-service/src/main/java/cn/com/qmth/examcloud/exchange/inner/service/upyun/UpyunSiteManager.java

@@ -1,109 +1,109 @@
-package cn.com.qmth.examcloud.exchange.inner.service.upyun;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.thoughtworks.xstream.XStream;
-
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.base.helpers.XStreamBuilder;
-import cn.com.qmth.examcloud.commons.base.util.PathUtil;
-import cn.com.qmth.examcloud.commons.base.util.PropertiesUtil;
-
-/**
- * upyun site manager
- *
- * @author WANGWEI
- * @date 2018年11月21日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class UpyunSiteManager {
-
-	private static final Map<String, UpYunClient> CLIENT_HOLDERS = new ConcurrentHashMap<>();
-
-	private static final Map<String, UpyunSite> SITE_HOLDERS = new ConcurrentHashMap<>();
-
-	public static void init() {
-		String resoucePath = PathUtil.getResoucePath("upyun.xml");
-		File file = new File(resoucePath);
-
-		XStream xStream = XStreamBuilder.newInstance().build();
-		xStream.allowTypes(new Class[]{UpyunSite.class, List.class});
-		xStream.alias("sites", List.class);
-		xStream.alias("site", UpyunSite.class);
-
-		List<UpyunSite> list = null;
-		try {
-			@SuppressWarnings("unchecked")
-			List<UpyunSite> obj = (List<UpyunSite>) xStream.fromXML(file);
-			list = obj;
-		} catch (Exception e) {
-			throw new StatusException("EX-520001", "upyun.xml is wrong", e);
-		}
-
-		for (UpyunSite upyunSite : list) {
-
-			SITE_HOLDERS.put(upyunSite.getId(), upyunSite);
-
-			String upyunId = upyunSite.getUpyunId();
-			String bucketName = PropertiesUtil.getString("$upyun.site." + upyunId + ".bucketName");
-			String userName = PropertiesUtil.getString("$upyun.site." + upyunId + ".userName");
-			String password = PropertiesUtil.getString("$upyun.site." + upyunId + ".password");
-
-			if (StringUtils.isBlank(bucketName)) {
-				throw new StatusException("EX-520002",
-						"bucketName is not configured. upyunId=" + upyunId);
-			}
-			if (StringUtils.isBlank(userName)) {
-				throw new StatusException("EX-520003",
-						"userName is not configured. upyunId=" + upyunId);
-			}
-			if (StringUtils.isBlank(password)) {
-				throw new StatusException("EX-520004",
-						"password is not configured. upyunId=" + upyunId);
-			}
-
-			UpYunClient upYunClient = new UpYunClient(bucketName, userName, password);
-
-			CLIENT_HOLDERS.put(upyunSite.getId(), upYunClient);
-		}
-
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param siteId
-	 * @return
-	 */
-	public static UpYunClient getUpYunClient(String siteId) {
-		UpYunClient upYunClient = CLIENT_HOLDERS.get(siteId);
-
-		if (null == upYunClient) {
-			throw new StatusException("EX-520005", "upYunClient is null");
-		}
-		return upYunClient;
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param siteId
-	 * @return
-	 */
-	public static UpyunSite getUpyunSite(String siteId) {
-		UpyunSite upyunSite = SITE_HOLDERS.get(siteId);
-
-		if (null == upyunSite) {
-			throw new StatusException("EX-520006", "upyunSite is null");
-		}
-		return upyunSite;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.inner.service.upyun;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.commons.lang3.StringUtils;
+
+import com.thoughtworks.xstream.XStream;
+
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.helpers.XStreamBuilder;
+import cn.com.qmth.examcloud.commons.util.PathUtil;
+import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
+
+/**
+ * upyun site manager
+ *
+ * @author WANGWEI
+ * @date 2018年11月21日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class UpyunSiteManager {
+
+	private static final Map<String, UpYunClient> CLIENT_HOLDERS = new ConcurrentHashMap<>();
+
+	private static final Map<String, UpyunSite> SITE_HOLDERS = new ConcurrentHashMap<>();
+
+	public static void init() {
+		String resoucePath = PathUtil.getResoucePath("upyun.xml");
+		File file = new File(resoucePath);
+
+		XStream xStream = XStreamBuilder.newInstance().build();
+		xStream.allowTypes(new Class[]{UpyunSite.class, List.class});
+		xStream.alias("sites", List.class);
+		xStream.alias("site", UpyunSite.class);
+
+		List<UpyunSite> list = null;
+		try {
+			@SuppressWarnings("unchecked")
+			List<UpyunSite> obj = (List<UpyunSite>) xStream.fromXML(file);
+			list = obj;
+		} catch (Exception e) {
+			throw new StatusException("EX-520001", "upyun.xml is wrong", e);
+		}
+
+		for (UpyunSite upyunSite : list) {
+
+			SITE_HOLDERS.put(upyunSite.getId(), upyunSite);
+
+			String upyunId = upyunSite.getUpyunId();
+			String bucketName = PropertiesUtil.getString("$upyun.site." + upyunId + ".bucketName");
+			String userName = PropertiesUtil.getString("$upyun.site." + upyunId + ".userName");
+			String password = PropertiesUtil.getString("$upyun.site." + upyunId + ".password");
+
+			if (StringUtils.isBlank(bucketName)) {
+				throw new StatusException("EX-520002",
+						"bucketName is not configured. upyunId=" + upyunId);
+			}
+			if (StringUtils.isBlank(userName)) {
+				throw new StatusException("EX-520003",
+						"userName is not configured. upyunId=" + upyunId);
+			}
+			if (StringUtils.isBlank(password)) {
+				throw new StatusException("EX-520004",
+						"password is not configured. upyunId=" + upyunId);
+			}
+
+			UpYunClient upYunClient = new UpYunClient(bucketName, userName, password);
+
+			CLIENT_HOLDERS.put(upyunSite.getId(), upYunClient);
+		}
+
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param siteId
+	 * @return
+	 */
+	public static UpYunClient getUpYunClient(String siteId) {
+		UpYunClient upYunClient = CLIENT_HOLDERS.get(siteId);
+
+		if (null == upYunClient) {
+			throw new StatusException("EX-520005", "upYunClient is null");
+		}
+		return upYunClient;
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param siteId
+	 * @return
+	 */
+	public static UpyunSite getUpyunSite(String siteId) {
+		UpyunSite upyunSite = SITE_HOLDERS.get(siteId);
+
+		if (null == upyunSite) {
+			throw new StatusException("EX-520006", "upyunSite is null");
+		}
+		return upyunSite;
+	}
+
+}

+ 2 - 2
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/CommonGainScoreController.java

@@ -14,12 +14,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import cn.com.qmth.examcloud.commons.web.security.bean.User;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.exchange.base.response.FailureBaseResponse;
 import cn.com.qmth.examcloud.exchange.base.response.SuccessBaseResponse;
 import cn.com.qmth.examcloud.exchange.outer.service.OutletScoreService;
 import cn.com.qmth.examcloud.exchange.outer.service.bean.OutletScore;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
 import io.swagger.annotations.ApiOperation;
 
 /**

+ 178 - 178
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/FaceController.java

@@ -1,178 +1,178 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.fileupload.disk.DiskFileItem;
-import org.apache.tomcat.util.http.fileupload.FileUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
-
-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.util.ZipUtil;
-import cn.com.qmth.examcloud.commons.web.security.bean.User;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 人脸 处理
- * 
- * @author chenken
- * @date 2018年4月3日 下午3:58:31
- * @company QMTH
- * @description FaceppController.java
- */
-@RestController
-@RequestMapping("/api/ecs_outlet/facepp")
-public class FaceController extends ControllerSupport {
-
-	@Value("${$tempDir}")
-	private String tempDir;
-
-	/**
-	 * ZIP最大50M
-	 */
-	private static final int ZIP_MAX_SIZE = 50;
-
-	/**
-	 * 每张照片最大尺寸 500KB
-	 */
-	private static final int MAX_SIZE = 500;
-
-	@Autowired
-	private FaceService faceService;
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param file
-	 */
-	@ApiOperation(value = "保存学生照片")
-	@PostMapping("add")
-	public void addPhoto(@RequestParam CommonsMultipartFile file) {
-		User accessUser = getAccessUser();
-		Long rootOrgId = accessUser.getRootOrgId();
-
-		log.debug("fileName =" + file.getOriginalFilename());
-		DiskFileItem item = (DiskFileItem) file.getFileItem();
-		File storeLocation = item.getStoreLocation();
-		String fileName = file.getOriginalFilename();
-
-		if (StringUtils.containsWhitespace(fileName)) {
-			throw new StatusException("EX-600100", "文件名不能含有空白字符");
-		}
-
-		if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
-			throw new StatusException("EX-600101", "文件名不合法");
-		}
-		String identityNumber = fileName.substring(0, fileName.lastIndexOf("."));
-		String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
-
-		faceService.processFace(rootOrgId, identityNumber, fileSuffix, storeLocation,
-				accessUser.getDisplayName());
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param file
-	 * @return
-	 */
-	@ApiOperation(value = "导入学生照片")
-	@PostMapping("import")
-	public List<Map<String, String>> importPhotos(@RequestParam CommonsMultipartFile file) {
-
-		User accessUser = getAccessUser();
-		Long rootOrgId = accessUser.getRootOrgId();
-
-		DiskFileItem item = (DiskFileItem) file.getFileItem();
-		File storeLocation = item.getStoreLocation();
-		String filename = file.getOriginalFilename();
-
-		if (!filename.endsWith(".zip")) {
-			throw new StatusException("EX-620001", "文件格式不正确,必须是zip格式的压缩包");
-		}
-		// 文件大小限制
-		if (file.getSize() > ZIP_MAX_SIZE * 1024 * 1024) {
-			throw new StatusException("EX-620002", "文件大小超过50M,请分批导入");
-		}
-
-		List<Map<String, String>> ret = Lists.newArrayList();
-
-		String tempDirPath = tempDir + File.separator + "photo_import" + File.separator
-				+ System.currentTimeMillis();
-		File tempDir = new File(tempDirPath);
-		try {
-			ZipUtil.unzip(storeLocation, new File(tempDirPath));
-		} catch (Exception e) {
-			throw new StatusException("EX-620003", "zip文件损坏");
-		}
-
-		File[] files = tempDir.listFiles();
-
-		if (null == files) {
-			throw new StatusException("EX-620004", "zip文件为空");
-		}
-
-		for (File f : files) {
-			Map<String, String> map = Maps.newHashMap();
-			String fileName = f.getName();
-			map.put("file", fileName);
-
-			if (f.length() > MAX_SIZE * 1024) {
-				map.put("statusCode", "EX-620005");
-				map.put("statusDesc", "文件大小超过500KB");
-				ret.add(map);
-				continue;
-			}
-			try {
-				if (StringUtils.containsWhitespace(fileName)) {
-					throw new StatusException("EX-600100", "文件名不能含有空白字符");
-				}
-
-				if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
-					throw new StatusException("EX-600101", "文件名不合法");
-				}
-				String identityNumber = fileName.substring(0, fileName.lastIndexOf("."));
-				String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
-
-				faceService.processFace(rootOrgId, identityNumber, fileSuffix, f,
-						accessUser.getDisplayName());
-
-				map.put("statusCode", "200");
-				map.put("statusDesc", "成功");
-
-			} catch (StatusException e) {
-				map.put("statusCode", e.getCode());
-				map.put("statusDesc", e.getDesc());
-			} catch (Exception e) {
-				map.put("statusCode", "系统异常");
-				map.put("statusDesc", e.getCause().getMessage());
-			}
-			ret.add(map);
-		}
-
-		try {
-			FileUtils.deleteDirectory(tempDir);
-		} catch (IOException e) {
-			log.error("fail to clean temp dir.", e);
-		}
-
-		return ret;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.controller;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.fileupload.disk.DiskFileItem;
+import org.apache.tomcat.util.http.fileupload.FileUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.util.ZipUtil;
+import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 人脸 处理
+ * 
+ * @author chenken
+ * @date 2018年4月3日 下午3:58:31
+ * @company QMTH
+ * @description FaceppController.java
+ */
+@RestController
+@RequestMapping("/api/ecs_outlet/facepp")
+public class FaceController extends ControllerSupport {
+
+	@Value("${$tempDir}")
+	private String tempDir;
+
+	/**
+	 * ZIP最大50M
+	 */
+	private static final int ZIP_MAX_SIZE = 50;
+
+	/**
+	 * 每张照片最大尺寸 500KB
+	 */
+	private static final int MAX_SIZE = 500;
+
+	@Autowired
+	private FaceService faceService;
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param file
+	 */
+	@ApiOperation(value = "保存学生照片")
+	@PostMapping("add")
+	public void addPhoto(@RequestParam CommonsMultipartFile file) {
+		User accessUser = getAccessUser();
+		Long rootOrgId = accessUser.getRootOrgId();
+
+		log.debug("fileName =" + file.getOriginalFilename());
+		DiskFileItem item = (DiskFileItem) file.getFileItem();
+		File storeLocation = item.getStoreLocation();
+		String fileName = file.getOriginalFilename();
+
+		if (StringUtils.containsWhitespace(fileName)) {
+			throw new StatusException("EX-600100", "文件名不能含有空白字符");
+		}
+
+		if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
+			throw new StatusException("EX-600101", "文件名不合法");
+		}
+		String identityNumber = fileName.substring(0, fileName.lastIndexOf("."));
+		String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
+
+		faceService.processFace(rootOrgId, identityNumber, fileSuffix, storeLocation,
+				accessUser.getDisplayName());
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param file
+	 * @return
+	 */
+	@ApiOperation(value = "导入学生照片")
+	@PostMapping("import")
+	public List<Map<String, String>> importPhotos(@RequestParam CommonsMultipartFile file) {
+
+		User accessUser = getAccessUser();
+		Long rootOrgId = accessUser.getRootOrgId();
+
+		DiskFileItem item = (DiskFileItem) file.getFileItem();
+		File storeLocation = item.getStoreLocation();
+		String filename = file.getOriginalFilename();
+
+		if (!filename.endsWith(".zip")) {
+			throw new StatusException("EX-620001", "文件格式不正确,必须是zip格式的压缩包");
+		}
+		// 文件大小限制
+		if (file.getSize() > ZIP_MAX_SIZE * 1024 * 1024) {
+			throw new StatusException("EX-620002", "文件大小超过50M,请分批导入");
+		}
+
+		List<Map<String, String>> ret = Lists.newArrayList();
+
+		String tempDirPath = tempDir + File.separator + "photo_import" + File.separator
+				+ System.currentTimeMillis();
+		File tempDir = new File(tempDirPath);
+		try {
+			ZipUtil.unzip(storeLocation, new File(tempDirPath));
+		} catch (Exception e) {
+			throw new StatusException("EX-620003", "zip文件损坏");
+		}
+
+		File[] files = tempDir.listFiles();
+
+		if (null == files) {
+			throw new StatusException("EX-620004", "zip文件为空");
+		}
+
+		for (File f : files) {
+			Map<String, String> map = Maps.newHashMap();
+			String fileName = f.getName();
+			map.put("file", fileName);
+
+			if (f.length() > MAX_SIZE * 1024) {
+				map.put("statusCode", "EX-620005");
+				map.put("statusDesc", "文件大小超过500KB");
+				ret.add(map);
+				continue;
+			}
+			try {
+				if (StringUtils.containsWhitespace(fileName)) {
+					throw new StatusException("EX-600100", "文件名不能含有空白字符");
+				}
+
+				if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
+					throw new StatusException("EX-600101", "文件名不合法");
+				}
+				String identityNumber = fileName.substring(0, fileName.lastIndexOf("."));
+				String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
+
+				faceService.processFace(rootOrgId, identityNumber, fileSuffix, f,
+						accessUser.getDisplayName());
+
+				map.put("statusCode", "200");
+				map.put("statusDesc", "成功");
+
+			} catch (StatusException e) {
+				map.put("statusCode", e.getCode());
+				map.put("statusDesc", e.getDesc());
+			} catch (Exception e) {
+				map.put("statusCode", "系统异常");
+				map.put("statusDesc", e.getCause().getMessage());
+			}
+			ret.add(map);
+		}
+
+		try {
+			FileUtils.deleteDirectory(tempDir);
+		} catch (IOException e) {
+			log.error("fail to clean temp dir.", e);
+		}
+
+		return ret;
+	}
+
+}

+ 90 - 90
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/ExamController.java

@@ -1,90 +1,90 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe;
-
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-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.Maps;
-
-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.web.security.bean.User;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
-import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
-import cn.com.qmth.examcloud.examwork.api.request.SaveExamReq;
-import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
-import cn.com.qmth.examcloud.exchange.outer.api.controller.swufe.bean.ExamReq;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * @author chenken
- * @date 2018年5月7日 下午3:20:33
- * @company QMTH
- * @description 创建考试
- */
-@RestController
-@RequestMapping("/api/ecs_outlet/exam")
-public class ExamController extends ControllerSupport {
-
-	@Autowired
-	ExamCloudService examCloudService;
-
-	@ApiOperation(value = "创建考试")
-	@PostMapping
-	public Map<String, Object> createExam(@RequestBody ExamReq examReq,
-			HttpServletRequest request) {
-		tranTimes(examReq);
-		User accessUser = getAccessUser();
-		Long rootOrgId = accessUser.getRootOrgId();
-
-		SaveExamReq saveExamReq = new SaveExamReq();
-		saveExamReq.setBeginTime(DateUtil.parse(examReq.getBeginTime(), DatePatterns.ISO));
-		saveExamReq.setDuration(examReq.getDuration());
-		saveExamReq.setEndTime(DateUtil.parse(examReq.getEndTime(), DatePatterns.ISO));
-		saveExamReq.setExamType(examReq.getExamType());
-		saveExamReq.setName(examReq.getName());
-		saveExamReq.setRootOrgId(rootOrgId);
-		examCloudService.saveExam(saveExamReq);
-
-		GetExamReq req = new GetExamReq();
-		req.setName(examReq.getName());
-		req.setRootOrgId(rootOrgId);
-		GetExamResp resp = examCloudService.getExam(req);
-
-		Map<String, Object> map = Maps.newHashMap();
-		map.put("examId", resp.getId());
-		return map;
-
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param examStudentImportDTO
-	 */
-	private void tranTimes(ExamReq exam) {
-		String beginTime = exam.getBeginTime();
-		if (StringUtils.isNotBlank(beginTime)) {
-			beginTime = StringUtils.replace(beginTime, ".000Z", "");
-			beginTime = StringUtils.replace(beginTime, "T", " ");
-			exam.setBeginTime(beginTime);
-		}
-
-		String endTime = exam.getEndTime();
-		if (StringUtils.isNotBlank(endTime)) {
-			endTime = StringUtils.replace(endTime, ".000Z", "");
-			endTime = StringUtils.replace(endTime, "T", " ");
-			exam.setEndTime(endTime);
-		}
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe;
+
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+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.Maps;
+
+import cn.com.qmth.examcloud.commons.util.DateUtil;
+import cn.com.qmth.examcloud.commons.util.DateUtil.DatePatterns;
+import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
+import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamReq;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
+import cn.com.qmth.examcloud.exchange.outer.api.controller.swufe.bean.ExamReq;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * @author chenken
+ * @date 2018年5月7日 下午3:20:33
+ * @company QMTH
+ * @description 创建考试
+ */
+@RestController
+@RequestMapping("/api/ecs_outlet/exam")
+public class ExamController extends ControllerSupport {
+
+	@Autowired
+	ExamCloudService examCloudService;
+
+	@ApiOperation(value = "创建考试")
+	@PostMapping
+	public Map<String, Object> createExam(@RequestBody ExamReq examReq,
+			HttpServletRequest request) {
+		tranTimes(examReq);
+		User accessUser = getAccessUser();
+		Long rootOrgId = accessUser.getRootOrgId();
+
+		SaveExamReq saveExamReq = new SaveExamReq();
+		saveExamReq.setBeginTime(DateUtil.parse(examReq.getBeginTime(), DatePatterns.ISO));
+		saveExamReq.setDuration(examReq.getDuration());
+		saveExamReq.setEndTime(DateUtil.parse(examReq.getEndTime(), DatePatterns.ISO));
+		saveExamReq.setExamType(examReq.getExamType());
+		saveExamReq.setName(examReq.getName());
+		saveExamReq.setRootOrgId(rootOrgId);
+		examCloudService.saveExam(saveExamReq);
+
+		GetExamReq req = new GetExamReq();
+		req.setName(examReq.getName());
+		req.setRootOrgId(rootOrgId);
+		GetExamResp resp = examCloudService.getExam(req);
+
+		Map<String, Object> map = Maps.newHashMap();
+		map.put("examId", resp.getId());
+		return map;
+
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param examStudentImportDTO
+	 */
+	private void tranTimes(ExamReq exam) {
+		String beginTime = exam.getBeginTime();
+		if (StringUtils.isNotBlank(beginTime)) {
+			beginTime = StringUtils.replace(beginTime, ".000Z", "");
+			beginTime = StringUtils.replace(beginTime, "T", " ");
+			exam.setBeginTime(beginTime);
+		}
+
+		String endTime = exam.getEndTime();
+		if (StringUtils.isNotBlank(endTime)) {
+			endTime = StringUtils.replace(endTime, ".000Z", "");
+			endTime = StringUtils.replace(endTime, "T", " ");
+			exam.setEndTime(endTime);
+		}
+	}
+
+}

+ 51 - 51
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/ExamVerifyPhotoController.java

@@ -1,51 +1,51 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import cn.com.qmth.examcloud.commons.web.security.bean.User;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.core.oe.admin.api.ExamRecordCloudService;
-import cn.com.qmth.examcloud.core.oe.admin.api.request.GetExamPhotoVerifyDataReq;
-import cn.com.qmth.examcloud.core.oe.admin.api.response.GetExamPhotoVerifyDataResp;
-import cn.com.qmth.examcloud.exchange.base.response.FailureBaseResponse;
-import cn.com.qmth.examcloud.exchange.base.response.SuccessBaseResponse;
-
-/**
- * @author chenken
- * @date 2018年5月7日 上午11:49:40
- * @company QMTH
- * @description 抓拍照片数据获取接口
- */
-@RestController
-@RequestMapping("/api/ecs_outlet/examVerifyPhotos")
-public class ExamVerifyPhotoController extends ControllerSupport {
-
-	@Autowired
-	private ExamRecordCloudService examRecordCloudService;
-
-	@GetMapping
-	public ResponseEntity<?> getExamVerifyPhotos(HttpServletRequest request,@RequestParam Long scoreId) {
-		User accessUser = getAccessUser();
-		if (accessUser == null) {
-			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"),HttpStatus.INTERNAL_SERVER_ERROR);
-		}
-		try {
-			GetExamPhotoVerifyDataReq req = new GetExamPhotoVerifyDataReq();
-			req.setScoreId(scoreId);
-			GetExamPhotoVerifyDataResp examPhotoVerifyData = examRecordCloudService.getExamPhotoVerifyData(req);
-			return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功", examPhotoVerifyData), HttpStatus.OK);
-		} catch (Exception e) {
-			e.printStackTrace();
-			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("查询失败"),HttpStatus.INTERNAL_SERVER_ERROR);
-		}
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import cn.com.qmth.examcloud.core.oe.admin.api.ExamRecordCloudService;
+import cn.com.qmth.examcloud.core.oe.admin.api.request.GetExamPhotoVerifyDataReq;
+import cn.com.qmth.examcloud.core.oe.admin.api.response.GetExamPhotoVerifyDataResp;
+import cn.com.qmth.examcloud.exchange.base.response.FailureBaseResponse;
+import cn.com.qmth.examcloud.exchange.base.response.SuccessBaseResponse;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+
+/**
+ * @author chenken
+ * @date 2018年5月7日 上午11:49:40
+ * @company QMTH
+ * @description 抓拍照片数据获取接口
+ */
+@RestController
+@RequestMapping("/api/ecs_outlet/examVerifyPhotos")
+public class ExamVerifyPhotoController extends ControllerSupport {
+
+	@Autowired
+	private ExamRecordCloudService examRecordCloudService;
+
+	@GetMapping
+	public ResponseEntity<?> getExamVerifyPhotos(HttpServletRequest request,@RequestParam Long scoreId) {
+		User accessUser = getAccessUser();
+		if (accessUser == null) {
+			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"),HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+		try {
+			GetExamPhotoVerifyDataReq req = new GetExamPhotoVerifyDataReq();
+			req.setScoreId(scoreId);
+			GetExamPhotoVerifyDataResp examPhotoVerifyData = examRecordCloudService.getExamPhotoVerifyData(req);
+			return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功", examPhotoVerifyData), HttpStatus.OK);
+		} catch (Exception e) {
+			e.printStackTrace();
+			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("查询失败"),HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+	}
+
+}

+ 114 - 114
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/StudentInfoController.java

@@ -1,114 +1,114 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-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 com.google.common.collect.Maps;
-
-import cn.com.qmth.examcloud.commons.web.security.bean.User;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
-import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentReq;
-import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentResp;
-import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
-import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
-import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
-import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean;
-import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
-import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
-import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
-import cn.com.qmth.examcloud.examwork.api.response.SaveExamStudentResp;
-import cn.com.qmth.examcloud.exchange.base.enums.CourseLevel;
-import cn.com.qmth.examcloud.exchange.outer.api.controller.swufe.bean.StudentInfoReq;
-
-/**
- * @author chenken
- * @date 2018年5月7日 下午4:30:29
- * @company QMTH
- * @description 保存学生信息
- */
-@RestController
-@RequestMapping("/api/ecs_outlet/studentInfo")
-public class StudentInfoController extends ControllerSupport {
-
-	@Autowired
-	StudentCloudService studentCloudService;
-
-	@Autowired
-	ExamCloudService examCloudService;
-
-	@Autowired
-	ExamStudentCloudService examStudentCloudService;
-
-	@PostMapping
-	public Map<String, Object> saveStudentInfo(@RequestBody List<StudentInfoReq> studentInfoReqs) {
-		User accessUser = getAccessUser();
-		Long rootOrgId = accessUser.getRootOrgId();
-
-		List<Long> examStudentIdList = Lists.newArrayList();
-		for (StudentInfoReq cur : studentInfoReqs) {
-
-			GetExamReq req = new GetExamReq();
-			req.setName(cur.getExamName());
-			req.setRootOrgId(rootOrgId);
-			GetExamResp resp = examCloudService.getExam(req);
-
-			Long examId = resp.getId();
-			ExamBean examBean = resp.getExamBean();
-			String examName = examBean.getName();
-
-			SaveStudentReq saveStudentReq = new SaveStudentReq();
-			saveStudentReq.setIdentityNumber(cur.getIdentityNumber());
-			saveStudentReq.setName(cur.getStudentName());
-			saveStudentReq.setOrgCode(cur.getOrgCode());
-			saveStudentReq.setOrgId(cur.getOrgId());
-			saveStudentReq.setOrgName(cur.getOrgName());
-			saveStudentReq.setRootOrgId(rootOrgId);
-			saveStudentReq.setStudentCode(cur.getStudentCode());
-
-			SaveStudentResp insertOrUpdateStudentResp = studentCloudService
-					.saveStudent(saveStudentReq);
-
-			Long studentId = insertOrUpdateStudentResp.getStudentId();
-
-			SaveExamStudentReq sReq = new SaveExamStudentReq();
-			sReq.setCourseLevel(cur.getCourseLevel());
-
-			CourseLevel courseLevel = CourseLevel.getCourseLevel(cur.getCourseLevel());
-			String courseCode = courseLevel.getAbbreviate() + cur.getCourseCode();
-			sReq.setCourseCode(courseCode);
-
-			sReq.setCourseName(cur.getCourseName());
-			sReq.setExamId(examId);
-			sReq.setStudentId(studentId);
-			sReq.setExamName(examName);
-			sReq.setIdentityNumber(cur.getIdentityNumber());
-			if (StringUtils.isNotBlank(cur.getPaperType())) {
-				sReq.setPaperType(cur.getPaperType());
-			} else {
-				sReq.setPaperType("O");
-			}
-			sReq.setRootOrgId(rootOrgId);
-			sReq.setStudentCode(cur.getStudentCode());
-			sReq.setStudentName(cur.getStudentName());
-			sReq.setRemark(cur.getRemark());
-			SaveExamStudentResp savedExamStudent = examStudentCloudService.saveExamStudent(sReq);
-			ExamStudentBean examStudentBean = savedExamStudent.getExamStudentBean();
-			examStudentIdList.add(examStudentBean.getId());
-		}
-
-		Map<String, Object> map = Maps.newHashMap();
-		map.put("success", true);
-		map.put("examStudentIdList", examStudentIdList);
-		return map;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+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 com.google.common.collect.Maps;
+
+import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
+import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentReq;
+import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentResp;
+import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
+import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
+import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
+import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean;
+import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
+import cn.com.qmth.examcloud.examwork.api.response.SaveExamStudentResp;
+import cn.com.qmth.examcloud.exchange.base.enums.CourseLevel;
+import cn.com.qmth.examcloud.exchange.outer.api.controller.swufe.bean.StudentInfoReq;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+
+/**
+ * @author chenken
+ * @date 2018年5月7日 下午4:30:29
+ * @company QMTH
+ * @description 保存学生信息
+ */
+@RestController
+@RequestMapping("/api/ecs_outlet/studentInfo")
+public class StudentInfoController extends ControllerSupport {
+
+	@Autowired
+	StudentCloudService studentCloudService;
+
+	@Autowired
+	ExamCloudService examCloudService;
+
+	@Autowired
+	ExamStudentCloudService examStudentCloudService;
+
+	@PostMapping
+	public Map<String, Object> saveStudentInfo(@RequestBody List<StudentInfoReq> studentInfoReqs) {
+		User accessUser = getAccessUser();
+		Long rootOrgId = accessUser.getRootOrgId();
+
+		List<Long> examStudentIdList = Lists.newArrayList();
+		for (StudentInfoReq cur : studentInfoReqs) {
+
+			GetExamReq req = new GetExamReq();
+			req.setName(cur.getExamName());
+			req.setRootOrgId(rootOrgId);
+			GetExamResp resp = examCloudService.getExam(req);
+
+			Long examId = resp.getId();
+			ExamBean examBean = resp.getExamBean();
+			String examName = examBean.getName();
+
+			SaveStudentReq saveStudentReq = new SaveStudentReq();
+			saveStudentReq.setIdentityNumber(cur.getIdentityNumber());
+			saveStudentReq.setName(cur.getStudentName());
+			saveStudentReq.setOrgCode(cur.getOrgCode());
+			saveStudentReq.setOrgId(cur.getOrgId());
+			saveStudentReq.setOrgName(cur.getOrgName());
+			saveStudentReq.setRootOrgId(rootOrgId);
+			saveStudentReq.setStudentCode(cur.getStudentCode());
+
+			SaveStudentResp insertOrUpdateStudentResp = studentCloudService
+					.saveStudent(saveStudentReq);
+
+			Long studentId = insertOrUpdateStudentResp.getStudentId();
+
+			SaveExamStudentReq sReq = new SaveExamStudentReq();
+			sReq.setCourseLevel(cur.getCourseLevel());
+
+			CourseLevel courseLevel = CourseLevel.getCourseLevel(cur.getCourseLevel());
+			String courseCode = courseLevel.getAbbreviate() + cur.getCourseCode();
+			sReq.setCourseCode(courseCode);
+
+			sReq.setCourseName(cur.getCourseName());
+			sReq.setExamId(examId);
+			sReq.setStudentId(studentId);
+			sReq.setExamName(examName);
+			sReq.setIdentityNumber(cur.getIdentityNumber());
+			if (StringUtils.isNotBlank(cur.getPaperType())) {
+				sReq.setPaperType(cur.getPaperType());
+			} else {
+				sReq.setPaperType("O");
+			}
+			sReq.setRootOrgId(rootOrgId);
+			sReq.setStudentCode(cur.getStudentCode());
+			sReq.setStudentName(cur.getStudentName());
+			sReq.setRemark(cur.getRemark());
+			SaveExamStudentResp savedExamStudent = examStudentCloudService.saveExamStudent(sReq);
+			ExamStudentBean examStudentBean = savedExamStudent.getExamStudentBean();
+			examStudentIdList.add(examStudentBean.getId());
+		}
+
+		Map<String, Object> map = Maps.newHashMap();
+		map.put("success", true);
+		map.put("examStudentIdList", examStudentIdList);
+		return map;
+	}
+
+}

+ 93 - 93
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/bean/ExamReq.java

@@ -1,93 +1,93 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe.bean;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
-
-/**
- * @author chenken
- * @date 2018年5月2日 下午3:44:54
- * @company QMTH
- * @description ExamReq.java
- */
-public class ExamReq implements JsonSerializable {
-
-	private static final long serialVersionUID = -4675668482972680269L;
-
-	/**
-	 * 机构ID
-	 */
-	private Long rootOrgId;
-
-	/**
-	 * 考试名称
-	 */
-	private String name;
-
-	/**
-	 * 考试类型
-	 */
-	private String examType;
-
-	/**
-	 * 考试开始时间
-	 */
-	private String beginTime;
-
-	/**
-	 * 考试结束时间
-	 */
-	private String endTime;
-
-	/**
-	 * 考试时长(分钟)
-	 */
-	private Integer duration;
-
-	public Long getRootOrgId() {
-		return rootOrgId;
-	}
-
-	public void setRootOrgId(Long rootOrgId) {
-		this.rootOrgId = rootOrgId;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getExamType() {
-		return examType;
-	}
-
-	public void setExamType(String examType) {
-		this.examType = examType;
-	}
-
-	public String getBeginTime() {
-		return beginTime;
-	}
-
-	public void setBeginTime(String beginTime) {
-		this.beginTime = beginTime;
-	}
-
-	public String getEndTime() {
-		return endTime;
-	}
-
-	public void setEndTime(String endTime) {
-		this.endTime = endTime;
-	}
-
-	public Integer getDuration() {
-		return duration;
-	}
-
-	public void setDuration(Integer duration) {
-		this.duration = duration;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe.bean;
+
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
+
+/**
+ * @author chenken
+ * @date 2018年5月2日 下午3:44:54
+ * @company QMTH
+ * @description ExamReq.java
+ */
+public class ExamReq implements JsonSerializable {
+
+	private static final long serialVersionUID = -4675668482972680269L;
+
+	/**
+	 * 机构ID
+	 */
+	private Long rootOrgId;
+
+	/**
+	 * 考试名称
+	 */
+	private String name;
+
+	/**
+	 * 考试类型
+	 */
+	private String examType;
+
+	/**
+	 * 考试开始时间
+	 */
+	private String beginTime;
+
+	/**
+	 * 考试结束时间
+	 */
+	private String endTime;
+
+	/**
+	 * 考试时长(分钟)
+	 */
+	private Integer duration;
+
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getExamType() {
+		return examType;
+	}
+
+	public void setExamType(String examType) {
+		this.examType = examType;
+	}
+
+	public String getBeginTime() {
+		return beginTime;
+	}
+
+	public void setBeginTime(String beginTime) {
+		this.beginTime = beginTime;
+	}
+
+	public String getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+
+	public Integer getDuration() {
+		return duration;
+	}
+
+	public void setDuration(Integer duration) {
+		this.duration = duration;
+	}
+
+}

+ 251 - 251
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/bean/StudentInfoReq.java

@@ -1,251 +1,251 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe.bean;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
-
-
-public class StudentInfoReq implements JsonSerializable{
-	
-	private static final long serialVersionUID = -6575958224230885795L;
-	/**
-	 * 考试ID
-	 */
-	private Long examId;
-	/**
-	 * 考试名称
-	 */
-	private String examName;
-	/**
-	 * 学生姓名
-	 */
-	private String studentName;
-	/**
-	 * 学生学号
-	 */
-	private String studentCode;
-	/**
-	 * 学生身份证号
-	 */
-	private String identityNumber;
-	/**
-	 * 考试课程名称
-	 */
-	private String courseName;
-	/**
-	 * 考试课程code
-	 */
-	private String courseCode;
-	/**
-	 * 考试课程level
-	 */
-	private String courseLevel;
-	/**
-	 * 试卷类型
-	 */
-	private String paperType;
-	/**
-	 * 采集人
-	 */
-	private String infoCollector;
-	/**
-	 * 专业名称
-	 */
-	private String specialtyName;
-	/**
-	 * 所属机构code
-	 */
-	private String orgCode;
-	/**
-	 * 所属机构名称
-	 */
-	private String orgName;
-	/**
-	 * 性别
-	 */
-	private String gender;
-	/**
-	 * 年级
-	 */
-	private String grade;
-	/**
-	 * 是否为重修
-	 */
-	private Boolean repair;
-	/**
-	 * 是否毕业
-	 */
-	private Boolean graduated;
-	/**
-	 * 备注
-	 */
-	private String remark;
-	
-	/**
-	 * 机构ID
-	 */
-	private Long orgId;
-	/**
-	 * 顶级机构id 
-	 */
-	private Long rootOrgId;
-	
-	public Long getExamId() {
-		return examId;
-	}
-
-	public void setExamId(Long examId) {
-		this.examId = examId;
-	}
-
-	public String getExamName() {
-		return examName;
-	}
-
-	public void setExamName(String examName) {
-		this.examName = examName;
-	}
-
-	public String getStudentName() {
-		return studentName;
-	}
-
-	public void setStudentName(String studentName) {
-		this.studentName = studentName;
-	}
-
-	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 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 String getPaperType() {
-		return paperType;
-	}
-
-	public void setPaperType(String paperType) {
-		this.paperType = paperType;
-	}
-
-	public String getInfoCollector() {
-		return infoCollector;
-	}
-
-	public void setInfoCollector(String infoCollector) {
-		this.infoCollector = infoCollector;
-	}
-
-	public String getSpecialtyName() {
-		return specialtyName;
-	}
-
-	public void setSpecialtyName(String specialtyName) {
-		this.specialtyName = specialtyName;
-	}
-
-	public String getOrgCode() {
-		return orgCode;
-	}
-
-	public void setOrgCode(String orgCode) {
-		this.orgCode = orgCode;
-	}
-
-	public String getOrgName() {
-		return orgName;
-	}
-
-	public void setOrgName(String orgName) {
-		this.orgName = orgName;
-	}
-
-	public String getGender() {
-		return gender;
-	}
-
-	public void setGender(String gender) {
-		this.gender = gender;
-	}
-
-	public String getGrade() {
-		return grade;
-	}
-
-	public void setGrade(String grade) {
-		this.grade = grade;
-	}
-
-	public Boolean getRepair() {
-		return repair;
-	}
-
-	public void setRepair(Boolean repair) {
-		this.repair = repair;
-	}
-
-	public Boolean getGraduated() {
-		return graduated;
-	}
-
-	public void setGraduated(Boolean graduated) {
-		this.graduated = graduated;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Long getOrgId() {
-		return orgId;
-	}
-
-	public void setOrgId(Long orgId) {
-		this.orgId = orgId;
-	}
-
-	public Long getRootOrgId() {
-		return rootOrgId;
-	}
-
-	public void setRootOrgId(Long rootOrgId) {
-		this.rootOrgId = rootOrgId;
-	}
-	
-}
+package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe.bean;
+
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
+
+
+public class StudentInfoReq implements JsonSerializable{
+	
+	private static final long serialVersionUID = -6575958224230885795L;
+	/**
+	 * 考试ID
+	 */
+	private Long examId;
+	/**
+	 * 考试名称
+	 */
+	private String examName;
+	/**
+	 * 学生姓名
+	 */
+	private String studentName;
+	/**
+	 * 学生学号
+	 */
+	private String studentCode;
+	/**
+	 * 学生身份证号
+	 */
+	private String identityNumber;
+	/**
+	 * 考试课程名称
+	 */
+	private String courseName;
+	/**
+	 * 考试课程code
+	 */
+	private String courseCode;
+	/**
+	 * 考试课程level
+	 */
+	private String courseLevel;
+	/**
+	 * 试卷类型
+	 */
+	private String paperType;
+	/**
+	 * 采集人
+	 */
+	private String infoCollector;
+	/**
+	 * 专业名称
+	 */
+	private String specialtyName;
+	/**
+	 * 所属机构code
+	 */
+	private String orgCode;
+	/**
+	 * 所属机构名称
+	 */
+	private String orgName;
+	/**
+	 * 性别
+	 */
+	private String gender;
+	/**
+	 * 年级
+	 */
+	private String grade;
+	/**
+	 * 是否为重修
+	 */
+	private Boolean repair;
+	/**
+	 * 是否毕业
+	 */
+	private Boolean graduated;
+	/**
+	 * 备注
+	 */
+	private String remark;
+	
+	/**
+	 * 机构ID
+	 */
+	private Long orgId;
+	/**
+	 * 顶级机构id 
+	 */
+	private Long rootOrgId;
+	
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+	public String getExamName() {
+		return examName;
+	}
+
+	public void setExamName(String examName) {
+		this.examName = examName;
+	}
+
+	public String getStudentName() {
+		return studentName;
+	}
+
+	public void setStudentName(String studentName) {
+		this.studentName = studentName;
+	}
+
+	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 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 String getPaperType() {
+		return paperType;
+	}
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
+	}
+
+	public String getInfoCollector() {
+		return infoCollector;
+	}
+
+	public void setInfoCollector(String infoCollector) {
+		this.infoCollector = infoCollector;
+	}
+
+	public String getSpecialtyName() {
+		return specialtyName;
+	}
+
+	public void setSpecialtyName(String specialtyName) {
+		this.specialtyName = specialtyName;
+	}
+
+	public String getOrgCode() {
+		return orgCode;
+	}
+
+	public void setOrgCode(String orgCode) {
+		this.orgCode = orgCode;
+	}
+
+	public String getOrgName() {
+		return orgName;
+	}
+
+	public void setOrgName(String orgName) {
+		this.orgName = orgName;
+	}
+
+	public String getGender() {
+		return gender;
+	}
+
+	public void setGender(String gender) {
+		this.gender = gender;
+	}
+
+	public String getGrade() {
+		return grade;
+	}
+
+	public void setGrade(String grade) {
+		this.grade = grade;
+	}
+
+	public Boolean getRepair() {
+		return repair;
+	}
+
+	public void setRepair(Boolean repair) {
+		this.repair = repair;
+	}
+
+	public Boolean getGraduated() {
+		return graduated;
+	}
+
+	public void setGraduated(Boolean graduated) {
+		this.graduated = graduated;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Long getOrgId() {
+		return orgId;
+	}
+
+	public void setOrgId(Long orgId) {
+		this.orgId = orgId;
+	}
+
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+	
+}

+ 103 - 103
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/sydx/ScoreController.java

@@ -1,103 +1,103 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller.sydx;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import cn.com.qmth.examcloud.commons.web.security.bean.User;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.exchange.base.response.FailureBaseResponse;
-import cn.com.qmth.examcloud.exchange.outer.service.OutletScoreService;
-import cn.com.qmth.examcloud.exchange.outer.service.bean.OutletScore;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * 石油大学专用-获取成绩接口
- * @author  	chenken
- * @date    	2018年4月3日 下午3:57:26
- * @company 	QMTH
- * @description ScoreController.java
- */
-@RestController
-@RequestMapping("/api/ecs_outlet/sydx/score")
-public class ScoreController  extends ControllerSupport{
-
-    @Autowired
-    private OutletScoreService outletScoreService;
-
-    @ApiOperation(value = "查询成绩:根据考试名称、机构ID和学生考试方式查询")
-    @GetMapping
-    public ResponseEntity<?> query(@RequestParam(name = "examRemark") String examRemark,
-                                @RequestParam(name = "examStuRemark",required=false) String examStuRemark,
-                                HttpServletRequest request) {
-    	try{
-    		if (StringUtils.isEmpty(examRemark)) {
-                return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("examRemark不能为空"),HttpStatus.BAD_REQUEST);
-            }
-    		User accessUser = getAccessUser();
-            Long orgId = accessUser.getRootOrgId();
-            List<OutletScore> outletScoreList = outletScoreService.queryExamScore(examRemark, examStuRemark, orgId);
-
-            return new ResponseEntity<List<OutletScore>>(outletScoreList, HttpStatus.OK);
-    	}catch(Exception e){
-    		e.printStackTrace();
-    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
-    	}
-        
-    }
-    
-    @ApiOperation(value = "查询成绩:按考生身份证号、机构ID查询成绩")
-    @GetMapping("/identityNumber")
-    public ResponseEntity<?> queryByIdentityNumber(@RequestParam(name = "identityNumberList") List<String> identityNumberList,HttpServletRequest request) {
-        try{
-        	if (identityNumberList==null||identityNumberList.size()==0) {
-                return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("身份证号不能为空"),HttpStatus.BAD_REQUEST);
-            }
-        	User accessUser = getAccessUser();
-            List<OutletScore> outletScoreList = outletScoreService.queryExamScoreByIdentityNumbers(identityNumberList, accessUser.getRootOrgId());
-            return new ResponseEntity<List<OutletScore>>(outletScoreList, HttpStatus.OK);
-    	}catch(Exception e){
-    		e.printStackTrace();
-    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
-    	}
-    }
-    
-    @ApiOperation(value = "查询成绩:按考试名称、机构ID、学号、课程code查询成绩")
-    @GetMapping("/batchNameAndCourseCodeAndStudentCodes")
-    public ResponseEntity<?> queryExamScores(
-    		@RequestParam(name = "batchName") String batchName,
-    		@RequestParam(name = "courseCode") String courseCode,
-    		@RequestParam(name = "studentCodes") List<String> studentCodes,
-    		HttpServletRequest request){
-    	try{
-	    	if(StringUtils.isEmpty(batchName)){
-	    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试批次名称不能为空"),HttpStatus.BAD_REQUEST);
-	    	}
-	    	if(StringUtils.isEmpty(courseCode)){
-	    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("课程不能为空"),HttpStatus.BAD_REQUEST);
-	    	}
-	    	if(studentCodes == null || studentCodes.size()==0){
-	    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("学号不能为空"),HttpStatus.BAD_REQUEST);
-	    	}
-	    	if(studentCodes.size()>1000){
-	    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("单次查询,学号数量不能大于1000"),HttpStatus.BAD_REQUEST);
-	    	}
-	    	User accessUser = getAccessUser();
-	    	List<OutletScore> outletScoreList = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(),batchName,courseCode,studentCodes);
-	    	return new ResponseEntity<List<OutletScore>>(outletScoreList, HttpStatus.OK);
-    	}catch(Exception e){
-    		e.printStackTrace();
-    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
-    	}
-    }
-    
-}
+package cn.com.qmth.examcloud.exchange.outer.api.controller.sydx;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import cn.com.qmth.examcloud.exchange.base.response.FailureBaseResponse;
+import cn.com.qmth.examcloud.exchange.outer.service.OutletScoreService;
+import cn.com.qmth.examcloud.exchange.outer.service.bean.OutletScore;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 石油大学专用-获取成绩接口
+ * @author  	chenken
+ * @date    	2018年4月3日 下午3:57:26
+ * @company 	QMTH
+ * @description ScoreController.java
+ */
+@RestController
+@RequestMapping("/api/ecs_outlet/sydx/score")
+public class ScoreController  extends ControllerSupport{
+
+    @Autowired
+    private OutletScoreService outletScoreService;
+
+    @ApiOperation(value = "查询成绩:根据考试名称、机构ID和学生考试方式查询")
+    @GetMapping
+    public ResponseEntity<?> query(@RequestParam(name = "examRemark") String examRemark,
+                                @RequestParam(name = "examStuRemark",required=false) String examStuRemark,
+                                HttpServletRequest request) {
+    	try{
+    		if (StringUtils.isEmpty(examRemark)) {
+                return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("examRemark不能为空"),HttpStatus.BAD_REQUEST);
+            }
+    		User accessUser = getAccessUser();
+            Long orgId = accessUser.getRootOrgId();
+            List<OutletScore> outletScoreList = outletScoreService.queryExamScore(examRemark, examStuRemark, orgId);
+
+            return new ResponseEntity<List<OutletScore>>(outletScoreList, HttpStatus.OK);
+    	}catch(Exception e){
+    		e.printStackTrace();
+    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
+    	}
+        
+    }
+    
+    @ApiOperation(value = "查询成绩:按考生身份证号、机构ID查询成绩")
+    @GetMapping("/identityNumber")
+    public ResponseEntity<?> queryByIdentityNumber(@RequestParam(name = "identityNumberList") List<String> identityNumberList,HttpServletRequest request) {
+        try{
+        	if (identityNumberList==null||identityNumberList.size()==0) {
+                return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("身份证号不能为空"),HttpStatus.BAD_REQUEST);
+            }
+        	User accessUser = getAccessUser();
+            List<OutletScore> outletScoreList = outletScoreService.queryExamScoreByIdentityNumbers(identityNumberList, accessUser.getRootOrgId());
+            return new ResponseEntity<List<OutletScore>>(outletScoreList, HttpStatus.OK);
+    	}catch(Exception e){
+    		e.printStackTrace();
+    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
+    	}
+    }
+    
+    @ApiOperation(value = "查询成绩:按考试名称、机构ID、学号、课程code查询成绩")
+    @GetMapping("/batchNameAndCourseCodeAndStudentCodes")
+    public ResponseEntity<?> queryExamScores(
+    		@RequestParam(name = "batchName") String batchName,
+    		@RequestParam(name = "courseCode") String courseCode,
+    		@RequestParam(name = "studentCodes") List<String> studentCodes,
+    		HttpServletRequest request){
+    	try{
+	    	if(StringUtils.isEmpty(batchName)){
+	    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试批次名称不能为空"),HttpStatus.BAD_REQUEST);
+	    	}
+	    	if(StringUtils.isEmpty(courseCode)){
+	    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("课程不能为空"),HttpStatus.BAD_REQUEST);
+	    	}
+	    	if(studentCodes == null || studentCodes.size()==0){
+	    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("学号不能为空"),HttpStatus.BAD_REQUEST);
+	    	}
+	    	if(studentCodes.size()>1000){
+	    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("单次查询,学号数量不能大于1000"),HttpStatus.BAD_REQUEST);
+	    	}
+	    	User accessUser = getAccessUser();
+	    	List<OutletScore> outletScoreList = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(),batchName,courseCode,studentCodes);
+	    	return new ResponseEntity<List<OutletScore>>(outletScoreList, HttpStatus.OK);
+    	}catch(Exception e){
+    		e.printStackTrace();
+    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
+    	}
+    }
+    
+}

+ 246 - 246
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/sydx/StudentExamInfoController.java

@@ -1,246 +1,246 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller.sydx;
-
-import java.util.List;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-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.base.util.DateUtil;
-import cn.com.qmth.examcloud.commons.base.util.DateUtil.DatePatterns;
-import cn.com.qmth.examcloud.commons.web.security.bean.User;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
-import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentReq;
-import cn.com.qmth.examcloud.core.basic.api.request.UnbindStudentCodeReq;
-import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentResp;
-import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
-import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
-import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
-import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean;
-import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
-import cn.com.qmth.examcloud.examwork.api.request.SaveExamReq;
-import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
-import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
-import cn.com.qmth.examcloud.examwork.api.response.SaveExamStudentResp;
-import cn.com.qmth.examcloud.exchange.base.enums.CourseLevel;
-import cn.com.qmth.examcloud.exchange.outer.api.controller.sydx.bean.ExamStudentImportRequest;
-import cn.com.qmth.examcloud.exchange.outer.api.controller.sydx.bean.FailureRecordDomain;
-import cn.com.qmth.examcloud.exchange.outer.api.controller.sydx.bean.OutletExam;
-import cn.com.qmth.examcloud.exchange.outer.api.controller.sydx.bean.OutletExamStudent;
-
-/**
- * 石油大学专用-接收考生数据接口
- * 
- * @author chenken
- * @date 2018年4月3日 下午3:57:42
- * @company QMTH
- * @description StudentExamInfoController.java
- */
-@RestController
-@RequestMapping("/api/ecs_outlet/sydx/import_exam_student_info")
-public class StudentExamInfoController extends ControllerSupport {
-
-	@Autowired
-	StudentCloudService studentCloudService;
-
-	@Autowired
-	ExamCloudService examCloudService;
-
-	@Autowired
-	ExamStudentCloudService examStudentCloudService;
-
-	/**
-	 * 石油大学使用:创建考试和导入学生
-	 *
-	 * @author WANGWEI
-	 * @param outerReq
-	 * @return
-	 */
-	@PostMapping
-	public ResponseEntity<?> post(@RequestBody ExamStudentImportRequest outerReq) {
-
-		tranTimes(outerReq);
-
-		OutletExam exam = outerReq.getExam();
-
-		User accessUser = getAccessUser();
-		Long rootOrgId = accessUser.getRootOrgId();
-
-		GetExamReq req = new GetExamReq();
-		req.setName(exam.getName());
-		req.setRootOrgId(accessUser.getRootOrgId());
-		GetExamResp resp = null;
-		try {
-			resp = examCloudService.getExam(req);
-		} catch (StatusException e) {
-			if (e.getCode().equals("E-002002")) {
-				SaveExamReq saveExamReq = new SaveExamReq();
-				saveExamReq.setBeginTime(DateUtil.parse(exam.getBeginTime(), DatePatterns.ISO));
-				saveExamReq.setDuration(exam.getDuration());
-				saveExamReq.setEndTime(DateUtil.parse(exam.getEndTime(), DatePatterns.ISO));
-				saveExamReq.setExamType(exam.getExamType().name());
-				saveExamReq.setName(exam.getName());
-				saveExamReq.setRemark(exam.getRemark());
-				saveExamReq.setRootOrgId(rootOrgId);
-				examCloudService.saveExam(saveExamReq);
-				resp = examCloudService.getExam(req);
-			} else {
-				throw e;
-			}
-		}
-
-		Long examId = resp.getId();
-		ExamBean examBean = resp.getExamBean();
-		String examName = examBean.getName();
-		List<OutletExamStudent> examStudentList = outerReq.getExamStudentList();
-
-		List<Long> examStudentIdList = Lists.newArrayList();
-		List<FailureRecordDomain> failureRecordList = Lists.newArrayList();
-
-		for (OutletExamStudent cur : examStudentList) {
-
-			SaveStudentReq saveStudentReq = new SaveStudentReq();
-			saveStudentReq.setIdentityNumber(cur.getIdentityNumber());
-			saveStudentReq.setName(cur.getName());
-			saveStudentReq.setPhoneNumber(cur.getPhone());
-			saveStudentReq.setOrgCode(cur.getOrgCode());
-			saveStudentReq.setOrgId(cur.getOrgId());
-			saveStudentReq.setOrgName(cur.getOrgName());
-			saveStudentReq.setRootOrgId(rootOrgId);
-			saveStudentReq.setStudentCode(cur.getStudentCode());
-
-			SaveStudentResp saveStudentResp = null;
-			try {
-				saveStudentResp = studentCloudService.saveStudent(saveStudentReq);
-			} catch (StatusException e) {
-				String code = e.getCode();
-				if (code.equals("B-160005") || code.equals("B-160008")) {
-					UnbindStudentCodeReq unbindStudentCodeReq = new UnbindStudentCodeReq();
-					unbindStudentCodeReq.setRootOrgId(rootOrgId);
-					unbindStudentCodeReq.setStudentCode(cur.getStudentCode());
-					unbindStudentCodeReq.setIdentityNumber(cur.getIdentityNumber());
-					studentCloudService.unbindStudentCode(unbindStudentCodeReq);
-					saveStudentResp = studentCloudService.saveStudent(saveStudentReq);
-				} else {
-					throw e;
-				}
-			}
-
-			Long studentId = saveStudentResp.getStudentId();
-
-			SaveExamStudentReq sReq = new SaveExamStudentReq();
-			sReq.setCourseLevel(cur.getCourseLevel());
-
-			CourseLevel courseLevel = CourseLevel.getCourseLevel(cur.getCourseLevel());
-			String courseCode = courseLevel.getAbbreviate() + cur.getCourseCode();
-			sReq.setCourseCode(courseCode);
-
-			sReq.setCourseName(cur.getCourseName());
-			sReq.setExamId(examId);
-			sReq.setStudentId(studentId);
-			sReq.setExamName(examName);
-			sReq.setIdentityNumber(cur.getIdentityNumber());
-			sReq.setPaperType(cur.getPaperType());
-			sReq.setRootOrgId(rootOrgId);
-			sReq.setStudentCode(cur.getStudentCode());
-			sReq.setStudentName(cur.getName());
-			sReq.setPaperType(cur.getPaperType());
-			sReq.setRemark(cur.getRemark());
-			sReq.setGrade(cur.getGrade());
-			sReq.setInfoCollector(cur.getInfoCollector());
-			sReq.setSpecialtyName(cur.getSpecialtyName());
-
-			try {
-				SaveExamStudentResp savedExamStudent = examStudentCloudService
-						.saveExamStudent(sReq);
-				ExamStudentBean examStudentBean = savedExamStudent.getExamStudentBean();
-				examStudentIdList.add(examStudentBean.getId());
-			} catch (StatusException e) {
-				FailureRecordDomain fr = new FailureRecordDomain();
-				fr.setCode(e.getCode());
-				fr.setDesc(e.getDesc());
-				fr.setCourseCode(cur.getCourseCode());
-				fr.setCourseLevel(cur.getCourseLevel());
-				fr.setCourseName(cur.getCourseName());
-				fr.setIdentityNumber(cur.getIdentityNumber());
-				fr.setStudentCode(cur.getStudentCode());
-				failureRecordList.add(fr);
-			} catch (Exception e) {
-				FailureRecordDomain fr = new FailureRecordDomain();
-				fr.setCode("EX-210001");
-				fr.setDesc(e.getMessage());
-				fr.setCourseCode(cur.getCourseCode());
-				fr.setCourseLevel(cur.getCourseLevel());
-				fr.setCourseName(cur.getCourseName());
-				fr.setIdentityNumber(cur.getIdentityNumber());
-				fr.setStudentCode(cur.getStudentCode());
-				failureRecordList.add(fr);
-			}
-		}
-
-		if (CollectionUtils.isNotEmpty(failureRecordList)) {
-			return new ResponseEntity<Object>(failureRecordList, HttpStatus.INTERNAL_SERVER_ERROR);
-		} else {
-			return new ResponseEntity<Object>(examStudentIdList, HttpStatus.OK);
-		}
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param examStudentImportDTO
-	 */
-	private void tranTimes(ExamStudentImportRequest examStudentImportDTO) {
-		OutletExam exam = examStudentImportDTO.getExam();
-
-		String beginTime = exam.getBeginTime();
-		if (StringUtils.isNotBlank(beginTime)) {
-			beginTime = StringUtils.replace(beginTime, ".000Z", "");
-			beginTime = StringUtils.replace(beginTime, "T", " ");
-			exam.setBeginTime(beginTime);
-		}
-
-		String endTime = exam.getEndTime();
-		if (StringUtils.isNotBlank(endTime)) {
-			endTime = StringUtils.replace(endTime, ".000Z", "");
-			endTime = StringUtils.replace(endTime, "T", " ");
-			exam.setEndTime(endTime);
-		}
-
-		List<OutletExamStudent> examStudentList = examStudentImportDTO.getExamStudentList();
-		if (CollectionUtils.isNotEmpty(examStudentList)) {
-
-			for (OutletExamStudent cur : examStudentList) {
-				OutletExam curExam = cur.getExam();
-				if (null == curExam) {
-					continue;
-				}
-				String b = curExam.getBeginTime();
-				if (StringUtils.isNotBlank(b)) {
-					b = StringUtils.replace(b, ".000Z", "");
-					b = StringUtils.replace(b, "T", " ");
-					curExam.setBeginTime(b);
-				}
-
-				String e = curExam.getEndTime();
-				if (StringUtils.isNotBlank(e)) {
-					e = StringUtils.replace(e, ".000Z", "");
-					e = StringUtils.replace(e, "T", " ");
-					curExam.setEndTime(e);
-				}
-			}
-		}
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.controller.sydx;
+
+import java.util.List;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+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.commons.util.DateUtil;
+import cn.com.qmth.examcloud.commons.util.DateUtil.DatePatterns;
+import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
+import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentReq;
+import cn.com.qmth.examcloud.core.basic.api.request.UnbindStudentCodeReq;
+import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentResp;
+import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
+import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
+import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
+import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean;
+import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
+import cn.com.qmth.examcloud.examwork.api.response.SaveExamStudentResp;
+import cn.com.qmth.examcloud.exchange.base.enums.CourseLevel;
+import cn.com.qmth.examcloud.exchange.outer.api.controller.sydx.bean.ExamStudentImportRequest;
+import cn.com.qmth.examcloud.exchange.outer.api.controller.sydx.bean.FailureRecordDomain;
+import cn.com.qmth.examcloud.exchange.outer.api.controller.sydx.bean.OutletExam;
+import cn.com.qmth.examcloud.exchange.outer.api.controller.sydx.bean.OutletExamStudent;
+import cn.com.qmth.examcloud.web.security.bean.User;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+
+/**
+ * 石油大学专用-接收考生数据接口
+ * 
+ * @author chenken
+ * @date 2018年4月3日 下午3:57:42
+ * @company QMTH
+ * @description StudentExamInfoController.java
+ */
+@RestController
+@RequestMapping("/api/ecs_outlet/sydx/import_exam_student_info")
+public class StudentExamInfoController extends ControllerSupport {
+
+	@Autowired
+	StudentCloudService studentCloudService;
+
+	@Autowired
+	ExamCloudService examCloudService;
+
+	@Autowired
+	ExamStudentCloudService examStudentCloudService;
+
+	/**
+	 * 石油大学使用:创建考试和导入学生
+	 *
+	 * @author WANGWEI
+	 * @param outerReq
+	 * @return
+	 */
+	@PostMapping
+	public ResponseEntity<?> post(@RequestBody ExamStudentImportRequest outerReq) {
+
+		tranTimes(outerReq);
+
+		OutletExam exam = outerReq.getExam();
+
+		User accessUser = getAccessUser();
+		Long rootOrgId = accessUser.getRootOrgId();
+
+		GetExamReq req = new GetExamReq();
+		req.setName(exam.getName());
+		req.setRootOrgId(accessUser.getRootOrgId());
+		GetExamResp resp = null;
+		try {
+			resp = examCloudService.getExam(req);
+		} catch (StatusException e) {
+			if (e.getCode().equals("E-002002")) {
+				SaveExamReq saveExamReq = new SaveExamReq();
+				saveExamReq.setBeginTime(DateUtil.parse(exam.getBeginTime(), DatePatterns.ISO));
+				saveExamReq.setDuration(exam.getDuration());
+				saveExamReq.setEndTime(DateUtil.parse(exam.getEndTime(), DatePatterns.ISO));
+				saveExamReq.setExamType(exam.getExamType().name());
+				saveExamReq.setName(exam.getName());
+				saveExamReq.setRemark(exam.getRemark());
+				saveExamReq.setRootOrgId(rootOrgId);
+				examCloudService.saveExam(saveExamReq);
+				resp = examCloudService.getExam(req);
+			} else {
+				throw e;
+			}
+		}
+
+		Long examId = resp.getId();
+		ExamBean examBean = resp.getExamBean();
+		String examName = examBean.getName();
+		List<OutletExamStudent> examStudentList = outerReq.getExamStudentList();
+
+		List<Long> examStudentIdList = Lists.newArrayList();
+		List<FailureRecordDomain> failureRecordList = Lists.newArrayList();
+
+		for (OutletExamStudent cur : examStudentList) {
+
+			SaveStudentReq saveStudentReq = new SaveStudentReq();
+			saveStudentReq.setIdentityNumber(cur.getIdentityNumber());
+			saveStudentReq.setName(cur.getName());
+			saveStudentReq.setPhoneNumber(cur.getPhone());
+			saveStudentReq.setOrgCode(cur.getOrgCode());
+			saveStudentReq.setOrgId(cur.getOrgId());
+			saveStudentReq.setOrgName(cur.getOrgName());
+			saveStudentReq.setRootOrgId(rootOrgId);
+			saveStudentReq.setStudentCode(cur.getStudentCode());
+
+			SaveStudentResp saveStudentResp = null;
+			try {
+				saveStudentResp = studentCloudService.saveStudent(saveStudentReq);
+			} catch (StatusException e) {
+				String code = e.getCode();
+				if (code.equals("B-160005") || code.equals("B-160008")) {
+					UnbindStudentCodeReq unbindStudentCodeReq = new UnbindStudentCodeReq();
+					unbindStudentCodeReq.setRootOrgId(rootOrgId);
+					unbindStudentCodeReq.setStudentCode(cur.getStudentCode());
+					unbindStudentCodeReq.setIdentityNumber(cur.getIdentityNumber());
+					studentCloudService.unbindStudentCode(unbindStudentCodeReq);
+					saveStudentResp = studentCloudService.saveStudent(saveStudentReq);
+				} else {
+					throw e;
+				}
+			}
+
+			Long studentId = saveStudentResp.getStudentId();
+
+			SaveExamStudentReq sReq = new SaveExamStudentReq();
+			sReq.setCourseLevel(cur.getCourseLevel());
+
+			CourseLevel courseLevel = CourseLevel.getCourseLevel(cur.getCourseLevel());
+			String courseCode = courseLevel.getAbbreviate() + cur.getCourseCode();
+			sReq.setCourseCode(courseCode);
+
+			sReq.setCourseName(cur.getCourseName());
+			sReq.setExamId(examId);
+			sReq.setStudentId(studentId);
+			sReq.setExamName(examName);
+			sReq.setIdentityNumber(cur.getIdentityNumber());
+			sReq.setPaperType(cur.getPaperType());
+			sReq.setRootOrgId(rootOrgId);
+			sReq.setStudentCode(cur.getStudentCode());
+			sReq.setStudentName(cur.getName());
+			sReq.setPaperType(cur.getPaperType());
+			sReq.setRemark(cur.getRemark());
+			sReq.setGrade(cur.getGrade());
+			sReq.setInfoCollector(cur.getInfoCollector());
+			sReq.setSpecialtyName(cur.getSpecialtyName());
+
+			try {
+				SaveExamStudentResp savedExamStudent = examStudentCloudService
+						.saveExamStudent(sReq);
+				ExamStudentBean examStudentBean = savedExamStudent.getExamStudentBean();
+				examStudentIdList.add(examStudentBean.getId());
+			} catch (StatusException e) {
+				FailureRecordDomain fr = new FailureRecordDomain();
+				fr.setCode(e.getCode());
+				fr.setDesc(e.getDesc());
+				fr.setCourseCode(cur.getCourseCode());
+				fr.setCourseLevel(cur.getCourseLevel());
+				fr.setCourseName(cur.getCourseName());
+				fr.setIdentityNumber(cur.getIdentityNumber());
+				fr.setStudentCode(cur.getStudentCode());
+				failureRecordList.add(fr);
+			} catch (Exception e) {
+				FailureRecordDomain fr = new FailureRecordDomain();
+				fr.setCode("EX-210001");
+				fr.setDesc(e.getMessage());
+				fr.setCourseCode(cur.getCourseCode());
+				fr.setCourseLevel(cur.getCourseLevel());
+				fr.setCourseName(cur.getCourseName());
+				fr.setIdentityNumber(cur.getIdentityNumber());
+				fr.setStudentCode(cur.getStudentCode());
+				failureRecordList.add(fr);
+			}
+		}
+
+		if (CollectionUtils.isNotEmpty(failureRecordList)) {
+			return new ResponseEntity<Object>(failureRecordList, HttpStatus.INTERNAL_SERVER_ERROR);
+		} else {
+			return new ResponseEntity<Object>(examStudentIdList, HttpStatus.OK);
+		}
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param examStudentImportDTO
+	 */
+	private void tranTimes(ExamStudentImportRequest examStudentImportDTO) {
+		OutletExam exam = examStudentImportDTO.getExam();
+
+		String beginTime = exam.getBeginTime();
+		if (StringUtils.isNotBlank(beginTime)) {
+			beginTime = StringUtils.replace(beginTime, ".000Z", "");
+			beginTime = StringUtils.replace(beginTime, "T", " ");
+			exam.setBeginTime(beginTime);
+		}
+
+		String endTime = exam.getEndTime();
+		if (StringUtils.isNotBlank(endTime)) {
+			endTime = StringUtils.replace(endTime, ".000Z", "");
+			endTime = StringUtils.replace(endTime, "T", " ");
+			exam.setEndTime(endTime);
+		}
+
+		List<OutletExamStudent> examStudentList = examStudentImportDTO.getExamStudentList();
+		if (CollectionUtils.isNotEmpty(examStudentList)) {
+
+			for (OutletExamStudent cur : examStudentList) {
+				OutletExam curExam = cur.getExam();
+				if (null == curExam) {
+					continue;
+				}
+				String b = curExam.getBeginTime();
+				if (StringUtils.isNotBlank(b)) {
+					b = StringUtils.replace(b, ".000Z", "");
+					b = StringUtils.replace(b, "T", " ");
+					curExam.setBeginTime(b);
+				}
+
+				String e = curExam.getEndTime();
+				if (StringUtils.isNotBlank(e)) {
+					e = StringUtils.replace(e, ".000Z", "");
+					e = StringUtils.replace(e, "T", " ");
+					curExam.setEndTime(e);
+				}
+			}
+		}
+	}
+
+}

+ 33 - 33
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/sydx/bean/ExamStudentImportRequest.java

@@ -1,33 +1,33 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller.sydx.bean;
-
-import java.util.List;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
-
-/**
- * Created by yuanpan on 2017/4/25.
- */
-public class ExamStudentImportRequest implements JsonSerializable {
-
-	private static final long serialVersionUID = 7067803176577343830L;
-
-	private OutletExam exam;
-
-	private List<OutletExamStudent> examStudentList;
-
-	public OutletExam getExam() {
-		return exam;
-	}
-
-	public void setExam(OutletExam exam) {
-		this.exam = exam;
-	}
-
-	public List<OutletExamStudent> getExamStudentList() {
-		return examStudentList;
-	}
-
-	public void setExamStudentList(List<OutletExamStudent> examStudentList) {
-		this.examStudentList = examStudentList;
-	}
-}
+package cn.com.qmth.examcloud.exchange.outer.api.controller.sydx.bean;
+
+import java.util.List;
+
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
+
+/**
+ * Created by yuanpan on 2017/4/25.
+ */
+public class ExamStudentImportRequest implements JsonSerializable {
+
+	private static final long serialVersionUID = 7067803176577343830L;
+
+	private OutletExam exam;
+
+	private List<OutletExamStudent> examStudentList;
+
+	public OutletExam getExam() {
+		return exam;
+	}
+
+	public void setExam(OutletExam exam) {
+		this.exam = exam;
+	}
+
+	public List<OutletExamStudent> getExamStudentList() {
+		return examStudentList;
+	}
+
+	public void setExamStudentList(List<OutletExamStudent> examStudentList) {
+		this.examStudentList = examStudentList;
+	}
+}

+ 3 - 3
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/CourseGroupOuterServiceProvider.java

@@ -10,15 +10,15 @@ 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.commons.web.support.StatusResponse;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.exchange.outer.api.CourseGroupOuterService;
 import cn.com.qmth.examcloud.exchange.outer.api.bean.CourseBean;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetCourseListReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetCourseListResp;
 import cn.com.qmth.examcloud.exchange.outer.service.CourseGroupService;
 import cn.com.qmth.examcloud.exchange.outer.service.bean.Course;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.web.support.StatusResponse;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;

+ 3 - 3
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/ExamOuterServiceProvider.java

@@ -9,9 +9,7 @@ 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.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.commons.web.support.StatusResponse;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
 import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
 import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
@@ -23,6 +21,8 @@ import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetExamReq;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterSaveExamReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetExamResp;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterSaveExamResp;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.web.support.StatusResponse;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;

+ 3 - 3
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/ExamStudentOuterServiceProvider.java

@@ -10,9 +10,7 @@ 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.commons.web.support.StatusResponse;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 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.SaveExamStudentReq;
@@ -25,6 +23,8 @@ import cn.com.qmth.examcloud.exchange.outer.api.request.OuterBatchSaveExamStuden
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterSaveExamStudentReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.BatchOuterSaveExamStudentResp;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterSaveExamStudentResp;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.web.support.StatusResponse;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;

+ 216 - 216
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/FaceOuterServiceProvider.java

@@ -1,216 +1,216 @@
-package cn.com.qmth.examcloud.exchange.outer.api.provider;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.fileupload.disk.DiskFileItem;
-import org.apache.commons.io.FileUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.util.StringUtils;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
-
-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.util.HttpClientUtil;
-import cn.com.qmth.examcloud.commons.base.util.ZipUtil;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.exchange.outer.api.FaceOuterService;
-import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-
-/**
- * 人脸服务
- *
- * @author WANGWEI
- * @date 2018年11月14日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Api("人脸服务")
-@RestController
-@RequestMapping("${$rmp.cloud.exchange.outer}/face")
-public class FaceOuterServiceProvider extends ControllerSupport implements FaceOuterService {
-
-	private static final long serialVersionUID = -6268268043341270752L;
-
-	@Value("${$tempDir}")
-	private String tempDir;
-
-	/**
-	 * ZIP最大50M
-	 */
-	private static final int ZIP_MAX_SIZE = 50;
-
-	/**
-	 * 每张照片最大尺寸 500KB
-	 */
-	private static final int MAX_SIZE = 500;
-
-	@Autowired
-	private FaceService faceService;
-
-	@ApiOperation(value = "保存学生照片", httpMethod = "POST")
-	@PostMapping("addPhotoByUrl")
-	@Override
-	public void addPhotoByUrl(
-			@RequestParam @ApiParam(value = "顶级机构ID", example = "1", required = true) Long rootOrgId,
-			@RequestParam @ApiParam(value = "身份证", required = true) String identityNumber,
-			@RequestParam @ApiParam(value = "照片地址", required = true) String photoUrl,
-			@RequestParam @ApiParam(value = "操作者", required = true) String operator) {
-
-		if (!getSecurityRootOrgId().equals(rootOrgId)) {
-			throw new StatusException("EX-1000001", "rootOrgId is wrong");
-		}
-
-		if (photoUrl.startsWith("http")) {
-			byte[] bs = HttpClientUtil.get(photoUrl);
-
-			int lastIndexOf = photoUrl.lastIndexOf(".");
-			if (0 > lastIndexOf) {
-				throw new StatusException("EX-100002",
-						"photoPath is not end with photo file suffix.");
-			}
-			String fileSuffix = photoUrl.substring(lastIndexOf);
-
-			String fileName = System.currentTimeMillis() + fileSuffix;
-			File temp = new File(
-					tempDir + File.separator + "student_photo" + File.separator + fileName);
-
-			try {
-				FileUtils.writeByteArrayToFile(temp, bs);
-			} catch (IOException e) {
-				throw new StatusException("EX-100003", "文件读写失败");
-			}
-
-			faceService.processFace(rootOrgId, identityNumber, fileSuffix, temp, operator);
-		}
-
-	}
-
-	@ApiOperation(value = "保存学生照片", httpMethod = "POST")
-	@PostMapping("addPhoto")
-	@Override
-	public void addPhoto(
-			@RequestParam @ApiParam(value = "顶级机构ID", example = "1", required = true) Long rootOrgId,
-			@RequestParam @ApiParam(value = "身份证", required = true) String identityNumber,
-			@RequestParam @ApiParam(value = "操作者", required = true) String operator,
-			@RequestParam @ApiParam(value = "学生照片文件(文件名称=身份证号码+文件后缀) 如:xxxxxxxxxx.jpg", required = true) CommonsMultipartFile file) {
-
-		if (!getSecurityRootOrgId().equals(rootOrgId)) {
-			throw new StatusException("EX-1000001", "rootOrgId is wrong");
-		}
-
-		DiskFileItem item = (DiskFileItem) file.getFileItem();
-		File storeLocation = item.getStoreLocation();
-		String fileName = file.getOriginalFilename();
-
-		if (StringUtils.containsWhitespace(fileName)) {
-			throw new StatusException("EX-600100", "文件名不能含有空白字符");
-		}
-
-		if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
-			throw new StatusException("EX-600101", "文件名不合法");
-		}
-		String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
-
-		faceService.processFace(rootOrgId, identityNumber, fileSuffix, storeLocation, operator);
-	}
-
-	@ApiOperation(value = "导入学生照片", httpMethod = "POST")
-	@PostMapping("importPhotos")
-	@Override
-	public List<Map<String, String>> importPhotos(
-			@RequestParam @ApiParam(value = "顶级机构ID", example = "1", required = true) Long rootOrgId,
-			@RequestParam @ApiParam(value = "操作者", required = true) String operator,
-			@RequestParam @ApiParam(value = "学生照片文件(身份证号码+文件后缀)压缩包(ZIP文件,压缩包内不含目录)", required = true) CommonsMultipartFile file) {
-
-		if (!getSecurityRootOrgId().equals(rootOrgId)) {
-			throw new StatusException("EX-1000001", "rootOrgId is wrong");
-		}
-
-		DiskFileItem item = (DiskFileItem) file.getFileItem();
-		File storeLocation = item.getStoreLocation();
-		String filename = file.getOriginalFilename();
-
-		if (!filename.endsWith(".zip")) {
-			throw new StatusException("EX-620001", "文件格式不正确,必须是zip格式的压缩包");
-		}
-		// 文件大小限制
-		if (file.getSize() > ZIP_MAX_SIZE * 1024 * 1024) {
-			throw new StatusException("EX-620002", "文件大小超过50M,请分批导入");
-		}
-
-		List<Map<String, String>> ret = Lists.newArrayList();
-
-		String tempDirPath = tempDir + File.separator + "photo_import" + File.separator
-				+ System.currentTimeMillis();
-		File tempDir = new File(tempDirPath);
-		try {
-			ZipUtil.unzip(storeLocation, new File(tempDirPath));
-		} catch (Exception e) {
-			throw new StatusException("EX-620003", "zip文件损坏");
-		}
-
-		File[] files = tempDir.listFiles();
-
-		if (null == files) {
-			throw new StatusException("EX-620004", "zip文件为空");
-		}
-
-		for (File f : files) {
-			Map<String, String> map = Maps.newHashMap();
-			String fileName = f.getName();
-			map.put("file", fileName);
-
-			if (f.length() > MAX_SIZE * 1024) {
-				map.put("statusCode", "EX-620005");
-				map.put("statusDesc", "文件大小超过500KB");
-				ret.add(map);
-				continue;
-			}
-			try {
-				if (StringUtils.containsWhitespace(fileName)) {
-					throw new StatusException("EX-600100", "文件名不能含有空白字符");
-				}
-
-				if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
-					throw new StatusException("EX-600101", "文件名不合法");
-				}
-				String identityNumber = fileName.substring(0, fileName.lastIndexOf("."));
-				String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
-
-				faceService.processFace(rootOrgId, identityNumber, fileSuffix, f, operator);
-
-				map.put("statusCode", "200");
-				map.put("statusDesc", "成功");
-
-			} catch (StatusException e) {
-				map.put("statusCode", e.getCode());
-				map.put("statusDesc", e.getDesc());
-			} catch (Exception e) {
-				map.put("statusCode", "系统异常");
-				map.put("statusDesc", e.getCause().getMessage());
-			}
-			ret.add(map);
-		}
-
-		try {
-			FileUtils.deleteDirectory(tempDir);
-		} catch (IOException e) {
-			log.error("fail to clean temp dir.", e);
-		}
-
-		return ret;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.provider;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.fileupload.disk.DiskFileItem;
+import org.apache.commons.io.FileUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.util.HttpClientUtil;
+import cn.com.qmth.examcloud.commons.util.ZipUtil;
+import cn.com.qmth.examcloud.exchange.outer.api.FaceOuterService;
+import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+/**
+ * 人脸服务
+ *
+ * @author WANGWEI
+ * @date 2018年11月14日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Api("人脸服务")
+@RestController
+@RequestMapping("${$rmp.cloud.exchange.outer}/face")
+public class FaceOuterServiceProvider extends ControllerSupport implements FaceOuterService {
+
+	private static final long serialVersionUID = -6268268043341270752L;
+
+	@Value("${$tempDir}")
+	private String tempDir;
+
+	/**
+	 * ZIP最大50M
+	 */
+	private static final int ZIP_MAX_SIZE = 50;
+
+	/**
+	 * 每张照片最大尺寸 500KB
+	 */
+	private static final int MAX_SIZE = 500;
+
+	@Autowired
+	private FaceService faceService;
+
+	@ApiOperation(value = "保存学生照片", httpMethod = "POST")
+	@PostMapping("addPhotoByUrl")
+	@Override
+	public void addPhotoByUrl(
+			@RequestParam @ApiParam(value = "顶级机构ID", example = "1", required = true) Long rootOrgId,
+			@RequestParam @ApiParam(value = "身份证", required = true) String identityNumber,
+			@RequestParam @ApiParam(value = "照片地址", required = true) String photoUrl,
+			@RequestParam @ApiParam(value = "操作者", required = true) String operator) {
+
+		if (!getSecurityRootOrgId().equals(rootOrgId)) {
+			throw new StatusException("EX-1000001", "rootOrgId is wrong");
+		}
+
+		if (photoUrl.startsWith("http")) {
+			byte[] bs = HttpClientUtil.get(photoUrl);
+
+			int lastIndexOf = photoUrl.lastIndexOf(".");
+			if (0 > lastIndexOf) {
+				throw new StatusException("EX-100002",
+						"photoPath is not end with photo file suffix.");
+			}
+			String fileSuffix = photoUrl.substring(lastIndexOf);
+
+			String fileName = System.currentTimeMillis() + fileSuffix;
+			File temp = new File(
+					tempDir + File.separator + "student_photo" + File.separator + fileName);
+
+			try {
+				FileUtils.writeByteArrayToFile(temp, bs);
+			} catch (IOException e) {
+				throw new StatusException("EX-100003", "文件读写失败");
+			}
+
+			faceService.processFace(rootOrgId, identityNumber, fileSuffix, temp, operator);
+		}
+
+	}
+
+	@ApiOperation(value = "保存学生照片", httpMethod = "POST")
+	@PostMapping("addPhoto")
+	@Override
+	public void addPhoto(
+			@RequestParam @ApiParam(value = "顶级机构ID", example = "1", required = true) Long rootOrgId,
+			@RequestParam @ApiParam(value = "身份证", required = true) String identityNumber,
+			@RequestParam @ApiParam(value = "操作者", required = true) String operator,
+			@RequestParam @ApiParam(value = "学生照片文件(文件名称=身份证号码+文件后缀) 如:xxxxxxxxxx.jpg", required = true) CommonsMultipartFile file) {
+
+		if (!getSecurityRootOrgId().equals(rootOrgId)) {
+			throw new StatusException("EX-1000001", "rootOrgId is wrong");
+		}
+
+		DiskFileItem item = (DiskFileItem) file.getFileItem();
+		File storeLocation = item.getStoreLocation();
+		String fileName = file.getOriginalFilename();
+
+		if (StringUtils.containsWhitespace(fileName)) {
+			throw new StatusException("EX-600100", "文件名不能含有空白字符");
+		}
+
+		if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
+			throw new StatusException("EX-600101", "文件名不合法");
+		}
+		String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
+
+		faceService.processFace(rootOrgId, identityNumber, fileSuffix, storeLocation, operator);
+	}
+
+	@ApiOperation(value = "导入学生照片", httpMethod = "POST")
+	@PostMapping("importPhotos")
+	@Override
+	public List<Map<String, String>> importPhotos(
+			@RequestParam @ApiParam(value = "顶级机构ID", example = "1", required = true) Long rootOrgId,
+			@RequestParam @ApiParam(value = "操作者", required = true) String operator,
+			@RequestParam @ApiParam(value = "学生照片文件(身份证号码+文件后缀)压缩包(ZIP文件,压缩包内不含目录)", required = true) CommonsMultipartFile file) {
+
+		if (!getSecurityRootOrgId().equals(rootOrgId)) {
+			throw new StatusException("EX-1000001", "rootOrgId is wrong");
+		}
+
+		DiskFileItem item = (DiskFileItem) file.getFileItem();
+		File storeLocation = item.getStoreLocation();
+		String filename = file.getOriginalFilename();
+
+		if (!filename.endsWith(".zip")) {
+			throw new StatusException("EX-620001", "文件格式不正确,必须是zip格式的压缩包");
+		}
+		// 文件大小限制
+		if (file.getSize() > ZIP_MAX_SIZE * 1024 * 1024) {
+			throw new StatusException("EX-620002", "文件大小超过50M,请分批导入");
+		}
+
+		List<Map<String, String>> ret = Lists.newArrayList();
+
+		String tempDirPath = tempDir + File.separator + "photo_import" + File.separator
+				+ System.currentTimeMillis();
+		File tempDir = new File(tempDirPath);
+		try {
+			ZipUtil.unzip(storeLocation, new File(tempDirPath));
+		} catch (Exception e) {
+			throw new StatusException("EX-620003", "zip文件损坏");
+		}
+
+		File[] files = tempDir.listFiles();
+
+		if (null == files) {
+			throw new StatusException("EX-620004", "zip文件为空");
+		}
+
+		for (File f : files) {
+			Map<String, String> map = Maps.newHashMap();
+			String fileName = f.getName();
+			map.put("file", fileName);
+
+			if (f.length() > MAX_SIZE * 1024) {
+				map.put("statusCode", "EX-620005");
+				map.put("statusDesc", "文件大小超过500KB");
+				ret.add(map);
+				continue;
+			}
+			try {
+				if (StringUtils.containsWhitespace(fileName)) {
+					throw new StatusException("EX-600100", "文件名不能含有空白字符");
+				}
+
+				if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
+					throw new StatusException("EX-600101", "文件名不合法");
+				}
+				String identityNumber = fileName.substring(0, fileName.lastIndexOf("."));
+				String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
+
+				faceService.processFace(rootOrgId, identityNumber, fileSuffix, f, operator);
+
+				map.put("statusCode", "200");
+				map.put("statusDesc", "成功");
+
+			} catch (StatusException e) {
+				map.put("statusCode", e.getCode());
+				map.put("statusDesc", e.getDesc());
+			} catch (Exception e) {
+				map.put("statusCode", "系统异常");
+				map.put("statusDesc", e.getCause().getMessage());
+			}
+			ret.add(map);
+		}
+
+		try {
+			FileUtils.deleteDirectory(tempDir);
+		} catch (IOException e) {
+			log.error("fail to clean temp dir.", e);
+		}
+
+		return ret;
+	}
+
+}

+ 3 - 3
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/GetExamRecordAuditInfoServiceProvider.java

@@ -11,15 +11,15 @@ 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.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.commons.web.support.StatusResponse;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreDataCloudService;
 import cn.com.qmth.examcloud.core.oe.admin.api.request.GetAuditDataReq;
 import cn.com.qmth.examcloud.core.oe.admin.api.response.GetAuditDataResp;
 import cn.com.qmth.examcloud.exchange.outer.api.GetExamRecordAuditInfoService;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetExamRecordAuditInfoReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetExamRecordAuditInfoResp;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.web.support.StatusResponse;
 
 @Api("获取考试记录审核信息服务")
 @RestController

+ 3 - 3
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/GetScoreDataServiceProvider.java

@@ -15,9 +15,7 @@ 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.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.commons.web.support.StatusResponse;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreDataCloudService;
 import cn.com.qmth.examcloud.core.oe.admin.api.bean.ScoreDataBean;
 import cn.com.qmth.examcloud.core.oe.admin.api.request.GetScoreDataReq;
@@ -30,6 +28,8 @@ import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetScoreDataReq;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterQueryScoreDataReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetScoreDataResp;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterQueryScoreDataResp;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.web.support.StatusResponse;
 
 @Api("获取成绩服务")
 @RestController

+ 3 - 3
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/QueryCapturePhotoServiceProvider.java

@@ -14,9 +14,7 @@ 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.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.commons.web.support.StatusResponse;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreDataCloudService;
 import cn.com.qmth.examcloud.core.oe.admin.api.bean.QueryCapturePhotoBean;
 import cn.com.qmth.examcloud.core.oe.admin.api.request.QueryCapturePhotoReq;
@@ -25,6 +23,8 @@ import cn.com.qmth.examcloud.exchange.outer.api.QueryCapturePhotoService;
 import cn.com.qmth.examcloud.exchange.outer.api.bean.OuterGetCapturePhotoBean;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterQueryCapturePhotoReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterQueryCapturePhotoResp;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.web.support.StatusResponse;
 
 @Api("获取抓拍照片信息服务")
 @RestController

+ 3 - 3
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/ScoreQueueServiceProvider.java

@@ -11,9 +11,7 @@ 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.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.commons.web.support.StatusResponse;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreObtainQueueCloudService;
 import cn.com.qmth.examcloud.core.oe.admin.api.request.DeleteExamScoreQueueReq;
 import cn.com.qmth.examcloud.core.oe.admin.api.request.GetTopExamScoreQueueReq;
@@ -27,6 +25,8 @@ import cn.com.qmth.examcloud.exchange.outer.api.request.OuterDeleteScoreQueueTop
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetScoreQueueTopReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterDeleteScoreQueueTopResp;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetScoreQueueTopResp;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.web.support.StatusResponse;
 
 @Api("成绩队列服务")
 @RestController

+ 197 - 197
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/StudentOuterServiceProvider.java

@@ -1,197 +1,197 @@
-package cn.com.qmth.examcloud.exchange.outer.api.provider;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-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.base.util.HttpClientUtil;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.commons.web.support.StatusResponse;
-import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
-import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentReq;
-import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentResp;
-import cn.com.qmth.examcloud.exchange.outer.api.StudentOuterService;
-import cn.com.qmth.examcloud.exchange.outer.api.bean.Student4BatchBean;
-import cn.com.qmth.examcloud.exchange.outer.api.bean.StudentStatus4BatchBean;
-import cn.com.qmth.examcloud.exchange.outer.api.request.OuterBatchSaveStudentReq;
-import cn.com.qmth.examcloud.exchange.outer.api.request.OuterSaveStudentReq;
-import cn.com.qmth.examcloud.exchange.outer.api.response.BatchOuterSaveStudentResp;
-import cn.com.qmth.examcloud.exchange.outer.api.response.OuterSaveStudentResp;
-import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年6月29日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Api(value = "学生服务")
-@RestController
-@RequestMapping("${$rmp.cloud.exchange.outer}/student")
-public class StudentOuterServiceProvider extends ControllerSupport implements StudentOuterService {
-
-	private static final long serialVersionUID = -8252740695302763716L;
-
-	@Autowired
-	StudentCloudService studentCloudService;
-
-	@Autowired
-	private FaceService faceService;
-
-	@Value("${$tempDir}")
-	private String tempDir;
-
-	@ApiOperation(value = "保存学生信息", httpMethod = "POST")
-	@ApiResponses({@ApiResponse(code = 200, message = "成功", response = OuterSaveStudentResp.class),
-			@ApiResponse(code = 500, message = "系统异常(异常信息见响应体)", response = StatusResponse.class)})
-	@PostMapping("saveStudent")
-	@Override
-	public OuterSaveStudentResp saveStudent(
-			@RequestBody @ApiParam(required = true) OuterSaveStudentReq req) {
-		trim(req);
-		Long rootOrgId = req.getRootOrgId();
-		if (!getSecurityRootOrgId().equals(rootOrgId)) {
-			throw new StatusException("EX-1000001", "rootOrgId is wrong");
-		}
-
-		SaveStudentReq request = new SaveStudentReq();
-		request.setIdentityNumber(req.getIdentityNumber());
-		request.setName(req.getName());
-		request.setOrgCode(req.getOrgCode());
-		request.setOrgId(req.getOrgId());
-		request.setOrgName(req.getOrgName());
-		request.setPhoneNumber(req.getPhoneNumber());
-		request.setRemark(req.getRemark());
-		request.setRootOrgId(req.getRootOrgId());
-		request.setStudentCode(req.getStudentCode());
-		
-		return processOuterSaveStudentReq(request,req.getPhotoUrl(),req.getOperator());
-	}
-	
-	private OuterSaveStudentResp processOuterSaveStudentReq(SaveStudentReq saveStudentReq,String photoUrl,String operator){
-		//保存学生
-		SaveStudentResp response = studentCloudService.saveStudent(saveStudentReq);
-		//处理照片
-		processPhotoUrl(saveStudentReq,photoUrl,operator);
-		
-		OuterSaveStudentResp resp = new OuterSaveStudentResp();
-		resp.setOrgId(response.getOrgId());
-		resp.setOrgName(response.getOrgName());
-		resp.setRootOrgId(response.getRootOrgId());
-		resp.setStudentId(response.getStudentId());
-		return resp;
-	}
-	
-	/**
-	 * 处理照片
-	 * @param req
-	 */
-	private void processPhotoUrl(SaveStudentReq request,String photoUrl,String operator){
-		Long rootOrgId = request.getRootOrgId();
-		String identityNumber = request.getIdentityNumber();
-		
-		if (StringUtils.isNotBlank(photoUrl)) {
-			byte[] bs = HttpClientUtil.get(photoUrl);
-
-			int lastIndexOf = photoUrl.lastIndexOf(".");
-			if (0 > lastIndexOf) {
-				throw new StatusException("EX-100002",
-						"photoPath is not end with photo file suffix.");
-			}
-			String fileSuffix = photoUrl.substring(lastIndexOf);
-
-			String fileName = System.currentTimeMillis() + fileSuffix;
-			File temp = new File(
-					tempDir + File.separator + "student_photo" + File.separator + fileName);
-
-			try {
-				FileUtils.writeByteArrayToFile(temp, bs);
-			} catch (IOException e) {
-				try {
-					FileUtils.forceDelete(temp);
-				} catch (IOException ex) {
-					// ignore
-				}
-				throw new StatusException("EX-100003", "文件读写失败", e);
-			}
-
-			try {
-				faceService.processFace(rootOrgId, identityNumber, fileSuffix, temp,operator);
-			} finally {
-				try {
-					FileUtils.forceDelete(temp);
-				} catch (IOException ex) {
-					// ignore
-				}
-			}
-		}
-	}
-	
-	@ApiOperation(value = "批量保存学生信息", httpMethod = "POST")
-	@ApiResponses({
-			@ApiResponse(code = 200, message = "成功", response = BatchOuterSaveStudentResp.class),
-			@ApiResponse(code = 500, message = "系统异常(异常信息见响应体)", response = StatusResponse.class)})
-	@PostMapping("batchSaveStudent")
-	@Override
-	public BatchOuterSaveStudentResp batchSaveStudent(@RequestBody @ApiParam(required = true) OuterBatchSaveStudentReq outerBatchSaveStudentReq) {
-		if (!getSecurityRootOrgId().equals(outerBatchSaveStudentReq.getRootOrgId())) {
-			throw new StatusException("EX-1000001", "rootOrgId is wrong");
-		}
-		List<Student4BatchBean> studentList = outerBatchSaveStudentReq.getStudentList();
-		
-		List<StudentStatus4BatchBean> successList = Lists.newArrayList();
-		List<StudentStatus4BatchBean> failureList = Lists.newArrayList();
-		
-		for(Student4BatchBean req:studentList){
-			SaveStudentReq request = new SaveStudentReq();
-			request.setIdentityNumber(req.getIdentityNumber());
-			request.setName(req.getName());
-			request.setOrgCode(req.getOrgCode());
-			request.setOrgId(req.getOrgId());
-			request.setOrgName(req.getOrgName());
-			request.setPhoneNumber(req.getPhoneNumber());
-			request.setRemark(req.getRemark());
-			request.setRootOrgId(req.getRootOrgId());
-			request.setStudentCode(req.getStudentCode());
-			
-			try{
-				OuterSaveStudentResp outerSaveStudentResp = processOuterSaveStudentReq(request,req.getPhotoUrl(),req.getOperator());
-				StudentStatus4BatchBean studentStatus4BatchBeanSuccess = new StudentStatus4BatchBean();
-				studentStatus4BatchBeanSuccess.setStudentId(outerSaveStudentResp.getStudentId());
-				studentStatus4BatchBeanSuccess.setIdentityNumber(req.getIdentityNumber());
-				studentStatus4BatchBeanSuccess.setName(req.getName());
-				studentStatus4BatchBeanSuccess.setStudentCode(req.getStudentCode());
-				successList.add(studentStatus4BatchBeanSuccess);
-			}catch(Exception e){
-				StudentStatus4BatchBean studentStatus4BatchBeanfailure = new StudentStatus4BatchBean();
-				studentStatus4BatchBeanfailure.setIdentityNumber(req.getIdentityNumber());
-				studentStatus4BatchBeanfailure.setName(req.getName());
-				studentStatus4BatchBeanfailure.setStudentCode(req.getStudentCode());
-				failureList.add(studentStatus4BatchBeanfailure);
-			}
-		}
-		BatchOuterSaveStudentResp resq = new BatchOuterSaveStudentResp();
-		resq.setSuccessList(successList);
-		resq.setFailureList(failureList);
-		return resq;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.provider;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+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.commons.util.HttpClientUtil;
+import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
+import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentReq;
+import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentResp;
+import cn.com.qmth.examcloud.exchange.outer.api.StudentOuterService;
+import cn.com.qmth.examcloud.exchange.outer.api.bean.Student4BatchBean;
+import cn.com.qmth.examcloud.exchange.outer.api.bean.StudentStatus4BatchBean;
+import cn.com.qmth.examcloud.exchange.outer.api.request.OuterBatchSaveStudentReq;
+import cn.com.qmth.examcloud.exchange.outer.api.request.OuterSaveStudentReq;
+import cn.com.qmth.examcloud.exchange.outer.api.response.BatchOuterSaveStudentResp;
+import cn.com.qmth.examcloud.exchange.outer.api.response.OuterSaveStudentResp;
+import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.web.support.StatusResponse;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年6月29日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Api(value = "学生服务")
+@RestController
+@RequestMapping("${$rmp.cloud.exchange.outer}/student")
+public class StudentOuterServiceProvider extends ControllerSupport implements StudentOuterService {
+
+	private static final long serialVersionUID = -8252740695302763716L;
+
+	@Autowired
+	StudentCloudService studentCloudService;
+
+	@Autowired
+	private FaceService faceService;
+
+	@Value("${$tempDir}")
+	private String tempDir;
+
+	@ApiOperation(value = "保存学生信息", httpMethod = "POST")
+	@ApiResponses({@ApiResponse(code = 200, message = "成功", response = OuterSaveStudentResp.class),
+			@ApiResponse(code = 500, message = "系统异常(异常信息见响应体)", response = StatusResponse.class)})
+	@PostMapping("saveStudent")
+	@Override
+	public OuterSaveStudentResp saveStudent(
+			@RequestBody @ApiParam(required = true) OuterSaveStudentReq req) {
+		trim(req);
+		Long rootOrgId = req.getRootOrgId();
+		if (!getSecurityRootOrgId().equals(rootOrgId)) {
+			throw new StatusException("EX-1000001", "rootOrgId is wrong");
+		}
+
+		SaveStudentReq request = new SaveStudentReq();
+		request.setIdentityNumber(req.getIdentityNumber());
+		request.setName(req.getName());
+		request.setOrgCode(req.getOrgCode());
+		request.setOrgId(req.getOrgId());
+		request.setOrgName(req.getOrgName());
+		request.setPhoneNumber(req.getPhoneNumber());
+		request.setRemark(req.getRemark());
+		request.setRootOrgId(req.getRootOrgId());
+		request.setStudentCode(req.getStudentCode());
+		
+		return processOuterSaveStudentReq(request,req.getPhotoUrl(),req.getOperator());
+	}
+	
+	private OuterSaveStudentResp processOuterSaveStudentReq(SaveStudentReq saveStudentReq,String photoUrl,String operator){
+		//保存学生
+		SaveStudentResp response = studentCloudService.saveStudent(saveStudentReq);
+		//处理照片
+		processPhotoUrl(saveStudentReq,photoUrl,operator);
+		
+		OuterSaveStudentResp resp = new OuterSaveStudentResp();
+		resp.setOrgId(response.getOrgId());
+		resp.setOrgName(response.getOrgName());
+		resp.setRootOrgId(response.getRootOrgId());
+		resp.setStudentId(response.getStudentId());
+		return resp;
+	}
+	
+	/**
+	 * 处理照片
+	 * @param req
+	 */
+	private void processPhotoUrl(SaveStudentReq request,String photoUrl,String operator){
+		Long rootOrgId = request.getRootOrgId();
+		String identityNumber = request.getIdentityNumber();
+		
+		if (StringUtils.isNotBlank(photoUrl)) {
+			byte[] bs = HttpClientUtil.get(photoUrl);
+
+			int lastIndexOf = photoUrl.lastIndexOf(".");
+			if (0 > lastIndexOf) {
+				throw new StatusException("EX-100002",
+						"photoPath is not end with photo file suffix.");
+			}
+			String fileSuffix = photoUrl.substring(lastIndexOf);
+
+			String fileName = System.currentTimeMillis() + fileSuffix;
+			File temp = new File(
+					tempDir + File.separator + "student_photo" + File.separator + fileName);
+
+			try {
+				FileUtils.writeByteArrayToFile(temp, bs);
+			} catch (IOException e) {
+				try {
+					FileUtils.forceDelete(temp);
+				} catch (IOException ex) {
+					// ignore
+				}
+				throw new StatusException("EX-100003", "文件读写失败", e);
+			}
+
+			try {
+				faceService.processFace(rootOrgId, identityNumber, fileSuffix, temp,operator);
+			} finally {
+				try {
+					FileUtils.forceDelete(temp);
+				} catch (IOException ex) {
+					// ignore
+				}
+			}
+		}
+	}
+	
+	@ApiOperation(value = "批量保存学生信息", httpMethod = "POST")
+	@ApiResponses({
+			@ApiResponse(code = 200, message = "成功", response = BatchOuterSaveStudentResp.class),
+			@ApiResponse(code = 500, message = "系统异常(异常信息见响应体)", response = StatusResponse.class)})
+	@PostMapping("batchSaveStudent")
+	@Override
+	public BatchOuterSaveStudentResp batchSaveStudent(@RequestBody @ApiParam(required = true) OuterBatchSaveStudentReq outerBatchSaveStudentReq) {
+		if (!getSecurityRootOrgId().equals(outerBatchSaveStudentReq.getRootOrgId())) {
+			throw new StatusException("EX-1000001", "rootOrgId is wrong");
+		}
+		List<Student4BatchBean> studentList = outerBatchSaveStudentReq.getStudentList();
+		
+		List<StudentStatus4BatchBean> successList = Lists.newArrayList();
+		List<StudentStatus4BatchBean> failureList = Lists.newArrayList();
+		
+		for(Student4BatchBean req:studentList){
+			SaveStudentReq request = new SaveStudentReq();
+			request.setIdentityNumber(req.getIdentityNumber());
+			request.setName(req.getName());
+			request.setOrgCode(req.getOrgCode());
+			request.setOrgId(req.getOrgId());
+			request.setOrgName(req.getOrgName());
+			request.setPhoneNumber(req.getPhoneNumber());
+			request.setRemark(req.getRemark());
+			request.setRootOrgId(req.getRootOrgId());
+			request.setStudentCode(req.getStudentCode());
+			
+			try{
+				OuterSaveStudentResp outerSaveStudentResp = processOuterSaveStudentReq(request,req.getPhotoUrl(),req.getOperator());
+				StudentStatus4BatchBean studentStatus4BatchBeanSuccess = new StudentStatus4BatchBean();
+				studentStatus4BatchBeanSuccess.setStudentId(outerSaveStudentResp.getStudentId());
+				studentStatus4BatchBeanSuccess.setIdentityNumber(req.getIdentityNumber());
+				studentStatus4BatchBeanSuccess.setName(req.getName());
+				studentStatus4BatchBeanSuccess.setStudentCode(req.getStudentCode());
+				successList.add(studentStatus4BatchBeanSuccess);
+			}catch(Exception e){
+				StudentStatus4BatchBean studentStatus4BatchBeanfailure = new StudentStatus4BatchBean();
+				studentStatus4BatchBeanfailure.setIdentityNumber(req.getIdentityNumber());
+				studentStatus4BatchBeanfailure.setName(req.getName());
+				studentStatus4BatchBeanfailure.setStudentCode(req.getStudentCode());
+				failureList.add(studentStatus4BatchBeanfailure);
+			}
+		}
+		BatchOuterSaveStudentResp resq = new BatchOuterSaveStudentResp();
+		resq.setSuccessList(successList);
+		resq.setFailureList(failureList);
+		return resq;
+	}
+
+}

+ 196 - 196
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/provider/cug/CugOuterServiceProvider.java

@@ -1,196 +1,196 @@
-package cn.com.qmth.examcloud.exchange.outer.api.provider.cug;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-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.base.util.HttpClientUtil;
-import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
-import cn.com.qmth.examcloud.commons.web.support.StatusResponse;
-import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
-import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentReq;
-import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentResp;
-import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
-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.GetExamReq;
-import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
-import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
-import cn.com.qmth.examcloud.examwork.api.response.SaveExamStudentResp;
-import cn.com.qmth.examcloud.exchange.outer.api.CugOuterService;
-import cn.com.qmth.examcloud.exchange.outer.api.request.cug.OuterSaveCugStudentAndExamStudentReq;
-import cn.com.qmth.examcloud.exchange.outer.api.response.cug.SaveCugStudentAndExamStudentResp;
-import cn.com.qmth.examcloud.exchange.outer.service.CourseGroupService;
-import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
-import cn.com.qmth.examcloud.exchange.outer.service.bean.Course;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-
-/**
- * 中国地质大学(武汉)
- *
- * @author WANGWEI
- * @date 2018年9月4日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Api("废弃接口")
-@RestController
-@RequestMapping("/api/ecs_outlet/cug")
-public class CugOuterServiceProvider extends ControllerSupport implements CugOuterService {
-
-	private static final long serialVersionUID = -2082287868965834214L;
-
-	@Autowired
-	StudentCloudService studentCloudService;
-
-	@Autowired
-	private FaceService faceService;
-
-	@Autowired
-	CourseGroupService courseGroupService;
-
-	@Autowired
-	ExamCloudService examCloudService;
-
-	@Autowired
-	ExamStudentCloudService examStudentCloudService;
-
-	@Value("${$tempDir}")
-	private String tempDir;
-
-	@ApiOperation(value = "废弃接口,考生接入", httpMethod = "POST")
-	@ApiResponses({
-			@ApiResponse(code = 200, message = "成功", response = SaveCugStudentAndExamStudentResp.class),
-			@ApiResponse(code = 500, message = "系统异常(异常信息见响应体)", response = StatusResponse.class)})
-	@PostMapping("saveCugStudentAndExamStudent")
-	@Override
-	public SaveCugStudentAndExamStudentResp saveCugStudentAndExamStudent(
-			@RequestBody @ApiParam(required = true) OuterSaveCugStudentAndExamStudentReq req) {
-
-		trim(req);
-
-		Long rootOrgId = req.getRootOrgId();
-		String identityNumber = req.getIdentityNumber();
-
-		String courseGroupName = req.getCourseGroupName();
-		String examName = req.getExamName();
-		String specialtyName = req.getSpecialtyName();
-
-		List<Course> courseList = courseGroupService.getCourseList(rootOrgId, courseGroupName);
-
-		SaveStudentReq request = new SaveStudentReq();
-		request.setIdentityNumber(identityNumber);
-		request.setName(req.getName());
-		request.setOrgCode(req.getOrgCode());
-		request.setOrgName(req.getOrgName());
-		request.setPhoneNumber(req.getPhoneNumber());
-		request.setRemark(req.getRemark());
-		request.setRootOrgId(req.getRootOrgId());
-		// request.setStudentCode(req.getStudentCode());
-
-		SaveStudentResp response = studentCloudService.saveStudent(request);
-
-		Long studentId = response.getStudentId();
-
-		String photoUrl = req.getPhotoUrl();
-		if (StringUtils.isNotBlank(photoUrl)) {
-			byte[] bs;
-			try {
-				bs = HttpClientUtil.get(photoUrl);
-			} catch (Exception e) {
-				throw new StatusException("EX-100002", "photoUrl is wrong");
-			}
-
-			int lastIndexOf = photoUrl.lastIndexOf(".");
-			if (0 > lastIndexOf) {
-				throw new StatusException("EX-100002",
-						"photoPath is not end with photo file suffix.");
-			}
-			String fileSuffix = photoUrl.substring(lastIndexOf);
-
-			String fileName = identityNumber + fileSuffix;
-			File temp = new File(
-					tempDir + File.separator + "student_photo" + File.separator + fileName);
-
-			try {
-				FileUtils.writeByteArrayToFile(temp, bs);
-			} catch (IOException e) {
-				try {
-					FileUtils.forceDelete(temp);
-				} catch (IOException ex) {
-					// ignore
-				}
-				throw new StatusException("EX-100003", "文件读写失败");
-			}
-
-			try {
-				faceService.processFace(rootOrgId, identityNumber, fileSuffix, temp,
-						req.getOperator());
-			} finally {
-				try {
-					FileUtils.forceDelete(temp);
-				} catch (IOException ex) {
-					// ignore
-				}
-			}
-		}
-
-		GetExamReq getExamReq = new GetExamReq();
-		getExamReq.setName(examName);
-		getExamReq.setRootOrgId(rootOrgId);
-		GetExamResp getExamResp = examCloudService.getExam(getExamReq);
-
-		Long examId = getExamResp.getId();
-
-		List<Long> examStudentIdList = Lists.newArrayList();
-
-		for (Course course : courseList) {
-			SaveExamStudentReq sReq = new SaveExamStudentReq();
-			sReq.setCourseLevel(course.getLevel());
-			sReq.setCourseCode(course.getCode());
-			sReq.setCourseName(course.getName());
-
-			sReq.setExamId(examId);
-			sReq.setExamName(examName);
-
-			sReq.setStudentId(studentId);
-			sReq.setIdentityNumber(req.getIdentityNumber());
-			sReq.setRootOrgId(rootOrgId);
-			sReq.setStudentCode(req.getStudentCode());
-			sReq.setStudentName(req.getName());
-			sReq.setSpecialtyName(specialtyName);
-
-			sReq.setRemark(req.getRemark());
-			sReq.setPaperType(req.getPaperType());
-
-			SaveExamStudentResp savedExamStudent = examStudentCloudService.saveExamStudent(sReq);
-			ExamStudentBean examStudentBean = savedExamStudent.getExamStudentBean();
-			examStudentIdList.add(examStudentBean.getId());
-		}
-
-		SaveCugStudentAndExamStudentResp resp = new SaveCugStudentAndExamStudentResp();
-		resp.setOrgId(response.getOrgId());
-		resp.setOrgName(response.getOrgName());
-		resp.setRootOrgId(response.getRootOrgId());
-		resp.setStudentId(response.getStudentId());
-		resp.setExamStudentIdList(examStudentIdList);
-
-		return resp;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.provider.cug;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+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.commons.util.HttpClientUtil;
+import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
+import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentReq;
+import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentResp;
+import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
+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.GetExamReq;
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
+import cn.com.qmth.examcloud.examwork.api.response.SaveExamStudentResp;
+import cn.com.qmth.examcloud.exchange.outer.api.CugOuterService;
+import cn.com.qmth.examcloud.exchange.outer.api.request.cug.OuterSaveCugStudentAndExamStudentReq;
+import cn.com.qmth.examcloud.exchange.outer.api.response.cug.SaveCugStudentAndExamStudentResp;
+import cn.com.qmth.examcloud.exchange.outer.service.CourseGroupService;
+import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
+import cn.com.qmth.examcloud.exchange.outer.service.bean.Course;
+import cn.com.qmth.examcloud.web.support.ControllerSupport;
+import cn.com.qmth.examcloud.web.support.StatusResponse;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+
+/**
+ * 中国地质大学(武汉)
+ *
+ * @author WANGWEI
+ * @date 2018年9月4日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Api("废弃接口")
+@RestController
+@RequestMapping("/api/ecs_outlet/cug")
+public class CugOuterServiceProvider extends ControllerSupport implements CugOuterService {
+
+	private static final long serialVersionUID = -2082287868965834214L;
+
+	@Autowired
+	StudentCloudService studentCloudService;
+
+	@Autowired
+	private FaceService faceService;
+
+	@Autowired
+	CourseGroupService courseGroupService;
+
+	@Autowired
+	ExamCloudService examCloudService;
+
+	@Autowired
+	ExamStudentCloudService examStudentCloudService;
+
+	@Value("${$tempDir}")
+	private String tempDir;
+
+	@ApiOperation(value = "废弃接口,考生接入", httpMethod = "POST")
+	@ApiResponses({
+			@ApiResponse(code = 200, message = "成功", response = SaveCugStudentAndExamStudentResp.class),
+			@ApiResponse(code = 500, message = "系统异常(异常信息见响应体)", response = StatusResponse.class)})
+	@PostMapping("saveCugStudentAndExamStudent")
+	@Override
+	public SaveCugStudentAndExamStudentResp saveCugStudentAndExamStudent(
+			@RequestBody @ApiParam(required = true) OuterSaveCugStudentAndExamStudentReq req) {
+
+		trim(req);
+
+		Long rootOrgId = req.getRootOrgId();
+		String identityNumber = req.getIdentityNumber();
+
+		String courseGroupName = req.getCourseGroupName();
+		String examName = req.getExamName();
+		String specialtyName = req.getSpecialtyName();
+
+		List<Course> courseList = courseGroupService.getCourseList(rootOrgId, courseGroupName);
+
+		SaveStudentReq request = new SaveStudentReq();
+		request.setIdentityNumber(identityNumber);
+		request.setName(req.getName());
+		request.setOrgCode(req.getOrgCode());
+		request.setOrgName(req.getOrgName());
+		request.setPhoneNumber(req.getPhoneNumber());
+		request.setRemark(req.getRemark());
+		request.setRootOrgId(req.getRootOrgId());
+		// request.setStudentCode(req.getStudentCode());
+
+		SaveStudentResp response = studentCloudService.saveStudent(request);
+
+		Long studentId = response.getStudentId();
+
+		String photoUrl = req.getPhotoUrl();
+		if (StringUtils.isNotBlank(photoUrl)) {
+			byte[] bs;
+			try {
+				bs = HttpClientUtil.get(photoUrl);
+			} catch (Exception e) {
+				throw new StatusException("EX-100002", "photoUrl is wrong");
+			}
+
+			int lastIndexOf = photoUrl.lastIndexOf(".");
+			if (0 > lastIndexOf) {
+				throw new StatusException("EX-100002",
+						"photoPath is not end with photo file suffix.");
+			}
+			String fileSuffix = photoUrl.substring(lastIndexOf);
+
+			String fileName = identityNumber + fileSuffix;
+			File temp = new File(
+					tempDir + File.separator + "student_photo" + File.separator + fileName);
+
+			try {
+				FileUtils.writeByteArrayToFile(temp, bs);
+			} catch (IOException e) {
+				try {
+					FileUtils.forceDelete(temp);
+				} catch (IOException ex) {
+					// ignore
+				}
+				throw new StatusException("EX-100003", "文件读写失败");
+			}
+
+			try {
+				faceService.processFace(rootOrgId, identityNumber, fileSuffix, temp,
+						req.getOperator());
+			} finally {
+				try {
+					FileUtils.forceDelete(temp);
+				} catch (IOException ex) {
+					// ignore
+				}
+			}
+		}
+
+		GetExamReq getExamReq = new GetExamReq();
+		getExamReq.setName(examName);
+		getExamReq.setRootOrgId(rootOrgId);
+		GetExamResp getExamResp = examCloudService.getExam(getExamReq);
+
+		Long examId = getExamResp.getId();
+
+		List<Long> examStudentIdList = Lists.newArrayList();
+
+		for (Course course : courseList) {
+			SaveExamStudentReq sReq = new SaveExamStudentReq();
+			sReq.setCourseLevel(course.getLevel());
+			sReq.setCourseCode(course.getCode());
+			sReq.setCourseName(course.getName());
+
+			sReq.setExamId(examId);
+			sReq.setExamName(examName);
+
+			sReq.setStudentId(studentId);
+			sReq.setIdentityNumber(req.getIdentityNumber());
+			sReq.setRootOrgId(rootOrgId);
+			sReq.setStudentCode(req.getStudentCode());
+			sReq.setStudentName(req.getName());
+			sReq.setSpecialtyName(specialtyName);
+
+			sReq.setRemark(req.getRemark());
+			sReq.setPaperType(req.getPaperType());
+
+			SaveExamStudentResp savedExamStudent = examStudentCloudService.saveExamStudent(sReq);
+			ExamStudentBean examStudentBean = savedExamStudent.getExamStudentBean();
+			examStudentIdList.add(examStudentBean.getId());
+		}
+
+		SaveCugStudentAndExamStudentResp resp = new SaveCugStudentAndExamStudentResp();
+		resp.setOrgId(response.getOrgId());
+		resp.setOrgName(response.getOrgName());
+		resp.setRootOrgId(response.getRootOrgId());
+		resp.setStudentId(response.getStudentId());
+		resp.setExamStudentIdList(examStudentIdList);
+
+		return resp;
+	}
+
+}

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/CourseGroupOuterService.java

@@ -1,8 +1,8 @@
 package cn.com.qmth.examcloud.exchange.outer.api;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetCourseListReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetCourseListResp;
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
 
 /**
  * 课程组服务

+ 26 - 26
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/CugOuterService.java

@@ -1,26 +1,26 @@
-package cn.com.qmth.examcloud.exchange.outer.api;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
-import cn.com.qmth.examcloud.exchange.outer.api.request.cug.OuterSaveCugStudentAndExamStudentReq;
-import cn.com.qmth.examcloud.exchange.outer.api.response.cug.SaveCugStudentAndExamStudentResp;
-
-/**
- * 中国地质大学(武汉)
- *
- * @author WANGWEI
- * @date 2018年9月4日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public interface CugOuterService extends OuterService {
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param req
-	 * @return
-	 */
-	SaveCugStudentAndExamStudentResp saveCugStudentAndExamStudent(
-			OuterSaveCugStudentAndExamStudentReq req);
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api;
+
+import cn.com.qmth.examcloud.exchange.outer.api.request.cug.OuterSaveCugStudentAndExamStudentReq;
+import cn.com.qmth.examcloud.exchange.outer.api.response.cug.SaveCugStudentAndExamStudentResp;
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
+
+/**
+ * 中国地质大学(武汉)
+ *
+ * @author WANGWEI
+ * @date 2018年9月4日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface CugOuterService extends OuterService {
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param req
+	 * @return
+	 */
+	SaveCugStudentAndExamStudentResp saveCugStudentAndExamStudent(
+			OuterSaveCugStudentAndExamStudentReq req);
+
+}

+ 36 - 36
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/ExamOuterService.java

@@ -1,36 +1,36 @@
-package cn.com.qmth.examcloud.exchange.outer.api;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
-import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetExamReq;
-import cn.com.qmth.examcloud.exchange.outer.api.request.OuterSaveExamReq;
-import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetExamResp;
-import cn.com.qmth.examcloud.exchange.outer.api.response.OuterSaveExamResp;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年6月29日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public interface ExamOuterService extends OuterService {
-
-	/**
-	 * 保存考试
-	 *
-	 * @author WANGWEI
-	 * @param req
-	 * @return
-	 */
-	OuterSaveExamResp saveExam(OuterSaveExamReq req);
-
-	/**
-	 * 查询考试
-	 *
-	 * @author WANGWEI
-	 * @param req
-	 * @return
-	 */
-	OuterGetExamResp getExam(OuterGetExamReq req);
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api;
+
+import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetExamReq;
+import cn.com.qmth.examcloud.exchange.outer.api.request.OuterSaveExamReq;
+import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetExamResp;
+import cn.com.qmth.examcloud.exchange.outer.api.response.OuterSaveExamResp;
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年6月29日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface ExamOuterService extends OuterService {
+
+	/**
+	 * 保存考试
+	 *
+	 * @author WANGWEI
+	 * @param req
+	 * @return
+	 */
+	OuterSaveExamResp saveExam(OuterSaveExamReq req);
+
+	/**
+	 * 查询考试
+	 *
+	 * @author WANGWEI
+	 * @param req
+	 * @return
+	 */
+	OuterGetExamResp getExam(OuterGetExamReq req);
+
+}

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/ExamStudentOuterService.java

@@ -1,10 +1,10 @@
 package cn.com.qmth.examcloud.exchange.outer.api;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterBatchSaveExamStudentReq;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterSaveExamStudentReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.BatchOuterSaveExamStudentResp;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterSaveExamStudentResp;
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
 
 /**
  * 类注释

+ 29 - 29
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/FaceOuterService.java

@@ -1,29 +1,29 @@
-package cn.com.qmth.examcloud.exchange.outer.api;
-
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年9月4日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public interface FaceOuterService extends OuterService {
-
-	void addPhotoByUrl(@RequestParam Long rootOrgId, @RequestParam String identityNumber,
-			@RequestParam String photoUrl, @RequestParam String operator);
-
-	void addPhoto(Long rootOrgId, String identityNumber, String operator,
-			CommonsMultipartFile file);
-
-	List<Map<String, String>> importPhotos(Long rootOrgId, String operator,
-			CommonsMultipartFile file);
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api;
+
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年9月4日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface FaceOuterService extends OuterService {
+
+	void addPhotoByUrl(@RequestParam Long rootOrgId, @RequestParam String identityNumber,
+			@RequestParam String photoUrl, @RequestParam String operator);
+
+	void addPhoto(Long rootOrgId, String identityNumber, String operator,
+			CommonsMultipartFile file);
+
+	List<Map<String, String>> importPhotos(Long rootOrgId, String operator,
+			CommonsMultipartFile file);
+
+}

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/GetExamRecordAuditInfoService.java

@@ -1,8 +1,8 @@
 package cn.com.qmth.examcloud.exchange.outer.api;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetExamRecordAuditInfoReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetExamRecordAuditInfoResp;
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
 
 /**
  * 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/GetScoreDataService.java

@@ -1,10 +1,10 @@
 package cn.com.qmth.examcloud.exchange.outer.api;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetScoreDataReq;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterQueryScoreDataReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetScoreDataResp;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterQueryScoreDataResp;
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
 
 /**
  * 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/QueryCapturePhotoService.java

@@ -1,8 +1,8 @@
 package cn.com.qmth.examcloud.exchange.outer.api;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterQueryCapturePhotoReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterQueryCapturePhotoResp;
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
 
 /**
  * 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/ScoreQueueService.java

@@ -1,10 +1,10 @@
 package cn.com.qmth.examcloud.exchange.outer.api;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterDeleteScoreQueueTopReq;
 import cn.com.qmth.examcloud.exchange.outer.api.request.OuterGetScoreQueueTopReq;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterDeleteScoreQueueTopResp;
 import cn.com.qmth.examcloud.exchange.outer.api.response.OuterGetScoreQueueTopResp;
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
 
 
 /**

+ 27 - 27
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/StudentOuterService.java

@@ -1,27 +1,27 @@
-package cn.com.qmth.examcloud.exchange.outer.api;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
-import cn.com.qmth.examcloud.exchange.outer.api.request.OuterBatchSaveStudentReq;
-import cn.com.qmth.examcloud.exchange.outer.api.request.OuterSaveStudentReq;
-import cn.com.qmth.examcloud.exchange.outer.api.response.BatchOuterSaveStudentResp;
-import cn.com.qmth.examcloud.exchange.outer.api.response.OuterSaveStudentResp;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年6月29日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public interface StudentOuterService extends OuterService {
-
-	OuterSaveStudentResp saveStudent(OuterSaveStudentReq req);
-
-	/**
-	 * 批量创建学生
-	 * @param req
-	 * @return
-	 */
-	BatchOuterSaveStudentResp batchSaveStudent(OuterBatchSaveStudentReq req);
-	
-}
+package cn.com.qmth.examcloud.exchange.outer.api;
+
+import cn.com.qmth.examcloud.exchange.outer.api.request.OuterBatchSaveStudentReq;
+import cn.com.qmth.examcloud.exchange.outer.api.request.OuterSaveStudentReq;
+import cn.com.qmth.examcloud.exchange.outer.api.response.BatchOuterSaveStudentResp;
+import cn.com.qmth.examcloud.exchange.outer.api.response.OuterSaveStudentResp;
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年6月29日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public interface StudentOuterService extends OuterService {
+
+	OuterSaveStudentResp saveStudent(OuterSaveStudentReq req);
+
+	/**
+	 * 批量创建学生
+	 * @param req
+	 * @return
+	 */
+	BatchOuterSaveStudentResp batchSaveStudent(OuterBatchSaveStudentReq req);
+	
+}

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/bean/CourseBean.java

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

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/bean/ExamStudent4BatchBean.java

@@ -1,6 +1,6 @@
 package cn.com.qmth.examcloud.exchange.outer.api.bean;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 

+ 159 - 159
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/bean/OuterExamStudentBean.java

@@ -1,159 +1,159 @@
-package cn.com.qmth.examcloud.exchange.outer.api.bean;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年11月14日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@ApiModel(value = "examStudentBean", description = "考生信息")
-public class OuterExamStudentBean implements JsonSerializable {
-	private static final long serialVersionUID = 2079003980099252759L;
-
-	/**
-	 * 顶级机构ID
-	 */
-	@ApiModelProperty(value = "顶级机构", example = "0", required = true)
-	private Long rootOrgId;
-
-	/**
-	 * 考试ID
-	 */
-	@ApiModelProperty(value = "考试ID", example = "100", required = true)
-	private Long examId;
-
-	/**
-	 * 考试名称
-	 */
-	@ApiModelProperty(value = "考试名称", example = "2018年秋季入学考试", required = true)
-	private String examName;
-
-	/**
-	 * 学生姓名
-	 */
-	@ApiModelProperty(value = "学生姓名", example = "陈圆圆", required = true)
-	private String studentName;
-
-	/**
-	 * 学生学号
-	 */
-	@ApiModelProperty(value = "学生学号", example = "2018001001", required = true)
-	private String studentCode;
-
-	/**
-	 * 学生身份证号
-	 */
-	@ApiModelProperty(value = "学生身份证号", example = "XXXXXXXXXXXXXXXXXX", required = true)
-	private String identityNumber;
-
-	/**
-	 * 考试课程名称
-	 */
-	@ApiModelProperty(value = "考试课程名称", example = "大学英语", required = true)
-	private String courseName;
-
-	/**
-	 * 考试课程code
-	 */
-	@ApiModelProperty(value = "考试课程code", example = "K2", required = true)
-	private String courseCode;
-
-	/**
-	 * 考试课程level
-	 */
-	@ApiModelProperty(value = "考试课程level.  ZSB:专升本;GQZ:高起专;GQB:高起本;ALL:不限", example = "ALL", required = true)
-
-	private String courseLevel;
-
-	/**
-	 * 试卷类型
-	 */
-	@ApiModelProperty(value = "试卷类型,大写字母A-Z", example = "X", required = true)
-	private String paperType;
-
-	public Long getRootOrgId() {
-		return rootOrgId;
-	}
-
-	public void setRootOrgId(Long rootOrgId) {
-		this.rootOrgId = rootOrgId;
-	}
-
-	public Long getExamId() {
-		return examId;
-	}
-
-	public void setExamId(Long examId) {
-		this.examId = examId;
-	}
-
-	public String getExamName() {
-		return examName;
-	}
-
-	public void setExamName(String examName) {
-		this.examName = examName;
-	}
-
-	public String getStudentName() {
-		return studentName;
-	}
-
-	public void setStudentName(String studentName) {
-		this.studentName = studentName;
-	}
-
-	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 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 String getPaperType() {
-		return paperType;
-	}
-
-	public void setPaperType(String paperType) {
-		this.paperType = paperType;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.bean;
+
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年11月14日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@ApiModel(value = "examStudentBean", description = "考生信息")
+public class OuterExamStudentBean implements JsonSerializable {
+	private static final long serialVersionUID = 2079003980099252759L;
+
+	/**
+	 * 顶级机构ID
+	 */
+	@ApiModelProperty(value = "顶级机构", example = "0", required = true)
+	private Long rootOrgId;
+
+	/**
+	 * 考试ID
+	 */
+	@ApiModelProperty(value = "考试ID", example = "100", required = true)
+	private Long examId;
+
+	/**
+	 * 考试名称
+	 */
+	@ApiModelProperty(value = "考试名称", example = "2018年秋季入学考试", required = true)
+	private String examName;
+
+	/**
+	 * 学生姓名
+	 */
+	@ApiModelProperty(value = "学生姓名", example = "陈圆圆", required = true)
+	private String studentName;
+
+	/**
+	 * 学生学号
+	 */
+	@ApiModelProperty(value = "学生学号", example = "2018001001", required = true)
+	private String studentCode;
+
+	/**
+	 * 学生身份证号
+	 */
+	@ApiModelProperty(value = "学生身份证号", example = "XXXXXXXXXXXXXXXXXX", required = true)
+	private String identityNumber;
+
+	/**
+	 * 考试课程名称
+	 */
+	@ApiModelProperty(value = "考试课程名称", example = "大学英语", required = true)
+	private String courseName;
+
+	/**
+	 * 考试课程code
+	 */
+	@ApiModelProperty(value = "考试课程code", example = "K2", required = true)
+	private String courseCode;
+
+	/**
+	 * 考试课程level
+	 */
+	@ApiModelProperty(value = "考试课程level.  ZSB:专升本;GQZ:高起专;GQB:高起本;ALL:不限", example = "ALL", required = true)
+
+	private String courseLevel;
+
+	/**
+	 * 试卷类型
+	 */
+	@ApiModelProperty(value = "试卷类型,大写字母A-Z", example = "X", required = true)
+	private String paperType;
+
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+	public String getExamName() {
+		return examName;
+	}
+
+	public void setExamName(String examName) {
+		this.examName = examName;
+	}
+
+	public String getStudentName() {
+		return studentName;
+	}
+
+	public void setStudentName(String studentName) {
+		this.studentName = studentName;
+	}
+
+	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 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 String getPaperType() {
+		return paperType;
+	}
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
+	}
+
+}

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/bean/OuterGetCapturePhotoBean.java

@@ -1,9 +1,9 @@
 package cn.com.qmth.examcloud.exchange.outer.api.bean;
 
 
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
 
 /**
  * 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/bean/OuterScoreDataBean.java

@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Date;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
 
 /**
  * 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterBatchSaveExamStudentReq.java

@@ -2,8 +2,8 @@ package cn.com.qmth.examcloud.exchange.outer.api.request;
 
 import java.util.List;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
 import cn.com.qmth.examcloud.exchange.outer.api.bean.ExamStudent4BatchBean;
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 import io.swagger.annotations.ApiModelProperty;
 
 /**

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterBatchSaveStudentReq.java

@@ -2,8 +2,8 @@ package cn.com.qmth.examcloud.exchange.outer.api.request;
 
 import java.util.List;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
 import cn.com.qmth.examcloud.exchange.outer.api.bean.Student4BatchBean;
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 
 public class OuterBatchSaveStudentReq extends BaseRequest{
 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterDeleteScoreQueueTopReq.java

@@ -1,6 +1,6 @@
 package cn.com.qmth.examcloud.exchange.outer.api.request;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 import io.swagger.annotations.ApiModelProperty;
 
 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterGetCourseListReq.java

@@ -1,6 +1,6 @@
 package cn.com.qmth.examcloud.exchange.outer.api.request;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 import io.swagger.annotations.ApiModelProperty;
 
 public class OuterGetCourseListReq extends BaseRequest {

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterGetExamRecordAuditInfoReq.java

@@ -1,6 +1,6 @@
 package cn.com.qmth.examcloud.exchange.outer.api.request;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 import io.swagger.annotations.ApiModelProperty;
 
 public class OuterGetExamRecordAuditInfoReq extends BaseRequest{

+ 61 - 61
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterGetExamReq.java

@@ -1,61 +1,61 @@
-package cn.com.qmth.examcloud.exchange.outer.api.request;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年11月16日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class OuterGetExamReq extends BaseRequest {
-
-	private static final long serialVersionUID = -2827676106721670081L;
-
-	@ApiModelProperty(value = "考试ID", example = "128", required = true)
-	private Long id;
-
-	@ApiModelProperty(value = "顶级机构", example = "0", required = true)
-	private Long rootOrgId;
-
-	@ApiModelProperty(value = "考试名称", example = "2018年6月期末考试", required = true)
-	private String name;
-
-	@ApiModelProperty(value = "机构ID(机构特殊配置不为空时覆盖考试信息)", example = "1111", required = false)
-	private Long orgId;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Long getRootOrgId() {
-		return rootOrgId;
-	}
-
-	public void setRootOrgId(Long rootOrgId) {
-		this.rootOrgId = rootOrgId;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public Long getOrgId() {
-		return orgId;
-	}
-
-	public void setOrgId(Long orgId) {
-		this.orgId = orgId;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.request;
+
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年11月16日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class OuterGetExamReq extends BaseRequest {
+
+	private static final long serialVersionUID = -2827676106721670081L;
+
+	@ApiModelProperty(value = "考试ID", example = "128", required = true)
+	private Long id;
+
+	@ApiModelProperty(value = "顶级机构", example = "0", required = true)
+	private Long rootOrgId;
+
+	@ApiModelProperty(value = "考试名称", example = "2018年6月期末考试", required = true)
+	private String name;
+
+	@ApiModelProperty(value = "机构ID(机构特殊配置不为空时覆盖考试信息)", example = "1111", required = false)
+	private Long orgId;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Long getOrgId() {
+		return orgId;
+	}
+
+	public void setOrgId(Long orgId) {
+		this.orgId = orgId;
+	}
+
+}

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterGetScoreDataReq.java

@@ -1,7 +1,7 @@
 package cn.com.qmth.examcloud.exchange.outer.api.request;
 
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 import io.swagger.annotations.ApiModelProperty;
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
 
 /**
  * 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterGetScoreQueueTopReq.java

@@ -1,7 +1,7 @@
 package cn.com.qmth.examcloud.exchange.outer.api.request;
 
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 import io.swagger.annotations.ApiModelProperty;
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
 
 public class OuterGetScoreQueueTopReq extends BaseRequest{
 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterQueryCapturePhotoReq.java

@@ -1,6 +1,6 @@
 package cn.com.qmth.examcloud.exchange.outer.api.request;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 import io.swagger.annotations.ApiModelProperty;
 
 /**

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterQueryScoreDataReq.java

@@ -1,6 +1,6 @@
 package cn.com.qmth.examcloud.exchange.outer.api.request;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 
 /**
  * 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterSaveExamReq.java

@@ -3,7 +3,7 @@ package cn.com.qmth.examcloud.exchange.outer.api.request;
 import java.util.Date;
 import java.util.Map;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 import io.swagger.annotations.ApiModelProperty;
 
 /**

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterSaveExamStudentReq.java

@@ -1,6 +1,6 @@
 package cn.com.qmth.examcloud.exchange.outer.api.request;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
 import io.swagger.annotations.ApiModelProperty;
 
 /**

+ 171 - 171
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/OuterSaveStudentReq.java

@@ -1,171 +1,171 @@
-package cn.com.qmth.examcloud.exchange.outer.api.request;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年6月29日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class OuterSaveStudentReq extends BaseRequest {
-
-	private static final long serialVersionUID = -8500412921400589808L;
-
-	/**
-	 * 学生姓名
-	 */
-	@ApiModelProperty(value = "学生姓名", example = "赵飞燕", required = true)
-	private String name;
-
-	/**
-	 * 顶级机构ID
-	 */
-	@ApiModelProperty(value = "顶级机构ID", example = "0", required = true)
-	private Long rootOrgId;
-
-	/**
-	 * 机构ID
-	 */
-	@ApiModelProperty(value = "学习中心ID", example = "1", required = false)
-	private Long orgId;
-
-	/**
-	 * 学习中心编码
-	 */
-	@ApiModelProperty(value = "学习中心编码", example = "LC111111", required = true)
-	private String orgCode;
-
-	/**
-	 * 学习中心名称
-	 */
-	@ApiModelProperty(value = "学习中心名称", example = "LC111111", required = true)
-	private String orgName;
-
-	/**
-	 * 学生code
-	 */
-	@ApiModelProperty(value = "学号", example = "1111", required = true)
-	private String studentCode;
-
-	/**
-	 * 身份证号码
-	 */
-	@ApiModelProperty(value = "身份证号", example = "XXXXXXXXXXXXXXXXXX", required = true)
-	private String identityNumber;
-
-	/**
-	 * 备注
-	 */
-	@ApiModelProperty(value = "备注", example = "xx", required = false)
-	private String remark;
-
-	/**
-	 * 图片地址
-	 */
-	@ApiModelProperty(value = "图片URL", example = "http://xxxx.xx/photo.jpg", required = false)
-	private String photoUrl;
-
-	/**
-	 * 手机号码
-	 */
-	@ApiModelProperty(value = "手机号码", example = "XXXXXXXXXXX", required = true)
-	private String phoneNumber;
-
-	/**
-	 * 操作者
-	 */
-	@ApiModelProperty(value = "操作者", example = "XXX", required = true)
-	private String operator;
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	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 getOrgCode() {
-		return orgCode;
-	}
-
-	public void setOrgCode(String orgCode) {
-		this.orgCode = orgCode;
-	}
-
-	public String getOrgName() {
-		return orgName;
-	}
-
-	public void setOrgName(String orgName) {
-		this.orgName = orgName;
-	}
-
-	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 String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public String getPhotoUrl() {
-		return photoUrl;
-	}
-
-	public void setPhotoUrl(String photoUrl) {
-		this.photoUrl = photoUrl;
-	}
-
-	public String getPhoneNumber() {
-		return phoneNumber;
-	}
-
-	public void setPhoneNumber(String phoneNumber) {
-		this.phoneNumber = phoneNumber;
-	}
-
-	public String getOperator() {
-		return operator;
-	}
-
-	public void setOperator(String operator) {
-		this.operator = operator;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.request;
+
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年6月29日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class OuterSaveStudentReq extends BaseRequest {
+
+	private static final long serialVersionUID = -8500412921400589808L;
+
+	/**
+	 * 学生姓名
+	 */
+	@ApiModelProperty(value = "学生姓名", example = "赵飞燕", required = true)
+	private String name;
+
+	/**
+	 * 顶级机构ID
+	 */
+	@ApiModelProperty(value = "顶级机构ID", example = "0", required = true)
+	private Long rootOrgId;
+
+	/**
+	 * 机构ID
+	 */
+	@ApiModelProperty(value = "学习中心ID", example = "1", required = false)
+	private Long orgId;
+
+	/**
+	 * 学习中心编码
+	 */
+	@ApiModelProperty(value = "学习中心编码", example = "LC111111", required = true)
+	private String orgCode;
+
+	/**
+	 * 学习中心名称
+	 */
+	@ApiModelProperty(value = "学习中心名称", example = "LC111111", required = true)
+	private String orgName;
+
+	/**
+	 * 学生code
+	 */
+	@ApiModelProperty(value = "学号", example = "1111", required = true)
+	private String studentCode;
+
+	/**
+	 * 身份证号码
+	 */
+	@ApiModelProperty(value = "身份证号", example = "XXXXXXXXXXXXXXXXXX", required = true)
+	private String identityNumber;
+
+	/**
+	 * 备注
+	 */
+	@ApiModelProperty(value = "备注", example = "xx", required = false)
+	private String remark;
+
+	/**
+	 * 图片地址
+	 */
+	@ApiModelProperty(value = "图片URL", example = "http://xxxx.xx/photo.jpg", required = false)
+	private String photoUrl;
+
+	/**
+	 * 手机号码
+	 */
+	@ApiModelProperty(value = "手机号码", example = "XXXXXXXXXXX", required = true)
+	private String phoneNumber;
+
+	/**
+	 * 操作者
+	 */
+	@ApiModelProperty(value = "操作者", example = "XXX", required = true)
+	private String operator;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	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 getOrgCode() {
+		return orgCode;
+	}
+
+	public void setOrgCode(String orgCode) {
+		this.orgCode = orgCode;
+	}
+
+	public String getOrgName() {
+		return orgName;
+	}
+
+	public void setOrgName(String orgName) {
+		this.orgName = orgName;
+	}
+
+	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 String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getPhotoUrl() {
+		return photoUrl;
+	}
+
+	public void setPhotoUrl(String photoUrl) {
+		this.photoUrl = photoUrl;
+	}
+
+	public String getPhoneNumber() {
+		return phoneNumber;
+	}
+
+	public void setPhoneNumber(String phoneNumber) {
+		this.phoneNumber = phoneNumber;
+	}
+
+	public String getOperator() {
+		return operator;
+	}
+
+	public void setOperator(String operator) {
+		this.operator = operator;
+	}
+
+}

+ 171 - 171
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/request/cug/OuterSaveCugStudentAndExamStudentReq.java

@@ -1,171 +1,171 @@
-package cn.com.qmth.examcloud.exchange.outer.api.request.cug;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseRequest;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年11月16日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class OuterSaveCugStudentAndExamStudentReq extends BaseRequest {
-
-	private static final long serialVersionUID = 8293200048902081959L;
-
-	@ApiModelProperty(value = "学生姓名", example = "陈圆圆", required = true)
-	private String name;
-
-	@ApiModelProperty(value = "顶级机构", example = "0", required = true)
-	private Long rootOrgId;
-
-	@ApiModelProperty(value = "学习中心编码", example = "LC111", required = true)
-	private String orgCode;
-
-	@ApiModelProperty(value = "学习中心名称", example = "XXX", required = true)
-	private String orgName;
-
-	@ApiModelProperty(value = "学生学号", example = "2018001001", required = true)
-	private String studentCode;
-
-	@ApiModelProperty(value = "学生身份证号", example = "XXXXXXXXXXXXXXXXXX", required = true)
-	private String identityNumber;
-
-	@ApiModelProperty(value = "备注", example = "XX", required = false)
-	private String remark;
-
-	@ApiModelProperty(value = "照片URL", example = "http://xxxx.xx/123.jpg", required = false)
-	private String photoUrl;
-
-	@ApiModelProperty(value = "手机号码", example = "XXXXXXXXXXX", required = true)
-	private String phoneNumber;
-
-	@ApiModelProperty(value = "操作者", example = "XX系统", required = true)
-	private String operator;
-
-	@ApiModelProperty(value = "考试名称", example = "2018年秋季入学考试", required = true)
-	private String examName;
-
-	@ApiModelProperty(value = "专业名称", example = "计算机", required = false)
-	private String specialtyName;
-
-	@ApiModelProperty(value = "课程组", example = "本科", required = true)
-	private String courseGroupName;
-
-	@ApiModelProperty(value = "试卷类型,大写字母A-Z", example = "X", required = true)
-	private String paperType;
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public Long getRootOrgId() {
-		return rootOrgId;
-	}
-
-	public void setRootOrgId(Long rootOrgId) {
-		this.rootOrgId = rootOrgId;
-	}
-
-	public String getOrgCode() {
-		return orgCode;
-	}
-
-	public void setOrgCode(String orgCode) {
-		this.orgCode = orgCode;
-	}
-
-	public String getOrgName() {
-		return orgName;
-	}
-
-	public void setOrgName(String orgName) {
-		this.orgName = orgName;
-	}
-
-	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 String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public String getPhotoUrl() {
-		return photoUrl;
-	}
-
-	public void setPhotoUrl(String photoUrl) {
-		this.photoUrl = photoUrl;
-	}
-
-	public String getPhoneNumber() {
-		return phoneNumber;
-	}
-
-	public void setPhoneNumber(String phoneNumber) {
-		this.phoneNumber = phoneNumber;
-	}
-
-	public String getOperator() {
-		return operator;
-	}
-
-	public void setOperator(String operator) {
-		this.operator = operator;
-	}
-
-	public String getExamName() {
-		return examName;
-	}
-
-	public void setExamName(String examName) {
-		this.examName = examName;
-	}
-
-	public String getSpecialtyName() {
-		return specialtyName;
-	}
-
-	public void setSpecialtyName(String specialtyName) {
-		this.specialtyName = specialtyName;
-	}
-
-	public String getCourseGroupName() {
-		return courseGroupName;
-	}
-
-	public void setCourseGroupName(String courseGroupName) {
-		this.courseGroupName = courseGroupName;
-	}
-
-	public String getPaperType() {
-		return paperType;
-	}
-
-	public void setPaperType(String paperType) {
-		this.paperType = paperType;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.request.cug;
+
+import cn.com.qmth.examcloud.web.cloud.api.BaseRequest;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年11月16日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class OuterSaveCugStudentAndExamStudentReq extends BaseRequest {
+
+	private static final long serialVersionUID = 8293200048902081959L;
+
+	@ApiModelProperty(value = "学生姓名", example = "陈圆圆", required = true)
+	private String name;
+
+	@ApiModelProperty(value = "顶级机构", example = "0", required = true)
+	private Long rootOrgId;
+
+	@ApiModelProperty(value = "学习中心编码", example = "LC111", required = true)
+	private String orgCode;
+
+	@ApiModelProperty(value = "学习中心名称", example = "XXX", required = true)
+	private String orgName;
+
+	@ApiModelProperty(value = "学生学号", example = "2018001001", required = true)
+	private String studentCode;
+
+	@ApiModelProperty(value = "学生身份证号", example = "XXXXXXXXXXXXXXXXXX", required = true)
+	private String identityNumber;
+
+	@ApiModelProperty(value = "备注", example = "XX", required = false)
+	private String remark;
+
+	@ApiModelProperty(value = "照片URL", example = "http://xxxx.xx/123.jpg", required = false)
+	private String photoUrl;
+
+	@ApiModelProperty(value = "手机号码", example = "XXXXXXXXXXX", required = true)
+	private String phoneNumber;
+
+	@ApiModelProperty(value = "操作者", example = "XX系统", required = true)
+	private String operator;
+
+	@ApiModelProperty(value = "考试名称", example = "2018年秋季入学考试", required = true)
+	private String examName;
+
+	@ApiModelProperty(value = "专业名称", example = "计算机", required = false)
+	private String specialtyName;
+
+	@ApiModelProperty(value = "课程组", example = "本科", required = true)
+	private String courseGroupName;
+
+	@ApiModelProperty(value = "试卷类型,大写字母A-Z", example = "X", required = true)
+	private String paperType;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	public String getOrgCode() {
+		return orgCode;
+	}
+
+	public void setOrgCode(String orgCode) {
+		this.orgCode = orgCode;
+	}
+
+	public String getOrgName() {
+		return orgName;
+	}
+
+	public void setOrgName(String orgName) {
+		this.orgName = orgName;
+	}
+
+	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 String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getPhotoUrl() {
+		return photoUrl;
+	}
+
+	public void setPhotoUrl(String photoUrl) {
+		this.photoUrl = photoUrl;
+	}
+
+	public String getPhoneNumber() {
+		return phoneNumber;
+	}
+
+	public void setPhoneNumber(String phoneNumber) {
+		this.phoneNumber = phoneNumber;
+	}
+
+	public String getOperator() {
+		return operator;
+	}
+
+	public void setOperator(String operator) {
+		this.operator = operator;
+	}
+
+	public String getExamName() {
+		return examName;
+	}
+
+	public void setExamName(String examName) {
+		this.examName = examName;
+	}
+
+	public String getSpecialtyName() {
+		return specialtyName;
+	}
+
+	public void setSpecialtyName(String specialtyName) {
+		this.specialtyName = specialtyName;
+	}
+
+	public String getCourseGroupName() {
+		return courseGroupName;
+	}
+
+	public void setCourseGroupName(String courseGroupName) {
+		this.courseGroupName = courseGroupName;
+	}
+
+	public String getPaperType() {
+		return paperType;
+	}
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
+	}
+
+}

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/BatchOuterSaveExamStudentResp.java

@@ -2,8 +2,8 @@ package cn.com.qmth.examcloud.exchange.outer.api.response;
 
 import java.util.List;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
 import cn.com.qmth.examcloud.exchange.outer.api.bean.ExamStudentStatus4BatchBean;
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
 
 /**
  * 类注释

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/BatchOuterSaveStudentResp.java

@@ -2,8 +2,8 @@ package cn.com.qmth.examcloud.exchange.outer.api.response;
 
 import java.util.List;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
 import cn.com.qmth.examcloud.exchange.outer.api.bean.StudentStatus4BatchBean;
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
 
 /**
  * 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterDeleteScoreQueueTopResp.java

@@ -1,7 +1,7 @@
 package cn.com.qmth.examcloud.exchange.outer.api.response;
 
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
 import io.swagger.annotations.ApiModelProperty;
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
 
 
 /**

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterGetCourseListResp.java

@@ -2,8 +2,8 @@ package cn.com.qmth.examcloud.exchange.outer.api.response;
 
 import java.util.List;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
 import cn.com.qmth.examcloud.exchange.outer.api.bean.CourseBean;
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
 
 public class OuterGetCourseListResp extends BaseResponse {
 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterGetExamRecordAuditInfoResp.java

@@ -2,8 +2,8 @@ package cn.com.qmth.examcloud.exchange.outer.api.response;
 
 import java.util.Date;
 
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
 import io.swagger.annotations.ApiModelProperty;
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
 
 /**
  * 

+ 159 - 159
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterGetExamResp.java

@@ -1,159 +1,159 @@
-package cn.com.qmth.examcloud.exchange.outer.api.response;
-
-import java.util.Date;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年11月16日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class OuterGetExamResp extends BaseResponse {
-
-	private static final long serialVersionUID = 1030154836013325322L;
-
-	/**
-	 * ID
-	 */
-	@ApiModelProperty(value = "考试ID", example = "128", required = true)
-	private Long id;
-
-	/**
-	 * 顶级机构Id
-	 */
-	@ApiModelProperty(value = "顶级机构", example = "0", required = true)
-	private Long rootOrgId;
-
-	/**
-	 * 考试批次开始时间
-	 */
-	@ApiModelProperty(value = " 考试批次开始时间", example = "2018-10-10 08:00:00", required = true)
-	private Date beginTime;
-
-	/**
-	 * 考试批次结束时间
-	 */
-	@ApiModelProperty(value = " 考试批次结束时间", example = "2018-10-10 08:00:00", required = true)
-	private Date endTime;
-
-	/**
-	 * 考试名称
-	 */
-	@ApiModelProperty(value = "考试名称", example = "2018年6月期末考试", required = true)
-	private String name;
-
-	/**
-	 * 考试类型
-	 */
-	@ApiModelProperty(value = " 考试类型(ONLINE:网考;TRADITION:传统;OFFLINE:离线;PRACTICE:练习;PRINT_EXAM:PRINT_EXAM.)", example = "ONLINE", required = true)
-	private String examType;
-
-	/**
-	 * 考试时长(分钟)
-	 */
-	@ApiModelProperty(value = "考试时长(单位:分钟)", example = "120", required = true)
-	private Integer duration;
-
-	/**
-	 * 是否可用
-	 */
-	@ApiModelProperty(value = "是否可用", example = "true", required = true)
-	private Boolean enable;
-
-	/**
-	 * 考试备注
-	 */
-	@ApiModelProperty(value = "考试备注", example = "xxx", required = true)
-	private String remark;
-
-	/**
-	 * 考试次数
-	 */
-	@ApiModelProperty(value = "考试次数", example = "2", required = true)
-	private Long examTimes;
-
-	public Long getId() {
-		return id;
-	}
-
-	public void setId(Long id) {
-		this.id = id;
-	}
-
-	public Long getRootOrgId() {
-		return rootOrgId;
-	}
-
-	public void setRootOrgId(Long rootOrgId) {
-		this.rootOrgId = rootOrgId;
-	}
-
-	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;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getExamType() {
-		return examType;
-	}
-
-	public void setExamType(String examType) {
-		this.examType = examType;
-	}
-
-	public Integer getDuration() {
-		return duration;
-	}
-
-	public void setDuration(Integer duration) {
-		this.duration = duration;
-	}
-
-	public Boolean getEnable() {
-		return enable;
-	}
-
-	public void setEnable(Boolean enable) {
-		this.enable = enable;
-	}
-
-	public String getRemark() {
-		return remark;
-	}
-
-	public void setRemark(String remark) {
-		this.remark = remark;
-	}
-
-	public Long getExamTimes() {
-		return examTimes;
-	}
-
-	public void setExamTimes(Long examTimes) {
-		this.examTimes = examTimes;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.response;
+
+import java.util.Date;
+
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年11月16日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class OuterGetExamResp extends BaseResponse {
+
+	private static final long serialVersionUID = 1030154836013325322L;
+
+	/**
+	 * ID
+	 */
+	@ApiModelProperty(value = "考试ID", example = "128", required = true)
+	private Long id;
+
+	/**
+	 * 顶级机构Id
+	 */
+	@ApiModelProperty(value = "顶级机构", example = "0", required = true)
+	private Long rootOrgId;
+
+	/**
+	 * 考试批次开始时间
+	 */
+	@ApiModelProperty(value = " 考试批次开始时间", example = "2018-10-10 08:00:00", required = true)
+	private Date beginTime;
+
+	/**
+	 * 考试批次结束时间
+	 */
+	@ApiModelProperty(value = " 考试批次结束时间", example = "2018-10-10 08:00:00", required = true)
+	private Date endTime;
+
+	/**
+	 * 考试名称
+	 */
+	@ApiModelProperty(value = "考试名称", example = "2018年6月期末考试", required = true)
+	private String name;
+
+	/**
+	 * 考试类型
+	 */
+	@ApiModelProperty(value = " 考试类型(ONLINE:网考;TRADITION:传统;OFFLINE:离线;PRACTICE:练习;PRINT_EXAM:PRINT_EXAM.)", example = "ONLINE", required = true)
+	private String examType;
+
+	/**
+	 * 考试时长(分钟)
+	 */
+	@ApiModelProperty(value = "考试时长(单位:分钟)", example = "120", required = true)
+	private Integer duration;
+
+	/**
+	 * 是否可用
+	 */
+	@ApiModelProperty(value = "是否可用", example = "true", required = true)
+	private Boolean enable;
+
+	/**
+	 * 考试备注
+	 */
+	@ApiModelProperty(value = "考试备注", example = "xxx", required = true)
+	private String remark;
+
+	/**
+	 * 考试次数
+	 */
+	@ApiModelProperty(value = "考试次数", example = "2", required = true)
+	private Long examTimes;
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getRootOrgId() {
+		return rootOrgId;
+	}
+
+	public void setRootOrgId(Long rootOrgId) {
+		this.rootOrgId = rootOrgId;
+	}
+
+	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;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getExamType() {
+		return examType;
+	}
+
+	public void setExamType(String examType) {
+		this.examType = examType;
+	}
+
+	public Integer getDuration() {
+		return duration;
+	}
+
+	public void setDuration(Integer duration) {
+		this.duration = duration;
+	}
+
+	public Boolean getEnable() {
+		return enable;
+	}
+
+	public void setEnable(Boolean enable) {
+		this.enable = enable;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Long getExamTimes() {
+		return examTimes;
+	}
+
+	public void setExamTimes(Long examTimes) {
+		this.examTimes = examTimes;
+	}
+
+}

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterGetScoreDataResp.java

@@ -1,7 +1,7 @@
 package cn.com.qmth.examcloud.exchange.outer.api.response;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
 import cn.com.qmth.examcloud.exchange.outer.api.bean.OuterScoreDataBean;
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
 
 /**
  * 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterGetScoreQueueTopResp.java

@@ -1,7 +1,7 @@
 package cn.com.qmth.examcloud.exchange.outer.api.response;
 
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
 import io.swagger.annotations.ApiModelProperty;
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
 
 /**
  * 

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterQueryCapturePhotoResp.java

@@ -2,8 +2,8 @@ package cn.com.qmth.examcloud.exchange.outer.api.response;
 
 import java.util.List;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
 import cn.com.qmth.examcloud.exchange.outer.api.bean.OuterGetCapturePhotoBean;
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
 import io.swagger.annotations.ApiModelProperty;
 
 public class OuterQueryCapturePhotoResp extends BaseResponse{

+ 1 - 1
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterQueryScoreDataResp.java

@@ -2,8 +2,8 @@ package cn.com.qmth.examcloud.exchange.outer.api.response;
 
 import java.util.List;
 
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
 import cn.com.qmth.examcloud.exchange.outer.api.bean.OuterScoreDataBean;
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
 
 public class OuterQueryScoreDataResp extends BaseResponse{
 

+ 28 - 28
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterSaveExamResp.java

@@ -1,28 +1,28 @@
-package cn.com.qmth.examcloud.exchange.outer.api.response;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年11月16日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class OuterSaveExamResp extends BaseResponse {
-
-	private static final long serialVersionUID = -8997559197584414927L;
-
-	@ApiModelProperty(value = "考试ID", example = "128", required = true)
-	private Long examId;
-
-	public Long getExamId() {
-		return examId;
-	}
-
-	public void setExamId(Long examId) {
-		this.examId = examId;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.response;
+
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年11月16日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class OuterSaveExamResp extends BaseResponse {
+
+	private static final long serialVersionUID = -8997559197584414927L;
+
+	@ApiModelProperty(value = "考试ID", example = "128", required = true)
+	private Long examId;
+
+	public Long getExamId() {
+		return examId;
+	}
+
+	public void setExamId(Long examId) {
+		this.examId = examId;
+	}
+
+}

+ 29 - 29
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterSaveExamStudentResp.java

@@ -1,29 +1,29 @@
-package cn.com.qmth.examcloud.exchange.outer.api.response;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
-import cn.com.qmth.examcloud.exchange.outer.api.bean.OuterExamStudentBean;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 响应
- *
- * @author WANGWEI
- * @date 2018年11月14日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class OuterSaveExamStudentResp extends BaseResponse {
-
-	private static final long serialVersionUID = 5003024673163742249L;
-
-	@ApiModelProperty(value = "考生信息", name = "examStudentBean")
-	private OuterExamStudentBean examStudentBean;
-
-	public OuterExamStudentBean getExamStudentBean() {
-		return examStudentBean;
-	}
-
-	public void setExamStudentBean(OuterExamStudentBean examStudentBean) {
-		this.examStudentBean = examStudentBean;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.response;
+
+import cn.com.qmth.examcloud.exchange.outer.api.bean.OuterExamStudentBean;
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 响应
+ *
+ * @author WANGWEI
+ * @date 2018年11月14日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class OuterSaveExamStudentResp extends BaseResponse {
+
+	private static final long serialVersionUID = 5003024673163742249L;
+
+	@ApiModelProperty(value = "考生信息", name = "examStudentBean")
+	private OuterExamStudentBean examStudentBean;
+
+	public OuterExamStudentBean getExamStudentBean() {
+		return examStudentBean;
+	}
+
+	public void setExamStudentBean(OuterExamStudentBean examStudentBean) {
+		this.examStudentBean = examStudentBean;
+	}
+
+}

+ 16 - 16
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterSaveStudentPhotoResp.java

@@ -1,16 +1,16 @@
-package cn.com.qmth.examcloud.exchange.outer.api.response;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年9月4日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class OuterSaveStudentPhotoResp extends BaseResponse {
-
-	private static final long serialVersionUID = 8401121486324558126L;
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.response;
+
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年9月4日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class OuterSaveStudentPhotoResp extends BaseResponse {
+
+	private static final long serialVersionUID = 8401121486324558126L;
+
+}

+ 54 - 54
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/OuterSaveStudentResp.java

@@ -1,54 +1,54 @@
-package cn.com.qmth.examcloud.exchange.outer.api.response;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
-import io.swagger.annotations.ApiModelProperty;
-
-public class OuterSaveStudentResp extends BaseResponse {
-
-	private static final long serialVersionUID = 2523302124132923363L;
-
-	@ApiModelProperty(value = "学生ID", example = "100", required = true)
-	private Long studentId;
-
-	@ApiModelProperty(value = "顶级机构ID", example = "0", required = true)
-	private Long rootOrgId;
-
-	@ApiModelProperty(value = "学习中心ID", example = "1", required = true)
-	private Long orgId;
-
-	@ApiModelProperty(value = "学习中心编码", example = "LC111111", required = true)
-	private String orgName;
-
-	public Long getStudentId() {
-		return studentId;
-	}
-
-	public void setStudentId(Long studentId) {
-		this.studentId = studentId;
-	}
-
-	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 getOrgName() {
-		return orgName;
-	}
-
-	public void setOrgName(String orgName) {
-		this.orgName = orgName;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.response;
+
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
+import io.swagger.annotations.ApiModelProperty;
+
+public class OuterSaveStudentResp extends BaseResponse {
+
+	private static final long serialVersionUID = 2523302124132923363L;
+
+	@ApiModelProperty(value = "学生ID", example = "100", required = true)
+	private Long studentId;
+
+	@ApiModelProperty(value = "顶级机构ID", example = "0", required = true)
+	private Long rootOrgId;
+
+	@ApiModelProperty(value = "学习中心ID", example = "1", required = true)
+	private Long orgId;
+
+	@ApiModelProperty(value = "学习中心编码", example = "LC111111", required = true)
+	private String orgName;
+
+	public Long getStudentId() {
+		return studentId;
+	}
+
+	public void setStudentId(Long studentId) {
+		this.studentId = studentId;
+	}
+
+	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 getOrgName() {
+		return orgName;
+	}
+
+	public void setOrgName(String orgName) {
+		this.orgName = orgName;
+	}
+
+}

+ 74 - 74
examcloud-exchange-outer-api/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/response/cug/SaveCugStudentAndExamStudentResp.java

@@ -1,74 +1,74 @@
-package cn.com.qmth.examcloud.exchange.outer.api.response.cug;
-
-import java.util.List;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.BaseResponse;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年11月15日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class SaveCugStudentAndExamStudentResp extends BaseResponse {
-
-	private static final long serialVersionUID = -7321764983963904493L;
-
-	@ApiModelProperty(value = "学生ID", example = "500", required = true)
-	private Long studentId;
-
-	@ApiModelProperty(value = "顶级机构ID", example = "0", required = true)
-	private Long rootOrgId;
-
-	@ApiModelProperty(value = "学习中心ID", example = "0", required = true)
-	private Long orgId;
-
-	@ApiModelProperty(value = "学习中心名称", example = "0", required = true)
-	private String orgName;
-
-	@ApiModelProperty(value = "考生ID集合", required = true)
-	private List<Long> examStudentIdList;
-
-	public Long getStudentId() {
-		return studentId;
-	}
-
-	public void setStudentId(Long studentId) {
-		this.studentId = studentId;
-	}
-
-	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 getOrgName() {
-		return orgName;
-	}
-
-	public void setOrgName(String orgName) {
-		this.orgName = orgName;
-	}
-
-	public List<Long> getExamStudentIdList() {
-		return examStudentIdList;
-	}
-
-	public void setExamStudentIdList(List<Long> examStudentIdList) {
-		this.examStudentIdList = examStudentIdList;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.api.response.cug;
+
+import java.util.List;
+
+import cn.com.qmth.examcloud.web.cloud.api.BaseResponse;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年11月15日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class SaveCugStudentAndExamStudentResp extends BaseResponse {
+
+	private static final long serialVersionUID = -7321764983963904493L;
+
+	@ApiModelProperty(value = "学生ID", example = "500", required = true)
+	private Long studentId;
+
+	@ApiModelProperty(value = "顶级机构ID", example = "0", required = true)
+	private Long rootOrgId;
+
+	@ApiModelProperty(value = "学习中心ID", example = "0", required = true)
+	private Long orgId;
+
+	@ApiModelProperty(value = "学习中心名称", example = "0", required = true)
+	private String orgName;
+
+	@ApiModelProperty(value = "考生ID集合", required = true)
+	private List<Long> examStudentIdList;
+
+	public Long getStudentId() {
+		return studentId;
+	}
+
+	public void setStudentId(Long studentId) {
+		this.studentId = studentId;
+	}
+
+	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 getOrgName() {
+		return orgName;
+	}
+
+	public void setOrgName(String orgName) {
+		this.orgName = orgName;
+	}
+
+	public List<Long> getExamStudentIdList() {
+		return examStudentIdList;
+	}
+
+	public void setExamStudentIdList(List<Long> examStudentIdList) {
+		this.examStudentIdList = examStudentIdList;
+	}
+
+}

+ 46 - 46
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/bean/Course.java

@@ -1,46 +1,46 @@
-package cn.com.qmth.examcloud.exchange.outer.service.bean;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年9月4日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class Course implements JsonSerializable {
-
-	private static final long serialVersionUID = 2064501395377152957L;
-
-	private String code;
-
-	private String name;
-
-	private String level;
-
-	public String getCode() {
-		return code;
-	}
-
-	public void setCode(String code) {
-		this.code = code;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getLevel() {
-		return level;
-	}
-
-	public void setLevel(String level) {
-		this.level = level;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.service.bean;
+
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年9月4日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class Course implements JsonSerializable {
+
+	private static final long serialVersionUID = 2064501395377152957L;
+
+	private String code;
+
+	private String name;
+
+	private String level;
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getLevel() {
+		return level;
+	}
+
+	public void setLevel(String level) {
+		this.level = level;
+	}
+
+}

+ 38 - 38
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/bean/CourseGroup.java

@@ -1,38 +1,38 @@
-package cn.com.qmth.examcloud.exchange.outer.service.bean;
-
-import java.util.List;
-
-import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年9月4日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class CourseGroup implements JsonSerializable {
-
-	private static final long serialVersionUID = -8448175294365570731L;
-
-	private String name;
-
-	private List<Course> courseList;
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public List<Course> getCourseList() {
-		return courseList;
-	}
-
-	public void setCourseList(List<Course> courseList) {
-		this.courseList = courseList;
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.service.bean;
+
+import java.util.List;
+
+import cn.com.qmth.examcloud.web.cloud.api.JsonSerializable;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年9月4日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+public class CourseGroup implements JsonSerializable {
+
+	private static final long serialVersionUID = -8448175294365570731L;
+
+	private String name;
+
+	private List<Course> courseList;
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public List<Course> getCourseList() {
+		return courseList;
+	}
+
+	public void setCourseList(List<Course> courseList) {
+		this.courseList = courseList;
+	}
+
+}

+ 5 - 5
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/CourseGroupServiceImpl.java

@@ -9,14 +9,14 @@ import org.springframework.stereotype.Service;
 import com.google.common.reflect.TypeToken;
 import com.thoughtworks.xstream.XStream;
 
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-import cn.com.qmth.examcloud.commons.base.helpers.XStreamBuilder;
-import cn.com.qmth.examcloud.commons.base.util.JsonUtil;
-import cn.com.qmth.examcloud.commons.base.util.PathUtil;
-import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.helpers.XStreamBuilder;
+import cn.com.qmth.examcloud.commons.util.JsonUtil;
+import cn.com.qmth.examcloud.commons.util.PathUtil;
 import cn.com.qmth.examcloud.exchange.outer.service.CourseGroupService;
 import cn.com.qmth.examcloud.exchange.outer.service.bean.Course;
 import cn.com.qmth.examcloud.exchange.outer.service.bean.CourseGroup;
+import cn.com.qmth.examcloud.web.redis.RedisClient;
 
 /**
  * 类注释

+ 279 - 279
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/FaceServiceImpl.java

@@ -1,279 +1,279 @@
-package cn.com.qmth.examcloud.exchange.outer.service.impl;
-
-import java.io.File;
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpStatus;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.util.EntityUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.google.common.collect.Maps;
-
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-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.util.HttpClientUtil;
-import cn.com.qmth.examcloud.commons.base.util.JsonUtil;
-import cn.com.qmth.examcloud.core.basic.api.FaceCloudService;
-import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
-import cn.com.qmth.examcloud.core.basic.api.bean.FacesetBean;
-import cn.com.qmth.examcloud.core.basic.api.bean.StudentBean;
-import cn.com.qmth.examcloud.core.basic.api.request.GetStudentReq;
-import cn.com.qmth.examcloud.core.basic.api.request.GetUsableFacesetListReq;
-import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentFaceReq;
-import cn.com.qmth.examcloud.core.basic.api.response.GetStudentResp;
-import cn.com.qmth.examcloud.core.basic.api.response.GetUsableFacesetListResp;
-import cn.com.qmth.examcloud.exchange.inner.service.UpyunService;
-import cn.com.qmth.examcloud.exchange.inner.service.bean.UpyunPathEnvironmentInfo;
-import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年9月4日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Service
-public class FaceServiceImpl implements FaceService {
-
-	protected ExamCloudLog log = ExamCloudLogFactory.getLog(this.getClass());
-
-	/**
-	 * 接口日志
-	 */
-	private static final ExamCloudLog INTERFACE_LOG = ExamCloudLogFactory
-			.getLog("INTERFACE_LOGGER");
-
-	@Autowired
-	StudentCloudService studentCloudService;
-
-	@Autowired
-	UpyunService upyunService;
-
-	@Autowired
-	FaceCloudService faceCloudService;
-
-	@Value("${$facepp.apiKey}")
-	private String apiKey;
-
-	@Value("${$facepp.apiSecret}")
-	private String apiSecret;
-
-	@Override
-	public void processFace(Long rootOrgId, String identityNumber, String fileSuffix, File file,
-			String operator) {
-
-		GetStudentReq req = new GetStudentReq();
-		req.setIdentityNumber(identityNumber);
-		req.setRootOrgId(rootOrgId);
-		GetStudentResp resp = studentCloudService.getStudent(req);
-		StudentBean student = resp.getStudentInfo();
-		identityNumber = student.getIdentityNumber();
-		Long id = student.getId();
-
-		UpyunPathEnvironmentInfo env = new UpyunPathEnvironmentInfo();
-		env.setFileSuffix(fileSuffix);
-		env.setRootOrgId(String.valueOf(rootOrgId));
-		env.setUserId(String.valueOf(id));
-
-		String photoUrl = upyunService.writeFile("studentBasePhoto", env, file);
-
-		String faceToken = detect(photoUrl);
-
-		Map<String, Object> map = addFaceToken2Faceset(rootOrgId, faceToken);
-
-		String facesetToken = (String) map.get("facesetToken");
-		Long faceCount = (Long) map.get("faceCount");
-
-		SaveStudentFaceReq request = new SaveStudentFaceReq();
-		request.setFacesetToken(facesetToken);
-		request.setFaceToken(faceToken);
-		request.setOperator(operator);
-		String photoName = photoUrl.substring(photoUrl.lastIndexOf("/") + 1);
-		request.setPhotoName(photoName);
-		request.setRootOrgId(rootOrgId);
-		request.setStudentId(student.getId());
-		request.setFaceCount(faceCount);
-
-		faceCloudService.saveStudentFace(request);
-
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param rootOrgId
-	 * @param faceToken
-	 * @return
-	 */
-	private Map<String, Object> addFaceToken2Faceset(Long rootOrgId, String faceToken) {
-
-		Map<String, Object> info = Maps.newHashMap();
-		info.put("rootOrgId", rootOrgId);
-		info.put("faceToken", faceToken);
-		int times = 0;
-		while (true) {
-			String facesetToken = getFacesetToken(rootOrgId);
-			info.put("facesetToken", facesetToken);
-
-			if (times > 5) {
-				log.error("添加faceToken至faceSet失败. info=" + JsonUtil.toJson(info));
-				return null;
-			}
-
-			CloseableHttpClient httpClient = HttpClients.createDefault();
-			CloseableHttpResponse httpResponse = null;
-			try {
-				URI uri = new URIBuilder().setScheme("https").setHost("api-cn.faceplusplus.com")
-						.setPath("/facepp/v3/faceset/addface").setParameter("api_key", apiKey)
-						.setParameter("api_secret", apiSecret)
-						.setParameter("faceset_token", facesetToken)
-						.setParameter("face_tokens", faceToken).build();
-
-				INTERFACE_LOG.info("[Face++ Rquest]. url=" + uri.toString());
-
-				HttpPost httpPost = new HttpPost(uri);
-
-				httpResponse = httpClient.execute(httpPost);
-				HttpEntity entity = httpResponse.getEntity();
-				int statusCode = httpResponse.getStatusLine().getStatusCode();
-				String respBody = EntityUtils.toString(entity, "UTF-8");
-
-				INTERFACE_LOG.info(
-						"[Face++ Response]. statusCode=" + statusCode + "; respBody=" + respBody);
-
-				if (respBody.contains("QUOTA_EXCEEDED")) {
-					throw new StatusException("EX-620006", "faceset is full");
-				}
-
-				if (statusCode == HttpStatus.SC_OK) {
-					JSONObject jsonObject = JSON.parseObject(respBody);
-					int faceAdded = jsonObject.getInteger("face_added");
-					int faceCount = jsonObject.getInteger("face_count");
-					if (1 == faceAdded) {
-						Map<String, Object> ret = Maps.newHashMap();
-						ret.put("facesetToken", facesetToken);
-						ret.put("faceCount", (long) faceCount);
-						return ret;
-					}
-				} else if (statusCode == HttpStatus.SC_FORBIDDEN) {
-					if (respBody.contains("CONCURRENCY_LIMIT_EXCEEDED")) {
-						continue;
-					}
-				}
-
-				times++;
-				continue;
-			} catch (Exception e) {
-				log.error("调用addface接口异常. info=" + JsonUtil.toJson(info), e);
-				times++;
-				continue;
-			} finally {
-				HttpClientUtil.close(httpResponse);
-			}
-		}
-
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param rootOrgId
-	 * @return
-	 */
-	private String getFacesetToken(Long rootOrgId) {
-
-		GetUsableFacesetListReq req = new GetUsableFacesetListReq();
-		req.setRootOrgId(rootOrgId);
-		GetUsableFacesetListResp resp = faceCloudService.getUsableFacesetList(req);
-		List<FacesetBean> facesetBeanList = resp.getFacesetBeanList();
-
-		if (CollectionUtils.isEmpty(facesetBeanList)) {
-			throw new StatusException("B-630001", "无可用的faceset");
-		}
-
-		FacesetBean facesetBean = facesetBeanList.get(0);
-		return facesetBean.getFacesetToken();
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param photoUrl
-	 * @return
-	 */
-	private String detect(String photoUrl) {
-		int times = 0;
-		String faceToken = null;
-		while (true) {
-			if (times > 5) {
-				throw new StatusException("EX-620005", "人脸检测失败");
-			}
-			CloseableHttpClient httpClient = HttpClients.createDefault();
-			CloseableHttpResponse httpResponse = null;
-			try {
-				URI uri = new URIBuilder().setScheme("https").setHost("api-cn.faceplusplus.com")
-						.setPath("/facepp/v3/detect").setParameter("api_key", apiKey)
-						.setParameter("api_secret", apiSecret).setParameter("image_url", photoUrl)
-						.build();
-
-				INTERFACE_LOG.info("[Face++ Rquest]. url=" + uri.toString());
-
-				HttpPost httpPost = new HttpPost(uri);
-
-				httpResponse = httpClient.execute(httpPost);
-				HttpEntity entity = httpResponse.getEntity();
-				int statusCode = httpResponse.getStatusLine().getStatusCode();
-				String respBody = EntityUtils.toString(entity, "UTF-8");
-
-				INTERFACE_LOG.info(
-						"[Face++ Response]. statusCode=" + statusCode + "; respBody=" + respBody);
-
-				if (statusCode == HttpStatus.SC_OK) {
-					JSONObject jsonObject = JSON.parseObject(respBody);
-					JSONArray faces = jsonObject.getJSONArray("faces");
-					if (1 != faces.size()) {
-						throw new StatusException("EX-620009", "检测到多张人脸. photoUrl=" + photoUrl);
-					}
-
-					JSONObject face = faces.getJSONObject(0);
-					faceToken = face.getString("face_token");
-					return faceToken;
-				} else if (statusCode == HttpStatus.SC_FORBIDDEN) {
-					if (respBody.contains("CONCURRENCY_LIMIT_EXCEEDED")) {
-						continue;
-					}
-				}
-
-				times++;
-				continue;
-			} catch (Exception e) {
-				log.error("调用detect接口异常. photoUrl=" + photoUrl, e);
-				times++;
-				continue;
-			} finally {
-				HttpClientUtil.close(httpResponse);
-			}
-		}
-
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.outer.service.impl;
+
+import java.io.File;
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.google.common.collect.Maps;
+
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
+import cn.com.qmth.examcloud.commons.util.HttpClientUtil;
+import cn.com.qmth.examcloud.commons.util.JsonUtil;
+import cn.com.qmth.examcloud.core.basic.api.FaceCloudService;
+import cn.com.qmth.examcloud.core.basic.api.StudentCloudService;
+import cn.com.qmth.examcloud.core.basic.api.bean.FacesetBean;
+import cn.com.qmth.examcloud.core.basic.api.bean.StudentBean;
+import cn.com.qmth.examcloud.core.basic.api.request.GetStudentReq;
+import cn.com.qmth.examcloud.core.basic.api.request.GetUsableFacesetListReq;
+import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentFaceReq;
+import cn.com.qmth.examcloud.core.basic.api.response.GetStudentResp;
+import cn.com.qmth.examcloud.core.basic.api.response.GetUsableFacesetListResp;
+import cn.com.qmth.examcloud.exchange.inner.service.UpyunService;
+import cn.com.qmth.examcloud.exchange.inner.service.bean.UpyunPathEnvironmentInfo;
+import cn.com.qmth.examcloud.exchange.outer.service.FaceService;
+
+/**
+ * 类注释
+ *
+ * @author WANGWEI
+ * @date 2018年9月4日
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+ */
+@Service
+public class FaceServiceImpl implements FaceService {
+
+	protected ExamCloudLog log = ExamCloudLogFactory.getLog(this.getClass());
+
+	/**
+	 * 接口日志
+	 */
+	private static final ExamCloudLog INTERFACE_LOG = ExamCloudLogFactory
+			.getLog("INTERFACE_LOGGER");
+
+	@Autowired
+	StudentCloudService studentCloudService;
+
+	@Autowired
+	UpyunService upyunService;
+
+	@Autowired
+	FaceCloudService faceCloudService;
+
+	@Value("${$facepp.apiKey}")
+	private String apiKey;
+
+	@Value("${$facepp.apiSecret}")
+	private String apiSecret;
+
+	@Override
+	public void processFace(Long rootOrgId, String identityNumber, String fileSuffix, File file,
+			String operator) {
+
+		GetStudentReq req = new GetStudentReq();
+		req.setIdentityNumber(identityNumber);
+		req.setRootOrgId(rootOrgId);
+		GetStudentResp resp = studentCloudService.getStudent(req);
+		StudentBean student = resp.getStudentInfo();
+		identityNumber = student.getIdentityNumber();
+		Long id = student.getId();
+
+		UpyunPathEnvironmentInfo env = new UpyunPathEnvironmentInfo();
+		env.setFileSuffix(fileSuffix);
+		env.setRootOrgId(String.valueOf(rootOrgId));
+		env.setUserId(String.valueOf(id));
+
+		String photoUrl = upyunService.writeFile("studentBasePhoto", env, file);
+
+		String faceToken = detect(photoUrl);
+
+		Map<String, Object> map = addFaceToken2Faceset(rootOrgId, faceToken);
+
+		String facesetToken = (String) map.get("facesetToken");
+		Long faceCount = (Long) map.get("faceCount");
+
+		SaveStudentFaceReq request = new SaveStudentFaceReq();
+		request.setFacesetToken(facesetToken);
+		request.setFaceToken(faceToken);
+		request.setOperator(operator);
+		String photoName = photoUrl.substring(photoUrl.lastIndexOf("/") + 1);
+		request.setPhotoName(photoName);
+		request.setRootOrgId(rootOrgId);
+		request.setStudentId(student.getId());
+		request.setFaceCount(faceCount);
+
+		faceCloudService.saveStudentFace(request);
+
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param rootOrgId
+	 * @param faceToken
+	 * @return
+	 */
+	private Map<String, Object> addFaceToken2Faceset(Long rootOrgId, String faceToken) {
+
+		Map<String, Object> info = Maps.newHashMap();
+		info.put("rootOrgId", rootOrgId);
+		info.put("faceToken", faceToken);
+		int times = 0;
+		while (true) {
+			String facesetToken = getFacesetToken(rootOrgId);
+			info.put("facesetToken", facesetToken);
+
+			if (times > 5) {
+				log.error("添加faceToken至faceSet失败. info=" + JsonUtil.toJson(info));
+				return null;
+			}
+
+			CloseableHttpClient httpClient = HttpClients.createDefault();
+			CloseableHttpResponse httpResponse = null;
+			try {
+				URI uri = new URIBuilder().setScheme("https").setHost("api-cn.faceplusplus.com")
+						.setPath("/facepp/v3/faceset/addface").setParameter("api_key", apiKey)
+						.setParameter("api_secret", apiSecret)
+						.setParameter("faceset_token", facesetToken)
+						.setParameter("face_tokens", faceToken).build();
+
+				INTERFACE_LOG.info("[Face++ Rquest]. url=" + uri.toString());
+
+				HttpPost httpPost = new HttpPost(uri);
+
+				httpResponse = httpClient.execute(httpPost);
+				HttpEntity entity = httpResponse.getEntity();
+				int statusCode = httpResponse.getStatusLine().getStatusCode();
+				String respBody = EntityUtils.toString(entity, "UTF-8");
+
+				INTERFACE_LOG.info(
+						"[Face++ Response]. statusCode=" + statusCode + "; respBody=" + respBody);
+
+				if (respBody.contains("QUOTA_EXCEEDED")) {
+					throw new StatusException("EX-620006", "faceset is full");
+				}
+
+				if (statusCode == HttpStatus.SC_OK) {
+					JSONObject jsonObject = JSON.parseObject(respBody);
+					int faceAdded = jsonObject.getInteger("face_added");
+					int faceCount = jsonObject.getInteger("face_count");
+					if (1 == faceAdded) {
+						Map<String, Object> ret = Maps.newHashMap();
+						ret.put("facesetToken", facesetToken);
+						ret.put("faceCount", (long) faceCount);
+						return ret;
+					}
+				} else if (statusCode == HttpStatus.SC_FORBIDDEN) {
+					if (respBody.contains("CONCURRENCY_LIMIT_EXCEEDED")) {
+						continue;
+					}
+				}
+
+				times++;
+				continue;
+			} catch (Exception e) {
+				log.error("调用addface接口异常. info=" + JsonUtil.toJson(info), e);
+				times++;
+				continue;
+			} finally {
+				HttpClientUtil.close(httpResponse);
+			}
+		}
+
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param rootOrgId
+	 * @return
+	 */
+	private String getFacesetToken(Long rootOrgId) {
+
+		GetUsableFacesetListReq req = new GetUsableFacesetListReq();
+		req.setRootOrgId(rootOrgId);
+		GetUsableFacesetListResp resp = faceCloudService.getUsableFacesetList(req);
+		List<FacesetBean> facesetBeanList = resp.getFacesetBeanList();
+
+		if (CollectionUtils.isEmpty(facesetBeanList)) {
+			throw new StatusException("B-630001", "无可用的faceset");
+		}
+
+		FacesetBean facesetBean = facesetBeanList.get(0);
+		return facesetBean.getFacesetToken();
+	}
+
+	/**
+	 * 方法注释
+	 *
+	 * @author WANGWEI
+	 * @param photoUrl
+	 * @return
+	 */
+	private String detect(String photoUrl) {
+		int times = 0;
+		String faceToken = null;
+		while (true) {
+			if (times > 5) {
+				throw new StatusException("EX-620005", "人脸检测失败");
+			}
+			CloseableHttpClient httpClient = HttpClients.createDefault();
+			CloseableHttpResponse httpResponse = null;
+			try {
+				URI uri = new URIBuilder().setScheme("https").setHost("api-cn.faceplusplus.com")
+						.setPath("/facepp/v3/detect").setParameter("api_key", apiKey)
+						.setParameter("api_secret", apiSecret).setParameter("image_url", photoUrl)
+						.build();
+
+				INTERFACE_LOG.info("[Face++ Rquest]. url=" + uri.toString());
+
+				HttpPost httpPost = new HttpPost(uri);
+
+				httpResponse = httpClient.execute(httpPost);
+				HttpEntity entity = httpResponse.getEntity();
+				int statusCode = httpResponse.getStatusLine().getStatusCode();
+				String respBody = EntityUtils.toString(entity, "UTF-8");
+
+				INTERFACE_LOG.info(
+						"[Face++ Response]. statusCode=" + statusCode + "; respBody=" + respBody);
+
+				if (statusCode == HttpStatus.SC_OK) {
+					JSONObject jsonObject = JSON.parseObject(respBody);
+					JSONArray faces = jsonObject.getJSONArray("faces");
+					if (1 != faces.size()) {
+						throw new StatusException("EX-620009", "检测到多张人脸. photoUrl=" + photoUrl);
+					}
+
+					JSONObject face = faces.getJSONObject(0);
+					faceToken = face.getString("face_token");
+					return faceToken;
+				} else if (statusCode == HttpStatus.SC_FORBIDDEN) {
+					if (respBody.contains("CONCURRENCY_LIMIT_EXCEEDED")) {
+						continue;
+					}
+				}
+
+				times++;
+				continue;
+			} catch (Exception e) {
+				log.error("调用detect接口异常. photoUrl=" + photoUrl, e);
+				times++;
+				continue;
+			} finally {
+				HttpClientUtil.close(httpResponse);
+			}
+		}
+
+	}
+
+}

+ 386 - 386
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/OutletScoreServiceImpl.java

@@ -1,386 +1,386 @@
-package cn.com.qmth.examcloud.exchange.outer.service.impl;
-
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-
-
-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.util.DateUtil;
-import cn.com.qmth.examcloud.commons.base.util.DateUtil.DatePatterns;
-import cn.com.qmth.examcloud.core.oe.admin.api.ExamRecordCloudService;
-import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreCloudService;
-import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreDataCloudService;
-import cn.com.qmth.examcloud.core.oe.admin.api.OeExamStudentCloudService;
-import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamRecordForSelectScore;
-import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamScoreBean;
-import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamScoreDataBean;
-import cn.com.qmth.examcloud.core.oe.admin.api.bean.OeExamStudentBean;
-import cn.com.qmth.examcloud.core.oe.admin.api.bean.FindStudentBean;
-import cn.com.qmth.examcloud.core.oe.admin.api.bean.FindStudentType;
-import cn.com.qmth.examcloud.core.oe.admin.api.request.FindExamScoreDataReq;
-import cn.com.qmth.examcloud.core.oe.admin.api.request.FindExamStudentInfoReq;
-import cn.com.qmth.examcloud.core.oe.admin.api.request.QueryExamRecordForSelectScoreReq;
-import cn.com.qmth.examcloud.core.oe.admin.api.request.QueryExamScoreReq;
-import cn.com.qmth.examcloud.core.oe.admin.api.response.FindExamScoreDataResp;
-import cn.com.qmth.examcloud.core.oe.admin.api.response.FindExamStudentInfoResp;
-import cn.com.qmth.examcloud.core.oe.admin.api.response.QueryExamRecordForSelectScoreResp;
-import cn.com.qmth.examcloud.core.oe.admin.api.response.QueryExamScoreResp;
-import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
-import cn.com.qmth.examcloud.examwork.api.request.GetExamPropertyReq;
-import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
-import cn.com.qmth.examcloud.examwork.api.response.GetExamPropertyResp;
-import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
-import cn.com.qmth.examcloud.exchange.base.enums.ExamRecordStatus;
-import cn.com.qmth.examcloud.exchange.base.enums.MarkingType;
-import cn.com.qmth.examcloud.exchange.outer.service.OutletScoreService;
-import cn.com.qmth.examcloud.exchange.outer.service.bean.OutletScore;
-
-/**
- * @author  	chenken
- * @date    	2018年1月3日 下午3:39:23
- * @company 	QMTH
- * @description OutletScoreServiceImpl.java
- */
-@Service("outletScoreService")
-public class OutletScoreServiceImpl implements OutletScoreService{
-
-	@Autowired
-	private ExamCloudService examCloudService;
-	
-	@Autowired
-	private ExamScoreCloudService examScoreCloudService;
-	
-	@Autowired
-	private ExamRecordCloudService examRecordCloudService;
-	
-	@Autowired
-	private OeExamStudentCloudService oeExamStudentCloudService;
-	
-	@Autowired
-	private ExamScoreDataCloudService examScoreDataCloudService;
-	
-	/**
-	 * examStuRemark不再使用  2018-10-15 chenken
-	 */
-	@Override
-	public List<OutletScore> queryExamScore(String examName, String examStuRemark,Long rootOrgId) throws Exception {
-		if(StringUtils.isBlank(examName) || rootOrgId == null){
-			return null;
-		}
-		
-		GetExamReq getExamReq = new GetExamReq();
-		getExamReq.setName(examName);
-		getExamReq.setRootOrgId(rootOrgId);
-		GetExamResp getExamResp = examCloudService.getExam(getExamReq);
-		Long examId = getExamResp.getId();
-		
-		FindExamStudentInfoReq req = new FindExamStudentInfoReq();
-		req.setFindStudentType(FindStudentType.BY_EXAMID);
-		FindStudentBean findStudentBean = new FindStudentBean();
-		findStudentBean.setExamId(examId);
-		req.setFindStudentBean(findStudentBean);
-		
-		FindExamStudentInfoResp findExamStudentInfoResp = oeExamStudentCloudService.findExamStudentInfoBy(req);
-		List<OeExamStudentBean> examStudentBeans = findExamStudentInfoResp.getExamStudents();
-		//List<ExamStudent> examStudents = outletScoreDao.findExamStudents(examId);
-		return getExamStudentsScore(examStudentBeans);
-	}
-
-	@Override
-	public List<OutletScore> queryExamScoreByIdentityNumbers(List<String> identityNumbers, Long rootOrgId) throws Exception {
-		if(identityNumbers==null||identityNumbers.size()==0||rootOrgId == null){
-			return null;
-		}
-		
-		FindExamStudentInfoReq req = new FindExamStudentInfoReq();
-		req.setFindStudentType(FindStudentType.BY_IDENTITYNUMBERS_AND_ROOTORGID);
-		FindStudentBean findStudentBean = new FindStudentBean();
-		findStudentBean.setRootOrgId(rootOrgId);
-		findStudentBean.setIdentityNumbers(identityNumbers);
-		req.setFindStudentBean(findStudentBean);
-		
-		FindExamStudentInfoResp findExamStudentInfoResp = oeExamStudentCloudService.findExamStudentInfoBy(req);
-		List<OeExamStudentBean> examStudentBeans = findExamStudentInfoResp.getExamStudents();
-		//List<ExamStudent> examStudents = outletScoreDao.findExamStudents(identityNumbers,examOrgId);
-		return getExamStudentsScore(examStudentBeans);
-	}
-	
-	@Override
-	public List<OutletScore> queryExamScoreBy(Long rootOrgId,String examName,String courseCode, List<String> studentCodes) throws Exception {
-		GetExamReq getExamReq = new GetExamReq();
-		getExamReq.setName(examName);
-		getExamReq.setRootOrgId(rootOrgId);
-		GetExamResp getExamResp = examCloudService.getExam(getExamReq);
-		Long examId = getExamResp.getId();
-		
-		FindExamStudentInfoReq req = new FindExamStudentInfoReq();
-		req.setFindStudentType(FindStudentType.BY_EXAMID_AND_STUDENTCODES);
-		FindStudentBean findStudentBean = new FindStudentBean();
-		findStudentBean.setExamId(examId);
-		findStudentBean.setStudentCodes(studentCodes);
-		req.setFindStudentBean(findStudentBean);
-		
-		FindExamStudentInfoResp findExamStudentInfoResp = oeExamStudentCloudService.findExamStudentInfoBy(req);
-		List<OeExamStudentBean> examStudentBeans = findExamStudentInfoResp.getExamStudents();
-		examStudentBeans = examStudentBeans.stream().filter(o->{
-			return o.getCourseCode().indexOf(courseCode)>-1;
-		}).collect(Collectors.toList());
-		//List<ExamStudent> examStudents = outletScoreDao.findExamStudents(examId,courseCode,studentCodes);
-		return getExamStudentsScore(examStudentBeans);
-	}
-	
-	private List<OutletScore> getExamStudentsScore(List<OeExamStudentBean> examStudents) throws Exception{
-		if(examStudents == null){
-			return null;
-		}
-		List<OutletScore> outletScoreList = new ArrayList<OutletScore>();
-		
-		for(OeExamStudentBean examStudent:examStudents){
-			OutletScore outletScore = new OutletScore(examStudent);
-			outletScore = findExamData(outletScore,examStudent);
-			
-			GetExamReq getExamReq = new GetExamReq();
-			getExamReq.setId(outletScore.getExamId());
-			GetExamResp getExamResp = examCloudService.getExam(getExamReq);
-			outletScore.setExamName(getExamResp.getExamBean().getName());
-			
-			outletScoreList.add(outletScore);
-		}
-		return outletScoreList;
-	}
-	
-	private OutletScore findExamData(OutletScore outletScore,OeExamStudentBean examStudent) throws Exception{
-		QueryExamRecordForSelectScoreReq req = new QueryExamRecordForSelectScoreReq();
-		req.setExamStudentId(examStudent.getExamStudentId());
-		QueryExamRecordForSelectScoreResp resp = examRecordCloudService.queryExamRecordForSelectScoreByExamStudentId(req);
-		List<ExamRecordForSelectScore> examRecordList = resp.getExamRecordForSelectScoreList();
-        //List<ExamRecord> examRecordList = examRecordDao.findByExamStudentId(examStudent.getId());
-        Boolean isFinished = examStudent.getFinished();
-        if(isFinished == null){
-        	isFinished = false;
-        }
-        //是否缺考
-        outletScore.setIsMissExam(!isFinished);
-        //是否违纪
-        outletScore.setIsBreachThePrinciple(isBreachThePrinciple(isFinished,examRecordList));
-        //最终成绩
-        GetExamPropertyReq getExamPropertyReq = new GetExamPropertyReq();
-        getExamPropertyReq.setExamId(outletScore.getExamId());
-        getExamPropertyReq.setKey("MARKING_TYPE");
-        GetExamPropertyResp getExamPropertyResp = examCloudService.getExamProperty(getExamPropertyReq);
-        String markingType = getExamPropertyResp.getValue();
-        setFinalExamScoreAndEndTime(isFinished,outletScore,examRecordList,markingType);
-        return outletScore;
-    }
-	
-	/**
-	 * 1.设置最终成绩
-	 * 2.设置考试结束时间
-	 */
-	public void setFinalExamScoreAndEndTime(Boolean isFinished,OutletScore outletScore,List<ExamRecordForSelectScore> examRecordList,String markingType){
-		if(!isFinished || examRecordList == null || examRecordList.size() == 0){
-			return;
-		}
-		ExamScoreBean examScore = finalExamScore(examRecordList,markingType);
-    	if(examScore != null){
-    		outletScore.setScoreId(examScore.getId());
-            outletScore.setTotalScore(examScore.getTotalScore());
-            outletScore.setObjectiveScore(examScore.getObjectiveScore());
-            outletScore.setSubjectiveScore(examScore.getSubjectiveScore());
-            //设置考试结束时间和人脸识别成功率
-            QueryExamRecordForSelectScoreReq req = new QueryExamRecordForSelectScoreReq();
-    		req.setExamScoreId(examScore.getId());
-    		QueryExamRecordForSelectScoreResp resp = examRecordCloudService.queryExamRecordForSelectScoreByScoreId(req);
-    		List<ExamRecordForSelectScore> examRecordForSelectScoreList = resp.getExamRecordForSelectScoreList();
-            
-    		ExamRecordForSelectScore examRecord = examRecordForSelectScoreList.get(0);
-            if(examRecord != null){
-            	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            	Date endTime =  examRecord.getEndTime();
-                if(endTime == null){
-                	endTime = examRecord.getCleanTime();
-                }
-                outletScore.setEndTime(endTime == null?null:sdf.format(endTime));
-            }
-    	}
-	}
-
-	/**
-	 * 查询并计算最终成绩
-	 * @param isFinished
-	 * @param examRecordList
-	 * @param markingType
-	 */
-	private ExamScoreBean finalExamScore(List<ExamRecordForSelectScore> examRecordAllList,String markingType) {
-    	//第一次过滤考试记录:正常结束或者被系统处理的
-    	List<ExamRecordForSelectScore> firstFilterExamRecordList = examRecordAllList.stream().filter(examRecord->{
-    		return  examRecord.getStatus().equals(ExamRecordStatus.EXAM_END.name())|| 
-    				examRecord.getStatus().equals(ExamRecordStatus.EXAM_OVERDUE.name());
-    	}).collect(Collectors.toList());
-    	
-        if (firstFilterExamRecordList != null && firstFilterExamRecordList.size()>0) {
-        	/**
-        	 * 第二次过滤考试记录:过滤出有效的考试记录 
-        	 * 1.没有违纪的
-        	 * 2.没有警告的或有警告已审核通过的
-        	 */
-            Stream<ExamRecordForSelectScore> secondFilterExamRecordStream = firstFilterExamRecordList.stream().filter(examRecord -> {
-                return !examRecord.getIsIllegality() &&
-                		(!examRecord.getIsWarn() || (examRecord.getIsWarn() && examRecord.getIsAudit()));
-            });
-            
-            List<ExamRecordForSelectScore> secondFilterExamRecords = secondFilterExamRecordStream.collect(Collectors.toList());
-            if(secondFilterExamRecords == null|| secondFilterExamRecords.size() == 0){
-            	return null;
-            }
-            //取出有效记录的成绩
-            List<Long> examRecordIds = new ArrayList<Long>();
-            for(int i = 0;i<secondFilterExamRecords.size();i++){
-            	examRecordIds.add(secondFilterExamRecords.get(i).getExamRecordDataId());
-            }
-            
-            QueryExamScoreReq queryExamScoreReq = new QueryExamScoreReq();
-            queryExamScoreReq.setExamRecordDataIds(examRecordIds);
-            QueryExamScoreResp resp = examScoreCloudService.queryExamScore(queryExamScoreReq);
-            
-            List<ExamScoreBean> effectiveExamScoreList = resp.getExamScoreBeans();
-            
-            //List<ExamScore> effectiveExamScoreList = examScoreDao.findByExamRecordIdIn(examRecordIds);
-            
-            //全部评阅规则或客观分最高规则:取总分最高
-            if(markingType.equals(MarkingType.ALL.name())||markingType.equals(MarkingType.OBJECT_SCORE_MAX.name())){
-				List<ExamScoreBean> examScores = effectiveExamScoreList
-											.stream()
-											.sorted((o1,o2)->o2.getTotalScore().compareTo(o1.getTotalScore()))
-											.collect(Collectors.toList());
-				return examScores.get(0);
-            }else if(markingType.equals(MarkingType.LAST_SUBMIT.name())){
-            	//最后一次提交规则:取最后一次的成绩
-            	List<ExamScoreBean> examScores = effectiveExamScoreList
-											.stream()
-											.sorted((o1,o2)->o2.getId().compareTo(o1.getId()))
-											.collect(Collectors.toList());
-				return examScores.get(0);
-			}else if(StringUtils.isBlank(markingType)){
-				//离线考试
-				if(effectiveExamScoreList != null&& effectiveExamScoreList.size()>0){
-					return effectiveExamScoreList.get(0);
-				}
-			}
-        }
-        return null;
-	}
-
-	/**
-	 * 是否违纪
-	 * @param isFinished
-	 * @param examRecordList
-	 * @return
-	 */
-	private Boolean isBreachThePrinciple(Boolean isFinished,List<ExamRecordForSelectScore> examRecordList) {
-		if(!isFinished){
-    		return null;
-    	}
-		if(examRecordList==null || examRecordList.size()==0){
-			return false;
-		}
-    	List<ExamRecordForSelectScore> examRecordFilterList = examRecordList.stream().filter(examRecord -> {
-    		return  examRecord.getIsIllegality();
-    	}).collect(Collectors.toList());
-        return (examRecordFilterList == null || examRecordFilterList.size()==0)?false:true;
-	}
-
-	@Override
-	public List<OutletScore> queryExamScoreByExamNameAndIdentityNumbers(String examName, List<String> identityNumbers, Long rootOrgId)
-			throws Exception {
-		if(StringUtils.isBlank(examName)){
-			return null;
-		}
-		if(identityNumbers==null||identityNumbers.size()==0||rootOrgId == null){
-			return null;
-		}
-		GetExamReq getExamReq = new GetExamReq();
-		getExamReq.setName(examName);
-		getExamReq.setRootOrgId(rootOrgId);
-		GetExamResp getExamResp = examCloudService.getExam(getExamReq);
-		Long examId = getExamResp.getId();
-		
-		FindExamStudentInfoReq req = new FindExamStudentInfoReq();
-		req.setFindStudentType(FindStudentType.BY_EXAMID_AND_IDENTITYNUMBERS);
-		FindStudentBean findStudentBean = new FindStudentBean();
-		findStudentBean.setExamId(examId);
-		findStudentBean.setIdentityNumbers(identityNumbers);
-		req.setFindStudentBean(findStudentBean);
-		
-		FindExamStudentInfoResp findExamStudentInfoResp = oeExamStudentCloudService.findExamStudentInfoBy(req);
-		List<OeExamStudentBean> examStudentBeans = findExamStudentInfoResp.getExamStudents();
-		
-		
-		//List<ExamStudent> examStudents = outletScoreDao.findExamStudents(examId,identityNumbers);
-		return getExamStudentsScore(examStudentBeans);
-	}
-
-	@Override
-	public List<OutletScore> queryExamScoreBy(Long rootOrgId, String examName,String studentCode, String courseCode) throws Exception {
-		if(rootOrgId == null || examName == null || studentCode == null || courseCode == null){
-			return null;
-		}
-		
-		GetExamReq getExamReq = new GetExamReq();
-		getExamReq.setName(examName);
-		getExamReq.setRootOrgId(rootOrgId);
-		GetExamResp getExamResp = examCloudService.getExam(getExamReq);
-		Long examId = getExamResp.getId();
-		
-		FindExamScoreDataReq findExamScoreDataReq = new FindExamScoreDataReq();
-		findExamScoreDataReq.setExamId(examId);
-		findExamScoreDataReq.setStudentCode(studentCode);
-		FindExamScoreDataResp findExamScoreDataResp = examScoreDataCloudService.findExamScoreDataByExamIdAndStudentCode(findExamScoreDataReq);
-		List<ExamScoreDataBean> examScoreDataList = findExamScoreDataResp.getExamScoreDatas();
-		if(examScoreDataList == null || examScoreDataList.size() == 0){
-			return null;
-		}
-		examScoreDataList = examScoreDataList.stream().filter(o->{
-			return o.getCourseCode().indexOf(courseCode)>-1;
-		}).collect(Collectors.toList());
-		
-		List<OutletScore> outletScoreList = new ArrayList<OutletScore>();		
-		for(ExamScoreDataBean examScoreData:examScoreDataList){
-			OutletScore outletScore = new OutletScore();
-			
-			outletScore.setExamName(examName);
-			outletScore.setCourseCode(courseCode);
-			outletScore.setCourseName(examScoreData.getCourseName());
-			
-			outletScore.setStudentCode(examScoreData.getStudentCode());
-			outletScore.setStudentName(examScoreData.getStudentName());
-			outletScore.setIdentityNumber(examScoreData.getIdentityNumber());
-			outletScore.setTotalScore(examScoreData.getTotalScore());
-			outletScore.setObjectiveScore(examScoreData.getObjectiveScore());
-			outletScore.setSubjectiveScore(examScoreData.getSubjectiveScore());
-			
-			String startTime = DateUtil.format(examScoreData.getStartTime(),DatePatterns.ISO);
-			outletScore.setStartTime(startTime);
-			if(examScoreData.getEndTime()!=null){
-				String endTime = DateUtil.format(examScoreData.getEndTime(),DatePatterns.ISO);
-				outletScore.setEndTime(endTime);
-			}
-			outletScore.setSuccessRate(examScoreData.getSuccPercent());
-			outletScore.setIsBreachThePrinciple(examScoreData.getIsIllegality());
-			outletScore.setScoreId(examScoreData.getScoreId());
-			outletScoreList.add(outletScore);
-		}
-		//return outletScoreDao.queryExamScoreBy(rootOrgId, examId, studentCode, courseCode);
-		return outletScoreList;
-	}
-
-}
-
+package cn.com.qmth.examcloud.exchange.outer.service.impl;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import cn.com.qmth.examcloud.commons.util.DateUtil;
+import cn.com.qmth.examcloud.commons.util.DateUtil.DatePatterns;
+import cn.com.qmth.examcloud.core.oe.admin.api.ExamRecordCloudService;
+import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreCloudService;
+import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreDataCloudService;
+import cn.com.qmth.examcloud.core.oe.admin.api.OeExamStudentCloudService;
+import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamRecordForSelectScore;
+import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamScoreBean;
+import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamScoreDataBean;
+import cn.com.qmth.examcloud.core.oe.admin.api.bean.OeExamStudentBean;
+import cn.com.qmth.examcloud.core.oe.admin.api.bean.FindStudentBean;
+import cn.com.qmth.examcloud.core.oe.admin.api.bean.FindStudentType;
+import cn.com.qmth.examcloud.core.oe.admin.api.request.FindExamScoreDataReq;
+import cn.com.qmth.examcloud.core.oe.admin.api.request.FindExamStudentInfoReq;
+import cn.com.qmth.examcloud.core.oe.admin.api.request.QueryExamRecordForSelectScoreReq;
+import cn.com.qmth.examcloud.core.oe.admin.api.request.QueryExamScoreReq;
+import cn.com.qmth.examcloud.core.oe.admin.api.response.FindExamScoreDataResp;
+import cn.com.qmth.examcloud.core.oe.admin.api.response.FindExamStudentInfoResp;
+import cn.com.qmth.examcloud.core.oe.admin.api.response.QueryExamRecordForSelectScoreResp;
+import cn.com.qmth.examcloud.core.oe.admin.api.response.QueryExamScoreResp;
+import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
+import cn.com.qmth.examcloud.examwork.api.request.GetExamPropertyReq;
+import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamPropertyResp;
+import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
+import cn.com.qmth.examcloud.exchange.base.enums.ExamRecordStatus;
+import cn.com.qmth.examcloud.exchange.base.enums.MarkingType;
+import cn.com.qmth.examcloud.exchange.outer.service.OutletScoreService;
+import cn.com.qmth.examcloud.exchange.outer.service.bean.OutletScore;
+
+/**
+ * @author  	chenken
+ * @date    	2018年1月3日 下午3:39:23
+ * @company 	QMTH
+ * @description OutletScoreServiceImpl.java
+ */
+@Service("outletScoreService")
+public class OutletScoreServiceImpl implements OutletScoreService{
+
+	@Autowired
+	private ExamCloudService examCloudService;
+	
+	@Autowired
+	private ExamScoreCloudService examScoreCloudService;
+	
+	@Autowired
+	private ExamRecordCloudService examRecordCloudService;
+	
+	@Autowired
+	private OeExamStudentCloudService oeExamStudentCloudService;
+	
+	@Autowired
+	private ExamScoreDataCloudService examScoreDataCloudService;
+	
+	/**
+	 * examStuRemark不再使用  2018-10-15 chenken
+	 */
+	@Override
+	public List<OutletScore> queryExamScore(String examName, String examStuRemark,Long rootOrgId) throws Exception {
+		if(StringUtils.isBlank(examName) || rootOrgId == null){
+			return null;
+		}
+		
+		GetExamReq getExamReq = new GetExamReq();
+		getExamReq.setName(examName);
+		getExamReq.setRootOrgId(rootOrgId);
+		GetExamResp getExamResp = examCloudService.getExam(getExamReq);
+		Long examId = getExamResp.getId();
+		
+		FindExamStudentInfoReq req = new FindExamStudentInfoReq();
+		req.setFindStudentType(FindStudentType.BY_EXAMID);
+		FindStudentBean findStudentBean = new FindStudentBean();
+		findStudentBean.setExamId(examId);
+		req.setFindStudentBean(findStudentBean);
+		
+		FindExamStudentInfoResp findExamStudentInfoResp = oeExamStudentCloudService.findExamStudentInfoBy(req);
+		List<OeExamStudentBean> examStudentBeans = findExamStudentInfoResp.getExamStudents();
+		//List<ExamStudent> examStudents = outletScoreDao.findExamStudents(examId);
+		return getExamStudentsScore(examStudentBeans);
+	}
+
+	@Override
+	public List<OutletScore> queryExamScoreByIdentityNumbers(List<String> identityNumbers, Long rootOrgId) throws Exception {
+		if(identityNumbers==null||identityNumbers.size()==0||rootOrgId == null){
+			return null;
+		}
+		
+		FindExamStudentInfoReq req = new FindExamStudentInfoReq();
+		req.setFindStudentType(FindStudentType.BY_IDENTITYNUMBERS_AND_ROOTORGID);
+		FindStudentBean findStudentBean = new FindStudentBean();
+		findStudentBean.setRootOrgId(rootOrgId);
+		findStudentBean.setIdentityNumbers(identityNumbers);
+		req.setFindStudentBean(findStudentBean);
+		
+		FindExamStudentInfoResp findExamStudentInfoResp = oeExamStudentCloudService.findExamStudentInfoBy(req);
+		List<OeExamStudentBean> examStudentBeans = findExamStudentInfoResp.getExamStudents();
+		//List<ExamStudent> examStudents = outletScoreDao.findExamStudents(identityNumbers,examOrgId);
+		return getExamStudentsScore(examStudentBeans);
+	}
+	
+	@Override
+	public List<OutletScore> queryExamScoreBy(Long rootOrgId,String examName,String courseCode, List<String> studentCodes) throws Exception {
+		GetExamReq getExamReq = new GetExamReq();
+		getExamReq.setName(examName);
+		getExamReq.setRootOrgId(rootOrgId);
+		GetExamResp getExamResp = examCloudService.getExam(getExamReq);
+		Long examId = getExamResp.getId();
+		
+		FindExamStudentInfoReq req = new FindExamStudentInfoReq();
+		req.setFindStudentType(FindStudentType.BY_EXAMID_AND_STUDENTCODES);
+		FindStudentBean findStudentBean = new FindStudentBean();
+		findStudentBean.setExamId(examId);
+		findStudentBean.setStudentCodes(studentCodes);
+		req.setFindStudentBean(findStudentBean);
+		
+		FindExamStudentInfoResp findExamStudentInfoResp = oeExamStudentCloudService.findExamStudentInfoBy(req);
+		List<OeExamStudentBean> examStudentBeans = findExamStudentInfoResp.getExamStudents();
+		examStudentBeans = examStudentBeans.stream().filter(o->{
+			return o.getCourseCode().indexOf(courseCode)>-1;
+		}).collect(Collectors.toList());
+		//List<ExamStudent> examStudents = outletScoreDao.findExamStudents(examId,courseCode,studentCodes);
+		return getExamStudentsScore(examStudentBeans);
+	}
+	
+	private List<OutletScore> getExamStudentsScore(List<OeExamStudentBean> examStudents) throws Exception{
+		if(examStudents == null){
+			return null;
+		}
+		List<OutletScore> outletScoreList = new ArrayList<OutletScore>();
+		
+		for(OeExamStudentBean examStudent:examStudents){
+			OutletScore outletScore = new OutletScore(examStudent);
+			outletScore = findExamData(outletScore,examStudent);
+			
+			GetExamReq getExamReq = new GetExamReq();
+			getExamReq.setId(outletScore.getExamId());
+			GetExamResp getExamResp = examCloudService.getExam(getExamReq);
+			outletScore.setExamName(getExamResp.getExamBean().getName());
+			
+			outletScoreList.add(outletScore);
+		}
+		return outletScoreList;
+	}
+	
+	private OutletScore findExamData(OutletScore outletScore,OeExamStudentBean examStudent) throws Exception{
+		QueryExamRecordForSelectScoreReq req = new QueryExamRecordForSelectScoreReq();
+		req.setExamStudentId(examStudent.getExamStudentId());
+		QueryExamRecordForSelectScoreResp resp = examRecordCloudService.queryExamRecordForSelectScoreByExamStudentId(req);
+		List<ExamRecordForSelectScore> examRecordList = resp.getExamRecordForSelectScoreList();
+        //List<ExamRecord> examRecordList = examRecordDao.findByExamStudentId(examStudent.getId());
+        Boolean isFinished = examStudent.getFinished();
+        if(isFinished == null){
+        	isFinished = false;
+        }
+        //是否缺考
+        outletScore.setIsMissExam(!isFinished);
+        //是否违纪
+        outletScore.setIsBreachThePrinciple(isBreachThePrinciple(isFinished,examRecordList));
+        //最终成绩
+        GetExamPropertyReq getExamPropertyReq = new GetExamPropertyReq();
+        getExamPropertyReq.setExamId(outletScore.getExamId());
+        getExamPropertyReq.setKey("MARKING_TYPE");
+        GetExamPropertyResp getExamPropertyResp = examCloudService.getExamProperty(getExamPropertyReq);
+        String markingType = getExamPropertyResp.getValue();
+        setFinalExamScoreAndEndTime(isFinished,outletScore,examRecordList,markingType);
+        return outletScore;
+    }
+	
+	/**
+	 * 1.设置最终成绩
+	 * 2.设置考试结束时间
+	 */
+	public void setFinalExamScoreAndEndTime(Boolean isFinished,OutletScore outletScore,List<ExamRecordForSelectScore> examRecordList,String markingType){
+		if(!isFinished || examRecordList == null || examRecordList.size() == 0){
+			return;
+		}
+		ExamScoreBean examScore = finalExamScore(examRecordList,markingType);
+    	if(examScore != null){
+    		outletScore.setScoreId(examScore.getId());
+            outletScore.setTotalScore(examScore.getTotalScore());
+            outletScore.setObjectiveScore(examScore.getObjectiveScore());
+            outletScore.setSubjectiveScore(examScore.getSubjectiveScore());
+            //设置考试结束时间和人脸识别成功率
+            QueryExamRecordForSelectScoreReq req = new QueryExamRecordForSelectScoreReq();
+    		req.setExamScoreId(examScore.getId());
+    		QueryExamRecordForSelectScoreResp resp = examRecordCloudService.queryExamRecordForSelectScoreByScoreId(req);
+    		List<ExamRecordForSelectScore> examRecordForSelectScoreList = resp.getExamRecordForSelectScoreList();
+            
+    		ExamRecordForSelectScore examRecord = examRecordForSelectScoreList.get(0);
+            if(examRecord != null){
+            	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            	Date endTime =  examRecord.getEndTime();
+                if(endTime == null){
+                	endTime = examRecord.getCleanTime();
+                }
+                outletScore.setEndTime(endTime == null?null:sdf.format(endTime));
+            }
+    	}
+	}
+
+	/**
+	 * 查询并计算最终成绩
+	 * @param isFinished
+	 * @param examRecordList
+	 * @param markingType
+	 */
+	private ExamScoreBean finalExamScore(List<ExamRecordForSelectScore> examRecordAllList,String markingType) {
+    	//第一次过滤考试记录:正常结束或者被系统处理的
+    	List<ExamRecordForSelectScore> firstFilterExamRecordList = examRecordAllList.stream().filter(examRecord->{
+    		return  examRecord.getStatus().equals(ExamRecordStatus.EXAM_END.name())|| 
+    				examRecord.getStatus().equals(ExamRecordStatus.EXAM_OVERDUE.name());
+    	}).collect(Collectors.toList());
+    	
+        if (firstFilterExamRecordList != null && firstFilterExamRecordList.size()>0) {
+        	/**
+        	 * 第二次过滤考试记录:过滤出有效的考试记录 
+        	 * 1.没有违纪的
+        	 * 2.没有警告的或有警告已审核通过的
+        	 */
+            Stream<ExamRecordForSelectScore> secondFilterExamRecordStream = firstFilterExamRecordList.stream().filter(examRecord -> {
+                return !examRecord.getIsIllegality() &&
+                		(!examRecord.getIsWarn() || (examRecord.getIsWarn() && examRecord.getIsAudit()));
+            });
+            
+            List<ExamRecordForSelectScore> secondFilterExamRecords = secondFilterExamRecordStream.collect(Collectors.toList());
+            if(secondFilterExamRecords == null|| secondFilterExamRecords.size() == 0){
+            	return null;
+            }
+            //取出有效记录的成绩
+            List<Long> examRecordIds = new ArrayList<Long>();
+            for(int i = 0;i<secondFilterExamRecords.size();i++){
+            	examRecordIds.add(secondFilterExamRecords.get(i).getExamRecordDataId());
+            }
+            
+            QueryExamScoreReq queryExamScoreReq = new QueryExamScoreReq();
+            queryExamScoreReq.setExamRecordDataIds(examRecordIds);
+            QueryExamScoreResp resp = examScoreCloudService.queryExamScore(queryExamScoreReq);
+            
+            List<ExamScoreBean> effectiveExamScoreList = resp.getExamScoreBeans();
+            
+            //List<ExamScore> effectiveExamScoreList = examScoreDao.findByExamRecordIdIn(examRecordIds);
+            
+            //全部评阅规则或客观分最高规则:取总分最高
+            if(markingType.equals(MarkingType.ALL.name())||markingType.equals(MarkingType.OBJECT_SCORE_MAX.name())){
+				List<ExamScoreBean> examScores = effectiveExamScoreList
+											.stream()
+											.sorted((o1,o2)->o2.getTotalScore().compareTo(o1.getTotalScore()))
+											.collect(Collectors.toList());
+				return examScores.get(0);
+            }else if(markingType.equals(MarkingType.LAST_SUBMIT.name())){
+            	//最后一次提交规则:取最后一次的成绩
+            	List<ExamScoreBean> examScores = effectiveExamScoreList
+											.stream()
+											.sorted((o1,o2)->o2.getId().compareTo(o1.getId()))
+											.collect(Collectors.toList());
+				return examScores.get(0);
+			}else if(StringUtils.isBlank(markingType)){
+				//离线考试
+				if(effectiveExamScoreList != null&& effectiveExamScoreList.size()>0){
+					return effectiveExamScoreList.get(0);
+				}
+			}
+        }
+        return null;
+	}
+
+	/**
+	 * 是否违纪
+	 * @param isFinished
+	 * @param examRecordList
+	 * @return
+	 */
+	private Boolean isBreachThePrinciple(Boolean isFinished,List<ExamRecordForSelectScore> examRecordList) {
+		if(!isFinished){
+    		return null;
+    	}
+		if(examRecordList==null || examRecordList.size()==0){
+			return false;
+		}
+    	List<ExamRecordForSelectScore> examRecordFilterList = examRecordList.stream().filter(examRecord -> {
+    		return  examRecord.getIsIllegality();
+    	}).collect(Collectors.toList());
+        return (examRecordFilterList == null || examRecordFilterList.size()==0)?false:true;
+	}
+
+	@Override
+	public List<OutletScore> queryExamScoreByExamNameAndIdentityNumbers(String examName, List<String> identityNumbers, Long rootOrgId)
+			throws Exception {
+		if(StringUtils.isBlank(examName)){
+			return null;
+		}
+		if(identityNumbers==null||identityNumbers.size()==0||rootOrgId == null){
+			return null;
+		}
+		GetExamReq getExamReq = new GetExamReq();
+		getExamReq.setName(examName);
+		getExamReq.setRootOrgId(rootOrgId);
+		GetExamResp getExamResp = examCloudService.getExam(getExamReq);
+		Long examId = getExamResp.getId();
+		
+		FindExamStudentInfoReq req = new FindExamStudentInfoReq();
+		req.setFindStudentType(FindStudentType.BY_EXAMID_AND_IDENTITYNUMBERS);
+		FindStudentBean findStudentBean = new FindStudentBean();
+		findStudentBean.setExamId(examId);
+		findStudentBean.setIdentityNumbers(identityNumbers);
+		req.setFindStudentBean(findStudentBean);
+		
+		FindExamStudentInfoResp findExamStudentInfoResp = oeExamStudentCloudService.findExamStudentInfoBy(req);
+		List<OeExamStudentBean> examStudentBeans = findExamStudentInfoResp.getExamStudents();
+		
+		
+		//List<ExamStudent> examStudents = outletScoreDao.findExamStudents(examId,identityNumbers);
+		return getExamStudentsScore(examStudentBeans);
+	}
+
+	@Override
+	public List<OutletScore> queryExamScoreBy(Long rootOrgId, String examName,String studentCode, String courseCode) throws Exception {
+		if(rootOrgId == null || examName == null || studentCode == null || courseCode == null){
+			return null;
+		}
+		
+		GetExamReq getExamReq = new GetExamReq();
+		getExamReq.setName(examName);
+		getExamReq.setRootOrgId(rootOrgId);
+		GetExamResp getExamResp = examCloudService.getExam(getExamReq);
+		Long examId = getExamResp.getId();
+		
+		FindExamScoreDataReq findExamScoreDataReq = new FindExamScoreDataReq();
+		findExamScoreDataReq.setExamId(examId);
+		findExamScoreDataReq.setStudentCode(studentCode);
+		FindExamScoreDataResp findExamScoreDataResp = examScoreDataCloudService.findExamScoreDataByExamIdAndStudentCode(findExamScoreDataReq);
+		List<ExamScoreDataBean> examScoreDataList = findExamScoreDataResp.getExamScoreDatas();
+		if(examScoreDataList == null || examScoreDataList.size() == 0){
+			return null;
+		}
+		examScoreDataList = examScoreDataList.stream().filter(o->{
+			return o.getCourseCode().indexOf(courseCode)>-1;
+		}).collect(Collectors.toList());
+		
+		List<OutletScore> outletScoreList = new ArrayList<OutletScore>();		
+		for(ExamScoreDataBean examScoreData:examScoreDataList){
+			OutletScore outletScore = new OutletScore();
+			
+			outletScore.setExamName(examName);
+			outletScore.setCourseCode(courseCode);
+			outletScore.setCourseName(examScoreData.getCourseName());
+			
+			outletScore.setStudentCode(examScoreData.getStudentCode());
+			outletScore.setStudentName(examScoreData.getStudentName());
+			outletScore.setIdentityNumber(examScoreData.getIdentityNumber());
+			outletScore.setTotalScore(examScoreData.getTotalScore());
+			outletScore.setObjectiveScore(examScoreData.getObjectiveScore());
+			outletScore.setSubjectiveScore(examScoreData.getSubjectiveScore());
+			
+			String startTime = DateUtil.format(examScoreData.getStartTime(),DatePatterns.ISO);
+			outletScore.setStartTime(startTime);
+			if(examScoreData.getEndTime()!=null){
+				String endTime = DateUtil.format(examScoreData.getEndTime(),DatePatterns.ISO);
+				outletScore.setEndTime(endTime);
+			}
+			outletScore.setSuccessRate(examScoreData.getSuccPercent());
+			outletScore.setIsBreachThePrinciple(examScoreData.getIsIllegality());
+			outletScore.setScoreId(examScoreData.getScoreId());
+			outletScoreList.add(outletScore);
+		}
+		//return outletScoreDao.queryExamScoreBy(rootOrgId, examId, studentCode, courseCode);
+		return outletScoreList;
+	}
+
+}
+

+ 109 - 109
examcloud-exchange-starter/src/main/java/cn/com/qmth/examcloud/exchange/ExchangeApp.java

@@ -1,110 +1,110 @@
-package cn.com.qmth.examcloud.exchange;
-
-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.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
-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.cloud.netflix.feign.EnableFeignClients;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-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.scheduling.annotation.EnableAsync;
-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.exchange.inner.service.upyun.UpyunSiteManager;
-
-/**
- * Exchange不连接除Redis外的任何数据库. 说明 by wangwei.<br>
- * 
- * inner 提供云平台向南调用的中间件<br>
- * outer 提供第三方接入的中间件<br>
- *
- */
-@ComponentScan(basePackages = {"cn.com.qmth"})
-@SpringBootApplication
-@EnableEurekaClient
-@EnableTransactionManagement
-@EnableAsync
-@EnableFeignClients
-@EnableDiscoveryClient
-@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class,
-		DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
-public class ExchangeApp {
-
-	private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(ExchangeApp.class);
-
-	public static void main(String[] args) throws Exception {
-
-		if (LOG instanceof SLF4JImpl) {
-			MDC.put("TRACE_ID", Thread.currentThread().getName());
-		}
-
-		ExamCloudApp.run(ExchangeApp.class, "exchange", args);
-
-		UpyunSiteManager.init();
-	}
-
-	@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(100 * 1024 * 1024);
-		return resolver;
-	}
+package cn.com.qmth.examcloud.exchange;
+
+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.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
+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.cloud.netflix.feign.EnableFeignClients;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+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.scheduling.annotation.EnableAsync;
+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.exchange.inner.service.upyun.UpyunSiteManager;
+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;
+
+/**
+ * Exchange不连接除Redis外的任何数据库. 说明 by wangwei.<br>
+ * 
+ * inner 提供云平台向南调用的中间件<br>
+ * outer 提供第三方接入的中间件<br>
+ *
+ */
+@ComponentScan(basePackages = {"cn.com.qmth"})
+@SpringBootApplication
+@EnableEurekaClient
+@EnableTransactionManagement
+@EnableAsync
+@EnableFeignClients
+@EnableDiscoveryClient
+@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class,
+		DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
+public class ExchangeApp {
+
+	private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(ExchangeApp.class);
+
+	public static void main(String[] args) throws Exception {
+
+		if (LOG instanceof SLF4JImpl) {
+			MDC.put("TRACE_ID", Thread.currentThread().getName());
+		}
+
+		ExamCloudApp.run(ExchangeApp.class, "exchange", args);
+
+		UpyunSiteManager.init();
+	}
+
+	@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(100 * 1024 * 1024);
+		return resolver;
+	}
 }

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

@@ -1,39 +1,39 @@
-package cn.com.qmth.examcloud.exchange.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");
-	}
-
-	@Override
-	public void run(ApplicationArguments args) throws Exception {
-		inspect();
-	}
-
-}
+package cn.com.qmth.examcloud.exchange.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");
+	}
+
+	@Override
+	public void run(ApplicationArguments args) throws Exception {
+		inspect();
+	}
+
+}

+ 134 - 134
examcloud-exchange-starter/src/main/java/cn/com/qmth/examcloud/exchange/config/DefaultWebMvcConfigurerAdapter.java

@@ -1,134 +1,134 @@
-package cn.com.qmth.examcloud.exchange.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;
-import cn.com.qmth.examcloud.core.basic.api.CommonCloudService;
-
-/**
- * 默认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;
-
-	@Autowired
-	CommonCloudService commonCloudService;
-
-	static {
-		PropertiesUtil.configure(PathUtil.getResoucePath("security-mapping.properties"));
-	}
-
-	@Override
-	public void addInterceptors(InterceptorRegistry registry) {
-		FirstInterceptor firstInterceptor = new FirstInterceptor();
-		firstInterceptor.configureAndWatch("intercept.conf");
-		registry.addInterceptor(firstInterceptor).addPathPatterns("/**");
-
-		SpringCloudInterceptor springCloudInterceptor = new SpringCloudInterceptor();
-		springCloudInterceptor.setRedisClient(redisClient);
-		registry.addInterceptor(springCloudInterceptor).addPathPatterns("/**");
-
-		ThirdPartyAccessInterceptor thirdPartyAccessInterceptor = new ThirdPartyAccessInterceptor();
-		thirdPartyAccessInterceptor.setRedisClient(redisClient);
-		thirdPartyAccessInterceptor.setCommonCloudService(commonCloudService);
-		registry.addInterceptor(thirdPartyAccessInterceptor).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.exchange.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.core.basic.api.CommonCloudService;
+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;
+
+	@Autowired
+	CommonCloudService commonCloudService;
+
+	static {
+		PropertiesUtil.configure(PathUtil.getResoucePath("security-mapping.properties"));
+	}
+
+	@Override
+	public void addInterceptors(InterceptorRegistry registry) {
+		FirstInterceptor firstInterceptor = new FirstInterceptor();
+		firstInterceptor.configureAndWatch("intercept.conf");
+		registry.addInterceptor(firstInterceptor).addPathPatterns("/**");
+
+		SpringCloudInterceptor springCloudInterceptor = new SpringCloudInterceptor();
+		springCloudInterceptor.setRedisClient(redisClient);
+		registry.addInterceptor(springCloudInterceptor).addPathPatterns("/**");
+
+		ThirdPartyAccessInterceptor thirdPartyAccessInterceptor = new ThirdPartyAccessInterceptor();
+		thirdPartyAccessInterceptor.setRedisClient(redisClient);
+		thirdPartyAccessInterceptor.setCommonCloudService(commonCloudService);
+		registry.addInterceptor(thirdPartyAccessInterceptor).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;
+			}
+
+		};
+	}
+}

+ 10 - 10
examcloud-exchange-starter/src/main/java/cn/com/qmth/examcloud/exchange/config/ThirdPartyAccessInterceptor.java

@@ -8,20 +8,20 @@ import org.springframework.http.HttpStatus;
 import org.springframework.web.servlet.HandlerInterceptor;
 import org.springframework.web.servlet.ModelAndView;
 
-import cn.com.qmth.examcloud.commons.base.exception.StatusException;
-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.util.ByteUtil;
-import cn.com.qmth.examcloud.commons.base.util.SHA256;
-import cn.com.qmth.examcloud.commons.base.util.StringUtil;
-import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
-import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
-import cn.com.qmth.examcloud.commons.web.support.ServletUtil;
-import cn.com.qmth.examcloud.commons.web.support.StatusResponse;
+import cn.com.qmth.examcloud.commons.exception.StatusException;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
+import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
+import cn.com.qmth.examcloud.commons.util.ByteUtil;
+import cn.com.qmth.examcloud.commons.util.SHA256;
+import cn.com.qmth.examcloud.commons.util.StringUtil;
 import cn.com.qmth.examcloud.core.basic.api.CommonCloudService;
 import cn.com.qmth.examcloud.core.basic.api.bean.ThirdPartyAccessBean;
 import cn.com.qmth.examcloud.core.basic.api.request.GetThirdPartyAccessInfoReq;
 import cn.com.qmth.examcloud.core.basic.api.response.GetThirdPartyAccessInfoResp;
+import cn.com.qmth.examcloud.web.cloud.api.OuterService;
+import cn.com.qmth.examcloud.web.redis.RedisClient;
+import cn.com.qmth.examcloud.web.support.ServletUtil;
+import cn.com.qmth.examcloud.web.support.StatusResponse;
 
 /**
  * 第三方请求接入