From 1ffb6c7910cfb4d55b4c169142b67ea872fcf614 Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期二, 27 六月 2023 19:55:50 +0800
Subject: [PATCH] BUG联调

---
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java |  115 ++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 85 insertions(+), 30 deletions(-)

diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java
index 21e970f..0ea858e 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java
@@ -5,6 +5,11 @@
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.system.api.constant.ConfigEnum;
 import com.ruoyi.system.api.domain.poji.config.Activeness;
+import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo;
+import com.ruoyi.system.api.service.RemoteActivityService;
+import com.ruoyi.system.api.service.RemoteMemberService;
+import com.ruoyi.system.api.service.RemoteOrderService;
+import com.ruoyi.system.api.service.RemoteShopService;
 import com.ruoyi.system.domain.dto.*;
 import com.ruoyi.system.domain.pojo.config.Advert;
 import com.ruoyi.system.domain.pojo.config.CustomConfig;
@@ -16,6 +21,7 @@
 import com.ruoyi.system.service.config.ActivenessService;
 import com.ruoyi.system.service.config.AdvertService;
 import com.ruoyi.system.service.config.CustomConfigService;
+import com.ruoyi.system.service.config.RecommendCooperationService;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -43,6 +49,20 @@
     @Resource
     private ActivenessService activenessService;
 
