forked from integrated_whb/integrated_whb
八项作业摄像头播放相关
parent
c6c76886d7
commit
571bff720f
|
@ -212,6 +212,18 @@ public class MapController extends BaseController {
|
||||||
return timeArray;
|
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) {
|
public static void main(String[] args) {
|
||||||
List<Map<String, String>> timeArray = generateTimeArray();
|
List<Map<String, String>> timeArray = generateTimeArray();
|
||||||
for (Map<String, String> monthInfo : timeArray) {
|
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 getCameraAlarmTimeCount(PageData pageData);
|
||||||
|
|
||||||
PageData getCameraTopToShow(PageData pageData);
|
PageData getCameraTopToShow(PageData pageData);
|
||||||
|
|
||||||
|
List<PageData> getCameraList(PageData pageData) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,25 @@
|
||||||
package com.zcloud.service.video.impl;
|
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.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.mapper.datasource.video.VideoManagerMapper;
|
import com.zcloud.mapper.datasource.video.VideoManagerMapper;
|
||||||
import com.zcloud.service.video.VideoManagerService;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 说明:视频管理
|
* 说明:视频管理
|
||||||
|
@ -21,122 +31,183 @@ import java.util.List;
|
||||||
@Transactional //开启事物
|
@Transactional //开启事物
|
||||||
public class VideoManagerServiceImpl implements VideoManagerService {
|
public class VideoManagerServiceImpl implements VideoManagerService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VideoManagerMapper videomanagerMapper;
|
private VideoManagerMapper videomanagerMapper;
|
||||||
|
|
||||||
/**新增
|
@Autowired
|
||||||
* @param pd
|
private EightWorkVideoManagerMapper eightWorkVideoManagerMapper;
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public void save(PageData pd)throws Exception{
|
|
||||||
videomanagerMapper.save(pd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**删除
|
/**
|
||||||
* @param pd
|
* 新增
|
||||||
* @throws Exception
|
*
|
||||||
*/
|
* @param pd
|
||||||
public void delete(PageData pd)throws Exception{
|
* @throws Exception
|
||||||
videomanagerMapper.delete(pd);
|
*/
|
||||||
}
|
public void save(PageData pd) throws Exception {
|
||||||
@Override
|
videomanagerMapper.save(pd);
|
||||||
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{
|
|
||||||
videomanagerMapper.edit(pd);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void editPls(PageData pd)throws Exception{
|
/**
|
||||||
videomanagerMapper.editPls(pd);
|
* 删除
|
||||||
}
|
*
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void delete(PageData pd) throws Exception {
|
||||||
|
videomanagerMapper.delete(pd);
|
||||||
|
}
|
||||||
|
|
||||||
public void editIsShowBycorpinfoid(PageData pd)throws Exception{
|
@Override
|
||||||
videomanagerMapper.editIsShowBycorpinfoid(pd);
|
public void editZhiding(PageData pd) throws Exception {
|
||||||
}
|
// TODO Auto-generated method stub
|
||||||
public void editIsShow(PageData pd)throws Exception{
|
videomanagerMapper.editZhiding(pd);
|
||||||
videomanagerMapper.editIsShow(pd);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**列表
|
/**
|
||||||
* @param page
|
* 修改
|
||||||
* @throws Exception
|
*
|
||||||
*/
|
* @param pd
|
||||||
public List<PageData> list(Page page)throws Exception{
|
* @throws Exception
|
||||||
return videomanagerMapper.datalistPage(page);
|
*/
|
||||||
}
|
public void edit(PageData pd) throws Exception {
|
||||||
|
videomanagerMapper.edit(pd);
|
||||||
|
}
|
||||||
|
|
||||||
/**列表(全部)
|
public void editPls(PageData pd) throws Exception {
|
||||||
* @param pd
|
videomanagerMapper.editPls(pd);
|
||||||
* @throws Exception
|
}
|
||||||
*/
|
|
||||||
public List<PageData> listAll(PageData pd)throws Exception{
|
|
||||||
return videomanagerMapper.listAll(pd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**通过id获取数据
|
public void editIsShowBycorpinfoid(PageData pd) throws Exception {
|
||||||
* @param pd
|
videomanagerMapper.editIsShowBycorpinfoid(pd);
|
||||||
* @throws Exception
|
}
|
||||||
*/
|
|
||||||
public PageData findById(PageData pd)throws Exception{
|
|
||||||
return videomanagerMapper.findById(pd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**批量删除
|
public void editIsShow(PageData pd) throws Exception {
|
||||||
* @param ArrayDATA_IDS
|
videomanagerMapper.editIsShow(pd);
|
||||||
* @throws Exception
|
}
|
||||||
*/
|
|
||||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
|
||||||
videomanagerMapper.deleteAll(ArrayDATA_IDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public PageData findByCode(PageData videoPd) {
|
* 列表
|
||||||
return videomanagerMapper.findByCode(videoPd);
|
*
|
||||||
}
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page) throws Exception {
|
||||||
|
return videomanagerMapper.datalistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public List<PageData> getCameraAlarmCount(PageData pageData) {
|
* 列表(全部)
|
||||||
return videomanagerMapper.getCameraAlarmCount(pageData);
|
*
|
||||||
}
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd) throws Exception {
|
||||||
|
return videomanagerMapper.listAll(pd);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public List<PageData> getCameraAlarmTypeCount(PageData pageData) {
|
* 通过id获取数据
|
||||||
return videomanagerMapper.getCameraAlarmTypeCount(pageData);
|
*
|
||||||
}
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd) throws Exception {
|
||||||
|
return videomanagerMapper.findById(pd);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public PageData getCameraAlarmTimeCount(PageData pageData) {
|
* 批量删除
|
||||||
List<PageData> cameraAlarmTimeCount = videomanagerMapper.getCameraAlarmTimeCount(pageData);
|
*
|
||||||
int leijicont = 0;
|
* @param ArrayDATA_IDS
|
||||||
// 月份集合
|
* @throws Exception
|
||||||
List<String> monthStrList = new ArrayList<>();
|
*/
|
||||||
// 当月数据
|
public void deleteAll(String[] ArrayDATA_IDS) throws Exception {
|
||||||
List<Integer> monthList = new ArrayList<>();
|
videomanagerMapper.deleteAll(ArrayDATA_IDS);
|
||||||
// 累计数据
|
}
|
||||||
List<Integer> accumulatedList = new ArrayList<>();
|
|
||||||
for (PageData item : cameraAlarmTimeCount) {
|
|
||||||
monthStrList.add(item.getString("MONTH"));
|
|
||||||
monthList.add(Integer.parseInt(item.getString("MONTH_COUNT")));
|
|
||||||
leijicont += Integer.parseInt(item.getString("MONTH_COUNT"));
|
|
||||||
accumulatedList.add(leijicont);
|
|
||||||
}
|
|
||||||
PageData valuePd = new PageData();
|
|
||||||
valuePd.put("monthStrList",monthStrList);
|
|
||||||
valuePd.put("monthList",monthList);
|
|
||||||
valuePd.put("accumulatedList",accumulatedList);
|
|
||||||
return valuePd;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageData getCameraTopToShow(PageData pageData) {
|
public PageData findByCode(PageData videoPd) {
|
||||||
return videomanagerMapper.getCameraTopToShow(pageData);
|
return videomanagerMapper.findByCode(videoPd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PageData> getCameraAlarmCount(PageData pageData) {
|
||||||
|
return videomanagerMapper.getCameraAlarmCount(pageData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PageData> getCameraAlarmTypeCount(PageData pageData) {
|
||||||
|
return videomanagerMapper.getCameraAlarmTypeCount(pageData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData getCameraAlarmTimeCount(PageData pageData) {
|
||||||
|
List<PageData> cameraAlarmTimeCount = videomanagerMapper.getCameraAlarmTimeCount(pageData);
|
||||||
|
int leijicont = 0;
|
||||||
|
// 月份集合
|
||||||
|
List<String> monthStrList = new ArrayList<>();
|
||||||
|
// 当月数据
|
||||||
|
List<Integer> monthList = new ArrayList<>();
|
||||||
|
// 累计数据
|
||||||
|
List<Integer> accumulatedList = new ArrayList<>();
|
||||||
|
for (PageData item : cameraAlarmTimeCount) {
|
||||||
|
monthStrList.add(item.getString("MONTH"));
|
||||||
|
monthList.add(Integer.parseInt(item.getString("MONTH_COUNT")));
|
||||||
|
leijicont += Integer.parseInt(item.getString("MONTH_COUNT"));
|
||||||
|
accumulatedList.add(leijicont);
|
||||||
|
}
|
||||||
|
PageData valuePd = new PageData();
|
||||||
|
valuePd.put("monthStrList", monthStrList);
|
||||||
|
valuePd.put("monthList", monthList);
|
||||||
|
valuePd.put("accumulatedList", accumulatedList);
|
||||||
|
return valuePd;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData getCameraTopToShow(PageData pageData) {
|
||||||
|
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);
|
JSONObject.class);
|
||||||
return exchange.getBody();
|
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: 添加摄像头
|
* @Description: 添加摄像头
|
||||||
|
|
|
@ -183,9 +183,19 @@
|
||||||
<!-- 列表(全部) -->
|
<!-- 列表(全部) -->
|
||||||
<select id="listAll" parameterType="pd" resultType="pd">
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
select
|
select
|
||||||
<include refid="Field"></include>
|
<include refid="Field"></include>,
|
||||||
|
v.VIDEONAME,
|
||||||
|
v.VIDEOURL,
|
||||||
|
v.CODE,
|
||||||
|
v.PLS_ID
|
||||||
from
|
from
|
||||||
<include refid="tableName"></include> f
|
<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>
|
</select>
|
||||||
|
|
||||||
<!-- 批量删除 -->
|
<!-- 批量删除 -->
|
||||||
|
|
Loading…
Reference in New Issue