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);
}
}
}
}
}
Aggregations