|
@@ -26,6 +26,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
|
|
|
import cn.com.qmth.stmms.admin.utils.PageUtil;
|
|
|
import cn.com.qmth.stmms.admin.vo.InspectedStudentVO;
|
|
|
+import cn.com.qmth.stmms.admin.vo.TagStudentVO;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ExamStudent;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.ImportQuery;
|
|
|
import cn.com.qmth.stmms.biz.exam.query.ExamStudentSearchQuery;
|
|
@@ -90,7 +91,11 @@ public class ImportQueryController extends BaseExamController {
|
|
|
List<ExamStudent> list = new ArrayList<ExamStudent>();
|
|
|
if (ids != null) {
|
|
|
for (Object id : ids) {
|
|
|
- list.add(studentService.findById((int) id));
|
|
|
+ ExamStudent student = studentService.findById((int) id);
|
|
|
+ if (importQuery.getTagIdList().contains(id)) {
|
|
|
+ student.setTagValue("1");
|
|
|
+ }
|
|
|
+ list.add(student);
|
|
|
}
|
|
|
}
|
|
|
query.setTotalPage(PageUtil.pageCount(importQuery.getStudentIdList(), query.getPageNumber(),
|
|
@@ -254,4 +259,25 @@ public class ImportQueryController extends BaseExamController {
|
|
|
}
|
|
|
return obj;
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping(value = "/exportTag")
|
|
|
+ public String exportTag(HttpServletRequest request, HttpServletResponse response,
|
|
|
+ RedirectAttributes redirectAttributes) {
|
|
|
+ int examId = getSessionExamId(request);
|
|
|
+ WebUser wu = RequestUtils.getWebUser(request);
|
|
|
+ try {
|
|
|
+ String fileName = "标记卷.xlsx";
|
|
|
+ List<TagStudentVO> list = Lists.newArrayList();
|
|
|
+ ImportQuery importQuery = queryService.findByExamIdAndUserIdAndType(examId, wu.getId(),
|
|
|
+ ImportType.INSPECTED);
|
|
|
+ for (Integer studentId : importQuery.getTagIdList()) {
|
|
|
+ list.add(new TagStudentVO(studentService.findById(studentId)));
|
|
|
+ }
|
|
|
+ new ExportExcel("标记卷信息", InspectedStudentVO.class, 2).setDataList(list).write(response, fileName).dispose();
|
|
|
+ return null;
|
|
|
+ } catch (Exception e) {
|
|
|
+ addMessage(redirectAttributes, "标记卷下载失败!失败信息:" + e.getMessage());
|
|
|
+ }
|
|
|
+ return "redirect:/admin/exam/inspected/import/list";
|
|
|
+ }
|
|
|
}
|