|
@@ -35,6 +35,7 @@ import javax.annotation.Resource;
|
35
|
35
|
import javax.servlet.http.HttpServletResponse;
|
36
|
36
|
import javax.validation.Valid;
|
37
|
37
|
import java.io.IOException;
|
|
38
|
+import java.util.ArrayList;
|
38
|
39
|
import java.util.List;
|
39
|
40
|
|
40
|
41
|
/**
|
|
@@ -130,13 +131,18 @@ public class DiagnosisManageController extends BaseController {
|
130
|
131
|
List<DiagnosisManageTemplateExcel> list = util.importExcel(file.getInputStream());
|
131
|
132
|
// 2.如果解析数据为空则返回错误信息
|
132
|
133
|
if (CollectionUtils.isEmpty(list)) {
|
133
|
|
- throw new RuntimeException("上传数据为空,请填写");
|
134
|
|
- }
|
135
|
|
- // 解析模板
|
136
|
|
- List<DiagnosisManageTemplateExcel> diagnosisManageTemplateExcels = diagnosisManageService.importTemplate(list);
|
137
|
|
- // 导出错误模板
|
138
|
|
- if (CollectionUtils.isNotEmpty(diagnosisManageTemplateExcels)) {
|
139
|
|
- util.exportExcel(response, diagnosisManageTemplateExcels, "模板错误");
|
|
134
|
+ List<DiagnosisManageTemplateExcel> diagnosisTypeTemplateExcels = new ArrayList<>();
|
|
135
|
+ DiagnosisManageTemplateExcel d = new DiagnosisManageTemplateExcel();
|
|
136
|
+ d.setMsg("上传数据为空,请填写");
|
|
137
|
+ diagnosisTypeTemplateExcels.add(d);
|
|
138
|
+ util.exportExcel(response, diagnosisTypeTemplateExcels, "模板错误");
|
|
139
|
+ } else {
|
|
140
|
+ // 解析模板
|
|
141
|
+ List<DiagnosisManageTemplateExcel> diagnosisManageTemplateExcels = diagnosisManageService.importTemplate(list);
|
|
142
|
+ // 导出错误模板
|
|
143
|
+ if (CollectionUtils.isNotEmpty(diagnosisManageTemplateExcels)) {
|
|
144
|
+ util.exportExcel(response, diagnosisManageTemplateExcels, "模板错误");
|
|
145
|
+ }
|
140
|
146
|
}
|
141
|
147
|
}
|
142
|
148
|
|