From dbf0844fc80f5bb0c4d44a4e211789e0be09cf2c Mon Sep 17 00:00:00 2001
From: liuxm <liuxm_a@163.com>
Date: 星期四, 23 五月 2024 11:37:53 +0800
Subject: [PATCH] 产品文件相关修改

---
 pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java |   15 +++++++++++----
 pms-parent/pms-global/src/main/resources/mapper/PltProParamsMapper.xml              |    3 +++
 pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml                |    2 +-
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/pms-parent/pms-global/src/main/resources/mapper/PltProParamsMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PltProParamsMapper.xml
index 47743cb..0f9eae0 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PltProParamsMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PltProParamsMapper.xml
@@ -86,6 +86,9 @@
       <if test="paramValue != null">
         param_value = #{paramValue,jdbcType=VARCHAR},
       </if>
+      <if test="deleted != null">
+        deleted = #{deleted,jdbcType=TINYINT}
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
diff --git a/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
index 07d8341..d574797 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
@@ -149,7 +149,7 @@
   </update>
 
 
-  <select id="selectSome" resultMap="BaseResultMap">
+  <select id="selectSome" resultMap="BaseResultMap2">
     select
     <include refid="Base_Column_List" />
     from plt_product p
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 86a72d0..5f13142 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
@@ -14,6 +14,7 @@
 import com.dy.pmsGlobal.pojoPlt.PltProductFile;
 import jakarta.servlet.http.HttpServletResponse;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.dubbo.common.utils.PojoUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -128,10 +129,8 @@
 
     private void saveRel(PltProduct p, List<PltProductFile> docs) {
         docs.forEach(doc -> {
-            if(doc.id == null){
-                doc.proId = p.id;
-                pfDao.insertSelective(doc);
-            }
+            doc.proId = p.id;
+            pfDao.insertSelective(doc);
         });
     }
 
@@ -163,6 +162,9 @@
 
             pro.proFiles.stream().forEach(doc -> {
                  OthFile file = othFileMapper.selectByPrimaryKey(doc.fileId);
+                 if (file == null) {
+                     return;
+                 }
                  FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash);
 
                  doc.webUrl = fileRestVo.fileWebUrl + file.filePath;
@@ -192,6 +194,11 @@
         rsVo.calculateAndSet(itemTotal, params);
         //鏌ヨ绗﹀悎鏉′欢鐨勮褰�
         rsVo.obj = dao.selectSome(params) ;
+        if(CollectionUtils.isNotEmpty(rsVo.obj)){
+            rsVo.obj.forEach(pro->{
+                pro = addWebUrl(pro);
+            });
+        }
         return rsVo ;
     }
 

--
Gitblit v1.8.0