+    @Resource
+    private RemoteMemberService remoteMemberService;
+
+    @Resource
+    private RecommendCooperationService recommendCooperationService;
+
+    @Resource
+    private RemoteShopService remoteShopService;
+
+    @Resource
+    private RemoteOrderService remoteOrderService;
+
+    @Resource
+    private RemoteActivityService remoteActivityService;
 
     /**
      * @param key
@@ -71,6 +91,7 @@
         if (customConfig == null) {
             customConfig = new CustomConfig();
             customConfig.setCreateTime(new Date());
+            customConfig.setDelFlag(0);
         }
         // 设置配置的类型、键、名称、值和更新时间
         customConfig.setConfigType(ConfigEnum.PLATFORM_SERVICE_PHONE.getKeyType());
@@ -232,41 +253,36 @@
             customConfig.setConfigType(configEnum.getKeyType());
             customConfig.setConfigKey(configEnum.getKey());
             customConfig.setConfigName(configEnum.getKeyName());
-            customConfig.setConfigValue(getConfigValue(configEnum, mgtOtherConfigEditDto));
             customConfig.setCreateTime(updateTime);
             customConfig.setUpdateTime(updateTime);
-            this.saveOrUpdate(customConfig);
+            switch (configEnum) {
+                case SHARE_INTEGRAL:
+                    customConfig.setConfigValue(mgtOtherConfigEditDto.getShareIntegral().toString());
+                    this.saveOrUpdate(customConfig);
+                case SUGGEST_PLATFORM_INTEGRAL:
+                    customConfig.setConfigValue(mgtOtherConfigEditDto.getSuggestPlatformIntegral().toString());
+                    this.saveOrUpdate(customConfig);
+                case SIGN_IN_INTEGRAL:
+                    customConfig.setConfigValue(mgtOtherConfigEditDto.getSignInIntegral().toString());
+                    this.saveOrUpdate(customConfig);
+                case SUGGEST_SHOP_INTEGRAL:
+                    customConfig.setConfigValue(mgtOtherConfigEditDto.getSuggestShopIntegral().toString());
+                    this.saveOrUpdate(customConfig);
+                case ORDER_AUTO_CANCEL_TIME:
+                    customConfig.setConfigValue(mgtOtherConfigEditDto.getOrderAutoCancelTime().toString());
+                    this.saveOrUpdate(customConfig);
+                case PAY_MONEY_INTEGRAL:
+                    customConfig.setConfigValue(mgtOtherConfigEditDto.getPayMoneyIntegral().toString());
+                    this.saveOrUpdate(customConfig);
+                case HOME_STYLE:
+                    customConfig.setConfigValue(mgtOtherConfigEditDto.getHomeStyle().toString());
+                    this.saveOrUpdate(customConfig);
+                default:
+                    break;
+            }
         }
     }
 
-    /**
-     * @param configEnum
-     * @param mgtOtherConfigEditDto
-     * @return String
-     * @description 获取配置参数
-     * @author jqs
-     * @date 2023/6/7 16:37
-     */
-    private String getConfigValue(ConfigEnum configEnum, MgtOtherConfigEditDto mgtOtherConfigEditDto) {
-        switch (configEnum) {
-            case SHARE_INTEGRAL:
-                return mgtOtherConfigEditDto.getShareIntegral().toString();
-            case SUGGEST_PLATFORM_INTEGRAL:
-                return mgtOtherConfigEditDto.getSuggestPlatformIntegral().toString();
-            case SIGN_IN_INTEGRAL:
-                return mgtOtherConfigEditDto.getSignInIntegral().toString();
-            case SUGGEST_SHOP_INTEGRAL:
-                return mgtOtherConfigEditDto.getSuggestShopIntegral().toString();
-            case ORDER_AUTO_CANCEL_TIME:
-                return mgtOtherConfigEditDto.getOrderAutoCancelTime().toString();
-            case PAY_MONEY_INTEGRAL:
-                return mgtOtherConfigEditDto.getPayMoneyIntegral().toString();
-            case HOME_STYLE:
-                return mgtOtherConfigEditDto.getHomeStyle().toString();
-            default:
-                throw new IllegalArgumentException("Invalid ConfigEnum");
-        }
-    }
 
     /**
      * @param mgtShopConfigEditDto
@@ -478,4 +494,43 @@
         }
         return mgtCustomConfigVo;
     }
+
+    /**
+     * @description getBulletinBoard
+     * @param
+     * @return MgtBulletinBoardVo
+     * @author jqs34
+     * @date 2023/6/18 16:41
+     */
+    @Override
+    public MgtBulletinBoardVo getBulletinBoard(){
+        // 创建 MgtBulletinBoardVo 对象
+        MgtBulletinBoardVo mgtBulletinBoardVo = new MgtBulletinBoardVo();
+        // 获取会员信息
+        MgtBulletinBoardVo mgtBulletinBoardVoMember = remoteMemberService.boardMemberTotal().getData();
+        mgtBulletinBoardVo.setMemberTotal(mgtBulletinBoardVoMember.getMemberTotal());
+        mgtBulletinBoardVo.setMemberToday(mgtBulletinBoardVoMember.getMemberToday());
+        // 获取推荐合作信息
+        MgtBulletinBoardVo mgtBulletinBoardVoCustom = recommendCooperationService.boardMemberTotal();
+        mgtBulletinBoardVo.setCustomTotal(mgtBulletinBoardVoCustom.getCustomTotal());
+        mgtBulletinBoardVo.setCustomToday(mgtBulletinBoardVoCustom.getCustomToday());
+        // 获取店铺信息
+        MgtBulletinBoardVo mgtBulletinBoardVoShop = remoteShopService.boardShopTotal().getData();
+        mgtBulletinBoardVo.setShopTotal(mgtBulletinBoardVoShop.getShopTotal());
+        mgtBulletinBoardVo.setAgencyTotal(mgtBulletinBoardVoShop.getAgencyTotal());
+        mgtBulletinBoardVo.setDealerTotal(mgtBulletinBoardVoShop.getDealerTotal());
+        mgtBulletinBoardVo.setFollowShopToday(mgtBulletinBoardVoShop.getFollowShopToday());
+        mgtBulletinBoardVo.setFollowUserToday(0);
+        // 获取订单信息
+        MgtBulletinBoardVo mgtBulletinBoardVoOrder = remoteOrderService.boardOrderTotal().getData();
+        mgtBulletinBoardVo.setSalesTotal(mgtBulletinBoardVoOrder.getSalesTotal());
+        mgtBulletinBoardVo.setUnUseOrderTotal(mgtBulletinBoardVoOrder.getUnUseOrderTotal());
+        mgtBulletinBoardVo.setActivityOrderTotal(mgtBulletinBoardVoOrder.getActivityOrderTotal());
+        // 获取活动信息
+        MgtBulletinBoardVo mgtBulletinBoardVoActivity = remoteActivityService.boardActivityTotal().getData();
+        mgtBulletinBoardVo.setActivityUserTotal(mgtBulletinBoardVoActivity.getActivityUserTotal());
+        // 返回 MgtBulletinBoardVo 对象
+        return mgtBulletinBoardVo;
+    }
+
 }

--
Gitblit v1.7.1