forked from integrated_whb/integrated_whb
八项作业摄像头播放相关
parent
c6c76886d7
commit
571bff720f
|
@ -212,6 +212,18 @@ public class MapController extends BaseController {
|
|||
return timeArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 地图获取摄像头
|
||||
* @Author: dearLin
|
||||
* @Date: 2024/2/1/001 15:43
|
||||
* @Param: [] []
|
||||
* @Return: java.lang.Object
|
||||
*/
|
||||
@RequestMapping(value = "/getCameraList")
|
||||
@ResponseBody
|
||||
public Object getCameraList() throws Exception {
|
||||
return ReturnMap.ok().put("varList", videomanagerService.getCameraList(getPageData()));
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
List<Map<String, String>> timeArray = generateTimeArray();
|
||||
for (Map<String, String> monthInfo : timeArray) {
|
||||
|
|
|
@ -111,5 +111,4 @@ public class MapEightController extends BaseController {
|
|||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -75,5 +75,7 @@ public interface VideoManagerService {
|
|||
PageData getCameraAlarmTimeCount(PageData pageData);
|
||||
|
||||
PageData getCameraTopToShow(PageData pageData);
|
||||
|
||||
List<PageData> getCameraList(PageData pageData) throws Exception;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,25 @@
|
|||
package com.zcloud.service.video.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.video.VideoManagerMapper;
|
||||
import com.zcloud.service.video.VideoManagerService;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper;
|
||||
import com.zcloud.util.PLSUtil;
|
||||
import com.zcloud.util.ReturnMap;
|
||||
import com.zcloud.util.Tools;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 说明:视频管理
|
||||
|
@ -24,74 +34,94 @@ public class VideoManagerServiceImpl implements VideoManagerService {
|
|||
@Autowired
|
||||
private VideoManagerMapper videomanagerMapper;
|
||||
|
||||
/**新增
|
||||
@Autowired
|
||||
private EightWorkVideoManagerMapper eightWorkVideoManagerMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception{
|
||||
public void save(PageData pd) throws Exception {
|
||||
videomanagerMapper.save(pd);
|
||||
}
|
||||
|
||||
/**删除
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception{
|
||||
public void delete(PageData pd) throws Exception {
|
||||
videomanagerMapper.delete(pd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editZhiding(PageData pd) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
videomanagerMapper.editZhiding(pd);
|
||||
}
|
||||
/**修改
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception{
|
||||
public void edit(PageData pd) throws Exception {
|
||||
videomanagerMapper.edit(pd);
|
||||
}
|
||||
|
||||
public void editPls(PageData pd)throws Exception{
|
||||
public void editPls(PageData pd) throws Exception {
|
||||
videomanagerMapper.editPls(pd);
|
||||
}
|
||||
|
||||
public void editIsShowBycorpinfoid(PageData pd)throws Exception{
|
||||
public void editIsShowBycorpinfoid(PageData pd) throws Exception {
|
||||
videomanagerMapper.editIsShowBycorpinfoid(pd);
|
||||
}
|
||||
public void editIsShow(PageData pd)throws Exception{
|
||||
|
||||
public void editIsShow(PageData pd) throws Exception {
|
||||
videomanagerMapper.editIsShow(pd);
|
||||
}
|
||||
|
||||
/**列表
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception{
|
||||
public List<PageData> list(Page page) throws Exception {
|
||||
return videomanagerMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**列表(全部)
|
||||
/**
|
||||
* 列表(全部)
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception{
|
||||
public List<PageData> listAll(PageData pd) throws Exception {
|
||||
return videomanagerMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**通过id获取数据
|
||||
/**
|
||||
* 通过id获取数据
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception{
|
||||
public PageData findById(PageData pd) throws Exception {
|
||||
return videomanagerMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||
public void deleteAll(String[] ArrayDATA_IDS) throws Exception {
|
||||
videomanagerMapper.deleteAll(ArrayDATA_IDS);
|
||||
}
|
||||
|
||||
|
@ -127,9 +157,9 @@ public class VideoManagerServiceImpl implements VideoManagerService {
|
|||
accumulatedList.add(leijicont);
|
||||
}
|
||||
PageData valuePd = new PageData();
|
||||
valuePd.put("monthStrList",monthStrList);
|
||||
valuePd.put("monthList",monthList);
|
||||
valuePd.put("accumulatedList",accumulatedList);
|
||||
valuePd.put("monthStrList", monthStrList);
|
||||
valuePd.put("monthList", monthList);
|
||||
valuePd.put("accumulatedList", accumulatedList);
|
||||
return valuePd;
|
||||
}
|
||||
|
||||
|
@ -138,5 +168,46 @@ public class VideoManagerServiceImpl implements VideoManagerService {
|
|||
return videomanagerMapper.getCameraTopToShow(pageData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PageData> getCameraList(PageData pageData) throws Exception {
|
||||
pageData.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
JSONObject ryCameraList = PLSUtil.getCameraList(pageData.getString("CORPINFO_ID"));
|
||||
switch (pageData.getString("CAMREA_TYPE")) {
|
||||
case "workSafelyCamera":
|
||||
// 八项作业摄像头
|
||||
List<PageData> eightWorkVideoList = eightWorkVideoManagerMapper.listAll(pageData);
|
||||
return getMapCameraList(eightWorkVideoList, ryCameraList);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private List<PageData> getMapCameraList(List<PageData> eightWorkVideoList, JSONObject ryCameraList) {
|
||||
HashMap<String, String> videoIds = new HashMap<>();
|
||||
HashMap<String, String> videolonlat = new HashMap<>();
|
||||
eightWorkVideoList.forEach(item -> {
|
||||
videoIds.put(item.getString("PLS_ID"), item.getString("VIDEOMANAGER_ID"));
|
||||
videoIds.put("NAME" + item.getString("PLS_ID"), item.getString("VIDEONAME"));
|
||||
videoIds.put("URL" + item.getString("PLS_ID"), item.getString("VIDEOURL"));
|
||||
videoIds.put("CODE" + item.getString("PLS_ID"), item.getString("CODE"));
|
||||
}
|
||||
);
|
||||
if (!"200".equals(ryCameraList.getString("code"))) {
|
||||
return null;
|
||||
}
|
||||
// 除去没有经纬度的摄像头。
|
||||
List<PageData> collect = JSON.parseArray(JSON.toJSONString(ryCameraList.getJSONArray("rows")), PageData.class).stream()
|
||||
.filter((item -> Tools.notEmpty(item.getString("lon")) && videoIds.containsKey(item.getString("camId")))).collect(Collectors.toList());
|
||||
collect
|
||||
.forEach(item -> {
|
||||
item.put("VIDEOMANAGER_ID", videoIds.get(item.getString("camId")));
|
||||
item.put("VIDEONAME", videoIds.get("NAME" + item.getString("camId")));
|
||||
item.put("VIDEOURL", videoIds.get("URL" + item.getString("camId")));
|
||||
item.put("CODE", videoIds.get("CODE" + item.getString("camId")));
|
||||
videolonlat.put(item.getString("camId"), item.getString("lon") + "," + item.getString("lat"));
|
||||
});
|
||||
return collect;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,20 @@ public class PLSUtil {
|
|||
JSONObject.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 查询摄像头
|
||||
* @Author: dearLin
|
||||
* @Date: 2024/1/25/025 14:37
|
||||
* @Param: [java.lang.String, java.lang.Integer, java.lang.Integer] [keywords, currentPage, showCount]
|
||||
* @Return: com.alibaba.fastjson.JSONObject
|
||||
*/
|
||||
public static JSONObject getCameraList(String CORPINFO_ID) throws Exception {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", getToken(CORPINFO_ID));
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity<>(headers);
|
||||
ResponseEntity<JSONObject> exchange = restTemplate.exchange(PLSUtil.BAKEADDR.get(CORPINFO_ID) + "/device/camera/list?pageNum=1&pageSize=100000&str=", HttpMethod.GET, httpEntity, JSONObject.class);
|
||||
return exchange.getBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 添加摄像头
|
||||
|
|
|
@ -183,9 +183,19 @@
|
|||
<!-- 列表(全部) -->
|
||||
<select id="listAll" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
<include refid="Field"></include>,
|
||||
v.VIDEONAME,
|
||||
v.VIDEOURL,
|
||||
v.CODE,
|
||||
v.PLS_ID
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
LEFT JOIN bus_videomanager v ON f.VIDEOMANAGER_ID = v.VIDEOMANAGER_ID and v.ISDELETE = 0
|
||||
where
|
||||
f.ISDELETE = 0
|
||||
<if test="CORPINFO_ID != null and CORPINFO_ID != ''">
|
||||
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
|
|
Loading…
Reference in New Issue