程序包 com.sh.util

类 DSUtil

java.lang.Object
com.sh.util.DSUtil

public class DSUtil extends Object
Description: Datastore工具对象 Title:首亨软件 - CRM、TSS、ERP等信息化管理软件
  • 构造器详细资料

    • DSUtil

      public DSUtil()
  • 方法详细资料

    • checkAndPrintTooMoreRowsLog

      public static void checkAndPrintTooMoreRowsLog(Datastore ds)
      检查ds数据集,如果值太多时,输出日志
      参数:
      ds - 数据集
    • loadFile

      public static FileDatastore loadFile(String path)
      将文件加载到数据集中,自动根据文件名识别文件类型,支持Excel/csv/txt文件
      参数:
      path - 文件路径,支持网络路径
      返回:
      数据集
    • loadResFile

      public static FileDatastore loadResFile(String path)
      加载资源服务器文件,会自动将文件路径转化为资源服务器路径
      参数:
      path - 文件路径
      返回:
    • loadResFile

      public static FileDatastore loadResFile(jakarta.servlet.http.HttpServletRequest request, String path)
      加载资源服务器文件,会自动将文件路径转化为资源服务器路径
      参数:
      path - 文件路径
      返回:
    • loadFile

      public static FileDatastore loadFile(String path, DSUtil.LoadFileConfig config)
      加载文件到DS中,自动根据文件名识别文件类型,支持Excel/csv/txt文件
      参数:
      path - 文件路径,支持网络文件
      config - 加载配置参数
      返回:
      数据集
    • loadExcel

      public static FileDatastore loadExcel(String path, DSUtil.LoadFileConfig config)
      加载Excel文件到数据集
      参数:
      path - 文件路径,支持网络路径
      config - 配置参数
      返回:
      数据集
    • loadCSV

      public static FileDatastore loadCSV(String path, DSUtil.LoadFileConfig config)
      加载CSV文件到数据集
      参数:
      path - 文件路径,支持网络路径
      config - 配置参数
      返回:
      数据集
    • loadTxt

      public static FileDatastore loadTxt(String path, DSUtil.LoadFileConfig config)
      加载Txt文件到数据集
      参数:
      path - 文件路径,支持网络路径
      config - 配置参数
      返回:
    • convertDs2Html

      public static String convertDs2Html(Datastore ds)
      将数据集中的记录转化为HTML
      参数:
      ds - Datastore
      返回:
      String
    • convertExcel2Ds

      public static Datastore convertExcel2Ds(String path)
    • convertExcel2Ds

      public static Datastore convertExcel2Ds(String path, int startRow, int maxRow)
      读取excel到ds中
      参数:
      path - excel路径
      startRow - 开始行
      maxRow - 最大读取记录数
      返回:
      Datastore
    • convertExcel2Ds

      public static Datastore convertExcel2Ds(String path, int startRow, int maxRow, int _maxCol)