diff --git a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/importdownload/ImportDownloadController.java b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/importdownload/ImportDownloadController.java index e6c2388c..3ed56dee 100644 --- a/postdischarge-manage/src/main/java/com/xinelu/manage/controller/importdownload/ImportDownloadController.java +++ b/postdischarge-manage/src/main/java/com/xinelu/manage/controller/importdownload/ImportDownloadController.java @@ -44,34 +44,28 @@ public class ImportDownloadController { throw new ServiceException("请选择文件类型!"); } File file = null; + //本地使用 classpath:template switch (fileType) { case Constants.AGENCY: - file = ResourceUtils.getFile("classpath:template/机构信息导入表.xlsx"); + file = ResourceUtils.getFile("template/机构信息导入表.xlsx"); break; case Constants.DEPARTMENT: - file = ResourceUtils.getFile("classpath:template/科室信息导入表.xlsx"); + file = ResourceUtils.getFile("template/科室信息导入表.xlsx"); break; case Constants.PRE_HOSPITALIZED: // 预住院患者 - file = ResourceUtils.getFile("classpath:template/预住院患者信息导入表.xlsx"); + file = ResourceUtils.getFile("template/预住院患者信息导入表.xlsx"); break; case Constants.IN_HOSPITAL: // 在院患者 - file = ResourceUtils.getFile("classpath:template/在院患者信息导入表.xlsx"); + file = ResourceUtils.getFile("template/在院患者信息导入表.xlsx"); break; case Constants.DISCHARGED: // 出院患者 - file = ResourceUtils.getFile("classpath:template/出院患者信息导入表.xlsx"); + file = ResourceUtils.getFile("template/出院患者信息导入表.xlsx"); break; case Constants.OUTPATIENT: // 门诊患者 - file = ResourceUtils.getFile("classpath:template/门诊患者信息导入表.xlsx"); + file = ResourceUtils.getFile("template/门诊患者信息导入表.xlsx"); break; case Constants.PATIENT_INFO_IMPORT: // 门诊患者 - //本地服务 - //file = ResourceUtils.getFile("classpath:template/OutpatientFollowUpRecords.xlsx"); - //线上服务 - Resource resource = new ClassPathResource("classpath:template/OutpatientFollowUpRecords.xlsx"); - String filePath= this.getClass().getClassLoader().getResource("classpath:template/OutpatientFollowUpRecords.xlsx").getFile(); - file= new File(filePath); - // 通过流讲文件复制到file中 - FileUtils.copyToFile(resource.getInputStream(), file); + file = ResourceUtils.getFile("template/OutpatientFollowUpRecords.xlsx"); break; } if (Objects.isNull(file)) {