Browse Source

fix: 修复巡检本站月报导出失败问题

zhongwei
haungxing 4 months ago
parent
commit
06727dc08c
  1. 24
      hzims-service/inspect/pom.xml
  2. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/entity/InspectMonthReportExcel.java
  3. 10
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/report/service/imp/InspectReportServiceImpl.java

24
hzims-service/inspect/pom.xml

@ -32,6 +32,12 @@
<dependency> <dependency>
<groupId>com.hnac.hzims</groupId> <groupId>com.hnac.hzims</groupId>
<artifactId>safeproduct-api</artifactId> <artifactId>safeproduct-api</artifactId>
<exclusions>
<exclusion>
<artifactId>easypoi-spring-boot-starter</artifactId>
<groupId>cn.afterturn</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.hnac.hzims</groupId> <groupId>com.hnac.hzims</groupId>
@ -40,6 +46,12 @@
<dependency> <dependency>
<groupId>com.hnac.hzims</groupId> <groupId>com.hnac.hzims</groupId>
<artifactId>hzims-operational-api</artifactId> <artifactId>hzims-operational-api</artifactId>
<exclusions>
<exclusion>
<artifactId>easypoi-base</artifactId>
<groupId>cn.afterturn</groupId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.hnac.hzims</groupId> <groupId>com.hnac.hzims</groupId>
@ -92,11 +104,17 @@
<!--<version>1.0-SNAPSHOT</version>--> <!--<version>1.0-SNAPSHOT</version>-->
<!--</dependency>--> <!--</dependency>-->
<!--短信发送平台 End--> <!--短信发送平台 End-->
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>easyexcel</artifactId>-->
<!-- <version>2.2.7</version>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>cn.afterturn</groupId>
<artifactId>easyexcel</artifactId> <artifactId>easypoi-spring-boot-starter</artifactId>
<version>2.2.7</version>
</dependency> </dependency>
<!--html 转pdf--> <!--html 转pdf-->
<dependency> <dependency>
<groupId>com.itextpdf</groupId> <groupId>com.itextpdf</groupId>

3
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 com.alibaba.excel.annotation.write.style.*;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.FillPatternType;
import java.util.Date; import java.util.Date;
@ -13,11 +12,9 @@ import java.util.Date;
*/ */
@ApiModel(value = "巡检月报-Excel-导出") @ApiModel(value = "巡检月报-Excel-导出")
@Data @Data
@HeadStyle(fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 22)
@HeadRowHeight(45) @HeadRowHeight(45)
@ColumnWidth(20) @ColumnWidth(20)
@ContentRowHeight(80) @ContentRowHeight(80)
@ContentStyle(wrapped = true)
public class InspectMonthReportExcel { public class InspectMonthReportExcel {
@ExcelProperty(value = "用户名称", index = 0) @ExcelProperty(value = "用户名称", index = 0)

10
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.service.InspectReportService;
import com.hnac.hzinfo.inspect.report.vo.AlarmRoutReportVO; import com.hnac.hzinfo.inspect.report.vo.AlarmRoutReportVO;
import com.hnac.hzinfo.inspect.report.vo.AlarmTaskGatherReportVO; 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.core.tool.utils.Func;
import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.cache.UserCache;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.time.YearMonth;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@ -81,7 +81,7 @@ public class InspectReportServiceImpl implements InspectReportService {
reportExcel.setTaskNum(entry.getValue().getTaskNum()); reportExcel.setTaskNum(entry.getValue().getTaskNum());
result.add(reportExcel); result.add(reportExcel);
} }
return result; return result.stream().sorted(Comparator.comparing(r -> LocalDate.parse(r.getTime(), DateUtil.DATE_FORMATTER))).collect(Collectors.toList());
} }
/** /**

Loading…
Cancel
Save