|
|
@ -1,14 +1,17 @@ |
|
|
|
package com.yxt.supervise.monitor.biz.messageInfo; |
|
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.yxt.supervise.monitor.api.entity.CallPolice; |
|
|
|
import com.yxt.supervise.monitor.api.entity.Device; |
|
|
|
import com.yxt.supervise.monitor.api.entity.DeviceLog; |
|
|
|
import com.yxt.supervise.monitor.api.entity.MessageInfo; |
|
|
|
import com.yxt.supervise.monitor.api.vo.MessageVo; |
|
|
|
import com.yxt.supervise.monitor.api.vo.PageVo; |
|
|
|
import com.yxt.supervise.monitor.biz.callpolice.YCallPoliceMapper; |
|
|
|
import com.yxt.supervise.monitor.biz.device.YDeviceMapper; |
|
|
|
import com.yxt.supervise.monitor.biz.device.YDeviceService; |
|
|
@ -36,6 +39,9 @@ public class YMessageInfoService extends ServiceImpl<YMessageInfoMapper, Message |
|
|
|
@Resource |
|
|
|
YDeviceMapper yDeviceMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
YMessageInfoMapper yMessageInfoMapper; |
|
|
|
|
|
|
|
|
|
|
|
public List<CallPolice> saveMessageInfo() { |
|
|
|
String url = "https://api2.hik-cloud.com/api/v1/mq/consumer/messages"; |
|
|
@ -108,4 +114,37 @@ public class YMessageInfoService extends ServiceImpl<YMessageInfoMapper, Message |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
public IPage<MessageInfo> getMessageInfoPage(Map<String, String> searchVo, PageVo pageVo) { |
|
|
|
IPage<MessageInfo> page = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(); |
|
|
|
page.setSize(pageVo.getSize()); |
|
|
|
page.setCurrent((long) pageVo.getCurrent()); |
|
|
|
|
|
|
|
QueryWrapper<MessageInfo> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(searchVo.get("startTime"))) { |
|
|
|
queryWrapper.gt("t.createTime", searchVo.get("startTime")); |
|
|
|
} |
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(searchVo.get("name"))) { |
|
|
|
queryWrapper.like("d.name", searchVo.get("name")); |
|
|
|
} |
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(searchVo.get("position"))) { |
|
|
|
queryWrapper.like("d.position", searchVo.get("position")); |
|
|
|
} |
|
|
|
queryWrapper.eq("t.isDelete", 0); |
|
|
|
|
|
|
|
IPage<MessageInfo> athleteBOIPage = null; |
|
|
|
try { |
|
|
|
athleteBOIPage = yMessageInfoMapper.getMessageInfoPage(page, queryWrapper); |
|
|
|
athleteBOIPage.getRecords().forEach(oo -> { |
|
|
|
oo.setCallType("消息通知"); |
|
|
|
}); |
|
|
|
} catch (Exception e) { |
|
|
|
System.out.println(e); |
|
|
|
athleteBOIPage = null; |
|
|
|
} |
|
|
|
return athleteBOIPage; |
|
|
|
} |
|
|
|
} |
|
|
|