Esempio n. 1
0
 private void processRelateConditions() {
   List<String> lstAllConditionNames = new ArrayList<String>();
   Set<String> sRelateConditionNames = new HashSet<String>();
   getAllRelateConditions(this, lstAllConditionNames, sRelateConditionNames);
   if (sRelateConditionNames.size() == 0) return;
   Map<String, List<ReportBean>> mRelateConReportBeans = new HashMap<String, List<ReportBean>>();
   getAllRelateConditionReportBeans(this, sRelateConditionNames, mRelateConReportBeans);
   for (Entry<String, List<ReportBean>> entryTmp :
       mRelateConReportBeans.entrySet()) { // 处理每个关联查询条件对应的报表
     updateRefreshContaineridForReportBeans(entryTmp.getValue());
     updateRelateReportidsForReportBeans(entryTmp.getValue());
   }
 }
Esempio n. 2
0
 private void getAllRelateConditions(
     AbsContainerConfigBean containerBean,
     List<String> lstAllConditionNames,
     Set<String> sRelateConditionNames) {
   List<String> lstConNames;
   for (Entry<String, IComponentConfigBean> entryTmp : containerBean.getMChildren().entrySet()) {
     if (entryTmp.getValue() instanceof ReportBean) {
       ReportBean rbeanTmp = (ReportBean) entryTmp.getValue();
       if (rbeanTmp.getSbean() == null || rbeanTmp.getSbean().getLstConditions() == null) continue;
       List<ConditionBean> lstConditions = rbeanTmp.getSbean().getLstConditions();
       lstConNames = new ArrayList<String>();
       for (ConditionBean cbean : lstConditions) {
         if (cbean == null) continue;
         if (lstConNames.contains(cbean.getName())) {
           throw new WabacusConfigLoadingException(
               "报表"
                   + rbeanTmp.getPath()
                   + "中存在多个name属性为"
                   + cbean.getName()
                   + "的查询条件,同一个报表下的所有<condition/>的name属性必须唯一");
         }
         lstConNames.add(cbean.getName());
         if (!cbean.isConditionValueFromUrl()) continue;
         if (lstAllConditionNames.contains(cbean.getName())) {
           sRelateConditionNames.add(cbean.getName());
         } else {
           lstAllConditionNames.add(cbean.getName());
         }
       }
     } else if (entryTmp.getValue() instanceof AbsContainerConfigBean) {
       getAllRelateConditions(
           (AbsContainerConfigBean) entryTmp.getValue(),
           lstAllConditionNames,
           sRelateConditionNames);
     }
   }
 }