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