use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class BscBaseLogicServiceCommonSupport method findEmployeeDataByAccountId.
public static EmployeeVO findEmployeeDataByAccountId(IEmployeeService<EmployeeVO, BbEmployee, String> service, String accountId) throws ServiceException, Exception {
if (StringUtils.isBlank(accountId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
BbEmployee poEmployee = service.findByAccountId(accountId);
EmployeeVO employeeObj = new EmployeeVO();
service.doMapper(poEmployee, employeeObj, IEmployeeService.MAPPER_ID_PO2VO);
return employeeObj;
}
use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class BscBaseLogicServiceCommonSupport method findEmployeeDataByUK.
public static EmployeeVO findEmployeeDataByUK(IEmployeeService<EmployeeVO, BbEmployee, String> service, String accountId, String empId) throws ServiceException, Exception {
if (StringUtils.isBlank(accountId) || StringUtils.isBlank(empId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
EmployeeVO employee = new EmployeeVO();
employee.setAccount(accountId);
employee.setEmpId(empId);
DefaultResult<EmployeeVO> empResult = service.findByUK(employee);
if (empResult.getValue() == null) {
throw new ServiceException(empResult.getSystemMessage().getValue());
}
employee = empResult.getValue();
return employee;
}
use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class PersonalReportBodyCommand method execute.
@Override
public boolean execute(Context context) throws Exception {
if (this.getResult(context) == null || !(this.getResult(context) instanceof BscStructTreeObj)) {
return false;
}
String dateType = (String) context.get("dateType");
String empId = (String) context.get("empId");
String account = (String) context.get("account");
BscStructTreeObj treeObj = (BscStructTreeObj) this.getResult(context);
Map<String, Object> parameter = new HashMap<String, Object>();
parameter.put("treeObj", treeObj);
parameter.put("dateType", dateType);
parameter.put("year", (String) context.get("startYearDate"));
parameter.put("fullName", " ");
parameter.put("jobTitle", " ");
parameter.put("departmentName", " ");
parameter.put("employeeOid", " ");
parameter.put("total", 0.0f);
if (context.get("total") != null && context.get("total") instanceof Float) {
parameter.put("total", context.get("total"));
}
EmployeeVO employee = new EmployeeVO();
employee.setEmpId(empId);
employee.setAccount(account);
DefaultResult<EmployeeVO> result = this.employeeService.findByUK(employee);
if (result.getValue() != null) {
parameter.put("fullName", result.getValue().getEmpId() + " - " + result.getValue().getFullName());
parameter.put("jobTitle", result.getValue().getJobTitle());
parameter.put("employeeOid", result.getValue().getOid());
List<String> appendIds = this.organizationService.findForAppendOrganizationOids(result.getValue().getEmpId());
List<String> appendNames = this.organizationService.findForAppendNames(appendIds);
StringBuilder sb = new StringBuilder();
for (int i = 0; appendNames != null && i < appendNames.size(); i++) {
sb.append(appendNames.get(i)).append(Constants.ID_DELIMITER);
}
parameter.put("departmentName", sb.toString());
}
this.fillReportProperty(parameter);
String content = TemplateUtils.processTemplate("resourceTemplate", PersonalReportBodyCommand.class.getClassLoader(), templateResource, parameter);
this.setResult(context, content);
return false;
}
use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class EmployeeLogicServiceImpl method getChild.
private void getChild(String supOid, List<EmployeeVO> tree, List<EmployeeVO> put) throws Exception {
if (put == null || tree == null) {
return;
}
if (StringUtils.isBlank(supOid) || BscConstants.EMPLOYEE_HIER_ZERO_OID.equals(supOid)) {
return;
}
for (EmployeeVO emp : tree) {
if (emp.getSupOid().equals(supOid)) {
put.add(emp);
this.getChild(emp.getOid(), tree, put);
}
}
}
use of com.netsteadfast.greenstep.vo.EmployeeVO in project bamboobsc by billchen198318.
the class EmployeeLogicServiceImpl method getTreeData.
private void getTreeData(String basePath, Map<String, Object> putObject, List<EmployeeVO> searchList, String supOid) throws Exception {
List<String> childList = new LinkedList<String>();
this.getChildEmpLevelOne(searchList, supOid, childList);
if (childList.size() < 1) {
return;
}
for (String childEmpOid : childList) {
EmployeeVO emp = this.getEmployeeFromSearchList(searchList, childEmpOid, false);
EmployeeVO childEmp = this.getEmployeeFromSearchList(searchList, childEmpOid, true);
if (emp == null) {
continue;
}
Map<String, Object> thePutObject = null;
@SuppressWarnings("unchecked") List<Map<String, Object>> childrenList = (List<Map<String, Object>>) putObject.get("children");
if (childrenList == null) {
childrenList = new LinkedList<Map<String, Object>>();
}
Map<String, Object> nodeMap = new LinkedHashMap<String, Object>();
nodeMap.put("id", emp.getOid());
nodeMap.put("name", IconUtils.getMenuIcon(basePath, TREE_ICON_ID) + StringEscapeUtils.escapeHtml4(this.getTreeShowName(emp)));
nodeMap.put("oid", emp.getOid());
childrenList.add(nodeMap);
putObject.put("children", childrenList);
if (childEmp != null) {
thePutObject = nodeMap;
} else {
nodeMap.put("type", "Leaf");
thePutObject = putObject;
}
if (childEmp != null) {
this.getTreeData(basePath, thePutObject, searchList, childEmpOid);
}
}
}
Aggregations