|
@@ -153,7 +153,7 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
|
|
|
.collect(Collectors.toList());
|
|
|
// 插入前端传来的新文件
|
|
|
for (ZFileBo pic : bo.getFiles()) {
|
|
|
- if (!existingPhotos.contains(pic)) {
|
|
|
+ if (!existingPhotos.contains(pic.getUrl())) {
|
|
|
ZEngiineeringPhoto newPhoto = new ZEngiineeringPhoto();
|
|
|
newPhoto.setParentId(bo.getId());
|
|
|
newPhoto.setPicUrl(pic.getUrl());
|
|
@@ -165,7 +165,7 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
|
|
|
}
|
|
|
// 删除数据库中多余的文件
|
|
|
List<String> photosToDelete = existingPhotos.stream()
|
|
|
- .filter(pic -> !bo.getFiles().contains(pic))
|
|
|
+ .filter(pic -> !bo.getFiles().stream().map(ZFileBo::getUrl).collect(Collectors.toList()).contains(pic))
|
|
|
.collect(Collectors.toList());
|
|
|
if (!photosToDelete.isEmpty()) {
|
|
|
photosToDelete.forEach(item->{
|