From 61b5f9863f14ab4fc9da504ca2b553a778eb2e2c Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期三, 24 一月 2024 15:10:32 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/HongRuiTang

---
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java |   43 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 41 insertions(+), 2 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 303589a..73e2e9b 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
@@ -137,6 +137,34 @@
     }
 
     /**
+     * @description  修改统一分成
+     * @author  jqs
+     * @date    2023/9/4 18:05
+     * @param mgtShopCommonProportionEditDto
+     * @return  void
+     */
+    @Override
+    public void editShopProportion(MgtShopCommonProportionEditDto mgtShopCommonProportionEditDto){
+        // 获取平台统一分成的配置
+        CustomConfig customConfig = getByKey(ConfigEnum.SHOP_COMMON_PROPORTION.getKey());
+        // 如果配置不存在,则创建一个新的配置
+        if (customConfig == null) {
+            customConfig = new CustomConfig();
+            customConfig.setCreateTime(new Date());
+            customConfig.setDelFlag(0);
+        }
+        // 设置配置的类型、键、名称、值和更新时间
+        customConfig.setConfigType(ConfigEnum.SHOP_COMMON_PROPORTION.getKeyType());
+        customConfig.setConfigKey(ConfigEnum.SHOP_COMMON_PROPORTION.getKey());
+        customConfig.setConfigName(ConfigEnum.SHOP_COMMON_PROPORTION.getKeyName());
+        customConfig.setConfigValue(mgtShopCommonProportionEditDto.getShopCommonProportion());
+        customConfig.setUpdateTime(new Date());
+        // 保存或更新配置
+        this.saveOrUpdate(customConfig);
+        redisService.setCacheObject(SecurityConstant.SHOP_COMMON_PROPORTION,mgtShopCommonProportionEditDto.getShopCommonProportion());
+    }
+
+    /**
      * @param
      * @return MgtCustomConfigVo
      * @description 平台获取自定义配置
@@ -176,6 +204,9 @@
                         break;
                     case "SHOP_EMERGENCY_DEGREE":
                         mgtAllCustomConfigVo.setShopEmergencyDegree(value.getConfigValue());
+                        break;
+                    case "SHOP_COMMON_PROPORTION":
+                        mgtAllCustomConfigVo.setShopCommonProportion(value.getConfigValue());
                         break;
                     case "SHOP_FOLLOW_TYPE":
                         mgtAllCustomConfigVo.setShopFollowType(value.getConfigValue());
@@ -397,6 +428,13 @@
                         }
                         updatedCustomConfigs.add(customConfig);
                         break;
+                    case "SHOP_COMMON_PROPORTION":
+                        newValue = mgtShopConfigEditDto.getShopCommonProportion();
+                        customConfig.setConfigValue(newValue);
+                        customConfig.setUpdateTime(updateTime);
+                        updatedCustomConfigs.add(customConfig);
+                        redisService.setCacheObject(SecurityConstant.SHOP_COMMON_PROPORTION,mgtShopConfigEditDto.getShopCommonProportion());
+                        break;
                     default:
                         break;
                 }
@@ -409,6 +447,7 @@
             createNewConfig(ConfigEnum.SHOP_FOLLOW_TYPE, mgtShopConfigEditDto.getShopFollowType(), updateTime);
             createNewConfig(ConfigEnum.SHOP_CUSTOM_STATUS, mgtShopConfigEditDto.getShopCustomStatus(), updateTime);
             createNewConfig(ConfigEnum.SHOP_SOURCE_CHANNEL, mgtShopConfigEditDto.getShopSourceChannel(), updateTime);
+            createNewConfig(ConfigEnum.SHOP_COMMON_PROPORTION, mgtShopConfigEditDto.getShopCommonProportion(), updateTime);
         }
     }
 
@@ -646,9 +685,9 @@
         mgtBulletinBoardVo.setSalesTotal(mgtBulletinBoardVoOrder.getSalesTotal());
         mgtBulletinBoardVo.setUnUseOrderTotal(mgtBulletinBoardVoOrder.getUnUseOrderTotal());
         mgtBulletinBoardVo.setActivityOrderTotal(mgtBulletinBoardVoOrder.getActivityOrderTotal());
+        mgtBulletinBoardVo.setActivityUserTotal(mgtBulletinBoardVoOrder.getActivityUserTotal());
         // 获取活动信息
-        MgtBulletinBoardVo mgtBulletinBoardVoActivity = remoteActivityService.boardActivityTotal().getData();
-        mgtBulletinBoardVo.setActivityUserTotal(mgtBulletinBoardVoActivity.getActivityUserTotal());
+        //MgtBulletinBoardVo mgtBulletinBoardVoActivity = remoteActivityService.boardActivityTotal().getData();
         //待回复建议数量
         Integer countA = remoteMemberService.getUnReplaySuggestVo().getData();
         Integer countB = remoteShopService.getUnReplaySuggestVo().getData();

--
Gitblit v1.7.1