|
@@ -23,7 +23,9 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
+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.commons.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.core.questions.base.enums.ExportWay;
|
|
|
import cn.com.qmth.examcloud.core.questions.base.enums.PaperSeqMode;
|
|
@@ -38,6 +40,7 @@ import cn.com.qmth.examcloud.core.questions.service.bean.dto.ExportPaperInfoMode
|
|
|
import cn.com.qmth.examcloud.core.questions.service.cache.ExtractConfigCache;
|
|
|
import cn.com.qmth.examcloud.reports.commons.bean.AdminOperateReport;
|
|
|
import cn.com.qmth.examcloud.reports.commons.util.ReportsUtil;
|
|
|
+import cn.com.qmth.examcloud.web.security.DataRule;
|
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.web.support.Naked;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -64,6 +67,7 @@ public class ExtractConfigController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
private ExtractConfigCache extractConfigCache;
|
|
|
|
|
|
+ @DataRule(type = DataRuleType.COURSE)
|
|
|
@ApiOperation(value = "根据考试ID和课程ID获取调卷规则", notes = "根据考试ID和课程ID获取调卷规则")
|
|
|
@GetMapping(value = "/findPageExtractConfig/{currentPage}/{pageSize}")
|
|
|
public ResponseEntity<Object> findPageExtractConfig(@PathVariable int currentPage,
|
|
@@ -72,7 +76,8 @@ public class ExtractConfigController extends ControllerSupport {
|
|
|
@RequestParam("courseNo") String courseNo) {
|
|
|
try {
|
|
|
User user = getAccessUser();
|
|
|
- Page<ExtractConfig> extractConfigPageList = extractConfigService.findPageExtractConfig(currentPage, pageSize, examId, courseNo, String.valueOf(user.getRootOrgId()));
|
|
|
+ UserDataRule ud = getUserDataRule(DataRuleType.COURSE);
|
|
|
+ Page<ExtractConfig> extractConfigPageList = extractConfigService.findPageExtractConfig(currentPage, pageSize, examId, courseNo, String.valueOf(user.getRootOrgId()),ud);
|
|
|
return new ResponseEntity<>(extractConfigPageList, HttpStatus.OK);
|
|
|
} catch (Exception e) {
|
|
|
LOG.error(e.getMessage(), e);
|
|
@@ -162,14 +167,13 @@ public class ExtractConfigController extends ControllerSupport {
|
|
|
return new ResponseEntity<ExtractConfig>(extractConfig, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
+ @DataRule(type = DataRuleType.COURSE)
|
|
|
@ApiOperation(value = "根据考试Id获取已经制定的调卷规则", notes = "根据考试Id获取已经制定的调卷规则")
|
|
|
@GetMapping(value = "/findCourseByExtractConfig/{examId}")
|
|
|
public ResponseEntity<Object> findCourseByExtractConfig(@PathVariable Long examId) {
|
|
|
User user = getAccessUser();
|
|
|
- if (user == null) {
|
|
|
- throw new StatusException("Q-", "user is null");
|
|
|
- }
|
|
|
- List<CouresInfo> courseCodeList = extractConfigService.findCourseByExtractConfig(examId, user.getRootOrgId().toString());
|
|
|
+ UserDataRule ud = getUserDataRule(DataRuleType.COURSE);
|
|
|
+ List<CouresInfo> courseCodeList = extractConfigService.findCourseByExtractConfig(examId, user.getRootOrgId().toString(),ud);
|
|
|
return new ResponseEntity<>(courseCodeList, HttpStatus.OK);
|
|
|
}
|
|
|
|