|
@@ -23,15 +23,18 @@ 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.ExamStudent;
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudentPaper;
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudentPaper;
|
|
import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.TagInfo;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamStudentPaperService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamStudentPaperService;
|
|
import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
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.ExamSubjectService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.TagInfoService;
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkLibrary;
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkLibrary;
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkSpecialTag;
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkSpecialTag;
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkStepDTO;
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkStepDTO;
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkTrack;
|
|
import cn.com.qmth.stmms.biz.mark.model.MarkTrack;
|
|
import cn.com.qmth.stmms.biz.mark.model.SpecialTagDTO;
|
|
import cn.com.qmth.stmms.biz.mark.model.SpecialTagDTO;
|
|
|
|
+import cn.com.qmth.stmms.biz.mark.model.TagInfoDTO;
|
|
import cn.com.qmth.stmms.biz.mark.model.Task;
|
|
import cn.com.qmth.stmms.biz.mark.model.Task;
|
|
import cn.com.qmth.stmms.biz.mark.model.TrackDTO;
|
|
import cn.com.qmth.stmms.biz.mark.model.TrackDTO;
|
|
import cn.com.qmth.stmms.biz.mark.query.MarkLibrarySearchQuery;
|
|
import cn.com.qmth.stmms.biz.mark.query.MarkLibrarySearchQuery;
|
|
@@ -42,6 +45,7 @@ import cn.com.qmth.stmms.biz.mark.service.TaskService;
|
|
import cn.com.qmth.stmms.biz.utils.CurrentTaskUtil;
|
|
import cn.com.qmth.stmms.biz.utils.CurrentTaskUtil;
|
|
import cn.com.qmth.stmms.biz.utils.MarkRedisUtil;
|
|
import cn.com.qmth.stmms.biz.utils.MarkRedisUtil;
|
|
import cn.com.qmth.stmms.common.enums.LibraryStatus;
|
|
import cn.com.qmth.stmms.common.enums.LibraryStatus;
|
|
|
|
+import cn.com.qmth.stmms.common.enums.TagType;
|
|
import cn.com.qmth.stmms.common.utils.PictureUrlBuilder;
|
|
import cn.com.qmth.stmms.common.utils.PictureUrlBuilder;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -80,6 +84,9 @@ public class TaskServiceImpl implements TaskService, ApplicationContextAware, In
|
|
@Autowired
|
|
@Autowired
|
|
private MarkSpecialTagService markSpecialTagService;
|
|
private MarkSpecialTagService markSpecialTagService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private TagInfoService tagInfoService;
|
|
|
|
+
|
|
@Value("${use.redis}")
|
|
@Value("${use.redis}")
|
|
private boolean useRedis;
|
|
private boolean useRedis;
|
|
|
|
|
|
@@ -126,9 +133,22 @@ public class TaskServiceImpl implements TaskService, ApplicationContextAware, In
|
|
if (library.getStatus() == LibraryStatus.QUEUED && library.getMarkerId() != null) {
|
|
if (library.getStatus() == LibraryStatus.QUEUED && library.getMarkerId() != null) {
|
|
task.setBack(true);
|
|
task.setBack(true);
|
|
}
|
|
}
|
|
|
|
+ task.setTagInfoList(getTagInfoList(library.getId()));
|
|
return task;
|
|
return task;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private TagInfoDTO[] getTagInfoList(Integer libraryId) {
|
|
|
|
+ TagInfoDTO[] tagInfos = null;
|
|
|
|
+ List<TagInfo> list = tagInfoService.findByLibraryId(libraryId);
|
|
|
|
+ if (!CollectionUtils.isEmpty(list)) {
|
|
|
|
+ tagInfos = new TagInfoDTO[list.size()];
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+ tagInfos[i] = new TagInfoDTO(list.get(i).getType().getValue(), list.get(i).getRemark());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return tagInfos;
|
|
|
|
+ }
|
|
|
|
+
|
|
private List<MarkStepDTO> buildMarkStep(MarkLibrary library) {
|
|
private List<MarkStepDTO> buildMarkStep(MarkLibrary library) {
|
|
List<MarkStepDTO> list = new LinkedList<MarkStepDTO>();
|
|
List<MarkStepDTO> list = new LinkedList<MarkStepDTO>();
|
|
List<ExamQuestion> sList = null;
|
|
List<ExamQuestion> sList = null;
|
|
@@ -248,16 +268,16 @@ public class TaskServiceImpl implements TaskService, ApplicationContextAware, In
|
|
LibraryStatus.MARKED));
|
|
LibraryStatus.MARKED));
|
|
|
|
|
|
Map<String, List<TrackDTO>> trackMap = task.getTrackMap();
|
|
Map<String, List<TrackDTO>> trackMap = task.getTrackMap();
|
|
- if(trackMap.isEmpty()){
|
|
|
|
- trackService.deleteByStudentId(library.getStudentId());
|
|
|
|
- }else{
|
|
|
|
- for (String questionNumber : trackMap.keySet()) {
|
|
|
|
- trackService.deleteByStudentIdAndQuestionNumber(library.getStudentId(), questionNumber);
|
|
|
|
- List<TrackDTO> list = trackMap.get(questionNumber);
|
|
|
|
- for (TrackDTO dto : list) {
|
|
|
|
- trackService.save(dto.transform(library));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ if (trackMap.isEmpty()) {
|
|
|
|
+ trackService.deleteByStudentId(library.getStudentId());
|
|
|
|
+ } else {
|
|
|
|
+ for (String questionNumber : trackMap.keySet()) {
|
|
|
|
+ trackService.deleteByStudentIdAndQuestionNumber(library.getStudentId(), questionNumber);
|
|
|
|
+ List<TrackDTO> list = trackMap.get(questionNumber);
|
|
|
|
+ for (TrackDTO dto : list) {
|
|
|
|
+ trackService.save(dto.transform(library));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
SpecialTagDTO[] tagList = task.getTagList();
|
|
SpecialTagDTO[] tagList = task.getTagList();
|
|
@@ -272,6 +292,17 @@ public class TaskServiceImpl implements TaskService, ApplicationContextAware, In
|
|
markSpecialTagService.save(markSpecialTag);
|
|
markSpecialTagService.save(markSpecialTag);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ tagInfoService.deleteByLibraryId(library.getId());
|
|
|
|
+ if (task.getTagInfoList() != null && task.getTagInfoList().length > 0) {
|
|
|
|
+ for (TagInfoDTO tagInfoDTO : task.getTagInfoList()) {
|
|
|
|
+ TagInfo tagInfo = new TagInfo();
|
|
|
|
+ tagInfo.setLibraryId(library.getId());
|
|
|
|
+ tagInfo.setStudentId(library.getStudentId());
|
|
|
|
+ tagInfo.setRemark(tagInfoDTO.getRemark());
|
|
|
|
+ tagInfo.setType(TagType.findByValue(tagInfoDTO.getValue()));
|
|
|
|
+ tagInfoService.save(tagInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -368,7 +399,6 @@ public class TaskServiceImpl implements TaskService, ApplicationContextAware, In
|
|
|
|
|
|
/*
|
|
/*
|
|
* 客户端非正常情况下退出系统时,对内存中的没有及时清除的任务进行处理
|
|
* 客户端非正常情况下退出系统时,对内存中的没有及时清除的任务进行处理
|
|
- *
|
|
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void clearTaskMap(long cleanMapinterval) throws Exception {
|
|
public void clearTaskMap(long cleanMapinterval) throws Exception {
|