Search in sources :

Example 16 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.

the class BscReportSupportUtils method fillKpiOrganizations.

/**
	 * 為KPI報表顯示要用的 , 取出KPI所屬的部門/組織
	 * 
	 * @param kpi
	 * @throws ServiceException
	 * @throws Exception
	 */
public static void fillKpiOrganizations(KpiVO kpi) throws ServiceException, Exception {
    List<String> appendOrgaOids = organizationService.findForAppendOrganizationOidsByKpiOrga(kpi.getId());
    for (int i = 0; appendOrgaOids != null && i < appendOrgaOids.size(); i++) {
        OrganizationVO organization = new OrganizationVO();
        organization.setOid(appendOrgaOids.get(i));
        DefaultResult<OrganizationVO> result = organizationService.findObjectByOid(organization);
        if (result.getValue() != null) {
            organization = result.getValue();
            kpi.getOrganizations().add(organization);
        }
    }
}
Also used : OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 17 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.

the class KpiReportExcelCommand method fillHeadContent.

private void fillHeadContent(Context context, Map<String, Object> parameter) throws ServiceException, Exception {
    String headContent = "";
    String orgId = (String) context.get("orgId");
    String empId = (String) context.get("empId");
    String account = (String) context.get("account");
    if (!BscConstants.MEASURE_DATA_ORGANIZATION_FULL.equals(orgId) && !StringUtils.isBlank(orgId)) {
        OrganizationVO organization = new OrganizationVO();
        organization.setOrgId(orgId);
        DefaultResult<OrganizationVO> result = this.organizationService.findByUK(organization);
        if (result.getValue() != null) {
            organization = result.getValue();
            headContent += "\nMeasure data for: " + organization.getOrgId() + " - " + organization.getName();
        }
    }
    if (!BscConstants.MEASURE_DATA_EMPLOYEE_FULL.equals(empId) && !StringUtils.isBlank(empId) && !StringUtils.isBlank(account)) {
        EmployeeVO employee = new EmployeeVO();
        employee.setEmpId(empId);
        employee.setAccount(account);
        DefaultResult<EmployeeVO> result = this.employeeService.findByUK(employee);
        if (result.getValue() != null) {
            employee = result.getValue();
            headContent += "\nMeasure data for: " + employee.getEmpId() + " - " + employee.getFullName();
            if (!StringUtils.isBlank(employee.getJobTitle())) {
                headContent += " ( " + employee.getJobTitle() + " ) ";
            }
        }
    }
    parameter.put("headContent", headContent);
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 18 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.

the class KpiReportPdfCommand method fillHeadContent.

private void fillHeadContent(Context context, Map<String, Object> parameter) throws ServiceException, Exception {
    String headContent = "";
    String orgId = (String) context.get("orgId");
    String empId = (String) context.get("empId");
    String account = (String) context.get("account");
    if (!BscConstants.MEASURE_DATA_ORGANIZATION_FULL.equals(orgId) && !StringUtils.isBlank(orgId)) {
        OrganizationVO organization = new OrganizationVO();
        organization.setOrgId(orgId);
        DefaultResult<OrganizationVO> result = this.organizationService.findByUK(organization);
        if (result.getValue() != null) {
            organization = result.getValue();
            headContent += "\nMeasure data for: " + organization.getOrgId() + " - " + organization.getName();
        }
    }
    if (!BscConstants.MEASURE_DATA_EMPLOYEE_FULL.equals(empId) && !StringUtils.isBlank(empId) && !StringUtils.isBlank(account)) {
        EmployeeVO employee = new EmployeeVO();
        employee.setEmpId(empId);
        employee.setAccount(account);
        DefaultResult<EmployeeVO> result = this.employeeService.findByUK(employee);
        if (result.getValue() != null) {
            employee = result.getValue();
            headContent += "\nMeasure data for: " + employee.getEmpId() + " - " + employee.getFullName();
            if (!StringUtils.isBlank(employee.getJobTitle())) {
                headContent += " ( " + employee.getJobTitle() + " ) ";
            }
        }
    }
    parameter.put("headContent", headContent);
}
Also used : EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Example 19 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.

the class LoadPdcaDataCommand method execute.

@SuppressWarnings("unchecked")
@Override
public boolean execute(Context context) throws Exception {
    pdcaService = (IPdcaService<PdcaVO, BbPdca, String>) AppContext.getBean("bsc.service.PdcaService");
    pdcaDocService = (IPdcaDocService<PdcaDocVO, BbPdcaDoc, String>) AppContext.getBean("bsc.service.PdcaDocService");
    pdcaItemService = (IPdcaItemService<PdcaItemVO, BbPdcaItem, String>) AppContext.getBean("bsc.service.PdcaItemService");
    pdcaItemDocService = (IPdcaItemDocService<PdcaItemDocVO, BbPdcaItemDoc, String>) AppContext.getBean("bsc.service.PdcaItemDocService");
    pdcaAuditService = (IPdcaAuditService<PdcaAuditVO, BbPdcaAudit, String>) AppContext.getBean("bsc.service.PdcaAuditService");
    employeeService = (IEmployeeService<EmployeeVO, BbEmployee, String>) AppContext.getBean("bsc.service.EmployeeService");
    organizationService = (IOrganizationService<OrganizationVO, BbOrganization, String>) AppContext.getBean("bsc.service.OrganizationService");
    kpiService = (IKpiService<KpiVO, BbKpi, String>) AppContext.getBean("bsc.service.KpiService");
    String pdcaOid = (String) context.get("pdcaOid");
    PdcaVO pdca = new PdcaVO();
    pdca.setOid(pdcaOid);
    DefaultResult<PdcaVO> result = pdcaService.findObjectByOid(pdca);
    if (result.getValue() == null) {
        this.setMessage(context, result.getSystemMessage().getValue());
    } else {
        pdca = result.getValue();
        this.loadDetail(pdca);
        this.loadPdcaItems(pdca);
        this.loadAudit(pdca);
        this.setResult(context, pdca);
        // Action 輸出可能會要用到
        context.put("pdca", pdca);
    }
    return false;
}
Also used : PdcaItemDocVO(com.netsteadfast.greenstep.vo.PdcaItemDocVO) PdcaDocVO(com.netsteadfast.greenstep.vo.PdcaDocVO) BbPdcaItemDoc(com.netsteadfast.greenstep.po.hbm.BbPdcaItemDoc) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) BbPdcaDoc(com.netsteadfast.greenstep.po.hbm.BbPdcaDoc) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) BbKpi(com.netsteadfast.greenstep.po.hbm.BbKpi) BbPdcaAudit(com.netsteadfast.greenstep.po.hbm.BbPdcaAudit) BbEmployee(com.netsteadfast.greenstep.po.hbm.BbEmployee) EmployeeVO(com.netsteadfast.greenstep.vo.EmployeeVO) BbOrganization(com.netsteadfast.greenstep.po.hbm.BbOrganization) PdcaVO(com.netsteadfast.greenstep.vo.PdcaVO) BbPdca(com.netsteadfast.greenstep.po.hbm.BbPdca) PdcaItemVO(com.netsteadfast.greenstep.vo.PdcaItemVO) BbPdcaItem(com.netsteadfast.greenstep.po.hbm.BbPdcaItem) PdcaAuditVO(com.netsteadfast.greenstep.vo.PdcaAuditVO)

