错误提示语句修改

This commit is contained in:
lym
2025-01-15 15:32:08 +08:00
parent 14fdac7ea8
commit 299bb30ffc
6 changed files with 31 additions and 13 deletions
@@ -1,7 +1,6 @@
package com.cf.imes.module.manage.controller.admin.parts;
import com.cf.imes.module.manage.controller.admin.parts.vo.*;
import com.cf.imes.module.manage.controller.admin.plate.vo.plate.PlateImportExcelVO;
import com.cf.imes.module.manage.dal.dataobject.parts.PartsDO;
import com.cf.imes.module.manage.service.parts.PartsExcelListener;
import com.cf.imes.module.manage.service.parts.PartsService;
@@ -131,7 +130,7 @@ public class PartsController {
ExcelReadUtil excelReadUtil = new ExcelReadUtil();
PartsExcelListener listener = new PartsExcelListener();
List<PartsImportExcelVO> list = excelReadUtil.read(file, PartsImportExcelVO.class, listener);
System.out.println(" list = " + list);
if (!excelReadUtil.getFlag())
ExcelUtils.write(response, IMPORT_TEMPLATE, "配件列表", PartsImportExcelVO.class, list);
else {
@@ -147,7 +147,7 @@ public class PlateController {
if (!plateExcelUtil.getFlag())
ExcelUtils.write(response, IMPORT_TEMPLATE, "板材列表", PlateImportExcelVO.class, list);
else {
if (list.size() == 0){
if (list.isEmpty()){
PlateImportExcelVO plateImportExcelVO = PlateImportExcelVO.builder().result("导入失败,请保证导入文件中包含板材数据").build();
list.add(plateImportExcelVO);
ExcelUtils.write(response, IMPORT_TEMPLATE, "板材列表", PlateImportExcelVO.class, list);
@@ -6,6 +6,9 @@ import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.cf.imes.module.infra.enums.ErrorCodeConstants.FILE_NOT_EXISTS;
/**
* 文件上传下载相工具类
*/
@@ -32,7 +35,7 @@ public class FileHelperUtil {
outputStream.write(buffer);
outputStream.flush();
} catch (IOException ex) {
ex.printStackTrace();
throw exception(FILE_NOT_EXISTS);
}
}
}