|
|
@@ -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());
|
|
|
}
|
|
|
|
|
|
// 设置设备类型名称
|