Browse Source

增加系统参数控制视频质量报警类型

jingyuanchao 1 năm trước cách đây
mục cha
commit
5451b88889

+ 13 - 0
project_data/sql/0.0.9/soc/soc.sql

@@ -23,6 +23,19 @@ END ??
 DELIMITER ;
 CALL schema_change();
 
+-- 新增系统参数: 控制视频质量报警类型
+delete from sys_config where config_key in ('SIGNAL_LOST_ALARM','OCCLUDE_ALARM','BRIGHTNESS_ALARM','COLOR_CAST_ALARM','SNOWFLAKE_ALARM','STRIPE_ALARM','CONTRAST_ALARM','BLURRY_ALARM');
+INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES ('视频质量: 信号丢失 是否需要产生告警数据', 'SIGNAL_LOST_ALARM', '0', 'Y', null, now(), null, now(), '0:否,1:是');
+INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES ('视频质量: 遮挡 是否需要产生告警数据', 'OCCLUDE_ALARM', '0', 'Y', null, now(), null, now(), '0:否,1:是');
+INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES ('视频质量: 亮度 是否需要产生告警数据', 'BRIGHTNESS_ALARM', '0', 'Y', null, now(), null, now(), '0:否,1:是');
+INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES ('视频质量: 偏色 是否需要产生告警数据', 'COLOR_CAST_ALARM', '0', 'Y', null, now(), null, now(), '0:否,1:是');
+INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES ('视频质量: 雪花 是否需要产生告警数据', 'SNOWFLAKE_ALARM', '0', 'Y', null, now(), null, now(), '0:否,1:是');
+INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES ('视频质量: 条纹 是否需要产生告警数据', 'STRIPE_ALARM', '0', 'Y', null, now(), null, now(), '0:否,1:是');
+INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES ('视频质量: 对比度 是否需要产生告警数据', 'CONTRAST_ALARM', '0', 'Y', null, now(), null, now(), '0:否,1:是');
+INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES ('视频质量: 模糊 是否需要产生告警数据', 'BLURRY_ALARM', '0', 'Y', null, now(), null, now(), '0:否,1:是');
+
+
+
 
 
 

+ 7 - 5
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteConfigService.java

@@ -5,12 +5,10 @@ import com.xunmei.common.core.constant.ServiceNameConstants;
 import com.xunmei.common.core.domain.R;
 import com.xunmei.system.api.domain.SysConfig;
 import com.xunmei.system.api.factory.RemoteConfigFallbackFactory;
-import com.xunmei.system.api.factory.RemoteLogFallbackFactory;
-import com.xunmei.system.api.factory.RemoteUserFallbackFactory;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 @FeignClient(contextId = "remoteConfigService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteConfigFallbackFactory.class)
 public interface RemoteConfigService {
@@ -19,4 +17,8 @@ public interface RemoteConfigService {
 
     @GetMapping("/config/findSysConfigByCode")
     SysConfig findSysConfigByCode(@RequestParam("code") String code, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
+
+    @PostMapping("/config/findConfigByCodeList")
+    List<SysConfig> findConfigByCodeList(@RequestBody List<String> codeList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 }

+ 8 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteConfigFallbackFactory.java

@@ -8,6 +8,9 @@ import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
 import org.springframework.stereotype.Component;
 
+import java.util.ArrayList;
+import java.util.List;
+
 @Component
 public class RemoteConfigFallbackFactory implements FallbackFactory<RemoteConfigService> {
     private static final Logger log = LoggerFactory.getLogger(RemoteConfigFallbackFactory.class);
@@ -24,6 +27,11 @@ public class RemoteConfigFallbackFactory implements FallbackFactory<RemoteConfig
             public SysConfig findSysConfigByCode(String code, String source) {
                 return new SysConfig();
             }
+
+            @Override
+            public  List<SysConfig> findConfigByCodeList(List<String> codeList, String source) {
+                return new ArrayList<>();
+            }
         };
     }
 }

+ 41 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/constant/SystemParameterConstant.java

@@ -127,4 +127,45 @@ public class SystemParameterConstant {
      */
     public static final String WEATHER_PARA = "WEATHER_PARA";
 
+    /**
+     * 视频质量: 信号丢失 是否需要产生告警数据, 0:否,1:是
+     */
+    public static final String SIGNAL_LOST_ALARM = "SIGNAL_LOST_ALARM";
+
+    /**
+     * 视频质量: 遮挡 是否需要产生告警数据, 0:否,1:是
+     */
+    public static final String OCCLUDE_ALARM = "OCCLUDE_ALARM";
+
+    /**
+     * 视频质量: 亮度 是否需要产生告警数据, 0:否,1:是
+     */
+    public static final String BRIGHTNESS_ALARM = "BRIGHTNESS_ALARM";
+
+    /**
+     * 视频质量: 偏色 是否需要产生告警数据, 0:否,1:是
+     */
+    public static final String COLOR_CAST_ALARM = "COLOR_CAST_ALARM";
+
+    /**
+     * 视频质量: 雪花 是否需要产生告警数据, 0:否,1:是
+     */
+    public static final String SNOWFLAKE_ALARM = "SNOWFLAKE_ALARM";
+
+    /**
+     * 视频质量: 条纹 是否需要产生告警数据, 0:否,1:是
+     */
+    public static final String STRIPE_ALARM = "STRIPE_ALARM";
+
+    /**
+     * 视频质量: 对比度 是否需要产生告警数据, 0:否,1:是
+     */
+    public static final String CONTRAST_ALARM = "CONTRAST_ALARM";
+
+    /**
+     * 视频质量: 模糊 是否需要产生告警数据, 0:否,1:是
+     */
+
+    public static final String BLURRY_ALARM = "BLURRY_ALARM";
+
 }

+ 63 - 40
soc-modules/soc-modules-mediator/src/main/java/com/xunmei/mediator/api/service/impl/IotAlarmDataServiceImpl.java

@@ -3,14 +3,12 @@ package com.xunmei.mediator.api.service.impl;
 
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.SecurityConstants;
-import com.xunmei.common.core.domain.iot.domain.IotDevice;
-import com.xunmei.common.core.domain.iot.domain.IotDvrDisk;
+import com.xunmei.common.core.constant.SystemParameterConstant;
 import com.xunmei.common.core.domain.iot.domain.IotDvrHardDiskDetection;
 import com.xunmei.common.core.domain.iot.domain.IotSensor;
 import com.xunmei.common.core.domain.mediator.domain.IotAlarmData;
@@ -18,7 +16,6 @@ import com.xunmei.common.core.domain.mediator.domain.IotAlarmRuleExpress;
 import com.xunmei.common.core.domain.mediator.domain.IotAlarmRuleSource;
 import com.xunmei.common.core.domain.mediator.domain.IotAlarmSystemField;
 import com.xunmei.common.core.domain.video.MediatorVideoDiagnosisRecord;
-import com.xunmei.common.core.enums.CategoryDataEnum;
 import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.utils.StringUtils;
 import com.xunmei.mediator.api.enums.AlarmDataTypeEnum;
@@ -26,7 +23,9 @@ import com.xunmei.mediator.api.enums.AlarmRuleExpressOperateEnum;
 import com.xunmei.mediator.api.enums.AlarmVideoTypeEnum;
 import com.xunmei.mediator.api.mapper.*;
 import com.xunmei.mediator.api.service.IotAlarmDataService;
+import com.xunmei.system.api.RemoteConfigService;
 import com.xunmei.system.api.RemoteSmsService;
+import com.xunmei.system.api.domain.SysConfig;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -65,10 +64,11 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
     private IotSensorMapper iotSensorMapper;
 
     @Autowired
-    private IotDeviceMapper iotDeviceMapper;
+    private RemoteConfigService remoteConfigService;
 
     @Autowired
     private RemoteSmsService remoteSmsService;
+
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void dealSensorData(IotSensor iotSensor) throws Exception {
@@ -95,9 +95,8 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
         //获取该设备对应的规则
         int weekDay = DateUtil.thisDayOfWeek() - 1;
         // 0 代表星期天, 规则表中星期天存的为7,需要做一下转换
-        if(weekDay==0)
-        {
-            weekDay =7;
+        if (weekDay == 0) {
+            weekDay = 7;
         }
         System.out.println(weekDay);
         QueryWrapper<IotAlarmRuleExpress> ruleExpress = new QueryWrapper<>();
@@ -139,41 +138,38 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
             this.saveBatch(list);
             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
             for (IotAlarmData alarm : list) {
-                if(alarm.getSmsType()){
+                if (alarm.getSmsType()) {
                     //需要发送短信
                     LocalDateTime time = alarm.getTime();
                     String timeStr = time.format(formatter);
-                    remoteSmsService.sendSmsIot(iotSensor.getOrgId(),alarm.getContent(),timeStr);
+                    remoteSmsService.sendSmsIot(iotSensor.getOrgId(), alarm.getContent(), timeStr);
                 }
             }
-            if (ObjectUtil.notEqual(iotSensor.getState(),1)) {
+            if (ObjectUtil.notEqual(iotSensor.getState(), 1)) {
                 iotSensor.setState(1);
                 iotSensor.setStateUpdateTime(LocalDateTime.now());
                 iotSensor.setStateStartTime(LocalDateTime.now());
                 iotSensorMapper.updateById(iotSensor);
             }
-        }
-        else{
+        } else {
             // 本次上传的设备状态数据 没有生成告警
             if (isExpress && !isAlarm) {
                 //报警恢复
-                if( alarms.size() != 0){
+                if (alarms.size() != 0) {
                     // 温湿度一个设备 存在同时2条告警的情况
-                    if(alarms.size()>1)
-                    {
+                    if (alarms.size() > 1) {
                         for (IotAlarmData oldAlarm : alarms) {
                             oldAlarm.setEndTime(LocalDateTime.now());
                             this.updateById(oldAlarm);
                         }
-                    }
-                    else {
+                    } else {
                         IotAlarmData iotAlarmData = alarms.get(0);
                         iotAlarmData.setEndTime(LocalDateTime.now());
                         this.updateById(iotAlarmData);
                     }
                 }
 
-                if (ObjectUtil.notEqual(iotSensor.getState(),0)) {
+                if (ObjectUtil.notEqual(iotSensor.getState(), 0)) {
                     iotSensor.setStateUpdateTime(LocalDateTime.now());
                     iotSensor.setStateStartTime(LocalDateTime.now());
                     iotSensor.setState(0);
@@ -181,10 +177,8 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
                 }
             }
             // 处理温湿度 一个设备 2 种告警, 可能会单个恢复的情况
-            else if(isAlarm && isExpress)
-            {
-                if(ObjectUtil.notEqual(list.size(),alarms.size()))
-                {
+            else if (isAlarm && isExpress) {
+                if (ObjectUtil.notEqual(list.size(), alarms.size())) {
                     List<IotAlarmData> noAlarmData = alarms.stream().filter(x -> !list.stream().anyMatch(y -> ObjectUtil.equal(y.getFieldCode(), x.getFieldCode()))).collect(Collectors.toList());
                     for (IotAlarmData oldAlarm : noAlarmData) {
                         oldAlarm.setEndTime(LocalDateTime.now());
@@ -218,40 +212,71 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
         //机构id
         Long orgId = videoDiagnosis.getOrgId();
 
+
+        List<SysConfig> configList = getVideoDiagnosisSystemParamConfig();
+        SysConfig signalLostConfig = getConfig(configList, SystemParameterConstant.SIGNAL_LOST_ALARM);
+        SysConfig occludeConfig = getConfig(configList, SystemParameterConstant.OCCLUDE_ALARM);
+        SysConfig brightnessConfig = getConfig(configList, SystemParameterConstant.BRIGHTNESS_ALARM);
+        SysConfig colorCastConfig = getConfig(configList, SystemParameterConstant.COLOR_CAST_ALARM);
+        SysConfig snowflakeConfig = getConfig(configList, SystemParameterConstant.SNOWFLAKE_ALARM);
+        SysConfig stripeConfig = getConfig(configList, SystemParameterConstant.STRIPE_ALARM);
+        SysConfig contrastConfig = getConfig(configList, SystemParameterConstant.CONTRAST_ALARM);
+        SysConfig blurryConfig = getConfig(configList, SystemParameterConstant.BLURRY_ALARM);
+
         //信号丢失 0: 正常 | 1:异常 1001
         Integer signalLost = videoDiagnosis.getSignalLost();
-        dealAlarmVideo(AlarmVideoTypeEnum.SIGNALLOST.getValue(), signalLost, deviceName, channelName, deviceId, orgId);
+        dealAlarmVideo(AlarmVideoTypeEnum.SIGNALLOST.getValue(), signalLost, deviceName, channelName, deviceId, orgId, signalLostConfig);
 
         //遮挡  0: 正常 | 1:异常  1002
         Integer occlude = videoDiagnosis.getOcclude();
-        dealAlarmVideo(AlarmVideoTypeEnum.OCCLUDE.getValue(), occlude, deviceName, channelName, deviceId, orgId);
+        dealAlarmVideo(AlarmVideoTypeEnum.OCCLUDE.getValue(), occlude, deviceName, channelName, deviceId, orgId, occludeConfig);
 
         //亮度  0: 正常 | 1:异常 1003
         Integer brightness = videoDiagnosis.getBrightness();
-        dealAlarmVideo(AlarmVideoTypeEnum.BRIGHTNESS.getValue(), brightness, deviceName, channelName, deviceId, orgId);
+        dealAlarmVideo(AlarmVideoTypeEnum.BRIGHTNESS.getValue(), brightness, deviceName, channelName, deviceId, orgId, brightnessConfig);
 
         //偏色  0: 正常 | 1:异常 1004
         Integer colorCast = videoDiagnosis.getColorCast();
-        dealAlarmVideo(AlarmVideoTypeEnum.COLORCAST.getValue(), colorCast, deviceName, channelName, deviceId, orgId);
+        dealAlarmVideo(AlarmVideoTypeEnum.COLORCAST.getValue(), colorCast, deviceName, channelName, deviceId, orgId, colorCastConfig);
 
         //雪花  0: 正常 | 1:异常 1005
         Integer snowflake = videoDiagnosis.getSnowflake();
-        dealAlarmVideo(AlarmVideoTypeEnum.SNOWFLAKE.getValue(), snowflake, deviceName, channelName, deviceId, orgId);
+        dealAlarmVideo(AlarmVideoTypeEnum.SNOWFLAKE.getValue(), snowflake, deviceName, channelName, deviceId, orgId, snowflakeConfig);
 
         //条纹  0: 正常 | 1:异常 1006
         Integer stripe = videoDiagnosis.getStripe();
-        dealAlarmVideo(AlarmVideoTypeEnum.STRIPE.getValue(), stripe, deviceName, channelName, deviceId, orgId);
+        dealAlarmVideo(AlarmVideoTypeEnum.STRIPE.getValue(), stripe, deviceName, channelName, deviceId, orgId, stripeConfig);
 
         //对比度  0: 正常 | 1:异常 1007
         Integer contrast = videoDiagnosis.getContrast();
-        dealAlarmVideo(AlarmVideoTypeEnum.CONTRAST.getValue(), contrast, deviceName, channelName, deviceId, orgId);
+        dealAlarmVideo(AlarmVideoTypeEnum.CONTRAST.getValue(), contrast, deviceName, channelName, deviceId, orgId, contrastConfig);
 
         //模糊  0: 正常 | 1:异常 1008
         Integer blurry = videoDiagnosis.getBlurry();
-        dealAlarmVideo(AlarmVideoTypeEnum.BLURRY.getValue(), blurry, deviceName, channelName, deviceId, orgId);
+        dealAlarmVideo(AlarmVideoTypeEnum.BLURRY.getValue(), blurry, deviceName, channelName, deviceId, orgId, blurryConfig);
 
     }
 
+    private List<SysConfig> getVideoDiagnosisSystemParamConfig() {
+        List<String> list = new ArrayList<>();
+        Collections.addAll(list,
+                SystemParameterConstant.SIGNAL_LOST_ALARM,
+                SystemParameterConstant.OCCLUDE_ALARM,
+                SystemParameterConstant.BRIGHTNESS_ALARM,
+                SystemParameterConstant.COLOR_CAST_ALARM,
+                SystemParameterConstant.SNOWFLAKE_ALARM,
+                SystemParameterConstant.STRIPE_ALARM,
+                SystemParameterConstant.CONTRAST_ALARM,
+                SystemParameterConstant.BLURRY_ALARM
+        );
+
+        return remoteConfigService.findConfigByCodeList(list, SecurityConstants.INNER);
+    }
+
+    private SysConfig getConfig(List<SysConfig> configList, String systemParamConstant) {
+        return configList.stream().filter(x -> ObjectUtil.equal(x.getConfigKey(), systemParamConstant)).findFirst().orElse(null);
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void dealDvrDiskData(IotDvrHardDiskDetection iotDvrDisk) throws Exception {
@@ -314,14 +339,14 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
         return iotAlarmData;
     }
 
-    private void dealAlarmVideo(int diagnosisType, Integer diagnosisValue, String deviceName, String channelName, String deviceId, Long orgId) {
+    private void dealAlarmVideo(int diagnosisType, Integer diagnosisValue, String deviceName, String channelName, String deviceId, Long orgId, SysConfig sysConfig) {
 
         QueryWrapper<IotAlarmData> qw = new QueryWrapper<>();
         qw.lambda().eq(IotAlarmData::getDeviceId, deviceId).eq(IotAlarmData::getOrgId, orgId)
                 .eq(IotAlarmData::getSourceType, diagnosisType).isNull(IotAlarmData::getEndTime);
         List<IotAlarmData> iots = baseMapper.selectList(qw);
-
-        if (diagnosisValue == 1 && iots.size() == 0) {
+        //对于未配置需要告警的视频质量类型,不产生告警,但是允许将设备恢复正常,结束告警时间
+        if (diagnosisValue == 1 && iots.isEmpty() && (sysConfig != null && "1".equals(sysConfig.getConfigValue()))) {
             /**
              * 报警处理逻辑
              * 1、判断报警表中是否有该类报警的数据;
@@ -334,7 +359,7 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
 
 
         }
-        if (diagnosisValue == 0 && iots.size() > 0) {
+        if (diagnosisValue == 0 && !iots.isEmpty()) {
             IotAlarmData iotAlarmData = iots.get(0);
             iotAlarmData.setEndTime(LocalDateTime.now());
             this.updateById(iotAlarmData);
@@ -354,7 +379,7 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
         //所以在判断此类规则的时候将值转为了BigDecimal进行判断; parseInt会在有小数的时候报错
         if (AlarmRuleExpressOperateEnum.EQUALS.getText().equals(operator)) {
             // sensorValue 存在为null的情况, deviceType和 infos.name 不对应的情况
-            if (ObjectUtil.equal(sensorValue,settingValue)) {
+            if (ObjectUtil.equal(sensorValue, settingValue)) {
                 //对上了
                 iotAlarmData = builderAlarm(sensorValue, field, express, iotSensor);
             }
@@ -403,11 +428,9 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
         IotAlarmData iotAlarmData = new IotAlarmData();
         iotAlarmData.setAlarmValue("异常");
         iotAlarmData.setTime(LocalDateTime.now());
-        if(ObjectUtil.equal(deviceName,channelName)){
+        if (ObjectUtil.equal(deviceName, channelName)) {
             iotAlarmData.setDeviceName(channelName);
-        }
-        else
-        {
+        } else {
             iotAlarmData.setDeviceName(deviceName + "-" + channelName);
         }
         iotAlarmData.setRuleId(1L);

+ 0 - 1
soc-modules/soc-modules-mediator/src/main/java/com/xunmei/mediator/api/service/impl/VideoDiagnosisRecordServiceImpl.java

@@ -286,7 +286,6 @@ public class VideoDiagnosisRecordServiceImpl extends ServiceImpl<VideoDiagnosisR
             throw new RuntimeException(e.getMessage());
         }
 
-        // TODO 25号版本先关闭视频类告警, 523版本通过 系统参数控制
         TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
             @Override
             public void afterCommit() {

+ 9 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysConfigController.java

@@ -6,6 +6,7 @@ import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.common.log.annotation.Log;
 import com.xunmei.common.log.enums.BusinessType;
+import com.xunmei.common.security.annotation.InnerAuth;
 import com.xunmei.common.security.annotation.RequiresPermissions;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.system.api.domain.SysConfig;
@@ -14,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 /**
  * 参数配置 信息操作处理
  *
@@ -116,4 +119,10 @@ public class SysConfigController extends BaseController {
     public SysConfig findSysConfigByCode(String code) {
         return configService.findFirstByCode(code);
     }
+
+    @InnerAuth
+    @PostMapping("/config/findConfigByCodeList")
+    List<SysConfig> findConfigByCodeList(@RequestBody List<String> codeList){
+        return configService.findConfigByCodeList(codeList);
+    }
 }

+ 3 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysConfigService.java

@@ -96,4 +96,7 @@ SysConfig selectIsDisplayPassword();
      * @return 结果
      */
     boolean checkConfigKeyUnique(SysConfig config);
+
+    List<SysConfig> findConfigByCodeList(List<String> codeList);
+
 }

+ 10 - 2
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysConfigServiceImpl.java

@@ -3,6 +3,7 @@ package com.xunmei.system.service.impl;
 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.google.common.collect.Lists;
 import com.xunmei.common.core.constant.CacheConstants;
 import com.xunmei.common.core.constant.UserConstants;
 import com.xunmei.common.core.exception.ServiceException;
@@ -13,12 +14,10 @@ import com.xunmei.common.redis.utils.RedisUtils;
 import com.xunmei.system.api.domain.SysConfig;
 import com.xunmei.system.mapper.SysConfigMapper;
 import com.xunmei.system.service.ISysConfigService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
-import java.util.Collection;
 import java.util.List;
 
 /**
@@ -226,4 +225,13 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
     private String getCacheKey(String configKey) {
         return CacheConstants.SYS_CONFIG_KEY + configKey;
     }
+
+
+    @Override
+    public List<SysConfig> findConfigByCodeList(List<String> codeList) {
+        if (codeList.isEmpty()){
+            return Lists.newArrayList();
+        }
+       return lambdaQuery().in(SysConfig::getConfigKey, codeList).list();
+    }
 }