From efaa975d89a6cc2ca16916834eba19f54f0229f8 Mon Sep 17 00:00:00 2001
From: zhanglin8526 <852614290@qq.com>
Date: 星期六, 26 八月 2023 16:38:04 +0800
Subject: [PATCH] 分账
---
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java | 433 +++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 345 insertions(+), 88 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 172e252..c37ea0f 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,18 +1,27 @@
package com.ruoyi.system.service.impl.config;
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.common.redis.service.RedisService;
import com.ruoyi.system.api.constant.ConfigEnum;
+import com.ruoyi.system.api.constant.SecurityConstant;
import com.ruoyi.system.api.domain.poji.config.Activeness;
+import com.ruoyi.system.api.domain.vo.AppOtherConfigGetVo;
+import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo;
+import com.ruoyi.system.api.service.RemoteActivityService;
+import com.ruoyi.system.api.service.RemoteMemberService;
+import com.ruoyi.system.api.service.RemoteOrderService;
+import com.ruoyi.system.api.service.RemoteShopService;
import com.ruoyi.system.domain.dto.*;
import com.ruoyi.system.domain.pojo.config.Advert;
import com.ruoyi.system.domain.pojo.config.CustomConfig;
import com.ruoyi.system.domain.vo.MgtActivenessVo;
-import com.ruoyi.system.domain.vo.MgtCustomConfigVo;
+import com.ruoyi.system.domain.vo.MgtAllCustomConfigVo;
+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.*;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -40,6 +49,26 @@
@Resource
private ActivenessService activenessService;
+ @Resource
+ private RemoteMemberService remoteMemberService;
+
+ @Resource
+ private RecommendCooperationService recommendCooperationService;
+
+ @Resource
+ private RemoteShopService remoteShopService;
+
+ @Resource
+ private RemoteOrderService remoteOrderService;
+
+ @Resource
+ private RemoteActivityService remoteActivityService;
+
+ @Resource
+ private StaffSuggestService staffSuggestService;
+
+ @Resource
+ private RedisService redisService;
/**
* @param key
@@ -68,12 +97,40 @@
if (customConfig == null) {
customConfig = new CustomConfig();
customConfig.setCreateTime(new Date());
+ customConfig.setDelFlag(0);
}
// 设置配置的类型、键、名称、值和更新时间
- customConfig.setType(ConfigEnum.PLATFORM_SERVICE_PHONE.getKeyType());
- customConfig.setKey(ConfigEnum.PLATFORM_SERVICE_PHONE.getKey());
- customConfig.setName(ConfigEnum.PLATFORM_SERVICE_PHONE.getKeyName());
- customConfig.setValue(mgtServiceMobileEditDto.getServiceMobile());
+ customConfig.setConfigType(ConfigEnum.PLATFORM_SERVICE_PHONE.getKeyType());
+ customConfig.setConfigKey(ConfigEnum.PLATFORM_SERVICE_PHONE.getKey());
+ customConfig.setConfigName(ConfigEnum.PLATFORM_SERVICE_PHONE.getKeyName());
+ customConfig.setConfigValue(mgtServiceMobileEditDto.getServiceMobile());
+ 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);
@@ -87,62 +144,62 @@
* @date 2023/6/7 15:02
*/
@Override
- public MgtCustomConfigVo getCustomConfig() {
- MgtCustomConfigVo mgtCustomConfigVo = new MgtCustomConfigVo();
+ public MgtAllCustomConfigVo getAllCustomConfig() {
+ MgtAllCustomConfigVo mgtAllCustomConfigVo = new MgtAllCustomConfigVo();
//获取自定义配置
List<CustomConfig> customConfigList = customConfigMapper.selectList(new LambdaQueryWrapper<CustomConfig>().eq(CustomConfig::getDelFlag, 0));
Optional.ofNullable(customConfigList).ifPresent(list -> {
- Map<String, CustomConfig> configMap = list.stream().collect(Collectors.toMap(CustomConfig::getKey, Function.identity()));
+ Map<String, CustomConfig> configMap = list.stream().collect(Collectors.toMap(CustomConfig::getConfigKey, Function.identity()));
// 遍历配置映射,设置相应的属性值
configMap.forEach((key, value) -> {
switch (key) {
case "SHARE_INTEGRAL":
- mgtCustomConfigVo.setShareIntegral(Integer.valueOf(value.getValue()));
+ mgtAllCustomConfigVo.setShareIntegral(Integer.valueOf(value.getConfigValue()));
break;
case "SUGGEST_PLATFORM_INTEGRAL":
- mgtCustomConfigVo.setSuggestPlatformIntegral(Integer.valueOf(value.getValue()));
+ mgtAllCustomConfigVo.setSuggestPlatformIntegral(Integer.valueOf(value.getConfigValue()));
break;
case "SIGN_IN_INTEGRAL":
- mgtCustomConfigVo.setSignInIntegral(Integer.valueOf(value.getValue()));
+ mgtAllCustomConfigVo.setSignInIntegral(Integer.valueOf(value.getConfigValue()));
break;
case "SUGGEST_SHOP_INTEGRAL":
- mgtCustomConfigVo.setSuggestShopIntegral(Integer.valueOf(value.getValue()));
+ mgtAllCustomConfigVo.setSuggestShopIntegral(Integer.valueOf(value.getConfigValue()));
break;
case "PAY_MONEY_INTEGRAL":
- mgtCustomConfigVo.setPayMoneyIntegral(Integer.valueOf(value.getValue()));
+ mgtAllCustomConfigVo.setPayMoneyIntegral(Integer.valueOf(value.getConfigValue()));
break;
case "ORDER_AUTO_CANCEL_TIME":
- mgtCustomConfigVo.setOrderAutoCancelTime(Integer.valueOf(value.getValue()));
+ mgtAllCustomConfigVo.setOrderAutoCancelTime(Integer.valueOf(value.getConfigValue()));
break;
case "HOME_STYLE":
- mgtCustomConfigVo.setHomeStyle(Integer.valueOf(value.getValue()));
+ mgtAllCustomConfigVo.setHomeStyle(Integer.valueOf(value.getConfigValue()));
break;
case "SHOP_EMERGENCY_DEGREE":
- mgtCustomConfigVo.setShopEmergencyDegree(value.getValue());
+ mgtAllCustomConfigVo.setShopEmergencyDegree(value.getConfigValue());
break;
case "SHOP_FOLLOW_TYPE":
- mgtCustomConfigVo.setShopFollowType(value.getValue());
+ mgtAllCustomConfigVo.setShopFollowType(value.getConfigValue());
break;
case "SHOP_CUSTOM_STATUS":
- mgtCustomConfigVo.setShopCustomStatus(value.getValue());
+ mgtAllCustomConfigVo.setShopCustomStatus(value.getConfigValue());
break;
case "SHOP_SOURCE_CHANNEL":
- mgtCustomConfigVo.setShopSourceChannel(value.getValue());
+ mgtAllCustomConfigVo.setShopSourceChannel(value.getConfigValue());
break;
case "MEMBER_SOURCE_CHANNEL":
- mgtCustomConfigVo.setMemberSourceChannel(value.getValue());
+ mgtAllCustomConfigVo.setMemberSourceChannel(value.getConfigValue());
break;
case "MEMBER_CHARACTER":
- mgtCustomConfigVo.setMemberCharacter(value.getValue());
+ mgtAllCustomConfigVo.setMemberCharacter(value.getConfigValue());
break;
case "MEMBER_LEVEL":
- mgtCustomConfigVo.setMemberLevel(value.getValue());
+ mgtAllCustomConfigVo.setMemberLevel(value.getConfigValue());
break;
case "MEMBER_TYPE":
- mgtCustomConfigVo.setMemberType(value.getValue());
+ mgtAllCustomConfigVo.setMemberType(value.getConfigValue());
break;
case "NURSE_PROBLEM":
- mgtCustomConfigVo.setNurseProblem(value.getValue());
+ mgtAllCustomConfigVo.setNurseProblem(value.getConfigValue());
break;
default:
break;
@@ -152,13 +209,14 @@
//获取广告配置
Advert advert = advertService.getAdvert();
if (advert != null) {
- mgtCustomConfigVo.setHomeSlogan(advert.getAdContent());
- mgtCustomConfigVo.setHomeLogo(advert.getLogoUrl());
- mgtCustomConfigVo.setAdUrl(advert.getAdUrl());
- mgtCustomConfigVo.setTargetType(advert.getTargetType());
- mgtCustomConfigVo.setLinkUrl(advert.getLinkUrl());
- mgtCustomConfigVo.setJumpType(advert.getJumpType());
- mgtCustomConfigVo.setJumpId(advert.getJumpId());
+ mgtAllCustomConfigVo.setHomeSlogan(advert.getAdContent());
+ 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());
}
//获取活跃度配置
List<Activeness> activenessList = activenessService.listActiveness();
@@ -173,9 +231,9 @@
return mgtActivenessVo;
})
.collect(Collectors.toList());
- mgtCustomConfigVo.setMgtActivenessVoList(mgtActivenessVoList);
+ mgtAllCustomConfigVo.setMgtActivenessVoList(mgtActivenessVoList);
}
- return mgtCustomConfigVo;
+ return mgtAllCustomConfigVo;
}
@@ -206,7 +264,7 @@
private void deletePastConfig(Date updateTime) {
List<CustomConfig> customConfigList = customConfigMapper.selectList(new LambdaQueryWrapper<CustomConfig>()
.eq(CustomConfig::getDelFlag, 0)
- .eq(CustomConfig::getType, 2));
+ .eq(CustomConfig::getConfigType, 2));
for (CustomConfig customConfig : customConfigList) {
customConfig.setDelFlag(1);
customConfig.setUpdateTime(updateTime);
@@ -226,44 +284,55 @@
for (ConfigEnum configEnum : ConfigEnum.values()) {
CustomConfig customConfig = new CustomConfig();
customConfig.setDelFlag(0);
- customConfig.setType(configEnum.getKeyType());
- customConfig.setKey(configEnum.getKey());
- customConfig.setName(configEnum.getKeyName());
- customConfig.setValue(getConfigValue(configEnum, mgtOtherConfigEditDto));
+ customConfig.setConfigType(configEnum.getKeyType());
+ customConfig.setConfigKey(configEnum.getKey());
+ customConfig.setConfigName(configEnum.getKeyName());
customConfig.setCreateTime(updateTime);
customConfig.setUpdateTime(updateTime);
- this.saveOrUpdate(customConfig);
+ switch (configEnum) {
+ //分享小程序可获得积分
+ 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;
+ //C端订单自动取消时间
+ case ORDER_AUTO_CANCEL_TIME:
+ customConfig.setConfigValue(mgtOtherConfigEditDto.getOrderAutoCancelTime().toString());
+ redisService.setCacheObject(SecurityConstant.AUTO_CANCEL_ORDER_TIME,mgtOtherConfigEditDto.getOrderAutoCancelTime());
+ this.saveOrUpdate(customConfig);
+ break;
+ //购物满1元可获得积分
+ case PAY_MONEY_INTEGRAL:
+ customConfig.setConfigValue(mgtOtherConfigEditDto.getPayMoneyIntegral().toString());
+ redisService.setCacheObject(SecurityConstant.PAY_MONEY_INTEGRAL,mgtOtherConfigEditDto.getPayMoneyIntegral());
+ this.saveOrUpdate(customConfig);
+ break;
+ //首页风格
+ case HOME_STYLE:
+ customConfig.setConfigValue(mgtOtherConfigEditDto.getHomeStyle().toString());
+ this.saveOrUpdate(customConfig);
+ break;
+ default:
+ break;
+ }
}
}
- /**
- * @param configEnum
- * @param mgtOtherConfigEditDto
- * @return String
- * @description 获取配置参数
- * @author jqs
- * @date 2023/6/7 16:37
- */
- private String getConfigValue(ConfigEnum configEnum, MgtOtherConfigEditDto mgtOtherConfigEditDto) {
- switch (configEnum) {
- case SHARE_INTEGRAL:
- return mgtOtherConfigEditDto.getShareIntegral().toString();
- case SUGGEST_PLATFORM_INTEGRAL:
- return mgtOtherConfigEditDto.getSuggestPlatformIntegral().toString();
- case SIGN_IN_INTEGRAL:
- return mgtOtherConfigEditDto.getSignInIntegral().toString();
- case SUGGEST_SHOP_INTEGRAL:
- return mgtOtherConfigEditDto.getSuggestShopIntegral().toString();
- case ORDER_AUTO_CANCEL_TIME:
- return mgtOtherConfigEditDto.getOrderAutoCancelTime().toString();
- case PAY_MONEY_INTEGRAL:
- return mgtOtherConfigEditDto.getPayMoneyIntegral().toString();
- case HOME_STYLE:
- return mgtOtherConfigEditDto.getHomeStyle().toString();
- default:
- throw new IllegalArgumentException("Invalid ConfigEnum");
- }
- }
/**
* @param mgtShopConfigEditDto
@@ -280,7 +349,7 @@
List<CustomConfig> customConfigList = customConfigMapper.selectList(
new LambdaQueryWrapper<CustomConfig>()
.eq(CustomConfig::getDelFlag, 0)
- .eq(CustomConfig::getType, 3)
+ .eq(CustomConfig::getConfigType, 3)
);
if (customConfigList != null && !customConfigList.isEmpty()) {
String key;
@@ -289,28 +358,49 @@
List<CustomConfig> updatedCustomConfigs = new ArrayList<>();
// 遍历配置列表,根据 key 更新配置值
for (CustomConfig customConfig : customConfigList) {
- key = customConfig.getKey();
- oldValue = customConfig.getValue();
+ key = customConfig.getConfigKey();
+ oldValue = customConfig.getConfigValue();
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.setValue(newValue);
- customConfig.setUpdateTime(updateTime);
- handleChangeConfig(oldValue, newValue, key);
- updatedCustomConfigs.add(customConfig);
+
}
this.saveOrUpdateBatch(updatedCustomConfigs);
} else {
@@ -337,7 +427,7 @@
List<CustomConfig> customConfigList = customConfigMapper.selectList(
new LambdaQueryWrapper<CustomConfig>()
.eq(CustomConfig::getDelFlag, 0)
- .eq(CustomConfig::getType, 4)
+ .eq(CustomConfig::getConfigType, 4)
);
if (customConfigList != null && !customConfigList.isEmpty()) {
String key;
@@ -346,31 +436,57 @@
List<CustomConfig> updatedCustomConfigs = new ArrayList<>();
// 遍历配置列表,根据 key 更新配置值
for (CustomConfig customConfig : customConfigList) {
- key = customConfig.getKey();
- oldValue = customConfig.getValue();
+ key = customConfig.getConfigKey();
+ oldValue = customConfig.getConfigValue();
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.setValue(newValue);
- customConfig.setUpdateTime(updateTime);
- handleChangeConfig(oldValue, newValue, key);
- updatedCustomConfigs.add(customConfig);
}
this.saveOrUpdateBatch(updatedCustomConfigs);
} else {
@@ -395,10 +511,10 @@
private void createNewConfig(ConfigEnum configEnum, String value, Date updateTime) {
CustomConfig customConfig = new CustomConfig();
customConfig.setDelFlag(0);
- customConfig.setType(configEnum.getKeyType());
- customConfig.setKey(configEnum.getKey());
- customConfig.setName(configEnum.getKeyName());
- customConfig.setValue(value);
+ customConfig.setConfigType(configEnum.getKeyType());
+ customConfig.setConfigKey(configEnum.getKey());
+ customConfig.setConfigName(configEnum.getKeyName());
+ customConfig.setConfigValue(value);
customConfig.setCreateTime(updateTime);
customConfig.setUpdateTime(updateTime);
this.saveOrUpdate(customConfig);
@@ -445,5 +561,146 @@
}
+ /**
+ * @description 分页获取操作日志
+ * @author jqs
+ * @date 2023/6/8 11:52
+ * @param page
+ * @param mgtOperLogPageDto
+ * @return List<MgtOperLogPageVo>
+ */
+ @Override
+ public List<MgtOperLogPageVo> pageOperLog(Page page, MgtOperLogPageDto mgtOperLogPageDto){
+ return customConfigMapper.pageOperLog(page, mgtOperLogPageDto);
+ }
+ /**
+ * @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
+ * @param
+ * @return List<String>
+ */
+ @Override
+ public List<String> listOperTitle(){
+ return customConfigMapper.listOperTitle();
+ }
+
+ /**
+ * @description 获取单个自定义配置
+ * @author jqs
+ * @date 2023/6/9 15:40
+ * @param mgtCustomConfigDto
+ * @return MgtCustomConfigVo
+ */
+ @Override
+ public List<String> getCustomConfig(MgtCustomConfigDto mgtCustomConfigDto){
+ CustomConfig customConfig = this.getByKey(mgtCustomConfigDto.getConfigType());
+ List<String> list = new ArrayList<>();
+ if(customConfig!=null&&StringUtils.isNotBlank(customConfig.getConfigValue())){
+ list = Arrays.asList(customConfig.getConfigValue().split(","));
+ }
+ return list;
+ }
+
+ /**
+ * @description getBulletinBoard
+ * @param
+ * @return MgtBulletinBoardVo
+ * @author jqs34
+ * @date 2023/6/18 16:41
+ */
+ @Override
+ public MgtBulletinBoardVo getBulletinBoard(){
+ // 创建 MgtBulletinBoardVo 对象
+ MgtBulletinBoardVo mgtBulletinBoardVo = new MgtBulletinBoardVo();
+ // 获取会员信息
+ MgtBulletinBoardVo mgtBulletinBoardVoMember = remoteMemberService.boardMemberTotal().getData();
+ mgtBulletinBoardVo.setMemberTotal(mgtBulletinBoardVoMember.getMemberTotal());
+ mgtBulletinBoardVo.setMemberToday(mgtBulletinBoardVoMember.getMemberToday());
+ // 获取推荐合作信息
+ 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 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();
+ //待回复建议数量
+ Integer countA = remoteMemberService.getUnReplaySuggestVo().getData();
+ Integer countB = remoteShopService.getUnReplaySuggestVo().getData();
+ Integer countC = staffSuggestService.getUnReplaySuggestVo();
+ mgtBulletinBoardVo.setUnReplaySuggestTotal(countA+countB+countC);
+ // 返回 MgtBulletinBoardVo 对象
+ return mgtBulletinBoardVo;
+ }
+
+ /**
+ * @description 获取其他设置
+ * @author jqs
+ * @date 2023/7/12 15:28
+ * @param
+ * @return AppOtherConfigGetVo
+ */
+ @Override
+ public AppOtherConfigGetVo getAppOtherConfigGetVo(){
+ AppOtherConfigGetVo appOtherConfigGetVo = new AppOtherConfigGetVo();
+ //获取自定义配置
+ List<CustomConfig> customConfigList = customConfigMapper.selectList(new LambdaQueryWrapper<CustomConfig>().eq(CustomConfig::getDelFlag, 0));
+ Optional.ofNullable(customConfigList).ifPresent(list -> {
+ Map<String, CustomConfig> configMap = list.stream().collect(Collectors.toMap(CustomConfig::getConfigKey, Function.identity()));
+ // 遍历配置映射,设置相应的属性值
+ configMap.forEach((key, value) -> {
+ switch (key) {
+ case "SHARE_INTEGRAL":
+ appOtherConfigGetVo.setShareIntegral(Integer.valueOf(value.getConfigValue()));
+ break;
+ case "SUGGEST_PLATFORM_INTEGRAL":
+ appOtherConfigGetVo.setSuggestPlatformIntegral(Integer.valueOf(value.getConfigValue()));
+ break;
+ case "SIGN_IN_INTEGRAL":
+ appOtherConfigGetVo.setSignInIntegral(Integer.valueOf(value.getConfigValue()));
+ break;
+ case "SUGGEST_SHOP_INTEGRAL":
+ appOtherConfigGetVo.setSuggestShopIntegral(Integer.valueOf(value.getConfigValue()));
+ break;
+ case "PAY_MONEY_INTEGRAL":
+ appOtherConfigGetVo.setPayMoneyIntegral(Integer.valueOf(value.getConfigValue()));
+ break;
+ case "ORDER_AUTO_CANCEL_TIME":
+ appOtherConfigGetVo.setOrderAutoCancelTime(Integer.valueOf(value.getConfigValue()));
+ break;
+ case "HOME_STYLE":
+ appOtherConfigGetVo.setHomeStyle(Integer.valueOf(value.getConfigValue()));
+ break;
+ default:
+ break;
+ }
+ });
+ });
+ return appOtherConfigGetVo;
+ }
}
--
Gitblit v1.7.1