use of com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.
the class KpiReportContentQueryAction method getPdf.
private void getPdf() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
this.setDateValue();
this.checkDateRange();
Context context = this.getChainContext();
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("kpiReportPdfContentChain", 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 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 com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.
the class BscMobileCardUtils method getVisionCard.
public static List<VisionVO> getVisionCard(String frequency, String startDate, String endDate) throws ServiceException, Exception {
List<VisionVO> visionScores = new ArrayList<VisionVO>();
Map<String, String> visions = visionService.findForMap(false);
if (null == visions || visions.size() < 1) {
return visionScores;
}
Context context = new ContextBase();
context.put("startDate", startDate);
context.put("endDate", endDate);
context.put("startYearDate", startDate.substring(0, 4));
context.put("endYearDate", endDate.substring(0, 4));
context.put("frequency", frequency);
context.put("dataFor", BscConstants.MEASURE_DATA_FOR_ALL);
context.put("orgId", BscConstants.MEASURE_DATA_ORGANIZATION_FULL);
context.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
for (Map.Entry<String, String> entry : visions.entrySet()) {
String visionOid = entry.getKey();
context.put("visionOid", visionOid);
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("performanceScoreChain", context);
BscStructTreeObj treeObj = (BscStructTreeObj) resultObj.getValue();
for (int i = 0; treeObj.getVisions() != null && i < treeObj.getVisions().size(); i++) {
VisionVO vision = treeObj.getVisions().get(i);
vision.setContent(" ".getBytes());
DefaultResult<VisionVO> vResult = visionService.findObjectByOid(vision);
if (vResult.getValue() != null) {
// 計算分數chain 取出的vision資料沒有放 content 欄位, 但這邊要用到, 所以取出content欄位
vision.setContent(new String(vResult.getValue().getContent(), Constants.BASE_ENCODING).getBytes());
}
for (PerspectiveVO perspective : vision.getPerspectives()) {
for (ObjectiveVO objective : perspective.getObjectives()) {
for (KpiVO kpi : objective.getKpis()) {
// 產生報表不需要以下欄位
kpi.getAggregationMethod().setDescription(" ");
kpi.getAggregationMethod().setExpression1(" ");
kpi.getAggregationMethod().setExpression2(" ");
kpi.getFormula().setExpression(" ");
}
}
}
visionScores.add(vision);
}
}
return visionScores;
}
use of com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.
the class BscMobileCardUtils method getDashboardScore.
public static VisionVO getDashboardScore(String visionOid, String frequency, String startDate, String endDate) throws ServiceException, Exception {
String startYear = "";
String endYear = "";
if (BscMeasureDataFrequency.FREQUENCY_YEAR.equals(frequency) || BscMeasureDataFrequency.FREQUENCY_HALF_OF_YEAR.equals(frequency) || BscMeasureDataFrequency.FREQUENCY_QUARTER.equals(frequency)) {
startYear = startDate.substring(0, 4);
endYear = endDate.substring(0, 4);
}
ChainResultObj result = PerformanceScoreChainUtils.getResult(visionOid, startDate, endDate, startYear, endYear, frequency, BscConstants.MEASURE_DATA_FOR_ALL, "", "");
if (result.getValue() == null || ((BscStructTreeObj) result.getValue()).getVisions() == null || ((BscStructTreeObj) result.getValue()).getVisions().size() == 0) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
}
BscStructTreeObj resultObj = (BscStructTreeObj) result.getValue();
VisionVO visionObj = resultObj.getVisions().get(0);
return visionObj;
}
use of com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.
the class IndexAction method loadRecord.
@SuppressWarnings("unchecked")
private void loadRecord() throws ControllerException, ServiceException, Exception {
String visionOid = this.getFields().get("visionOid");
if (super.isNoSelectId(visionOid)) {
return;
}
Context context = new ContextBase();
context.put("visionOid", visionOid);
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("strategyMapItemsForRecChain", context);
this.setPageMessage(resultObj.getMessage());
if (resultObj.getValue() instanceof StrategyMapItemsVO) {
this.divItems = ((StrategyMapItemsVO) resultObj.getValue()).getDiv();
this.cssItems = ((StrategyMapItemsVO) resultObj.getValue()).getCss();
this.conItems = ((StrategyMapItemsVO) resultObj.getValue()).getCon();
}
}
Aggregations