ci: 注释掉老法规导入文件对应关系问题
This commit is contained in:
+39
-39
@@ -287,19 +287,19 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl<LawsEnterpris
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 根据文件路径获取文件Id
|
// 根据文件路径获取文件Id
|
||||||
String originPath = dto.getSclj();
|
// String originPath = dto.getSclj();
|
||||||
if (StrUtil.isNotBlank(originPath)) {
|
// if (StrUtil.isNotBlank(originPath)) {
|
||||||
String filePath = this.getFilePath(originPath);
|
// String filePath = this.getFilePath(originPath);
|
||||||
if (MinioUtil.doesObjectExist(filePath)) {
|
// if (MinioUtil.doesObjectExist(filePath)) {
|
||||||
// 存入关系表
|
// // 存入关系表
|
||||||
OSSFile ossFile = new OSSFile();
|
// OSSFile ossFile = new OSSFile();
|
||||||
ossFile.setUrl(filePath);
|
// ossFile.setUrl(filePath);
|
||||||
ossFile.setStandardNo(dto.getBzh());
|
// ossFile.setStandardNo(dto.getBzh());
|
||||||
ossFile.setFileName(FileUtil.getName(filePath));
|
// ossFile.setFileName(FileUtil.getName(filePath));
|
||||||
ossFile.setStandardFileType("publish_of_original");
|
// ossFile.setStandardFileType("publish_of_original");
|
||||||
ossFileList.add(ossFile);
|
// ossFileList.add(ossFile);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
gbList.add(gb);
|
gbList.add(gb);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("导入转换国标数据时发生错误:{}", e.getMessage());
|
log.error("导入转换国标数据时发生错误:{}", e.getMessage());
|
||||||
@@ -318,7 +318,7 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl<LawsEnterpris
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. 将文件关系列表转为Map,用于快速查找
|
// 3. 将文件关系列表转为Map,用于快速查找
|
||||||
Map<String, List<OSSFile>> standardNumberToFileMap = ossFileList.stream().collect(Collectors.groupingBy(OSSFile::getStandardNo));
|
// Map<String, List<OSSFile>> standardNumberToFileMap = ossFileList.stream().collect(Collectors.groupingBy(OSSFile::getStandardNo));
|
||||||
|
|
||||||
// 4. 遍历待保存或更新的列表,设置ID
|
// 4. 遍历待保存或更新的列表,设置ID
|
||||||
StringBuilder oldIds = new StringBuilder();
|
StringBuilder oldIds = new StringBuilder();
|
||||||
@@ -355,11 +355,11 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl<LawsEnterpris
|
|||||||
entity.setReplacedByStandardNumber(null);
|
entity.setReplacedByStandardNumber(null);
|
||||||
domesticStandardService.saveOrUpdate(entity);
|
domesticStandardService.saveOrUpdate(entity);
|
||||||
String standardId = entity.getId();
|
String standardId = entity.getId();
|
||||||
// 保存文件关联
|
// 保存文件关联 //TODO 处理空指针
|
||||||
OSSFile ossFile = standardNumberToFileMap.get(entity.getStandardNumber()).get(0);
|
// OSSFile ossFile = standardNumberToFileMap.get(entity.getStandardNumber()).get(0);
|
||||||
ossFile.setStandardId(standardId);
|
// ossFile.setStandardId(standardId);
|
||||||
ossFileService.save(ossFile);
|
// ossFileService.save(ossFile);
|
||||||
entity.setId(standardId);
|
// entity.setId(standardId);
|
||||||
}
|
}
|
||||||
log.info("老法规国标覆盖导入完成");
|
log.info("老法规国标覆盖导入完成");
|
||||||
// 获取当前时间戳(毫秒)
|
// 获取当前时间戳(毫秒)
|
||||||
@@ -439,19 +439,19 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl<LawsEnterpris
|
|||||||
es.setCategoryCode(excelUtils.translateDictValue("standard_category_code", categoryCode, listDict));
|
es.setCategoryCode(excelUtils.translateDictValue("standard_category_code", categoryCode, listDict));
|
||||||
}
|
}
|
||||||
// 根据文件路径获取文件Id
|
// 根据文件路径获取文件Id
|
||||||
String originPath = dto.getSclj();
|
// String originPath = dto.getSclj();
|
||||||
if (StrUtil.isNotBlank(originPath)) {
|
// if (StrUtil.isNotBlank(originPath)) {
|
||||||
String filePath = this.getFilePath(originPath);
|
// String filePath = this.getFilePath(originPath);
|
||||||
if (MinioUtil.doesObjectExist(filePath)) {
|
// if (MinioUtil.doesObjectExist(filePath)) {
|
||||||
// 存入关系表
|
// // 存入关系表
|
||||||
OSSFile ossFile = new OSSFile();
|
// OSSFile ossFile = new OSSFile();
|
||||||
ossFile.setUrl(filePath);
|
// ossFile.setUrl(filePath);
|
||||||
ossFile.setStandardNo(dto.getBzh());
|
// ossFile.setStandardNo(dto.getBzh());
|
||||||
ossFile.setFileName(FileUtil.getName(filePath));
|
// ossFile.setFileName(FileUtil.getName(filePath));
|
||||||
ossFile.setStandardFileType("publish_of_original");
|
// ossFile.setStandardFileType("publish_of_original");
|
||||||
ossFileList.add(ossFile);
|
// ossFileList.add(ossFile);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
esList.add(es);
|
esList.add(es);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("导入转换企标数据时发生错误:{}", e.getMessage());
|
log.error("导入转换企标数据时发生错误:{}", e.getMessage());
|
||||||
@@ -470,7 +470,7 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl<LawsEnterpris
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. 将文件关系列表转为Map,用于快速查找
|
// 3. 将文件关系列表转为Map,用于快速查找
|
||||||
Map<String, List<OSSFile>> standardNumberToFileMap = ossFileList.stream().collect(Collectors.groupingBy(OSSFile::getStandardNo));
|
// Map<String, List<OSSFile>> standardNumberToFileMap = ossFileList.stream().collect(Collectors.groupingBy(OSSFile::getStandardNo));
|
||||||
|
|
||||||
// 4. 遍历待保存或更新的列表,设置ID
|
// 4. 遍历待保存或更新的列表,设置ID
|
||||||
StringBuilder oldIds = new StringBuilder();
|
StringBuilder oldIds = new StringBuilder();
|
||||||
@@ -511,12 +511,12 @@ public class LawsEnterpriseStandardServiceImpl extends ServiceImpl<LawsEnterpris
|
|||||||
// 保存文件关联
|
// 保存文件关联
|
||||||
String standardId = entity.getId();
|
String standardId = entity.getId();
|
||||||
// 保存文件关联
|
// 保存文件关联
|
||||||
List<OSSFile> ossFiles = standardNumberToFileMap.get(entity.getStandardNumber());
|
// List<OSSFile> ossFiles = standardNumberToFileMap.get(entity.getStandardNumber());
|
||||||
if (ossFiles != null && !ossFiles.isEmpty()) {
|
// if (ossFiles != null && !ossFiles.isEmpty()) {
|
||||||
OSSFile ossFile = ossFiles.get(0);
|
// OSSFile ossFile = ossFiles.get(0);
|
||||||
ossFile.setStandardId(standardId);
|
// ossFile.setStandardId(standardId);
|
||||||
ossFileService.save(ossFile);
|
// ossFileService.save(ossFile);
|
||||||
}
|
// }
|
||||||
entity.setId(standardId);
|
entity.setId(standardId);
|
||||||
// 拼接新id
|
// 拼接新id
|
||||||
newIds.append(standardId).append(",");
|
newIds.append(standardId).append(",");
|
||||||
|
|||||||
Reference in New Issue
Block a user