Search in sources :

Example 51 with PerspectiveVO

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

the class PerformanceScoreChainUtils method clearExpressionContentOut.

/**
	 * 清除 公式 與 歸類方法 的表達式內容
	 * 
	 * @param vision
	 * @throws Exception
	 */
public static void clearExpressionContentOut(VisionVO vision) throws Exception {
    if (null == vision) {
        return;
    }
    for (PerspectiveVO perspective : vision.getPerspectives()) {
        for (ObjectiveVO objective : perspective.getObjectives()) {
            for (KpiVO kpi : objective.getKpis()) {
                kpi.getFormula().setExpression("");
                kpi.getFormula().setDescription("");
                kpi.getTrendsFormula().setExpression("");
                kpi.getTrendsFormula().setDescription("");
                kpi.getAggregationMethod().setExpression1("");
                kpi.getAggregationMethod().setExpression2("");
                kpi.getAggregationMethod().setDescription("");
            }
        }
    }
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO)

Example 52 with PerspectiveVO

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

the class KpiReportContentQueryAction method fillLineChartData.

private void fillLineChartData(BscStructTreeObj treeObj) throws Exception {
    // 給 09 - Dashboard 用的 , 判斷 用第1筆的資料來組  categories 的變數
    int c = 0;
    List<VisionVO> visions = treeObj.getVisions();
    for (VisionVO vision : visions) {
        if (!vision.getOid().equals(this.getFields().get("visionOid"))) {
            continue;
        }
        // 在  Dashboard 查詢時, 一定要選 vision, 所以只會有一個 vision , 給 09 - Dashboard 用的 
        this.subTitle = vision.getTitle();
        for (PerspectiveVO perspective : vision.getPerspectives()) {
            // 給 04 - Perspectives Dashboard 用的
            this.perspectiveItems.add(perspective);
            for (ObjectiveVO objective : perspective.getObjectives()) {
                for (KpiVO kpi : objective.getKpis()) {
                    Map<String, String> labelMap = new HashMap<String, String>();
                    List<List<Object>> dataList = new LinkedList<List<Object>>();
                    labelMap.put("label", kpi.getName());
                    this.lineChartNames.add(labelMap);
                    for (DateRangeScoreVO entry : kpi.getDateRangeScores()) {
                        List<Object> dateScoreList = new LinkedList<Object>();
                        dateScoreList.add(entry.getDate().replaceAll("/", "-"));
                        dateScoreList.add(entry.getScore());
                        dataList.add(dateScoreList);
                    }
                    this.lineChartValues.add(dataList);
                    // ----------------------------------------------------------------------
                    // 給 09 - Dashboard 用的 
                    // 給 Dashboard 頁面 trend line chart 用的資料
                    Map<String, Object> mapData = new HashMap<String, Object>();
                    List<Float> rangeScore = new LinkedList<Float>();
                    for (DateRangeScoreVO dateRangeScore : kpi.getDateRangeScores()) {
                        if (c == 0) {
                            // 用第1筆的資料來組  categories 就可已了
                            categories.add(dateRangeScore.getDate());
                        }
                        rangeScore.add(dateRangeScore.getScore());
                    }
                    mapData.put("name", kpi.getName());
                    mapData.put("data", rangeScore);
                    this.series.add(mapData);
                    c++;
                // ----------------------------------------------------------------------
                }
            }
        }
    }
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) DateRangeScoreVO(com.netsteadfast.greenstep.vo.DateRangeScoreVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO) LinkedList(java.util.LinkedList) List(java.util.List) LinkedList(java.util.LinkedList)

Example 53 with PerspectiveVO

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

the class KpiReportContentQueryAction method fillPerspectivesBarChartData.

private void fillPerspectivesBarChartData(BscStructTreeObj treeObj) throws Exception {
    Map<String, Object> valueMap = new LinkedHashMap<String, Object>();
    List<Map<String, Object>> values = new LinkedList<Map<String, Object>>();
    valueMap.put("key", "Perspectives");
    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());
            values.add(dataMap);
            this.perspectivesBarChartBgColor.add(perspective.getBgColor());
        }
    }
    valueMap.put("values", values);
    this.perspectivesBarChartValue.add(valueMap);
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) Map(java.util.Map) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) VisionVO(com.netsteadfast.greenstep.vo.VisionVO) LinkedList(java.util.LinkedList) LinkedHashMap(java.util.LinkedHashMap)

Example 54 with PerspectiveVO

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

the class ObjectiveManagementAction method loadObjectiveData.

private void loadObjectiveData() throws ServiceException, Exception {
    this.transformFields2ValueObject(this.objective, new String[] { "oid" });
    DefaultResult<ObjectiveVO> result = this.objectiveService.findObjectByOid(objective);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.objective = result.getValue();
    PerspectiveVO perspective = new PerspectiveVO();
    perspective.setPerId(this.objective.getPerId());
    DefaultResult<PerspectiveVO> pResult = this.perspectiveService.findByUK(perspective);
    if (pResult.getValue() == null) {
        throw new ServiceException(pResult.getSystemMessage().getValue());
    }
    perspective = pResult.getValue();
    this.getFields().put("perspectiveOid", perspective.getOid());
    VisionVO vision = new VisionVO();
    vision.setVisId(perspective.getVisId());
    DefaultResult<VisionVO> vResult = this.visionService.findForSimpleByVisId(vision.getVisId());
    if (vResult.getValue() == null) {
        throw new ServiceException(vResult.getSystemMessage().getValue());
    }
    vision = vResult.getValue();
    this.getFields().put("visionOid", vision.getOid());
    this.perspectiveMap = this.perspectiveService.findForMapByVisionOid(vision.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 55 with PerspectiveVO

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

the class PerspectiveSaveOrUpdateAction method save.

private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    PerspectiveVO perspective = new PerspectiveVO();
    this.transformFields2ValueObject(perspective, new String[] { "name", "weight", "target", "min", "description" });
    DefaultResult<PerspectiveVO> result = this.perspectiveLogicService.create(perspective, this.getFields().get("visionOid"));
    this.message = result.getSystemMessage().getValue();
    if (result.getValue() != null) {
        this.success = IS_YES;
    }
}
Also used : PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO)

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