Search in sources :

Example 1 with BscMixDataVO

use of com.netsteadfast.greenstep.bsc.vo.BscMixDataVO in project bamboobsc by billchen198318.

the class LoadBscStructTreeCommand method processKpi.

private void processKpi(BscStructTreeObj treeObj, List<BscMixDataVO> mixDatas) throws Exception {
    //Map<String, String> calculationMap = BscKpiCode.getCalculationMap(false);
    Map<String, String> managementMap = BscKpiCode.getManagementMap(false);
    for (VisionVO vision : treeObj.getVisions()) {
        for (PerspectiveVO perspective : vision.getPerspectives()) {
            for (ObjectiveVO objective : perspective.getObjectives()) {
                for (BscMixDataVO mixData : mixDatas) {
                    if (!vision.getVisId().equals(mixData.getVisId()) || !perspective.getPerId().equals(mixData.getPerId()) || !objective.getObjId().equals(mixData.getObjId())) {
                        continue;
                    }
                    boolean found = false;
                    for (int i = 0; i < objective.getKpis().size(); i++) {
                        if (objective.getKpis().get(i).getId().equals(mixData.getKpiId())) {
                            found = true;
                        }
                    }
                    if (!found) {
                        KpiVO kpi = new KpiVO();
                        kpi.setOid(mixData.getKpiOid());
                        kpi.setId(mixData.getKpiId());
                        kpi.setCal(mixData.getKpiCal());
                        kpi.setCompareType(mixData.getKpiCompareType());
                        kpi.setDataType(mixData.getKpiDataType());
                        kpi.setDescription(mixData.getKpiDescription());
                        kpi.setForId(mixData.getForId());
                        kpi.setManagement(mixData.getKpiManagement());
                        kpi.setMax(mixData.getKpiMax());
                        kpi.setMin(mixData.getKpiMin());
                        kpi.setName(mixData.getKpiName());
                        kpi.setObjId(mixData.getObjId());
                        kpi.setOrgaMeasureSeparate(mixData.getKpiOrgaMeasureSeparate());
                        kpi.setTarget(mixData.getKpiTarget());
                        kpi.setUnit(mixData.getKpiUnit());
                        kpi.setUserMeasureSeparate(mixData.getKpiUserMeasureSeparate());
                        kpi.setWeight(mixData.getKpiWeight());
                        kpi.setManagementName(managementMap.get(kpi.getManagement()));
                        //kpi.setCalculationName( calculationMap.get(kpi.getCal()) );
                        kpi.setCalculationName(AggregationMethodUtils.getNameByAggrId(kpi.getCal()));
                        kpi.setQuasiRange(mixData.getKpiQuasiRange());
                        kpi.setActivate(mixData.getKpiActivate());
                        FormulaVO formula = new FormulaVO();
                        formula.setOid(mixData.getForOid());
                        formula.setForId(mixData.getForId());
                        formula.setName(mixData.getForName());
                        formula.setType(mixData.getForType());
                        formula.setReturnMode(mixData.getForReturnMode());
                        formula.setReturnVar(mixData.getForReturnVar());
                        formula.setExpression(mixData.getForExpression());
                        kpi.setFormula(formula);
                        AggregationMethodVO aggr = new AggregationMethodVO();
                        aggr.setOid(mixData.getAggrOid());
                        aggr.setAggrId(mixData.getAggrId());
                        aggr.setName(mixData.getAggrName());
                        aggr.setType(mixData.getAggrType());
                        aggr.setExpression1(mixData.getAggrExpression1());
                        aggr.setExpression2(mixData.getAggrExpression2());
                        kpi.setAggregationMethod(aggr);
                        FormulaVO trendsFormula = new FormulaVO();
                        trendsFormula.setOid(mixData.getTrendsForOid());
                        trendsFormula.setForId(mixData.getTrendsForId());
                        trendsFormula.setName(mixData.getTrendsForName());
                        trendsFormula.setType(mixData.getTrendsForType());
                        trendsFormula.setReturnMode(mixData.getTrendsForReturnMode());
                        trendsFormula.setReturnVar(mixData.getTrendsForReturnVar());
                        trendsFormula.setExpression(mixData.getTrendsForExpression());
                        kpi.setTrendsFormula(trendsFormula);
                        objective.getKpis().add(kpi);
                    }
                }
            }
        }
    }
}
Also used : AggregationMethodVO(com.netsteadfast.greenstep.vo.AggregationMethodVO) ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO) FormulaVO(com.netsteadfast.greenstep.vo.FormulaVO) BscMixDataVO(com.netsteadfast.greenstep.bsc.vo.BscMixDataVO)

Example 2 with BscMixDataVO

use of com.netsteadfast.greenstep.bsc.vo.BscMixDataVO in project bamboobsc by billchen198318.

the class LoadBscStructTreeCommand method processObjective.

