Search in sources :

Example 31 with ChainResultObj

use of com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.

the class KpisDashboardAction method getExcel.

@SuppressWarnings("unchecked")
private void getExcel() throws ControllerException, AuthorityException, ServiceException, Exception {
    Context context = this.getContext();
    List<Map<String, Object>> chartDatas = (List<Map<String, Object>>) context.get("chartDatas");
    if (chartDatas == null || chartDatas.size() < 1) {
        throw new ServiceException("Please first query!");
    }
    SimpleChain chain = new SimpleChain();
    ChainResultObj resultObj = chain.getResultFromResource("kpisDashboardExcelContentChain", context);
    this.message = resultObj.getMessage();
    if (resultObj.getValue() instanceof String) {
        this.uploadOid = (String) resultObj.getValue();
        this.success = IS_YES;
    }
}
Also used : Context(org.apache.commons.chain.Context) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) SimpleChain(com.netsteadfast.greenstep.base.chain.SimpleChain) LinkedList(java.util.LinkedList) List(java.util.List) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Example 32 with ChainResultObj

use of com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.

the class PersonalReportContentQueryAction method getPdf.

private void getPdf() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    Context context = this.getChainContext();
    SimpleChain chain = new SimpleChain();
    ChainResultObj resultObj = chain.getResultFromResource("personalReportPdfContentChain", context);
    this.message = resultObj.getMessage();
    if (resultObj.getValue() instanceof String) {
        this.uploadOid = (String) resultObj.getValue();
        this.success = IS_YES;
    }
}
Also used : Context(org.apache.commons.chain.Context) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) SimpleChain(com.netsteadfast.greenstep.base.chain.SimpleChain)

Example 33 with ChainResultObj

use of com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.

the class PersonalReportContentQueryAction method getExcel.

private void getExcel() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    Context context = this.getChainContext();
    SimpleChain chain = new SimpleChain();
    ChainResultObj resultObj = chain.getResultFromResource("personalReportExcelContentChain", context);
    this.message = resultObj.getMessage();
    if (resultObj.getValue() instanceof String) {
        this.uploadOid = (String) resultObj.getValue();
        this.success = IS_YES;
    }
}
Also used : Context(org.apache.commons.chain.Context) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) SimpleChain(com.netsteadfast.greenstep.base.chain.SimpleChain)

Example 34 with ChainResultObj

use of com.netsteadfast.greenstep.base.model.ChainResultObj in project bamboobsc by billchen198318.

the class PdcaReportContentQueryAction method getContent.

@SuppressWarnings("unchecked")
private void getContent() throws ControllerException, AuthorityException, ServiceException, Exception {
    this.checkFields();
    Context pdcaContext = new ContextBase();
    pdcaContext.put("pdcaOid", this.getFields().get("pdcaOid"));
    SimpleChain chain = new SimpleChain();
    ChainResultObj pdcaReportObj = chain.getResultFromResource("pdcaReportHtmlContentChain", pdcaContext);
    List<ChainResultObj> bscReportResults = null;
    if ("true".equals(this.getFields().get("showBscReport"))) {
        bscReportResults = this.getBscReportContent("kpiReportHtmlContentChain");
    }
    if (pdcaReportObj.getValue() instanceof String) {
        this.body = String.valueOf(pdcaReportObj.getValue());
        this.pdca = (PdcaVO) pdcaContext.get("pdca");
    }
    this.message = super.defaultString(pdcaReportObj.getMessage()).trim();
    for (int i = 0; bscReportResults != null && i < bscReportResults.size(); i++) {
        ChainResultObj bscReportObj = bscReportResults.get(i);
        if (bscReportObj.getValue() instanceof String) {
            this.body += String.valueOf(bscReportObj.getValue());
        }
        if (!this.message.equals(bscReportObj.getMessage())) {
            if (!"".equals(this.message)) {
                this.message += super.getHtmlBr();
            }
            this.message += bscReportObj.getMessage();
        }
    }
    if (!StringUtils.isBlank(this.body)) {
        this.success = IS_YES;
    }
}
Also used : Context(org.apache.commons.chain.Context) ChainResultObj(com.netsteadfast.greenstep.base.model.ChainResultObj) SimpleChain(com.netsteadfast.greenstep.base.chain.SimpleChain) ContextBase(org.apache.commons.chain.impl.ContextBase)

Aggregations

ChainResultObj (com.netsteadfast.greenstep.base.model.ChainResultObj)34 SimpleChain (com.netsteadfast.greenstep.base.chain.SimpleChain)28 Context (org.apache.commons.chain.Context)27 ContextBase (org.apache.commons.chain.impl.ContextBase)8 BscStructTreeObj (com.netsteadfast.greenstep.bsc.model.BscStructTreeObj)7 VisionVO (com.netsteadfast.greenstep.vo.VisionVO)6 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)5 ArrayList (java.util.ArrayList)5 List (java.util.List)5 Map (java.util.Map)5 KpiVO (com.netsteadfast.greenstep.vo.KpiVO)4 ObjectiveVO (com.netsteadfast.greenstep.vo.ObjectiveVO)4 PerspectiveVO (com.netsteadfast.greenstep.vo.PerspectiveVO)4 LinkedHashMap (java.util.LinkedHashMap)4 LinkedList (java.util.LinkedList)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 ControllerException (com.netsteadfast.greenstep.base.exception.ControllerException)3 StrategyMapItemsVO (com.netsteadfast.greenstep.bsc.vo.StrategyMapItemsVO)3 HashMap (java.util.HashMap)3 AppContext (com.netsteadfast.greenstep.base.AppContext)2