|
@@ -1,5 +1,6 @@
|
|
|
package cn.com.qmth.stmms.ms.marking.api;
|
|
|
|
|
|
+import cn.com.qmth.stmms.ms.accesscontrol.config.LoginConfig;
|
|
|
import cn.com.qmth.stmms.ms.commons.threadPool.MyThreadPool;
|
|
|
import cn.com.qmth.stmms.ms.commons.utils.SqlUtil;
|
|
|
import cn.com.qmth.stmms.ms.core.cache.ParamCache;
|
|
@@ -17,6 +18,7 @@ import cn.com.qmth.stmms.ms.marking.assembler.LevelStatAssembler;
|
|
|
import cn.com.qmth.stmms.ms.marking.assembler.MarkerAssembler;
|
|
|
import cn.com.qmth.stmms.ms.marking.assembler.QuestionStatAssembler;
|
|
|
import cn.com.qmth.stmms.ms.marking.dto.*;
|
|
|
+import cn.com.qmth.stmms.ms.marking.service.MarkingService;
|
|
|
import javassist.bytecode.stackmap.BasicBlock;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -73,6 +75,12 @@ public class MakrerApi {
|
|
|
@Autowired
|
|
|
StudentRepo studentRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private LoginConfig loginConfig;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ MarkingService markingService;
|
|
|
+
|
|
|
/**
|
|
|
* 评卷员信息
|
|
|
*
|
|
@@ -689,4 +697,38 @@ public class MakrerApi {
|
|
|
return objectMap;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 清空当前阶段数据
|
|
|
+ * @param workId
|
|
|
+ * @param subject
|
|
|
+ * @param stage
|
|
|
+ * @param loginName
|
|
|
+ * @param password
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/subject/reset", method = RequestMethod.POST)
|
|
|
+ public Object subjectReset(@PathVariable Long workId,
|
|
|
+ @RequestParam Subject subject,
|
|
|
+ @RequestParam MarkStage stage,
|
|
|
+ @RequestParam String loginName,
|
|
|
+ @RequestParam String password) {
|
|
|
+ if(Objects.nonNull(workId)){
|
|
|
+ throw new RuntimeException("工作ID不能为空");
|
|
|
+ }
|
|
|
+ if(Objects.nonNull(subject)){
|
|
|
+ throw new RuntimeException("科目不能为空");
|
|
|
+ }
|
|
|
+ if (!loginConfig.adminLoginConfig().getLoginName().equals(loginName)) {
|
|
|
+ throw new RuntimeException("只有管理员才能操作");
|
|
|
+ }
|
|
|
+ if (loginConfig.adminLoginConfig().getPassword().equals(password)) {
|
|
|
+ throw new RuntimeException("管理员密码错误");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 清空当前阶段数据
|
|
|
+ markingService.subjectReset(workId, subject, stage);
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
}
|