15832144755
2022-03-17 bc131131c5c96f8cb3bed679d4a359820c22e335
src/main/java/com/hxzkoa/controller/WarningController.java
@@ -51,6 +51,15 @@
   }
   @ResponseBody
   @RequestMapping(value = "/warningSummarya.do", method = { RequestMethod.POST, RequestMethod.GET })
   public JSONObject warningSummarya(HttpServletRequest request) {
      JSONObject json = new JSONObject();
      List<tb_warning> warningSummaryList = warningService.getWarningSummarya();
      json.put("dataList", warningSummaryList);
      return json;
   }
   @ResponseBody
   @RequestMapping(value = "/warningSummary_search.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String warningSummary_search(HttpServletRequest request) throws IOException {
      JSONObject json = new JSONObject();
@@ -78,6 +87,28 @@
   }
   @ResponseBody
   @RequestMapping(value = "/warningSummary_searcha.do", method = { RequestMethod.POST, RequestMethod.GET })
   public JSONObject warningSummary_searcha(HttpServletRequest request) throws IOException {
      JSONObject json = new JSONObject();
      String input = request.getParameter("tagid");
      if (("").equals(input) || input == null) {
         String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset());
         tb_tag tag = (tb_tag) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class);
         input = tag.getTag_id();
         List<tb_warning> warningSummaryList = warningService.searchWarningSummary(input);
         if (warningSummaryList.size()>0){
            json.put("result", warningSummaryList.get(0));
         } else {
            json.put("result", "null");
         }
      } else {
         List<tb_warning> warningSummaryList = warningService.searchWarningSummary(input);
         json.put("dataList", warningSummaryList);
      }
      return json;
   }
   @ResponseBody
   @RequestMapping(value = "/warningSummary_page.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String warningSummary_page(HttpServletRequest request) {
      String pageStr = request.getParameter("page");
@@ -161,6 +192,15 @@
   }
   @ResponseBody
   @RequestMapping(value = "/realTimeWarninga.do", method = { RequestMethod.POST, RequestMethod.GET })
   public JSONObject realTimeWarninga(HttpServletRequest request) {
      JSONObject json = new JSONObject();
      List<tb_realinwarning> realTimeWarningList = warningService.getRealinWarninga();
      json.put("dataList", realTimeWarningList);
      return json;
   }
   @ResponseBody
   @RequestMapping(value = "/realTimeWarning_delete.do", method = { RequestMethod.POST, RequestMethod.GET })
   public void realTimeWarning_delete(HttpServletRequest request) {
      String checkValStr = request.getParameter("checkVal");
@@ -170,12 +210,29 @@
   }
   @ResponseBody
   @RequestMapping(value = "/realTimeWarning_deletea.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int realTimeWarning_deletea(HttpServletRequest request) {
      String checkValStr = request.getParameter("checkVal");
      checkValStr = checkValStr.replaceAll("\"", "");
      String[] checkVal = checkValStr.split(",");
      int aaa = warningService.realinWarning_deletea(checkVal);
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/realTimeWarning_deleteAll.do", method = { RequestMethod.POST, RequestMethod.GET })
   public void realTimeWarning_deleteAll(HttpServletRequest request) {
      warningService.realinWarning_deleteAll();
   }
   @ResponseBody
   @RequestMapping(value = "/realTimeWarning_deleteAlla.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int realTimeWarning_deleteAlla(HttpServletRequest request) {
      int aaa = warningService.realinWarning_deleteAlla();
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/realTimeWarning_search.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String realTimeWarning_search(HttpServletRequest request) throws IOException {
      JSONObject json = new JSONObject();
@@ -203,6 +260,28 @@
   }
   @ResponseBody
   @RequestMapping(value = "/realTimeWarning_searcha.do", method = { RequestMethod.POST, RequestMethod.GET })
   public JSONObject realTimeWarning_searcha(HttpServletRequest request) throws IOException {
      JSONObject json = new JSONObject();
      String input = request.getParameter("tagid");
      if (("").equals(input) || input == null) {
         String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset());
         tb_tag tag = (tb_tag) JSONObject.toBean(JSONObject.fromObject(jsonString), tb_tag.class);
         input = tag.getTag_id();
         List<tb_realinwarning> realTimeWarningList = warningService.searchRealinWarning(input);
         if (realTimeWarningList.size()>0){
            json.put("result", realTimeWarningList.get(0));
         } else {
            json.put("result", "null");
         }
      } else {
         List<tb_realinwarning> realTimeWarningList = warningService.searchRealinWarning(input);
         json.put("dataList", realTimeWarningList);
      }
      return json;
   }
   @ResponseBody
   @RequestMapping(value = "/realTimeWarning_page.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String realTimeWarning_page(HttpServletRequest request) {
      String pageStr = request.getParameter("page");
@@ -286,6 +365,15 @@
   }
   @ResponseBody
   @RequestMapping(value = "/historicalWarninga.do", method = { RequestMethod.POST, RequestMethod.GET })
   public JSONObject historicalWarninga(HttpServletRequest request) {
      JSONObject json = new JSONObject();
      List<tb_historyinwarning> historicalWarningList = warningService.getHistoricalWarninga();
      json.put("dataList", historicalWarningList);
      return json;
   }
   @ResponseBody
   @RequestMapping(value = "/historicalWarning_delete.do", method = { RequestMethod.POST, RequestMethod.GET })
   public void historicalWarning_delete(HttpServletRequest request) {
      String checkValStr = request.getParameter("checkVal");
@@ -295,6 +383,16 @@
   }
   
   @ResponseBody
   @RequestMapping(value = "/historicalWarning_deletea.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int historicalWarning_deletea(HttpServletRequest request) {
      String checkValStr = request.getParameter("checkVal");
      checkValStr = checkValStr.replaceAll("\"", "");
      String[] checkVal = checkValStr.split(",");
      int aaa = warningService.historicalWarning_deletea(checkVal);
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/Warning_delete.do", method = { RequestMethod.POST, RequestMethod.GET })
   public void Warning_delete(HttpServletRequest request) {
      String checkValStr = request.getParameter("checkVal");
@@ -314,12 +412,39 @@
   }
   @ResponseBody
   @RequestMapping(value = "/Warning_deletea.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int Warning_deletea(HttpServletRequest request) {
      String checkValStr = request.getParameter("checkVal");
      String tagids = request.getParameter("tagids");
      String types = request.getParameter("types");
      checkValStr = checkValStr.replaceAll("\"", "");
      tagids = tagids.replaceAll("\"", "");
      types = types.replaceAll("\"", "");
      String[] checkVal = checkValStr.split(",");
      String[] tagid = tagids.split(",");
      String[] typess = types.split(",");
      int aaa = warningService.Warning_deletea(checkVal);
      for (int i = 0; i < tagid.length; i++) {
         String xieyi = "BSTOCS1,DELETEWARN," +tagid[i]+ "," +typess[i]+ ",END";
         Udp_Out.udp_to_cs(xieyi);
      }
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/historicalWarning_deleteAll.do", method = { RequestMethod.POST, RequestMethod.GET })
   public void historicalWarning_deleteAll(HttpServletRequest request) {
      warningService.historicalWarning_deleteAll();
   }
   
   @ResponseBody
   @RequestMapping(value = "/historicalWarning_deleteAlla.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int historicalWarning_deleteAlla(HttpServletRequest request) {
      int aaa = warningService.historicalWarning_deleteAlla();
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/Warning_deleteAll.do", method = { RequestMethod.POST, RequestMethod.GET })
   public void Warning_deleteAll(HttpServletRequest request) {
      String input = request.getParameter("fenlei");
@@ -333,6 +458,21 @@
   }
   @ResponseBody
   @RequestMapping(value = "/Warning_deleteAlla.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int Warning_deleteAlla(HttpServletRequest request) {
      String input = request.getParameter("fenlei");
      int aaa = 0;
      if (input.equals("全部")) {
         aaa = warningService.Warning_deleteAlla();
         String xieyi = "BSTOCS1,DELETEWARNALL,END";
         Udp_Out.udp_to_cs(xieyi);
      } else {
         warningService.Warning_deletefenlei(input);
      }
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/historicalWarning_search.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String historicalWarning_search(HttpServletRequest request) {
      String input = request.getParameter("input");
@@ -348,6 +488,16 @@
   }
   @ResponseBody
   @RequestMapping(value = "/historicalWarning_searcha.do", method = { RequestMethod.POST, RequestMethod.GET })
   public JSONObject historicalWarning_searcha(HttpServletRequest request) {
      String input = request.getParameter("tagid");
      List<tb_historyinwarning> historicalWarningList = warningService.searchHistoricalWarning(input);
      JSONObject json = new JSONObject();
      json.put("dataList", historicalWarningList);
      return json;
   }
   @ResponseBody
   @RequestMapping(value = "/historicalWarning_page.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String labelManagement_page(HttpServletRequest request) {
      String pageStr = request.getParameter("page");
@@ -438,6 +588,23 @@
   }
   
   @ResponseBody
   @RequestMapping(value = "/historicalWarning_handlea.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int historicalWarning_handlea(HttpServletRequest request) {
      String checkValStr = request.getParameter("checkVal");
      String types = request.getParameter("types");
      types = types.replaceAll("\"", "");
      String[] typess = types.split(",");
      checkValStr = checkValStr.replaceAll("\"", "");
      String[] checkVal = checkValStr.split(",");
      int aaa = warningService.historicalWarning_handle(checkVal);
      for (int i = 0; i < checkVal.length; i++) {
         String xieyi = "BSTOCS1,DELLWARN," +checkVal[i]+ "," +typess[i]+ ",END";
         Udp_Out.udp_to_cs(xieyi);
      }
      return aaa;
   }
   @ResponseBody
   @RequestMapping(value = "/historicalWarning_handleAll.do", method = { RequestMethod.POST, RequestMethod.GET })
   public void historicalWarning_handleAll(HttpServletRequest request) {
      warningService.historicalWarning_handleAll();
@@ -446,6 +613,16 @@
      Udp_Out.udp_to_cs(xieyi);
   }
   @ResponseBody
   @RequestMapping(value = "/historicalWarning_handleAlla.do", method = { RequestMethod.POST, RequestMethod.GET })
   public int historicalWarning_handleAlla(HttpServletRequest request) {
      int aaa = warningService.historicalWarning_handleAll();
      warningService.historicalWarning_handleAll_realpositoin();
      String xieyi = "BSTOCS1,DELLWARNALL,END";
      Udp_Out.udp_to_cs(xieyi);
      return aaa;
   }
   @RequestMapping(value = "/warning_bw_add.do", method = { RequestMethod.POST, RequestMethod.GET })
   public void warning_bw_add(HttpServletRequest request) throws IOException {
      String jsonString = RequestUtils.getRequestJsonString(request, Config.getCharset());
@@ -498,10 +675,31 @@
   }
   
   @ResponseBody
   @RequestMapping(value = "/fenlei.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String fenlei(HttpServletRequest request) {
   @RequestMapping(value = "/shaileixing.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String shaileixing(HttpServletRequest request) {
      String fenlei = request.getParameter("fenlei");
      List<tb_warning> labelManagementList = warningService.getfenlei(fenlei);
      List<tb_warning> labelManagementList = warningService.getleixing(fenlei);
      JSONObject json = new JSONObject();
      json.put("dataList", labelManagementList);
      return json.toString();
   }
   @ResponseBody
   @RequestMapping(value = "/shaizhuangtai.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String shaizhuangtai(HttpServletRequest request) {
      String fenlei = request.getParameter("fenlei");
      List<tb_warning> labelManagementList = warningService.getzhuangtai(fenlei);
      JSONObject json = new JSONObject();
      json.put("dataList", labelManagementList);
      return json.toString();
   }
   @ResponseBody
   @RequestMapping(value = "/shuangshai.do", method = { RequestMethod.POST, RequestMethod.GET })
   public String shuangshai(HttpServletRequest request) {
      String fenlei = request.getParameter("fenlei");
      String fenlei2 = request.getParameter("fenlei2");
      List<tb_warning> labelManagementList = warningService.getshuangshai(fenlei,fenlei2);
      JSONObject json = new JSONObject();
      json.put("dataList", labelManagementList);
      return json.toString();