/**
* 标签开始
*/
public int doStartTag() throws JspException {
Dao g4Dao = (Dao) SpringBeanLoader.getSpringBean("g4Dao");
HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
Dto grantDto = new BaseDto();
grantDto.put("roleid", request.getParameter("roleid"));
grantDto.put("authorizelevel", authorizelevel);
List grantedList = g4Dao.queryForList("ArmTagSupport.queryGrantedMenusByRoleId", grantDto);
List menuList = new ArrayList();
String account = WebUtils.getSessionContainer(request).getUserInfo().getAccount();
String developerAccount = WebUtils.getParamValue("DEFAULT_DEVELOP_ACCOUNT", request);
String superAccount = WebUtils.getParamValue("DEFAULT_ADMIN_ACCOUNT", request);
Dto qDto = new BaseDto();
String userid = WebUtils.getSessionContainer(request).getUserInfo().getUserid();
qDto.put("userid", userid);
String roletype = request.getParameter("roletype");
String menutype = SystemConstants.MENUTYPE_SYSTEM;
if (roletype.equals(SystemConstants.ROLETYPE_BUSINESS)) {
menutype = SystemConstants.MENUTYPE_BUSINESS;
}
if (authorizelevel.equals(SystemConstants.AUTHORIZELEVEL_ADMIN)) {
menutype = SystemConstants.MENUTYPE_BUSINESS;
}
qDto.put("roleid", roletype);
qDto.put("menutype", menutype);
if (account.equalsIgnoreCase(developerAccount) || account.equalsIgnoreCase(superAccount)) {
menuList = g4Dao.queryForList("ArmTagSupport.queryMenusForRoleGrant", qDto);
} else {
qDto.put("menutype", SystemConstants.MENUTYPE_BUSINESS);
menuList = g4Dao.queryForList("ArmTagSupport.queryMenusForGrant", qDto);
}
for (int i = 0; i < menuList.size(); i++) {
MenuVo menuVo = (MenuVo) menuList.get(i);
if (checkGeant(grantedList, menuVo.getMenuid()).booleanValue()) {
menuVo.setChecked("true");