From a9bf1966f94955f542d39147fb1539befe2b4eec Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期四, 09 五月 2024 17:57:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java
index 2288545..d240b5e 100644
--- a/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java
+++ b/modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java
@@ -89,9 +89,14 @@
             sysPictureBaseService.insert(sysPictureBase);
         }
         if (sysPictureBase.getIsDefault()==1){
-            if (!sysPictureBase.getId().equals(pictureBase.getId())){
+            if (pictureBase.getId()==null){
                 sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType());
-                sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),pictureBase.getId());
+                sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),null);
+            }else{
+                if (!sysPictureBase.getId().equals(pictureBase.getId())){
+                    sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType());
+                    sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),pictureBase.getId());
+                }
             }
         }
         if (file != null) {

--
Gitblit v1.9.1