|
@@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
+import java.sql.Timestamp;
|
|
|
|
+
|
|
@Controller
|
|
@Controller
|
|
public class PaperController {
|
|
public class PaperController {
|
|
|
|
|
|
@@ -43,6 +45,10 @@ public class PaperController {
|
|
@GetMapping("/papers")
|
|
@GetMapping("/papers")
|
|
public String auditTask ( Model model){
|
|
public String auditTask ( Model model){
|
|
JSONArray jsonArray = paperService.getPaperData(); // 所有的数据。
|
|
JSONArray jsonArray = paperService.getPaperData(); // 所有的数据。
|
|
|
|
+ for (Object single : jsonArray){
|
|
|
|
+ single = (JSONObject) single;
|
|
|
|
+ changeTime2Long(single); // 修改创建时间的格式 以便前段展示
|
|
|
|
+ }
|
|
model.addAttribute("tasks",jsonArray);
|
|
model.addAttribute("tasks",jsonArray);
|
|
return "paper_list";
|
|
return "paper_list";
|
|
}
|
|
}
|
|
@@ -73,4 +79,8 @@ public class PaperController {
|
|
// JSONObject res = auditTaskService.getSingleTask(id);
|
|
// JSONObject res = auditTaskService.getSingleTask(id);
|
|
// return res;
|
|
// return res;
|
|
// }
|
|
// }
|
|
|
|
+private void changeTime2Long ( Object input){
|
|
|
|
+ JSONObject temp = (JSONObject) input;
|
|
|
|
+ temp.put("create_time",new Timestamp(Long.parseLong(temp.get("create_time").toString()))); // 修改创建时间的格式 以便前段展示
|
|
|
|
+}
|
|
}
|
|
}
|