Search in sources :

Example 46 with Context

use of org.apache.commons.chain.Context in project bamboobsc by billchen198318.

the class PdcaReportContentQueryAction method getBscReportChainContext.

@SuppressWarnings("unchecked")
private Context getBscReportChainContext(String pdcaOid, String visionOid, PdcaMeasureFreqVO measureFreq) throws Exception {
    Context context = new ContextBase();
    context.put("visionOid", visionOid);
    context.put("startDate", SimpleUtils.getStrYMD(measureFreq.getStartDate(), "/"));
    context.put("endDate", SimpleUtils.getStrYMD(measureFreq.getEndDate(), "/"));
    context.put("startYearDate", SimpleUtils.getStrYMD(measureFreq.getStartDate(), "/"));
    context.put("endYearDate", SimpleUtils.getStrYMD(measureFreq.getEndDate(), "/"));
    context.put("frequency", measureFreq.getFreq());
    context.put("dataFor", measureFreq.getDataType());
    context.put("orgId", measureFreq.getOrgId());
    context.put("empId", measureFreq.getEmpId());
    context.put("account", "");
    context.put("ngVer", YesNo.NO);
    List<String> kpiIds = new ArrayList<String>();
    Map<String, Object> paramMap = new HashMap<String, Object>();
    paramMap.put("pdcaOid", pdcaOid);
    List<BbPdcaKpis> pdcaKpisList = this.pdcaKpisService.findListByParams(paramMap);
    for (BbPdcaKpis pdcaKpi : pdcaKpisList) {
        kpiIds.add(pdcaKpi.getKpiId());
    }
    // 只顯示,要顯示的KPI
    context.put("kpiIds", kpiIds);
    return context;
}
Also used : Context(org.apache.commons.chain.Context) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) BbPdcaKpis(com.netsteadfast.greenstep.po.hbm.BbPdcaKpis) ContextBase(org.apache.commons.chain.impl.ContextBase)

Aggregations

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