From 06727dc08cfb89b5b844cd458f7483461f0b1f1e Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Tue, 6 Aug 2024 13:57:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E6=9C=AC=E7=AB=99=E6=9C=88=E6=8A=A5=E5=AF=BC=E5=87=BA=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hzims-service/inspect/pom.xml | 24 +++++++++++++++++++--- .../report/entity/InspectMonthReportExcel.java | 3 --- .../service/imp/InspectReportServiceImpl.java | 10 ++++----- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/hzims-service/inspect/pom.xml b/hzims-service/inspect/pom.xml index 4d1f307..10d46e5 100644 --- a/hzims-service/inspect/pom.xml +++ b/hzims-service/inspect/pom.xml @@ -32,6 +32,12 @@ com.hnac.hzims safeproduct-api + + + easypoi-spring-boot-starter + cn.afterturn + + com.hnac.hzims @@ -40,6 +46,12 @@ com.hnac.hzims hzims-operational-api + + + easypoi-base + cn.afterturn + + com.hnac.hzims @@ -92,11 +104,17 @@ + + + + + + - com.alibaba - easyexcel - 2.2.7 + cn.afterturn + easypoi-spring-boot-starter + com.itextpdf diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/entity/InspectMonthReportExcel.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/entity/InspectMonthReportExcel.java index 3a0d9f4..2d52683 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/entity/InspectMonthReportExcel.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/entity/InspectMonthReportExcel.java @@ -4,7 +4,6 @@ import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.*; import io.swagger.annotations.ApiModel; import lombok.Data; -import org.apache.poi.ss.usermodel.FillPatternType; import java.util.Date; @@ -13,11 +12,9 @@ import java.util.Date; */ @ApiModel(value = "巡检月报-Excel-导出") @Data -@HeadStyle(fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 22) @HeadRowHeight(45) @ColumnWidth(20) @ContentRowHeight(80) -@ContentStyle(wrapped = true) public class InspectMonthReportExcel { @ExcelProperty(value = "用户名称", index = 0) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/service/imp/InspectReportServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/service/imp/InspectReportServiceImpl.java index 86481af..e7dd2b3 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/service/imp/InspectReportServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/service/imp/InspectReportServiceImpl.java @@ -11,16 +11,16 @@ import com.hnac.hzinfo.inspect.report.mapper.InspectReportMapper; import com.hnac.hzinfo.inspect.report.service.InspectReportService; import com.hnac.hzinfo.inspect.report.vo.AlarmRoutReportVO; import com.hnac.hzinfo.inspect.report.vo.AlarmTaskGatherReportVO; +import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springblade.system.user.cache.UserCache; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.time.LocalDate; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.time.YearMonth; +import java.util.*; import java.util.stream.Collectors; @Service @@ -81,7 +81,7 @@ public class InspectReportServiceImpl implements InspectReportService { reportExcel.setTaskNum(entry.getValue().getTaskNum()); result.add(reportExcel); } - return result; + return result.stream().sorted(Comparator.comparing(r -> LocalDate.parse(r.getTime(), DateUtil.DATE_FORMATTER))).collect(Collectors.toList()); } /**