use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class KpiTreeJsonAction method loadTreeItems.
@SuppressWarnings("unchecked")
private void loadTreeItems() throws ServiceException, Exception {
Context context = new ContextBase();
context.put("http", this.getHttpServletRequest().getScheme() + "://");
SimpleChain chain = new SimpleChain();
ChainResultObj result = chain.getResultFromResource("kpiTreeItemsChain", context);
this.message = super.defaultString(result.getMessage());
if (result.getValue() != null && result.getValue() instanceof List) {
this.items = (List<Map<String, Object>>) result.getValue();
}
}
use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class KpisDashboardAction method getExcel.
@SuppressWarnings("unchecked")
private void getExcel() throws ControllerException, AuthorityException, ServiceException, Exception {
Context context = this.getContext();
List<Map<String, Object>> chartDatas = (List<Map<String, Object>>) context.get("chartDatas");
if (chartDatas == null || chartDatas.size() < 1) {
throw new ServiceException("Please first query!");
}
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("kpisDashboardExcelContentChain", 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 PersonalReportContentQueryAction method getChainContext.
@SuppressWarnings("unchecked")
private Context getChainContext() throws Exception {
Context context = new ContextBase();
context.put("visionOid", this.getFields().get("visionOid"));
context.put("frequency", this.getFields().get("frequency"));
context.put("startYearDate", this.getFields().get("year"));
context.put("endYearDate", this.getFields().get("year"));
context.put("dateType", this.getFields().get("dateType"));
context.put("dataFor", BscConstants.MEASURE_DATA_FOR_EMPLOYEE);
EmployeeVO employee = new EmployeeVO();
employee.setOid(this.getFields().get("employeeOid"));
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());
context.put("orgId", BscConstants.MEASURE_DATA_ORGANIZATION_FULL);
context.put("uploadSignatureOid", this.getFields().get("uploadSignatureOid"));
return context;
}
use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class PersonalReportContentQueryAction method getPdf.
private void getPdf() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("personalReportPdfContentChain", 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 PersonalReportContentQueryAction method getExcel.
private void getExcel() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("personalReportExcelContentChain", context);
this.message = resultObj.getMessage();
if (resultObj.getValue() instanceof String) {
this.uploadOid = (String) resultObj.getValue();
this.success = IS_YES;
}
}
Aggregations