use of com.netsteadfast.greenstep.vo.VisionVO 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 + ")";
}
use of com.netsteadfast.greenstep.vo.VisionVO in project bamboobsc by billchen198318.
the class ScorecardQueryContentAction method loadPerspectiveCardContent.
private void loadPerspectiveCardContent() throws ServiceException, Exception {
StringBuilder outContent = new StringBuilder();
this.message = SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA);
String uploadOid = this.getFields().get("uploadOid");
VisionVO vision = BscMobileCardUtils.getVisionCardFromUpload(uploadOid);
this.rootVision = vision;
List<PerspectiveVO> perspectives = vision.getPerspectives();
for (PerspectiveVO perspective : perspectives) {
outContent.append(BscMobileCardUtils.getPerspectivesCardContent(uploadOid, perspective));
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.VisionVO in project bamboobsc by billchen198318.
the class ScorecardQueryContentAction method loadObjectiveCardContent.
private void loadObjectiveCardContent() throws ServiceException, Exception {
StringBuilder outContent = new StringBuilder();
this.message = SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA);
String uploadOid = this.getFields().get("uploadOid");
String perspectiveOid = super.defaultString(this.getFields().get("perspectiveOid"));
VisionVO vision = BscMobileCardUtils.getVisionCardFromUpload(uploadOid);
List<PerspectiveVO> perspectives = vision.getPerspectives();
for (PerspectiveVO perspective : perspectives) {
if (perspectiveOid.equals(perspective.getOid())) {
this.rootPerspective = perspective;
List<ObjectiveVO> objectives = perspective.getObjectives();
for (ObjectiveVO objective : objectives) {
outContent.append(BscMobileCardUtils.getObjectivesCardContent(uploadOid, objective));
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.VisionVO in project bamboobsc by billchen198318.
the class KpiReportExcelCommand method createExcel.
private String createExcel(Context context) throws Exception {
String visionOid = (String) context.get("visionOid");
VisionVO vision = null;
BscStructTreeObj treeObj = (BscStructTreeObj) this.getResult(context);
for (VisionVO visionObj : treeObj.getVisions()) {
if (visionObj.getOid().equals(visionOid)) {
vision = visionObj;
}
}
BscReportPropertyUtils.loadData();
// 2015-04-18 add
BscReportSupportUtils.loadExpression();
String fileName = SimpleUtils.getUUIDStr() + ".xlsx";
String fileFullPath = Constants.getWorkTmpDir() + "/" + fileName;
int row = 24;
if (context.get("pieCanvasToData") == null || context.get("barCanvasToData") == null) {
row = 0;
}
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sh = wb.createSheet();
row += this.createHead(wb, sh, row, vision);
row = this.createMainBody(wb, sh, row, vision);
// 空一列
row = row + 1;
row = this.createDateRange(wb, sh, row, vision, context);
if (context.get("pieCanvasToData") != null && context.get("barCanvasToData") != null) {
this.putCharts(wb, sh, context);
}
this.putSignature(wb, sh, row + 1, context);
FileOutputStream out = new FileOutputStream(fileFullPath);
wb.write(out);
out.close();
wb = null;
File file = new File(fileFullPath);
String oid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, file, "kpi-report.xlsx");
file = null;
return oid;
}
use of com.netsteadfast.greenstep.vo.VisionVO in project bamboobsc by billchen198318.
the class KpiDateRangeScoreCommand method execute.
/*
private static final String QUARTER_1 = "Q1";
private static final String QUARTER_2 = "Q2";
private static final String QUARTER_3 = "Q3";
private static final String QUARTER_4 = "Q4";
private static final String HALF_YEAR_FIRST = "first";
private static final String HALF_YEAR_LAST = "last";
*/
@Override
public boolean execute(Context context) throws Exception {
if (this.getResult(context) == null || !(this.getResult(context) instanceof BscStructTreeObj)) {
return false;
}
BscStructTreeObj treeObj = (BscStructTreeObj) this.getResult(context);
String frequency = (String) context.get("frequency");
String startYearDate = StringUtils.defaultString((String) context.get("startYearDate")).trim();
String endYearDate = StringUtils.defaultString((String) context.get("endYearDate")).trim();
String startDate = StringUtils.defaultString((String) context.get("startDate")).trim();
String endDate = StringUtils.defaultString((String) context.get("endDate")).trim();
//long beg = System.currentTimeMillis();
for (VisionVO vision : treeObj.getVisions()) {
for (PerspectiveVO perspective : vision.getPerspectives()) {
for (ObjectiveVO objective : perspective.getObjectives()) {
// 2015-04-11 add
ExecutorService kpiCalculationPool = Executors.newFixedThreadPool(SimpleUtils.getAvailableProcessors(objective.getKpis().size()));
for (KpiVO kpi : objective.getKpis()) {
/* 2015-04-11 rem
if (BscMeasureDataFrequency.FREQUENCY_DAY.equals(frequency)
|| BscMeasureDataFrequency.FREQUENCY_WEEK.equals(frequency)
|| BscMeasureDataFrequency.FREQUENCY_MONTH.equals(frequency) ) {
this.fillDateRangeMonth(kpi, frequency, startDate, endDate);
} else {
this.fillDateRangeYear(kpi, frequency, startYearDate, endYearDate);
}
*/
// 2015-04-11 add
ScoreCalculationCallableData data = new ScoreCalculationCallableData();
data.setDefaultMode(false);
data.setKpi(kpi);
data.setFrequency(frequency);
data.setDate1(startYearDate);
data.setDate2(endYearDate);
if (BscMeasureDataFrequency.FREQUENCY_DAY.equals(frequency) || BscMeasureDataFrequency.FREQUENCY_WEEK.equals(frequency) || BscMeasureDataFrequency.FREQUENCY_MONTH.equals(frequency)) {
data.setDate1(startDate);
data.setDate2(endDate);
}
data = kpiCalculationPool.submit(new ScoreCalculationCallable(data)).get();
}
kpiCalculationPool.shutdown();
}
}
}
//System.out.println( this.getClass().getName() + " use time(MS) = " + (end-beg) );
return false;
}
Aggregations