use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class LoadStrategyMapItemsForNewCommand method fillStrategyMapItems.
private StrategyMapItemsVO fillStrategyMapItems(VisionVO vision) throws Exception {
StrategyMapItemsVO mapItems = new StrategyMapItemsVO();
int w = 190;
int top = 10;
for (PerspectiveVO perspective : vision.getPerspectives()) {
int left = 10;
for (ObjectiveVO objective : perspective.getObjectives()) {
String idName = objective.getObjId();
/**
* 1em = 16px
*
* <div class="w" id="phone1">PHONE INTERVIEW 1<div class="ep"></div></div>
* #phone1 { left:35em; top:12em; width:7em; }
*
*/
String div = "<div class=\"w\" id=\"" + idName + "\">" + objective.getName() + "<div class=\"ep\"></div></div>";
String css = "#" + idName + " { left:" + left + "px; top:" + top + "px; width:" + w + "px; }";
mapItems.getDiv().add(div);
mapItems.getCss().add(css);
left += (w + 80);
}
top += 120;
}
return mapItems;
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class WeightLogicServiceImpl method update.
@ServiceMethodAuthority(type = { ServiceMethodType.UPDATE })
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = { RuntimeException.class, IOException.class, Exception.class })
@Override
public DefaultResult<Boolean> update(List<PerspectiveVO> perspectives, List<ObjectiveVO> objectives, List<KpiVO> kpis) throws ServiceException, Exception {
if (perspectives == null || perspectives.size() < 1 || objectives == null || objectives.size() < 1 || kpis == null || kpis.size() < 1) {
throw new ServiceException(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
for (PerspectiveVO perspective : perspectives) {
BbPerspective entity = this.perspectiveService.findByPKng(perspective.getOid());
entity.setWeight(perspective.getWeight());
this.perspectiveService.update(entity);
}
for (ObjectiveVO objective : objectives) {
BbObjective entity = this.objectiveService.findByPKng(objective.getOid());
entity.setWeight(objective.getWeight());
this.objectiveService.update(entity);
}
for (KpiVO kpi : kpis) {
BbKpi entity = this.kpiService.findByPKng(kpi.getOid());
entity.setWeight(kpi.getWeight());
this.kpiService.update(entity);
}
DefaultResult<Boolean> result = new DefaultResult<Boolean>();
result.setSystemMessage(new SystemMessage(SysMessageUtil.get(GreenStepSysMsgConstants.UPDATE_SUCCESS)));
result.setValue(Boolean.TRUE);
return result;
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class BscMobileCardUtils method getVisionCard.
public static List<VisionVO> getVisionCard(String frequency, String startDate, String endDate) throws ServiceException, Exception {
List<VisionVO> visionScores = new ArrayList<VisionVO>();
Map<String, String> visions = visionService.findForMap(false);
if (null == visions || visions.size() < 1) {
return visionScores;
}
Context context = new ContextBase();
context.put("startDate", startDate);
context.put("endDate", endDate);
context.put("startYearDate", startDate.substring(0, 4));
context.put("endYearDate", endDate.substring(0, 4));
context.put("frequency", frequency);
context.put("dataFor", BscConstants.MEASURE_DATA_FOR_ALL);
context.put("orgId", BscConstants.MEASURE_DATA_ORGANIZATION_FULL);
context.put("empId", BscConstants.MEASURE_DATA_EMPLOYEE_FULL);
for (Map.Entry<String, String> entry : visions.entrySet()) {
String visionOid = entry.getKey();
context.put("visionOid", visionOid);
SimpleChain chain = new SimpleChain();
ChainResultObj resultObj = chain.getResultFromResource("performanceScoreChain", context);
BscStructTreeObj treeObj = (BscStructTreeObj) resultObj.getValue();
for (int i = 0; treeObj.getVisions() != null && i < treeObj.getVisions().size(); i++) {
VisionVO vision = treeObj.getVisions().get(i);
vision.setContent(" ".getBytes());
DefaultResult<VisionVO> vResult = visionService.findObjectByOid(vision);
if (vResult.getValue() != null) {
// 計算分數chain 取出的vision資料沒有放 content 欄位, 但這邊要用到, 所以取出content欄位
vision.setContent(new String(vResult.getValue().getContent(), Constants.BASE_ENCODING).getBytes());
}
for (PerspectiveVO perspective : vision.getPerspectives()) {
for (ObjectiveVO objective : perspective.getObjectives()) {
for (KpiVO kpi : objective.getKpis()) {
// 產生報表不需要以下欄位
kpi.getAggregationMethod().setDescription(" ");
kpi.getAggregationMethod().setExpression1(" ");
kpi.getAggregationMethod().setExpression2(" ");
kpi.getFormula().setExpression(" ");
}
}
}
visionScores.add(vision);
}
}
return visionScores;
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class HistoryItemScoreReportContentQueryUtils method getBasicDataList.
private static List<VisionVO> getBasicDataList() throws ServiceException, Exception {
List<VisionVO> visions = new LinkedList<VisionVO>();
List<VisionVO> visionsTempList = new ArrayList<VisionVO>();
Map<String, String> visionMap = visionService.findForMap(false);
for (Map.Entry<String, String> visionEntry : visionMap.entrySet()) {
DefaultResult<VisionVO> visionResult = visionService.findForSimple(visionEntry.getKey());
if (visionResult.getValue() == null) {
throw new ServiceException(visionResult.getSystemMessage().getValue());
}
VisionVO vision = visionResult.getValue();
visionsTempList.add(vision);
}
Map<String, Object> paramMap = new HashMap<String, Object>();
for (VisionVO vision : visionsTempList) {
paramMap.clear();
paramMap.put("visId", vision.getVisId());
List<PerspectiveVO> perspectivesList = perspectiveService.findListVOByParams(paramMap);
for (int p = 0; perspectivesList != null && p < perspectivesList.size(); p++) {
PerspectiveVO perspective = perspectivesList.get(p);
vision.getPerspectives().add(perspective);
paramMap.clear();
paramMap.put("perId", perspective.getPerId());
List<ObjectiveVO> objectivesList = objectiveService.findListVOByParams(paramMap);
for (int o = 0; objectivesList != null && o < objectivesList.size(); o++) {
ObjectiveVO objective = objectivesList.get(o);
perspective.getObjectives().add(objective);
paramMap.clear();
paramMap.put("objId", objective.getObjId());
List<KpiVO> kpiList = kpiService.findListVOByParams(paramMap);
if (kpiList != null && kpiList.size() > 0) {
objective.getKpis().addAll(kpiList);
}
}
}
}
// 必須有 KPI 才能放到回傳的 visions
for (int v = 0; v < visionsTempList.size(); v++) {
boolean isFoundData = true;
VisionVO vision = visionsTempList.get(v);
for (int p = 0; p < vision.getPerspectives().size() && isFoundData; p++) {
PerspectiveVO perspective = vision.getPerspectives().get(p);
for (int o = 0; o < perspective.getObjectives().size() && isFoundData; o++) {
ObjectiveVO objective = perspective.getObjectives().get(o);
if (objective.getKpis() == null || objective.getKpis().size() < 1) {
isFoundData = false;
}
}
}
if (isFoundData) {
visions.add(vision);
}
}
return visions;
}
use of com.netsteadfast.greenstep.vo.ObjectiveVO in project bamboobsc by billchen198318.
the class HistoryItemScoreReportContentQueryUtils method getItemNameWithVisionGroup.
private static String getItemNameWithVisionGroup(String itemType, String id, String name, List<VisionVO> basicDataList) throws Exception {
if (basicDataList.size() < 2) {
// 沒有1筆以上的 vision 資料, 不需要組出 group 字串
return name;
}
String groupStr = "";
for (int v = 0; v < basicDataList.size() && "".equals(groupStr); v++) {
int group = v + 1;
VisionVO vision = basicDataList.get(v);
if (MonitorItemType.VISION.equals(itemType) && id.equals(vision.getVisId())) {
groupStr = String.valueOf(group);
}
for (int p = 0; p < vision.getPerspectives().size() && "".equals(groupStr); p++) {
PerspectiveVO perspective = vision.getPerspectives().get(p);
if (MonitorItemType.PERSPECTIVES.equals(itemType) && id.equals(perspective.getPerId())) {
groupStr = String.valueOf(group);
}
for (int o = 0; o < perspective.getObjectives().size() && "".equals(groupStr); o++) {
ObjectiveVO objective = perspective.getObjectives().get(o);
if (MonitorItemType.STRATEGY_OF_OBJECTIVES.equals(itemType) && id.equals(objective.getObjId())) {
groupStr = String.valueOf(group);
}
for (int k = 0; k < objective.getKpis().size() && "".equals(groupStr); k++) {
KpiVO kpi = objective.getKpis().get(k);
if (MonitorItemType.KPI.equals(itemType) && id.equals(kpi.getId())) {
groupStr = String.valueOf(group);
}
}
}
}
}
if ("".equals(groupStr)) {
return name;
}
return name + "(" + groupStr + ")";
}
Aggregations