Browse Source

# 线下工作票预览接口调整

zhongwei
haungxing 1 year ago
parent
commit
2ef6c51b35
  1. 9
      hzims-service/ticket/pom.xml
  2. 17
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

9
hzims-service/ticket/pom.xml

@ -298,7 +298,14 @@
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--设置为true,以便把本地的system的jar也包括进来-->
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>

17
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

@ -395,27 +395,27 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl<WorkTicketInfoMa
//安全隔离措施附页 (true,展示附件,false,不展示附件)
if (workTicketInfo.getIsSafety()) {
XWPFDocument xwpfDocument = this.fillDocument("template/" + TicketConstant.SECURE_PAGE, params);
result.add(xwpfDocument);
//result.add(xwpfDocument);
}
//危险点分析与预控措施票 (true,展示附件,false,不展示附件)
if (workTicketInfo.getIsHazard()) {
XWPFDocument xwpfDocument = this.fillDocument("template/" + TicketConstant.SAFETY_PAGE, params);
result.add(xwpfDocument);
//result.add(xwpfDocument);
}
//动火工作票 (true,展示附件,false,不展示附件)
if (workTicketInfo.getIsRailway()) {
XWPFDocument xwpfDocument = this.fillDocument("template/" + TicketConstant.FLIGHT_PAGE, params);
result.add(xwpfDocument);
//result.add(xwpfDocument);
}
//有限空间监测记录单(true,展示附件,false,不展示附件)
if (workTicketInfo.getIsLimited()) {
XWPFDocument xwpfDocument = this.fillDocument("template/" + TicketConstant.SPACE_PAGE, params);
result.add(xwpfDocument);
//result.add(xwpfDocument);
}
//每日开工和收工时间附页
if (workTicketInfo.getIsStart()) {
XWPFDocument xwpfDocument = this.fillDocument("template/" + TicketConstant.START_PAGE, params);
result.add(xwpfDocument);
//result.add(xwpfDocument);
}
return result;
}
@ -431,12 +431,7 @@ public class FirstWorkTicketServiceImpl extends BaseServiceImpl<WorkTicketInfoMa
}
private void exportTicketWord(List<XWPFDocument> documents, String savePath) throws IOException {
FileOutputStream out = new FileOutputStream(savePath, true);
Path file = Paths.get(path);
if(Files.exists(file)) {
Files.delete(file);
}
new File(savePath).createNewFile();
FileOutputStream out = new FileOutputStream(savePath);
for (XWPFDocument document : documents) {
document.write(out);
}

Loading…
Cancel
Save