Search in sources :

Example 26 with EmployeeVO

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;
}
Also used : BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 27 with EmployeeVO

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;
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 28 with EmployeeVO

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;
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) HashMap(java.util.HashMap) BscStructTreeObj(com.netsteadfast.greenstep.bsc.model.BscStructTreeObj)

Example 29 with EmployeeVO

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);
        }
    }
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO)

Example 30 with EmployeeVO

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);
        }
    }
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) List(java.util.List) LinkedList(java.util.LinkedList) Map(java.util.Map) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) LinkedList(java.util.LinkedList) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)48 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)21 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)15 HashMap (java.util.HashMap)13 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)7 LinkedHashMap (java.util.LinkedHashMap)5 Transactional (org.springframework.transaction.annotation.Transactional)5 Map (java.util.Map)4 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)3 AccountVO (com.netsteadfast.greenstep.vo.AccountVO)3 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)3 List (java.util.List)3 Context (org.apache.commons.chain.Context)3 ContextBase (org.apache.commons.chain.impl.ContextBase)3 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)2 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)2 BbOrganization (com.netsteadfast.greenstep.po.hbm.BbOrganization)2 BbPdcaDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaDoc)2 BbPdcaItem (com.netsteadfast.greenstep.po.hbm.BbPdcaItem)2 BbPdcaItemDoc (com.netsteadfast.greenstep.po.hbm.BbPdcaItemDoc)2