Răsfoiți Sursa

题库提交

weiwenhai 6 ani în urmă
părinte
comite
2d83131a4c
14 a modificat fișierele cu 324 adăugiri și 178 ștergeri
  1. 45 17
      examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/PaperController.java
  2. 19 0
      examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/provider/ExtractConfigCloudServiceProvider.java
  3. 8 0
      examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/provider/HandleSyncCloudServiceProvider.java
  4. 5 0
      examcloud-core-questions-base/pom.xml
  5. 7 0
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/ExtractConfigProviderService.java
  6. 2 3
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/PaperService.java
  7. 74 47
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/dto/ObjectiveQuestionStructure.java
  8. 56 0
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/dto/PaperQuestionStructureInfo.java
  9. 0 42
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/dto/QuestionAllTypeDto.java
  10. 67 45
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/dto/SubjectiveQuestionStructure.java
  11. 4 4
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/export/InitPaperExpService.java
  12. 10 0
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/ExtractConfigProviderServiceImpl.java
  13. 25 19
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/PaperServiceImpl.java
  14. 2 1
      examcloud-core-questions-starter/src/main/resources/security-exclusions.conf

+ 45 - 17
examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/PaperController.java

@@ -17,6 +17,7 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.PageImpl;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.ModelAttribute;
@@ -24,11 +25,11 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestHeader;
 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.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.servlet.ModelAndView;
 
 import com.google.gson.Gson;
 
@@ -36,7 +37,6 @@ import cn.com.qmth.examcloud.core.questions.dao.PaperRepo;
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperDetailExp;
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperDetailUnitExp;
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperExp;
-import cn.com.qmth.examcloud.core.questions.service.bean.dto.QuestionAllTypeDto;
 import cn.com.qmth.examcloud.core.questions.dao.entity.Paper;
 import cn.com.qmth.examcloud.core.questions.dao.entity.PaperSearchInfo;
 import cn.com.qmth.examcloud.core.questions.service.PaperService;
@@ -47,6 +47,7 @@ import cn.com.qmth.examcloud.core.questions.base.StringSimilarityUtils;
 import cn.com.qmth.examcloud.core.questions.base.enums.PaperType;
 import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
 import cn.com.qmth.examcloud.commons.base.exception.StatusException;
+import cn.com.qmth.examcloud.commons.base.util.JsonUtil;
 import cn.com.qmth.examcloud.commons.web.security.bean.User;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
 import io.swagger.annotations.ApiOperation;
@@ -56,7 +57,7 @@ import io.swagger.annotations.ApiOperation;
  * updated by weiwenhai on 2018.9.28
  * @code 160
  */
