Browse Source

Merge remote-tracking branch 'origin/hotfixes_v5.0.1_20230904_updates' into dev_v5.0.2

# Conflicts:
#	examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/controller/ExtractConfigController.java
#	examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/extract/SaveRandomPaperExtractConfigDomain.java
#	examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/ExtractConfigServiceImpl.java
deason 1 year ago
parent
commit
826c02b109

+ 4 - 9
examcloud-core-questions-api-provider/src/main/java/cn/com/qmth/examcloud/core/questions/api/controller/ExtractConfigController.java

@@ -15,13 +15,7 @@ import org.springframework.data.domain.Page;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
 
 
 import cn.com.qmth.examcloud.api.commons.enums.AdminOperateType;
 import cn.com.qmth.examcloud.api.commons.enums.AdminOperateType;
 import cn.com.qmth.examcloud.api.commons.enums.CallType;
 import cn.com.qmth.examcloud.api.commons.enums.CallType;
@@ -375,10 +369,11 @@ public class ExtractConfigController extends ControllerSupport {
 		String answerHtml = extractConfigService.getAnswerHtml(paperId);
 		String answerHtml = extractConfigService.getAnswerHtml(paperId);
 		return new ResponseEntity<>(answerHtml, HttpStatus.OK);
 		return new ResponseEntity<>(answerHtml, HttpStatus.OK);
 	}
 	}
-	
+
+	@ResponseBody
 	@ApiOperation("随机抽卷调卷规则创建")
 	@ApiOperation("随机抽卷调卷规则创建")
     @PostMapping("extract_config/randompaper/save")
     @PostMapping("extract_config/randompaper/save")
-	public void saveRandomPaperExtractConfig(SaveRandomPaperExtractConfigDomain req) {
+	public void saveRandomPaperExtractConfig(@RequestBody SaveRandomPaperExtractConfigDomain req) {
     	extractConfigService.saveExtractConfigForRandomPaper(getAccessUser().getRootOrgId(),req);
     	extractConfigService.saveExtractConfigForRandomPaper(getAccessUser().getRootOrgId(),req);
 	}
 	}
 
 

+ 37 - 26
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/bean/extract/SaveRandomPaperExtractConfigDomain.java

@@ -2,40 +2,51 @@ package cn.com.qmth.examcloud.core.questions.service.bean.extract;
 
 
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 
 
-public class SaveRandomPaperExtractConfigDomain{
+public class SaveRandomPaperExtractConfigDomain {
 
 
-	@ApiModelProperty(value = "考试编码(不传时取考试名称)", example = "xxxxxx", required = true)
-	private String examCode;
+    @ApiModelProperty(value = "考试ID(为空时取考试编码的值)", required = false)
+    private Long examId;
 
 
-	@ApiModelProperty(value = "考试名称", example = "2018年6月期末考试", required = true)
-	private String examName;
+    @ApiModelProperty(value = "考试编码(为空时取考试名称的值)", required = false)
+    private String examCode;
 
 
-	@ApiModelProperty(value = " 课程代码", example = "xxxxxx", required = true)
-	private String courseCode;
+    @ApiModelProperty(value = "考试名称(为空时取考试ID或考试编码的值)", required = false)
+    private String examName;
 
 
-	public String getExamCode() {
-		return examCode;
-	}
+    @ApiModelProperty(value = " 课程代码", required = true)
+    private String courseCode;
 
 
-	public void setExamCode(String examCode) {
-		this.examCode = examCode;
-	}
+    public Long getExamId() {
+        return examId;
+    }
 
 
-	public String getExamName() {
-		return examName;
-	}
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
 
 
-	public void setExamName(String examName) {
-		this.examName = examName;
-	}
+    public String getExamCode() {
+        return examCode;
+    }
 
 
-	public String getCourseCode() {
-		return courseCode;
-	}
+    public void setExamCode(String examCode) {
+        this.examCode = examCode;
+    }
+
+    public String getExamName() {
+        return examName;
+    }
+
+    public void setExamName(String examName) {
+        this.examName = examName;
+    }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
 
 
-	public void setCourseCode(String courseCode) {
-		this.courseCode = courseCode;
-	}
 
 
-	
 }
 }

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

@@ -1468,6 +1468,7 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
     	}
     	}
     	GetExamReq examReq=new GetExamReq();
     	GetExamReq examReq=new GetExamReq();
     	examReq.setRootOrgId(rootOrgId);
     	examReq.setRootOrgId(rootOrgId);
+    	examReq.setId(req.getExamId());
     	examReq.setName(req.getExamName());
     	examReq.setName(req.getExamName());
     	examReq.setCode(req.getExamCode());
     	examReq.setCode(req.getExamCode());
     	GetExamResp examRes=examCloudService.getExam(examReq);
     	GetExamResp examRes=examCloudService.getExam(examReq);