From aa0131b1efb96c9f52371160b3a1e6823db3656a Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期四, 07 十二月 2023 13:02:26 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java |  103 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 91 insertions(+), 12 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 f25a3be..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
@@ -110,6 +110,61 @@
     }
 
     /**
+     * @description  修改客服二维码
+     * @author  jqs
+     * @date    2023/7/25 16:17
+     * @param mgtServiceCodeEditDto
+     * @return  void
+     */
+    @Override
+    public void editServiceCode(MgtServiceCodeEditDto mgtServiceCodeEditDto){
+        // 获取平台服务电话的配置
+        CustomConfig customConfig = getByKey(ConfigEnum.PLATFORM_SERVICE_CODE.getKey());
+        // 如果配置不存在,则创建一个新的配置
+        if (customConfig == null) {
+            customConfig = new CustomConfig();
+            customConfig.setCreateTime(new Date());
+            customConfig.setDelFlag(0);
+        }
+        // 设置配置的类型、键、名称、值和更新时间
+        customConfig.setConfigType(ConfigEnum.PLATFORM_SERVICE_CODE.getKeyType());
+        customConfig.setConfigKey(ConfigEnum.PLATFORM_SERVICE_CODE.getKey());
+        customConfig.setConfigName(ConfigEnum.PLATFORM_SERVICE_CODE.getKeyName());
+        customConfig.setConfigValue(mgtServiceCodeEditDto.getServiceCodeUrl());
+        customConfig.setUpdateTime(new Date());
+        // 保存或更新配置
+        this.saveOrUpdate(customConfig);
+    }
+
+    /**
+     * @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 平台获取自定义配置
@@ -150,6 +205,9 @@
                     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());
                         break;
@@ -186,6 +244,7 @@
             mgtAllCustomConfigVo.setHomeLogo(advert.getLogoUrl());
             mgtAllCustomConfigVo.setAdUrl(advert.getAdUrl());
             mgtAllCustomConfigVo.setTargetType(advert.getTargetType());
+            mgtAllCustomConfigVo.setLinkType(advert.getLinkType());
             mgtAllCustomConfigVo.setLinkUrl(advert.getLinkUrl());
             mgtAllCustomConfigVo.setJumpType(advert.getJumpType());
             mgtAllCustomConfigVo.setJumpId(advert.getJumpId());
@@ -339,8 +398,8 @@
                         customConfig.setUpdateTime(updateTime);
                         if(oldValue!=null&&!oldValue.isEmpty()){
                             handleChangeConfig(oldValue, newValue, key);
-                            updatedCustomConfigs.add(customConfig);
                         }
+                        updatedCustomConfigs.add(customConfig);
                         break;
                     case "SHOP_FOLLOW_TYPE":
                         newValue = mgtShopConfigEditDto.getShopFollowType();
@@ -348,8 +407,8 @@
                         customConfig.setUpdateTime(updateTime);
                         if(oldValue!=null&&!oldValue.isEmpty()){
                             handleChangeConfig(oldValue, newValue, key);
-                            updatedCustomConfigs.add(customConfig);
                         }
+                        updatedCustomConfigs.add(customConfig);
                         break;
                     case "SHOP_CUSTOM_STATUS":
                         newValue = mgtShopConfigEditDto.getShopCustomStatus();
@@ -357,8 +416,8 @@
                         customConfig.setUpdateTime(updateTime);
                         if(oldValue!=null&&!oldValue.isEmpty()){
                             handleChangeConfig(oldValue, newValue, key);
-                            updatedCustomConfigs.add(customConfig);
                         }
+                        updatedCustomConfigs.add(customConfig);
                         break;
                     case "SHOP_SOURCE_CHANNEL":
                         newValue = mgtShopConfigEditDto.getShopSourceChannel();
@@ -366,8 +425,15 @@
                         customConfig.setUpdateTime(updateTime);
                         if(oldValue!=null&&!oldValue.isEmpty()){
                             handleChangeConfig(oldValue, newValue, key);
-                            updatedCustomConfigs.add(customConfig);
                         }
+                        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;
@@ -381,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);
         }
     }
 
@@ -417,8 +484,8 @@
                         customConfig.setUpdateTime(updateTime);
                         if(oldValue!=null&&!oldValue.isEmpty()){
                             handleChangeConfig(oldValue, newValue, key);
-                            updatedCustomConfigs.add(customConfig);
                         }
+                        updatedCustomConfigs.add(customConfig);
                         break;
                     case "MEMBER_CHARACTER":
                         newValue = mgtMemberConfigEditDto.getMemberCharacter();
@@ -426,8 +493,8 @@
                         customConfig.setUpdateTime(updateTime);
                         if(oldValue!=null&&!oldValue.isEmpty()){
                             handleChangeConfig(oldValue, newValue, key);
-                            updatedCustomConfigs.add(customConfig);
                         }
+                        updatedCustomConfigs.add(customConfig);
                         break;
                     case "MEMBER_LEVEL":
                         newValue = mgtMemberConfigEditDto.getMemberLevel();
@@ -435,8 +502,8 @@
                         customConfig.setUpdateTime(updateTime);
                         if(oldValue!=null&&!oldValue.isEmpty()){
                             handleChangeConfig(oldValue, newValue, key);
-                            updatedCustomConfigs.add(customConfig);
                         }
+                        updatedCustomConfigs.add(customConfig);
                         break;
                     case "MEMBER_TYPE":
                         newValue = mgtMemberConfigEditDto.getMemberType();
@@ -444,8 +511,8 @@
                         customConfig.setUpdateTime(updateTime);
                         if(oldValue!=null&&!oldValue.isEmpty()){
                             handleChangeConfig(oldValue, newValue, key);
-                            updatedCustomConfigs.add(customConfig);
                         }
+                        updatedCustomConfigs.add(customConfig);
                         break;
                     case "NURSE_PROBLEM":
                         newValue = mgtMemberConfigEditDto.getNurseProblem();
@@ -453,8 +520,8 @@
                         customConfig.setUpdateTime(updateTime);
                         if(oldValue!=null&&!oldValue.isEmpty()){
                             handleChangeConfig(oldValue, newValue, key);
-                            updatedCustomConfigs.add(customConfig);
                         }
+                        updatedCustomConfigs.add(customConfig);
                         break;
                     default:
                         break;
@@ -547,6 +614,18 @@
     }
 
     /**
+     * @description  删除日志
+     * @author  jqs
+     * @date    2023/8/1 19:39
+     * @param
+     * @return  void
+     */
+    @Override
+    public void deleteOperlog(){
+        customConfigMapper.deleteOperlog();
+    }
+
+    /**
      * @description
      * @author  jqs
      * @date    2023/7/13 15:52
@@ -594,21 +673,21 @@
         MgtBulletinBoardVo mgtBulletinBoardVoCustom = recommendCooperationService.boardMemberTotal();
         mgtBulletinBoardVo.setCustomTotal(mgtBulletinBoardVoCustom.getCustomTotal());
         mgtBulletinBoardVo.setCustomToday(mgtBulletinBoardVoCustom.getCustomToday());
+        mgtBulletinBoardVo.setFollowUserToday(mgtBulletinBoardVoCustom.getFollowUserToday());
         // 获取店铺信息
         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.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