liuyaowen 9 місяців тому
батько
коміт
b561228141

+ 1 - 1
src/main/java/com/yunfeiyun/agmp/iotm/web/controller/IotWarnlogController.java

@@ -64,7 +64,7 @@ public class IotWarnlogController extends BaseController{
     @PreAuthorize("@ss.hasPermi('iot:warn:record:query')")
     @GetMapping(value = "/info/{wlBid}")
     public AjaxResult getInfo(@PathVariable("wlBid") String wlBid){
-        return success(iotWarnlogService.selectIotWarnlogByWlBid(wlBid,SecurityUtils.getTid()));
+        return success(iotWarnlogService.selectIotWarnlogResVoByWlBid(wlBid,SecurityUtils.getTid()));
     }
 
     /**

+ 13 - 6
src/main/java/com/yunfeiyun/agmp/iotm/web/service/impl/IotWarnlogServiceImpl.java

@@ -64,10 +64,14 @@ public class IotWarnlogServiceImpl implements IIotWarnlogService {
         IotWarnlogResVo iotWarnlogResVo = new IotWarnlogResVo();
         BeanUtils.copyProperties(iotWarnlog,iotWarnlogResVo);
         IotDevice iotDevice = iotDeviceMapper.selectIotDeviceByDevBid(iotWarnlogResVo.getDevBid());
-        iotWarnlogResVo.setDevName(iotDevice.getDevName());
-        iotWarnlogResVo.setDevCode(iotDevice.getDevCode());
+        if(null != iotDevice){
+            iotWarnlogResVo.setDevName(iotDevice.getDevName());
+            iotWarnlogResVo.setDevCode(iotDevice.getDevCode());
+        }
         TosDevicetype iotDevicetype = tosDevicetypeMapper.selectTosDevicetypeByDevtypeBid(iotWarnlog.getDevtypeBid());
-        iotWarnlogResVo.setDevTypeName(iotDevicetype.getDevtypeName());
+        if(null != iotDevicetype){
+            iotWarnlogResVo.setDevTypeName(iotDevicetype.getDevtypeName());
+        }
         // 获取设备触发类型,并进行赋值
         IotWarnTouchTypeEnum iotWarnTouchTypeEnum = IotWarnTouchTypeEnum.findByCode(iotWarnlogResVo.getWlType());
         iotWarnlogResVo.setWlTypeContent(iotWarnTouchTypeEnum==null?null:iotWarnTouchTypeEnum.getContent());
@@ -75,7 +79,10 @@ public class IotWarnlogServiceImpl implements IIotWarnlogService {
         IotWarnlevelEnum iotWarnlevelEnum = IotWarnlevelEnum.findByCode(iotWarnlogResVo.getWlLevel());
         iotWarnlogResVo.setWlLevelContent(iotWarnlevelEnum==null?null:iotWarnlevelEnum.getContent());
         SysUser user = sysUserMapper.selectUserById(iotWarnlogResVo.getWlDealuserid());
-        iotWarnlogResVo.setDealUserName(user.getUserName());
+        if(null != user){
+            iotWarnlogResVo.setDealUserName(user.getUserName());
+        }
+
 
         return iotWarnlogResVo;
     }
@@ -126,8 +133,8 @@ public class IotWarnlogServiceImpl implements IIotWarnlogService {
                 // 设置设备名称
                 iotWarnlogResVo.setDevName(iotDevice.getDevName());
                 // 设置设备经纬度
-                iotWarnlogResVo.setDevLngalign(iotDevice.getDevLngalign());
-                iotWarnlogResVo.setDevLatalign(iotDevice.getDevLatalign());
+                iotWarnlogResVo.setDevLngalign(null == iotDevice.getDevLngalign()?iotDevice.getDevLng():iotDevice.getDevLngalign());
+                iotWarnlogResVo.setDevLatalign(null == iotDevice.getDevLatalign()?iotDevice.getDevLat():iotDevice.getDevLatalign());
             }
 
             // 设置设备类型名称