| | |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import com.hxzkoa.json.tb_achor; |
| | | import com.hxzkoa.json.tb_anchor_nearby; |
| | | import com.hxzkoa.json.tb_department; |
| | | import com.hxzkoa.json.tb_fence; |
| | | import com.hxzkoa.json.tb_shipin; |
| | | import com.hxzkoa.json.tb_tongbuanchor; |
| | | import com.hxzkoa.json.tb_xunjianbaobiao; |
| | | import com.hxzkoa.json.tb_xunjianset; |
| | | import com.hxzkoa.services.BasicInfoService; |
| | |
| | | request.setAttribute("department", department); |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping(value = "/jiankongManagement.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String jiankongManagement(HttpServletRequest request) { |
| | | String toPage = "forward:/hxzk/fence/jiankongManagement.jsp"; |
| | | List<tb_shipin> shipinManagementList = fenceService.getShipinManagement(1); |
| | | request.setAttribute("shipinManagementList", shipinManagementList); |
| | | List<tb_fence> fenceList = fenceService.getFenceList(); |
| | | request.setAttribute("fences", fenceList); |
| | | int curPage = 1; |
| | | int count = fenceService.getShipinManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | request.setAttribute("pageList", PageUtil.getPage(minPage)); |
| | | request.setAttribute("curPage", curPage); |
| | | return toPage; |
| | | } |
| | | |
| | | @RequestMapping(value = "/shipinManagement_add.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void shipinManagement_add(HttpServletRequest request) throws IOException { |
| | | tb_shipin shipin = new tb_shipin(); |
| | | shipin.setFencename(request.getParameter("fencename")); |
| | | shipin.setShebeiid(request.getParameter("shebeiid")); |
| | | shipin.setTongdaoid(request.getParameter("tongdaoid")); |
| | | fenceService.shipinManagement_add(shipin); |
| | | } |
| | | |
| | | @RequestMapping(value = "/shipinManagement_modify.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void shipinManagement_modify(HttpServletRequest request) { |
| | | tb_shipin shipin = new tb_shipin(); |
| | | String idstr = request.getParameter("id"); |
| | | idstr = idstr.replaceAll("\"", ""); |
| | | String[] id = idstr.split(","); |
| | | shipin.setId(Integer.parseInt(id[0])); |
| | | shipin.setFencename(request.getParameter("fencename")); |
| | | shipin.setShebeiid(request.getParameter("shebeiid")); |
| | | shipin.setTongdaoid(request.getParameter("tongdaoid")); |
| | | System.out.print(shipin.getId()); |
| | | System.out.print(shipin.getFencename()); |
| | | System.out.print(shipin.getShebeiid()); |
| | | System.out.print(shipin.getTongdaoid()); |
| | | fenceService.shipinManagement_modify(shipin); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/shipinManagement_delete.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void shipinManagement_delete(HttpServletRequest request) { |
| | | String checkValStr = request.getParameter("checkVal"); |
| | | checkValStr = checkValStr.replaceAll("\"", ""); |
| | | String[] checkVal = checkValStr.split(","); |
| | | fenceService.shipinManagement_delete(checkVal); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/shipinManagement_deleteAll.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void shipinManagement_deleteAll(HttpServletRequest request) { |
| | | fenceService.shipinManagement_deleteAll(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/shipinManagement_search.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String shipinManagement_search(HttpServletRequest request) throws IOException { |
| | | JSONObject json = new JSONObject(); |
| | | String input = request.getParameter("input"); |
| | | System.out.print(input); |
| | | int curPage = 1; |
| | | List<Integer> pageList = new ArrayList<Integer>(); |
| | | List<tb_shipin> shipinManagementList = fenceService.searchshipinManagement(input); |
| | | pageList.add(1); |
| | | json.put("dataList", shipinManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", curPage); |
| | | System.out.print(json.toString()); |
| | | return json.toString(); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/shipinManagement_page.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public String shipinManagement_page(HttpServletRequest request) { |
| | | String pageStr = request.getParameter("page"); |
| | | String curPageStr = request.getParameter("curPage"); |
| | | int count = fenceService.getShipinManagementCount(); |
| | | int minPage = PageUtil.getMinPage(count); |
| | | int curPage = Integer.parseInt(curPageStr); |
| | | int page = 1; |
| | | if ("pre".equals(pageStr)) { |
| | | if (curPage > 1) { |
| | | page = curPage - 1; |
| | | } |
| | | } else if ("next".equals(pageStr)) { |
| | | if (curPage < minPage) { |
| | | page = curPage + 1; |
| | | } |
| | | } else { |
| | | page = Integer.parseInt(pageStr); |
| | | } |
| | | List<tb_shipin> anchorManagementList = fenceService.getShipinManagement(page); |
| | | List<Integer> pageList = PageUtil.getPage(PageUtil.getLocPage(page, curPage), page, minPage); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("dataList", anchorManagementList); |
| | | json.put("pageList", pageList); |
| | | json.put("curPage", page); |
| | | return json.toString(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/fenceList_modify.do", method = { RequestMethod.POST, RequestMethod.GET }) |
| | | public void fenceList_modify(HttpServletRequest request) throws ParseException { |