代码调整
This commit is contained in:
@@ -24,6 +24,7 @@ public enum SupervisionResponseEnum {
|
|||||||
NO_USER_REPORT_UPDATE("A00550","常态化干扰源用户管理信息更新失败,不存在该条信息"),
|
NO_USER_REPORT_UPDATE("A00550","常态化干扰源用户管理信息更新失败,不存在该条信息"),
|
||||||
NO_DEPT_POWER("A00550","不能操作非自己部门创建的任务"),
|
NO_DEPT_POWER("A00550","不能操作非自己部门创建的任务"),
|
||||||
IMPORT_DEV_ERROR("A00550","导入终端检测失败"),
|
IMPORT_DEV_ERROR("A00550","导入终端检测失败"),
|
||||||
|
IMPORT_DEV_DATA_ERROR("A00550","终端数据为空"),
|
||||||
DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"),
|
DELETE_TO_BE_SUBMITTED("A00550","流程删除失败,只有待提交信息可删除!"),
|
||||||
EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"),
|
EXISTENCE_OR_NOT("A00550","信息查询为空,请检查信息是否存在!"),
|
||||||
NAME_EXISTS("A00550","名称重复"),
|
NAME_EXISTS("A00550","名称重复"),
|
||||||
|
|||||||
@@ -503,15 +503,20 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
params.setNeedVerify(true);
|
params.setNeedVerify(true);
|
||||||
params.setStartSheetIndex(0);
|
params.setStartSheetIndex(0);
|
||||||
params.setSheetNum(1);
|
params.setSheetNum(1);
|
||||||
List<SupervisionDevMainReportExcel> devExcels = new ArrayList<>();
|
List<SupervisionDevMainReportExcel> devExcels;
|
||||||
try {
|
try {
|
||||||
ExcelImportResult<SupervisionDevMainReportExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SupervisionDevMainReportExcel.class, params);
|
List<SupervisionDevMainReportExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcel(file.getInputStream(), SupervisionDevMainReportExcel.class, params);
|
||||||
//如果存在非法数据,将不合格的数据导出
|
// 过滤掉空的数据
|
||||||
if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
devExcels = sensitiveUserExcelExcelImportResult.stream().filter(x -> StringUtils.isNotBlank(x.getCity())).collect(Collectors.toList());
|
||||||
PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法数据.xlsx", response);
|
if(CollectionUtil.isEmpty(devExcels)){
|
||||||
} else {
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_DATA_ERROR);
|
||||||
devExcels = sensitiveUserExcelExcelImportResult.getList();
|
|
||||||
}
|
}
|
||||||
|
//如果存在非法数据,将不合格的数据导出
|
||||||
|
// if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
||||||
|
// PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法数据.xlsx", response);
|
||||||
|
// } else {
|
||||||
|
// devExcels = sensitiveUserExcelExcelImportResult.getList();
|
||||||
|
// }
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_ERROR);
|
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_ERROR);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user