From 7b09a4398feed2cf0d060f4955b9d361badd82e4 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 23 五月 2025 16:18:52 +0800 Subject: [PATCH] 新增公交的接口对接 --- ruoyi-service/ruoyi-dataInterchange/src/main/java/com/ruoyi/dataInterchange/controller/UPWarnMsgAdptInfoController.java | 30 +++++++++++++++++++++++------- 1 files changed, 23 insertions(+), 7 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 8ee19d0..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 { @@ -82,8 +83,23 @@ @PostMapping("/findByInfoId") public R<UPWarnMsgAdptInfoVo> findByInfoId(@RequestParam("infoId") Integer infoId) { UPWarnMsgAdptInfo warnMsgAdptInfo = upWarnMsgAdptInfoDao.findByInfoIdIs(infoId); - UPWarnMsgAdptInfoVo vo = new UPWarnMsgAdptInfoVo(); - BeanUtils.copyProperties(warnMsgAdptInfo, vo); - return R.ok(vo); + 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