use of com.netsteadfast.greenstep.vo.PerspectiveVO in project bamboobsc by billchen198318.
the class ScoreCalculationCommand method processObjectivesScore.
private void processObjectivesScore(List<VisionVO> visions) throws Exception {
for (VisionVO vision : visions) {
for (PerspectiveVO perspective : vision.getPerspectives()) {
for (ObjectiveVO objective : perspective.getObjectives()) {
float score = 0.0f;
for (KpiVO kpi : objective.getKpis()) {
score += kpi.getScore() * this.getWeightPercentage(kpi.getWeight());
}
objective.setScore(score);
objective.setBgColor(BscScoreColorUtils.getBackgroundColor(score));
objective.setFontColor(BscScoreColorUtils.getFontColor(score));
/*
objective.setImgIcon(
BscReportSupportUtils.getHtmlIconBase(
"OBJECTIVES",
objective.getTarget(),
objective.getMin(),
score,
"",
"",
0)
);
*/
}
}
}
}
use of com.netsteadfast.greenstep.vo.PerspectiveVO in project bamboobsc by billchen198318.
the class ScoreCalculationCommand method processVisionsScore.
private void processVisionsScore(List<VisionVO> visions) throws Exception {
for (VisionVO vision : visions) {
float score = 0.0f;
for (PerspectiveVO perspective : vision.getPerspectives()) {
score += perspective.getScore() * this.getWeightPercentage(perspective.getWeight());
}
vision.setScore(score);
vision.setBgColor(BscScoreColorUtils.getBackgroundColor(score));
vision.setFontColor(BscScoreColorUtils.getFontColor(score));
}
}
use of com.netsteadfast.greenstep.vo.PerspectiveVO in project bamboobsc by billchen198318.
the class ScoreCalculationCommand method processKpisScore.
private void processKpisScore(List<VisionVO> visions) throws Exception {
//long beg = System.currentTimeMillis();
for (VisionVO vision : visions) {
for (PerspectiveVO perspective : vision.getPerspectives()) {
for (ObjectiveVO objective : perspective.getObjectives()) {
// 2015-04-11 add
ExecutorService kpiCalculationPool = Executors.newFixedThreadPool(SimpleUtils.getAvailableProcessors(objective.getKpis().size()));
for (KpiVO kpi : objective.getKpis()) {
/* 2015-04-11 rem
float score = this.calculationMeasureData(kpi);
kpi.setScore(score);
kpi.setBgColor( BscScoreColorUtils.getBackgroundColor(score) );
kpi.setFontColor( BscScoreColorUtils.getFontColor(score) );
*/
// 2015-04-11 add
ScoreCalculationCallableData data = new ScoreCalculationCallableData();
data.setDefaultMode(true);
data.setKpi(kpi);
data = kpiCalculationPool.submit(new ScoreCalculationCallable(data)).get();
}
kpiCalculationPool.shutdown();
}
}
}
//long end = System.currentTimeMillis();
//System.out.println( this.getClass().getName() + " use time(MS) = " + (end-beg) );
}
use of com.netsteadfast.greenstep.vo.PerspectiveVO in project bamboobsc by billchen198318.
the class KpiManagementAction method handlerSelectValueForEdit.
private void handlerSelectValueForEdit() throws ServiceException, Exception {
ObjectiveVO objective = new ObjectiveVO();
objective.setObjId(this.kpi.getObjId());
DefaultResult<ObjectiveVO> objResult = this.objectiveService.findByUK(objective);
if (objResult.getValue() == null) {
throw new ServiceException(objResult.getSystemMessage().getValue());
}
objective = objResult.getValue();
PerspectiveVO perspective = new PerspectiveVO();
perspective.setPerId(objective.getPerId());
DefaultResult<PerspectiveVO> perResult = this.perspectiveService.findByUK(perspective);
if (perResult.getValue() == null) {
throw new ServiceException(perResult.getSystemMessage().getValue());
}
perspective = perResult.getValue();
VisionVO vision = new VisionVO();
vision.setVisId(perspective.getVisId());
DefaultResult<VisionVO> visResult = this.visionService.findForSimpleByVisId(vision.getVisId());
if (visResult.getValue() == null) {
throw new ServiceException(visResult.getSystemMessage().getValue());
}
vision = visResult.getValue();
// FormulaVO formula = new FormulaVO();
// formula.setForId( this.kpi.getForId() );
// DefaultResult<FormulaVO> forResult = this.formulaService.findByUK(formula);
// if (forResult.getValue()==null) {
// throw new ServiceException( forResult.getSystemMessage().getValue() );
// }
// formula = forResult.getValue();
//
// FormulaVO trendsFormula = new FormulaVO();
// trendsFormula.setForId( this.kpi.getTrendsForId() );
// DefaultResult<FormulaVO> trendsForResult = this.formulaService.findByUK(trendsFormula);
// if (trendsForResult.getValue()==null) {
// throw new ServiceException( trendsForResult.getSystemMessage().getValue() );
// }
// trendsFormula = trendsForResult.getValue();
this.getFields().put("visionOid", vision.getOid());
this.getFields().put("perspectiveOid", perspective.getOid());
this.getFields().put("objectiveOid", objective.getOid());
this.getFields().put("formulaOid", BscFormulaUtils.getFormulaById(this.kpi.getForId()).getOid());
this.getFields().put("trendsFormulaOid", BscFormulaUtils.getFormulaById(this.kpi.getTrendsForId()).getOid());
this.getFields().put("aggrMethodOid", AggregationMethodUtils.findSimpleById(this.kpi.getCal()).getOid());
this.perspectiveMap = this.perspectiveService.findForMapByVisionOid(vision.getOid(), true);
this.objectiveMap = this.objectiveService.findForMapByPerspectiveOid(perspective.getOid(), true);
}
use of com.netsteadfast.greenstep.vo.PerspectiveVO in project bamboobsc by billchen198318.
the class KpiReportContentQueryAction method fillPerspectivesPieChartData.
private void fillPerspectivesPieChartData(BscStructTreeObj treeObj) throws Exception {
List<VisionVO> visions = treeObj.getVisions();
for (VisionVO vision : visions) {
if (!vision.getOid().equals(this.getFields().get("visionOid"))) {
continue;
}
for (PerspectiveVO perspective : vision.getPerspectives()) {
Map<String, Object> dataMap = new HashMap<String, Object>();
dataMap.put("label", perspective.getName());
dataMap.put("value", perspective.getScore());
this.perspectivesPieChartValue.add(dataMap);
this.perspectivesPieChartBgColor.add(perspective.getBgColor());
}
}
}
Aggregations