-@RestController
+@Controller
 @RequestMapping("${api_cqb}/")
 public class PaperController extends ControllerSupport{
 
@@ -81,6 +82,7 @@ public class PaperController extends ControllerSupport{
      * @param paperId
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "根据Id获取试卷", notes = "根据Id获取试卷")
     @GetMapping(value = "/paper/{paperId}")
     public ResponseEntity<Object> getPaperById(@PathVariable String paperId) {
@@ -93,6 +95,7 @@ public class PaperController extends ControllerSupport{
      * @param paper
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "保存试卷", notes = "保存试卷")
     @PutMapping(value = "/paper")
     public ResponseEntity<Object> savePaperById(@RequestBody PaperExp paper) {
@@ -113,6 +116,7 @@ public class PaperController extends ControllerSupport{
      * @param pageSize
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "查询所有导入试卷", notes = "查询所有导入试卷")
     @GetMapping(value = "/importPaper/{curPage}/{pageSize}")
     public ResponseEntity<Object> getImportPapers(@ModelAttribute PaperSearchInfo paperSearchInfo,
@@ -123,6 +127,7 @@ public class PaperController extends ControllerSupport{
         return new ResponseEntity<Object>(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
     }
 
+    @ResponseBody
     @ApiOperation(value = "查询所有待审核和审核不通过的导入试卷", notes = "查询所有待审核和审核不通过的导入试卷")
     @GetMapping(value = "/importPaperNotSuccess/{curPage}/{pageSize}")
     public ResponseEntity<Object> getImportPapersNotSuccess(@ModelAttribute PaperSearchInfo paperSearchInfo, @PathVariable int curPage, @PathVariable int pageSize) {
@@ -132,6 +137,7 @@ public class PaperController extends ControllerSupport{
                 HttpStatus.OK);
     }
 
+    @ResponseBody
     @ApiOperation(value = "根据条件查询导入试卷", notes = "根据条件查询导入试卷")
     @GetMapping(value = "/getImportPaper")
     public ResponseEntity<List<Paper>> getImportPapersBySearch(@ModelAttribute PaperSearchInfo paperSearchInfo) {
@@ -140,6 +146,7 @@ public class PaperController extends ControllerSupport{
         return new ResponseEntity<List<Paper>>(paperService.getImportPapersBySearch(paperSearchInfo), HttpStatus.OK);
     }
 
+    @ResponseBody
     @ApiOperation(value = "根据条件查询已组试卷", notes = "根据条件查询已组试卷")
     @GetMapping(value = "/getGenPaper")
     public ResponseEntity<List<Paper>> getGenPapersBySearch(@ModelAttribute PaperSearchInfo paperSearchInfo) {
@@ -156,6 +163,7 @@ public class PaperController extends ControllerSupport{
      * @param pageSize
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "查询所有已组试卷", notes = "查询所有已组试卷")
     @GetMapping(value = "/genPaper/{curPage}/{pageSize}")
     public ResponseEntity<Object> getGenPapers(@ModelAttribute PaperSearchInfo paperSearchInfo,
@@ -174,6 +182,7 @@ public class PaperController extends ControllerSupport{
      * @param pageSize
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "查询所有导入试卷(not in paperIds)", notes = "查询所有导入试卷(not in paperIds)")
     @GetMapping(value = "/genPaper/{ids}/{curPage}/{pageSize}")
     public ResponseEntity<Object> getGenPapersNotInIds(@ModelAttribute PaperSearchInfo paperSearchInfo, 
@@ -194,6 +203,7 @@ public class PaperController extends ControllerSupport{
      * @param paperIds
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "删除试卷", notes = "删除试卷")
     @DeleteMapping(value = "/paper/{paperIds}")
     public ResponseEntity<Object> delPaper(@PathVariable String paperIds) {
@@ -213,6 +223,7 @@ public class PaperController extends ControllerSupport{
      * @param paperSearchInfo
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "批量通过试卷", notes = "批量通过试卷")
     @PutMapping(value = "/paper/pass")
     public ResponseEntity<Object> passPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
@@ -226,6 +237,7 @@ public class PaperController extends ControllerSupport{
      * @param paperSearchInfo
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "批量不通过试卷", notes = "批量不通过试卷")
     @PutMapping(value = "/paper/noPass")
     public ResponseEntity<Object> noPassPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
@@ -239,6 +251,7 @@ public class PaperController extends ControllerSupport{
      * @param paperSearchInfo
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "批量待审核试卷", notes = "批量待审核试卷")
     @PutMapping(value = "/paper/draft")
     public ResponseEntity<Object> initPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
@@ -254,6 +267,7 @@ public class PaperController extends ControllerSupport{
      * @param groupCode
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "获取卷库考试试卷", notes = "获取卷库考试试卷")
     @GetMapping(value = "/paper/list/{examId}/{courseCode}/{groupCode}")
     public List<Paper> listPaperById(@PathVariable String examId, @PathVariable String courseCode,
@@ -270,6 +284,7 @@ public class PaperController extends ControllerSupport{
      * @param paperId
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "新增考试试卷", notes = "新增考试试卷")
     @PostMapping(value = "/paper/join/{examId}/{courseCode}/{groupCode}/{paperId}")
     public ResponseEntity<Object> joinExamPaper(@PathVariable String examId, @PathVariable String courseCode,
@@ -287,6 +302,7 @@ public class PaperController extends ControllerSupport{
      * @param paperId
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "删除考试试卷", notes = "删除考试试卷")
     @DeleteMapping(value = "/paper/release/{examId}/{courseCode}/{groupCode}/{paperId}")
     public ResponseEntity<Object> releaseExamPaper(@PathVariable String examId, @PathVariable String courseCode,
@@ -303,6 +319,7 @@ public class PaperController extends ControllerSupport{
      * @param courseCode
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "获取考试试卷类型集合", notes = "获取考试试卷类型集合")
     @GetMapping(value = "/paper/groupCode/{examId}/{courseCode}")
     public Set<String> listGroup(@PathVariable String examId, @PathVariable String courseCode) {
@@ -317,6 +334,7 @@ public class PaperController extends ControllerSupport{
      * @param groupCode
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "删除考试试卷类型", notes = "删除考试试卷类型")
     @DeleteMapping(value = "/paper/groupCode/{examId}/{courseCode}/{groupCode}")
     public ResponseEntity<Object> deleteGroup(@PathVariable String examId, @PathVariable String courseCode,
@@ -331,6 +349,7 @@ public class PaperController extends ControllerSupport{
      * @param questionId
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "删除导入试卷中的试题", notes = "删除导入试卷中的试题")
     @DeleteMapping(value = "/paper/deleteQuestion/{questionId}")
     public ResponseEntity<Object> deleteImportPaperQuestion(@PathVariable String questionId) {
@@ -347,6 +366,7 @@ public class PaperController extends ControllerSupport{
      * @param question
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "向导入试卷中的新增试题", notes = "向导入试卷中的新增试题")
     @PostMapping(value = "/paper/addQuestion/{paperId}/{paperDetailId}")
     public ResponseEntity<Object> insertQuestionToPaper(@PathVariable String paperId,
@@ -357,6 +377,7 @@ public class PaperController extends ControllerSupport{
 
     }
 
+    @ResponseBody
     @ApiOperation(value = "获取试卷的重复试题", notes = "获取试卷的重复试题")
     @GetMapping(value = "/paper/{paperId}/reduplicate-questions")
     public ResponseEntity<Object> reduplicateQuestions(@PathVariable String paperId) {
@@ -425,6 +446,7 @@ public class PaperController extends ControllerSupport{
      * @param
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "获取试题所在的试卷名称", notes = "获取试题所在的试卷名称")
     @GetMapping(value = "/paper/listNames/{questionId}")
     public ResponseEntity<Object> getPaperNamesByQuesId(@PathVariable String questionId) {
@@ -437,6 +459,7 @@ public class PaperController extends ControllerSupport{
      * @param
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "查询用于选题的试题列表", notes = "查询用于选题的试题列表")
     @GetMapping(value = "/paper/listQuestion/{paperId}/{curPage}/{pageSize}")
     public ResponseEntity<Object> listQuestionforSelect(@PathVariable String paperId,
@@ -463,6 +486,7 @@ public class PaperController extends ControllerSupport{
      * @param questions
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "向导入试卷中的新增试题", notes = "向导入试卷中的新增试题")
     @PostMapping(value = "/paper/selectQuestions/{paperId}/{paperDetailId}")
     public ResponseEntity<Object> selectQuestionsToPaper(@PathVariable String paperId,
@@ -481,6 +505,7 @@ public class PaperController extends ControllerSupport{
      * @param pageSize
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "查询所有导入试卷(not in paperIds)", notes = "查询所有导入试卷(not in paperIds)")
     @GetMapping(value = "/importPaper/{ids}/{curPage}/{pageSize}")
     public ResponseEntity<Object> getImportPapersNotInIds(@ModelAttribute PaperSearchInfo paperSearchInfo, @PathVariable String[] ids, @PathVariable int curPage,
@@ -501,6 +526,7 @@ public class PaperController extends ControllerSupport{
      * @param paperSearchInfo
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "查询该课程的所有导入试卷", notes = "查询该课程的所有导入试卷")
     @GetMapping(value = "/importPaper/course")
     public ResponseEntity<Object> getImportPapersByCourseNo(@ModelAttribute PaperSearchInfo paperSearchInfo) {
@@ -518,6 +544,7 @@ public class PaperController extends ControllerSupport{
      * @param paperIds
      * @return
      */
+    @ResponseBody
     @ApiOperation(value = "复制导入试卷为组卷", notes = "复制导入试卷为组卷")
     @PutMapping(value = "/useBasePaper/{paperIds}")
     public ResponseEntity<Object> useBasePaper(@PathVariable String paperIds){
@@ -544,6 +571,7 @@ public class PaperController extends ControllerSupport{
      * @param filesName
      * @return
      */
+    @ResponseBody
     @ApiOperation(value="上传音频文件检查",notes="上传音频文件检查")
     @PostMapping(value="/checkRadioFile/{paperId}")
     public ResponseEntity<Object> checkRadioFile(@PathVariable String paperId,@RequestBody List<String> filesName){
@@ -551,6 +579,7 @@ public class PaperController extends ControllerSupport{
     	return new ResponseEntity<Object>(errorMessage,HttpStatus.OK);
     }
     
+    @ResponseBody
     @ApiOperation(value="上传音频文件", notes="上传音频文件")
     @PostMapping(value="/uploadRadio/{paperId}")
     public ResponseEntity<Object> uploadRadio(List<MultipartFile> files,@PathVariable String paperId){
@@ -570,37 +599,35 @@ public class PaperController extends ControllerSupport{
      */
     @ApiOperation(value="根据id获取试卷的html片段集合", notes="根据id获取试卷的html片段集合")
     @GetMapping(value="/paper/pdf/{paperId}")
-    public ResponseEntity<Object> getPaperPDFById(@PathVariable String paperId){
+    public ModelAndView getPaperPDFById(@PathVariable String paperId){
+    	ModelAndView view = new ModelAndView("pdf");
     	Map<String, Object> mag;
 		try {
 			mag = paperService.getPaperPDF(paperId);
-			return new ResponseEntity<Object>(mag,HttpStatus.OK);
+			view.addObject("htmlList", JsonUtil.toJson(mag.get("htmlList")));
+			view.addObject("courseName", mag.get("courseName"));
+			view.addObject("courseNo", mag.get("courseNo"));
+			return view;
 		} catch (Exception e) {
 			e.printStackTrace();
-			return new ResponseEntity<Object>(e.getMessage(),HttpStatus.OK);
+			return view;
 		}
     }
     
     @ApiOperation(value="传送到印刷平台", notes="传送到印刷平台")
-    @GetMapping(value="/sendPrint/{paperId}/{paperHtmlUrl}/{examId}")
+    @GetMapping(value="/sendPrint/{paperId}/{examId}/{orgId}")
     public ResponseEntity<Object> sendPrint(@PathVariable String paperId,
-    										@PathVariable String paperHtmlUrl,
+    										@PathVariable String orgId,
     										@PathVariable String examId){
     	User user = getAccessUser();
     	if(user == null){
     		return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
     	}
-    	String message = paperService.sendPrint(paperId,paperHtmlUrl,examId,user);
+    	String message = paperService.sendPrint(paperId,orgId,examId,user);
     	return new ResponseEntity<Object>(message,HttpStatus.OK);
     }
     
-    @ApiOperation(value="根据试卷id查询主观题与客观题数量", notes="根据试卷id查询主观题与客观题数量")
-    @GetMapping(value="/questionStructure")
-    public QuestionAllTypeDto findQuestionStructure(@RequestParam("paperId") String paperId, @RequestHeader("user_token") String user_token) throws Exception{
-    	User user = getAccessUser();
-		return paperService.findQuestionStructure(paperId,user);
-    }
-    
+    @ResponseBody
     @ApiOperation(value="根绝试卷id查询不同类型,题的数量")
     @GetMapping(value="/paper/questionNumbers/{paperId}/{publicityType}/{difficultyType}")
     public ResponseEntity<Object> questionNumbers(@PathVariable String paperId,
@@ -610,6 +637,7 @@ public class PaperController extends ControllerSupport{
     	return new ResponseEntity<Object>(total,HttpStatus.OK);
     }
     
+    @ResponseBody
     @ApiOperation(value="根绝试卷id查询不同类型,题的数量")
     @GetMapping(value="/paper/questionScores/{paperId}/{publicityType}/{difficultyType}")
     public ResponseEntity<Object> questionScores(@PathVariable String paperId,

+ 19 - 0
examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/provider/ExtractConfigCloudServiceProvider.java

@@ -153,5 +153,24 @@ public class ExtractConfigCloudServiceProvider implements ExtractConfigCloudServ
 		resp.setDefaultQuestion(defaultQuestion);
 		return resp;
 	}
+
+	@ApiOperation(value = "根据试卷id查询主观题与客观题数量")
+	@PostMapping("getQuestionStructure")
+	@Override
+	public GetQuestionListResp getQuestionStructure(GetBasePaperReq req) {
+		String paperId = req.getPaperId();
+		if (null == paperId) {
+			throw new StatusException("Q-010163", "paperId is null");
+		}
+		try {
+			String json = extractConfigExamService.getQuestionStructure(paperId);
+			GetQuestionListResp resp = new GetQuestionListResp();
+			resp.setJson(json);
+			return resp;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
 	
 }

+ 8 - 0
examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/provider/HandleSyncCloudServiceProvider.java

@@ -19,12 +19,14 @@ import cn.com.qmth.examcloud.commons.api.request.SyncExamStudentReq;
 import cn.com.qmth.examcloud.commons.api.request.SyncOrgReq;
 import cn.com.qmth.examcloud.commons.api.request.SyncSpecialtyReq;
 import cn.com.qmth.examcloud.commons.api.request.SyncStudentReq;
+import cn.com.qmth.examcloud.commons.api.request.SyncUserReq;
 import cn.com.qmth.examcloud.commons.api.response.SyncCourseResp;
 import cn.com.qmth.examcloud.commons.api.response.SyncExamResp;
 import cn.com.qmth.examcloud.commons.api.response.SyncExamStudentResp;
 import cn.com.qmth.examcloud.commons.api.response.SyncOrgResp;
 import cn.com.qmth.examcloud.commons.api.response.SyncSpecialtyResp;
 import cn.com.qmth.examcloud.commons.api.response.SyncStudentResp;
+import cn.com.qmth.examcloud.commons.api.response.SyncUserResp;
 import cn.com.qmth.examcloud.commons.base.exception.StatusException;
 import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
 import cn.com.qmth.examcloud.core.questions.base.CommonUtils;
@@ -207,4 +209,10 @@ public class HandleSyncCloudServiceProvider extends ControllerSupport implements
 		return null;
 	}
 
+	@Override
+	public SyncUserResp syncUser(SyncUserReq req) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
 }

+ 5 - 0
examcloud-core-questions-base/pom.xml

@@ -99,6 +99,11 @@
 			<artifactId>examcloud-core-basic-api-client</artifactId>
 			<version>${examcloud.version}</version>
 		</dependency>
+		<dependency>
+			<groupId>cn.com.qmth.examcloud.rmi</groupId>
+			<artifactId>examcloud-core-print-api-client</artifactId>
+			<version>${examcloud.version}</version>
+		</dependency>
 	</dependencies>
 
 </project>

+ 7 - 0
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/ExtractConfigProviderService.java

@@ -52,4 +52,11 @@ public interface ExtractConfigProviderService {
 	 * @return
 	 */
 	public List<String> getAnswer(String questionId);
+	
+	/**
+	 * 根据试卷id查询主观题与客观题数量
+	 * @param paperId
+	 * @return
+	 */
+	public String getQuestionStructure(String paperId) throws Exception;
 }

+ 2 - 3
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/PaperService.java

@@ -12,7 +12,6 @@ import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
 import cn.com.qmth.examcloud.commons.web.security.bean.User;
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperDetailUnitExp;
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperExp;
-import cn.com.qmth.examcloud.core.questions.service.bean.dto.QuestionAllTypeDto;
 import cn.com.qmth.examcloud.core.questions.dao.entity.Paper;
 import cn.com.qmth.examcloud.core.questions.dao.entity.PaperDetail;
 import cn.com.qmth.examcloud.core.questions.dao.entity.PaperDetailUnit;
@@ -267,13 +266,13 @@ public interface PaperService {
 	 * @param paperId
 	 * @param paperHtmlUrl
 	 */
-	public String sendPrint(String paperId, String paperHtmlUrl, String examId, User user);
+	public String sendPrint(String paperId, String orgId, String examId);
 
 	/**
 	 * 根据试卷id查询主观题与客观题的数量
 	 * @param paperId
 	 */
-	public QuestionAllTypeDto findQuestionStructure(String paperId,User user) throws Exception;
+	public String findQuestionStructure(String paperId) throws Exception;
 	
 	/**
      * 导出试卷Dto

+ 74 - 47
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/dto/ObjectiveQuestionStructure.java

@@ -19,11 +19,16 @@ public class ObjectiveQuestionStructure implements Serializable{
 	 * 
 	 */
 	private static final long serialVersionUID = -4064781474344761068L;
+	
+	/**
+	 * 课程ID
+	 */
+	private Long courseId;
 	/**
 	 * 课程代码
 	 */
 	@ExcelProperty(name="课程代码",index = 0)
-	private String courseNo;
+	private String courseCode;
 	/**
 	 * 课程名称
 	 */
@@ -45,12 +50,12 @@ public class ObjectiveQuestionStructure implements Serializable{
 	 * 大题号
 	 */
 	@ExcelProperty(name="大题号",index = 4)
-	private Integer bigQuestionNo;
+	private Integer sectionNum;
 	/**
 	 * 小题号
 	 */
 	@ExcelProperty(name="小题号",index = 5)
-	private Integer smallQuestionNo;
+	private Integer unitNum;
 	/**
 	 * 题目类型
 	 */
@@ -65,19 +70,20 @@ public class ObjectiveQuestionStructure implements Serializable{
 	 * 小题分数
 	 */
 	@ExcelProperty(name="小题分数",index = 8)
-	private Double smallQuestionScore;
+	private Double unitScore;
 	
 	public ObjectiveQuestionStructure(){}
 	
 	public ObjectiveQuestionStructure(PaperExp paperExp,PaperDetailExp paperDetailExp,PaperDetailUnitExp unit,String paperType){
+		this.courseId = Long.valueOf(paperExp.getCourse().getId());
 		this.paperType = paperType;
 		this.paperName = paperExp.getName();
-		this.courseNo = paperExp.getCourseNo();
+		this.courseCode = paperExp.getCourseNo();
 		this.courseName = paperExp.getCourseName();
-		this.bigQuestionNo = paperDetailExp.getNumber();
+		this.sectionNum = paperDetailExp.getNumber();
 		this.questionType = unit.getQuestionType().getName();
-		this.smallQuestionNo = unit.getNumber();
-		this.smallQuestionScore = unit.getScore();
+		this.unitNum = unit.getNumber();
+		this.unitScore = unit.getScore();
 		if(StringUtils.isNotBlank(unit.getQuestion().getQuesAnswer())){
 			if(unit.getQuestionType()==QuesStructType.BOOL_ANSWER_QUESTION){
 				if("正确".equals(unit.getQuestion().getQuesAnswer())){
@@ -97,12 +103,12 @@ public class ObjectiveQuestionStructure implements Serializable{
 	
 	
 	public ObjectiveQuestionStructure(PaperExp paperExp,PaperDetailExp paperDetailExp,PaperDetailUnitExp unit){
-		this.courseNo = paperExp.getCourseNo();
+		this.courseCode = paperExp.getCourseNo();
 		this.courseName = paperExp.getCourseName();
-		this.bigQuestionNo = paperDetailExp.getNumber();
+		this.sectionNum = paperDetailExp.getNumber();
 		this.questionType = unit.getQuestionType().getName();
-		this.smallQuestionNo = unit.getNumber();
-		this.smallQuestionScore = unit.getScore();
+		this.unitNum = unit.getNumber();
+		this.unitScore = unit.getScore();
 		if(StringUtils.isNotBlank(unit.getQuestion().getQuesAnswer())){
 			if(unit.getQuestionType()==QuesStructType.BOOL_ANSWER_QUESTION){
 				if("正确".equals(unit.getQuestion().getQuesAnswer())){
@@ -121,12 +127,12 @@ public class ObjectiveQuestionStructure implements Serializable{
 	}
 	
 	public ObjectiveQuestionStructure(PaperExp paperExp,PaperDetailExp paperDetailExp,Question question){
-		this.courseNo = paperExp.getCourseNo();
+		this.courseCode = paperExp.getCourseNo();
 		this.courseName = paperExp.getCourseName();
-		this.bigQuestionNo = paperDetailExp.getNumber();
+		this.sectionNum = paperDetailExp.getNumber();
 		this.questionType = question.getQuestionType().getName();
-		this.smallQuestionNo = question.getNumber();
-		this.smallQuestionScore = question.getScore();
+		this.unitNum = question.getNumber();
+		this.unitScore = question.getScore();
 		if(StringUtils.isNotBlank(question.getQuesAnswer())){
 			if(question.getQuestionType()==QuesStructType.BOOL_ANSWER_QUESTION){
 				if("正确".equals(question.getQuesAnswer())){
@@ -143,64 +149,85 @@ public class ObjectiveQuestionStructure implements Serializable{
 			}
 		}
 	}
-	
-	public String getCourseNo() {
-		return courseNo;
+
+	public Long getCourseId() {
+		return courseId;
 	}
-	public void setCourseNo(String courseNo) {
-		this.courseNo = courseNo;
+
+	public void setCourseId(Long courseId) {
+		this.courseId = courseId;
 	}
+
+	public String getCourseCode() {
+		return courseCode;
+	}
+
+	public void setCourseCode(String courseCode) {
+		this.courseCode = courseCode;
+	}
+
 	public String getCourseName() {
 		return courseName;
 	}
+
 	public void setCourseName(String courseName) {
 		this.courseName = courseName;
 	}
-	public Integer getBigQuestionNo() {
-		return bigQuestionNo;
+
+	public String getPaperName() {
+		return paperName;
+	}
+
+	public void setPaperName(String paperName) {
+		this.paperName = paperName;
+	}
+
+	public String getPaperType() {
+		return paperType;
+	}
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
+	}
+
+	public Integer getSectionNum() {
+		return sectionNum;
 	}
-	public void setBigQuestionNo(Integer bigQuestionNo) {
-		this.bigQuestionNo = bigQuestionNo;
+
+	public void setSectionNum(Integer sectionNum) {
+		this.sectionNum = sectionNum;
 	}
-	public Integer getSmallQuestionNo() {
-		return smallQuestionNo;
+
+	public Integer getUnitNum() {
+		return unitNum;
 	}
-	public void setSmallQuestionNo(Integer smallQuestionNo) {
-		this.smallQuestionNo = smallQuestionNo;
+
+	public void setUnitNum(Integer unitNum) {
+		this.unitNum = unitNum;
 	}
+
 	public String getQuestionType() {
 		return questionType;
 	}
+
 	public void setQuestionType(String questionType) {
 		this.questionType = questionType;
 	}
+
 	public String getAnswer() {
 		return answer;
 	}
+
 	public void setAnswer(String answer) {
 		this.answer = answer;
 	}
-	public Double getSmallQuestionScore() {
-		return smallQuestionScore;
-	}
-	public void setSmallQuestionScore(Double smallQuestionScore) {
-		this.smallQuestionScore = smallQuestionScore;
-	}
 
-	public String getPaperName() {
-		return paperName;
-	}
-
-	public void setPaperName(String paperName) {
-		this.paperName = paperName;
+	public Double getUnitScore() {
+		return unitScore;
 	}
 
-	public String getPaperType() {
-		return paperType;
-	}
-
-	public void setPaperType(String paperType) {
-		this.paperType = paperType;
+	public void setUnitScore(Double unitScore) {
+		this.unitScore = unitScore;
 	}
 	
 }

+ 56 - 0
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/dto/PaperQuestionStructureInfo.java

@@ -0,0 +1,56 @@
+package cn.com.qmth.examcloud.core.questions.service.bean.dto;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import cn.com.qmth.examcloud.commons.web.cloud.api.JsonSerializable;
+
+/**
+ * @author 		weiwenhai
+ * @date 		2018.4.19
+ * @company		qmth
+ * @describle   主观题可以客观题集合
+ */
+public class PaperQuestionStructureInfo implements JsonSerializable {
+	
+	private static final long serialVersionUID = -2018523006958760481L;
+	/**
+     * 客观题列表
+     */
+    private List<ObjectiveQuestionStructure> objectives;
+    /**
+     * 主观题列表
+     */
+    private List<SubjectiveQuestionStructure> subjectives;
+
+    public void addObjective(ObjectiveQuestionStructure objective) {
+        if (objectives == null) {
+            objectives = new ArrayList<>();
+        }
+        objectives.add(objective);
+    }
+
+    public void addSubjective(SubjectiveQuestionStructure subjective) {
+        if (subjectives == null) {
+            subjectives = new ArrayList<>();
+        }
+        subjectives.add(subjective);
+    }
+
+    public List<ObjectiveQuestionStructure> getObjectives() {
+        return objectives;
+    }
+
+    public void setObjectives(List<ObjectiveQuestionStructure> objectives) {
+        this.objectives = objectives;
+    }
+
+    public List<SubjectiveQuestionStructure> getSubjectives() {
+        return subjectives;
+    }
+
+    public void setSubjectives(List<SubjectiveQuestionStructure> subjectives) {
+        this.subjectives = subjectives;
+    }
+
+}

+ 0 - 42
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/dto/QuestionAllTypeDto.java

@@ -1,42 +0,0 @@
-package cn.com.qmth.examcloud.core.questions.service.bean.dto;
-
-import java.util.List;
-
-/**
- * @author 		weiwenhai
- * @date 		2018.4.19
- * @company		qmth
- * @describle   主观题可以客观题集合
- */
-public class QuestionAllTypeDto {
-
-	private List<ObjectiveQuestionStructure> objectiveQuestionStructureList;
-	
-	private List<SubjectiveQuestionStructure> subjectiveQuestionStructureList;
-	
-	public QuestionAllTypeDto(){}
-	
-	public QuestionAllTypeDto(List<ObjectiveQuestionStructure> objectiveQuestionStructureList,List<SubjectiveQuestionStructure> subjectiveQuestionStructureList){
-		this.objectiveQuestionStructureList = objectiveQuestionStructureList;
-		this.subjectiveQuestionStructureList = subjectiveQuestionStructureList;
-	}
-
-	public List<ObjectiveQuestionStructure> getObjectiveQuestionStructureList() {
-		return objectiveQuestionStructureList;
-	}
-
-	public void setObjectiveQuestionStructureList(
-			List<ObjectiveQuestionStructure> objectiveQuestionStructureList) {
-		this.objectiveQuestionStructureList = objectiveQuestionStructureList;
-	}
-
-	public List<SubjectiveQuestionStructure> getSubjectiveQuestionStructureList() {
-		return subjectiveQuestionStructureList;
-	}
-
-	public void setSubjectiveQuestionStructureList(
-			List<SubjectiveQuestionStructure> subjectiveQuestionStructureList) {
-		this.subjectiveQuestionStructureList = subjectiveQuestionStructureList;
-	}
-	
-}

+ 67 - 45
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/dto/SubjectiveQuestionStructure.java

@@ -15,11 +15,16 @@ public class SubjectiveQuestionStructure implements Serializable{
 	 * 
 	 */
 	private static final long serialVersionUID = 1130718763453256519L;
+	
+	/**
+	 * 课程Id
+	 */
+	private Long courseId;
 	/**
 	 * 课程代码
 	 */
 	@ExcelProperty(name="科目代码",index = 0)
-	private String courseNo;
+	private String courseCode;
 	/**
 	 * 课程名称
 	 */
@@ -40,99 +45,116 @@ public class SubjectiveQuestionStructure implements Serializable{
 	 * 大题号
 	 */
 	@ExcelProperty(name="大题号",index = 4)
-	private Integer bigQuestionNo;
+	private Integer sectionNum;
 	/**
 	 * 大题名称
 	 */
 	@ExcelProperty(name="大题名称",index = 5)
-	private String bigQuestionName;
+	private String sectionName;
 	/**
 	 * 小题号
 	 */
 	@ExcelProperty(name="小题号",index = 6)
-	private Integer smallQuestionNo;
+	private Integer unitNum;
 	/**
 	 * 小题分数
 	 */
 	@ExcelProperty(name="满分",index = 7)
-	private Double questionScore;
+	private Double unitScore;
 	
 	public SubjectiveQuestionStructure(){}
 	
 	public SubjectiveQuestionStructure(PaperExp paperExp,PaperDetailExp paperDetailExp,PaperDetailUnitExp unit){
-		this.courseNo = paperExp.getCourseNo();
+		this.courseCode = paperExp.getCourseNo();
 		this.courseName = paperExp.getCourseName();
-		this.bigQuestionNo = paperDetailExp.getNumber();
-		this.bigQuestionName = paperDetailExp.getName();
-		this.smallQuestionNo = unit.getNumber();
-		this.questionScore = unit.getScore();
+		this.sectionNum = paperDetailExp.getNumber();
+		this.sectionName = paperDetailExp.getName();
+		this.unitNum = unit.getNumber();
+		this.unitScore = unit.getScore();
 	}
 	
 	public SubjectiveQuestionStructure(PaperExp paperExp,PaperDetailExp paperDetailExp,PaperDetailUnitExp unit,String paperType){
+		this.courseId = Long.valueOf(paperExp.getCourse().getId());
 		this.paperName = paperExp.getName();
 		this.paperType = paperType;
-		this.courseNo = paperExp.getCourseNo();
+		this.courseCode = paperExp.getCourseNo();
 		this.courseName = paperExp.getCourseName();
-		this.bigQuestionNo = paperDetailExp.getNumber();
-		this.bigQuestionName = paperDetailExp.getName();
-		this.smallQuestionNo = unit.getNumber();
-		this.questionScore = unit.getScore();
+		this.sectionNum = paperDetailExp.getNumber();
+		this.sectionName = paperDetailExp.getName();
+		this.unitNum = unit.getNumber();
+		this.unitScore = unit.getScore();
 	}
-	
-	
-	public String getCourseNo() {
-		return courseNo;
+
+	public Long getCourseId() {
+		return courseId;
+	}
+
+	public void setCourseId(Long courseId) {
+		this.courseId = courseId;
+	}
+
+	public String getCourseCode() {
+		return courseCode;
 	}
-	public void setCourseNo(String courseNo) {
-		this.courseNo = courseNo;
+
+	public void setCourseCode(String courseCode) {
+		this.courseCode = courseCode;
 	}
+
 	public String getCourseName() {
 		return courseName;
 	}
+
 	public void setCourseName(String courseName) {
 		this.courseName = courseName;
 	}
-	public Integer getBigQuestionNo() {
-		return bigQuestionNo;
+
+	public String getPaperName() {
+		return paperName;
 	}
-	public void setBigQuestionNo(Integer bigQuestionNo) {
-		this.bigQuestionNo = bigQuestionNo;
+
+	public void setPaperName(String paperName) {
+		this.paperName = paperName;
 	}
-	public String getBigQuestionName() {
-		return bigQuestionName;
+
+	public String getPaperType() {
+		return paperType;
 	}
-	public void setBigQuestionName(String bigQuestionName) {
-		this.bigQuestionName = bigQuestionName;
+
+	public void setPaperType(String paperType) {
+		this.paperType = paperType;
 	}
-	public Integer getSmallQuestionNo() {
-		return smallQuestionNo;
+
+	public Integer getSectionNum() {
+		return sectionNum;
 	}
-	public void setSmallQuestionNo(Integer smallQuestionNo) {
-		this.smallQuestionNo = smallQuestionNo;
+
+	public void setSectionNum(Integer sectionNum) {
+		this.sectionNum = sectionNum;
 	}
 
-	public Double getQuestionScore() {
-		return questionScore;
+	public String getSectionName() {
+		return sectionName;
 	}
 
-	public void setQuestionScore(Double questionScore) {
-		this.questionScore = questionScore;
+	public void setSectionName(String sectionName) {
+		this.sectionName = sectionName;
 	}
 
-	public String getPaperName() {
-		return paperName;
+	public Integer getUnitNum() {
+		return unitNum;
 	}
 
-	public void setPaperName(String paperName) {
-		this.paperName = paperName;
+	public void setUnitNum(Integer unitNum) {
+		this.unitNum = unitNum;
 	}
 
-	public String getPaperType() {
-		return paperType;
+	public Double getUnitScore() {
+		return unitScore;
 	}
 
-	public void setPaperType(String paperType) {
-		this.paperType = paperType;
+	public void setUnitScore(Double unitScore) {
+		this.unitScore = unitScore;
 	}
 	
 }

+ 4 - 4
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/export/InitPaperExpService.java

@@ -24,9 +24,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import cn.com.qmth.examcloud.commons.base.exception.StatusException;
 import cn.com.qmth.examcloud.core.questions.base.core.enums.CourseLevel;
 import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
-
 import cn.com.qmth.examcloud.core.questions.dao.AudioTimeConfigRepo;
 import cn.com.qmth.examcloud.core.questions.dao.PaperDetailRepo;
 import cn.com.qmth.examcloud.core.questions.dao.PaperDetailUnitRepo;
@@ -45,7 +45,6 @@ import cn.com.qmth.examcloud.core.questions.dao.entity.Question;
 import cn.com.qmth.examcloud.core.questions.service.QuestionAudioService;
 import cn.com.qmth.examcloud.core.questions.base.BeanCopierUtil;
 import cn.com.qmth.examcloud.core.questions.base.CommonUtils;
-import cn.com.qmth.examcloud.core.questions.base.exception.PaperException;
 import cn.com.qmth.examcloud.core.questions.base.word.DocxProcessUtil;
 
 
@@ -53,6 +52,7 @@ import cn.com.qmth.examcloud.core.questions.base.word.DocxProcessUtil;
  * @describle 初始化导出对象service
  * @author weiwenhai 
  * @date 2017.10.17
+ * @code 090
  */
 @Service("initPaperExpService")
 public  class InitPaperExpService {
@@ -124,12 +124,12 @@ public  class InitPaperExpService {
      * @return
      * @throws Exception
      */
-    public PaperExp initPaperExp(String paperId) throws Exception{
+    public PaperExp initPaperExp(String paperId){
     	//根据paperId取到paper对象
     	Paper paper = paperRepo.findOne(paperId);
     	//paperService.formatPaper(paper, null);
     	if (paper == null) {
-			throw new PaperException("该试卷不存在");
+			throw new StatusException("Q-090133","该试卷不存在");
 		}
     	//创建试卷导出的dto
     	PaperExp paperExpDto = BeanCopierUtil.copyProperties(paper, PaperExp.class);

+ 10 - 0
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/ExtractConfigProviderServiceImpl.java

@@ -40,6 +40,7 @@ import cn.com.qmth.examcloud.core.questions.dao.entity.Question;
 import cn.com.qmth.examcloud.core.questions.dao.entity.QuestionAudio;
 import cn.com.qmth.examcloud.core.questions.service.ExtractConfigProviderService;
 import cn.com.qmth.examcloud.core.questions.service.ExtractConfigService;
+import cn.com.qmth.examcloud.core.questions.service.PaperService;
 import cn.com.qmth.examcloud.core.questions.service.QuesService;
 import cn.com.qmth.examcloud.core.questions.service.QuestionAudioService;
 import cn.com.qmth.examcloud.question.core.paper.DefaultPaper;
@@ -87,6 +88,9 @@ public class ExtractConfigProviderServiceImpl implements ExtractConfigProviderSe
     
     @Autowired
     private QuesService quesService;
+    
+    @Autowired
+    private PaperService paperService;
 	
 	@Value("${upyun.downloadUrl}")
 	private String downloadUrl;
@@ -666,5 +670,11 @@ public class ExtractConfigProviderServiceImpl implements ExtractConfigProviderSe
 		}
 		return list;
 	}
+
+	@Override
+	public String getQuestionStructure(String paperId) throws Exception {
+		String json = paperService.findQuestionStructure(paperId);
+		return json;
+	}
 	
 }

+ 25 - 19
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/PaperServiceImpl.java

@@ -46,9 +46,12 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.Assert;
 import org.springframework.web.multipart.MultipartFile;
 
+import cn.com.qmth.examcloud.core.print.api.CoursePaperCloudService;
+import cn.com.qmth.examcloud.core.print.api.bean.SyncCoursePaperBean;
 import cn.com.qmth.examcloud.core.questions.base.print.CoursePaperDto;
 import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
 import cn.com.qmth.examcloud.core.questions.base.word.DocxProcessUtil;
+import cn.com.qmth.examcloud.commons.base.util.JsonUtil;
 import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
 import cn.com.qmth.examcloud.commons.web.security.bean.User;
 
@@ -63,7 +66,7 @@ import cn.com.qmth.examcloud.core.questions.service.bean.dto.ObjectiveQuestionSt
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperDetailExp;
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperDetailUnitExp;
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperExp;
-import cn.com.qmth.examcloud.core.questions.service.bean.dto.QuestionAllTypeDto;
+import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperQuestionStructureInfo;
 import cn.com.qmth.examcloud.core.questions.service.bean.dto.SubjectiveQuestionStructure;
 import cn.com.qmth.examcloud.core.questions.dao.entity.ExamPaper;
 import cn.com.qmth.examcloud.core.questions.dao.entity.ExportServiceManage;
@@ -179,6 +182,9 @@ public class PaperServiceImpl implements PaperService{
     @Value("${$redis.paper.prefix}")
     private String redisPaperPrefix;
     
+    @Autowired
+    private CoursePaperCloudService coursePaperCloudService;
+    
     public static final String TEMP_FILE_EXP = "docxExport/";
 
     /**
@@ -1332,29 +1338,25 @@ public class PaperServiceImpl implements PaperService{
 	}
 
 	@Override
-	public String sendPrint(String paperId, String paperHtmlUrl, String examId, User user) {
+	public String sendPrint(String paperId, String orgId, String examId) {
 		//查询原paper对象
 		Paper paper = paperRepo.findOne(paperId);
-		CoursePaperDto coursePaperDto = new CoursePaperDto();
-		coursePaperDto.setOrgId(user.getRootOrgId());
-		coursePaperDto.setPaperId(paper.getId());
-		coursePaperDto.setPaperName(paper.getName());
-		coursePaperDto.setExamId(Long.parseLong(examId));
-		coursePaperDto.setPaperHtmlUrl(paperHtmlUrl);
-		coursePaperDto.setCourseCode(paper.getCourse().getCode());
-		coursePaperDto.setCourseName(paper.getCourse().getName());
-		//远程调用印刷平台接口,把对象传值过去
-		String message = printCoursePaperClient.saveCoursePaper(user.getToken(), coursePaperDto);
-		return message;
+		SyncCoursePaperBean bean = new SyncCoursePaperBean();
+		bean.setOrgId(Long.valueOf(orgId));
+		bean.setExamId(Long.valueOf(examId));
+		bean.setCourseId(Long.valueOf(paper.getCourse().getId()));
+		bean.setCourseCode(paper.getCourse().getCode());
+		bean.setCourseName(paper.getCourse().getName());
+		bean.setPaperId(paper.getId());
+		bean.setPaperName(paper.getName());
+		
+		return "";
 	}
 
 	@Override
-	public QuestionAllTypeDto findQuestionStructure(String paperId,User user) throws Exception {
+	public String findQuestionStructure(String paperId) throws Exception {
 		//根据paperId查询新的对象
-		ExportServiceManage esm = exportServiceManageRepo.findByOrgName(user.getRootOrgName());
-		if(esm == null){
-			esm = exportServiceManageRepo.findByOrgName("陕西师范大学");
-		}
+		ExportServiceManage esm = exportServiceManageRepo.findByOrgName("陕西师范大学");
     	ExportPaperAbstractService exportPaperAbstractService = (ExportPaperAbstractService) SpringContextUtils.getBeanById(esm.getExportServiceName());
     	PaperExp paperExp = exportPaperAbstractService.initPaperExp(paperId);
     	//得到试卷中的客观大题
@@ -1377,7 +1379,11 @@ public class PaperServiceImpl implements PaperService{
     			subjectiveQuestionStructureList.add(new SubjectiveQuestionStructure(paperExp,paperDetailExp,unit,null));
     		}
     	}
-    	return new QuestionAllTypeDto(objectiveQuestionStructureList, subjectiveQuestionStructureList);
+    	PaperQuestionStructureInfo info = new PaperQuestionStructureInfo();
+    	info.setObjectives(objectiveQuestionStructureList);
+    	info.setSubjectives(subjectiveQuestionStructureList);
+    	String jsonResp = JsonUtil.toJson(info);
+    	return jsonResp;
 	}
 
 	public List<PaperDetailExp> buildPaperDetailExp(List<PaperDetailExp> objectiveDetails) {

+ 2 - 1
examcloud-core-questions-starter/src/main/resources/security-exclusions.conf

@@ -19,4 +19,5 @@ regexp:.*webjars.*
 [${api_cqb}/][/questionAudio/{questionAudioId}][GET]
 [${api_cqb}/][/extract/getAnswerHtml/{paperId}][GET]
 [${api_cqb}/][/extract/paper/{paperId}][GET]
-[${api_cqb}/][/checkObjective/{paperId}][GET]
+[${api_cqb}/][/checkObjective/{paperId}][GET]
+[${api_cqb}/][/paper/pdf/{paperId}][GET]