|
|
@ -510,16 +510,18 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo |
|
|
|
List<CommunitySelfOrgImportExcel> fileList = new ArrayList<>(); |
|
|
|
CommunitySelfOrgImportExcel excel = null; |
|
|
|
//1.读取Excel数据
|
|
|
|
ExcelImportResult<ImportCommunitySelfOrganization> testExcelImportResult = ExcelPoiUtils.importExcelMore(inputStream,0,2,ImportCommunitySelfOrganization.class); |
|
|
|
ExcelImportResult<ImportCommunitySelfOrganization> testExcelImportResult = ExcelPoiUtils.importExcel1(inputStream,0,2,ImportCommunitySelfOrganization.class); |
|
|
|
//2.存在错误行数据时存入错误数据集合中
|
|
|
|
for (ImportCommunitySelfOrganization entity : testExcelImportResult.getFailList()) { |
|
|
|
//打印失败的行 和失败的信息
|
|
|
|
log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); |
|
|
|
excel = new CommunitySelfOrgImportExcel(); |
|
|
|
//excel.setAgencyName(entity.getOrganizationName());
|
|
|
|
excel.setSocietyName(entity.getOrganizationName()); |
|
|
|
excel.setErrorInfo(entity.getErrorMsg()); |
|
|
|
fileList.add(excel); |
|
|
|
if(CollectionUtils.isNotEmpty(testExcelImportResult.getFailList())){ |
|
|
|
for (ImportCommunitySelfOrganization entity : testExcelImportResult.getFailList()) { |
|
|
|
//打印失败的行 和失败的信息
|
|
|
|
log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg()); |
|
|
|
excel = new CommunitySelfOrgImportExcel(); |
|
|
|
//excel.setAgencyName(entity.getOrganizationName());
|
|
|
|
excel.setSocietyName(entity.getOrganizationName()); |
|
|
|
excel.setErrorInfo(entity.getErrorMsg()); |
|
|
|
fileList.add(excel); |
|
|
|
} |
|
|
|
} |
|
|
|
//正确行数据集合
|
|
|
|
List<ImportCommunitySelfOrganization> list = testExcelImportResult.getList(); |
|
|
|