zengh
2021-01-13 b5bc0b851586c8ac4c74602a173fa5c141ef1353
src/main/java/org/springblade/modules/Netty/controller/nettyController.java
@@ -159,21 +159,33 @@
      int zT = 0;
      String arr = "";
      //将得到的设备与查询所得设备进行匹配
      for (int i = 0; i < childList.size(); i++) {
         for (int j = 0; j < pages.size(); j++) {
            if (childList.get(i).get("eqid") != null) {
               if (childList.get(i).get("eqid").equals(pages.get(j).getDeviceNumber())) {
                  zT = 1;
                  arr += pages.get(j).getId() + ",";
                  List<String> outData = new ArrayList<>();
                  outData.add("LC8109085B#@");
                  Channel channel = channelHashMap.get(pages.get(j).getDeviceNumber());
                  channel.writeAndFlush(Unpooled.copiedBuffer(outData.get(0), CharsetUtil.UTF_8));
                  break;
               }
            }
         }
      }
      if (!arr.equals("")){
         String substring = arr.substring(0, arr.length() - 1);
         equipmentService.updataType(substring);
      }
      if (zT == 0) {
         return R.success("暂无设备撤");
         return R.success("暂无设备布防");
      }
      return R.success("设备布防");
   }
@@ -201,11 +213,15 @@
      int zT = 0;
      String arr = "";
      //将得到的设备与查询所得设备进行匹配
      for (int i = 0; i < childList.size(); i++) {
         for (int j = 0; j < pages.size(); j++) {
            if (childList.get(i).get("eqid") != null) {
               if (childList.get(i).get("eqid").equals(pages.get(j).getDeviceNumber())) {
                  zT = 1;
                  arr += pages.get(j).getId() + ",";
                  List<String> outData = new ArrayList<>();
                  outData.add("LC8109085C#@");
                  Channel channel = channelHashMap.get(pages.get(j).getDeviceNumber());
@@ -215,6 +231,11 @@
         }
      }
      if (!arr.equals("")){
         String substring = arr.substring(0, arr.length() - 1);
         equipmentService.updataTypeC(substring);
      }
      if (zT == 0) {
         return R.success("暂无设备布防");
      }