use of com.netsteadfast.greenstep.bsc.vo.SwotDataVO in project bamboobsc by billchen198318.
the class SwotDataProvideCommand method execute.
@Override
public boolean execute(Context context) throws Exception {
String visionOid = (String) context.get("visionOid");
String organizationOid = (String) context.get("organizationOid");
VisionVO vision = this.findVision(visionOid);
OrganizationVO organization = this.findOrganization(organizationOid);
if (StringUtils.isBlank(vision.getVisId()) || StringUtils.isBlank(organization.getOrgId())) {
this.setMessage(context, SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
return false;
}
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> orderParams = new HashMap<String, String>();
params.put("visId", vision.getVisId());
orderParams.put("perId", "asc");
List<BbPerspective> perspectives = this.perspectiveService.findListByParams(params, null, orderParams);
if (perspectives == null || perspectives.size() < 1) {
this.setMessage(context, SysMessageUtil.get(GreenStepSysMsgConstants.SEARCH_NO_DATA));
return false;
}
params.put("orgId", organization.getOrgId());
List<BbSwot> swots = this.swotService.findListByParams(params, null, orderParams);
SwotDataVO swotData = new SwotDataVO();
swotData.setVision(vision);
swotData.setOrganization(organization);
swotData.setContents(swots);
swotData.setPerspectives(perspectives);
this.initIssues(swotData, vision.getVisId(), organization.getOrgId());
this.setResult(context, swotData);
return false;
}
use of com.netsteadfast.greenstep.bsc.vo.SwotDataVO in project bamboobsc by billchen198318.
the class SwotReportPdfDataCommand method execute.
@Override
public boolean execute(Context context) throws Exception {
if (this.getResult(context) == null || !(this.getResult(context) instanceof SwotDataVO)) {
return false;
}
SwotDataVO swotData = (SwotDataVO) this.getResult(context);
String reportId = this.createReportData(swotData);
if (!StringUtils.isBlank(reportId)) {
this.setResult(context, reportId);
} else {
this.setMessage(context, "create report data fail!");
}
return false;
}
use of com.netsteadfast.greenstep.bsc.vo.SwotDataVO in project bamboobsc by billchen198318.
the class SwotBodyCommand method execute.
@Override
public boolean execute(Context context) throws Exception {
if (this.getResult(context) == null || !(this.getResult(context) instanceof SwotDataVO)) {
return false;
}
SwotDataVO swotData = (SwotDataVO) this.getResult(context);
Map<String, Object> parameter = new HashMap<String, Object>();
parameter.put("issues", swotData.getIssues());
parameter.put("vision", swotData.getVision());
parameter.put("organization", swotData.getOrganization());
parameter.put("strengthsName", String.valueOf(context.get("strengthsName")));
parameter.put("weaknessesName", String.valueOf(context.get("weaknessesName")));
parameter.put("opportunitiesName", String.valueOf(context.get("opportunitiesName")));
parameter.put("threatsName", String.valueOf(context.get("threatsName")));
String content = TemplateUtils.processTemplate("resourceTemplate", SwotBodyCommand.class.getClassLoader(), templateResource, parameter);
this.setResult(context, content);
return false;
}
Aggregations