jinlin
2024-09-19 2902b6d147bf531b6c7cf8a971161c331f738f35
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/sysPictureBase/controller/SysPictureBaseController.java
@@ -73,16 +73,9 @@
        } else {
            sysPictureBaseService.insert(sysPictureBase);
        }
        if (sysPictureBase.getIsDefault()==1){
            if (sysPictureBase.getId()==null){
                sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType());
                sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),null);
            }else{
                if (!sysPictureBase.getId().equals(sysPictureBase.getId())){
                    sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType());
                    sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),sysPictureBase.getId());
                }
            }
        if (sysPictureBase.getIsDefault() == 1 && sysPictureBase.getProductType()!=20) {
            sysPictureBaseService.updateByDefault(sysPictureBase.getId(), sysPictureBase.getProductType());
            sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(), sysPictureBase.getProductType(), null);
        }
        return Result.ok();
    }
@@ -111,7 +104,7 @@
            //关流
            outputStream.close();
            in.close();
        }  catch (IOException e) {
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
@@ -126,7 +119,7 @@
            response.getWriter().flush();
            response.getWriter().close();
        }  catch (IOException e) {
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
@@ -136,6 +129,7 @@
        SysPictureBase data = sysPictureBaseService.getDefaultImg(productType);
        return Result.ok(data);
    }
    @DeleteMapping
    @ApiOperation("删除")
    @LogOperation("删除")