@RequestMapping( value = "/icitem/list", method = {RequestMethod.GET, RequestMethod.POST}) @ResponseBody public Object getIcItems() { return materialListManager.getList(); }
@RequestMapping( value = "/department/list", method = {RequestMethod.GET, RequestMethod.POST}) @ResponseBody public Object getT_departments() { return materialListManager.getDepartmentList(); }
private List<TreeNode> getCompoentTree(List<PieceworkComponentEntity> compoents, Long id) { List<TreeNode> result = new ArrayList<TreeNode>(); if (id == null) { for (PieceworkComponentEntity _component : compoents) { if (_component.getSuper_id() == null) { TreeNode treeNode = new TreeNode(); treeNode.setId(_component.getId()); treeNode.setText(_component.getName()); MaterialBean department = materialListManager.getDepartmentEntityByFNumber(_component.getFnumber()); if (department != null) { treeNode.setIdx(department.getFname()); } result.add(treeNode); } } } else { for (PieceworkComponentEntity _component : compoents) { if (id.equals(_component.getSuper_id())) { TreeNode treeNode = new TreeNode(); treeNode.setId(_component.getId()); treeNode.setText(_component.getName()); MaterialBean department = materialListManager.getDepartmentEntityByFNumber(_component.getFnumber()); if (department != null) { treeNode.setIdx(department.getFname()); } result.add(treeNode); } } } for (TreeNode _node : result) { _node.setChildren(getCompoentTree(compoents, _node.getId())); } return result; }