From 8444084e6aa11efa23287e7f82474ac22378a5c4 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期二, 01 四月 2025 16:03:19 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java |   78 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 74 insertions(+), 4 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 f357232..6ddda72 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
@@ -1,13 +1,19 @@
 package com.ruoyi.system.service.impl.config;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ibm.icu.util.LocaleData;
 import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.redis.service.RedisService;
+import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.system.api.constant.ConfigEnum;
 import com.ruoyi.system.api.constant.SecurityConstant;
+import com.ruoyi.system.api.domain.dto.BoardMemberTotalDto;
 import com.ruoyi.system.api.domain.poji.config.Activeness;
+import com.ruoyi.system.api.domain.poji.sys.SysUser;
 import com.ruoyi.system.api.domain.vo.AppOtherConfigGetVo;
 import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo;
 import com.ruoyi.system.api.service.RemoteActivityService;
@@ -22,6 +28,8 @@
 import com.ruoyi.system.domain.vo.MgtOperLogPageVo;
 import com.ruoyi.system.mapper.config.CustomConfigMapper;
 import com.ruoyi.system.service.config.*;
+import com.ruoyi.system.service.sys.ISysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -69,6 +77,12 @@
 
     @Resource
     private RedisService redisService;
+
+    @Autowired
+    private ISysUserService sysUserService;
+
+
+
 
     /**
      * @param key
@@ -205,6 +219,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;
@@ -228,6 +245,12 @@
                         break;
                     case "NURSE_PROBLEM":
                         mgtAllCustomConfigVo.setNurseProblem(value.getConfigValue());
+                        break;
+                    case "STORE_COURSE_DISPLAY_NAME":
+                        mgtAllCustomConfigVo.setStoreCourseDisplayName(value.getConfigValue());
+                        break;
+                    case "STORE_COURSE_DISPLAY_PASSWORD":
+                        mgtAllCustomConfigVo.setStoreCourseDisplayPassword(value.getConfigValue());
                         break;
                     default:
                         break;
@@ -281,6 +304,41 @@
         // 新建配置
         createNewConfig(mgtOtherConfigEditDto, updateTime);
     }
+    
+    
+    /**
+     * 修改门店课程配置
+     * @param mgtStoreCurriculumEditDto
+     */
+    @Override
+    public void editStoreCurriculum(MgtStoreCurriculumEditDto mgtStoreCurriculumEditDto) {
+        customConfigMapper.delete(new QueryWrapper<CustomConfig>().eq("config_type", ConfigEnum.STORE_COURSE_DISPLAY_NAME.getKeyType())
+                .eq("config_key", ConfigEnum.STORE_COURSE_DISPLAY_NAME.getKey()));
+        customConfigMapper.delete(new QueryWrapper<CustomConfig>().eq("config_type", ConfigEnum.STORE_COURSE_DISPLAY_PASSWORD.getKeyType())
+                .eq("config_key", ConfigEnum.STORE_COURSE_DISPLAY_PASSWORD.getKey()));
+    
+        CustomConfig customConfig = new CustomConfig();
+        customConfig.setDelFlag(0);
+        customConfig.setConfigType(2);
+        customConfig.setConfigKey(ConfigEnum.STORE_COURSE_DISPLAY_NAME.getKey());
+        customConfig.setConfigName(ConfigEnum.STORE_COURSE_DISPLAY_NAME.getKeyName());
+        customConfig.setCreateTime(new Date());
+        customConfig.setUpdateTime(new Date());
+        customConfig.setConfigValue(mgtStoreCurriculumEditDto.getStoreCourseDisplayName());
+        this.saveOrUpdate(customConfig);
+        
+        customConfig = new CustomConfig();
+        customConfig.setDelFlag(0);
+        customConfig.setConfigType(2);
+        customConfig.setConfigKey(ConfigEnum.STORE_COURSE_DISPLAY_PASSWORD.getKey());
+        customConfig.setConfigName(ConfigEnum.STORE_COURSE_DISPLAY_PASSWORD.getKeyName());
+        customConfig.setCreateTime(new Date());
+        customConfig.setUpdateTime(new Date());
+        customConfig.setConfigValue(mgtStoreCurriculumEditDto.getStoreCourseDisplayPassword());
+        this.saveOrUpdate(customConfig);
+    }
+    
+    
 
     /**
      * @param updateTime
@@ -425,6 +483,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;
                 }
@@ -437,6 +502,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);
         }
     }
 
@@ -652,25 +718,29 @@
      */
     @Override
     public MgtBulletinBoardVo getBulletinBoard(){
+        List<Long> userIds = sysUserService.getScopeOfAuthorityUserId();
         // 创建 MgtBulletinBoardVo 对象
         MgtBulletinBoardVo mgtBulletinBoardVo = new MgtBulletinBoardVo();
         // 获取会员信息
-        MgtBulletinBoardVo mgtBulletinBoardVoMember = remoteMemberService.boardMemberTotal().getData();
+        BoardMemberTotalDto boardMemberTotalDto = new BoardMemberTotalDto();
+        boardMemberTotalDto.setUserIds(userIds);
+
+        MgtBulletinBoardVo mgtBulletinBoardVoMember = remoteMemberService.boardMemberTotal(boardMemberTotalDto).getData();
         mgtBulletinBoardVo.setMemberTotal(mgtBulletinBoardVoMember.getMemberTotal());
         mgtBulletinBoardVo.setMemberToday(mgtBulletinBoardVoMember.getMemberToday());
         // 获取推荐合作信息
-        MgtBulletinBoardVo mgtBulletinBoardVoCustom = recommendCooperationService.boardMemberTotal();
+        MgtBulletinBoardVo mgtBulletinBoardVoCustom = recommendCooperationService.boardMemberTotal(userIds);
         mgtBulletinBoardVo.setCustomTotal(mgtBulletinBoardVoCustom.getCustomTotal());
         mgtBulletinBoardVo.setCustomToday(mgtBulletinBoardVoCustom.getCustomToday());
         mgtBulletinBoardVo.setFollowUserToday(mgtBulletinBoardVoCustom.getFollowUserToday());
         // 获取店铺信息
-        MgtBulletinBoardVo mgtBulletinBoardVoShop = remoteShopService.boardShopTotal().getData();
+        MgtBulletinBoardVo mgtBulletinBoardVoShop = remoteShopService.boardShopTotal(boardMemberTotalDto).getData();
         mgtBulletinBoardVo.setShopTotal(mgtBulletinBoardVoShop.getShopTotal());
         mgtBulletinBoardVo.setAgencyTotal(mgtBulletinBoardVoShop.getAgencyTotal());
         mgtBulletinBoardVo.setDealerTotal(mgtBulletinBoardVoShop.getDealerTotal());
         mgtBulletinBoardVo.setFollowShopToday(mgtBulletinBoardVoShop.getFollowShopToday());
         // 获取订单信息
-        MgtBulletinBoardVo mgtBulletinBoardVoOrder = remoteOrderService.boardOrderTotal().getData();
+        MgtBulletinBoardVo mgtBulletinBoardVoOrder = remoteOrderService.boardOrderTotal(boardMemberTotalDto).getData();
         mgtBulletinBoardVo.setSalesTotal(mgtBulletinBoardVoOrder.getSalesTotal());
         mgtBulletinBoardVo.setUnUseOrderTotal(mgtBulletinBoardVoOrder.getUnUseOrderTotal());
         mgtBulletinBoardVo.setActivityOrderTotal(mgtBulletinBoardVoOrder.getActivityOrderTotal());

--
Gitblit v1.7.1