From 0988d76cc27616d23c32846fdf4585750ce19d34 Mon Sep 17 00:00:00 2001 From: limingyu Date: Mon, 20 May 2024 14:59:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E5=85=AC=E5=8F=B8=E6=91=84=E5=83=8F?= =?UTF-8?q?=E5=A4=B4=E8=AF=A6=E6=83=85=E6=98=BE=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/mkmj/GateVideoController.java | 60 +++++++++++++++++++ .../zcloud/service/mkmj/GateVideoService.java | 23 +++++++ .../mkmj/impl/GateVideoServiceImpl.java | 34 +++++++++++ .../datasource/map/GateMachineMapper.xml | 5 +- .../datasource/map/GateVideoMapper.xml | 2 + 5 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/zcloud/controller/mkmj/GateVideoController.java create mode 100644 src/main/java/com/zcloud/service/mkmj/GateVideoService.java create mode 100644 src/main/java/com/zcloud/service/mkmj/impl/GateVideoServiceImpl.java diff --git a/src/main/java/com/zcloud/controller/mkmj/GateVideoController.java b/src/main/java/com/zcloud/controller/mkmj/GateVideoController.java new file mode 100644 index 00000000..9e57fb56 --- /dev/null +++ b/src/main/java/com/zcloud/controller/mkmj/GateVideoController.java @@ -0,0 +1,60 @@ +package com.zcloud.controller.mkmj; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.mkmj.GateVideoService; +import com.zcloud.util.DateUtil; +import com.zcloud.util.Jurisdiction; +import com.zcloud.util.Tools; +import com.zcloud.util.hk.HKUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 说明:视频管理 + * 作者:luoxiaobao + * 时间:2021-05-10 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/gateVideo") +public class GateVideoController extends BaseController { + + @Autowired + private GateVideoService gateVideoService; + + @RequestMapping(value="/goAllVideo") + @ResponseBody + public Object goAllVideo() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + + String DATA_IDS = pd.getString("DATA_IDS"); + if(Tools.notEmpty(DATA_IDS)){ + String ArrayDATA_IDS[] = DATA_IDS.split(","); + pd.put("ArrayDATA_IDS", ArrayDATA_IDS); + } + List videoList = gateVideoService.listBo(pd); //根据ID读取 + for (PageData video : videoList) { + if(video.get("INDEXCODE")!=null && !"".equals(video.getString("INDEXCODE"))){ + Map data = HKUtil.camerasPreviewURLs(video.getString("INDEXCODE"), "hls"); + video.put("HLSVIDEOURL", data); + Map resData = (Map) data.get("data"); + video.put("GBSVIDEOURL",resData.get("url")); + } + } + map.put("videoList", videoList); + map.put("result", errInfo); + return map; + } +} diff --git a/src/main/java/com/zcloud/service/mkmj/GateVideoService.java b/src/main/java/com/zcloud/service/mkmj/GateVideoService.java new file mode 100644 index 00000000..defe393e --- /dev/null +++ b/src/main/java/com/zcloud/service/mkmj/GateVideoService.java @@ -0,0 +1,23 @@ +package com.zcloud.service.mkmj; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:视频管理 + * 作者:luoxiaobao + * 时间:2021-05-10 + * 官网:www.zcloudchina.com + */ +public interface GateVideoService { + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listBo(PageData pd)throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/mkmj/impl/GateVideoServiceImpl.java b/src/main/java/com/zcloud/service/mkmj/impl/GateVideoServiceImpl.java new file mode 100644 index 00000000..e0d4ebc7 --- /dev/null +++ b/src/main/java/com/zcloud/service/mkmj/impl/GateVideoServiceImpl.java @@ -0,0 +1,34 @@ +package com.zcloud.service.mkmj.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.map.GateVideoMapper; +import com.zcloud.service.mkmj.GateVideoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 说明:视频管理 + * 作者:luoxiaobao + * 时间:2021-05-10 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class GateVideoServiceImpl implements GateVideoService { + + @Autowired + private GateVideoMapper gateVideoMapper; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listBo(PageData pd)throws Exception{ + return gateVideoMapper.listBo(pd); + } +} + diff --git a/src/main/resources/mybatis/datasource/map/GateMachineMapper.xml b/src/main/resources/mybatis/datasource/map/GateMachineMapper.xml index 6aa1edae..6ca493aa 100644 --- a/src/main/resources/mybatis/datasource/map/GateMachineMapper.xml +++ b/src/main/resources/mybatis/datasource/map/GateMachineMapper.xml @@ -146,14 +146,15 @@ bus_gatevideo v LEFT JOIN mk_gate_area o on v.GATE_AREA_ID = o.GATE_AREA_ID WHERE - v.isdelete = 0 + v.isdelete = 0 and v.LATITUDE IS NOT NULL and v.LONGITUDE IS NOT NULL and o.CORPINFO_ID in (select CORPINFO_ID from bus_corp_info where AREA = #{AREA} and ISDELETE = 0) and o.CORPINFO_ID = #{CORP_INFO_ID} - + group by + v.GATEVIDEO_ID