Ver código fonte

点巡检下载模板获取方式更新

huangpeng 7 meses atrás
pai
commit
a86ee1d528

+ 5 - 2
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/PointCheckServiceImpl.java

@@ -36,6 +36,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -492,12 +493,14 @@ public class PointCheckServiceImpl extends ServiceImpl<PointCheckDao, PointCheck
                 .in(PointCheckItemDo::getPointcheckid, excelData.getIds())).stream().collect(Collectors.groupingBy(PointCheckItemDo::getPointcheckid));
 
         //3.获取点检记录模板
-        String fullPath = pointCheckItemService.getExcelTempPath(excelData.getPagePartId(),excelData.getFileTemplateName());
+    //    String fullPath = pointCheckItemService.getExcelTempPath(excelData.getPagePartId(),excelData.getFileTemplateName());
+
+        ClassPathResource classPathResource = new ClassPathResource("filetem/点检记录模板.xlsx");
 
         XSSFWorkbook workbook =null;
 
         try {
-            InputStream fileInputStream = new FileInputStream(fullPath);
+            InputStream fileInputStream = classPathResource.getInputStream();
             workbook = new XSSFWorkbook(fileInputStream);
             XSSFSheet tempSheet = workbook.getSheetAt(0);
             excelData.setStartIndex(0);

BIN
cx-safe-check/cx-save-check-common/src/main/resources/filetem/点检记录模板.xlsx