jingyuanchao 1 жил өмнө
parent
commit
85c4147b16

+ 2 - 0
soc-auth/src/main/java/com/xunmei/auth/SocAuthApplication.java

@@ -5,12 +5,14 @@ import com.xunmei.common.swagger.annotation.EnableCustomSwagger2;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
 
 /**
  * 认证授权中心
  * 
  * @author xunmei
  */
+@RefreshScope
 @EnableSocFeignClients
 @EnableCustomSwagger2
 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/SocCoreApplication.java

@@ -7,10 +7,11 @@ import com.xunmei.common.swagger.annotation.EnableCustomSwagger2;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.scheduling.annotation.EnableAsync;
 
-
+@RefreshScope
 @MapperScan("com.xunmei.core.**.mapper")
 @EnableCustomConfig
 @ComponentScan(basePackages = {"com.xunmei.core", "com.xunmei.common.redis"})

+ 2 - 1
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/SocIotApplication.java

@@ -6,8 +6,9 @@ import com.xunmei.common.security.annotation.EnableSocFeignClients;
 import com.xunmei.common.swagger.annotation.EnableCustomSwagger2;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.scheduling.annotation.EnableAsync;
-
+@RefreshScope
 @EnableAsync
 @EnableCustomConfig
 @EnableCustomSwagger2

+ 1 - 1
soc-modules/soc-modules-iot/src/main/resources/mapper/IotDvrChannelMapper.xml

@@ -76,7 +76,7 @@
             and d.equipment_name like concat('%', #{pageDto.hostName},'%')
         </if>
         <if test="pageDto.channelName!=null and pageDto.channelName!=''">
-            and d.channel_name like concat('%', #{pageDto.channelName},'%')
+            and c.channel_name like concat('%', #{pageDto.channelName},'%')
         </if>
         <if test="pageDto.integrityState!=null">
             and vic.status=#{pageDto.integrityState}

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

@@ -82,6 +82,10 @@ public class IotSensorServiceImpl extends ServiceImpl<IotSensorMapper, IotSensor
         String path = "/api/status/sensorCommon";
         List<NorthError> errors = new ArrayList<>();
         Map<String, List<IotSensor>> productDeviceMap = getAllDevice();
+        if (ObjectUtil.isEmpty(productDeviceMap)){
+            LogUtils.DIRECT_HOST_SENSOR_STATUS.error("处理动环传感器状态时,未查询到传感器数据!");
+            return;
+        }
         List<IotSensor> sensorList = new ArrayList<>();
         List<IotSensorLog> sensorLogList = new ArrayList<>();
         for (SensorStatusDto status : request.getData()) {
@@ -269,7 +273,7 @@ public class IotSensorServiceImpl extends ServiceImpl<IotSensorMapper, IotSensor
     }
 
     private String convertDeviceType(String deviceType) {
-        if (ObjectUtil.isNotNull(deviceType)){
+        if (ObjectUtil.isEmpty(deviceType)){
             return null;
         }
         return DictUtils.getDictLabel(DictConstants.SENSOR_DEVICE_TYPE, Integer.parseInt(deviceType));