chenken 6 anos atrás
pai
commit
156ce180d1

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

@@ -1,148 +1,148 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe;
-
-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.base.response.SuccessBaseResponse;
-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("${$rmp.cloud.exchange.outer}/score")
-public class CommonGainScoreController  extends ControllerSupport{
-
-    @Autowired
-    private OutletScoreService outletScoreService;
-
-    @ApiOperation(value = "查询成绩:根据考试名称、机构ID和学生考试方式查询")
-    @GetMapping
-    public ResponseEntity<?> query(@RequestParam(name = "examName") String examName,
-                                   @RequestParam(name = "examStuRemark",required=false) String examStuRemark,
-                                   HttpServletRequest request) {
-    	try{
-    		User accessUser = getAccessUser();
-    		if(accessUser == null){
-    			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
-    		}
-    		if (StringUtils.isEmpty(examName)) {
-                return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试名称不能为空"),HttpStatus.BAD_REQUEST);
-            }
-            Long orgId = accessUser.getRootOrgId();
-            List<OutletScore> outletScoreList = outletScoreService.queryExamScore(examName, examStuRemark, orgId);
-            return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScoreList), HttpStatus.OK);
-    	}catch(Exception e){
-    		e.printStackTrace();
-    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
-    	}
-        
-    }
-    
-    @ApiOperation(value = "查询成绩:按考试名称、考生身份证号、机构ID查询成绩")
-    @GetMapping("/examNameAndIdentityNumberList")
-    public ResponseEntity<?> queryByIdentityNumber(@RequestParam(name = "examName") String examName,
-    											   @RequestParam(name = "identityNumberList") List<String> identityNumberList,
-    											   HttpServletRequest request) {
-        try{
-        	User accessUser = getAccessUser();
-    		if(accessUser == null){
-    			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
-    		}
-    		if (StringUtils.isEmpty(examName)) {
-                return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试名称不能为空"),HttpStatus.BAD_REQUEST);
-            }
-    		if (identityNumberList==null||identityNumberList.size()==0) {
-                return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("身份证号不能为空"),HttpStatus.BAD_REQUEST);
-            }
-    		if(identityNumberList.size()>1000){
-	    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("单次查询,身份证号数量不能大于1000"),HttpStatus.BAD_REQUEST);
-	    	}
-            List<OutletScore> outletScoreList = outletScoreService.queryExamScoreByExamNameAndIdentityNumbers(examName,identityNumberList,accessUser.getRootOrgId());
-            return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",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{
-    		User accessUser = getAccessUser();
-    		if(accessUser == null){
-    			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
-    		}
-	    	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);
-	    	}
-	    	List<OutletScore> outletScoreList = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(),batchName,courseCode,studentCodes);
-	    	return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScoreList), HttpStatus.OK);
-    	}catch(Exception e){
-    		e.printStackTrace();
-    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
-    	}
-    }
-    
-    @ApiOperation(value = "查询成绩明细:按考试名称、机构ID、学号、课程code查询成绩")
-    @GetMapping("/batchQueryScoreDetail")
-    public ResponseEntity<?> batchQueryScoreDetail(@RequestParam(name = "examName")String examName,
-						    		 @RequestParam(name = "studentCode")String studentCode,
-						    		 @RequestParam(name = "courseCode")String courseCode,
-						    		 HttpServletRequest request){
-    	User accessUser = getAccessUser();
-    	if(accessUser == null){
-			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
-		}
-		if(examName == null){
-			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("examName is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
-		}
-		if(studentCode == null){
-			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("studentCode is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
-		}
-		if(courseCode == null){
-			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("courseCode is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
-		}
-    	try {
-			List<OutletScore> outletScores = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(), examName, studentCode, courseCode);
-			return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScores), 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;
+
+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.base.response.SuccessBaseResponse;
+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("${$rmp.cloud.exchange.outer}/score")
+public class CommonGainScoreController  extends ControllerSupport{
+
+    @Autowired
+    private OutletScoreService outletScoreService;
+
+    @ApiOperation(value = "查询成绩:根据考试名称、机构ID和学生考试方式查询")
+    @GetMapping
+    public ResponseEntity<?> query(@RequestParam(name = "examName") String examName,
+                                   @RequestParam(name = "examStuRemark",required=false) String examStuRemark,
+                                   HttpServletRequest request) {
+    	try{
+    		User accessUser = getAccessUser();
+    		if(accessUser == null){
+    			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
+    		}
+    		if (StringUtils.isEmpty(examName)) {
+                return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试名称不能为空"),HttpStatus.BAD_REQUEST);
+            }
+            Long orgId = accessUser.getRootOrgId();
+            List<OutletScore> outletScoreList = outletScoreService.queryExamScore(examName, examStuRemark, orgId);
+            return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScoreList), HttpStatus.OK);
+    	}catch(Exception e){
+    		e.printStackTrace();
+    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
+    	}
+        
+    }
+    
+    @ApiOperation(value = "查询成绩:按考试名称、考生身份证号、机构ID查询成绩")
+    @GetMapping("/examNameAndIdentityNumberList")
+    public ResponseEntity<?> queryByIdentityNumber(@RequestParam(name = "examName") String examName,
+    											   @RequestParam(name = "identityNumberList") List<String> identityNumberList,
+    											   HttpServletRequest request) {
+        try{
+        	User accessUser = getAccessUser();
+    		if(accessUser == null){
+    			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
+    		}
+    		if (StringUtils.isEmpty(examName)) {
+                return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("考试名称不能为空"),HttpStatus.BAD_REQUEST);
+            }
+    		if (identityNumberList==null||identityNumberList.size()==0) {
+                return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("身份证号不能为空"),HttpStatus.BAD_REQUEST);
+            }
+    		if(identityNumberList.size()>1000){
+	    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("单次查询,身份证号数量不能大于1000"),HttpStatus.BAD_REQUEST);
+	    	}
+            List<OutletScore> outletScoreList = outletScoreService.queryExamScoreByExamNameAndIdentityNumbers(examName,identityNumberList,accessUser.getRootOrgId());
+            return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",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{
+    		User accessUser = getAccessUser();
+    		if(accessUser == null){
+    			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
+    		}
+	    	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);
+	    	}
+	    	List<OutletScore> outletScoreList = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(),batchName,courseCode,studentCodes);
+	    	return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScoreList), HttpStatus.OK);
+    	}catch(Exception e){
+    		e.printStackTrace();
+    		return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请求失败"), HttpStatus.INTERNAL_SERVER_ERROR);
+    	}
+    }
+    
+    @ApiOperation(value = "查询成绩明细:按考试名称、机构ID、学号、课程code查询成绩")
+    @GetMapping("/batchQueryScoreDetail")
+    public ResponseEntity<?> batchQueryScoreDetail(@RequestParam(name = "examName")String examName,
+						    		 @RequestParam(name = "studentCode")String studentCode,
+						    		 @RequestParam(name = "courseCode")String courseCode,
+						    		 HttpServletRequest request){
+    	User accessUser = getAccessUser();
+    	if(accessUser == null){
+			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"), HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+		if(examName == null){
+			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("examName is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+		if(studentCode == null){
+			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("studentCode is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+		if(courseCode == null){
+			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("courseCode is not null"), HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+    	try {
+			List<OutletScore> outletScores = outletScoreService.queryExamScoreBy(accessUser.getRootOrgId(), examName, studentCode, courseCode);
+			return new ResponseEntity<SuccessBaseResponse>(new SuccessBaseResponse("查询成功",outletScores), HttpStatus.OK);
+    	} catch (Exception e) {
+			e.printStackTrace();
+			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("查询失败"), HttpStatus.INTERNAL_SERVER_ERROR);
+		}
+    }
+    
+}

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

@@ -28,7 +28,7 @@ import io.swagger.annotations.ApiOperation;
  * @author chenken
  * @date 2018年5月7日 下午3:20:33
  * @company QMTH
- * @description ExamController.java
+ * @description 创建考试
  */
 @RestController
 @RequestMapping("${$rmp.cloud.exchange.outer}/exam")

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

@@ -10,12 +10,13 @@ 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.common.dto.oe.marking.ExamPhotoVerifyData;
 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;
-import cn.com.qmth.examcloud.exchange.outer.service.client.OeClient;
 
 /**
  * @author chenken
@@ -28,26 +29,22 @@ import cn.com.qmth.examcloud.exchange.outer.service.client.OeClient;
 public class ExamVerifyPhotoController extends ControllerSupport {
 
 	@Autowired
-	private OeClient oeClient;
+	private ExamRecordCloudService examRecordCloudService;
 
 	@GetMapping
-	public ResponseEntity<?> getExamVerifyPhotos(HttpServletRequest request,
-			@RequestParam Long scoreId) {
+	public ResponseEntity<?> getExamVerifyPhotos(HttpServletRequest request,@RequestParam Long scoreId) {
 		User accessUser = getAccessUser();
 		if (accessUser == null) {
-			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"),
-					HttpStatus.INTERNAL_SERVER_ERROR);
+			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("请先登录"),HttpStatus.INTERNAL_SERVER_ERROR);
 		}
 		try {
-			String userToken = accessUser.getKey() + ":" + accessUser.getToken();
-			ExamPhotoVerifyData examPhotoVerifyData = oeClient.getExamPhotoVerifyData(userToken,
-					scoreId);
-			return new ResponseEntity<SuccessBaseResponse>(
-					new SuccessBaseResponse("查询成功", examPhotoVerifyData), HttpStatus.OK);
+			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);
+			return new ResponseEntity<FailureBaseResponse>(new FailureBaseResponse("查询失败"),HttpStatus.INTERNAL_SERVER_ERROR);
 		}
 	}
 

+ 0 - 53
examcloud-exchange-outer-api-provider/src/main/java/cn/com/qmth/examcloud/exchange/outer/api/controller/swufe/ScorePushController.java

@@ -1,53 +0,0 @@
-package cn.com.qmth.examcloud.exchange.outer.api.controller.swufe;
-
-import io.swagger.annotations.ApiOperation;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-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 cn.com.qmth.examcloud.common.dto.oe.marking.ExamRecordDto;
-import cn.com.qmth.examcloud.exchange.base.enums.OrgIdServiceEnum;
-import cn.com.qmth.examcloud.exchange.base.response.FailureBaseResponse;
-import cn.com.qmth.examcloud.exchange.base.response.SuccessBaseResponse;
-import cn.com.qmth.examcloud.exchange.base.util.SpringContextUtils;
-import cn.com.qmth.examcloud.exchange.outer.service.ScorePushService;
-
-/**
- * @author  	chenken
- * @date    	2018年4月3日 下午3:57:34
- * @company 	QMTH
- * @description ScorePushController.java
- */
-@RestController
-@RequestMapping("${$rmp.cloud.exchange.outer}/score-push")
-@ConditionalOnProperty("app.pushscore.enable")
-public class ScorePushController {
-	
-	private static final Logger log = LoggerFactory.getLogger(ScorePushController.class);
-	
-    @ApiOperation(value = "推送成绩")
-    @PostMapping
-    public ResponseEntity<Object> push(@RequestBody ExamRecordDto examRecordDto) throws Exception {
-    	log.info("推送成绩orgId:"+examRecordDto.getOrgId()+"scoreId:"+examRecordDto.getScoreId());
-    	OrgIdServiceEnum orgIdServiceEnum = OrgIdServiceEnum.getServiceNameByOrgId(examRecordDto.getOrgId());
-    	if(orgIdServiceEnum !=null){
-    		try{
-    			ScorePushService scorePushService = (ScorePushService) SpringContextUtils.getBeanById(orgIdServiceEnum.getServiceName());
-        		scorePushService.scorePush(examRecordDto);
-        		return new ResponseEntity<>(new SuccessBaseResponse("分数ID:"+examRecordDto.getScoreId()+":推送成绩成功",null),HttpStatus.OK);
-    		}catch(Exception e){
-    			e.printStackTrace();
-    			return new ResponseEntity<>(new FailureBaseResponse("分数ID:"+examRecordDto.getScoreId()+":推送成绩失败"),HttpStatus.INTERNAL_SERVER_ERROR);
-    		}
-    	}else{
-    		return new ResponseEntity<>(new SuccessBaseResponse("没有机构ID为"+examRecordDto.getOrgId()+"的配置",null),HttpStatus.OK);
-    	}
-    }
-}

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

@@ -34,7 +34,7 @@ import io.swagger.annotations.ApiOperation;
  * @author chenken
  * @date 2018年5月7日 下午4:30:29
  * @company QMTH
- * @description StudentInfoController.java
+ * @description 保存学生信息
  */
 @RestController
 @RequestMapping("${$rmp.cloud.exchange.outer}/studentInfo")

+ 0 - 16
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/ScorePushService.java

@@ -1,16 +0,0 @@
-package cn.com.qmth.examcloud.exchange.outer.service;
-
-import cn.com.qmth.examcloud.common.dto.oe.marking.ExamRecordDto;
-
-/**
- * @author  	chenken
- * @date    	2018年5月17日 上午11:00:13
- * @company 	QMTH
- * @description 分数推送接口
- */
-public interface ScorePushService {
-
-	public void scorePush(ExamRecordDto examRecordDto) throws Exception;
-	
-}
-

+ 0 - 29
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/client/OeClient.java

@@ -1,29 +0,0 @@
-package cn.com.qmth.examcloud.exchange.outer.service.client;
-
-import org.springframework.cloud.netflix.feign.FeignClient;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import cn.com.qmth.examcloud.common.dto.oe.marking.ExamPhotoVerifyData;
-
-/**
- * @author  	chenken
- * @date    	2018年5月7日 下午3:11:55
- * @company 	QMTH
- * @description OeClient.java
- */
-@FeignClient(value = "ExamCloud-SERVICE-OE")
-public interface OeClient {
-
-	/**
-	 * 查询考试拍照相关数据
-	 * @param scoreId
-	 * @return
-	 */
-	@RequestMapping(method = RequestMethod.GET, value = "/api/exam_record/examPhotoVerifyCount")
-	public ExamPhotoVerifyData getExamPhotoVerifyData(@RequestHeader("user_token") String token,@RequestParam("scoreId") Long scoreId);
-	
-}
-

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

@@ -69,14 +69,6 @@ public class OutletScoreServiceImpl implements OutletScoreService{
 	@Autowired
 	private ExamScoreDataCloudService examScoreDataCloudService;
 	
-	/*@Override
-	public List<OutletScore> getExamScoreById(Long scoreId)  throws Exception{
-		if(scoreId == null){
-			return null;
-		}
-		return outletScoreDao.getExamScoreById(scoreId);
-	}*/
-	
 	/**
 	 * examStuRemark不再使用  2018-10-15 chenken
 	 */

+ 0 - 160
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/scorePush/SydxScorePushServiceImpl.java

@@ -1,160 +0,0 @@
-package cn.com.qmth.examcloud.exchange.outer.service.impl.scorePush;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.List;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.HttpEntity;
-import org.apache.http.client.config.RequestConfig;
-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.HttpClientBuilder;
-import org.apache.http.util.EntityUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import cn.com.qmth.examcloud.common.dto.oe.marking.ExamRecordDto;
-import cn.com.qmth.examcloud.commons.base.util.JsonUtil;
-import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreDataCloudService;
-import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamScoreDataBean;
-import cn.com.qmth.examcloud.core.oe.admin.api.request.FindExamScoreDataReq;
-import cn.com.qmth.examcloud.core.oe.admin.api.response.FindExamScoreDataResp;
-import cn.com.qmth.examcloud.exchange.outer.service.ScorePushService;
-
-/**
- * @author  	chenken
- * @date    	2018年5月17日 上午11:01:45
- * @company 	QMTH
- * @description 石油大学推送成绩接口
- */
-@Service("sydxScorePushService")
-public class SydxScorePushServiceImpl implements ScorePushService{
-
-    private static final Logger LOG = LoggerFactory.getLogger(SydxScorePushServiceImpl.class);
-
-    @Value("${sydx.pushscore.url.schema}")
-    private String pushUrlSchema;
-
-    @Value("${sydx.pushscore.url.host}")
-    private String pushUrlHost;
-
-    @Value("${sydx.pushscore.url.port}")
-    private String pushUrlPort;
-    
-	/*@Autowired
-	private OutletScoreDao outletScoreDao;*/
-	
-	@Autowired
-	private ExamScoreDataCloudService examScoreDataCloudService;
-	
-	@Override
-	public void scorePush(ExamRecordDto examRecordDto) throws Exception {
-		//有警告未审核
-        if (examRecordDto.isWarn() && !examRecordDto.isAudit()) {
-            return;
-        }
-        //违纪
-  		if(examRecordDto.getInvigilatorOperation() == 1){
-  			return;
-  		}
-        //考试记录是作废状态
-  		if(StringUtils.isNotBlank(examRecordDto.getExamRecordStatus()) &&
-  				"EXAM_INVALID".equals(examRecordDto.getExamRecordStatus())){
-  			return;
-  		}
-		
-  		Long scoreId = examRecordDto.getScoreId();
-  		
-		LOG.info("准备推送成绩:{}", scoreId);
-		 
-		FindExamScoreDataReq findExamScoreDataReq = new FindExamScoreDataReq();
-		findExamScoreDataReq.setScoreId(scoreId);
-		FindExamScoreDataResp findExamScoreDataResp =  examScoreDataCloudService.findExamScoreDataByScoreId(findExamScoreDataReq);
-		List<ExamScoreDataBean> examScoreDataList = findExamScoreDataResp.getExamScoreDatas();
-        //List<OutletScore> outletScores = outletScoreDao.sydxGetExamScoreById(scoreId);
-
-        if (examScoreDataList == null || examScoreDataList.size() == 0) {
-            LOG.info("{}成绩数据不存在", scoreId);
-        }
-        
-        for(ExamScoreDataBean outletScore:examScoreDataList){
-        	String courseCode = outletScore.getCourseCode();
-        	//将Z000001变成000001
-        	if(courseCode.startsWith("Z")||courseCode.startsWith("Q")||courseCode.startsWith("S")){
-        		outletScore.setCourseCode(courseCode.substring(1, courseCode.length()));
-        	}else{
-        		outletScore.setCourseCode(courseCode);
-        	}
-        }
-
-        CloseableHttpResponse httpResponse = null;
-        CloseableHttpClient httpClient = null;
-        try {
-            String scoreStr = JsonUtil.toJson(examScoreDataList);
-            LOG.info("成绩数据:{}", scoreStr);
-            RequestConfig config = RequestConfig.custom()
-                    .setConnectTimeout(5000)
-                    .setConnectionRequestTimeout(5000)
-                    .setSocketTimeout(5000)
-                    .build();
-
-            httpClient = HttpClientBuilder
-                    .create()
-                    .setDefaultRequestConfig(config)
-                    .build();
-
-            URI uri = new URIBuilder()
-                    .setScheme(pushUrlSchema)
-                    .setHost(pushUrlHost)
-                    .setPort(Integer.parseInt(pushUrlPort))
-                    .setPath("/entity/learning/interface/stuHomeworkScore_syncFinalExamScore.action")
-                    .setParameter("loginId", "bjsy")
-                    .setParameter("password", "1111")
-                    .setParameter("examRemark", examScoreDataList.get(0).getExamName())
-                    //.setParameter("examStuRemark", examScoreDataList.get(0).getStudentRemark())
-                    .setParameter("scoreJsonStr", scoreStr)//通过查询参数的方式传递
-                    .build();
-
-            HttpPost httpPost = new HttpPost(uri);
-//	            StringEntity data = new StringEntity(scoreStr);
-//	            httpPost.setEntity(data);
-
-            httpResponse = httpClient.execute(httpPost);
-            HttpEntity entity = httpResponse.getEntity();
-            String entityStr = EntityUtils.toString(entity);
-            LOG.info("推送结果:{}", entityStr);
-        } catch (Exception e) {
-            LOG.error(scoreId + "成绩推送失败", e);
-            e.printStackTrace();
-        } finally {
-
-            if (httpResponse != null) {
-                try {
-                    httpResponse.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                } finally {
-                    httpResponse = null;
-                }
-            }
-
-            if (httpClient != null) {
-                try {
-                    httpClient.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                } finally {
-                    httpClient = null;
-                }
-            }
-        }
-	}
-
-}
-

+ 0 - 121
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/scorePush/XncdScorePushServiceImpl.java

@@ -1,121 +0,0 @@
-package cn.com.qmth.examcloud.exchange.outer.service.impl.scorePush;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.HttpEntity;
-import org.apache.http.NameValuePair;
-import org.apache.http.client.entity.UrlEncodedFormEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicNameValuePair;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import cn.com.qmth.examcloud.common.dto.oe.marking.ExamRecordDto;
-import cn.com.qmth.examcloud.common.dto.oe.marking.PushScoreActionEnum;
-import cn.com.qmth.examcloud.core.oe.admin.api.ExamScoreDataCloudService;
-import cn.com.qmth.examcloud.core.oe.admin.api.bean.ExamScoreDataBean;
-import cn.com.qmth.examcloud.core.oe.admin.api.request.FindExamScoreDataReq;
-import cn.com.qmth.examcloud.core.oe.admin.api.response.FindExamScoreDataResp;
-import cn.com.qmth.examcloud.exchange.base.util.OutletUtils;
-import cn.com.qmth.examcloud.exchange.outer.service.ScorePushService;
-
-/**
- * @author  	chenken
- * @date    	2018年5月17日 下午2:22:43
- * @company 	QMTH
- * @description 西南财大推送成绩接口
- */
-@Service("xncdScorePushService")
-public class XncdScorePushServiceImpl  implements ScorePushService{
-
-	private static final Logger log = LoggerFactory.getLogger(XncdScorePushServiceImpl.class);
-	
-    @Autowired
-	private ExamScoreDataCloudService examScoreDataCloudService;
-    
-    private static final String pushScoreUrl = "http://www.swufe-online.com/netedu/qmth.do";
-	
-	@Override
-	public void scorePush(ExamRecordDto examRecordDto) throws Exception {
-		//西南财大只有考试结束后或自动清理才推送分数
-		if(examRecordDto.getPushScoreActionEnum() == PushScoreActionEnum.END_EXAM 
-				|| examRecordDto.getPushScoreActionEnum() == PushScoreActionEnum.CLEAN){
-			log.info("开始推送西南财大考生成绩 scoreId:"+examRecordDto.getScoreId());
-			Long scoreId = examRecordDto.getScoreId();
-			
-			FindExamScoreDataReq findExamScoreDataReq = new FindExamScoreDataReq();
-			findExamScoreDataReq.setScoreId(scoreId);
-			FindExamScoreDataResp findExamScoreDataResp =  examScoreDataCloudService.findExamScoreDataByScoreId(findExamScoreDataReq);
-			List<ExamScoreDataBean> examScoreDataList = findExamScoreDataResp.getExamScoreDatas();
-			
-	        //List<OutletScore> outletScores = outletScoreService.getExamScoreById(scoreId);
-	        if (examScoreDataList != null && examScoreDataList.size() > 0) {
-	        	ExamScoreDataBean outletScore = examScoreDataList.get(0);
-	        	
-	        	CloseableHttpResponse httpResponse = null;
-	            CloseableHttpClient httpClient = HttpClients.createDefault();;
-	            HttpPost httpPost = new HttpPost(pushScoreUrl);
-	            
-	            List<NameValuePair> params = buildParamsData(outletScore);
-	            
-	            httpPost.setEntity(new UrlEncodedFormEntity(params,"UTF-8"));
-	            
-	            httpResponse = httpClient.execute(httpPost);
-	            
-	            String result = "";
-	            HttpEntity responseEntity = httpResponse.getEntity();
-	            int statusCode= httpResponse.getStatusLine().getStatusCode();
-	            if(statusCode == 200){
-	                BufferedReader reader = new BufferedReader(new InputStreamReader(responseEntity.getContent()));
-	                StringBuffer buffer = new StringBuffer();
-	                String str = "";
-	                while(StringUtils.isNoneBlank((str = reader.readLine()))) {
-	                    buffer.append(str);
-	                }
-	                result = buffer.toString();
-	            }
-	                 
-	            httpClient.close();
-	            if(httpResponse!=null){
-	                httpResponse.close();
-	            }
-	            log.info(result);
-	        }
-		}
-	}
-	
-	private List<NameValuePair> buildParamsData(ExamScoreDataBean outletScore){
-		Map<String,Object> map = OutletUtils.getKeyAndValue(outletScore);
-        map.remove("examRemark");//西南财大接口不需要
-        map.remove("studentRemark");//西南财大接口不需要
-        map.remove("isMissExam");//西南财大接口不需要
-        
-        map.put("op","pushScore");
-        map.put("x","xczx_white_list");
-        map.put("LoginName","qmth");
-        map.put("PassWord","qmth123!");
-        
-        //是否违纪
-        boolean isIllegality = (boolean) map.get("isIllegality");
-        map.put("isBreachThePrinciple", isIllegality?1:0);
-        
-        List<NameValuePair> params = new ArrayList<NameValuePair>();
-        for(String key:map.keySet()){
-        	params.add(new BasicNameValuePair(key,map.get(key)+""));
-        }
-        
-        return params;
-	}
-
-}
-