Search in sources :

Example 6 with MonitorItemScoreVO

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

the class PerformanceScoreChainUtils method createOrUpdateMonitorItemScore.

public static void createOrUpdateMonitorItemScore(String dateVal, Context context) throws ServiceException, Exception {
    ChainResultObj result = getResult(context);
    if (result.getValue() == null || ((BscStructTreeObj) result.getValue()).getVisions() == null || ((BscStructTreeObj) result.getValue()).getVisions().size() == 0) {
        logger.warn("No data!");
        return;
    }
    //String dateVal = SimpleUtils.getStrYMD("");
    String frequency = (String) context.get("frequency");
    String orgId = (String) context.get("orgId");
    String empId = (String) context.get("empId");
    List<VisionVO> visions = ((BscStructTreeObj) result.getValue()).getVisions();
    for (VisionVO vision : visions) {
        List<PerspectiveVO> perspectives = vision.getPerspectives();
        MonitorItemScoreVO visionMonitorItemScore = getMonitorItemScore(dateVal, frequency, orgId, empId, MonitorItemType.VISION, vision.getVisId());
        //visionMonitorItemScore.setScore( BscReportSupportUtils.parse2(vision.getScore()) );
        setScore(visionMonitorItemScore, vision.getScore());
        saveOrUpdateMonitorItemScore(visionMonitorItemScore);
        for (PerspectiveVO perspective : perspectives) {
            List<ObjectiveVO> objectives = perspective.getObjectives();
            MonitorItemScoreVO perspectiveMonitorItemScore = getMonitorItemScore(dateVal, frequency, orgId, empId, MonitorItemType.PERSPECTIVES, perspective.getPerId());
            //perspectiveMonitorItemScore.setScore( BscReportSupportUtils.parse2(perspective.getScore()) );
            setScore(perspectiveMonitorItemScore, perspective.getScore());
            saveOrUpdateMonitorItemScore(perspectiveMonitorItemScore);
            for (ObjectiveVO objective : objectives) {
                List<KpiVO> kpis = objective.getKpis();
                MonitorItemScoreVO objectiveMonitorItemScore = getMonitorItemScore(dateVal, frequency, orgId, empId, MonitorItemType.STRATEGY_OF_OBJECTIVES, objective.getObjId());
                //objectiveMonitorItemScore.setScore( BscReportSupportUtils.parse2(objective.getScore()) );
                setScore(objectiveMonitorItemScore, objective.getScore());
                saveOrUpdateMonitorItemScore(objectiveMonitorItemScore);
                for (KpiVO kpi : kpis) {
                    MonitorItemScoreVO kpiMonitorItemScore = getMonitorItemScore(dateVal, frequency, orgId, empId, MonitorItemType.KPI, kpi.getId());
                    //kpiMonitorItemScore.setScore( BscReportSupportUtils.parse2(kpi.getScore()) );
                    setScore(kpiMonitorItemScore, kpi.getScore());
                    saveOrUpdateMonitorItemScore(kpiMonitorItemScore);
                }
            }
        }
    }
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) BscStructTreeObj(com.netsteadfast.greenstep.bsc.model.BscStructTreeObj) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO) MonitorItemScoreVO(com.netsteadfast.greenstep.vo.MonitorItemScoreVO)

Aggregations

MonitorItemScoreVO (com.netsteadfast.greenstep.vo.MonitorItemScoreVO)6 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)3 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)3 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)3 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)3 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 BbMonitorItemScore (com.netsteadfast.greenstep.po.hbm.BbMonitorItemScore)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 ChainResultObj (com.netsteadfast.greenstep.base.model.ChainResultObj)1 CustomeOperational (com.netsteadfast.greenstep.base.model.CustomeOperational)1 BscStructTreeObj (com.netsteadfast.greenstep.bsc.model.BscStructTreeObj)1 TemplateResultObj (com.netsteadfast.greenstep.model.TemplateResultObj)1 EmployeeVO (com.netsteadfast.greenstep.vo.EmployeeVO)1 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)1 Date (java.util.Date)1 Map (java.util.Map)1