use of com.netsteadfast.greenstep.vo.ObjectiveVO 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)
);
*/
}
}
}
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO 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) );
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO 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);
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class OrganizationReportExcelCommand method createMainBody.
private int createMainBody(XSSFWorkbook wb, XSSFSheet sh, int row, VisionVO vision) throws Exception {
XSSFCellStyle cellStyle = wb.createCellStyle();
cellStyle.setFillForegroundColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor("#ffffff")));
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
XSSFFont cellFont = wb.createFont();
cellFont.setBold(false);
cellFont.setColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor("#000000")));
cellStyle.setFont(cellFont);
cellStyle.setWrapText(true);
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBorderTop(BorderStyle.THIN);
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setBorderLeft(BorderStyle.THIN);
int mrRow = row;
for (int px = 0; px < vision.getPerspectives().size(); px++) {
PerspectiveVO perspective = vision.getPerspectives().get(px);
for (int ox = 0; ox < perspective.getObjectives().size(); ox++) {
ObjectiveVO objective = perspective.getObjectives().get(ox);
for (int kx = 0; kx < objective.getKpis().size(); kx++) {
KpiVO kpi = objective.getKpis().get(kx);
Row contentRow = sh.createRow(row++);
Cell cell1 = contentRow.createCell(0);
cell1.setCellValue(perspective.getName());
cell1.setCellStyle(cellStyle);
Cell titleCell2 = contentRow.createCell(1);
titleCell2.setCellValue(objective.getName());
titleCell2.setCellStyle(cellStyle);
Cell titleCell3 = contentRow.createCell(2);
titleCell3.setCellValue(kpi.getName());
titleCell3.setCellStyle(cellStyle);
Cell titleCell4 = contentRow.createCell(3);
titleCell4.setCellValue(kpi.getWeight() + "%");
titleCell4.setCellStyle(cellStyle);
Cell titleCell5 = contentRow.createCell(4);
titleCell5.setCellValue("max: " + kpi.getMax() + "\n" + "target: " + kpi.getTarget() + "\n" + "min: " + kpi.getMin() + "\n" + "unit: " + kpi.getUnit());
titleCell5.setCellStyle(cellStyle);
DateRangeScoreVO dateRangeScore = kpi.getDateRangeScores().get(0);
XSSFCellStyle cellStyle2 = wb.createCellStyle();
cellStyle2.setFillForegroundColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(dateRangeScore.getBgColor())));
cellStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);
XSSFFont cellFont2 = wb.createFont();
cellFont2.setBold(false);
cellFont2.setColor(new XSSFColor(SimpleUtils.getColorRGB4POIColor(dateRangeScore.getFontColor())));
cellStyle2.setFont(cellFont2);
cellStyle2.setWrapText(true);
cellStyle2.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle2.setBorderBottom(BorderStyle.THIN);
cellStyle2.setBorderTop(BorderStyle.THIN);
cellStyle2.setBorderRight(BorderStyle.THIN);
cellStyle2.setBorderLeft(BorderStyle.THIN);
Cell titleCell6 = contentRow.createCell(5);
titleCell6.setCellValue(BscReportSupportUtils.parse2(dateRangeScore.getScore()));
titleCell6.setCellStyle(cellStyle2);
}
}
}
for (int px = 0; px < vision.getPerspectives().size(); px++) {
PerspectiveVO perspective = vision.getPerspectives().get(px);
// 2016-12-13 old work with POI 3.12
//sh.addMergedRegion(new CellRangeAddress(mrRow, mrRow + perspective.getRow()-1, 0, 0));
// 2016-12-13 new work with POI 3.15
int mrRow1 = mrRow + perspective.getRow() - 1;
if (mrRow1 > mrRow) {
sh.addMergedRegion(new CellRangeAddress(mrRow, mrRow1, 0, 0));
}
for (int ox = 0; ox < perspective.getObjectives().size(); ox++) {
ObjectiveVO objective = perspective.getObjectives().get(ox);
// 2016-12-13 old work with POI 3.12
//sh.addMergedRegion(new CellRangeAddress(mrRow, mrRow + objective.getRow()-1, 1, 1));
// 2016-12-13 new work with POI 3.15
int mrRow2 = mrRow + objective.getRow() - 1;
if (mrRow2 > mrRow) {
sh.addMergedRegion(new CellRangeAddress(mrRow, mrRow2, 1, 1));
}
mrRow += objective.getKpis().size();
}
}
return row++;
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class LoadBscStructTreeCommand method calculateRowspan.
private void calculateRowspan(BscStructTreeObj treeObj) throws Exception {
for (VisionVO vision : treeObj.getVisions()) {
int vRow = 0;
for (PerspectiveVO perspective : vision.getPerspectives()) {
int pRow = 0;
for (ObjectiveVO objective : perspective.getObjectives()) {
vRow += objective.getKpis().size();
pRow += objective.getKpis().size();
objective.setRow(objective.getKpis().size());
}
perspective.setRow(pRow);
}
vision.setRow(vRow);
}
}
Aggregations