类 ExcelHelperAround

java.lang.Object
gu.sql2java.excel.aspect.spring.ExcelHelperAround

@Component public class ExcelHelperAround extends Object
  • 构造器详细资料

    • ExcelHelperAround

      public ExcelHelperAround()
  • 方法详细资料

    • excelAround

      public Object excelAround(org.aspectj.lang.ProceedingJoinPoint joinPoint) throws Throwable
      ExcelHelper切面执行
      对于有ExcelSheet注解的服务方法,自动根据注解创建SheetConfig实例, 并将服务方法中与ExcelSheet注解定义的方法名同名的参数注入到上面的SheetConfig实例中. 将服务方法返回的数据记录列表执行springWebExport(SheetConfig, Integer, String, ExcelGenerator)方法输出excel格式数据
      因为需要获取服务方法的参数名,所以需要服务方法所在项目Java编译器如下设置指定-parameters参数
       <build>
           <pluginManagement>
               <plugins>
                   <plugin>
                       <groupId>org.apache.maven.plugins</groupId>
                       <artifactId>maven-compiler-plugin</artifactId>
                       <configuration>
                           <compilerArgs>
                               <compilerArg>-Xlint:unchecked</compilerArg>
                               <compilerArg>-parameters</compilerArg>
                           </compilerArgs>
                       </configuration>
                   </plugin>
               </plugins>
           </pluginManagement>
       </build>
       
      参数:
      joinPoint -
      返回:
      返回执行服务方法调用的返回值
      抛出:
      Throwable
    • setSheetconfig

      public static void setSheetconfig(SheetConfig sheetConfig, boolean force)
      为Spring AOP处理当前Excel导出指定的Excel配置对象
      参数:
      sheetConfig -
      force - 为true强制替换ExcelGenerator生成的SheetConfig对象
    • setSheetconfig

      public static void setSheetconfig(SheetConfig sheetConfig)
      (非强制)为Spring AOP处理当前Excel导出指定的Excel配置对象
      另请参阅:
    • setQueueTimeout

      public static void setQueueTimeout(int queueTimeout)
      (非强制)为Spring AOP处理当前Excel导出指定的阻塞队列超时时间(秒)
      参数:
      queueTimeout -
    • setTotalRowCount

      public static void setTotalRowCount(long totalRowCount)
      (非强制)为Spring AOP处理当前Excel导出指定的阻塞队列记录总数
      参数:
      totalRowCount -
    • getSheetconfig

      public static SheetConfig getSheetconfig()
      返回为Spring AOP处理当前Excel导出的Excel配置对象
      从以下版本开始:
      3.25.4