position_update.jsp

来自「非常完整的Java开发的网络办公系统」· JSP 代码 · 共 70 行

JSP
70
字号
<%@ page errorPage="/vnex/ErrorPage.jsp" %>
<%@ page import="com.vnex.intranet.organization.value.*"%>
<%@ page import="com.vnex.intranet.organization.proxy.*"%>
<jsp:useBean id="positionProxyBean" scope="Application" class="com.vnex.intranet.organization.proxy.PositionProxyBean" />
<jsp:useBean id="duvalue" scope="request" class="com.vnex.intranet.organization.value.DutyValueBean" />
<jsp:useBean id="idList" scope="page" class="com.vnex.intranet.pub.IdList" />


<jsp:setProperty name="duvalue" property="dutyId" />
<jsp:setProperty name="duvalue" property="dutyTitle" />
<jsp:setProperty name="duvalue" property="description" />
<jsp:setProperty name="duvalue" property="demandSkill" />
<jsp:setProperty name="duvalue" property="checkStandard" />
<jsp:setProperty name="duvalue" property="divisionId" />
<jsp:setProperty name="idList" property="ids" />
<%

String divisionName = request.getParameter("divisionName");
positionProxyBean.modifyDuty(duvalue);

	int did = duvalue.getDutyId();

	ArrayList array = (ArrayList)positionProxyBean.getPrivilegesByDuty(did);
	ArrayList current = null;
	int[] ids =idList.getIds();
	if (ids !=null)
	{
		current = new ArrayList();
		for(int i=0;i<ids.length;i++)
		{
			PrivilegeValueBean pinfo = new PrivilegeValueBean();
			pinfo.setPrivilegeId(ids[i]);
			current.add(pinfo);
		}
	}	
	
	if (array !=null && current !=null)
	{
	
		
		ArrayList middle = new ArrayList();
		middle.addAll(current);
		current.removeAll(array);
		array.removeAll(middle);
	}

	if (current!=null)
	{
	
		int[] idsnew = new int[current.size()];	
		for(int i=0;i<current.size();i++)
		{
			idsnew[i] = ((PrivilegeValueBean)current.get(i)).getPrivilegeId();
		}
		positionProxyBean.addPrivilege(idsnew,1,did);
	}
	if (array!=null)
	{
	
		int[] idsremove = new int[array.size()];
		for(int j=0;j<array.size();j++)
		{
			idsremove[j] = ((PrivilegeValueBean)array.get(j)).getPrivilegeId();	
		}
		positionProxyBean.removePrivileges(idsremove,did);
	}

	String link="/mainctrl/organization/getAllPosition?id=" + duvalue.getDivisionId() + "&name=" + divisionName; 
%>
	<jsp:forward page="<%=link%>" /> 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?