Преглед изворни кода

添加跳转到具体job页面

insomniaLee пре 5 година
родитељ
комит
c82333dc62

+ 8 - 2
src/main/java/com/mooctest/controller/JobController.java

@@ -89,10 +89,12 @@ public class JobController {
     @GetMapping(value = "jobDetail")
     public String detail ( Model model , @RequestParam("id") String id){
         JSONObject res  = jobService.getSinglePaper(id); // 获取job的详细信息
-        changeTime2Long(res);
+        changeJobTime(res);
         JSONObject paper = paperService.getSinglePaper((String)res.get("paper_id"));
         model.addAttribute("paper",paper);
         model.addAttribute("data",res);
+        model.addAttribute("reportHost",reportHost);
+
         // TODO: 2019/12/24 在jobdetail页面添跳转到   xjw 统计页面的按钮。
         return "jobDetail";
     }
@@ -158,8 +160,9 @@ public class JobController {
 
     private void changeJobTime ( Object input){
         JSONObject temp = (JSONObject) input;
-        String startTime = temp.get("create_time").toString();
+        String startTime = temp.get("start_time").toString();
         String endTime = temp.get("end_time").toString();
+        String createTime = temp.get("create_time").toString();
         if(!startTime.contains("AM")&&!startTime.contains("PM")){
             //should transfer
             temp.put("start_time", TimeUtil.timestamp2str(startTime));
@@ -168,6 +171,9 @@ public class JobController {
             //should transfer
             temp.put("end_time", TimeUtil.timestamp2str(endTime));
         }
+        if(!createTime.contains("AM")&&!createTime.contains("PM")){
+            temp.put("create_time",TimeUtil.timestamp2str(createTime));
+        }
     }
 
 }

+ 16 - 6
src/main/resources/templates/jobDetail.html

@@ -159,12 +159,13 @@
                         <button onclick="changeJob()" class="btn btn-success pull-right" >
                             修改
                         </button>
-<!--                        <button  onclick="addJobByThis()" class="btn btn-info pull-right">-->
-<!--                            使用该试卷出题-->
-<!--                        </button>-->
-<!--                        <button onclick="showyu()"   class="btn btn-default pull-right" >-->
-<!--                            预览-->
-<!--                        </button>-->
+                        <button onclick="seeWorkerPaper()" class="btn btn-default pull-right" >
+                            查看工人试卷
+                        </button>
+                        <button onclick="seeDataStatistic()" class="btn btn-default pull-right" >
+                            查看数据统计
+                        </button>
+
                     </div>
                     <!-- /.box-header -->
                     <div class="box-body">
@@ -512,6 +513,15 @@
         window.open("/paperDetail?id="+paperId);
     }
 
+    seeWorkerPaper = function(){
+        // job id
+        window.open("http://"+reportHost+"/report/review/workerList/"+id)
+    }
+
+    seeDataStatistic = function(){
+        // job Id
+        window.open("http://"+reportHost+"/report/review/resultStatistics/"+id)
+    }
 
     getCleanStr = function (str) {
         var obj = eval('(' + str + ')');