private void processObjective(BscStructTreeObj treeObj, List<BscMixDataVO> mixDatas) throws Exception {
    for (VisionVO vision : treeObj.getVisions()) {
        for (PerspectiveVO perspective : vision.getPerspectives()) {
            for (BscMixDataVO mixData : mixDatas) {
                if (!vision.getVisId().equals(mixData.getVisId()) || !perspective.getPerId().equals(mixData.getPerId())) {
                    continue;
                }
                boolean found = false;
                for (int i = 0; i < perspective.getObjectives().size(); i++) {
                    if (perspective.getObjectives().get(i).getObjId().equals(mixData.getObjId())) {
                        found = true;
                    }
                }
                if (!found) {
                    ObjectiveVO objective = new ObjectiveVO();
                    objective.setOid(mixData.getObjOid());
                    objective.setObjId(mixData.getObjId());
                    objective.setPerId(mixData.getPerId());
                    objective.setName(mixData.getObjName());
                    objective.setWeight(mixData.getObjWeight());
                    objective.setTarget(mixData.getObjTarget());
                    objective.setMin(mixData.getObjMin());
                    objective.setDescription(mixData.getObjDescription());
                    perspective.getObjectives().add(objective);
                }
            }
        }
    }
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO) BscMixDataVO(com.netsteadfast.greenstep.bsc.vo.BscMixDataVO)

Example 3 with BscMixDataVO

use of com.netsteadfast.greenstep.bsc.vo.BscMixDataVO in project bamboobsc by billchen198318.

the class LoadBscStructTreeCommand method execute.

@SuppressWarnings("unchecked")
@Override
public boolean execute(Context context) throws Exception {
    if (this.getResult(context) == null || !(this.getResult(context) instanceof List)) {
        return false;
    }
    List<BscMixDataVO> mixDatas = (List<BscMixDataVO>) this.getResult(context);
    BscStructTreeObj treeObj = this.processTree(mixDatas);
    this.calculateRowspan(treeObj);
    this.setResult(context, treeObj);
    context.put("treeObj", treeObj);
    return false;
}
Also used : BscStructTreeObj(com.netsteadfast.greenstep.bsc.model.BscStructTreeObj) List(java.util.List) BscMixDataVO(com.netsteadfast.greenstep.bsc.vo.BscMixDataVO)

Example 4 with BscMixDataVO

use of com.netsteadfast.greenstep.bsc.vo.BscMixDataVO in project bamboobsc by billchen198318.

the class LoadBscStructTreeCommand method processPerspective.

private void processPerspective(BscStructTreeObj treeObj, List<BscMixDataVO> mixDatas) throws Exception {
    for (VisionVO vision : treeObj.getVisions()) {
        for (BscMixDataVO mixData : mixDatas) {
            if (!vision.getVisId().equals(mixData.getVisId())) {
                continue;
            }
            boolean found = false;
            for (int i = 0; i < vision.getPerspectives().size(); i++) {
                if (vision.getPerspectives().get(i).getPerId().equals(mixData.getPerId())) {
                    found = true;
                }
            }
            if (!found) {
                PerspectiveVO perspective = new PerspectiveVO();
                perspective.setOid(mixData.getPerOid());
                perspective.setPerId(mixData.getPerId());
                perspective.setVisId(mixData.getVisId());
                perspective.setName(mixData.getPerName());
                perspective.setWeight(mixData.getPerWeight());
                perspective.setTarget(mixData.getPerTarget());
                perspective.setMin(mixData.getPerMin());
                perspective.setDescription(mixData.getPerDescription());
                vision.getPerspectives().add(perspective);
            }
        }
    }
}
Also used : PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO) BscMixDataVO(com.netsteadfast.greenstep.bsc.vo.BscMixDataVO)

Example 5 with BscMixDataVO

use of com.netsteadfast.greenstep.bsc.vo.BscMixDataVO in project bamboobsc by billchen198318.

the class LoadBscStructTreeCommand method processVision.

private void processVision(BscStructTreeObj treeObj, List<BscMixDataVO> mixDatas) throws Exception {
    for (BscMixDataVO mixData : mixDatas) {
        boolean found = false;
        for (int i = 0; i < treeObj.getVisions().size(); i++) {
            if (treeObj.getVisions().get(i).getVisId().equals(mixData.getVisId())) {
                found = true;
            }
        }
        if (!found) {
            VisionVO vision = new VisionVO();
            vision.setOid(mixData.getVisOid());
            vision.setVisId(mixData.getVisId());
            vision.setTitle(mixData.getVisTitle());
            treeObj.getVisions().add(vision);
        }
    }
}
Also used : VisionVO(com.netsteadfast.greenstep.vo.VisionVO) BscMixDataVO(com.netsteadfast.greenstep.bsc.vo.BscMixDataVO)

Aggregations

BscMixDataVO (com.netsteadfast.greenstep.bsc.vo.BscMixDataVO)6 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)4 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)3 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)2 List (java.util.List)2 DefaultResult (com.netsteadfast.greenstep.base.model.DefaultResult)1 SystemMessage (com.netsteadfast.greenstep.base.model.SystemMessage)1 BscStructTreeObj (com.netsteadfast.greenstep.bsc.model.BscStructTreeObj)1 AggregationMethodVO (com.netsteadfast.greenstep.vo.AggregationMethodVO)1 FormulaVO (com.netsteadfast.greenstep.vo.FormulaVO)1 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)1 ArrayList (java.util.ArrayList)1