|
@@ -34,116 +34,11 @@ public class RoleAuthInfoService extends BaseService<RoleAuthInfo, String> imple
|
|
|
|
|
|
@Autowired
|
|
|
private RoleAuthInfoBPO roleAuthInfoBPO;
|
|
|
-// @Autowired
|
|
|
-// private IStaffAssignAuthInfoService staffAssignAuthInfoService;
|
|
|
-// @Autowired
|
|
|
-// private IStaffAssignAuthLogService staffAssignAuthLogService;
|
|
|
-// @Autowired
|
|
|
-// private IRoleInfoService roleInfoService;
|
|
|
-// @Autowired
|
|
|
-// private IOrgQuotaAuthService iOrgQuotaAuthService;
|
|
|
|
|
|
@Autowired
|
|
|
private IAuthOrgInfoService authOrgInfoService;
|
|
|
|
|
|
|
|
|
-// public boolean isStaffPass(String appId, String staffId, String orgId, Searchable searchable, String[] roleList, Long roleListSize) {
|
|
|
-// boolean pass = false;
|
|
|
-//
|
|
|
-// for (String roleId : roleList) {
|
|
|
-// List<String> roleSize = new ArrayList<String>();
|
|
|
-// roleSize.add(roleId);
|
|
|
-// Searchable searchableNew = Searchable.newSearchable().addSearchFilter(SearchFilterHelper.newCondition("id", SearchOperator.eq, roleId)).setPage(1, 1);
|
|
|
-// Page<RoleInfoVO> page = roleInfoService.getOrgRoleQuotaList(appId, orgId, searchableNew);
|
|
|
-// long initQuotaSold = page.getContent().get(0).getTotalQuotas() - page.getContent().get(0).getQuotaed();
|
|
|
-// if (roleSize.size() > initQuotaSold) {
|
|
|
-//
|
|
|
-// return true;
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// //删除已保存角色记录
|
|
|
-// roleAuthInfoBPO.deleteOldRole(appId, staffId, orgId);
|
|
|
-// return pass;
|
|
|
-// }
|
|
|
-//
|
|
|
-// private void updateOrgQuotaAuthInfoRoleNoLimitCount(String appId, String roleId, String orgId, int staffSize, int delTotal, List<String> parentList) {
|
|
|
-// int difNum = staffSize - delTotal;
|
|
|
-// OrgQuotaAuthInfo orgQuotoAuthInfo = iOrgQuotaAuthService.getOrgQuotaAuthInfo(appId, roleId, orgId);
|
|
|
-// SecurityUser userInfo = UserContextUtils.getCurrentUser();
|
|
|
-// if (orgQuotoAuthInfo == null) {
|
|
|
-// orgQuotoAuthInfo = iOrgQuotaAuthService.setOrgQuotaAuthInfo(appId, roleId, orgId, staffSize, 0, 0, "20", userInfo.getUserName(), userInfo.getDeptId());
|
|
|
-// } else {
|
|
|
-//
|
|
|
-// if (staffSize == 0) {
|
|
|
-// orgQuotoAuthInfo.setBjNum(0);
|
|
|
-// } else {
|
|
|
-// orgQuotoAuthInfo.setBjNum(staffSize);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// iOrgQuotaAuthService.saveOrUpdate(orgQuotoAuthInfo);
|
|
|
-//
|
|
|
-// for (String parentId : parentList) {
|
|
|
-// OrgQuotaAuthInfo parentOrgQuotoAuthInfo = iOrgQuotaAuthService.getOrgQuotaAuthInfo(appId, roleId, parentId);
|
|
|
-// if (parentOrgQuotoAuthInfo == null) {
|
|
|
-// parentOrgQuotoAuthInfo = iOrgQuotaAuthService.setOrgQuotaAuthInfo(appId, roleId, parentId, 0, staffSize, 0, "20", userInfo.getUserName(), userInfo.getDeptId());
|
|
|
-// } else {
|
|
|
-// parentOrgQuotoAuthInfo.setYxfNum(parentOrgQuotoAuthInfo.getYxfNum() + difNum);
|
|
|
-// }
|
|
|
-// iOrgQuotaAuthService.saveOrUpdate(parentOrgQuotoAuthInfo);
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// public void saveStaff(String[] roleList, String staffId, String appId, String orgId, Long roleListSize, Searchable searchable) throws Exception {
|
|
|
-// SecurityUser currentUser = UserContextUtils.getCurrentUser();//当前登录账号
|
|
|
-// String managerId = currentUser.getUserName();
|
|
|
-// StringBuffer errorMsg = new StringBuffer();
|
|
|
-// int roleSize = roleList.length;
|
|
|
-//
|
|
|
-// if (this.isStaffPass(appId, staffId, orgId, searchable, roleList, roleListSize)) {
|
|
|
-// throw new Exception("超出待分配数额");
|
|
|
-// } else {
|
|
|
-// //删除已保存角色记录
|
|
|
-// roleAuthInfoBPO.deleteOldRole(appId, staffId, orgId);
|
|
|
-//
|
|
|
-// //重新保存角色记录
|
|
|
-// if (roleList.length > 0) {
|
|
|
-// for (String roleId : roleList) {
|
|
|
-//
|
|
|
-// if (roleAuthInfoBPO.isStaffQuota(appId, orgId, roleId) <= 0) {
|
|
|
-// throw new Exception("该机构未分配名额");
|
|
|
-// }
|
|
|
-//
|
|
|
-// StaffAssignAuthInfo staffAssignAuthInfo = new StaffAssignAuthInfo();
|
|
|
-// StaffAssignAuthLog staffAssignAuthLog = new StaffAssignAuthLog();
|
|
|
-// staffAssignAuthInfo.setAppId(appId);
|
|
|
-// staffAssignAuthInfo.setRoleId(roleId);
|
|
|
-// staffAssignAuthInfo.setStaffOrgId(orgId);
|
|
|
-// staffAssignAuthInfo.setStaffId(staffId);
|
|
|
-// staffAssignAuthInfo.setManagerId(managerId);
|
|
|
-// staffAssignAuthInfo.setMgeOrgId(currentUser.getDeptId()); // 之后取appOrgId
|
|
|
-// staffAssignAuthInfo.setCreateTime(new Date());
|
|
|
-// staffAssignAuthInfoService.save(staffAssignAuthInfo);
|
|
|
-//
|
|
|
-// //保存T_STAFF_ASSIGN_AUTH_INFO表
|
|
|
-// staffAssignAuthLog.setAppId(appId);
|
|
|
-// staffAssignAuthLog.setRoleId(roleId);
|
|
|
-// staffAssignAuthLog.setStaffId(staffId);
|
|
|
-// staffAssignAuthLog.setCreateTime(new Date());
|
|
|
-// staffAssignAuthLog.setStaffOrgId(orgId);
|
|
|
-// staffAssignAuthLog.setManagerId(managerId);
|
|
|
-// staffAssignAuthLog.setAppOrgId(currentUser.getDeptId()); // 之后取appOrgId
|
|
|
-// staffAssignAuthLogService.save(staffAssignAuthLog);
|
|
|
-//
|
|
|
-// //更新角色总额表
|
|
|
-// roleAuthInfoBPO.updateOrgQuotaAuthInfoStaff(appId, roleId, orgId);
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-
|
|
|
@Override
|
|
|
public List<StaffAssignAuthInfo> getStaff(String roleId, String orgId) {
|
|
|
return roleAuthInfoBPO.getStaff(roleId, orgId);
|
|
@@ -155,8 +50,9 @@ public class RoleAuthInfoService extends BaseService<RoleAuthInfo, String> imple
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Page<TreeInfoVO> getRptList(String appId, String orgId, Searchable searchable) {
|
|
|
- return roleAuthInfoBPO.getRptList(appId, orgId, searchable);
|
|
|
+ public Page<TreeInfoVO> getRptList(String appId, String orgCode, Searchable searchable) {
|
|
|
+ AuthOrgInfo orgInfo = authOrgInfoService.getByOrgCode(orgCode);
|
|
|
+ return roleAuthInfoBPO.getRptList(appId, orgInfo.getId(), searchable);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -172,8 +68,9 @@ public class RoleAuthInfoService extends BaseService<RoleAuthInfo, String> imple
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public Map<String, Object> getRoleTjInfo(String appId, String orgId) {
|
|
|
- return roleAuthInfoBPO.getRoleTjInfo(appId, orgId);
|
|
|
+ public Map<String, Object> getRoleTjInfo(String appId, String orgCode) {
|
|
|
+ AuthOrgInfo authOrgInfo = authOrgInfoService.getByOrgCode(orgCode);
|
|
|
+ return roleAuthInfoBPO.getRoleTjInfo(appId, authOrgInfo.getId());
|
|
|
}
|
|
|
|
|
|
@Override
|