|
|
@ -279,7 +279,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
relationEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
|
relationEntity.setIcNatId(formDTO.getIcNatId()); |
|
|
|
relationEntity.setAgencyId(staffInfo.getAgencyId()); |
|
|
|
relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds())?staffInfo.getAgencyPIds()+":"+formDTO.getAgencyId():staffInfo.getAgencyId()); |
|
|
|
relationEntity.setPids(StringUtils.isNotBlank(staffInfo.getAgencyPIds())?staffInfo.getAgencyPIds()+":"+staffInfo.getAgencyId():staffInfo.getAgencyId()); |
|
|
|
relationEntity.setUserType("synchro"); |
|
|
|
icNatRelationDao.insert(relationEntity); |
|
|
|
} |
|
|
@ -334,27 +334,29 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
// 合并到一起写入
|
|
|
|
errorRows.addAll(otherRows); |
|
|
|
|
|
|
|
// 生成并上传错误文件
|
|
|
|
try { |
|
|
|
// 文件生成
|
|
|
|
Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_nat", "import", "error_des"); |
|
|
|
String fileName = UUID.randomUUID().toString().concat(".xlsx"); |
|
|
|
errorDescFile = errorDescDir.resolve(fileName); |
|
|
|
|
|
|
|
FileItemFactory factory = new DiskFileItemFactory(16, errorDescDir.toFile()); |
|
|
|
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName); |
|
|
|
OutputStream os = fileItem.getOutputStream(); |
|
|
|
|
|
|
|
EasyExcel.write(os, IcNatImportExcelData.RowRemarkMessage.class).sheet("信息列表").doWrite(errorRows); |
|
|
|
|
|
|
|
// 文件上传oss
|
|
|
|
Result<UploadImgResultDTO> errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); |
|
|
|
if (errorDesFileUploadResult.success()) { |
|
|
|
errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); |
|
|
|
} |
|
|
|
} finally { |
|
|
|
if (Files.exists(errorDescFile)) { |
|
|
|
Files.delete(errorDescFile); |
|
|
|
// 生成并上传描述文件
|
|
|
|
if (errorRows.size() > 0) { |
|
|
|
try { |
|
|
|
// 文件生成
|
|
|
|
Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_nat", "import", "error_des"); |
|
|
|
String fileName = UUID.randomUUID().toString().concat(".xlsx"); |
|
|
|
errorDescFile = errorDescDir.resolve(fileName); |
|
|
|
|
|
|
|
FileItemFactory factory = new DiskFileItemFactory(16, errorDescDir.toFile()); |
|
|
|
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName); |
|
|
|
OutputStream os = fileItem.getOutputStream(); |
|
|
|
|
|
|
|
EasyExcel.write(os, IcNatImportExcelData.RowRemarkMessage.class).sheet("信息列表").doWrite(errorRows); |
|
|
|
// 文件上传oss
|
|
|
|
Result<UploadImgResultDTO> errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); |
|
|
|
if (errorDesFileUploadResult.success()) { |
|
|
|
errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); |
|
|
|
} |
|
|
|
|
|
|
|
} finally { |
|
|
|
if (Files.exists(errorDescFile)) { |
|
|
|
Files.delete(errorDescFile); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|