String isvisiable = request.getParameter("isvisiable");
String issys = request.getParameter("issys");
String menu_rel = request.getParameter("isrel");
String menu_type = request.getParameter("menu_type");
String memo = request.getParameter("memo");
Menu menu = new Menu();
boolean flag = false;
Map<String, Object> map = new HashMap<String, Object>();
if (menu_name == null || "".equals(menu_name)) {
flag = true;
map.put("msg", "菜单名称不能空");
}
if (menu_url == null || "".equals(menu_url)) {
flag = true;
map.put("msg", "URL不能为空");
}
int parent = 0;
if (menu_parent == null || menu_parent.equals("")) {
flag = true;
map.put("msg", "父节点不能为空");
} else {
parent = Integer.valueOf(menu_parent);
}
if (flag) {
map.put("failture", true);
} else {
menu.setMenu_id(Integer.valueOf(menu_id));
menu.setMenu_name(menu_name);
menu.setMenu_url(menu_url);
menu.setMenu_parent(parent);
menu.setMenu_icon(menu_icon);
menu.setIsleaf(Integer.valueOf(isleaf));
menu.setIsvisiable(Integer.valueOf(isvisiable));
menu.setIssys(Integer.valueOf(issys));
menu.setMenu_rel(Integer.valueOf(menu_rel));
menu.setMenu_type(Integer.valueOf(menu_type));
menu.setMemo(memo);
try {
menuDao.updateMenu(menu);
map.put("success", true);
map.put("msg", "修改成功!");
} catch (Exception e) {