|
@@ -11,6 +11,7 @@ import cn.com.qmth.examcloud.core.questions.service.ExtractConfigFileService;
|
|
import cn.com.qmth.examcloud.core.questions.service.ExtractConfigService;
|
|
import cn.com.qmth.examcloud.core.questions.service.ExtractConfigService;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.CouresInfo;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.CouresInfo;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.ExportPaperInfoModel;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.ExportPaperInfoModel;
|
|
|
|
+import cn.com.qmth.examcloud.core.questions.service.cache.ExtractConfigCache;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.web.support.Naked;
|
|
import cn.com.qmth.examcloud.web.support.Naked;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -24,7 +25,6 @@ import org.springframework.http.ResponseEntity;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
@@ -50,6 +50,9 @@ public class ExtractConfigController extends ControllerSupport {
|
|
@Autowired
|
|
@Autowired
|
|
private ExtractConfigFileService extractConfigFileService;
|
|
private ExtractConfigFileService extractConfigFileService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ExtractConfigCache extractConfigCache;
|
|
|
|
+
|
|
@ApiOperation(value = "根据考试ID和课程ID获取调卷规则", notes = "根据考试ID和课程ID获取调卷规则")
|
|
@ApiOperation(value = "根据考试ID和课程ID获取调卷规则", notes = "根据考试ID和课程ID获取调卷规则")
|
|
@GetMapping(value = "/findPageExtractConfig/{currentPage}/{pageSize}")
|
|
@GetMapping(value = "/findPageExtractConfig/{currentPage}/{pageSize}")
|
|
public ResponseEntity<Object> findPageExtractConfig(@PathVariable int currentPage,
|
|
public ResponseEntity<Object> findPageExtractConfig(@PathVariable int currentPage,
|
|
@@ -67,13 +70,17 @@ public class ExtractConfigController extends ControllerSupport {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "保存调卷规则", notes = "保存调卷规则")
|
|
@ApiOperation(value = "保存调卷规则", notes = "保存调卷规则")
|
|
- @PutMapping(value = "/extractConfig/{isbuildFile}")
|
|
|
|
- public ResponseEntity<Object> saveExtractConfig(HttpServletRequest request, @PathVariable Integer isbuildFile, @RequestBody ExtractConfig extractConfig) {
|
|
|
|
|
|
+ @PutMapping(value = "/extractConfig/{isBuildFile}")
|
|
|
|
+ public ResponseEntity<Object> saveExtractConfig(@PathVariable Integer isBuildFile, @RequestBody ExtractConfig extractConfig) {
|
|
try {
|
|
try {
|
|
User user = getAccessUser();
|
|
User user = getAccessUser();
|
|
extractConfig.setOrgId(user.getRootOrgId() + "");
|
|
extractConfig.setOrgId(user.getRootOrgId() + "");
|
|
extractConfig.setOrgName(user.getRootOrgName());
|
|
extractConfig.setOrgName(user.getRootOrgName());
|
|
- extractConfigFileService.saveExtractConfigAndBuildPaperFile(extractConfig, isbuildFile, user);
|
|
|
|
|
|
+ extractConfigFileService.saveExtractConfigAndBuildPaperFile(extractConfig, isBuildFile, user);
|
|
|
|
+
|
|
|
|
+ //清除缓存
|
|
|
|
+ extractConfigCache.remove(extractConfig.getExamId(), extractConfig.getCourseCode());
|
|
|
|
+
|
|
return new ResponseEntity<>(HttpStatus.OK);
|
|
return new ResponseEntity<>(HttpStatus.OK);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
logger.error(e.getMessage(), e);
|
|
logger.error(e.getMessage(), e);
|