master
20918 1 year ago
parent 0120abecad
commit 8a70e9f081

@ -32,9 +32,10 @@ public class MenuManageServlet extends DispatchServlet
String companyid = request.getParameter("companyidQ"); String companyid = request.getParameter("companyidQ");
String areaid = request.getParameter("areaidQ"); String areaid = request.getParameter("areaidQ");
String menuitem = request.getParameter("menuitemQ"); String menuitem = request.getParameter("menuitemQ");
System.out.println(menuitem);
if ((menuitem != null) && (!(menuitem.equals("")))) { if ((menuitem != null) && (!(menuitem.equals("")))) {
sql.append(" and menuitem=").append(menuitemname).append("'"); sql.append(" and menuitem=").append(menuitemname).append("");
} else { } else {
if ((menuitemname != null) && (!(menuitemname.equals("")))) { if ((menuitemname != null) && (!(menuitemname.equals("")))) {
sql.append(" and menuitemname like '%").append(menuitemname).append("%'"); sql.append(" and menuitemname like '%").append(menuitemname).append("%'");
@ -62,6 +63,30 @@ public class MenuManageServlet extends DispatchServlet
} }
} }
public void queryMenu1(HttpServletRequest request, HttpServletResponse response) throws Exception {
StringBuffer sql = new StringBuffer("select distinct frameworkid,menuitem,menuitemname from tab_menuitem where 1=1");
String menuitemname = request.getParameter("menuitemnameQ");
String companyid = request.getParameter("companyidQ");
String areaid = request.getParameter("areaidQ");
String menuitem = request.getParameter("menuitemQ");
Connection conn = null;
try {
conn = DbConn.getConn();
//HashFmlBuf buf = (HashFmlBuf)JDBCUtils.query(conn, sql.toString(),new HashFmlBufResultSetHandler());
PageQuery pageQuery = new PageQuery(conn,sql.toString(),new HashFmlBufResultSetHandler(),request);
HashFmlBuf buf=(HashFmlBuf)pageQuery.query(20);
request.setAttribute("menu_buf", buf);
request.getRequestDispatcher("/manage/MenuManage.jsp").forward(request, response);
} catch (SQLException e) {
throw e;
} finally {
JDBCUtils.close(conn);
}
}
public void deleteMenu(HttpServletRequest request, HttpServletResponse response) throws Exception { public void deleteMenu(HttpServletRequest request, HttpServletResponse response) throws Exception {
String companyid = request.getParameter("companyid"); String companyid = request.getParameter("companyid");
String menuitem = request.getParameter("menuitem"); String menuitem = request.getParameter("menuitem");
@ -101,7 +126,7 @@ public class MenuManageServlet extends DispatchServlet
public void getMenuTree(HttpServletRequest request, HttpServletResponse response) throws Exception { public void getMenuTree(HttpServletRequest request, HttpServletResponse response) throws Exception {
String companyid = request.getParameter("companyid"); String companyid = request.getParameter("companyid");
String menuitem = request.getParameter("menuitem"); String menuitem = request.getParameter("menuitem");
String sql = "select a.frameworkid,a.menuitem,a.menuitemname,a.menuid,a.menuname,a.menulevel,a.uplevel,decode(b.web_workobject,null,'0','1') as type from tab_menuitem a,tab_funcmodu b where a.menuid=b.funcmoducode(+) and a.frameworkid = ? and a.menuitem =? order by type,a.menuid"; String sql = "select a.frameworkid,a.menuitem,a.menuitemname,a.menuid,a.menuname,a.menulevel,a.uplevel ,(CASE WHEN b.web_workobject IS NULL THEN '0' ELSE '1' END) as type from tab_menuitem a,tab_funcmodu b where a.menuid=b.funcmoducode and a.frameworkid = ? and a.menuitem =? order by type , a.menuid";
Connection conn = null; Connection conn = null;
try { try {
conn = DbConn.getConn(); conn = DbConn.getConn();
@ -280,6 +305,38 @@ public class MenuManageServlet extends DispatchServlet
} }
} }
public void editTree(HttpServletRequest request, HttpServletResponse response) throws Exception {
ManagerServlet ms=new ManagerServlet();
String menuitem=request.getParameter("menuitem");
String companyid=request.getParameter("companyid");
MenuTree tree = (MenuTree)request.getSession().getAttribute("menu_tree");
if (tree == null)
throw new Exception("提示!");
String menuitemname = request.getParameter("menuitemname");
tree.setTreeName(menuitemname);
Connection conn = null;
try {
conn = DbConn.getConn();
conn.setAutoCommit(false);
JDBCUtils.update(conn, "delete from tab_menuitem where menuitem=? and frameworkid=?",
tree.getTreeId(), tree.getCompanyId());
MenuTreeUtils.saveTree(conn, tree);
//oracle数据库手动提交mysql中 自动提交autoCommit();
conn.commit();
queryMenu1(request, response);
} catch (SQLException e) {
if (conn != null)
conn.rollback();
throw e;
} finally {
JDBCUtils.close(conn);
}
}
public void defaultMethod(HttpServletRequest request, HttpServletResponse response) throws Exception { public void defaultMethod(HttpServletRequest request, HttpServletResponse response) throws Exception {
} }
} }

