fix: 产品标准去除重复文件接口,添加忽略后缀名大小写

This commit is contained in:
wxyclub
2023-11-20 15:36:17 +08:00
parent 8607c6621b
commit 5868ae2ba0
@@ -216,6 +216,11 @@ public class SarBussStandFileServiceImpl extends ServiceImpl<SarBussStandFileDao
List<SarBussStandFile> sarBussStandFileList = sarStandFileEODao.selectList(wrapper1);
sarBussStandFileList.forEach(each -> {
String fileName = each.getFileName().replace("/", "").replace("_", "");
// 把文件名后缀忽略大小写
int dotIndex = fileName.lastIndexOf(".");
if (dotIndex!= -1) {
fileName = fileName.substring(0, dotIndex) + fileName.substring(dotIndex).toLowerCase();
}
each.setFileName(fileName);
});
// 使用 HashMap 记录已经出现过的 fileName