Search in sources :

Example 1 with SwotDataVO

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;
}
Also used : HashMap(java.util.HashMap) BbSwot(com.netsteadfast.greenstep.po.hbm.BbSwot) SwotDataVO(com.netsteadfast.greenstep.bsc.vo.SwotDataVO) OrganizationVO(com.netsteadfast.greenstep.vo.OrganizationVO) BbPerspective(com.netsteadfast.greenstep.po.hbm.BbPerspective) VisionVO(com.netsteadfast.greenstep.vo.VisionVO)

Example 2 with SwotDataVO

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;
}
Also used : SwotDataVO(com.netsteadfast.greenstep.bsc.vo.SwotDataVO)

Example 3 with SwotDataVO

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;
}
Also used : HashMap(java.util.HashMap) SwotDataVO(com.netsteadfast.greenstep.bsc.vo.SwotDataVO)

Aggregations

SwotDataVO (com.netsteadfast.greenstep.bsc.vo.SwotDataVO)3 HashMap (java.util.HashMap)2 BbPerspective (com.netsteadfast.greenstep.po.hbm.BbPerspective)1 BbSwot (com.netsteadfast.greenstep.po.hbm.BbSwot)1 OrganizationVO (com.netsteadfast.greenstep.vo.OrganizationVO)1 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)1