Search in sources :

Example 26 with PerspectiveVO

use of com.netsteadfast.greenstep.vo.PerspectiveVO in project bamboobsc by billchen198318.

the class KpiReportBodyCommand method setImgIconBaseAndKpiInfo.

private void setImgIconBaseAndKpiInfo(BscStructTreeObj treeObj) throws ServiceException, Exception {
    BscReportSupportUtils.loadExpression();
    List<VisionVO> visions = treeObj.getVisions();
    Map<String, Object> paramMap = new HashMap<String, Object>();
    for (VisionVO vision : visions) {
        for (PerspectiveVO perspective : vision.getPerspectives()) {
            perspective.setImgIcon(BscReportSupportUtils.getHtmlIconBase("PERSPECTIVES", perspective.getTarget(), perspective.getMin(), perspective.getScore(), "", "", 0));
            for (ObjectiveVO objective : perspective.getObjectives()) {
                objective.setImgIcon(BscReportSupportUtils.getHtmlIconBase("OBJECTIVES", objective.getTarget(), objective.getMin(), objective.getScore(), "", "", 0));
                for (KpiVO kpi : objective.getKpis()) {
                    kpi.setImgIcon(BscReportSupportUtils.getHtmlIconBase("KPI", kpi.getTarget(), kpi.getMin(), kpi.getScore(), kpi.getCompareType(), kpi.getManagement(), kpi.getQuasiRange()));
                    BscReportSupportUtils.fillKpiEmployees(kpi);
                    BscReportSupportUtils.fillKpiOrganizations(kpi);
                    // KPI attachment documents
                    paramMap.clear();
                    paramMap.put("kpiId", kpi.getId());
                    List<KpiAttacVO> attacs = kpiAttacService.findListVOByParams(paramMap);
                    for (int i = 0; attacs != null && i < attacs.size(); i++) {
                        KpiAttacVO attac = attacs.get(i);
                        DefaultResult<SysUploadVO> uploadResult = sysUploadService.findForNoByteContent(attac.getUploadOid());
                        if (uploadResult.getValue() != null) {
                            attac.setShowName(uploadResult.getValue().getShowName());
                        } else {
                            attac.setShowName("unknown-" + attac.getUploadOid());
                        }
                        kpi.getAttachments().add(attac);
                    }
                }
            }
        }
    }
}
Also used : HashMap(java.util.HashMap) ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) SysUploadVO(com.netsteadfast.greenstep.vo.SysUploadVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO) KpiAttacVO(com.netsteadfast.greenstep.vo.KpiAttacVO)

Example 27 with PerspectiveVO

use of com.netsteadfast.greenstep.vo.PerspectiveVO in project bamboobsc by billchen198318.

the class ScorecardQueryContentAction method loadKpiCardContent.

private void loadKpiCardContent() throws ServiceException, Exception {
    StringBuilder outContent = new StringBuilder();
    this.message = SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA);
    String uploadOid = this.getFields().get("uploadOid");
    String objectiveOid = super.defaultString(this.getFields().get("objectiveOid"));
    VisionVO vision = BscMobileCardUtils.getVisionCardFromUpload(uploadOid);
    List<PerspectiveVO> perspectives = vision.getPerspectives();
    for (PerspectiveVO perspective : perspectives) {
        List<ObjectiveVO> objectives = perspective.getObjectives();
        for (ObjectiveVO objective : objectives) {
            if (objectiveOid.equals(objective.getOid())) {
                this.rootPerspective = perspective;
                this.rootObjective = objective;
                List<KpiVO> kpis = objective.getKpis();
                for (KpiVO kpi : kpis) {
                    outContent.append(BscMobileCardUtils.getKPIsCardContent(uploadOid, kpi));
                    outContent.append(super.getHtmlBr());
                }
            }
        }
    }
    this.content = outContent.toString();
    if (!StringUtils.isBlank(content)) {
        this.loadColor();
        this.message = this.getText("MESSAGE.ScorecardQueryContentAction_06");
        this.success = IS_YES;
    }
}
Also used : ObjectiveVO(com.netsteadfast.greenstep.vo.ObjectiveVO) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO)

Example 28 with PerspectiveVO

use of com.netsteadfast.greenstep.vo.PerspectiveVO 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 29 with PerspectiveVO

use of com.netsteadfast.greenstep.vo.PerspectiveVO in project bamboobsc by billchen198318.

the class PerspectiveLogicServiceImpl method update.

@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<PerspectiveVO> update(PerspectiveVO perspective, String visionOid) throws ServiceException, Exception {
    if (null == perspective || super.isBlank(perspective.getOid()) || super.isBlank(visionOid)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    DefaultResult<PerspectiveVO> oldResult = this.perspectiveService.findObjectByOid(perspective);
    if (oldResult.getValue() == null) {
        throw new ServiceException(oldResult.getSystemMessage().getValue());
    }
    DefaultResult<VisionVO> vResult = this.visionService.findForSimple(visionOid);
    if (vResult.getValue() == null) {
        throw new ServiceException(vResult.getSystemMessage().getValue());
    }
    VisionVO vision = vResult.getValue();
    perspective.setVisId(vision.getVisId());
    perspective.setPerId(oldResult.getValue().getPerId());
    this.setStringValueMaxLength(perspective, "description", MAX_DESCRIPTION_LENGTH);
    return this.perspectiveService.updateObject(perspective);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) VisionVO(com.netsteadfast.greenstep.vo.VisionVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Example 30 with PerspectiveVO

use of com.netsteadfast.greenstep.vo.PerspectiveVO in project bamboobsc by billchen198318.

the class ObjectiveLogicServiceImpl method create.

@ServiceMethodAuthority(type = { ServiceMethodType.INSERT })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<ObjectiveVO> create(ObjectiveVO objective, String perspectiveOid) throws ServiceException, Exception {
    if (null == objective || super.isBlank(perspectiveOid)) {
        throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
    }
    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.setPerId(perspective.getPerId());
    if (!SimpleUtils.checkBeTrueOf_azAZ09(4, 14, objective.getObjId())) {
        // for import-mode from csv file OBJ_ID is old(before id).
        objective.setObjId(this.findForMaxObjId(SimpleUtils.getStrYMD("")));
    }
    this.setStringValueMaxLength(objective, "description", MAX_DESCRIPTION_LENGTH);
    return this.objectiveService.saveObject(objective);
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) PerspectiveVO(com.netsteadfast.greenstep.vo.PerspectiveVO) ServiceMethodAuthority(com.netsteadfast.greenstep.base.model.ServiceMethodAuthority) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)58 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)44 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)38 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)33 HashMap (java.util.HashMap)17 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)15 BscStructTreeObj (com.netsteadfast.greenstep.bsc.model.BscStructTreeObj)8 DateRangeScoreVO (com.netsteadfast.greenstep.vo.DateRangeScoreVO)8 LinkedList (java.util.LinkedList)8 Map (java.util.Map)8 ServiceMethodAuthority (com.netsteadfast.greenstep.base.model.ServiceMethodAuthority)6 ArrayList (java.util.ArrayList)6 Transactional (org.springframework.transaction.annotation.Transactional)6 Phrase (com.itextpdf.text.Phrase)4 PdfPCell (com.itextpdf.text.pdf.PdfPCell)4 ChainResultObj (com.netsteadfast.greenstep.base.model.ChainResultObj)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