use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class DepartmentReportContentQueryAction 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_ORGANIZATION);
OrganizationVO organization = new OrganizationVO();
organization.setOid(this.getFields().get("organizationOid"));
DefaultResult<OrganizationVO> result = this.organizationService.findObjectByOid(organization);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
organization = result.getValue();
context.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
context.put("orgId", organization.getOrgId());
context.put("uploadSignatureOid", this.getFields().get("uploadSignatureOid"));
return context;
}
use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class DepartmentReportContentQueryAction method getExcel.
private void getExcel() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("organizationReportExcelContentChain", 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 ObjectivesDashboardAction method getContext.
@SuppressWarnings("unchecked")
private Context getContext() throws Exception {
List<Map<String, Object>> chartDatas = new LinkedList<Map<String, Object>>();
Enumeration<String> paramNames = this.getHttpServletRequest().getParameterNames();
while (paramNames.hasMoreElements()) {
String paramName = paramNames.nextElement();
String value = this.getHttpServletRequest().getParameter(paramName);
if (paramName.startsWith("BSC_PROG003D0005Q_meterGaugeChartDatas:")) {
Map<String, Object> dataMap = (Map<String, Object>) new ObjectMapper().readValue(value, LinkedHashMap.class);
chartDatas.add(dataMap);
}
}
Context context = new ContextBase();
context.put("chartDatas", chartDatas);
context.put("year", this.getHttpServletRequest().getParameter("BSC_PROG003D0005Q_year"));
context.put("barChartsData", this.getHttpServletRequest().getParameter("BSC_PROG003D0005Q_objectivesBarChartsData"));
return context;
}
use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.
the class ObjectivesDashboardAction 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) {
super.throwMessage(this.getText("MESSAGE.BSC_PROG003D0005Q_msg1"));
}
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("objectivesDashboardExcelContentChain", 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 PerspectivesDashboardAction method getContext.
@SuppressWarnings("unchecked")
private Context getContext() throws Exception {
List<Map<String, Object>> chartDatas = new LinkedList<Map<String, Object>>();
String pieCanvasToData = "";
String barCanvasToData = "";
Enumeration<String> paramNames = this.getHttpServletRequest().getParameterNames();
while (paramNames.hasMoreElements()) {
String paramName = paramNames.nextElement();
String value = this.getHttpServletRequest().getParameter(paramName);
if (paramName.startsWith("BSC_PROG003D0004Q_meterGaugeChartDatas:")) {
Map<String, Object> dataMap = (Map<String, Object>) new ObjectMapper().readValue(value, LinkedHashMap.class);
chartDatas.add(dataMap);
}
if (paramName.equals("BSC_PROG003D0004Q_barChartDatas")) {
barCanvasToData = SimpleUtils.deHex(this.defaultString(value));
}
if (paramName.equals("BSC_PROG003D0004Q_pieChartDatas")) {
pieCanvasToData = SimpleUtils.deHex(this.defaultString(value));
}
}
Context context = new ContextBase();
context.put("barCanvasToData", barCanvasToData);
context.put("pieCanvasToData", pieCanvasToData);
context.put("chartDatas", chartDatas);
context.put("year", this.getHttpServletRequest().getParameter("BSC_PROG003D0004Q_year"));
return context;
}
Aggregations