فهرست منبع

Merge remote-tracking branch 'origin/V0.1.1_alarm' into V0.1.1_alarm

jingyuanchao 11 ماه پیش
والد
کامیت
88085b7341

+ 15 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/letter/controller/CoreIntroduceLetterController.java

@@ -1,5 +1,6 @@
 package com.xunmei.core.letter.controller;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.xunmei.common.core.domain.letter.domain.CoreIntroduceLetterOutInRequest;
 import com.xunmei.common.core.domain.letter.dto.*;
 import com.xunmei.common.core.domain.letter.vo.CoreIntroduceLetterOutInRequestVo;
@@ -10,6 +11,7 @@ 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.RequiresPermissions;
+import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.letter.service.ICoreIntroduceLetterService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -44,6 +46,19 @@ public class CoreIntroduceLetterController extends BaseController {
     @RequiresPermissions("core:letter:approveList")
     @GetMapping("/approve/list")
     public TableDataInfo<CoreIntroduceLetterOutInRequestVo> approveList(CoreIntroduceLetterApproveRequestDto requestDto) {
+        if(ObjectUtil.isNull(requestDto))
+        {
+            throw new RuntimeException("请求参数不能为空");
+        }
+        if(ObjectUtil.isEmpty( requestDto.getOrgId()))
+        {
+            requestDto.setOrgId(SecurityUtils.getLoginUser().getOrgId());
+        }
+        if(ObjectUtil.isNull(requestDto.getOrgId()))
+        {
+            throw new RuntimeException("请求参数机构编码不能为空");
+        }
+
         return coreIntroduceLetterService.selectApproveListPage(requestDto);
     }
 

+ 2 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/device/ProtectionMapper.xml

@@ -30,7 +30,7 @@
         a.alarm_host_code as deviceCode,
         a.iot_token as iotToken,
         a.source, c.path
-        from iot_alarm_subsystem a inner join sys_device d on (d.business_device_id = a.id) and d.device_status = 1 and d.del_flag=0
+        from iot_alarm_subsystem a inner join sys_device d on (d.business_device_id = a.id) and d.device_status = 1 and d.del_flag=0 and a.deleted=0
         inner join sys_org c on a.org_id = c.id and c.deleted=0 and c.is_lock=0
         UNION ALL
         select a.id,
@@ -49,7 +49,7 @@
         a.alarm_host_code as deviceCode,
         a.iot_token as iotToken,
         a.source, c.path
-        from iot_alarm_subsystem a inner join sys_device d on (d.id=a.device_id) and d.device_status = 1 and d.del_flag=0
+        from iot_alarm_subsystem a inner join sys_device d on (d.id=a.device_id) and d.device_status = 1 and d.del_flag=0 and a.deleted=0
         inner join sys_org c on a.org_id = c.id and c.deleted=0 and c.is_lock=0 ) t where  1= 1
         <if test="request.checkSub==true">
             and t.path like concat((select path from sys_org where id=#{request.orgId}), '%')

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

@@ -10,17 +10,17 @@
         FROM
         iot_alarm_data a
         LEFT JOIN sys_org b ON a.org_id = b.id
-        LEFT JOIN iot_device_info d ON a.device_id = d.id
-        where 1=1 and d.deleted = 0
+        <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
+        where 1=1
         <if test="param.deviceName != null and param.deviceName != ''">
             and a.device_name like concat('%',#{param.deviceName},'%')
         </if>
         <if test="param.orgId != null and param.orgId != ''">
             and a.org_id = #{param.orgId}
         </if>
-        <if test="param.orgPath != null and param.orgPath != ''">
-            and b.path like concat(#{param.orgPath},'%')
-        </if>
         <if test="param.dataType != null">
             and a.data_type = #{param.dataType}
         </if>