当前位置:首页>Excel>公司大佬对 Excel 导入、导出的封装,那叫一个妙啊!

公司大佬对 Excel 导入、导出的封装,那叫一个妙啊!

  • 2026-03-27 10:55:53
公司大佬对 Excel 导入、导出的封装,那叫一个妙啊!

👉 这是一个或许对你有用的社群

🐱 一对一交流/面试小册/简历优化/求职解惑,欢迎加入芋道快速开发平台知识星球。下面是星球提供的部分资料:

👉这是一个或许对你有用的开源项目

国产Star破10w的开源项目,前端包括管理后台、微信小程序,后端支持单体、微服务架构

RBAC权限、数据权限、SaaS多租户、商城、支付、工作流、大屏报表、ERPCRMAI大模型、IoT物联网等功能:

  • 多模块:https://gitee.com/zhijiantianya/ruoyi-vue-pro
  • 微服务:https://gitee.com/zhijiantianya/yudao-cloud
  • 视频教程:https://doc.iocoder.cn
【国内首批】支持 JDK17/21+SpringBoot3、JDK8/11+Spring Boot2双版本 

来源:juejin.cn/post/7328242736027762739


最近在封装公司统一使用的组件,主要目的是要求封装后开发人员调用简单,不用每个项目组中重复去集成同一个依赖l,写的五花八门,代码不规范,后者两行泪。

为此,我们对EasyExcel进行了二次封装,我会先来介绍下具体使用,然后再给出封装过程

环境准备

开发环境:SpringBoot+mybatis-plus+db

数据库:

