use of com.netsteadfast.greenstep.vo.VisionVO 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.VisionVO in project bamboobsc by billchen198318.
the class KpiReportContentQueryAction method fillPerspectivesPieChartData.
private void fillPerspectivesPieChartData(BscStructTreeObj treeObj) throws Exception {
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());
this.perspectivesPieChartValue.add(dataMap);
this.perspectivesPieChartBgColor.add(perspective.getBgColor());
}
}
}
use of com.netsteadfast.greenstep.vo.VisionVO in project bamboobsc by billchen198318.
the class OrganizationReportExcelCommand method createExcel.
private String createExcel(Context context) throws Exception {
String visionOid = (String) context.get("visionOid");
VisionVO vision = null;
BscStructTreeObj treeObj = (BscStructTreeObj) this.getResult(context);
for (VisionVO visionObj : treeObj.getVisions()) {
if (visionObj.getOid().equals(visionOid)) {
vision = visionObj;
}
}
BscReportPropertyUtils.loadData();
String fileName = SimpleUtils.getUUIDStr() + ".xlsx";
String fileFullPath = Constants.getWorkTmpDir() + "/" + fileName;
int row = 0;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sh = wb.createSheet();
row += this.createHead(wb, sh, row, vision, context);
row = this.createMainBody(wb, sh, row, vision);
this.putSignature(wb, sh, row + 1, context);
FileOutputStream out = new FileOutputStream(fileFullPath);
wb.write(out);
out.close();
wb = null;
File file = new File(fileFullPath);
String oid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, file, "department-report.xlsx");
file = null;
return oid;
}
use of com.netsteadfast.greenstep.vo.VisionVO 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);
}
}
use of com.netsteadfast.greenstep.vo.VisionVO 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);
}
}
}
}
}
}
Aggregations