public void testMaxAssessAuthority() {
    List<AssessDeptPrincipal> prin = new ArrayList<AssessDeptPrincipal>();
    AssessDeptPrincipal p = new AssessDeptPrincipal();
    p.setDeptId("463");
    p.setDeptName("浙江事业部");
    p.setPrincipal("003998");
    prin.add(p);

    Set<String> auths = new HashSet<String>();
    auths.add("2005"); // 是否具有全国权限
    MarketAssessUtils.maxAssessAuthority(prin, auths);
    auths.clear();
    auths.add("2004"); // 是否具有经营本部权限
    MarketAssessUtils.maxAssessAuthority(prin, auths);
    auths.clear();
    auths.add("2003"); // 是否具有事业部权限
    MarketAssessUtils.maxAssessAuthority(prin, auths);
    auths.clear();
    auths.add("2002"); // 是否具有大区权限
    MarketAssessUtils.maxAssessAuthority(prin, auths);
    auths.clear();
    auths.add("2001"); // 是否具有营业区权限
    MarketAssessUtils.maxAssessAuthority(null, auths);
    auths.clear();
    MarketAssessUtils.maxAssessAuthority(null, auths);
  }
  public void testAssessAuthority() {
    List<AssessDeptPrincipal> prin = new ArrayList<AssessDeptPrincipal>();
    AssessDeptPrincipal p = new AssessDeptPrincipal();
    p.setDeptId("463");
    p.setDeptName("浙江事业部");
    p.setPrincipal("003998");
    prin.add(p);

    Set<String> auths = new HashSet<String>();
    List<AssessDept> depts = new ArrayList<AssessDept>();
    auths.add("2005");
    AssessDept dept = new AssessDept();
    dept.setId("106139");
    dept.setDeptName("钟琼");
    dept.setHierarchy("C");
    depts.add(dept);
    MarketAssessUtils.assessAuthority(null, auths, depts);
    MarketAssessUtils.assessAuthority(prin, auths, depts);
    AssessDept dept1 = new AssessDept();
    dept1.setId("106139");
    dept1.setDeptName("经营本部");
    depts.add(dept1);
    MarketAssessUtils.assessAuthority(prin, auths, depts);
    AssessDept dept2 = new AssessDept();
    dept2.setId("106139");
    dept2.setDeptName("事业部");
    AssessDept dept3 = new AssessDept();
    dept3.setId("106139");
    dept3.setDeptName("大区");
    dept3.setHierarchy("2005");
    depts.add(dept3);
    dept2.setChildDept(dept3);
    depts.add(dept2);
    MarketAssessUtils.assessAuthority(prin, auths, depts);
  }
 public void testCloneDept() {
   AssessDept dept = new AssessDept();
   dept.setId("106139");
   dept.setDeptName("钟琼");
   String hierarchy = "106139";
   MarketAssessUtils.cloneDept(dept, hierarchy);
 }
 public void testGetAssessDeptByDeptName() {
   List<AssessDept> depts = new ArrayList<AssessDept>();
   String deptName = "钟琼";
   MarketAssessUtils.getAssessDeptByDeptName(depts, deptName);
   AssessDept dept = new AssessDept();
   dept.setId("106139");
   dept.setDeptName("钟琼");
   depts.add(dept);
   MarketAssessUtils.getAssessDeptByDeptName(depts, deptName);
   deptName = "欢欢";
   MarketAssessUtils.getAssessDeptByDeptName(depts, deptName);
   AssessDept dept1 = null;
   depts.clear();
   depts.add(dept1);
   MarketAssessUtils.getAssessDeptByDeptName(depts, deptName);
 }
 public void testAssessAuthorityBuildDept1() {
   Set<String> auths = new HashSet<String>();
   auths.add("2005");
   List<AssessDept> depts = new ArrayList<AssessDept>();
   AssessDept dept = new AssessDept();
   dept.setId("106139");
   dept.setDeptName("2121");
   depts.add(dept);
   MarketAssessUtils.assessAuthorityBuildDept(null, auths, depts);
 }
  public void testAssessAuthorityBuildDept3() {
    List<AssessDeptPrincipal> prin = new ArrayList<AssessDeptPrincipal>();
    AssessDeptPrincipal p = new AssessDeptPrincipal();
    p.setDeptId("463");
    p.setDeptName("浙江事业部");
    p.setPrincipal("003998");
    prin.add(p);

    Set<String> auths = new HashSet<String>();
    auths.add("2005");
    List<AssessDept> depts = new ArrayList<AssessDept>();
    AssessDept dept = new AssessDept();
    dept.setId("106139");
    dept.setDeptName("经营本部");
    depts.add(dept);
    MarketAssessUtils.assessAuthorityBuildDept(prin, auths, depts);
  }
 public void testGetDeptHier() {
   String authId = "2005"; // 全国权限
   MarketAssessUtils.getDeptHier(authId);
   authId = "2004"; // 经营本部权限
   MarketAssessUtils.getDeptHier(authId);
   authId = "2003"; // 事业部权限
   MarketAssessUtils.getDeptHier(authId);
   authId = "2002"; // 大区权限
   MarketAssessUtils.getDeptHier(authId);
   authId = "2001"; // 营业区权限
   MarketAssessUtils.getDeptHier(authId);
   authId = "2000"; // 营业区权限
   MarketAssessUtils.getDeptHier(authId);
 }
 public void testGetCreateDate() {
   MarketAssessUtils.getCreateDate();
 }