| | |
| | | |
| | | 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#@"); |
| | | int code = Integer.parseInt(pages.get(j).getDeviceNumber()); |
| | | Channel channel = channelHashMap.get(code); |
| | | Channel channel = channelHashMap.get(pages.get(j).getDeviceNumber()); |
| | | if(channel == null){ |
| | | break; |
| | | } |
| | | 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("设备布防"); |
| | | } |
| | |
| | | |
| | | 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()); |
| | | if(channel == null){ |
| | | break; |
| | | } |
| | | channel.writeAndFlush(Unpooled.copiedBuffer(outData.get(0), CharsetUtil.UTF_8)); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!arr.equals("")){ |
| | | String substring = arr.substring(0, arr.length() - 1); |
| | | equipmentService.updataTypeC(substring); |
| | | } |
| | | |
| | | if (zT == 0) { |
| | |
| | | List<String> outData = new ArrayList<>(); |
| | | outData.add("LC8109085B#@"); |
| | | Channel channel = channelHashMap.get(deviceNumber); |
| | | if(channel == null){ |
| | | return R.success("未查询到设备"); |
| | | } |
| | | channel.writeAndFlush(Unpooled.copiedBuffer(outData.get(0), CharsetUtil.UTF_8)); |
| | | return R.success("设备布防"); |
| | | |
| | |
| | | List<String> outData = new ArrayList<>(); |
| | | outData.add("LC8109085C#@"); |
| | | Channel channel = channelHashMap.get(deviceNumber); |
| | | if(channel == null){ |
| | | return R.success("未查询到设备"); |
| | | } |
| | | channel.writeAndFlush(Unpooled.copiedBuffer(outData.get(0), CharsetUtil.UTF_8)); |
| | | return R.success("设备撤防"); |
| | | |