use of com.netsteadfast.greenstep.vo.FormulaVO in project bamboobsc by billchen198318.
the class FormulaServiceImpl method findForSimple.
@Override
public DefaultResult<List<FormulaVO>> findForSimple(boolean trendsFlag) throws ServiceException, Exception {
DefaultResult<List<FormulaVO>> result = new DefaultResult<List<FormulaVO>>();
List<FormulaVO> searchList = this.formulaDAO.findForSimple((trendsFlag ? YesNo.YES : YesNo.NO));
if (searchList != null && searchList.size() > 0) {
result.setValue(searchList);
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
}
return result;
}
use of com.netsteadfast.greenstep.vo.FormulaVO in project bamboobsc by billchen198318.
the class FormulaServiceImpl method findForMap.
@Override
public Map<String, String> findForMap(boolean pleaseSelect, boolean trendsFlag) throws ServiceException, Exception {
Map<String, String> dataMap = this.providedSelectZeroDataMap(pleaseSelect);
List<FormulaVO> searchList = this.formulaDAO.findForSimple((trendsFlag ? YesNo.YES : YesNo.NO));
for (int i = 0; searchList != null && i < searchList.size(); i++) {
FormulaVO formula = searchList.get(i);
dataMap.put(formula.getOid(), formula.getName());
}
return dataMap;
}
use of com.netsteadfast.greenstep.vo.FormulaVO in project bamboobsc by billchen198318.
the class FormulaSaveOrUpdateAction method delete.
private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
FormulaVO formula = new FormulaVO();
this.transformFields2ValueObject(formula, new String[] { "oid" });
DefaultResult<Boolean> result = this.formulaLogicService.delete(formula);
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null && result.getValue()) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.FormulaVO 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);
}
}
}
}
}
}
use of com.netsteadfast.greenstep.vo.FormulaVO in project bamboobsc by billchen198318.
the class BscFormulaUtils method getFormulaById.
@SuppressWarnings("unchecked")
public static FormulaVO getFormulaById(String forId) throws ServiceException, Exception {
IFormulaService<FormulaVO, BbFormula, String> formulaService = (IFormulaService<FormulaVO, BbFormula, String>) AppContext.getBean("bsc.service.FormulaService");
FormulaVO formula = new FormulaVO();
formula.setForId(forId);
DefaultResult<FormulaVO> forResult = formulaService.findByUK(formula);
if (forResult.getValue() == null) {
throw new ServiceException(forResult.getSystemMessage().getValue());
}
formula = forResult.getValue();
return formula;
}
Aggregations