Example 20 with OrganizationVO

use of com.netsteadfast.greenstep.vo.OrganizationVO in project bamboobsc by billchen198318.

the class OrganizationReportBodyCommand 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 orgId = (String) context.get("orgId");
    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("departmentName", " ");
    parameter.put("departmentOid", " ");
    parameter.put("total", 0.0f);
    if (context.get("total") != null && context.get("total") instanceof Float) {
        parameter.put("total", context.get("total"));
    }
    OrganizationVO organization = new OrganizationVO();
    organization.setOrgId(orgId);
    DefaultResult<OrganizationVO> result = this.organizationService.findByUK(organization);
    if (result.getValue() != null) {
        organization = result.getValue();
        parameter.put("departmentName", organization.getName());
        parameter.put("departmentOid", organization.getOid());
    }
    this.fillReportProperty(parameter);
    String content = TemplateUtils.processTemplate("resourceTemplate", OrganizationReportBodyCommand.class.getClassLoader(), templateResource, parameter);
    this.setResult(context, content);
    return false;
}
Also used : HashMap(java.util.HashMap) BscStructTreeObj(com.netsteadfast.greenstep.bsc.model.BscStructTreeObj) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO)

Aggregations

OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)42 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)17 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)15 HashMap (java.util.HashMap)11 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)5 Map (java.util.Map)5 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)4 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)3 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)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 Transactional (org.springframework.transaction.annotation.Transactional)3 BbEmployee (com.netsteadfast.greenstep.po.hbm.BbEmployee)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 PdcaDocVO (com.netsteadfast.greenstep.vo.PdcaDocVO)2