| | |
| | | package com.ots.project.exam.controller; |
| | | |
| | | import com.ots.common.enums.UserTypeEnum; |
| | | import com.ots.common.utils.security.ShiroUtils; |
| | | import com.ots.framework.web.controller.BaseController; |
| | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * entTestDetailController |
| | | * |
| | | * @author ots |
| | | * @date 2020-03-01 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/exam/entTestDetail") |
| | | public class EntTestDetailController extends BaseController { |
| | | private String prefix = "exam/entTestDetail"; |
| | | |
| | | @Autowired |
| | | private ITExamReportService examReportService; |
| | | |
| | | @GetMapping("/testDetail/{tokens}") |
| | | |
| | | // @RequiresPermissions("exam:entTestDetail:list") |
| | | public String entTestDetail(@PathVariable List<String> tokens, ModelMap mmap) { |
| | | EntTestDetail entTestDetail = new EntTestDetail(); |
| | | entTestDetail.setToken(JsonUtil.toJsonStr(tokens)); |
| | |
| | | mmap.put("entTestDetail", entTestDetail); |
| | | return prefix + "/entTestDetail"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询entTestDetail列表 |
| | | */ |
| | | // @RequiresPermissions("exam:entTestDetail:list") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(EntTestDetail entTestDetail) { |
| | |
| | | if (ExamUtil.isListEmpty(questionReportList)) { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | // 遍历出每一个report |
| | | for (QuestionReport questionReport : questionReportList) { |
| | | EntTestDetail entTestDetailTemp = new EntTestDetail(); |
| | | entTestDetailTemp.setPermanentId(questionReport.getPermanentId()); |
| | |
| | | entTestDetailList.add(entTestDetailTemp); |
| | | } |
| | | } |
| | | |
| | | //按照耗时降序排列 timeSpent |
| | | if (Objects.equals("TimeSpent",entTestDetail.getSortType())) { |
| | | Collections.sort(entTestDetailList, new TimeSpentComparator()); |
| | | }else { |
| | |
| | | } |
| | | return getDataTable(entTestDetailList); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 新增entTestDetail |
| | | */ |
| | | @GetMapping("/add") |
| | | public String add() { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | } |