Bladeren bron

Merge branch 'V1.0.11_performance' of http://10.87.21.221:8000/jzyd_yyds/soc into V1.0.11_performance

zhulu 10 maanden geleden
bovenliggende
commit
2e97c3f2d8

+ 7 - 7
soc-modules/soc-modules-host/src/main/java/com/xunmei/host/notice/service/impl/WebsocketNoticeLogServiceImpl.java

@@ -162,6 +162,13 @@ public class WebsocketNoticeLogServiceImpl extends ServiceImpl<WebsocketNoticeLo
                     }
                     List<WebSocketSendVo> list = new ArrayList<>();
                     for (Long userId : userSet) {
+                        //获取用户信息
+                        SysUser sysUser = coreNoticeRuleItemService.getByUserId(userId);
+                        if (sysUser == null){
+                            LogUtils.SMS_NOTICE_LOG.info("用户:{},不发送传感器通知和报警短信",userId);
+                            sendSmsUserSet.remove(userId);
+                            continue;
+                        }
                         WebSocketSendVo sendVo = new WebSocketSendVo();
                         sendVo.setUserId(userId);
                         //通知机构
@@ -175,13 +182,6 @@ public class WebsocketNoticeLogServiceImpl extends ServiceImpl<WebsocketNoticeLo
                 if (!sendSmsUserSet.isEmpty()){
                     //调用接口发送短信
                     for (Long userId : sendSmsUserSet) {
-                        //获取用户信息
-                        SysUser sysUser = coreNoticeRuleItemService.getByUserId(userId);
-                        if (sysUser == null){
-                            LogUtils.SMS_NOTICE_LOG.info("用户:{},不发送传感器报警短信",userId);
-                            continue;
-                        }
-
                         LocalDateTime localDateTime = iotAlarmData.getTime();
                         String alarmTime = localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
 

+ 2 - 2
soc-modules/soc-modules-iot/src/main/resources/mapper/IotAlarmDataMapper.xml

@@ -9,11 +9,11 @@
         b.short_name AS org_name
         FROM
         iot_alarm_data a
-        LEFT JOIN sys_org b ON a.org_id = b.id
+        inner JOIN sys_org b ON a.org_id = b.id
         <if test="param.orgPath != null and param.orgPath != ''">
             and b.path like concat(#{param.orgPath},'%')
         </if>
-        LEFT JOIN iot_device_info d ON a.device_id = d.id and d.deleted = 0
+        inner JOIN iot_device_info d ON a.device_id = d.id and d.deleted = 0
         where 1=1
         <if test="param.deviceName != null and param.deviceName != ''">
             and a.device_name like concat('%',#{param.deviceName},'%')