use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class ObjectiveLogicServiceImpl method update.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<ObjectiveVO> update(ObjectiveVO objective, String perspectiveOid) throws ServiceException, Exception {
if (null == objective || super.isBlank(objective.getOid()) || super.isBlank(perspectiveOid)) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
DefaultResult<ObjectiveVO> oldResult = this.objectiveService.findObjectByOid(objective);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
PerspectiveVO perspective = new PerspectiveVO();
perspective.setOid(perspectiveOid);
DefaultResult<PerspectiveVO> pResult = this.perspectiveService.findObjectByOid(perspective);
if (pResult.getValue() == null) {
throw new ServiceException(pResult.getSystemMessage().getValue());
}
perspective = pResult.getValue();
objective.setObjId(oldResult.getValue().getObjId());
objective.setPerId(perspective.getPerId());
this.setStringValueMaxLength(objective, "description", MAX_DESCRIPTION_LENGTH);
return this.objectiveService.updateObject(objective);
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class ObjectiveSaveOrUpdateAction method save.
private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
ObjectiveVO objective = new ObjectiveVO();
this.transformFields2ValueObject(objective, new String[] { "name", "weight", "target", "min", "description" });
DefaultResult<ObjectiveVO> result = this.objectiveLogicService.create(objective, this.getFields().get("perspectiveOid"));
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class ObjectiveSaveOrUpdateAction method delete.
private void delete() throws ControllerException, AuthorityException, ServiceException, Exception {
ObjectiveVO objective = new ObjectiveVO();
this.transformFields2ValueObject(objective, new String[] { "oid" });
DefaultResult<Boolean> result = this.objectiveLogicService.delete(objective);
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null && result.getValue()) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class ObjectiveSaveOrUpdateAction method update.
private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
ObjectiveVO objective = new ObjectiveVO();
this.transformFields2ValueObject(objective, new String[] { "oid", "name", "weight", "target", "min", "description" });
DefaultResult<ObjectiveVO> result = this.objectiveLogicService.update(objective, this.getFields().get("perspectiveOid"));
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class StrategyMapManagementAction method loadObjectiveItem.
private void loadObjectiveItem() throws ControllerException, ServiceException, Exception {
// 這裡的 fields.oid 放的是 BB_OBJECTIVE.OBJ_ID
String objId = super.defaultString(super.getFields().get("oid")).trim();
if (StringUtils.isBlank(objId)) {
throw new ControllerException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
this.objective = new ObjectiveVO();
this.objective.setObjId(objId);
DefaultResult<ObjectiveVO> result = this.objectiveService.findByUK(this.objective);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
this.objective = result.getValue();
PerspectiveVO perspective = new PerspectiveVO();
perspective.setPerId(this.objective.getPerId());
DefaultResult<PerspectiveVO> pResult = this.perspectiveService.findByUK(perspective);
if (pResult.getValue() == null) {
throw new ServiceException(pResult.getSystemMessage().getValue());
}
perspective = pResult.getValue();
DefaultResult<VisionVO> vResult = this.visionService.findForSimpleByVisId(perspective.getVisId());
if (vResult.getValue() == null) {
throw new ServiceException(vResult.getSystemMessage().getValue());
}
VisionVO vision = vResult.getValue();
this.visionOid = vision.getOid();
}
Aggregations