| | |
| | | |
| | | 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) { |
| | |
| | | */ |
| | | @PostMapping("/selectNettyChannelOb") |
| | | @ApiOperationSupport(order = 10) |
| | | public R selectNettyChannelOb(String deviceNumber, HttpServletResponse response) { |
| | | public R selectNettyChannelOb(String deviceNumber,String ID, HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | |
| | | 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)); |
| | | equipmentService.updataType(ID); |
| | | return R.success("设备布防"); |
| | | |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/selectNettyChannelOc") |
| | | @ApiOperationSupport(order = 11) |
| | | public R selectNettyChannelOc(String deviceNumber, HttpServletResponse response) { |
| | | public R selectNettyChannelOc(String deviceNumber,String ID, HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | |
| | | 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)); |
| | | equipmentService.updataTypeC(ID); |
| | | return R.success("设备撤防"); |
| | | |
| | | } |