use of com.netsteadfast.greenstep.po.hbm.BbObjective in project bamboobsc by billchen198318.
the class WeightLogicServiceImpl method update.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<Boolean> update(List<PerspectiveVO> perspectives, List<ObjectiveVO> objectives, List<KpiVO> kpis) throws ServiceException, Exception {
if (perspectives == null || perspectives.size() < 1 || objectives == null || objectives.size() < 1 || kpis == null || kpis.size() < 1) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
for (PerspectiveVO perspective : perspectives) {
BbPerspective entity = this.perspectiveService.findByPKng(perspective.getOid());
entity.setWeight(perspective.getWeight());
this.perspectiveService.update(entity);
}
for (ObjectiveVO objective : objectives) {
BbObjective entity = this.objectiveService.findByPKng(objective.getOid());
entity.setWeight(objective.getWeight());
this.objectiveService.update(entity);
}
for (KpiVO kpi : kpis) {
BbKpi entity = this.kpiService.findByPKng(kpi.getOid());
entity.setWeight(kpi.getWeight());
this.kpiService.update(entity);
}
DefaultResult<Boolean> result = new DefaultResult<Boolean>();
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_SUCCESS)));
result.setValue(Boolean.TRUE);
return result;
}
Aggregations