?????????????????????????????????????????????????·?????QUI?????????????????????????????????????????о?????????????о????????????????????????????д?????????к?????API????ο????????????????????????????????Щ??????????????????????????????????????????????????????????????????????????????????????
?????????????????????ν???????????????????????????????????????????????setting???????????checked??????ɡ?
???????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????ajax????????????????????????????????????????????????????????????????????
???????????????У????????????????????????ó????????????£???????′???????????????????
??????????????????
?????????????XM??json??????????????????????json??????????Ч?????Щ????????????Щ????????????????ο??????????Щ????????????????????Щ????????????????????????????????????????????????????json??????????????????json???????
??????????????л??????????ú??о???????????????????????????????ū?????????????Ч?????????????????????
?????????????д???????????????????????????????????????????????????????????????????????????????????????????????list?б???????????????????json????????????????????????????json????????????????????????????????Ч????
????????????????json?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????json??????????????????????????json??array???????????????????Щ????????????????????????
????isParent???
????????????????????????????????????????????????????????isParent?true??????????y???????????????????????????????????ε???????????????????????????????????????????????????????????????????????????????????
?????????????json??????

 

treeList=resourceService.list(childMap);
JSONArray jsonArray=new JSONArray();
for(Organization organization:treeList)
{
JSONObject jsonObject=new JSONObject();
jsonObject.put("id"??organization.getId());
jsonObject.put("pid"??organization.getPid());
jsonObject.put("name"??organization.getName());
//?ж??????????????????????????isParent?????true???????????false
Map subchildMap=new LinkedHashMap();
subchildMap.put("sqlid"??"SubChildLst");
subchildMap.put("id"??organization.getId());
List<Organization> subtreeList=new ArrayList<Organization>();
subtreeList=resourceService.list(subchildMap);
if(subtreeList.size() > 0 )
{
jsonObject.put("isParent"??"true");
}else {
jsonObject.put("isParent"??"false");
}
boolean isChecked=resourceService.IsChecked(contactid??organization.getId());
if (null==contactid || "".equals(contactid) || "null".equals(contactid)) {
jsonObject.put("checked"??"false");
}else {
if (isChecked) {
jsonObject.put("checked"??"true");
}else {
jsonObject.put("checked"??"false");
}
}
jsonObject.put("open"??"false");
jsonArray.put(jsonObject);
}
String json=JsonUtil.toJson(jsonArray);