3.7
fxl
2023-03-07 52cffc4ab8e9787a6f233295502c7c9788dddae1
src/main/java/com/hxzkoa/controller/LocationController.java
@@ -106,12 +106,12 @@
      Date date = new Date(System.currentTimeMillis());
      SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
      String currentDate = formatter.format(date);
      System.out.print(currentDate);
      //System.out.print(currentDate);
      List<tb_track> trackList = locationService.getTrack(currentDate, 1, perPage);
      request.setAttribute("historicalLocationList", trackList);
      int curPage = 1;
      int count = locationService.getRealTimeLocationCount(currentDate);
      System.out.print(count);
      //System.out.print(count);
      int minPage = PageUtil.getMinPage(count);
      request.setAttribute("pageList", PageUtil.getPage(minPage));
      request.setAttribute("curPage", curPage);
@@ -129,6 +129,22 @@
      request.setAttribute("dateList", trackDateReList);
      return toPage;
   }
   @ResponseBody
   @RequestMapping(value = "/historicalLocationa.do", method = { RequestMethod.POST, RequestMethod.GET })
   public JSONObject historicalLocationa(HttpServletRequest request) throws SQLException {
      JSONObject json = new JSONObject();
      String date = request.getParameter("date");
      int aaa = locationService.searchtablenameLocation("tb_track_"+date);
      if (aaa != 0) {
         List<tb_track> trackList = locationService.getTracka(date);
         json.put("dataList", trackList);
      } else {
         List<tb_track> trackList = new ArrayList<>();
         json.put("dataList", trackList);
      }
      return json;
   }
   @ResponseBody
   @RequestMapping(value = "/historicalLocation_delete.do", method = { RequestMethod.POST, RequestMethod.GET })
@@ -139,6 +155,21 @@
      String[] checkVal = checkValStr.split(",");
      locationService.realTimeLocation_delete(checkVal,date);
   }
   @ResponseBody
   @RequestMapping(value = "/historicalLocation_deletea.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int historicalLocation_deletea(HttpServletRequest request) {
      String checkValStr = request.getParameter("checkVal");
      String date = request.getParameter("datea");
      checkValStr = checkValStr.replaceAll("\"", "");
      String[] checkVal = checkValStr.split(",");
      int bbb = locationService.searchtablenameLocation("tb_track_"+date);
      int aaa = 0;
      if (bbb != 0) {
         aaa = locationService.realTimeLocation_deletea(checkVal,date);
      }
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/historicalLocation_deleteAll.do", method = { RequestMethod.POST, RequestMethod.GET })
@@ -146,6 +177,18 @@
      String date = request.getParameter("aaaa");
      locationService.realTimeLocation_deleteAll(date);
   }
   @ResponseBody
   @RequestMapping(value = "/historicalLocation_deleteAlla.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int historicalLocation_deleteAlla(HttpServletRequest request) {
      String date = request.getParameter("date");
      int bbb = locationService.searchtablenameLocation("tb_track_"+date);
      int aaa = 0;
      if (bbb != 0) {
         aaa = locationService.realTimeLocation_deleteAlla(date);
      }
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/historicalLocation_search.do", method = { RequestMethod.POST, RequestMethod.GET })
@@ -162,6 +205,23 @@
      json.put("curPage", curPage);
      return json.toString();
   }
   @ResponseBody
   @RequestMapping(value = "/historicalLocation_searcha.do", method = { RequestMethod.POST, RequestMethod.GET })
   public JSONObject historicalLocation_searcha(HttpServletRequest request) {
      String input = request.getParameter("tagid");
      String date = request.getParameter("date");
      JSONObject json = new JSONObject();
      int aaa = locationService.searchtablenameLocation("tb_track_"+date);
      if (aaa != 0) {
         List<tb_realocation> historicalLocationList = locationService.searchRealTimeLocation(input,date);
         json.put("dataList", historicalLocationList);
      } else {
         List<tb_realocation> abc = new ArrayList<>();
         json.put("dataList", abc);
      }
      return json;
   }
   @ResponseBody
   @RequestMapping(value = "/historicalLocation_page.do", method = { RequestMethod.POST, RequestMethod.GET })
@@ -197,7 +257,7 @@
      json.put("dataList", trackList);
      json.put("pageList", pageList);
      json.put("curPage", page);
      System.out.print(pageList);
      //System.out.print(pageList);
      return json.toString();
   }
@@ -269,11 +329,21 @@
      locationService.tag_time(tag);
   }
   
   @ResponseBody
   @RequestMapping(value="panduanweiyi.do", method={RequestMethod.POST,RequestMethod.GET})
   public String panduanweiyi(HttpServletRequest request) {
      JSONObject json = new JSONObject();
      String name = request.getParameter("name");
      List<String> strs = locationService.panduanweiyi(name);
      json.put("dataList", strs);
      return json.toString();
   }
// @RequestMapping(value = "/shishi.do", method = { RequestMethod.POST, RequestMethod.GET })
// public void shiyan(HttpServletRequest request) throws IOException {
//    String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset());
//    System.out.print(jsonString);
//    System.out.print("执行力我");
//    //System.out.print(jsonString);
//    //System.out.print("执行力我");
//    tb_tag tag = (tb_tag) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class);
//    locationService.tag_time(tag);
// }