jiangqs
2023-07-12 f26537e926d7ad2d725e059700142ba14c0c2b1f
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java
@@ -6,6 +6,7 @@
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.AppOtherConfigGetVo;
import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo;
import com.ruoyi.system.api.service.RemoteActivityService;
import com.ruoyi.system.api.service.RemoteMemberService;
@@ -591,4 +592,49 @@
        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;
    }
}