use of com.netsteadfast.greenstep.base.model.ChainResultObj 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 com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.
the class PerformanceScoreChainUtils method createOrUpdateMonitorItemScore.
public static void createOrUpdateMonitorItemScore(String dateVal, Context context) throws ServiceException, Exception {
ChainResultObj result = getResult(context);
if (result.getValue() == null || ((BscStructTreeObj) result.getValue()).getVisions() == null || ((BscStructTreeObj) result.getValue()).getVisions().size() == 0) {
logger.warn("No data!");
return;
}
//String dateVal = SimpleUtils.getStrYMD("");
String frequency = (String) context.get("frequency");
String orgId = (String) context.get("orgId");
String empId = (String) context.get("empId");
List<VisionVO> visions = ((BscStructTreeObj) result.getValue()).getVisions();
for (VisionVO vision : visions) {
List<PerspectiveVO> perspectives = vision.getPerspectives();
MonitorItemScoreVO visionMonitorItemScore = getMonitorItemScore(dateVal, frequency, orgId, empId, MonitorItemType.VISION, vision.getVisId());
//visionMonitorItemScore.setScore( BscReportSupportUtils.parse2(vision.getScore()) );
setScore(visionMonitorItemScore, vision.getScore());
saveOrUpdateMonitorItemScore(visionMonitorItemScore);
for (PerspectiveVO perspective : perspectives) {
List<ObjectiveVO> objectives = perspective.getObjectives();
MonitorItemScoreVO perspectiveMonitorItemScore = getMonitorItemScore(dateVal, frequency, orgId, empId, MonitorItemType.PERSPECTIVES, perspective.getPerId());
//perspectiveMonitorItemScore.setScore( BscReportSupportUtils.parse2(perspective.getScore()) );
setScore(perspectiveMonitorItemScore, perspective.getScore());
saveOrUpdateMonitorItemScore(perspectiveMonitorItemScore);
for (ObjectiveVO objective : objectives) {
List<KpiVO> kpis = objective.getKpis();
MonitorItemScoreVO objectiveMonitorItemScore = getMonitorItemScore(dateVal, frequency, orgId, empId, MonitorItemType.STRATEGY_OF_OBJECTIVES, objective.getObjId());
//objectiveMonitorItemScore.setScore( BscReportSupportUtils.parse2(objective.getScore()) );
setScore(objectiveMonitorItemScore, objective.getScore());
saveOrUpdateMonitorItemScore(objectiveMonitorItemScore);
for (KpiVO kpi : kpis) {
MonitorItemScoreVO kpiMonitorItemScore = getMonitorItemScore(dateVal, frequency, orgId, empId, MonitorItemType.KPI, kpi.getId());
//kpiMonitorItemScore.setScore( BscReportSupportUtils.parse2(kpi.getScore()) );
setScore(kpiMonitorItemScore, kpi.getScore());
saveOrUpdateMonitorItemScore(kpiMonitorItemScore);
}
}
}
}
}
use of com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.
the class PerformanceScoreChainUtils method getResult.
public static ChainResultObj getResult(Context context) throws ServiceException, Exception {
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("performanceScoreChain", context);
return resultObj;
}
use of com.netsteadfast.greenstep.base.model.ChainResultObj 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;
}
}
use of com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.
the class RegionMapViewAction method renderInfowindowContent.
private void renderInfowindowContent() throws ServiceException, Exception {
StringBuilder outStr = new StringBuilder();
String year = this.getFields().get("year");
String orgId = this.getFields().get("orgId");
List<String> visionOids = this.visionService.findForOidByKpiOrga(orgId);
if (visionOids == null || visionOids.size() < 1) {
this.setPageMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA) + " , for KPIs.");
return;
}
for (String visionOid : visionOids) {
Context context = this.getChainContext(visionOid, year);
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("kpiReportHtmlContentChain", context);
outStr.append(String.valueOf(resultObj.getValue()));
}
this.content = outStr.toString();
}
Aggregations