From 7109e2fefaa46caffcd36b44828f48e0f8a790ba Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期二, 11 七月 2023 09:36:50 +0800
Subject: [PATCH] 管理台bug和用户端

---
 ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java |   96 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 77 insertions(+), 19 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 0ea858e..b3a48fa 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
@@ -3,6 +3,7 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.system.api.constant.ConfigEnum;
 import com.ruoyi.system.api.domain.poji.config.Activeness;
 import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo;
@@ -15,13 +16,9 @@
 import com.ruoyi.system.domain.pojo.config.CustomConfig;
 import com.ruoyi.system.domain.vo.MgtActivenessVo;
 import com.ruoyi.system.domain.vo.MgtAllCustomConfigVo;
-import com.ruoyi.system.domain.vo.MgtCustomConfigVo;
 import com.ruoyi.system.domain.vo.MgtOperLogPageVo;
 import com.ruoyi.system.mapper.config.CustomConfigMapper;
-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 com.ruoyi.system.service.config.*;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -63,6 +60,9 @@
 
     @Resource
     private RemoteActivityService remoteActivityService;
+
+    @Resource
+    private StaffSuggestService staffSuggestService;
 
     /**
      * @param key
@@ -259,24 +259,31 @@
                 case SHARE_INTEGRAL:
                     customConfig.setConfigValue(mgtOtherConfigEditDto.getShareIntegral().toString());
                     this.saveOrUpdate(customConfig);
+                    break;
                 case SUGGEST_PLATFORM_INTEGRAL:
                     customConfig.setConfigValue(mgtOtherConfigEditDto.getSuggestPlatformIntegral().toString());
                     this.saveOrUpdate(customConfig);
+                    break;
                 case SIGN_IN_INTEGRAL:
                     customConfig.setConfigValue(mgtOtherConfigEditDto.getSignInIntegral().toString());
                     this.saveOrUpdate(customConfig);
+                    break;
                 case SUGGEST_SHOP_INTEGRAL:
                     customConfig.setConfigValue(mgtOtherConfigEditDto.getSuggestShopIntegral().toString());
                     this.saveOrUpdate(customConfig);
+                    break;
                 case ORDER_AUTO_CANCEL_TIME:
                     customConfig.setConfigValue(mgtOtherConfigEditDto.getOrderAutoCancelTime().toString());
                     this.saveOrUpdate(customConfig);
+                    break;
                 case PAY_MONEY_INTEGRAL:
                     customConfig.setConfigValue(mgtOtherConfigEditDto.getPayMoneyIntegral().toString());
                     this.saveOrUpdate(customConfig);
+                    break;
                 case HOME_STYLE:
                     customConfig.setConfigValue(mgtOtherConfigEditDto.getHomeStyle().toString());
                     this.saveOrUpdate(customConfig);
+                    break;
                 default:
                     break;
             }
@@ -313,23 +320,44 @@
                 switch (key) {
                     case "SHOP_EMERGENCY_DEGREE":
                         newValue = mgtShopConfigEditDto.getShopEmergencyDegree();
+                        customConfig.setConfigValue(newValue);
+                        customConfig.setUpdateTime(updateTime);
+                        if(oldValue!=null&&!oldValue.isEmpty()){
+                            handleChangeConfig(oldValue, newValue, key);
+                            updatedCustomConfigs.add(customConfig);
+                        }
                         break;
                     case "SHOP_FOLLOW_TYPE":
                         newValue = mgtShopConfigEditDto.getShopFollowType();
+                        customConfig.setConfigValue(newValue);
+                        customConfig.setUpdateTime(updateTime);
+                        if(oldValue!=null&&!oldValue.isEmpty()){
+                            handleChangeConfig(oldValue, newValue, key);
+                            updatedCustomConfigs.add(customConfig);
+                        }
                         break;
                     case "SHOP_CUSTOM_STATUS":
                         newValue = mgtShopConfigEditDto.getShopCustomStatus();
+                        customConfig.setConfigValue(newValue);
+                        customConfig.setUpdateTime(updateTime);
+                        if(oldValue!=null&&!oldValue.isEmpty()){
+                            handleChangeConfig(oldValue, newValue, key);
+                            updatedCustomConfigs.add(customConfig);
+                        }
                         break;
                     case "SHOP_SOURCE_CHANNEL":
                         newValue = mgtShopConfigEditDto.getShopSourceChannel();
+                        customConfig.setConfigValue(newValue);
+                        customConfig.setUpdateTime(updateTime);
+                        if(oldValue!=null&&!oldValue.isEmpty()){
+                            handleChangeConfig(oldValue, newValue, key);
+                            updatedCustomConfigs.add(customConfig);
+                        }
                         break;
                     default:
                         break;
                 }
-                customConfig.setConfigValue(newValue);
-                customConfig.setUpdateTime(updateTime);
-                handleChangeConfig(oldValue, newValue, key);
-                updatedCustomConfigs.add(customConfig);
+
             }
             this.saveOrUpdateBatch(updatedCustomConfigs);
         } else {
@@ -370,26 +398,52 @@
                 switch (key) {
                     case "MEMBER_SOURCE_CHANNEL":
                         newValue = mgtMemberConfigEditDto.getMemberSourceChannel();
+                        customConfig.setConfigValue(newValue);
+                        customConfig.setUpdateTime(updateTime);
+                        if(oldValue!=null&&!oldValue.isEmpty()){
+                            handleChangeConfig(oldValue, newValue, key);
+                            updatedCustomConfigs.add(customConfig);
+                        }
                         break;
                     case "MEMBER_CHARACTER":
                         newValue = mgtMemberConfigEditDto.getMemberCharacter();
+                        customConfig.setConfigValue(newValue);
+                        customConfig.setUpdateTime(updateTime);
+                        if(oldValue!=null&&!oldValue.isEmpty()){
+                            handleChangeConfig(oldValue, newValue, key);
+                            updatedCustomConfigs.add(customConfig);
+                        }
                         break;
                     case "MEMBER_LEVEL":
                         newValue = mgtMemberConfigEditDto.getMemberLevel();
+                        customConfig.setConfigValue(newValue);
+                        customConfig.setUpdateTime(updateTime);
+                        if(oldValue!=null&&!oldValue.isEmpty()){
+                            handleChangeConfig(oldValue, newValue, key);
+                            updatedCustomConfigs.add(customConfig);
+                        }
                         break;
                     case "MEMBER_TYPE":
                         newValue = mgtMemberConfigEditDto.getMemberType();
+                        customConfig.setConfigValue(newValue);
+                        customConfig.setUpdateTime(updateTime);
+                        if(oldValue!=null&&!oldValue.isEmpty()){
+                            handleChangeConfig(oldValue, newValue, key);
+                            updatedCustomConfigs.add(customConfig);
+                        }
                         break;
                     case "NURSE_PROBLEM":
                         newValue = mgtMemberConfigEditDto.getNurseProblem();
+                        customConfig.setConfigValue(newValue);
+                        customConfig.setUpdateTime(updateTime);
+                        if(oldValue!=null&&!oldValue.isEmpty()){
+                            handleChangeConfig(oldValue, newValue, key);
+                            updatedCustomConfigs.add(customConfig);
+                        }
                         break;
                     default:
                         break;
                 }
-                customConfig.setConfigValue(newValue);
-                customConfig.setUpdateTime(updateTime);
-                handleChangeConfig(oldValue, newValue, key);
-                updatedCustomConfigs.add(customConfig);
             }
             this.saveOrUpdateBatch(updatedCustomConfigs);
         } else {
@@ -485,14 +539,13 @@
      * @return  MgtCustomConfigVo
      */
     @Override
