chenye
2023-07-10 98e06673cc0858aebed99c4e9550d2d71d838e6f
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/CustomConfigServiceImpl.java
@@ -18,10 +18,7 @@
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.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 {
@@ -528,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;
    }