Search in sources :

Example 6 with PerspectiveVO

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)
					);
					*/
            }
        }
    }
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO)

Example 7 with PerspectiveVO

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));
    }
}
Also used : PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO)

Example 8 with PerspectiveVO

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) );		
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) ExecutorService(java.util.concurrent.ExecutorService) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) ScoreCalculationCallableData(com.netsteadfast.greenstep.bsc.support.ScoreCalculationCallableData) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) ScoreCalculationCallable(com.netsteadfast.greenstep.bsc.support.ScoreCalculationCallable) VisionVO(com.netsteadfast.greenstep.vo.VisionVO)

Example 9 with PerspectiveVO

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);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO)

Example 10 with PerspectiveVO

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());
        }
    }
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO)

Aggregations

PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)58 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)44 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)38 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)33 HashMap (java.util.HashMap)17 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)15 BscStructTreeObj (com.netsteadfast.greenstep.bsc.model.BscStructTreeObj)8 DateRangeScoreVO (com.netsteadfast.greenstep.vo.DateRangeScoreVO)8 LinkedList (java.util.LinkedList)8 Map (java.util.Map)8 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)6 ArrayList (java.util.ArrayList)6 Transactional (org.springframework.transaction.annotation.Transactional)6 Phrase (com.itextpdf.text.Phrase)4 PdfPCell (com.itextpdf.text.pdf.PdfPCell)4 ChainResultObj (com.netsteadfast.greenstep.base.model.ChainResultObj)4 Cell (org.apache.poi.ss.usermodel.Cell)4 Row (org.apache.poi.ss.usermodel.Row)4 CellRangeAddress (org.apache.poi.ss.util.CellRangeAddress)4 XSSFCellStyle (org.apache.poi.xssf.usermodel.XSSFCellStyle)4