예제 #1
0
 private void getAllRelateConditionReportBeans(
     AbsContainerConfigBean containerBean,
     Set<String> sRelateConditionNames,
     Map<String, List<ReportBean>> mRelateConReportBeans) {
   IComponentConfigBean childBeanTmp;
   for (Entry<String, IComponentConfigBean> entryTmp : containerBean.getMChildren().entrySet()) {
     childBeanTmp = entryTmp.getValue();
     if (childBeanTmp instanceof ReportBean) {
       for (String relateconname : sRelateConditionNames) {
         ReportBean rbeanTmp = (ReportBean) entryTmp.getValue();
         if (rbeanTmp.getSbean() == null || rbeanTmp.getSbean().getLstConditions() == null)
           continue;
         if (rbeanTmp.isSlaveReportDependsonListReport()) continue; // 从报表不存在查询条件关联的情况
         List<ConditionBean> lstConditions = rbeanTmp.getSbean().getLstConditions();
         for (ConditionBean cbean : lstConditions) {
           if (cbean == null || !cbean.isConditionValueFromUrl()) continue;
           if (relateconname.equals(cbean.getName())) {
             List<ReportBean> lst = mRelateConReportBeans.get(relateconname);
             if (lst == null) {
               lst = new ArrayList<ReportBean>();
               mRelateConReportBeans.put(relateconname, lst);
             }
             lst.add(rbeanTmp);
           }
         }
       }
     } else if (childBeanTmp instanceof AbsContainerConfigBean) {
       getAllRelateConditionReportBeans(
           (AbsContainerConfigBean) childBeanTmp, sRelateConditionNames, mRelateConReportBeans);
     }
   }
 }
예제 #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);
     }
   }
 }