导入表修改
This commit is contained in:
parent
d19209d85b
commit
678801b011
@ -11,6 +11,8 @@ import javax.servlet.ServletOutputStream;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
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.util.ResourceUtils;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@ -62,7 +64,12 @@ public class ImportDownloadController {
|
|||||||
file = ResourceUtils.getFile("classpath:template/门诊患者信息导入表.xlsx");
|
file = ResourceUtils.getFile("classpath:template/门诊患者信息导入表.xlsx");
|
||||||
break;
|
break;
|
||||||
case Constants.PATIENT_INFO_IMPORT: // 门诊患者
|
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;
|
break;
|
||||||
}
|
}
|
||||||
if (Objects.isNull(file)) {
|
if (Objects.isNull(file)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user