use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class PeriodTrendsCalUtils method getKpiScoreChange.
public static List<PeriodTrendsData<KpiVO>> getKpiScoreChange(String visionOid1, String startDate1, String endDate1, String startYearDate1, String endYearDate1, String frequency1, String dataFor1, String measureDataOrganizationOid1, String measureDataEmployeeOid1, String visionOid2, String startDate2, String endDate2, String startYearDate2, String endYearDate2, String frequency2, String dataFor2, String measureDataOrganizationOid2, String measureDataEmployeeOid2) throws ServiceException, Exception {
List<PeriodTrendsData<KpiVO>> result = new ArrayList<PeriodTrendsData<KpiVO>>();
Context context1 = PerformanceScoreChainUtils.getContext(visionOid1, startDate1, endDate1, startYearDate1, endYearDate1, frequency1, dataFor1, measureDataOrganizationOid1, measureDataEmployeeOid1);
Context context2 = PerformanceScoreChainUtils.getContext(visionOid2, startDate2, endDate2, startYearDate2, endYearDate2, frequency2, dataFor2, measureDataOrganizationOid2, measureDataEmployeeOid2);
/*
SimpleChain chain1 = new SimpleChain();
SimpleChain chain2 = new SimpleChain();
ChainResultObj resultObj1 = chain1.getResultFromResource("performanceScoreChain", context1);
ChainResultObj resultObj2 = chain2.getResultFromResource("performanceScoreChain", context2);
*/
fillKpiPeriodTrends(result, PerformanceScoreChainUtils.getResult(context1), PerformanceScoreChainUtils.getResult(context2), frequency1.equals(frequency2));
return result;
}
use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class DepartmentReportContentQueryAction method getContent.
private void getContent() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("organizationReportHtmlContentChain", context);
this.body = String.valueOf(resultObj.getValue());
this.message = resultObj.getMessage();
if (!StringUtils.isBlank(this.body) && this.body.startsWith("<!-- BSC_PROG003D0003Q -->")) {
this.success = IS_YES;
}
}
use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class DepartmentReportContentQueryAction method getPdf.
private void getPdf() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("organizationReportPdfContentChain", context);
this.message = resultObj.getMessage();
if (resultObj.getValue() instanceof String) {
this.uploadOid = (String) resultObj.getValue();
this.success = IS_YES;
}
}
use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class KpiReportContentQueryAction method getChainContext.
@SuppressWarnings("unchecked")
private Context getChainContext() throws Exception {
Context context = new ContextBase();
context.put("visionOid", this.getFields().get("visionOid"));
context.put("startDate", this.getFields().get("startDate"));
context.put("endDate", this.getFields().get("endDate"));
context.put("startYearDate", this.getFields().get("startYearDate"));
context.put("endYearDate", this.getFields().get("endYearDate"));
context.put("frequency", this.getFields().get("frequency"));
context.put("dataFor", this.getFields().get("dataFor"));
context.put("orgId", BscConstants.MEASURE_DATA_ORGANIZATION_FULL);
context.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
context.put("account", "");
context.put("pieCanvasToData", SimpleUtils.deHex(this.defaultString(this.getFields().get("pieCanvasToData"))));
context.put("barCanvasToData", SimpleUtils.deHex(this.defaultString(this.getFields().get("barCanvasToData"))));
context.put("uploadSignatureOid", this.getFields().get("uploadSignatureOid"));
context.put("ngVer", YesNo.NO);
if ("Y".equals(this.getFields().get("ngVer"))) {
// 有 javascript click 事件 kpi-report-body-ng.ftl 版本
context.put("ngVer", YesNo.YES);
}
if (!this.isNoSelectId(this.getFields().get("measureDataOrganizationOid"))) {
OrganizationVO organization = new OrganizationVO();
organization.setOid(this.getFields().get("measureDataOrganizationOid"));
DefaultResult<OrganizationVO> result = this.organizationService.findObjectByOid(organization);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
organization = result.getValue();
context.put("orgId", organization.getOrgId());
}
if (!this.isNoSelectId(this.getFields().get("measureDataEmployeeOid"))) {
EmployeeVO employee = new EmployeeVO();
employee.setOid(this.getFields().get("measureDataEmployeeOid"));
DefaultResult<EmployeeVO> result = this.employeeService.findObjectByOid(employee);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
employee = result.getValue();
context.put("empId", employee.getEmpId());
context.put("account", employee.getAccount());
}
this.setContextForSingleObject(context);
return context;
}
use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class KpiReportContentQueryAction method getExcel.
private void getExcel() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
this.setDateValue();
this.checkDateRange();
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("kpiReportExcelContentChain", context);
this.message = resultObj.getMessage();
if (resultObj.getValue() instanceof String) {
this.uploadOid = (String) resultObj.getValue();
this.success = IS_YES;
}
}
Aggregations