|
@@ -5,12 +5,8 @@ import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import javax.validation.Valid;
|
|
|
|
|
|
-import cn.com.qmth.stmms.biz.exam.bean.MarkerGroupVo;
|
|
|
|
-import cn.com.qmth.stmms.biz.exam.bean.PictureConfigVo;
|
|
|
|
-import cn.com.qmth.stmms.biz.exam.query.ExamStudentSearchQuery;
|
|
|
|
-import cn.com.qmth.stmms.biz.mark.model.PictureConfigItem;
|
|
|
|
-import cn.com.qmth.stmms.biz.user.model.User;
|
|
|
|
import org.apache.commons.lang.StringEscapeUtils;
|
|
import org.apache.commons.lang.StringEscapeUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.apache.commons.lang.StringUtils;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -21,6 +17,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.core.task.AsyncTaskExecutor;
|
|
import org.springframework.core.task.AsyncTaskExecutor;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
@@ -31,24 +28,51 @@ import com.qmth.boot.core.exception.StatusException;
|
|
import cn.com.qmth.stmms.admin.thread.MarkGroupDeleteThread;
|
|
import cn.com.qmth.stmms.admin.thread.MarkGroupDeleteThread;
|
|
import cn.com.qmth.stmms.api.controller.BaseApiController;
|
|
import cn.com.qmth.stmms.api.controller.BaseApiController;
|
|
import cn.com.qmth.stmms.biz.config.service.impl.SystemCache;
|
|
import cn.com.qmth.stmms.biz.config.service.impl.SystemCache;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.bean.MarkGroupAdd;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.bean.MarkGroupFinish;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.bean.MarkGroupUpdate;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.bean.MarkerGroupVo;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.bean.PictureConfigVo;
|
|
import cn.com.qmth.stmms.biz.exam.bean.ResultMessage;
|
|
import cn.com.qmth.stmms.biz.exam.bean.ResultMessage;
|
|
import cn.com.qmth.stmms.biz.exam.dao.SelectiveStudentDao;
|
|
import cn.com.qmth.stmms.biz.exam.dao.SelectiveStudentDao;
|
|
-import cn.com.qmth.stmms.biz.exam.model.*;
|
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.*;
|
|
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.Exam;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.SelectiveGroup;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.query.ExamStudentSearchQuery;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.InspectHistoryService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.MarkGroupService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.MarkerService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.SelectiveGroupService;
|
|
import cn.com.qmth.stmms.biz.file.service.FileService;
|
|
import cn.com.qmth.stmms.biz.file.service.FileService;
|
|
import cn.com.qmth.stmms.biz.lock.LockService;
|
|
import cn.com.qmth.stmms.biz.lock.LockService;
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkConfigItem;
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkConfigItem;
|
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.PictureConfigItem;
|
|
import cn.com.qmth.stmms.biz.mark.service.MarkService;
|
|
import cn.com.qmth.stmms.biz.mark.service.MarkService;
|
|
import cn.com.qmth.stmms.biz.school.model.School;
|
|
import cn.com.qmth.stmms.biz.school.model.School;
|
|
import cn.com.qmth.stmms.biz.school.service.SchoolService;
|
|
import cn.com.qmth.stmms.biz.school.service.SchoolService;
|
|
|
|
+import cn.com.qmth.stmms.biz.user.model.User;
|
|
import cn.com.qmth.stmms.common.annotation.Logging;
|
|
import cn.com.qmth.stmms.common.annotation.Logging;
|
|
-import cn.com.qmth.stmms.common.domain.ApiUser;
|
|
|
|
-import cn.com.qmth.stmms.common.enums.*;
|
|
|
|
|
|
+import cn.com.qmth.stmms.common.enums.ArbitrateType;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.ExamType;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.LockType;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.LogType;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.MarkMode;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.MarkStatus;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.ScorePolicy;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.SubjectiveStatus;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.ThirdPolicy;
|
|
import cn.com.qmth.stmms.common.utils.RequestUtils;
|
|
import cn.com.qmth.stmms.common.utils.RequestUtils;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import net.sf.json.JSONArray;
|
|
import net.sf.json.JSONArray;
|
|
-import net.sf.json.JSONObject;
|
|
|
|
import net.sf.json.JsonConfig;
|
|
import net.sf.json.JsonConfig;
|
|
|
|
|
|
@Api(tags = "分组管理")
|
|
@Api(tags = "分组管理")
|
|
@@ -114,7 +138,6 @@ public class MarkGroupController extends BaseApiController {
|
|
@RequestMapping(value = "query", method = RequestMethod.POST)
|
|
@RequestMapping(value = "query", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public List<MarkGroup> query(@RequestParam String subjectCode) {
|
|
public List<MarkGroup> query(@RequestParam String subjectCode) {
|
|
- ApiUser wu = getApiUser();
|
|
|
|
int examId = getSessionExamId();
|
|
int examId = getSessionExamId();
|
|
ExamSubject subject = subjectService.find(examId, subjectCode);
|
|
ExamSubject subject = subjectService.find(examId, subjectCode);
|
|
if (subject == null) {
|
|
if (subject == null) {
|
|
@@ -167,27 +190,34 @@ public class MarkGroupController extends BaseApiController {
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
@ApiOperation(value = "新增分组")
|
|
@ApiOperation(value = "新增分组")
|
|
@Logging(menu = "新增大题", type = LogType.ADD)
|
|
@Logging(menu = "新增大题", type = LogType.ADD)
|
|
@RequestMapping(value = "/insert", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/insert", method = RequestMethod.POST)
|
|
@Transactional
|
|
@Transactional
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public ResultMessage insert(@RequestParam String subjectCode, @RequestParam Integer number,
|
|
|
|
- @RequestParam Integer[] questionIds, @RequestParam String picList,
|
|
|
|
- @RequestParam(required = false) Double doubleRate,
|
|
|
|
- @RequestParam(required = false) Double arbitrateThreshold,
|
|
|
|
- @RequestParam(required = false) Integer thirdPolicy, @RequestParam(required = false) Integer scorePolicy,
|
|
|
|
- @RequestParam(required = false) String arbitrateThresholdList,
|
|
|
|
- @RequestParam(required = false) Integer arbitrateType, @RequestParam(required = false) String markMode,
|
|
|
|
- @RequestParam(required = false) Integer trialCount,
|
|
|
|
- @RequestParam(required = false, defaultValue = "false") boolean sheetView,
|
|
|
|
- @RequestParam(defaultValue = "false") boolean enableAllZero) {
|
|
|
|
|
|
+ public ResultMessage insert(@Valid @RequestBody MarkGroupAdd req) {
|
|
|
|
+ String subjectCode = req.getSubjectCode();
|
|
|
|
+ Integer number = req.getNumber();
|
|
|
|
+ List<Integer> questionIds = req.getQuestionIds();
|
|
|
|
+ String picList = req.getPicList();
|
|
|
|
+ Double doubleRate = req.getDoubleRate();
|
|
|
|
+ Double arbitrateThreshold = req.getArbitrateThreshold();
|
|
|
|
+ Integer thirdPolicy = req.getThirdPolicy();
|
|
|
|
+ Integer scorePolicy = req.getScorePolicy();
|
|
|
|
+ String arbitrateThresholdList = req.getArbitrateThresholdList();
|
|
|
|
+ Integer arbitrateType = req.getArbitrateType();
|
|
|
|
+ String markMode = req.getMarkMode();
|
|
|
|
+ Integer trialCount = req.getTrialCount();
|
|
|
|
+ boolean sheetView = req.getSheetView() == null ? false : req.getSheetView();
|
|
|
|
+ boolean enableAllZero = req.getEnableAllZero() == null ? false : req.getEnableAllZero();
|
|
|
|
+
|
|
int examId = getSessionExamId();
|
|
int examId = getSessionExamId();
|
|
Exam exam = examService.findById(examId);
|
|
Exam exam = examService.findById(examId);
|
|
MarkGroup group = groupService.findOne(examId, subjectCode, number);
|
|
MarkGroup group = groupService.findOne(examId, subjectCode, number);
|
|
if (group != null) {
|
|
if (group != null) {
|
|
throw new StatusException("评卷分组序号不能重复");
|
|
throw new StatusException("评卷分组序号不能重复");
|
|
- } else if (questionIds == null || questionIds.length <= 0) {
|
|
|
|
|
|
+ } else if (questionIds == null || questionIds.size() <= 0) {
|
|
throw new StatusException("题目不能为空");
|
|
throw new StatusException("题目不能为空");
|
|
} else {
|
|
} else {
|
|
try {
|
|
try {
|
|
@@ -203,8 +233,8 @@ public class MarkGroupController extends BaseApiController {
|
|
BigDecimal totalScore = BigDecimal.ZERO;
|
|
BigDecimal totalScore = BigDecimal.ZERO;
|
|
boolean selective = false;
|
|
boolean selective = false;
|
|
List<Double> arbitrateThresholds = buildDoubleList(arbitrateThresholdList);
|
|
List<Double> arbitrateThresholds = buildDoubleList(arbitrateThresholdList);
|
|
- for (int i = 0; i < questionIds.length; i++) {
|
|
|
|
- Integer questionId = questionIds[i];
|
|
|
|
|
|
+ for (int i = 0; i < questionIds.size(); i++) {
|
|
|
|
+ Integer questionId = questionIds.get(i);
|
|
ExamQuestion question = questionService.findById(questionId);
|
|
ExamQuestion question = questionService.findById(questionId);
|
|
question.setGroupNumber(number);
|
|
question.setGroupNumber(number);
|
|
if (doubleRate != null && doubleRate > 0
|
|
if (doubleRate != null && doubleRate > 0
|
|
@@ -245,24 +275,29 @@ public class MarkGroupController extends BaseApiController {
|
|
return resultOk();
|
|
return resultOk();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
@ApiOperation(value = "分组修改")
|
|
@ApiOperation(value = "分组修改")
|
|
@Logging(menu = "分组修改", type = LogType.UPDATE)
|
|
@Logging(menu = "分组修改", type = LogType.UPDATE)
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
@Transactional
|
|
@Transactional
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public ResultMessage update(HttpServletRequest request, @RequestParam String subjectCode,
|
|
|
|
- @RequestParam Integer number, @RequestParam Boolean reset, @RequestParam(required = false) String picList,
|
|
|
|
- @RequestParam(required = false) Double doubleRate,
|
|
|
|
- @RequestParam(required = false) Double arbitrateThreshold,
|
|
|
|
- @RequestParam(required = false) Integer thirdPolicy, @RequestParam(required = false) Integer scorePolicy,
|
|
|
|
- @RequestParam(required = false) Integer arbitrateType, @RequestParam(required = false) MarkMode markMode,
|
|
|
|
- @RequestParam(required = false) Integer trialCount,
|
|
|
|
- @RequestParam(required = false, defaultValue = "false") Boolean sheetView,
|
|
|
|
- @RequestParam(required = false, defaultValue = "false") Boolean enableAllZero,
|
|
|
|
- @RequestParam(required = false) Integer[] questionIds,
|
|
|
|
- @RequestParam(required = false) String intervalScoreList,
|
|
|
|
- @RequestParam(required = false) String arbitrateThresholdList,
|
|
|
|
- @RequestParam(required = false) String deleteCode) {
|
|
|
|
|
|
+ public ResultMessage update(@Valid @RequestBody MarkGroupUpdate req) {
|
|
|
|
+ String subjectCode = req.getSubjectCode();
|
|
|
|
+ Integer number = req.getNumber();
|
|
|
|
+ List<Integer> questionIds = req.getQuestionIds();
|
|
|
|
+ String picList = req.getPicList();
|
|
|
|
+ Double doubleRate = req.getDoubleRate();
|
|
|
|
+ Double arbitrateThreshold = req.getArbitrateThreshold();
|
|
|
|
+ Integer thirdPolicy = req.getThirdPolicy();
|
|
|
|
+ Integer scorePolicy = req.getScorePolicy();
|
|
|
|
+ String arbitrateThresholdList = req.getArbitrateThresholdList();
|
|
|
|
+ Integer arbitrateType = req.getArbitrateType();
|
|
|
|
+ MarkMode markMode = req.getMarkMode();
|
|
|
|
+ Boolean sheetView = req.getSheetView() == null ? false : req.getSheetView();
|
|
|
|
+ Boolean enableAllZero = req.getEnableAllZero() == null ? false : req.getEnableAllZero();
|
|
|
|
+ String intervalScoreList = req.getIntervalScoreList();
|
|
|
|
+ String deleteCode = req.getDeleteCode();
|
|
|
|
+ Boolean reset = req.getReset();
|
|
int examId = getSessionExamId();
|
|
int examId = getSessionExamId();
|
|
Exam exam = examService.findById(examId);
|
|
Exam exam = examService.findById(examId);
|
|
MarkGroup group = groupService.findOne(examId, subjectCode, number);
|
|
MarkGroup group = groupService.findOne(examId, subjectCode, number);
|
|
@@ -284,8 +319,8 @@ public class MarkGroupController extends BaseApiController {
|
|
}
|
|
}
|
|
List<Double> arbitrateThresholds = buildDoubleList(arbitrateThresholdList);
|
|
List<Double> arbitrateThresholds = buildDoubleList(arbitrateThresholdList);
|
|
boolean selective = false;
|
|
boolean selective = false;
|
|
- for (int i = 0; i < questionIds.length; i++) {
|
|
|
|
- ExamQuestion question = questionService.findById(questionIds[i]);
|
|
|
|
|
|
+ for (int i = 0; i < questionIds.size(); i++) {
|
|
|
|
+ ExamQuestion question = questionService.findById(questionIds.get(i));
|
|
if (doubleRate != null && doubleRate > 0 && ArbitrateType.QUESTION.equals(at)) {
|
|
if (doubleRate != null && doubleRate > 0 && ArbitrateType.QUESTION.equals(at)) {
|
|
question.setArbitrateThreshold(arbitrateThresholds.get(i));
|
|
question.setArbitrateThreshold(arbitrateThresholds.get(i));
|
|
} else {
|
|
} else {
|
|
@@ -305,7 +340,7 @@ public class MarkGroupController extends BaseApiController {
|
|
lockService.waitlock(LockType.GROUP, true, group.getExamId(), group.getSubjectCode(),
|
|
lockService.waitlock(LockType.GROUP, true, group.getExamId(), group.getSubjectCode(),
|
|
group.getNumber());
|
|
group.getNumber());
|
|
markService.updateGroup(group, questionList, policy, at, third, selective);
|
|
markService.updateGroup(group, questionList, policy, at, third, selective);
|
|
- RequestUtils.setLog(request, "重置分组,科目代码:" + subjectCode + " 分组号:" + number);
|
|
|
|
|
|
+ RequestUtils.setLog("重置分组,科目代码:" + subjectCode + " 分组号:" + number);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("update group error", e);
|
|
log.error("update group error", e);
|
|
throw new StatusException("重置更新大题失败" + e.getMessage());
|
|
throw new StatusException("重置更新大题失败" + e.getMessage());
|
|
@@ -545,11 +580,11 @@ public class MarkGroupController extends BaseApiController {
|
|
@Logging(menu = "大题关闭", type = LogType.QUERY)
|
|
@Logging(menu = "大题关闭", type = LogType.QUERY)
|
|
@RequestMapping(value = "/finish", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/finish", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public ResultMessage finish(@RequestParam String subjectCode, @RequestParam Integer[] groupNumbers) {
|
|
|
|
|
|
+ public ResultMessage finish(@Valid @RequestBody MarkGroupFinish req) {
|
|
int examId = getSessionExamId();
|
|
int examId = getSessionExamId();
|
|
String messages = "";
|
|
String messages = "";
|
|
- for (Integer number : groupNumbers) {
|
|
|
|
- MarkGroup group = groupService.findOne(examId, subjectCode, number);
|
|
|
|
|
|
+ for (Integer number : req.getGroupNumbers()) {
|
|
|
|
+ MarkGroup group = groupService.findOne(examId, req.getSubjectCode(), number);
|
|
if (group == null || group.getStatus() == MarkStatus.FINISH) {
|
|
if (group == null || group.getStatus() == MarkStatus.FINISH) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -558,7 +593,8 @@ public class MarkGroupController extends BaseApiController {
|
|
if (group.getStatus() == MarkStatus.FORMAL && group.getLeftCount() == 0
|
|
if (group.getStatus() == MarkStatus.FORMAL && group.getLeftCount() == 0
|
|
&& selectiveStudentDao.countByExamIdAndSubjectCodeAndLessSelectiveOrNotSelective(
|
|
&& selectiveStudentDao.countByExamIdAndSubjectCodeAndLessSelectiveOrNotSelective(
|
|
group.getExamId(), group.getSubjectCode(), true, true) == 0) {
|
|
group.getExamId(), group.getSubjectCode(), true, true) == 0) {
|
|
- groupService.updateStatus(examId, subjectCode, number, MarkStatus.FINISH, group.getStatus());
|
|
|
|
|
|
+ groupService.updateStatus(examId, req.getSubjectCode(), number, MarkStatus.FINISH,
|
|
|
|
+ group.getStatus());
|
|
} else {
|
|
} else {
|
|
messages = "评卷未完成或选做题异常,无法关闭分组";
|
|
messages = "评卷未完成或选做题异常,无法关闭分组";
|
|
}
|
|
}
|
|
@@ -579,7 +615,6 @@ public class MarkGroupController extends BaseApiController {
|
|
public ResultMessage updateTrialCount(@RequestParam String subjectCode, @RequestParam Integer trialCount) {
|
|
public ResultMessage updateTrialCount(@RequestParam String subjectCode, @RequestParam Integer trialCount) {
|
|
int examId = getSessionExamId();
|
|
int examId = getSessionExamId();
|
|
ExamSubject subject = subjectService.find(examId, subjectCode);
|
|
ExamSubject subject = subjectService.find(examId, subjectCode);
|
|
- JSONObject obj = new JSONObject();
|
|
|
|
if (subject == null) {
|
|
if (subject == null) {
|
|
throw new StatusException("科目不能为空");
|
|
throw new StatusException("科目不能为空");
|
|
}
|
|
}
|
|
@@ -599,7 +634,7 @@ public class MarkGroupController extends BaseApiController {
|
|
@RequestMapping(value = "/marker/list", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/marker/list", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public List<MarkerGroupVo> groupQuery(HttpServletRequest request, @RequestParam Integer examId,
|
|
public List<MarkerGroupVo> groupQuery(HttpServletRequest request, @RequestParam Integer examId,
|
|
- @RequestParam String subjectCode) {
|
|
|
|
|
|
+ @RequestParam String subjectCode) {
|
|
User user = getApiUser().getUser();
|
|
User user = getApiUser().getUser();
|
|
List<Marker> list = markerService.findByExamAndSubjectAndUserIdAndEnable(examId, subjectCode, user.getId(),
|
|
List<Marker> list = markerService.findByExamAndSubjectAndUserIdAndEnable(examId, subjectCode, user.getId(),
|
|
true);
|
|
true);
|
|
@@ -610,11 +645,12 @@ public class MarkGroupController extends BaseApiController {
|
|
marker.getSubjectCode(), false, group.getNumber()));
|
|
marker.getSubjectCode(), false, group.getNumber()));
|
|
if (group.getStatus() != MarkStatus.FINISH) {
|
|
if (group.getStatus() != MarkStatus.FINISH) {
|
|
MarkerGroupVo vo = new MarkerGroupVo();
|
|
MarkerGroupVo vo = new MarkerGroupVo();
|
|
- vo.setId( marker.getId());
|
|
|
|
|
|
+ vo.setId(marker.getId());
|
|
vo.setTitle(group.getTitle());
|
|
vo.setTitle(group.getTitle());
|
|
vo.setGroupNumber(group.getNumber());
|
|
vo.setGroupNumber(group.getNumber());
|
|
- int percent = group.getLibraryCount() > 0 ? (int) (group.getMarkedCount() * 100.00 / group
|
|
|
|
- .getLibraryCount()) : 0;
|
|
|
|
|
|
+ int percent = group.getLibraryCount() > 0
|
|
|
|
+ ? (int) (group.getMarkedCount() * 100.00 / group.getLibraryCount())
|
|
|
|
+ : 0;
|
|
if (group.getMarkedCount() > 0 && percent == 0) {
|
|
if (group.getMarkedCount() > 0 && percent == 0) {
|
|
percent = 1;
|
|
percent = 1;
|
|
} else if (group.getLeftCount() > 0 && percent == 100) {
|
|
} else if (group.getLeftCount() > 0 && percent == 100) {
|
|
@@ -630,15 +666,16 @@ public class MarkGroupController extends BaseApiController {
|
|
@ApiOperation(value = "获取评卷分组评卷区配置")
|
|
@ApiOperation(value = "获取评卷分组评卷区配置")
|
|
@RequestMapping(value = "/sliceConfig", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/sliceConfig", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public PictureConfigVo sliceConfig(@RequestParam Integer examId,@RequestParam String subejctCode,@RequestParam Integer groupNumber) {
|
|
|
|
|
|
+ public PictureConfigVo sliceConfig(@RequestParam Integer examId, @RequestParam String subejctCode,
|
|
|
|
+ @RequestParam Integer groupNumber) {
|
|
PictureConfigVo vo = new PictureConfigVo();
|
|
PictureConfigVo vo = new PictureConfigVo();
|
|
- MarkGroup group = groupService.findOne(examId,subejctCode,groupNumber);
|
|
|
|
|
|
+ MarkGroup group = groupService.findOne(examId, subejctCode, groupNumber);
|
|
if (group == null) {
|
|
if (group == null) {
|
|
throw new StatusException("分组不存在");
|
|
throw new StatusException("分组不存在");
|
|
}
|
|
}
|
|
List<PictureConfigItem> list = PictureConfigItem.parse(group.getPicList());
|
|
List<PictureConfigItem> list = PictureConfigItem.parse(group.getPicList());
|
|
vo.setPictureConfigItemList(list);
|
|
vo.setPictureConfigItemList(list);
|
|
- Integer sliceCount = studentService.findMaxSliceCountByExamIdAndSubjectCode(examId,subejctCode);
|
|
|
|
|
|
+ Integer sliceCount = studentService.findMaxSliceCountByExamIdAndSubjectCode(examId, subejctCode);
|
|
ExamStudentSearchQuery query = new ExamStudentSearchQuery();
|
|
ExamStudentSearchQuery query = new ExamStudentSearchQuery();
|
|
query.setExamId(examId);
|
|
query.setExamId(examId);
|
|
query.setUpload(true);
|
|
query.setUpload(true);
|
|
@@ -646,10 +683,11 @@ public class MarkGroupController extends BaseApiController {
|
|
List<ExamStudent> examStudents = studentService.findByQuery(query).getResult();
|
|
List<ExamStudent> examStudents = studentService.findByQuery(query).getResult();
|
|
if (examStudents.size() > 0) {
|
|
if (examStudents.size() > 0) {
|
|
ExamStudent student = examStudents.get(0);
|
|
ExamStudent student = examStudents.get(0);
|
|
- List<String> sliceUrl= fileService.getSheetUris(student.getExamId(), student.getExamNumber(), 1, sliceCount);
|
|
|
|
|
|
+ List<String> sliceUrl = fileService.getSheetUris(student.getExamId(), student.getExamNumber(), 1,
|
|
|
|
+ sliceCount);
|
|
vo.setStudentUrl(sliceUrl);
|
|
vo.setStudentUrl(sliceUrl);
|
|
return vo;
|
|
return vo;
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
throw new StatusException("没有已上传的考生");
|
|
throw new StatusException("没有已上传的考生");
|
|
}
|
|
}
|
|
}
|
|
}
|