重点工程-平台中所有的视频现支持反查绑定的重点工程
parent
7b4f85a08c
commit
6e46289973
|
@ -1,8 +1,12 @@
|
|||
package com.zcloud.controller.keyProjects;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.keyProjects.OutSourcedService;
|
||||
import com.zcloud.service.keyProjects.VideoManagerService;
|
||||
import com.zcloud.service.keyProjects.VideoResourcesService;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
|
@ -13,10 +17,8 @@ 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;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 说明:视频管理
|
||||
|
@ -31,6 +33,12 @@ public class VideoResourcesController extends BaseController {
|
|||
@Autowired
|
||||
private VideoResourcesService videoResourcesService;
|
||||
|
||||
@Autowired
|
||||
private VideoManagerService videoManagerService;
|
||||
|
||||
@Autowired
|
||||
private OutSourcedService outSourcedService;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
|
@ -190,4 +198,39 @@ public class VideoResourcesController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过摄像头查询绑定的重点工程数据
|
||||
*/
|
||||
@RequestMapping("/getRelevanceOutsourced")
|
||||
@ResponseBody
|
||||
public Object getRelevanceOutsourced() throws Exception {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String errInfo = "success";
|
||||
List<PageData> outsourcedList = Collections.emptyList();
|
||||
// 获取该摄像头绑定的重点工程ID列表
|
||||
List<PageData> outsourcedIds = videoManagerService.findRepeatOutSourcedIdByVideoId(this.getPageData());
|
||||
// 非空判断
|
||||
if (CollUtil.isNotEmpty(outsourcedIds)){
|
||||
// 通过Ids查询重点工程数据
|
||||
outsourcedList = outSourcedService.listOutSourcedByIds(outsourcedIds.stream().map(e -> e.getString("OUTSOURCED_ID")).collect(Collectors.toList()))
|
||||
.stream().map(e -> {
|
||||
// 遍历带有"VIDEOMANAGER_ID"的列表
|
||||
outsourcedIds.forEach(
|
||||
m -> {
|
||||
if (StringUtils.equals(m.getString("OUTSOURCED_ID"), e.getString("OUTSOURCED_ID"))){
|
||||
// 补全信息
|
||||
e.put("VIDEOMANAGER_ID", m.getString("VIDEOMANAGER_ID"));
|
||||
}
|
||||
}
|
||||
);
|
||||
return e;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
map.put("varList", outsourcedList);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -91,5 +91,7 @@ public interface OutSourcedMapper{
|
|||
|
||||
|
||||
List<PageData> listForCount(PageData pd);
|
||||
|
||||
List<PageData> listOutSourcedByIds(List ids);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,5 +77,7 @@ public interface VideoManagerMapper {
|
|||
void updateAiByOUTSOURCED_ID(PageData pd);
|
||||
|
||||
List<PageData> dataApplistPage(Page page);
|
||||
|
||||
List<PageData> findRepeatOutSourcedIdByVideoId(PageData video);
|
||||
}
|
||||
|
||||
|
|
|
@ -93,5 +93,7 @@ public interface OutSourcedService{
|
|||
|
||||
|
||||
List<PageData> listForCount(PageData pd);
|
||||
|
||||
List<PageData> listOutSourcedByIds(List ids);
|
||||
}
|
||||
|
||||
|
|
|
@ -75,5 +75,7 @@ public interface VideoManagerService {
|
|||
void updateAiByOUTSOURCED_ID(PageData pd);
|
||||
|
||||
List<PageData> listApp(Page page);
|
||||
|
||||
List<PageData> findRepeatOutSourcedIdByVideoId(PageData video)throws Exception;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,5 +121,9 @@ public class OutSourcedServiceImpl implements OutSourcedService {
|
|||
public List<PageData> listForCount(PageData pd) {
|
||||
return outsourcedMapper.listForCount(pd);
|
||||
}
|
||||
|
||||
public List<PageData> listOutSourcedByIds(List ids){
|
||||
return outsourcedMapper.listOutSourcedByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -126,5 +126,10 @@ public class VideoManagerServiceImpl implements VideoManagerService {
|
|||
public List<PageData> listApp(Page page) {
|
||||
return videomanagerMapper.dataApplistPage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PageData> findRepeatOutSourcedIdByVideoId(PageData video)throws Exception{
|
||||
return videomanagerMapper.findRepeatOutSourcedIdByVideoId(video);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -955,4 +955,17 @@
|
|||
and vac.CORPINFO_ID = #{CORPINFO_ID}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 通过List批量获取重点工程数据 -->
|
||||
<select id="listOutSourcedByIds" parameterType="List" resultType="pd">
|
||||
select <include refid="Field"></include>
|
||||
from <include refid="tableName"></include> f
|
||||
where f.ISDELETE = '0'
|
||||
|
||||
and f.OUTSOURCED_ID in
|
||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -312,4 +312,25 @@
|
|||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 获取到重复的摄像头绑定 -->
|
||||
<select id="findRepeatOutSourcedIdByVideoId" resultType="com.zcloud.entity.PageData">
|
||||
select
|
||||
f.OUTSOURCED_ID,
|
||||
f.VIDEOMANAGER_ID,
|
||||
f.VIDEONAME,
|
||||
f.CAMERAID,
|
||||
IFNULL(f.VIDEO_RESOURCES_ID,f.PLATFORMVIDEOMANAGEMENT_ID) as VIDEO_ID,
|
||||
(case when f.VIDEO_RESOURCES_ID is not null then '0' when f.PLATFORMVIDEOMANAGEMENT_ID is not null then '1' else '-1' end) as VIDEO_TYPE
|
||||
from
|
||||
<include refid="tableName"></include>
|
||||
f
|
||||
where
|
||||
#{VIDEO_ID} = (
|
||||
case when f.VIDEO_RESOURCES_ID is not null and f.VIDEO_RESOURCES_ID != '' then f.VIDEO_RESOURCES_ID
|
||||
when f.PLATFORMVIDEOMANAGEMENT_ID is not null and f.PLATFORMVIDEOMANAGEMENT_ID != '' then f.PLATFORMVIDEOMANAGEMENT_ID
|
||||
else '-1' end
|
||||
)
|
||||
and f.ISDELETE='0'
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue