From f355ef485a56e613b71d0262c089b995d7ca10d2 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 23 五月 2025 17:38:39 +0800 Subject: [PATCH] 集成MQTT对接公交主防数据 --- ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/controller/UPWarnMsgAdptInfoController.java | 39 +++++++++++++++++++++++++++++++++++---- 1 files changed, 35 insertions(+), 4 deletions(-) diff --git a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/controller/UPWarnMsgAdptInfoController.java b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/controller/UPWarnMsgAdptInfoController.java index b000fad..084fecf 100644 --- a/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/controller/UPWarnMsgAdptInfoController.java +++ b/ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/controller/UPWarnMsgAdptInfoController.java @@ -1,5 +1,6 @@ package com.ruoyi.dataInterchange.controller; +import com.alibaba.fastjson2.JSON; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.bean.BeanUtils; import com.ruoyi.dataInterchange.api.vo.UPWarnMsgAdptInfoVo; @@ -7,10 +8,9 @@ import com.ruoyi.dataInterchange.dao.UPWarnMsgUrgeTodoAckDao; import com.ruoyi.dataInterchange.model.UPWarnMsgAdptInfo; import com.ruoyi.dataInterchange.model.UPWarnMsgUrgeTodoAck; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.dataInterchange.util.haikang.model.SubscriptionEvent; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.ArrayList; @@ -23,6 +23,7 @@ * @author zhibing.pu * @Date 2025/4/2 10:08 */ +@Slf4j @RestController @RequestMapping("/warnMsgAdptInfo") public class UPWarnMsgAdptInfoController { @@ -71,4 +72,34 @@ return R.ok(list); } } + + + /** + * 根据信息id查询报警原始数据 + * + * @param infoId + * @return + */ + @PostMapping("/findByInfoId") + public R<UPWarnMsgAdptInfoVo> findByInfoId(@RequestParam("infoId") Integer infoId) { + UPWarnMsgAdptInfo warnMsgAdptInfo = upWarnMsgAdptInfoDao.findByInfoIdIs(infoId); + if(null != warnMsgAdptInfo){ + UPWarnMsgAdptInfoVo vo = new UPWarnMsgAdptInfoVo(); + BeanUtils.copyProperties(warnMsgAdptInfo, vo); + return R.ok(vo); + } + return R.ok(); + } + + + /** + * 海康威视报警信息推送 + * @return + */ + @ResponseBody + @PostMapping("/alarmNotice") + public void alarmNotice(@RequestBody SubscriptionEvent event) { + log.error("收到危海康的事件回调"); + log.error(JSON.toJSONString(event)); + } } -- Gitblit v1.7.1