|
|
@@ -12,6 +12,7 @@ import com.yunfeiyun.agmp.iotm.web.mapper.IotDeviceMapper;
|
|
|
import com.yunfeiyun.agmp.iotm.web.mapper.IotWarnlogMapper;
|
|
|
import com.yunfeiyun.agmp.iotm.web.mapper.TosDevicetypeMapper;
|
|
|
import com.yunfeiyun.agmp.iotm.web.service.IIotWarnlogService;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -40,7 +41,7 @@ public class IotWarnlogServiceImpl implements IIotWarnlogService {
|
|
|
|
|
|
/**
|
|
|
* 查询告警记录
|
|
|
- *
|
|
|
+ *
|
|
|
* @param wlBid 告警记录主键
|
|
|
* @return 告警记录
|
|
|
*/
|
|
|
@@ -50,6 +51,31 @@ public class IotWarnlogServiceImpl implements IIotWarnlogService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 查询告警记录
|
|
|
+ *
|
|
|
+ * @param wlBid 告警记录主键
|
|
|
+ * @return 告警记录
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public IotWarnlogResVo selectIotWarnlogResVoByWlBid(String wlBid, String tid){
|
|
|
+ IotWarnlog iotWarnlog = iotWarnlogMapper.selectIotWarnlogById(wlBid, tid);
|
|
|
+ IotWarnlogResVo iotWarnlogResVo = new IotWarnlogResVo();
|
|
|
+ BeanUtils.copyProperties(iotWarnlog,iotWarnlogResVo);
|
|
|
+ IotDevice iotDevice = iotDeviceMapper.selectIotDeviceByDevBid(iotWarnlogResVo.getDevBid());
|
|
|
+ iotWarnlogResVo.setDevName(iotDevice.getDevName());
|
|
|
+ iotWarnlogResVo.setDevCode(iotDevice.getDevCode());
|
|
|
+ TosDevicetype iotDevicetype = tosDevicetypeMapper.selectTosDevicetypeByDevtypeBid(iotWarnlog.getDevtypeBid());
|
|
|
+ iotWarnlogResVo.setDevTypeName(iotDevicetype.getDevtypeName());
|
|
|
+ // 获取设备触发类型,并进行赋值
|
|
|
+ IotWarnTouchTypeEnum iotWarnTouchTypeEnum = IotWarnTouchTypeEnum.findByCode(iotWarnlogResVo.getWlType());
|
|
|
+ iotWarnlogResVo.setWlTypeContent(iotWarnTouchTypeEnum==null?null:iotWarnTouchTypeEnum.getContent());
|
|
|
+ // 获取设备告警等级,并进行赋值
|
|
|
+ IotWarnlevelEnum iotWarnlevelEnum = IotWarnlevelEnum.findByCode(iotWarnlogResVo.getWlLevel());
|
|
|
+ iotWarnlogResVo.setWlLevelContent(iotWarnlevelEnum==null?null:iotWarnlevelEnum.getContent());
|
|
|
+ return iotWarnlogResVo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 查询告警记录列表
|
|
|
*
|
|
|
* @param iotWarnlog 告警记录
|