|
@@ -2,15 +2,16 @@ package cn.com.qmth.stmms.ms.admin.exporter;
|
|
|
|
|
|
import cn.com.qmth.stmms.ms.admin.assembler.MarkUserAssembler;
|
|
|
import cn.com.qmth.stmms.ms.admin.dto.MarkUserDTO;
|
|
|
+import cn.com.qmth.stmms.ms.admin.dto.PaperCounter;
|
|
|
+import cn.com.qmth.stmms.ms.admin.dto.StudentDTO;
|
|
|
import cn.com.qmth.stmms.ms.commons.utils.excel.ExportUtils;
|
|
|
+import cn.com.qmth.stmms.ms.core.domain.Work;
|
|
|
import cn.com.qmth.stmms.ms.core.domain.user.MarkUser;
|
|
|
import cn.com.qmth.stmms.ms.core.repository.MarkUserRepo;
|
|
|
+import cn.com.qmth.stmms.ms.core.repository.StudentRepo;
|
|
|
import cn.com.qmth.stmms.ms.core.vo.Subject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.ArrayList;
|
|
@@ -28,6 +29,9 @@ public class UserExporter {
|
|
|
@Autowired
|
|
|
private MarkUserRepo markUserRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StudentRepo studentRepo;
|
|
|
+
|
|
|
@Autowired
|
|
|
private MarkUserAssembler markUserAssembler;
|
|
|
|
|
@@ -44,4 +48,24 @@ public class UserExporter {
|
|
|
String fileName = "用户列表";
|
|
|
ExportUtils.exportEXCEL(fileName,MarkUserDTO.class,markUserDTOs,response);
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping(value = "{work}/{subject}/export",method = RequestMethod.GET)
|
|
|
+ public void countGropuByQuestion(@PathVariable Work work, @PathVariable Subject subject, HttpServletResponse response){
|
|
|
+ if(work != null) {
|
|
|
+ List<StudentDTO> list = new ArrayList<>();
|
|
|
+ List<Object[]> result = studentRepo.listMissingBySubject(work.getId(), subject.toString());
|
|
|
+ result.forEach(i -> {
|
|
|
+ StudentDTO studentDTO = new StudentDTO();
|
|
|
+ studentDTO.setExamNumber(String.valueOf(i[0]));
|
|
|
+ studentDTO.setName(String.valueOf(i[1]));
|
|
|
+ studentDTO.setAreaName(String.valueOf(i[2]));
|
|
|
+ studentDTO.setAreaCode(String.valueOf(i[3]));
|
|
|
+ studentDTO.setExamRoom(String.valueOf(i[4]));
|
|
|
+ studentDTO.setSourceName(String.valueOf(i[5]));
|
|
|
+ list.add(studentDTO);
|
|
|
+ });
|
|
|
+ String fileName =subject.toString()+ "缺考名单";
|
|
|
+ ExportUtils.exportEXCEL(fileName,StudentDTO.class,list,response);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|