Browse Source

fix: 解决年度里程统计导出报错的问题

zhongwei
liwen 4 months ago
parent
commit
01dfccab9b
  1. 9
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java

9
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/CarServiceImpl.java

@ -29,10 +29,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -254,7 +251,11 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, CarEntity> implements
.registerConverter(new LongStringConverter())
.registerWriteHandler(new SimpleColumnWidthStyleStrategy(25))
.build();
// 排除时间字段
Set<String> excludeSets = new HashSet<>();
excludeSets.add("createTime");
WriteSheet writeSheet = EasyExcel.writerSheet(1, "年度里程统计表").head(CarMilesYearVO.class)
.excludeColumnFieldNames(excludeSets)
.build();
excelWriter.write(list, writeSheet);
excelWriter.finish();

Loading…
Cancel
Save