From a756255136e9244180f90d6dcfb51529e2ac8a9b Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期一, 03 六月 2024 21:13:35 +0800
Subject: [PATCH] 提交【管理后台】-大屏操作台相关接口

---
 ruoyi-modules/ruoyi-promotion/src/main/java/com/ruoyi/promotion/service/impl/PromotionWishListServiceImpl.java |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/ruoyi-modules/ruoyi-promotion/src/main/java/com/ruoyi/promotion/service/impl/PromotionWishListServiceImpl.java b/ruoyi-modules/ruoyi-promotion/src/main/java/com/ruoyi/promotion/service/impl/PromotionWishListServiceImpl.java
index 02ca19d..57c439b 100644
--- a/ruoyi-modules/ruoyi-promotion/src/main/java/com/ruoyi/promotion/service/impl/PromotionWishListServiceImpl.java
+++ b/ruoyi-modules/ruoyi-promotion/src/main/java/com/ruoyi/promotion/service/impl/PromotionWishListServiceImpl.java
@@ -1,10 +1,20 @@
 package com.ruoyi.promotion.service.impl;
 
-import com.ruoyi.promotion.domain.pojo.PromotionWishList;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.utils.page.PageDTO;
+import com.ruoyi.promotion.controller.forepart.dto.PromotionWishListDTO;
+import com.ruoyi.promotion.domain.PromotionWishList;
 import com.ruoyi.promotion.mapper.PromotionWishListMapper;
 import com.ruoyi.promotion.service.IPromotionWishListService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.system.api.util.HuaWeiOBSUtil;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * <p>
@@ -17,4 +27,49 @@
 @Service
 public class PromotionWishListServiceImpl extends ServiceImpl<PromotionWishListMapper, PromotionWishList> implements IPromotionWishListService {
 
+
+    @Override
+    public PageDTO<PromotionWishList> getPromotionWishList(PromotionWishListDTO promotionWishListDTO) {
+
+        Page<PromotionWishList> page = new Page<>(promotionWishListDTO.getPageCurr(), promotionWishListDTO.getPageSize());
+        LambdaQueryWrapper<PromotionWishList> wrapper= Wrappers.lambdaQuery();
+        wrapper.eq(PromotionWishList::getMemberId,promotionWishListDTO.getMemberId());
+        Page<PromotionWishList> page1 = this.page(page, wrapper);
+        return PageDTO.of(page1);
+    }
+
+    @Override
+    public void savePromotionWishList(PromotionWishListDTO promotionWishListDTO) {
+        PromotionWishList promotionWishList=new PromotionWishList();
+        promotionWishList.setExpectedPrice(promotionWishListDTO.getExpectedPrice());
+        promotionWishList.setGoodsName(promotionWishListDTO.getGoodsName());
+        promotionWishList.setRemark(promotionWishListDTO.getRemark());
+        List<String> urlList=new ArrayList<>();
+        if (promotionWishListDTO.getGoodsImageUrl().length>0){
+            for (MultipartFile file:promotionWishListDTO.getGoodsImageUrl()){
+                try {
+                    String url= HuaWeiOBSUtil.obsUpload(file);
+                    urlList.add(url);
+                } catch (IOException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+            promotionWishList.setGoodsImageUrl(urlList.toString());
+        }
+        this.save(promotionWishList);
+    }
+
+    @Override
+    public void delPromotionWishOne(PromotionWishListDTO promotionWishListDTO) {
+        this.removeById(promotionWishListDTO.getRomotionWishId());
+    }
+
+    @Override
+    public PromotionWishList getPromotionWishOne(PromotionWishListDTO promotionWishListDTO) {
+        LambdaQueryWrapper<PromotionWishList> wrapper= Wrappers.lambdaQuery();
+        wrapper.eq(PromotionWishList::getId,promotionWishListDTO.getRomotionWishId());
+        wrapper.eq(PromotionWishList::getDelFlag,0);
+        return this.getOne(wrapper);
+    }
+
 }

--
Gitblit v1.7.1