freemaker嵌套

 <#list allinfos as danwei>
                 <h4 class="sidebar-header" data-toggle="collapse"  href="#collapse${ danwei_index}">
                        <strong>${danwei.orgname!}</strong>
                    </h4>
                    <ul class="nav sidebar-nav collapse"  id="collapse${danwei_index}" >
                    
                      <#list danwei.mulu as Unit>
                      <li><a href="#" οnclick="ShowitemmuluDetail(this)" _id="${Unit.code!}">${Unit.name!}</a></li>
</#list> 
                    </ul>

                </#list> 



JSONArray itemallbyorg = new JSONArray();
JSONArray allinfos = new JSONArray();
JSONArray orgnames = new JSONArray();
JSONArray UnitListall = new JSONArray();
JSONArray muluallbyorg = new JSONArray();
if (null != UnitList && UnitList.size() > 0) {
// 对每个单位进行循环遍历查询一级目录
for (int i = 0; i < UnitList.size(); i++) {
EnforceUnit bean = UnitList.get(i);
String orgid = bean.getOrganizeId();


JSONArray jsonarraymulu2 = new JSONArray();


JSONObject allinfo = new JSONObject();
JSONObject infos = new JSONObject();
infos.put("orgid", orgid);
infos.put("orgname", bean.getOrganizeName());


JSONArray para = new JSONArray();


StringBuffer where2 = new StringBuffer();
where2.append(" AND TYPE='CF' AND FOLDER_TREE_LEVEL=0 ");
where2.append(MessageFormat.format(" AND ORG_CODE=''{0}''", orgid));
com.alibaba.fastjson.JSONObject jsonmulu = null;
jsonmulu = powerManagerService.getFloderListByPage(1, 1000, where2.toString(), para);


// JSONObject jsonmulu =
// powerManagerService.getIndexListByPage(1,20,"",UnitList.get(i).getOrganizeId(),
// "", "",regionCode,"");
JSONArray muluarray = jsonmulu.getJSONArray("pageList");
if (null != muluarray && muluarray.size() > 0) {
for (int m = 0; m < muluarray.size(); m++) {
JSONObject muluone = new JSONObject();
JSONObject muluonce = muluarray.getJSONObject(m);
muluone.put("name", muluonce.getJSONObject("columns").get("FOLDER_NAME"));
muluone.put("id", muluonce.getJSONObject("columns").get("ID"));
muluone.put("code", muluonce.getJSONObject("columns").get("CODE"));
muluone.put("unitorgcode", orgid);
muluone.put("unitorgname", bean.getOrganizeName());
jsonarraymulu2.add(muluone);
}
}
infos.put("mulu", jsonarraymulu2);
muluallbyorg.add(jsonarraymulu2);
allinfo.put("orgs", bean);
allinfo.put("mulus", jsonarraymulu2);
UnitListall.add(allinfo);
// UnitListall.add(jsonarraymulu2);
orgnames.add(bean.getOrganizeName());
allinfos.add(infos);
setAttr("zhifamulu" + i, jsonarraymulu2);
}
}
setAttr("orgnames", orgnames);
setAttr("UnitListall", UnitListall);
setAttr("muluallbyorg", muluallbyorg);
setAttr("allinfos", allinfos);
setAttr("itemallbyorg", itemallbyorg.toJSONString());
setAttr("root", getCdnURL(request));



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值