| | |
| | | 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); |
| | |
| | | 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 }) |
| | |
| | | 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 }) |
| | |
| | | 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 }) |
| | |
| | | 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 }) |
| | |
| | | json.put("dataList", trackList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", page); |
| | | System.out.print(pageList); |
| | | //System.out.print(pageList); |
| | | 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); |
| | | // } |