导入表修改

This commit is contained in:
zhangheng 2024-12-26 10:14:30 +08:00
parent d19209d85b
commit 678801b011

View File

@ -11,6 +11,8 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -62,7 +64,12 @@ public class ImportDownloadController {
file = ResourceUtils.getFile("classpath:template/门诊患者信息导入表.xlsx");
break;
case Constants.PATIENT_INFO_IMPORT: // 门诊患者
file = ResourceUtils.getFile("classpath:template/OutpatientFollowUpRecords.xlsx");
//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);
break;
}
if (Objects.isNull(file)) {