-    public MgtCustomConfigVo getCustomConfig(MgtCustomConfigDto mgtCustomConfigDto){
+    public List<String> getCustomConfig(MgtCustomConfigDto mgtCustomConfigDto){
         CustomConfig customConfig = this.getByKey(mgtCustomConfigDto.getConfigType());
-        MgtCustomConfigVo mgtCustomConfigVo = new MgtCustomConfigVo();
-        if(customConfig!=null){
-            mgtCustomConfigVo.setCustomConfig(customConfig.getConfigValue());
-            mgtCustomConfigVo.setConfigType(mgtCustomConfigDto.getConfigType());
+        List<String> list = new ArrayList<>();
+        if(customConfig!=null&&StringUtils.isNotBlank(customConfig.getConfigValue())){
+            list = Arrays.asList(customConfig.getConfigValue().split(","));
         }
-        return mgtCustomConfigVo;
+        return list;
     }
 
     /**
@@ -529,6 +582,11 @@
         // 获取活动信息
         MgtBulletinBoardVo mgtBulletinBoardVoActivity = remoteActivityService.boardActivityTotal().getData();
         mgtBulletinBoardVo.setActivityUserTotal(mgtBulletinBoardVoActivity.getActivityUserTotal());
+        //待回复建议数量
+        Integer countA = remoteMemberService.getUnReplaySuggestVo().getData();
+        Integer countB = remoteShopService.getUnReplaySuggestVo().getData();
+        Integer countC = staffSuggestService.getUnReplaySuggestVo();
+        mgtBulletinBoardVo.setUnReplaySuggestTotal(countA+countB+countC);
         // 返回 MgtBulletinBoardVo 对象
         return mgtBulletinBoardVo;
     }

--
Gitblit v1.7.1