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);
}
}
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);
}
}
}
}
}
}
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());
}
}
}
Aggregations