@ -76,7 +76,6 @@ public class MenuTreeUtils {
public static void saveTree(Connection conn, MenuTree tree) throws SQLException { public static void saveTree(Connection conn, MenuTree tree) throws SQLException {
BatchParam param = new BatchParam(); BatchParam param = new BatchParam();
System.out.println();
for (int i=0; i<tree.size(); i++) { for (int i=0; i<tree.size(); i++) {
setParam(tree.getMenu(i), param, tree.getCompanyId(),tree.getAreaId(),tree.getTreeId(),tree.getTreeName(),1); setParam(tree.getMenu(i), param, tree.getCompanyId(),tree.getAreaId(),tree.getTreeId(),tree.getTreeName(),1);
} }

@ -29,7 +29,7 @@ else{
} }
if (operate.equals("getMenuTree")) { if (operate.equals("getMenuTree")) {
disabled = "disabled"; disabled = "readonly";
} }
%> %>
<html> <html>
@ -84,7 +84,7 @@ function saveMenu() {
} }
form1.button1.disabled=true; form1.button1.disabled=true;
form1.button2.disabled=true; form1.button2.disabled=true;
form1.operate.value="saveTree"; form1.operate.value="editTree";
form1.submit(); form1.submit();
} }
</script> </script>
@ -368,4 +368,4 @@ function selectChange(i){
form1.submit(); form1.submit();
} }
</script> </script>
<script src="../js/ajaxUtils.js"></script> <script src="/js/ajaxUtils.js"></script>

