action:
// 形成市场客户公司的树节点 public String marketjson() throws Exception { try { List<Org> dlist = bdao.list("from Org d where d.flag=3"); StringBuffer str = new StringBuffer(); str.append("["); for (int j = 0; j < dlist.size(); j++) { Long pId = 0L; if (dlist.get(j).getSuperOrg() != null && dlist.get(j).getSuperOrg().getOrgId() != null) { pId = dlist.get(j).getSuperOrg().getOrgId(); } if (j == dlist.size() - 1) { str.append("{id:" + dlist.get(j).getOrgId() + ",pId:" + pId + ",name:'" + dlist.get(j).getName() + "',t:'" + dlist.get(j).getName() + "'}"); } else { str.append("{id:" + dlist.get(j).getOrgId() + ",pId:" + pId + ",name:'" + dlist.get(j).getName() + "',t:'" + dlist.get(j).getName() + "'},"); } } str.append("]"); outJson(str.toString()); } catch (Exception e) { e.printStackTrace(); } return "ajax"; } // 形成市场客户公司的树节点 public String