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);
}
}
}
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);
}
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);
}
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;
}
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;
}
Aggregations