use of com.netsteadfast.greenstep.bsc.model.BscStructTreeObj in project bamboobsc by billchen198318.
the class LoadStrategyMapItemsForRecCommand method execute.
@Override
public boolean execute(Context context) throws ServiceException, Exception {
if (this.getResult(context) == null || !(this.getResult(context) instanceof BscStructTreeObj)) {
return false;
}
BscStructTreeObj treeObj = (BscStructTreeObj) this.getResult(context);
String visionOid = (String) context.get("visionOid");
VisionVO vision = null;
for (VisionVO obj : treeObj.getVisions()) {
if (obj.getOid().equals(visionOid)) {
vision = obj;
}
}
StrategyMapItemsVO mapItems = this.fillStrategyMapItems(vision, context);
this.setResult(context, mapItems);
return false;
}
use of com.netsteadfast.greenstep.bsc.model.BscStructTreeObj in project bamboobsc by billchen198318.
the class OrganizationReportBodyCommand method execute.
@Override
public boolean execute(Context context) throws Exception {
if (this.getResult(context) == null || !(this.getResult(context) instanceof BscStructTreeObj)) {
return false;
}
String dateType = (String) context.get("dateType");
String orgId = (String) context.get("orgId");
BscStructTreeObj treeObj = (BscStructTreeObj) this.getResult(context);
Map<String, Object> parameter = new HashMap<String, Object>();
parameter.put("treeObj", treeObj);
parameter.put("dateType", dateType);
parameter.put("year", (String) context.get("startYearDate"));
parameter.put("departmentName", " ");
parameter.put("departmentOid", " ");
parameter.put("total", 0.0f);
if (context.get("total") != null && context.get("total") instanceof Float) {
parameter.put("total", context.get("total"));
}
OrganizationVO organization = new OrganizationVO();
organization.setOrgId(orgId);
DefaultResult<OrganizationVO> result = this.organizationService.findByUK(organization);
if (result.getValue() != null) {
organization = result.getValue();
parameter.put("departmentName", organization.getName());
parameter.put("departmentOid", organization.getOid());
}
this.fillReportProperty(parameter);
String content = TemplateUtils.processTemplate("resourceTemplate", OrganizationReportBodyCommand.class.getClassLoader(), templateResource, parameter);
this.setResult(context, content);
return false;
}
use of com.netsteadfast.greenstep.bsc.model.BscStructTreeObj in project bamboobsc by billchen198318.
the class OrganizationReportPdfCommand method createPdf.
private String createPdf(Context context) throws Exception {
BscReportPropertyUtils.loadData();
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;
}
}
FontFactory.register(BscConstants.PDF_ITEXT_FONT);
String fileName = UUID.randomUUID().toString() + ".pdf";
String fileFullPath = Constants.getWorkTmpDir() + "/" + fileName;
OutputStream os = new FileOutputStream(fileFullPath);
Document document = new Document(PageSize.A4.rotate(), 10, 10, 10, 10);
document.left(100f);
document.top(150f);
PdfWriter writer = PdfWriter.getInstance(document, os);
document.open();
PdfPTable table = new PdfPTable(MAX_COLSPAN);
table.setWidthPercentage(100f);
PdfPTable signTable = new PdfPTable(1);
signTable.setWidthPercentage(100f);
this.createHead(table, vision, context);
this.createBody(table, vision);
this.putSignature(signTable, context);
document.add(table);
document.add(signTable);
document.close();
writer.close();
os.flush();
os.close();
os = null;
File file = new File(fileFullPath);
String oid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, file, "department-report.pdf");
file = null;
return oid;
}
use of com.netsteadfast.greenstep.bsc.model.BscStructTreeObj in project bamboobsc by billchen198318.
the class LoadBscStructTreeCommand method execute.
@SuppressWarnings("unchecked")
@Override
public boolean execute(Context context) throws Exception {
if (this.getResult(context) == null || !(this.getResult(context) instanceof List)) {
return false;
}
List<BscMixDataVO> mixDatas = (List<BscMixDataVO>) this.getResult(context);
BscStructTreeObj treeObj = this.processTree(mixDatas);
this.calculateRowspan(treeObj);
this.setResult(context, treeObj);
context.put("treeObj", treeObj);
return false;
}
use of com.netsteadfast.greenstep.bsc.model.BscStructTreeObj in project bamboobsc by billchen198318.
the class LoadBscStructTreeCommand method processTree.
private BscStructTreeObj processTree(List<BscMixDataVO> mixDatas) throws Exception {
BscStructTreeObj treeObj = new BscStructTreeObj();
treeObj.setBscMixDatas(mixDatas);
this.processVision(treeObj, mixDatas);
this.processPerspective(treeObj, mixDatas);
this.processObjective(treeObj, mixDatas);
this.processKpi(treeObj, mixDatas);
return treeObj;
}
Aggregations