<%@page import="weaver.conn.RecordSet"%>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<%@ page import="weaver.conn.RecordSetDataSource" %>
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
<%@ page language="java" contentType="text/html; charset=UTF-8" %>

<%

    String dataResource = "E7TEST";
    List<String> E9ResourceList = getE9ResourceList();
    List<String> E7ResourceList = getE7HrmResourceList(dataResource);
    out.println("E9ResourceList:"+E9ResourceList.size()+"</br>");
    out.println("E7ResourceList:"+E7ResourceList.size()+"</br>");

    String E7IDS = "";
    out.println("E7比E9多的:</br>");
    for(String e7id : E7ResourceList){
        if(!E9ResourceList.contains(e7id)){
            E7IDS += StringUtils.isBlank(E7IDS) ? e7id : ","+e7id ;
        }
    }
    out.println(E7IDS+"</br>");

    out.println("E9比E7多的:</br>");
    String E9IDS = "";
    for(String e9id : E9ResourceList){
        if(!E7ResourceList.contains(e9id)){
            E9IDS += StringUtils.isBlank(E9IDS) ? e9id : ","+ e9id ;
        }
    }
    out.println(E9IDS.length()+"</br>");
    out.println(E9IDS+"</br>");

%>


<%!

    public  List<String> getE9ResourceList(){

        RecordSet rs = new RecordSet();
        List<String> E9ResourceList = new ArrayList<String>();
        String sql = " select outkey from hrmresource " ;
        rs.executeQuery(sql);
        while (rs.next()){
            String outkey = Util.null2String(rs.getString("outkey"));
            E9ResourceList.add(outkey);
        }
        return E9ResourceList;
    }


    public List<String> getE7HrmResourceList(String dataResource){

        RecordSetDataSource rsd = new RecordSetDataSource(dataResource);
        List<String> E7ResourceList = new ArrayList<String>();
        String sql = " select id from hrmresource " ;
        rsd.execute(sql);
        while (rsd.next()){
            String id = Util.null2String(rsd.getString("id"));
            E7ResourceList.add(id);
        }
        return E7ResourceList;
    }




%>



