Search in sources :

Example 1 with KpiAttacVO

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

the class KpiLogicServiceImpl method createKpiAttachment.

private void createKpiAttachment(KpiVO kpi, List<String> attachment) throws ServiceException, Exception {
    if (kpi == null || attachment == null || attachment.size() < 1) {
        return;
    }
    for (String uploadOid : attachment) {
        SysUploadVO upload = this.findUploadDataForNoByteContent(uploadOid);
        if (!(upload.getSystem().equals(Constants.getSystem()) && upload.getType().equals(UploadTypes.IS_TEMP))) {
            throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.DATA_ERRORS));
        }
        KpiAttacVO attac = new KpiAttacVO();
        attac.setKpiId(kpi.getId());
        attac.setUploadOid(uploadOid);
        attac.setViewMode(UploadSupportUtils.getViewMode(upload.getShowName()));
        DefaultResult<KpiAttacVO> result = this.kpiAttacService.saveObject(attac);
        if (result.getValue() == null) {
            throw new ServiceException(result.getSystemMessage().getValue());
        }
        //this.sysUploadService.updateTypeOnly(uploadOid, UploadTypes.IS_KPI_DOCUMENT);
        UploadSupportUtils.updateType(uploadOid, UploadTypes.IS_KPI_DOCUMENT);
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysUploadVO(com.netsteadfast.greenstep.vo.SysUploadVO) KpiAttacVO(com.netsteadfast.greenstep.vo.KpiAttacVO)

Example 2 with KpiAttacVO

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

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

the class KpiManagementAction method loadKpiData.

private void loadKpiData() throws ServiceException, Exception {
    this.transformFields2ValueObject(this.kpi, new String[] { "oid" });
    DefaultResult<KpiVO> result = this.kpiService.findObjectByOid(this.kpi);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.kpi = result.getValue();
    this.handlerSelectValueForEdit();
    this.handlerKpiOrgaAndEmplForEdit();
    Map<String, Object> paramMap = new HashMap<String, Object>();
    paramMap.put("kpiId", this.kpi.getId());
    this.kpiAttac = this.kpiAttacService.findListVOByParams(paramMap);
    for (int i = 0; this.kpiAttac != null && i < this.kpiAttac.size(); i++) {
        KpiAttacVO attac = this.kpiAttac.get(i);
        attac.setShowName("unknown-" + attac.getUploadOid());
        DefaultResult<SysUploadVO> upResult = this.sysUploadService.findForNoByteContent(attac.getUploadOid());
        if (upResult.getValue() != null) {
            attac.setShowName(upResult.getValue().getShowName());
        }
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) HashMap(java.util.HashMap) KpiVO(com.netsteadfast.greenstep.vo.KpiVO) SysUploadVO(com.netsteadfast.greenstep.vo.SysUploadVO) KpiAttacVO(com.netsteadfast.greenstep.vo.KpiAttacVO)

Aggregations

KpiAttacVO (com.netsteadfast.greenstep.vo.KpiAttacVO)3 SysUploadVO (com.netsteadfast.greenstep.vo.SysUploadVO)3 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)2 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)2 HashMap (java.util.HashMap)2 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)1 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)1 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)1