xiatian 2 ani în urmă
părinte
comite
1b8bc9eba8

+ 3 - 2
examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/controller/RandomPaperController.java

@@ -14,6 +14,7 @@ import cn.com.qmth.examcloud.api.commons.enums.DataRuleType;
 import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.api.commons.security.bean.UserDataRule;
 import cn.com.qmth.examcloud.core.questions.service.RandomPaperService;
+import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.PaperQuestionViewQuery;
 import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.RandomPaperDomain;
 import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.RandomPaperListVo;
 import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.RandomPaperQuery;
@@ -62,8 +63,8 @@ public class RandomPaperController extends ControllerSupport {
 
 	@ApiOperation(value = "选中试卷范围预览")
 	@PostMapping("struct/question/view/info")
-	public StructInfo getPaperQuestionViewInfo(@RequestParam String structId, @RequestParam List<String> paperIds) {
-		return randomPaperService.getPaperQuestionViewInfo(structId,paperIds);
+	public StructInfo getPaperQuestionViewInfo(PaperQuestionViewQuery query) {
+		return randomPaperService.getPaperQuestionViewInfo(query);
 	}
 	
 	@ApiOperation(value = "保存模板")

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

@@ -1,10 +1,9 @@
 package cn.com.qmth.examcloud.core.questions.service;
 
-import java.util.List;
-
 import org.springframework.data.domain.Page;
 
 import cn.com.qmth.examcloud.api.commons.security.bean.User;
+import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.PaperQuestionViewQuery;
 import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.RandomPaperDomain;
 import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.RandomPaperListVo;
 import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.RandomPaperQuery;
@@ -21,7 +20,7 @@ public interface RandomPaperService {
 
 	StructInfo saveRandomPaper(RandomPaperDomain domain);
 
-	StructInfo getPaperQuestionViewInfo(String structId, List<String> paperIds);
+	StructInfo getPaperQuestionViewInfo(PaperQuestionViewQuery query);
 
 	RandomPaperListVo getInfo(String id);
 

+ 21 - 0
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/randompaper/PaperQuestionViewQuery.java

@@ -0,0 +1,21 @@
+package cn.com.qmth.examcloud.core.questions.service.bean.randompaper;
+
+import java.util.List;
+
+public class PaperQuestionViewQuery {
+	private String structId;
+	private List<String> paperIds;
+	public String getStructId() {
+		return structId;
+	}
+	public void setStructId(String structId) {
+		this.structId = structId;
+	}
+	public List<String> getPaperIds() {
+		return paperIds;
+	}
+	public void setPaperIds(List<String> paperIds) {
+		this.paperIds = paperIds;
+	}
+	
+}

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

@@ -48,6 +48,7 @@ import cn.com.qmth.examcloud.core.questions.dao.entity.dto.PaperDetailUnitStruct
 import cn.com.qmth.examcloud.core.questions.service.PaperStructService;
 import cn.com.qmth.examcloud.core.questions.service.RandomPaperService;
 import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.PaperDetailUnitDto;
+import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.PaperQuestionViewQuery;
 import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.QuestionDto;
 import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.RandomPaperDomain;
 import cn.com.qmth.examcloud.core.questions.service.bean.randompaper.RandomPaperListVo;
@@ -245,7 +246,15 @@ public class RandomPaperServiceImpl implements RandomPaperService {
 	}
 
 	@Override
-	public StructInfo getPaperQuestionViewInfo(String structId, List<String> paperIds) {
+	public StructInfo getPaperQuestionViewInfo(PaperQuestionViewQuery query) {
+		String structId=query.getStructId();
+		List<String> paperIds=query.getPaperIds();
+		if (StringUtils.isBlank(structId)) {
+			throw new StatusException("structId不能为空");
+		}
+		if (CollectionUtils.isEmpty(paperIds)) {
+			throw new StatusException("paperIds不能为空");
+		}
 		StructInfo ret = getPaperQuestionInfo(structId, paperIds);
 		clearQuestionIds(ret);
 		return ret;