use of com.netsteadfast.greenstep.vo.AggregationMethodVO in project bamboobsc by billchen198318.
the class AggregationMethodServiceImpl method findForMap.
@Override
public Map<String, String> findForMap(boolean pleaseSelect) throws ServiceException, Exception {
Map<String, String> dataMap = this.providedSelectZeroDataMap(pleaseSelect);
List<AggregationMethodVO> searchList = this.aggregationMethodDAO.findForSimple();
for (int i = 0; searchList != null && i < searchList.size(); i++) {
AggregationMethodVO aggr = searchList.get(i);
dataMap.put(aggr.getOid(), aggr.getName());
}
return dataMap;
}
use of com.netsteadfast.greenstep.vo.AggregationMethodVO in project bamboobsc by billchen198318.
the class AggregationMethodServiceImpl method findSimpleById.
@Override
public DefaultResult<AggregationMethodVO> findSimpleById(String aggrId) throws ServiceException, Exception {
if (StringUtils.isBlank(aggrId) || super.isNoSelectId(aggrId)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
AggregationMethodVO aggr = this.aggregationMethodDAO.findSimpleById(aggrId);
DefaultResult<AggregationMethodVO> result = new DefaultResult<AggregationMethodVO>();
if (aggr != null && !StringUtils.isBlank(aggr.getOid())) {
result.setValue(aggr);
} else {
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA)));
}
return result;
}
use of com.netsteadfast.greenstep.vo.AggregationMethodVO in project bamboobsc by billchen198318.
the class AggregationMethodSaveOrUpdateAction method update.
private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
AggregationMethodVO aggr = new AggregationMethodVO();
this.transformFields2ValueObject(aggr, new String[] { "oid", "aggrId", "name", "type", "expression1", "expression2", "description" });
DefaultResult<AggregationMethodVO> result = this.aggregationMethodLogicService.update(aggr);
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.AggregationMethodVO in project bamboobsc by billchen198318.
the class AggregationMethodLogicServiceImpl method delete.
@ServiceMethodAuthority(type = { ServiceMethodType.DELETE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<Boolean> delete(AggregationMethodVO aggregationMethod) throws ServiceException, Exception {
if (null == aggregationMethod || super.isBlank(aggregationMethod.getOid())) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
AggregationMethodVO oldAggregationMethod = AggregationMethodUtils.findSimpleByOid(aggregationMethod.getOid());
Map<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("cal", oldAggregationMethod.getAggrId());
if (this.kpiService.countByParams(paramMap) > 0) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_CANNOT_DELETE));
}
return this.aggregationMethodService.deleteObject(aggregationMethod);
}
use of com.netsteadfast.greenstep.vo.AggregationMethodVO 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