| | |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(pid); |
| | | IPage<EquipmentVO> page = null; |
| | | //清空全局参数 |
| | | childMenu = new ArrayList(); |
| | | |
| | | if (pid == null || pid.equals("")) { |
| | | //根据查询条件得到所有设备 |
| | | page = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment, null); |
| | | } else { |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(); |
| | | //根据传入的id递归出该节点下所有的设备 |
| | | List<Map<String, Object>> childList = treeIdList(treedatas, pid); |
| | | |
| | | //根据查询条件得到所有设备 |
| | | page = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment, childList); |
| | | } |
| | | |
| | | System.out.println(childList); |
| | | |
| | | |
| | | |
| | | |
| | | return R.data(null); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | childMenu = new ArrayList(); |
| | | |
| | | //根据查询条件得到所有设备 |
| | | IPage<EquipmentVO> pageData = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment); |
| | | IPage<EquipmentVO> pageData = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment, null); |
| | | |
| | | List<EquipmentVO> pages = pageData.getRecords(); |
| | | List<EquipmentVO> datas = new ArrayList(); |
| | | |
| | | |
| | | |
| | | if (pid == null || pid.equals("")) { |
| | |
| | | } |
| | | datas = pages; |
| | | } else { |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(pid); |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(); |
| | | //根据传入的id递归出该节点下所有的设备 |
| | | List<Map<String, Object>> childList = treeMenuList(treedatas, pid); |
| | | //将得到的设备与查询所得设备进行匹配 |
| | |
| | | pages.get(j).setType(0); |
| | | } |
| | | |
| | | if (childList.get(i).get("eqid") != null) { |
| | | if (childList.get(i).get("eqid") != null && !childList.get(i).get("eqid").equals("")) { |
| | | if (childList.get(i).get("eqid").equals(pages.get(j).getDeviceNumber())) { |
| | | datas.add(pages.get(j)); |
| | | } |
| | |
| | | if (menuList.get(i).get("pId").toString().equals(pid) ) { |
| | | //递归遍历下一级 |
| | | treeIdList(menuList, menuList.get(i).get("id").toString()); |
| | | if (menuList.get(i).get("eqid") != null || menuList.get(i).get("eqid") != "") { |
| | | if (menuList.get(i).get("eqid") != null && !menuList.get(i).get("eqid").equals("")) { |
| | | childMenu.add(menuList.get(i).get("eqid")); |
| | | } |
| | | } |