use of com.netsteadfast.greenstep.po.hbm.TbUserRole in project bamboobsc by billchen198318.
the class ReportRoleViewLogicServiceImpl method findForEmployeeMap.
@ServiceMethodAuthority(type = { ServiceMethodType.SELECT })
@Override
public Map<String, String> findForEmployeeMap(boolean pleaseSelect, String accountId) throws ServiceException, Exception {
if (super.isBlank(accountId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
Map<String, String> dataMap = new LinkedHashMap<String, String>();
if (pleaseSelect) {
dataMap.put(Constants.HTML_SELECT_NO_SELECT_ID, Constants.HTML_SELECT_NO_SELECT_NAME);
}
List<TbUserRole> roles = this.getUserRoles(accountId);
for (int i = 0; roles != null && i < roles.size(); i++) {
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("role", roles.get(i).getRole());
paramMap.put("type", ReportRoleViewTypes.IS_EMPLOYEE);
List<BbReportRoleView> views = this.reportRoleViewService.findListByParams(paramMap);
for (int j = 0; views != null && j < views.size(); j++) {
paramMap.clear();
paramMap.put("account", views.get(j).getIdName());
List<BbEmployee> employees = this.getEmployeeService().findListByParams(paramMap);
for (int e = 0; employees != null && e < employees.size(); e++) {
BbEmployee employee = employees.get(e);
if (dataMap.get(employee.getOid()) != null) {
continue;
}
dataMap.put(employee.getOid(), employee.getFullName());
}
}
}
return dataMap;
}
Aggregations