insomniaLee 6 роки тому
батько
коміт
8932aba408

+ 7 - 0
src/main/java/com/mooctest/controller/TaskController.java

@@ -4,6 +4,7 @@ import com.mooctest.data.BugDTO;
 import com.mooctest.data.TaskDTO;
 import com.mooctest.model.MasterReport;
 import com.mooctest.service.BugReportService;
+import com.mooctest.service.HistoryService;
 import com.mooctest.service.MasterReportService;
 import com.mooctest.service.TaskService;
 import com.mooctest.util.ReportUtil;
@@ -30,6 +31,9 @@ public class TaskController {
     BugReportService bugReportService;
 
     @Autowired
+    HistoryService historyService;
+
+    @Autowired
     MasterReportService masterReportService;
     @GetMapping("/home")
     public String home(Model model) {
@@ -51,6 +55,7 @@ public class TaskController {
 
         boolean aggregated = masterReportService.isAggregated(examId, caseId);
         List<BugDTO> allReports = bugReportService.getAllBugs(examId, caseId);
+        Map<String,String> single2rootMap = historyService.getSingle2Root(caseId, examId);
         if (aggregated) {
             List<String> bugIds = allReports.stream().map(BugDTO::getId).collect(Collectors.toList());
             List<MasterReport> mrs = masterReportService.getByBugIds(bugIds);
@@ -60,6 +65,8 @@ public class TaskController {
                 bug.setStatus(mr.getStatus());
                 bug.setReviewerId(mr.getReviewerId());
                 bug.setMasterId(mr.getMasterId());
+                String te = single2rootMap.get(bug.getId());
+                bug.setTreeId(te==null?"null":te);
             });
         }
         TaskDTO task = taskService.getByExamIdAndCaseId(examId, caseId);

+ 23 - 1
src/main/resources/templates/final_report_list.html

@@ -14,10 +14,32 @@
 </head>
 <body>
 <th:block layout:fragment="sidebar">
+    <li>
+        <a th:href="'/task_detail?examId=' + ${examId} + '&amp;caseId=' + ${caseId}">
+            <i class="glyphicon glyphicon-book"></i>
+            <span>
+                任务详情
+            </span>
+        </a>
+    </li>
+    <li>
+        <a th:href="'/final_reports?examId=' + ${examId} + '&amp;caseId=' + ${caseId}">
+            <i class="fa fa-calendar-check-o"></i>
+            <span>预交付报告</span>
+        </a>
+    </li>
+    <li>
+        <a th:href="'/review_report?examId=' + ${examId} + '&amp;caseId=' + ${caseId}">
+            <i class="glyphicon glyphicon-edit"></i>
+            <span>
+                报告审核
+            </span>
+        </a>
+    </li>
     <li class="treeview">
         <a href="#">
             <i class="fa fa-list"></i>
-            <span>审核报告</span>
+            <span>Reports</span>
             <span class="pull-right-container">
 			<i class="fa fa-angle-left pull-right"></i>
 		</span>

+ 4 - 1
src/main/resources/templates/task_detail.html

@@ -216,7 +216,10 @@
 <!--                        是否已经聚合-->
                         <a th:if="${aggregated}" th:text="|ML-AG-${report.masterId.substring(10)}|" th:href="'/report?masterId='+${report.masterId}+'&amp;examId='+${examId}+'&amp;caseId='+${caseId}"></a>
                     </td>
-                    <td>暂无</td>
+                    <td>
+                        <span th:if="(${report.getTreeId()==null}) or ${report.getTreeId().length()==4}">暂无</span>
+                        <a th:if="${report.getTreeId()!=null} and  ${report.getTreeId().length()!=4}" th:text="|ML-TR-${report.treeId.substring(10)}|" th:href="'/history/report?treeId='+${report.treeId}+'&amp;examId='+${examId}+'&amp;caseId='+${caseId}"></a>
+                    </td>
                 </tr>
             </th:block>
             </tbody>