/** 检查用户权限的id是否存在,存在返回yes,否则返回no */ @Test public void testCheckIdByUserCodeComCode() { String result = staffingService.checkIdByUserCodeComCode("admin", "00"); Assert.assertEquals("yes", result); String result2 = staffingService.checkIdByUserCodeComCode("admin", "08"); Assert.assertEquals("no", result2); }
/** 查询用户权限 */ @Test public void testFindUserPowerByUserCode() { List<UserPower> userPosers = staffingService.findUserPowerByUserCode("admin"); for (UserPower up : userPosers) { System.out.println(up.getUserPowerID() + "," + up.getComCode()); } }
/** 查询数据规则的参数 */ @Test public void testGetParams() { List<BusPower> busPower = staffingService.getParams("00", "admin", "queryRuleAccordCompany"); if (busPower.size() > 0) { Assert.assertEquals("queryRuleAccordCompany", busPower.get(0).getDataRule().getDataRuleID()); } }
/** 查询出有参数的数据规则 */ @Test public void testGetRuleParam() { List<DataRule> dataRules = staffingService.getRuleParam("00", "admin"); for (DataRule dr : dataRules) { System.out.println(dr.getDataRuleID()); } }
/** 查询用户权限 */ @Test public void testFindDataRuleByDataRuleId() { DataRule dr = staffingService.findDataRuleByDataRuleId("queryRuleAccordCompany"); Assert.assertEquals("queryRuleAccordCompany", dr.getDataRuleID()); }
/** 保存数据设置 */ @Test public void testSaveBusPower() { staffingService.saveBusPower("07", "user10", "rule100001", "{comCode:'07'}"); }
/** 保存用户的权限除外表、用户权限表和用户与组关系表 */ @Test public void testSavePower() { staffingService.savePower("07", "user10", "group10110", "RMS001"); }