提交代码
parent
ded2d46796
commit
defe0080fa
|
@ -1,7 +1,9 @@
|
|||
package com.yanzhu.jh.bigscreen.web.controller;
|
||||
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.yanzhu.jh.video.domain.DevAiProjectData;
|
||||
import com.yanzhu.jh.video.domain.SurProjectVideoConfig;
|
||||
|
@ -12,9 +14,11 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 实时视频Conller
|
||||
|
@ -23,6 +27,9 @@ import java.util.Map;
|
|||
@RequestMapping("/bgscreen/aiBoxVideo")
|
||||
public class VideoAiBoxController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private IDevAiProjectDataService devAiProjectDataService;
|
||||
|
||||
|
@ -35,6 +42,11 @@ public class VideoAiBoxController extends BaseController {
|
|||
@GetMapping("/listView")
|
||||
public AjaxResult listView(String deptId, String projectId)
|
||||
{
|
||||
String key="bgscreen_aiBoxVideo_listView_"+deptId+"_"+projectId;
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return success(obj);
|
||||
}
|
||||
DevAiProjectData devAiProjectData = new DevAiProjectData();
|
||||
if(deptId!=null && !"0".equals(deptId)){
|
||||
devAiProjectData.setProjectDeptId(deptId);
|
||||
|
@ -42,10 +54,12 @@ public class VideoAiBoxController extends BaseController {
|
|||
if(projectId!=null && !"0".equals(projectId)){
|
||||
devAiProjectData.setProjectId(Convert.toLong(projectId));
|
||||
}
|
||||
//默认查询当天数据
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("limit",100);
|
||||
params.put("date",new Date());
|
||||
devAiProjectData.setParams(params);
|
||||
List<DevAiProjectData> list = devAiProjectDataService.selectDevAiProjectDataList(devAiProjectData);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
@ -55,6 +69,11 @@ public class VideoAiBoxController extends BaseController {
|
|||
@GetMapping(value = "/getVideoPassage")
|
||||
public AjaxResult getVideoPassage(String deptId, String projectId, String passageType, String importance)
|
||||
{
|
||||
String key="bgscreen_aiBoxVideo_getVideoPassage_"+deptId+"_"+projectId+"_"+passageType+"_"+importance;
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return success(obj);
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(deptId!=null && !"0".equals(deptId)){
|
||||
map.put("deptId",deptId);
|
||||
|
@ -68,15 +87,22 @@ public class VideoAiBoxController extends BaseController {
|
|||
if(importance!=null && !"".equals(importance)){
|
||||
map.put("importance",importance);
|
||||
}
|
||||
return success(surProjectVideoConfigService.selectSurProjectVideoConfigByParams(map));
|
||||
List<SurProjectVideoConfig> list = surProjectVideoConfigService.selectSurProjectVideoConfigByParams(map);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询视频配置列表
|
||||
*/
|
||||
@GetMapping("/groupCountByAlarmType")
|
||||
public AjaxResult groupCountByAlarmType(String deptId,String projectId)
|
||||
public AjaxResult groupCountByAlarmType(String deptId,String projectId,String now)
|
||||
{
|
||||
String key="bgscreen_aiBoxVideo_groupCountByAlarmType_"+deptId+"_"+projectId+"_"+now;
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return success(obj);
|
||||
}
|
||||
DevAiProjectData devAiProjectData = new DevAiProjectData();
|
||||
if(deptId!=null && !"0".equals(deptId)){
|
||||
devAiProjectData.setProjectDeptId(deptId);
|
||||
|
@ -84,7 +110,38 @@ public class VideoAiBoxController extends BaseController {
|
|||
if(projectId!=null && !"0".equals(projectId)){
|
||||
devAiProjectData.setProjectId(Convert.toLong(projectId));
|
||||
}
|
||||
//查询当天数据
|
||||
if(now!=null && "Y".equals(now)){
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("date",new Date());
|
||||
devAiProjectData.setParams(params);
|
||||
}
|
||||
List<Map<String, Object>> list = devAiProjectDataService.groupCountByAlarmType(devAiProjectData);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询视频配置列表汇总
|
||||
*/
|
||||
@GetMapping("/selectGroupCountVideoConfig")
|
||||
public AjaxResult selectGroupCountVideoConfig(String deptId,String projectId)
|
||||
{
|
||||
String key="bgscreen_aiBoxVideo_selectGroupCountVideoConfig_"+deptId+"_"+projectId;
|
||||
Object obj=redisCache.getCacheObject(key);
|
||||
if(obj!=null){
|
||||
return success(obj);
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(deptId!=null && !"0".equals(deptId)){
|
||||
map.put("deptId",deptId);
|
||||
}
|
||||
if(projectId!=null && !"0".equals(projectId)){
|
||||
map.put("projectId",projectId);
|
||||
}
|
||||
List<Map<String, Object>> list = surProjectVideoConfigService.selectGroupCountVideoConfig(map);
|
||||
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -37,10 +37,6 @@ public class VideoController extends BaseController {
|
|||
if(projectId!=null && !"0".equals(projectId)){
|
||||
surProjectVideoConfig.setProjectId(Convert.toLong(projectId));
|
||||
}
|
||||
//默认查询当天数据
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("date","Y");
|
||||
surProjectVideoConfig.setParams(params);
|
||||
List<SurProjectVideoConfig> list = surProjectVideoConfigService.selectSurProjectVideoConfigList(surProjectVideoConfig);
|
||||
return success(list);
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@ public class SurProjectVideoPassage extends BaseEntity
|
|||
@Excel(name = "视频通道状态")
|
||||
private String passageState;
|
||||
|
||||
private String passageType;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
@ -92,6 +94,14 @@ public class SurProjectVideoPassage extends BaseEntity
|
|||
this.passageState = passageState;
|
||||
}
|
||||
|
||||
public String getPassageType() {
|
||||
return passageType;
|
||||
}
|
||||
|
||||
public void setPassageType(String passageType) {
|
||||
this.passageType = passageType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
@ -38,6 +38,14 @@ public interface SurProjectVideoConfigMapper
|
|||
*/
|
||||
public List<SurProjectVideoConfig> selectSurProjectVideoConfigByParams(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 查询视频配置
|
||||
*
|
||||
* @param map 查询条件
|
||||
* @return 视频配置
|
||||
*/
|
||||
public List<SurProjectVideoConfig> selectSurProjectVideoConfigByGroupCountParams(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 查询视频配置列表
|
||||
*
|
||||
|
|
|
@ -102,4 +102,12 @@ public interface ISurProjectVideoConfigService
|
|||
* @return 视频配置
|
||||
*/
|
||||
public List<SurProjectVideoConfig> selectSurProjectVideoConfigByParams(Map<String, Object> map);
|
||||
|
||||
/**
|
||||
* 查询视频配置汇总
|
||||
*
|
||||
* @param map 查询条件
|
||||
* @return 视频配置
|
||||
*/
|
||||
public List<Map<String, Object>> selectGroupCountVideoConfig(Map<String, Object> map);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package com.yanzhu.jh.video.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.enums.PublicStateEnum;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.yanzhu.jh.video.domain.SurProjectVideoConfig;
|
||||
import com.yanzhu.jh.video.domain.SurProjectVideoPassage;
|
||||
import com.yanzhu.jh.video.mapper.SurProjectVideoConfigMapper;
|
||||
|
@ -12,9 +14,8 @@ 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.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* 视频配置Service业务层处理
|
||||
|
@ -25,6 +26,9 @@ import java.util.Map;
|
|||
@Service
|
||||
public class SurProjectVideoConfigServiceImpl implements ISurProjectVideoConfigService
|
||||
{
|
||||
@Autowired
|
||||
ISysDictDataService sysDictDataService;
|
||||
|
||||
@Autowired
|
||||
private SurProjectVideoConfigMapper surProjectVideoConfigMapper;
|
||||
|
||||
|
@ -222,4 +226,37 @@ public class SurProjectVideoConfigServiceImpl implements ISurProjectVideoConfigS
|
|||
public List<SurProjectVideoConfig> selectSurProjectVideoConfigByParams(Map<String, Object> map) {
|
||||
return surProjectVideoConfigMapper.selectSurProjectVideoConfigByParams(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询视频配置汇总
|
||||
*
|
||||
* @param map 查询条件
|
||||
* @return 视频配置
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> selectGroupCountVideoConfig(Map<String, Object> map){
|
||||
List<SurProjectVideoConfig> list = surProjectVideoConfigMapper.selectSurProjectVideoConfigByGroupCountParams(map);
|
||||
SysDictData dictData = new SysDictData();
|
||||
dictData.setDictType("aibox_alarm_type");
|
||||
List<SysDictData> dictlist = sysDictDataService.selectDictDataList(dictData);
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
for(SysDictData dict : dictlist){
|
||||
Map<String, Object> dataMap = new HashMap<>();
|
||||
dataMap.put("id",dict.getDictValue());
|
||||
dataMap.put("name",dict.getDictLabel());
|
||||
AtomicInteger count = new AtomicInteger();
|
||||
for(SurProjectVideoConfig v:list){
|
||||
if(v.getSurProjectVideoPassageList()!=null && v.getSurProjectVideoPassageList().size()>0){
|
||||
for(SurProjectVideoPassage vp:v.getSurProjectVideoPassageList()){
|
||||
if(vp.getPassageType()!=null && vp.getPassageType().contains(dict.getDictValue())){
|
||||
count.addAndGet(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dataMap.put("value",count.intValue());
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,8 +52,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</association>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<sql id="selectSmzProjectQuarterlyAssessVo">
|
||||
select id, project_id, year, quarterly, date, plan_target, cur_progress, lagging_matters, problem, plan_date, finish_date, status, remark, is_del, create_by, create_time, update_by, update_time from smz_project_quarterly_assess
|
||||
</sql>
|
||||
|
|
|
@ -42,10 +42,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectSurProjectMaterialSealList" parameterType="SurProjectMaterialSeal" resultMap="SurProjectMaterialSealResult">
|
||||
<include refid="selectSurProjectMaterialSealVo"/>
|
||||
<!--监理单位/总包公司/分包单位-->
|
||||
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> left join sur_project_unit_info spui on spui.projectId = sp.id</if>
|
||||
<!--普通用户查询项目人员-->
|
||||
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> left join sur_project_userinfo spu on spu.project_id = sp.id</if>
|
||||
<where>
|
||||
and spme.is_del='0'
|
||||
<if test="projectId != null "> and spme.project_id = #{projectId}</if>
|
||||
|
|
|
@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'>
|
||||
and sp.id in (select spu.project_id from sur_project_userinfo spu where spu.user_id = #{nowUser} and spu.is_del=0)
|
||||
</if>
|
||||
<if test="params.date != null"> and date(dapd.create_time) = date(now())</if>
|
||||
<if test="params.date != null"> and date(dapd.create_time) = date(#{params.date})</if>
|
||||
</where>
|
||||
order by dapd.create_time desc
|
||||
</select>
|
||||
|
@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="groupCountByAlarmType" parameterType="DevAiProjectData" resultType="map">
|
||||
select dapd.alarm_type as alarmType,sdd.dict_label as alarmTypeName, count(1) as sumValue from dev_ai_project_data dapd
|
||||
select dapd.alarm_type as type,sdd.dict_label as name, count(1) as value from dev_ai_project_data dapd
|
||||
left join sur_project sp on sp.id=dapd.project_id
|
||||
left join sys_dept sd on sd.dept_id=dapd.dept_id
|
||||
left join sys_dict_data sdd on sdd.dict_type='aibox_alarm_type' and sdd.dict_value=dapd.alarm_type
|
||||
|
@ -103,7 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'>
|
||||
and sp.id in (select spu.project_id from sur_project_userinfo spu where spu.user_id = #{nowUser} and spu.is_del=0)
|
||||
</if>
|
||||
<if test="params.date != null"> and date(dapd.create_time) = date(#{params.date})</if>
|
||||
</where>
|
||||
GROUP BY dapd.alarm_type
|
||||
</select>
|
||||
|
||||
<insert id="insertDevAiProjectData" parameterType="DevAiProjectData" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="passageName" column="sub_passage_name" />
|
||||
<result property="passageValue" column="sub_passage_value" />
|
||||
<result property="passageState" column="sub_passage_state" />
|
||||
<result property="passageType" column="sub_passage_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSurProjectVideoConfigVo">
|
||||
|
@ -108,6 +109,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by a.project_id asc,b.id asc
|
||||
<if test='importance != "Y" '> limit 6</if>
|
||||
</select>
|
||||
|
||||
<select id="selectSurProjectVideoConfigByGroupCountParams" parameterType="map" resultMap="SurProjectVideoConfigSurProjectVideoPassageResult">
|
||||
select a.id, a.project_id, a.video_name, a.video_only_type, a.video_dvr_number, a.video_dvr_security, a.video_passage_count, a.passage_pass_count, a.video_sort, a.signal_type, a.signal_state, a.signal_code, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, p.projectName,
|
||||
b.id as sub_id, b.video_id as sub_video_id, b.video_dvr_number as sub_video_dvr_number, dacp.channel_name as sub_passage_name, b.passage_value as sub_passage_value, b.passage_state as sub_passage_state, dacp.passage_type as sub_passage_type
|
||||
from sur_project_video_config a
|
||||
left join sur_project_video_passage b on b.video_id = a.id
|
||||
left join sur_project p on a.project_id=p.id
|
||||
left join dev_ai_project_config_passage dacp on dacp.video_passage_id = b.id
|
||||
where dacp.is_del=0 and dacp.channel_id is NOT NULL and dacp.channel_id!=''
|
||||
<if test="projectId != null "> and a.project_id = #{projectId}</if>
|
||||
<if test="deptId != null "> and p.dept_id = #{deptId}</if>
|
||||
order by a.project_id asc,b.id asc
|
||||
</select>
|
||||
|
||||
<insert id="insertSurProjectVideoConfig" parameterType="SurProjectVideoConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sur_project_video_config
|
||||
|
|
Loading…
Reference in New Issue