6c
5 天以前 80a310f54039fabd20aecc2677fe6bbc191f4a5c
src/main/java/com/product/server/report/service/DataListReportService.java
@@ -19,6 +19,7 @@
import com.product.core.service.support.AbstractBaseService;
import com.product.core.service.support.QueryFilterService;
import com.product.core.spring.context.SpringMVCContextHolder;
import com.product.core.util.ReflectUtil;
import com.product.module.data.service.SystemDataExportService;
import com.product.server.report.config.CmnConst;
import com.product.server.report.config.ReportCode;
@@ -992,11 +993,24 @@
         Object result;
         String value;
         try {
            result = BaseUtil.executeExpression(executeContent);
            String reg = "\\w+\\.\\w+\\((\\w+)?((,\\w+)*)?\\)";
            if (executeContent.matches(reg)) {
               int split1 = executeContent.indexOf(".");
               int split2 = executeContent.indexOf("(");
               String beanName = executeContent.substring(0, split1);
               String methodName = executeContent.substring(split1 + 1, split2);
               String paramStr = executeContent.substring(split2 + 1, executeContent.length() - 1);
               if (StringUtils.isEmpty(paramStr)) {
                  result = ReflectUtil.invoke(beanName, methodName, new Object[]{});
               } else {
                  result = ReflectUtil.invoke(beanName, methodName, Arrays.asList(paramStr.split(",")).toArray());
               }
            } else {
               result = BaseUtil.executeExpression(executeContent);
            }
            value = result.toString();
         } catch (Exception e) {
            SpringMVCContextHolder.getSystemLogger().error(e);
            value = "";
            throw new BaseException(ReportCode.APPLY_SQL_FAIL.getValue(), ReportCode.APPLY_SQL_FAIL.getText() + e.getMessage());
         }
         sqlText = sqlText.replace(suitContent, value);
      }