fix: 设计导航没有正确返回预览链接

This commit is contained in:
2024-08-20 16:21:07 +08:00
parent 989e16538a
commit 7b1b4e95e8
2 changed files with 19 additions and 3 deletions
@@ -159,7 +159,7 @@ public class ShiroConfig {
// 获取token
filterChainDefinitionMap.put("/srms/getByToken", "anon");
// 标准法规文档查询
filterChainDefinitionMap.put("/srms/getByLawsFileList", "anon");
// filterChainDefinitionMap.put("/srms/getByLawsFileList", "anon");
// 设计导航-产品设计条款查询
filterChainDefinitionMap.put("/srms/getByLawsProductDesign", "anon");
// 获取所有体系数据
@@ -267,7 +267,15 @@ public class SrmsApiServiceImpl implements SrmsApiService {
List<OSSFile> listFile = listOssFile.stream().filter(o -> Objects.equals(o.getStandardId(), byFileRows.getId())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(listFile)) {
listFile = listFile.stream().sorted(Comparator.comparing(OSSFile::getCreateTime).reversed()).collect(Collectors.toList());
byFileRows.setStandardUrl(getUrl(listFile.get(0), token));
// 查找有没有pdf版本
LambdaQueryWrapper<OSSFile> queryOssFilePdf = new LambdaQueryWrapper<>();
queryOssFilePdf.eq(OSSFile::getBindId, listFile.get(0).getId());
List<OSSFile> list = ossFileService.list(queryOssFilePdf);
if (CollectionUtils.isEmpty(list)) {
byFileRows.setStandardUrl(getUrl(listFile.get(0), token));
} else {
byFileRows.setStandardUrl(getUrl(list.get(0), token));
}
}
}
LambdaQueryWrapper<SarFileSplitInfoEO> querySarFileSplitInfoEo = new LambdaQueryWrapper<>();
@@ -588,7 +596,15 @@ public class SrmsApiServiceImpl implements SrmsApiService {
List<OSSFile> listOssFileOne = listOssFile.stream().filter(o -> Objects.equals(o.getStandardId(), standardPageVO.getId())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(listOssFileOne)) {
listOssFileOne = listOssFileOne.stream().sorted(Comparator.comparing(OSSFile::getCreateTime).reversed()).collect(Collectors.toList());
standardPageVO.setStandardUrl(getUrl(listOssFileOne.get(0), token));
// 查找有没有pdf版本
LambdaQueryWrapper<OSSFile> queryOssFilePdf = new LambdaQueryWrapper<>();
queryOssFilePdf.eq(OSSFile::getBindId, listOssFileOne.get(0).getId());
List<OSSFile> list = ossFileService.list(queryOssFilePdf);
if (CollectionUtils.isEmpty(list)) {
standardPageVO.setStandardUrl(getUrl(listOssFileOne.get(0), token));
} else {
standardPageVO.setStandardUrl(getUrl(list.get(0), token));
}
}
}
// 零件号查询