@ -9,19 +9,22 @@
String menuitemname = Common.convertNull(request.getParameter("menuitemnameQ")); String menuitemname = Common.convertNull(request.getParameter("menuitemnameQ"));
String companyid = Common.convertNull(request.getParameter("companyidQ")); String companyid = Common.convertNull(request.getParameter("companyidQ"));
String areaid=Common.convertNull(request.getParameter("areaidQ")); String areaid=Common.convertNull(request.getParameter("areaidQ"));
String disabled="";
%> %>
<html> <html>
<head> <head>
<title>菜单管理</title> <title>菜单管理</title>
<link rel="stylesheet" type="text/css" href="../css/font.css"> <link rel="stylesheet" type="text/css" href="../css/font.css">
<script src="../js/check.js"></script> <script src="/js/check.js"></script>
<script src="../js/date.js"></script> <script src="/js/date.js"></script>
<link rel="stylesheet" type="text/css" href="../js/2k3Grid.css"> <link rel="stylesheet" type="text/css" href="../js/2k3Grid.css">
<link rel="stylesheet" type="text/css" href="../js/2k3Menu.css"> <link rel="stylesheet" type="text/css" href="../js/2k3Menu.css">
<link rel="stylesheet" type="text/css" href="../js/2k3Dialog.css"> <link rel="stylesheet" type="text/css" href="../js/2k3Dialog.css">
<script> <script>
function check(operate,companyid,menuitem) { function check(operate,companyid,menuitem) {
debugger;
form1.operate.value=operate; form1.operate.value=operate;
if (operate == "add") { if (operate == "add") {
form1.action = "/manage/MenuEdit.jsp?clearsession=1"; form1.action = "/manage/MenuEdit.jsp?clearsession=1";
} }
@ -40,8 +43,9 @@ function check(operate,companyid,menuitem) {
return false; return false;
} }
} }
form1.button1.disabled=true;
form1.button2.disabled=true; // form1.button1.disabled=true;
// form1.button2.disabled=true;
form1.submit(); form1.submit();
} }
function selectChange(i){ function selectChange(i){
@ -176,7 +180,7 @@ form{
<table width="99%" align="center"> <table width="99%" align="center">
<tr align="left"> <tr align="left">
<td> <td>
<input border="0" type="image" src="../../../images1/tj.png" name="button2" alt="添加" onclick="check('add');"/> <input border="0" type="image" src="/images1/tj.png" name="button2" alt="添加" onclick="check('add');"/>
</td> </td>
</tr> </tr>
</table> </table>
@ -210,7 +214,9 @@ form{
<span><%=tempMenuitem%></span> <span><%=tempMenuitem%></span>
<span><%=buf.fget("menuitemname",i)%></span> <span><%=buf.fget("menuitemname",i)%></span>
<span> <span>
<a href="/servlet/MenuManage?operate=deleteMenu&menuitem=<%=buf.fget("menuitem",i) %>&companyid=<%=buf.fget("frameworkid",i)%>" onclick="return confirm('确定要删除此信息吗?')"><IMG border="0" src="../../../images1/delete.gif" ALT="删除" style="cursor: pointer;" ></a></span> <a href="/servlet/MenuManage?operate=getMenuTree&menuitem=<%=buf.fget("menuitem",i) %>&companyid=<%=buf.fget("frameworkid",i)%>" ><IMG border="0" src="/images1/edit.gif" ALT="修改" style="cursor: pointer;" ></a>
<a href="/servlet/MenuManage?operate=deleteMenu&menuitem=<%=buf.fget("menuitem",i) %>&companyid=<%=buf.fget("frameworkid",i)%>" onclick="return confirm('确定要删除此信息吗?')"><IMG border="0" src="/images1/delete.gif" ALT="删除" style="cursor: pointer;" ></a>
</span>
</div> </div>
<% <%
} }

@ -49,7 +49,7 @@
certname = buf.fget("certname ",pos); certname = buf.fget("certname ",pos);
certid = buf.fget("certid ",pos); certid = buf.fget("certid ",pos);
sj = buf.fget("frameworkid ",pos); sj = buf.fget("frameworkid ",pos);
birthday = Common.convertNull(buf.fget("birthday ",pos)).substring(0,9); birthday = buf.fget("birthday ",pos);
sex = buf.fget("sex ",pos); sex = buf.fget("sex ",pos);
empcontaddr = buf.fget("empcontaddr ",pos); empcontaddr = buf.fget("empcontaddr ",pos);
empcontphone = buf.fget("empcontphone ",pos); empcontphone = buf.fget("empcontphone ",pos);
@ -124,7 +124,7 @@ html { overflow-x:hidden; overflow-y:hidden; }
</tr> </tr>
</table> </table>
<table width="99%" style="height: 35" border="0" align="center" cellpadding="0" cellspacing="0"> <table width="99%" style="height: 35px" border="0" align="center" cellpadding="0" cellspacing="0">
<tr> <tr>
<td width="3%"><img src="/images/little.gif" width="12" height="12"></td> <td width="3%"><img src="/images/little.gif" width="12" height="12"></td>
<td width="97%" class="font12">基本信息</td> <td width="97%" class="font12">基本信息</td>
@ -174,16 +174,16 @@ html { overflow-x:hidden; overflow-y:hidden; }
</td> </td>
</tr> </tr>
<tr bgcolor="#FFFFFF"> <%-- <tr bgcolor="#FFFFFF">--%>
<td class="cell1" style="line-height: 30px;">UKEY名称</td> <%-- <td class="cell1" style="line-height: 30px;">UKEY名称</td>--%>
<td class="cell2"> <%-- <td class="cell2">--%>
<%=certname%> <%-- <%=certname%>--%>
</td> <%-- </td>--%>
<td class="cell1">UKEY id</td> <%-- <td class="cell1">UKEY id</td>--%>
<td class="cell2"> <%-- <td class="cell2">--%>
<%=certid%> <%-- <%=certid%>--%>
</td> <%-- </td>--%>
</tr> <%-- </tr>--%>
<tr bgcolor="#FFFFFF"> <tr bgcolor="#FFFFFF">
<td class="cell1" style="line-height: 30px;">性别</td> <td class="cell1" style="line-height: 30px;">性别</td>
@ -254,7 +254,7 @@ html { overflow-x:hidden; overflow-y:hidden; }
<td colspan="4"></td> <td colspan="4"></td>
</tr> </tr>
</table> </table>
<table width="99%" style="height: 35" border="0" align="center" cellpadding="0" cellspacing="0"> <table width="99%" style="height: 35px" border="0" align="center" cellpadding="0" cellspacing="0">
<tr> <tr>
<td width="3%"><img src="/images/little.gif" width="12" height="12"></td> <td width="3%"><img src="/images/little.gif" width="12" height="12"></td>
<td width="97%" class="font12">详细信息</td> <td width="97%" class="font12">详细信息</td>

Loading…
Cancel
Save