From fd3819392c0c3fafc4f1d7d254b952207ddca3b5 Mon Sep 17 00:00:00 2001
From: liuxm <liuxm_a@163.com>
Date: 星期四, 23 五月 2024 10:56:39 +0800
Subject: [PATCH] 产品文件相关修改
---
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
index 1512b4a..86a72d0 100644
--- a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
+++ b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
@@ -119,19 +119,19 @@
if(param.id !=null){
paramDao.updateByPrimaryKeySelective(param);
}else{
+ param.deleted=false;
paramDao.insert(param);
}
});
- saveRel(p, p.processDocuments, "01");
- saveRel(p, p.userManual, "02");
- saveRel(p, p.materials, "03");
+ saveRel(p, p.proFiles);
}
- private void saveRel(PltProduct p, List<PltProductFile> docs, String fileType) {
+ private void saveRel(PltProduct p, List<PltProductFile> docs) {
docs.forEach(doc -> {
- doc.proId = p.id;
- doc.fileType = fileType;
- pfDao.insert(doc);
+ if(doc.id == null){
+ doc.proId = p.id;
+ pfDao.insertSelective(doc);
+ }
});
}
@@ -161,11 +161,7 @@
pro.imageWebPathZip = fileOperate.getImgFileZipPath(filePathWithWebUrl);
}
- Stream.concat(
- pro.userManual.stream(),
- Stream.concat(pro.processDocuments.stream(), pro.materials.stream())
- )
- .forEach(doc -> {
+ pro.proFiles.stream().forEach(doc -> {
OthFile file = othFileMapper.selectByPrimaryKey(doc.fileId);
FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash);
--
Gitblit v1.8.0