15832144755
2022-03-17 bc131131c5c96f8cb3bed679d4a359820c22e335
src/main/java/com/hxzkoa/controller/FenceController.java
@@ -59,6 +59,15 @@
      return toPage;
   }
   
   @ResponseBody
   @RequestMapping(value = "/fenceLista.do", method = { RequestMethod.POST, RequestMethod.GET })
   public JSONObject fenceLista(HttpServletRequest request) throws ParseException {
      JSONObject json = new JSONObject();
      List<tb_fence> fenceList = fenceService.getFenceLista();
      json.put("dataList", fenceList);
      return json;
   }
   @RequestMapping(value = "/jiankongManagement.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String jiankongManagement(HttpServletRequest request) {
      String toPage = "forward:/hxzk/fence/jiankongManagement.jsp";
@@ -212,6 +221,24 @@
      String xieyi = "BSTOCS1,ALTERFENCE,"+fenceListList.get(0).getFloor()+","+fenceListList.get(0).getType()+","+fence.getBumen()+","+fence.getName()+","+fence.getZuobiao()+","+fenceListList.get(0).getShape()+","+fence.getStart()+","+fence.getStop()+","+fenceListList.get(0).getAddtime()+","+fenceListList.get(0).getColor()+",END";
      Udp_Out.udp_to_cs(xieyi);
   }
   @ResponseBody
   @RequestMapping(value = "/fenceList_modifya.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int fenceList_modifya(HttpServletRequest request) throws ParseException {
      tb_fence fence = new tb_fence();
      fence.setBumen(request.getParameter("bumen"));
      fence.setName(request.getParameter("name"));
      fence.setZuobiao(request.getParameter("zuobiao"));
      fence.setStart(request.getParameter("start"));
      fence.setStart(request.getParameter("stop"));
      fence.setBaoliu1(request.getParameter("gaodu"));
      fence.setId(Integer.parseInt(request.getParameter("id")));
      int aaa = fenceService.fenceList_modify(fence);
      List<tb_fence> fenceListList = fenceService.searchFenceListid(fence.getId());
      String xieyi = "BSTOCS1,ALTERFENCE,"+fenceListList.get(0).getFloor()+","+fenceListList.get(0).getType()+","+fence.getBumen()+","+fence.getName()+","+fence.getZuobiao()+","+fenceListList.get(0).getShape()+","+fence.getStart()+","+fence.getStop()+","+fenceListList.get(0).getAddtime()+","+fenceListList.get(0).getColor()+",END";
      Udp_Out.udp_to_cs(xieyi);
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/fenceList_delete.do", method = { RequestMethod.POST, RequestMethod.GET })
@@ -228,6 +255,23 @@
         Udp_Out.udp_to_cs(xieyi);
      }
   }
   @ResponseBody
   @RequestMapping(value = "/fenceList_deletea.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int fenceList_deletea(HttpServletRequest request) throws NumberFormatException, ParseException {
      String checkValStr = request.getParameter("checkVal");
      checkValStr = checkValStr.replaceAll("\"", "");
      String[] checkVal = checkValStr.split(",");
      int aaa = fenceService.fenceList_delete(checkVal);
      for (int i = 0; i < checkVal.length; i++) {
         List<tb_fence> fences = fenceService.searchFenceListid(Integer.parseInt(checkVal[i]));
         tb_fence fence = new tb_fence();
         fence = fences.get(0);
         String xieyi = "BSTOCS1,DELETEFECNCE,"+fence.getName()+",END";
         Udp_Out.udp_to_cs(xieyi);
      }
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/fenceList_deleteAll.do", method = { RequestMethod.POST, RequestMethod.GET })
@@ -236,6 +280,15 @@
      String xieyi = "BSTOCS1,DELETEALLFENCE,END";
      Udp_Out.udp_to_cs(xieyi);
   }
   @ResponseBody
   @RequestMapping(value = "/fenceList_deleteAlla.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int fenceList_deleteAlla(HttpServletRequest request) {
      int aaa = fenceService.fenceList_deleteAll();
      String xieyi = "BSTOCS1,DELETEALLFENCE,END";
      Udp_Out.udp_to_cs(xieyi);
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/fenceList_search.do", method = { RequestMethod.POST, RequestMethod.GET })
@@ -246,6 +299,16 @@
      json.put("dataList", fenceListList);
      return json.toString();
   }
   @ResponseBody
   @RequestMapping(value = "/fenceList_searcha.do", method = { RequestMethod.POST, RequestMethod.GET })
   public JSONObject fenceList_searcha(HttpServletRequest request) throws ParseException {
      String input = request.getParameter("type");
      List<tb_fence> fenceListList = fenceService.searchFenceList(input);
      JSONObject json = new JSONObject();
      json.put("dataList", fenceListList);
      return json;
   }
   @RequestMapping(value = "/inspectionSettings.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String inspectionSettings(HttpServletRequest request) {