Search in sources :

Example 26 with ObjectiveVO

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);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 27 with ObjectiveVO

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;
    }
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO)

Example 28 with ObjectiveVO

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;
    }
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO)

Example 29 with ObjectiveVO

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;
    }
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO)

Example 30 with ObjectiveVO

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();
}
Also used : ControllerException(com.netsteadfast.greenstep.base.exception.ControllerException) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO)

Aggregations

ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)50 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)44 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)34 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)29 HashMap (java.util.HashMap)15 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)13 BscStructTreeObj (com.netsteadfast.greenstep.bsc.model.BscStructTreeObj)8 DateRangeScoreVO (com.netsteadfast.greenstep.vo.DateRangeScoreVO)8 ArrayList (java.util.ArrayList)7 Map (java.util.Map)7 LinkedList (java.util.LinkedList)6 Phrase (com.itextpdf.text.Phrase)4 PdfPCell (com.itextpdf.text.pdf.PdfPCell)4 ChainResultObj (com.netsteadfast.greenstep.base.model.ChainResultObj)4 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)4 Cell (org.apache.poi.ss.usermodel.Cell)4 Row (org.apache.poi.ss.usermodel.Row)4 CellRangeAddress (org.apache.poi.ss.util.CellRangeAddress)4 XSSFCellStyle (org.apache.poi.xssf.usermodel.XSSFCellStyle)4 XSSFColor (org.apache.poi.xssf.usermodel.XSSFColor)4