|
|
|
@ -289,19 +289,17 @@ public class ExcelController extends BaseController{
|
|
|
|
|
if (listPath.size() > 0) {
|
|
|
|
|
//导入
|
|
|
|
|
result = preDataInfoService.importExcel(listPath);
|
|
|
|
|
//导入成功后再次请求数据
|
|
|
|
|
List<PreDataInfo> datalist = preDataInfoService.findAll();
|
|
|
|
|
modelMap.addAttribute("data", datalist);
|
|
|
|
|
modelMap.addAttribute("length", datalist.size());
|
|
|
|
|
modelMap.addAttribute("code","1001");
|
|
|
|
|
//失败
|
|
|
|
|
if (result.containsKey("fileUnExist")/* || result.containsKey("areaUnImport")*/) {
|
|
|
|
|
modelMap.addAttribute("data", result);
|
|
|
|
|
if (result.keySet().size() > 0) {
|
|
|
|
|
modelMap.addAllAttributes(result);
|
|
|
|
|
modelMap.addAttribute("code","3001");
|
|
|
|
|
response.setStatus(500);
|
|
|
|
|
}
|
|
|
|
|
//成功
|
|
|
|
|
else {
|
|
|
|
|
List<PreDataInfo> datalist = preDataInfoService.findAll();
|
|
|
|
|
modelMap.addAttribute("data", datalist);
|
|
|
|
|
modelMap.addAttribute("length", datalist.size());
|
|
|
|
|
modelMap.addAttribute("code","1001");
|
|
|
|
|
}
|
|
|
|
|
//删除文件
|
|
|
|
|
List<String> failedDelete = new ArrayList<String>();
|
|
|
|
|
for (String filePath : listPath) {
|
|
|
|
|