<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.database.SzPageInfo" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.organize.*" %>

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
<SCRIPT src="../share/js/ftiens4_tree.js"></SCRIPT>
</head>

<body>
<table width=100% border="0" cellpadding=0 cellspacing=0>
  <tr>
    <td align="center" width="33">
    <td width="751" colspan="2" align="center"><p align="left">
      <!--名字，连接，定位的页面，图片---->
      <SCRIPT>
        USETEXTLINKS = 1
        level_0 = gFld("<b>组织结构</b>", "","","images/skin1/menu/asset.gif")
<%
    //读取数据
    SzDepart szDepart = new SzDepart();
    SzDepartInfo departInfo = null;
    String sCond = "1=1";
    Iterator iter = szDepart.getArrayList(sCond).iterator();
    int i = 0;
    int j = 0;
    SzUserPost szUserPost = new SzUserPost();
    SzUserPostInfo szUserPostInfo = null;
    Iterator iterUserPost = null;

    //获取员工，部门，职务的hashMap
    SzLogin szLogin = new SzLogin();
    HashMap mapLogin = szLogin.getMainHashMap("1=1");
    HashMap mapDepart = szDepart.getMainHashMap("1=1");
    SzPost szPost = new SzPost();
    HashMap mapPost = szPost.getMainHashMap("1=1");
    String sUserInfo = "";
%>
<%
    while (iter != null && iter.hasNext()) {
        departInfo = (SzDepartInfo)iter.next();
        i++;
%>
        level_000<%=i%> = insFld(level_0, gFld("<%=departInfo.getBMMC()%>", "","","images/skin1/menu/asset.gif"))
<%
        //取得部门下的员工
        iterUserPost = szUserPost.getArrayList("RZBM=" + departInfo.getBMID()).iterator();
        while (iterUserPost != null && iterUserPost.hasNext()) {
            szUserPostInfo = (SzUserPostInfo)iterUserPost.next();
            //获取姓名、职务名称
            sUserInfo = mapLogin.get(new Integer(szUserPostInfo.getRZDL()))
                      + "[" + mapPost.get(new Integer(szUserPostInfo.getRZZW())) + "]";
%>
        level_000<%=i%>000<%=j%> = insFld(level_000<%=i%>, gFld("<%=sUserInfo%>", "","","images/skin1/menu/asset.gif"))
<%
        }
    }
%>
      </SCRIPT>
<SCRIPT>
    initializeDocument();
</SCRIPT>
    </td>
  </tr>
</table>
</body>

