From 981aacc8d5de2638a0f5b3eb2585e64cfaf2807d Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期六, 12 七月 2025 18:01:19 +0800
Subject: [PATCH] 修改bug
---
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 162 insertions(+), 16 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..966e899 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;
@@ -70,6 +78,12 @@
@Resource
private RedisService redisService;
+ @Autowired
+ private ISysUserService sysUserService;
+
+
+
+
/**
* @param key
* @return CustomConfig
@@ -107,6 +121,61 @@
customConfig.setUpdateTime(new Date());
// 保存或更新配置
this.saveOrUpdate(customConfig);
+ }
+
+ /**
+ * @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());
}
/**
@@ -150,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;
@@ -174,6 +246,12 @@
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;
}
@@ -186,9 +264,18 @@
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());
+ mgtAllCustomConfigVo.setAppid(advert.getAppid());
+ //广告语
+ mgtAllCustomConfigVo.setTargetTypeSlogan(advert.getTargetTypeSlogan());
+ mgtAllCustomConfigVo.setLinkTypeSlogan(advert.getLinkTypeSlogan());
+ mgtAllCustomConfigVo.setLinkUrlSlogan(advert.getLinkUrlSlogan());
+ mgtAllCustomConfigVo.setJumpTypeSlogan(advert.getJumpTypeSlogan());
+ mgtAllCustomConfigVo.setJumpIdSlogan(advert.getJumpIdSlogan());
+ mgtAllCustomConfigVo.setAppidSlogan(advert.getAppidSlogan());
}
//获取活跃度配置
List<Activeness> activenessList = activenessService.listActiveness();
@@ -225,6 +312,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
@@ -339,8 +461,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 +470,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 +479,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 +488,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 +510,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 +547,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 +556,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 +565,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 +574,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 +583,8 @@
customConfig.setUpdateTime(updateTime);
if(oldValue!=null&&!oldValue.isEmpty()){
handleChangeConfig(oldValue, newValue, key);
- updatedCustomConfigs.add(customConfig);
}
+ updatedCustomConfigs.add(customConfig);
break;
default:
break;
@@ -547,6 +677,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
@@ -584,31 +726,35 @@
*/
@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.setFollowUserToday(0);
// 获取订单信息
- MgtBulletinBoardVo mgtBulletinBoardVoOrder = remoteOrderService.boardOrderTotal().getData();
+ MgtBulletinBoardVo mgtBulletinBoardVoOrder = remoteOrderService.boardOrderTotal(boardMemberTotalDto).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