-- `dfec-tcht-platform-dev`.test definitionCREATETABLE`test` (`num`decimal(10,0DEFAULTNULLCOMMENT'数字',`sex`varchar(100DEFAULTNULLCOMMENT'性别',`name`varchar(100DEFAULTNULLCOMMENT'姓名',`born_date` datetime DEFAULTNULLENGINE=InnoDBDEFAULTCHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
使用
  • 第一步、在接口类中引入以下
@AurowiredExcelService excelService;
  • 第二步、标注字段

这些个注解是EasyExcel的注解,我们做了保留,仍然使用他的注解

/** * 【请填写功能名称】对象 test * * @author trg * @date Fri Jan 19 14:14:08 CST 2024 */@Data@TableName("test")publicclassTestEntity{/**     * 数字     */@Schema(description = "数字")@ExcelProperty("数字")private BigDecimal num;/**     * 性别     */@Schema(description = "性别")@ExcelProperty("性别")private String sex;/**     * 姓名     */@Schema(description = "姓名")@ExcelProperty("姓名")private String name;/**     * 创建时间     */@Schema(description = "创建时间")@ExcelProperty(value = "创建时间")private Date bornDate;}
  • 第三步、使用
@PostMapping("/importExcel")publicvoidimportExcel(@RequestParam MultipartFile file){   excelService.importExcel(file, TestEntity.class,2,testService::saveBatch);}@PostMapping("/exportExcel")publicvoidexportExcel(HttpServletResponse response)throws IOException {   excelService.exportExcel(testService.list(),TestEntity.class,response);
  • 完整代码
package com.dfec.server.controller;import com.baomidou.mybatisplus.core.toolkit.IdWorker;import com.dfec.framework.excel.service.ExcelService;import com.dfec.server.entity.TestEntity;import com.dfec.server.entity.TestVo;import com.dfec.server.service.TestService;import lombok.RequiredArgsConstructor;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestParam;import org.springframework.web.bind.annotation.RestController;import org.springframework.web.multipart.MultipartFile;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.io.IOException;import java.util.List;import java.util.function.Function;/** * @author trg * @title: TestController * @projectName df-platform * @description: TODO * @date 2023/6/1915:22 */@RestController@RequestMapping("test")@RequiredArgsConstructorpublicclassTestController{privatefinal ExcelService excelService;privatefinal TestService testService;@PostMapping("/importExcel")publicvoidimportExcel(@RequestParam MultipartFile file){        excelService.importExcel(file, TestEntity.class,2,testService::saveBatch);    }@PostMapping("/exportExcel")publicvoidexportExcel(HttpServletResponse response)throws IOException {        excelService.exportExcel(testService.list(),TestEntity.class,filePath,response);    }}

哈哈哈,是不是非常简洁

以上只是一个简单的使用情况,我们还封装了支持模板的导入、导出,数据转换等问题,客官请继续向下看。

如果遇到有读取到的数据和实际保存的数据不一致的情况下,可以使用如下方式导入,这里给出一个示例

@PostMapping("/importExcel")publicvoidimportExcel(@RequestParam MultipartFile file){    Function<TestEntity, TestVo> map = new Function<TestEntity, TestVo>() {@Overridepublic TestVo apply(TestEntity testEntities){            TestVo testVo = new TestVo();            testVo.setNum(testEntities.getNum());            testVo.setSex(testEntities.getSex());            testVo.setBaseName(testEntities.getName());return testVo;        }    };    excelService.importExcel(file, TestEntity.class,2,map,testService::saveBatchTest);}

基于 Spring Boot + MyBatis Plus + Vue & Element 实现的后台管理系统 + 用户小程序,支持 RBAC 动态权限、多租户、数据权限、工作流、三方登录、支付、短信、商城等功能

  • 项目地址:https://github.com/YunaiV/ruoyi-vue-pro
  • 视频教程:https://doc.iocoder.cn/video/

封装过程

核心思想:

对导入和导出提供接口、保持最少依赖原则

我们先从ExcelService接口类出发,依次看下封装的几个核心类

package com.dfec.framework.excel.service;import org.springframework.web.multipart.MultipartFile;import javax.servlet.http.HttpServletResponse;import java.io.IOException;import java.util.List;import java.util.function.Consumer;import java.util.function.Function;/** * ExcelService * * @author LiuBin * @interfaceName ExcelService * @date 2024/1/16 11:21 **/publicinterfaceExcelService{/**     * 导出Excel,默认     * @param list 导出的数据     * @param tClass 带有excel注解的实体类     * @param response 相应     * @return T     * @author trg     * @date 2024/1/15 17:32     */    <T> voidexportExcel(List<T> list, Class<T> tClass, HttpServletResponse response)throws IOException;/**     * 导出Excel,增加类型转换     * @param list 导出的数据     * @param tClass 带有excel注解的实体类     * @param response 相应     * @return T     * @author trg     * @date 2024/1/15 17:32     */    <T, R> voidexportExcel(List<T> list, Function<T, R> map, Class<R> tClass, HttpServletResponse response)throws IOException;/**     * 导出Excel,按照模板导出,这里是填充模板     * @param list 导出的数据     * @param tClass 带有excel注解的实体类     * @param template 模板     * @param response 相应     * @return T     * @author trg     * @date 2024/1/15 17:32     */    <T> voidexportExcel(List<T> list, Class<T> tClass, String template, HttpServletResponse response)throws IOException;/**     * 导入Excel     * @param file 文件     * @param tClass 带有excel注解的实体类     * @param headRowNumber 表格头行数据     * @param map 类型转换     * @param consumer 消费数据的操作     * @return T     * @author trg     * @date 2024/1/15 17:32     */    <T, R> voidimportExcel(MultipartFile file, Class<T> tClass, Integer headRowNumber, Function<T, R> map, Consumer<List<R>> consumer);/**     * 导入Excel     * @param file 文件     * @param tClass 带有excel注解的实体类     * @param headRowNumber 表格头行数据     * @param consumer 消费数据的操作     * @return T     * @author trg     * @date 2024/1/15 17:32     */    <T> voidimportExcel(MultipartFile file, Class<T> tClass, Integer headRowNumber, Consumer<List<T>> consumer);}

以上接口只有个导入、导出,只是加了几个重载方法而已

再看下具体的实现类

package com.dfec.framework.excel.service.impl;import com.alibaba.excel.EasyExcel;import com.alibaba.excel.support.ExcelTypeEnum;import com.dfec.framework.excel.convert.LocalDateTimeConverter;import com.dfec.framework.excel.service.ExcelService;import com.dfec.framework.excel.util.ExcelUtils;import org.springframework.stereotype.Service;import org.springframework.web.multipart.MultipartFile;import javax.servlet.http.HttpServletResponse;import java.io.File;import java.io.FileInputStream;import java.io.IOException;import java.io.UnsupportedEncodingException;import java.net.URLEncoder;import java.util.List;import java.util.function.Consumer;import java.util.function.Function;import java.util.stream.Collectors;/** * DefaultExcelServiceImpl * * @author LiuBin * @className DefaultExcelServiceImpl * @date 2024/1/16 11:42 **/@ServicepublicclassDefaultExcelServiceImplimplementsExcelService{@Overridepublic <T> voidexportExcel(List<T> list, Class<T> tClass, HttpServletResponse response)throws IOException {        setResponse(response);        EasyExcel.write(response.getOutputStream())                .head(tClass)                .excelType(ExcelTypeEnum.XLSX)                .registerConverter(new LocalDateTimeConverter())                .sheet("工作簿1")                .doWrite(list);    }@Overridepublic <T, R> voidexportExcel(List<T> list, Function<T, R> map, Class<R> tClass, HttpServletResponse response)throws IOException {        setResponse(response);        List<R> result = list.stream().map(map::apply).collect(Collectors.toList());        exportExcel(result, tClass, response);    }@Overridepublic <T> voidexportExcel(List<T> list, Class<T> tClass,String template, HttpServletResponse response)throws IOException {        setResponse(response);        EasyExcel.write(response.getOutputStream())                .withTemplate(template)                .excelType(ExcelTypeEnum.XLS)                .useDefaultStyle(false)                .registerConverter(new LocalDateTimeConverter())                .sheet(0)                .doFill(list) ;    }@Overridepublic <T,R> voidimportExcel(MultipartFile file, Class<T> tClass,Integer headRowNumber, Function<T, R> map,Consumer<List<R>> consumer){        List<T> excelData = ExcelUtils.readExcelData(file,tClass,headRowNumber);        List<R> result = excelData.stream().map(map::apply).collect(Collectors.toList());        consumer.accept(result);    }@Overridepublic <T> voidimportExcel(MultipartFile file, Class<T> tClass,Integer headRowNumber, Consumer<List<T>> consumer){        List<T> excelData = ExcelUtils.readExcelData(file,tClass,headRowNumber);        consumer.accept(excelData);    }publicvoidsetResponse(HttpServletResponse response)throws UnsupportedEncodingException {        response.setContentType("application/vnd.ms-excel");        response.setCharacterEncoding("utf-8");// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系        String fileName = URLEncoder.encode("data""UTF-8").replaceAll("\\+""%20");        response.setHeader("Content-disposition""attachment;filename*=utf-8''" + fileName + ".xls");    }}

ExcelUtils

package com.dfec.framework.excel.util;import com.alibaba.excel.EasyExcel;import com.alibaba.excel.ExcelReader;import com.alibaba.excel.read.builder.ExcelReaderBuilder;import com.alibaba.excel.read.metadata.ReadSheet;import com.alibaba.excel.util.MapUtils;import com.alibaba.fastjson.JSON;import com.dfec.common.exception.ServiceException;import com.dfec.framework.excel.listener.ExcelListener;import com.dfec.framework.excel.service.ExcelBaseService;import org.springframework.web.multipart.MultipartFile;import javax.servlet.http.HttpServletResponse;import java.io.BufferedInputStream;import java.io.IOException;import java.io.InputStream;import java.util.List;import java.util.Map;import java.util.Set;/** * @author trg * @description: Excel 工具类 * @title: ExcelUtils * @email 1446232546@qq.com * @date 2023/9/14 9:18 */publicclassExcelUtils{/**     * 将列表以 Excel 响应给前端     *     * @param response  响应     * @param fileName  文件名     * @param sheetName Excel sheet 名     * @param head      Excel head 头     * @param data      数据列表哦     * @param <T>       泛型,保证 head 和 data 类型的一致性     * @throws IOException 写入失败的情况     */publicstatic <T> voidexcelExport(HttpServletResponse response, String fileName, String sheetName,                                       Class<T> head, List<T> data)throws IOException {        write(response, fileName);// 这里需要设置不关闭流        EasyExcel.write(response.getOutputStream(), head).autoCloseStream(Boolean.FALSE).sheet(sheetName)                .doWrite(data);    }/**     * 根据模板导出     *     * @param response     响应     * @param templatePath 模板名称     * @param fileName     文件名     * @param sheetName    Excel sheet 名     * @param head         Excel head 头     * @param data         数据列表哦     * @param <T>          泛型,保证 head 和 data 类型的一致性     * @throws IOException 写入失败的情况     */publicstatic <T> voidexcelExport(HttpServletResponse response, String templatePath, String fileName, String sheetName,                                       Class<T> head, List<T> data)throws IOException {        write(response, fileName);// 这里需要设置不关闭流        EasyExcel.write(response.getOutputStream(), head).withTemplate(templatePath).autoCloseStream(Boolean.FALSE).sheet(sheetName)                .doWrite(data);    }/**     * 根据参数,只导出指定列     *     * @param response                响应     * @param fileName                文件名     * @param sheetName               Excel sheet 名     * @param head                    Excel head 头     * @param data                    数据列表哦     * @param excludeColumnFiledNames 排除的列     * @param <T>                     泛型,保证 head 和 data 类型的一致性     * @throws IOException 写入失败的情况     */publicstatic <T> voidexcelExport(HttpServletResponse response, String fileName, String sheetName,                                       Class<T> head, List<T> data, Set<String> excludeColumnFiledNames)throws IOException {        write(response, fileName);// 这里需要设置不关闭流        EasyExcel.write(response.getOutputStream(), head).autoCloseStream(Boolean.FALSE).excludeColumnFiledNames(excludeColumnFiledNames).sheet(sheetName)                .doWrite(data);    }privatestaticvoidwrite(HttpServletResponse response, String fileName){try {            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");            response.setCharacterEncoding("utf-8");// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系            response.setHeader("Content-disposition""attachment;filename*=utf-8''" + fileName + ".xlsx");        } catch (Exception e) {// 重置response            response.reset();            response.setContentType("application/json");            response.setCharacterEncoding("utf-8");            Map<String, String> map = MapUtils.newHashMap();            map.put("status""failure");            map.put("message""下载文件失败" + e.getMessage());try {                response.getWriter().println(JSON.toJSONString(map));            } catch (IOException ex) {thrownew RuntimeException(ex);            }        }    }publicstatic <T> List<T> read(MultipartFile file, Class<T> head)throws IOException {return EasyExcel.read(file.getInputStream(), head, null)// 不要自动关闭,交给 Servlet 自己处理                .autoCloseStream(false)                .doReadAllSync();    }/**     * 读取 Excel(多个 sheet)     *     * @param excel    文件     * @param rowModel 实体类映射     * @return Excel 数据 list     */publicstatic <T> List<T> readExcelData(MultipartFile excel, Class<T> rowModel, Integer headRowNumber){        ExcelListener excelListener = new ExcelListener();        ExcelReaderBuilder readerBuilder = getReader(excel, excelListener);if (readerBuilder == null) {returnnull;        }if (headRowNumber == null) {            headRowNumber = 1;        }        readerBuilder.head(rowModel).headRowNumber(headRowNumber).doReadAll();return excelListener.getData();    }/**     * 读取 Excel(多个 sheet)     *     * @param excel    文件     * @param rowModel 实体类映射     * @return Excel 数据 list     */publicstatic <T> List<T> excelImport(MultipartFile excel, ExcelBaseService excelBaseService, Class rowModel){        ExcelListener excelListener = new ExcelListener(excelBaseService);        ExcelReaderBuilder readerBuilder = getReader(excel, excelListener);if (readerBuilder == null) {returnnull;        }        readerBuilder.head(rowModel).doReadAll();return excelListener.getData();    }/**     * 读取某个 sheet 的 Excel     *     * @param excel       文件     * @param rowModel    实体类映射     * @param sheetNo     sheet 的序号 从1开始     * @param headLineNum 表头行数,默认为1     * @return Excel 数据 list     */publicstatic <T> List<T> excelImport(MultipartFile excel, ExcelBaseService excelBaseService, Class rowModel, int sheetNo,                                          Integer headLineNum){        ExcelListener excelListener = new ExcelListener(excelBaseService);        ExcelReaderBuilder readerBuilder = getReader(excel, excelListener);if (readerBuilder == null) {returnnull;        }        ExcelReader reader = readerBuilder.headRowNumber(headLineNum).build();        ReadSheet readSheet = EasyExcel.readSheet(sheetNo).head(rowModel).build();        reader.read(readSheet);return excelListener.getData();    }/**     * 返回 ExcelReader     *     * @param excel         需要解析的 Excel 文件     * @param excelListener 监听器     */privatestatic ExcelReaderBuilder getReader(MultipartFile excel,                                                ExcelListener excelListener){        String filename = excel.getOriginalFilename();if (filename == null || (!filename.toLowerCase().endsWith(".xls") && !filename.toLowerCase().endsWith(".xlsx"))) {thrownew ServiceException("文件格式错误!");        }        InputStream inputStream;try {            inputStream = new BufferedInputStream(excel.getInputStream());return EasyExcel.read(inputStream, excelListener);        } catch (IOException e) {            e.printStackTrace();        }returnnull;    }}

ExcelListener.java

package com.dfec.framework.excel.listener;import com.alibaba.excel.context.AnalysisContext;import com.alibaba.excel.event.AnalysisEventListener;import com.alibaba.fastjson.JSON;import com.dfec.framework.excel.service.ExcelBaseService;import lombok.extern.slf4j.Slf4j;import java.util.ArrayList;import java.util.List;import java.util.Map;/** * @author trg * @description: Excel导入的监听类 * @title: ExcelListener * @projectName df-platform * @email 1446232546@qq.com * @date 2023/9/14 16:23 */@Slf4jpublicclassExcelListener<TextendsAnalysisEventListener<T{private ExcelBaseService excelBaseService;publicExcelListener(){}publicExcelListener(ExcelBaseService excelBaseService){this.excelBaseService = excelBaseService;    }/**     * 每隔1000条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收     */privatestaticfinalint BATCH_COUNT = 1000;    List<T> list = new ArrayList<>();@Overridepublicvoidinvoke(T data, AnalysisContext context){        list.add(data);        log.info("解析到一条数据:{}", JSON.toJSONString(data));    }@OverridepublicvoiddoAfterAllAnalysed(AnalysisContext context){        log.info("所有数据解析完成!");    }/**     * 返回list     */public  List<T> getData(){returnthis.list;    }}

基于 Spring Cloud Alibaba + Gateway + Nacos + RocketMQ + Vue & Element 实现的后台管理系统 + 用户小程序,支持 RBAC 动态权限、多租户、数据权限、工作流、三方登录、支付、短信、商城等功能

  • 项目地址:https://github.com/YunaiV/yudao-cloud
  • 视频教程:https://doc.iocoder.cn/video/

遇到的问题

1、通过模板导出数据作为导入数据再导入进来,日期格式不正确

解决方法:

package com.dfec.server;import com.alibaba.excel.converters.Converter;import com.alibaba.excel.converters.ReadConverterContext;import com.alibaba.excel.enums.CellDataTypeEnum;import com.dfec.common.utils.str.StringUtils;import java.util.Date;/** * DateConverter * * @author trg * @className DateConverter * @date 2024/1/25 16:09 **/publicclassDateConverterimplementsConverter<Date{@Overridepublic Date convertToJavaData(ReadConverterContext<?> context)throws Exception {        Class<?> aClass = context.getContentProperty().getField().getType();        CellDataTypeEnum type = context.getReadCellData().getType();        String stringValue = context.getReadCellData().getStringValue();if(aClass.equals(Date.class) && type.equals(CellDataTypeEnum.STRING)  && StringUtils.isBlank(stringValue)){returnnull;        }return Converter.super.convertToJavaData(context);    }}

实体类上添加

/** * 创建时间 */@Schema(description = "创建时间")@ExcelProperty(value = "创建时间",converter = DateConverter.class)privateDatebornDate;

同理,这块

注意这里也是可以用相同的方法去做字典值类型的转换的,可以参考下芋道源码的DictConvert.java

2、POI版本

这里切记POI版本和ooxml的版本一堆要保持一致,不然会出现各种问题

3、日期类型 LocalDateTime 转换的问题
package com.dfec.framework.excel.convert;import com.alibaba.excel.converters.Converter;import com.alibaba.excel.enums.CellDataTypeEnum;import com.alibaba.excel.metadata.GlobalConfiguration;import com.alibaba.excel.metadata.data.ReadCellData;import com.alibaba.excel.metadata.data.WriteCellData;import com.alibaba.excel.metadata.property.ExcelContentProperty;import java.time.LocalDateTime;import java.time.format.DateTimeFormatter;/** * 解决 EasyExcel 日期类型 LocalDateTime 转换的问题 */publicclassLocalDateTimeConverterimplementsConverter<LocalDateTime{@Overridepublic Class<LocalDateTime> supportJavaTypeKey(){return LocalDateTime.class;    }@Overridepublic CellDataTypeEnum supportExcelTypeKey(){return CellDataTypeEnum.STRING;    }@Overridepublic LocalDateTime convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty,                                           GlobalConfiguration globalConfiguration){return LocalDateTime.parse(cellData.getStringValue(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));    }@Overridepublic WriteCellData<String> convertToExcelData(LocalDateTime value, ExcelContentProperty contentProperty,                                                    GlobalConfiguration globalConfiguration){returnnew WriteCellData(value.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));    }}

遗留问题

目前我们使用的这个EasyExcel版本是3.3.2,但是发现,导出的时候按照模板去导出文件数据的话只能支持xls,xlsx的不支持,目前还未有解决方案,有遇到的朋友还望不吝赐教

参照:

EasyExcel官方文档;

https://easyexcel.opensource.alibaba.com/docs/current/


欢迎加入我的知识星球,全面提升技术能力。

👉 加入方式,长按”或“扫描”下方二维码噢

星球的内容包括:项目实战、面试招聘、源码解析、学习路线。

文章有帮助的话,在看,转发吧。

谢谢支持哟 (*^__^*)

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-07 13:45:27 HTTP/2.0 GET : https://h.sjds.net/a/466336.html
  2. 运行时间 : 0.272592s [ 吞吐率:3.67req/s ] 内存消耗:4,595.81kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=d5f851cc3a025084c79523bf6e18aeb1
  1. /yingpanguazai/ssd/ssd1/www/h.sjds.net/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/h.sjds.net/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/h.sjds.net/runtime/temp/ad153693ed39fba6d1bda2fe72512cde.php ( 12.06 KB )
  140. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000327s ] mysql:host=127.0.0.1;port=3306;dbname=h_sjds;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000529s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.011518s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000588s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000502s ]
  6. SELECT * FROM `set` [ RunTime:0.009996s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000652s ]
  8. SELECT * FROM `article` WHERE `id` = 466336 LIMIT 1 [ RunTime:0.026961s ]
  9. UPDATE `article` SET `lasttime` = 1775540727 WHERE `id` = 466336 [ RunTime:0.021380s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 65 LIMIT 1 [ RunTime:0.001729s ]
  11. SELECT * FROM `article` WHERE `id` < 466336 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.011990s ]
  12. SELECT * FROM `article` WHERE `id` > 466336 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.037954s ]
  13. SELECT * FROM `article` WHERE `id` < 466336 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.052736s ]
  14. SELECT * FROM `article` WHERE `id` < 466336 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.005740s ]
  15. SELECT * FROM `article` WHERE `id` < 466336 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.005871s ]
0.275335s