提交代码

dev_xds
姜玉琦 2023-08-26 18:08:05 +08:00
parent 24290c9970
commit 6b505a3ca5
18 changed files with 675 additions and 130 deletions

View File

@ -15,6 +15,12 @@ public enum PublicStateEnum {
PROJECT_CHECK_TYPE_JPYS("1", "举牌验收"),
PROJECT_CHECK_POSITION_TYPE("1", "默认工序部位类型"),
/**********************************项目验收***************************************/
/**********************************视频设备***************************************/
VIDEO_ONLINE("1", "在线"),
VIDEO_OFFLINE("2", "离线"),
VIDEO_UNKNOWN("3", "未知"),
/**********************************视频设备***************************************/
COMZGS("1","子公司状态标识");
private final String code;

View File

@ -62,6 +62,7 @@
"vue": "2.6.12",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-h265-player": "^0.0.24",
"vue-meta": "2.4.0",
"vue-router": "3.4.9",
"vuedraggable": "2.24.3",

Binary file not shown.

View File

@ -1,44 +0,0 @@
import request from '@/utils/request'
// 查询视频配置列表
export function listVideoConfig(query) {
return request({
url: '/project/videoConfig/list',
method: 'get',
params: query
})
}
// 查询视频配置详细
export function getVideoConfig(id) {
return request({
url: '/project/videoConfig/' + id,
method: 'get'
})
}
// 新增视频配置
export function addVideoConfig(data) {
return request({
url: '/project/videoConfig',
method: 'post',
data: data
})
}
// 修改视频配置
export function updateVideoConfig(data) {
return request({
url: '/project/videoConfig',
method: 'put',
data: data
})
}
// 删除视频配置
export function delVideoConfig(id) {
return request({
url: '/project/videoConfig/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,69 @@
import request from '@/utils/request'
// 查询视频配置列表
export function listVideoConfig(query) {
return request({
url: '/video/videoConfig/list',
method: 'get',
params: query
})
}
// 查询视频配置列表
export function listVideoView(query) {
return request({
url: '/video/videoConfig/listView',
method: 'get',
params: query
})
}
// 查询视频配置详细
export function getVideoConfig(id) {
return request({
url: '/video/videoConfig/' + id,
method: 'get'
})
}
// 新增视频配置
export function addVideoConfig(data) {
return request({
url: '/video/videoConfig',
method: 'post',
data: data
})
}
// 修改视频配置
export function updateVideoConfig(data) {
return request({
url: '/video/videoConfig',
method: 'put',
data: data
})
}
// 修改视频配置
export function updateVideoConfigSort(data) {
return request({
url: '/video/videoConfig/updateVideoConfigSort',
method: 'post',
data: data
})
}
// 删除视频配置
export function delVideoConfig(id) {
return request({
url: '/video/videoConfig/' + id,
method: 'delete'
})
}
// 根据设备编号查询设备通道信息
export function getVideoPassage(videoDvrNumberd) {
return request({
url: '/video/videoConfig/getVideoPassage/' + videoDvrNumberd,
method: 'get'
})
}

File diff suppressed because one or more lines are too long

View File

@ -373,7 +373,7 @@
'project:materialSeal:list',
'project:projectDeptWroks:list',
'project:surProjectAttendance:add',
'project:videoConfig:list',
'video:videoConfig:list',
'project:surProject:remove',
]"
>
@ -450,7 +450,7 @@
<el-dropdown-item
command="handleVideoConfig"
icon="el-icon-video-camera-solid"
v-hasPermi="['project:videoConfig:list']"
v-hasPermi="['video:videoConfig:list']"
>视频配置</el-dropdown-item
>
<el-dropdown-item
@ -822,7 +822,7 @@ import insuranceDrawer from "../surProjectInsurance/insuranceDrawer.vue";
import projectCheckingDrawer from "../projectChecking/projectCheckingDrawer.vue";
import materialSealDrawer from "../materialSeal/projectMaterialSealDrawer.vue";
import projectMeasureDrawer from "../projectMeasure/projectMeasureDrawer.vue";
import videoConfigDrawer from "@/views/project/videoConfig/videoConfigDrawer";
import videoConfigDrawer from "@/views/video/videoConfig/videoConfigDrawer";
import { checkPermi, checkRole } from "@/utils/permission"; //
export default {

View File

@ -62,7 +62,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['project:videoConfig:add']"
v-hasPermi="['video:videoConfig:add']"
>新增</el-button
>
</el-col>
@ -74,7 +74,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['project:videoConfig:edit']"
v-hasPermi="['video:videoConfig:edit']"
>修改</el-button
>
</el-col>
@ -86,7 +86,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['project:videoConfig:remove']"
v-hasPermi="['video:videoConfig:remove']"
>删除</el-button
>
</el-col>
@ -97,7 +97,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['project:videoConfig:export']"
v-hasPermi="['video:videoConfig:export']"
>导出</el-button
>
</el-col>
@ -140,7 +140,19 @@
show-overflow-tooltip
/>
<el-table-column label="通道数量" align="center" prop="videoPassageCount" />
<el-table-column label="通信状态" align="center" prop="signalState">
<el-table-column label="设备排序" align="center" width="140">
<template slot-scope="scope">
<el-input-number
size="mini"
v-model="scope.row.videoSort"
:min="1"
:max="999"
@change="setVideoSort(scope.row, $event)"
style="width: 120px"
></el-input-number>
</template>
</el-table-column>
<el-table-column label="通信状态" align="center" prop="signalState" v-if="false">
<template slot-scope="scope">
<dict-tag
:options="dict.type.project_video_signal_state"
@ -170,16 +182,16 @@
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['project:videoConfig:edit']"
>实时视频</el-button
@click="handlePlay(scope.row)"
v-hasPermi="['video:videoConfig:edit']"
>视频检测</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['project:videoConfig:edit']"
v-hasPermi="['video:videoConfig:edit']"
>修改</el-button
>
<el-button
@ -187,7 +199,7 @@
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['project:videoConfig:remove']"
v-hasPermi="['video:videoConfig:remove']"
>删除</el-button
>
</template>
@ -285,6 +297,13 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改视频配置对话框 -->
<videoPlayDrawer
size="65%"
:visible.sync="videoPlayDrawerVisible"
:form-data="formData"
v-if="videoPlayDrawerVisible"
></videoPlayDrawer>
</div>
</template>
@ -295,10 +314,15 @@ import {
delVideoConfig,
addVideoConfig,
updateVideoConfig,
} from "@/api/project/videoConfig";
updateVideoConfigSort,
} from "@/api/video/videoConfig";
import videoPlayDrawer from "@/views/video/videoConfig/videoPlayDrawer";
export default {
name: "VideoConfig",
components: {
videoPlayDrawer,
},
dicts: ["project_video_type", "project_video_signal_state", "sys_common_isdel"],
data() {
return {
@ -366,6 +390,10 @@ export default {
{ maxlength: 200, message: "备注最多200字符", trigger: "blur" },
],
},
formData: {
videoDvrNumber: null,
},
videoPlayDrawerVisible: false,
};
},
created() {
@ -520,13 +548,28 @@ export default {
/** 导出按钮操作 */
handleExport() {
this.download(
"project/videoConfig/export",
"video/videoConfig/export",
{
...this.queryParams,
},
`videoConfig_${new Date().getTime()}.xlsx`
);
},
//
setVideoSort(row, val) {
let param = {
id: row.id,
videoSort: val,
};
updateVideoConfigSort(param).then((response) => {
this.$modal.msgSuccess("修改成功");
this.getList();
});
},
handlePlay(row) {
this.formData.videoDvrNumber = row.videoDvrNumber;
this.videoPlayDrawerVisible = true;
},
},
};
</script>

View File

@ -22,7 +22,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['project:videoConfig:add']"
v-hasPermi="['video:videoConfig:add']"
>新增</el-button
>
</el-col>
@ -34,7 +34,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['project:videoConfig:edit']"
v-hasPermi="['video:videoConfig:edit']"
>修改</el-button
>
</el-col>
@ -46,7 +46,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['project:videoConfig:remove']"
v-hasPermi="['video:videoConfig:remove']"
>删除</el-button
>
</el-col>
@ -57,7 +57,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['project:videoConfig:export']"
v-hasPermi="['video:videoConfig:export']"
>导出</el-button
>
</el-col> -->
@ -96,7 +96,7 @@
show-overflow-tooltip
/>
<el-table-column label="通道数量" align="center" prop="videoPassageCount" />
<el-table-column label="通信状态" align="center" prop="signalState">
<el-table-column label="通信状态" align="center" prop="signalState" v-if="false">
<template slot-scope="scope">
<dict-tag
:options="dict.type.project_video_signal_state"
@ -121,7 +121,7 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['project:videoConfig:edit']"
v-hasPermi="['video:videoConfig:edit']"
>修改</el-button
>
<el-button
@ -129,7 +129,7 @@
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['project:videoConfig:remove']"
v-hasPermi="['video:videoConfig:remove']"
>删除</el-button
>
</template>
@ -228,7 +228,7 @@ import {
delVideoConfig,
addVideoConfig,
updateVideoConfig,
} from "@/api/project/videoConfig";
} from "@/api/video/videoConfig";
export default {
name: "VideoConfig",
@ -454,7 +454,7 @@ export default {
/** 导出按钮操作 */
handleExport() {
this.download(
"project/videoConfig/export",
"video/videoConfig/export",
{
...this.queryParams,
},

View File

@ -0,0 +1,108 @@
<template>
<div class="app-container">
<el-drawer
v-bind="$attrs"
v-if="onOpen"
v-on="$listeners"
@opened="onOpen"
@close="onClose"
style="padding-left: 20px"
>
<div class="videoView">
<H265Player :url="url0" @on-error="handleOnError" />
</div>
<div class="videoView">
<H265Player :url="url1" @on-error="handleOnError" />
</div>
<div class="videoView">
<H265Player :url="url2" @on-error="handleOnError" />
</div>
<div class="videoView">
<H265Player :url="url3" @on-error="handleOnError" />
</div>
</el-drawer>
</div>
</template>
<script>
import { getVideoPassage } from "@/api/video/videoConfig";
import H265Player from "vue-h265-player";
export default {
name: "videoPlay",
components: {
H265Player,
},
props: {
formData: {
videoDvrNumber: String,
},
},
data() {
return {
request:
"http://111.21.209.230:7086/live/cameraid/{{videoDvrNumber}}${{passage}}/substream/2.m3u8",
url0: "",
url1: "",
url2: "",
url3: "",
};
},
computed: {},
watch: {
formData: {
handler(value) {
this.formData = value;
this.request = this.request.replace(
"{{videoDvrNumber}}",
this.formData.videoDvrNumber
);
this.initVideo();
},
},
},
created() {},
mounted() {},
beforeDestroy() {},
methods: {
onOpen() {},
onClose() {},
handleOnError(error) {
console.log("error: ", error);
},
//
initVideo() {
getVideoPassage(this.formData.videoDvrNumber).then((response) => {
let data = response.data;
data.forEach((it, idx) => {
if (idx == 0) {
this.url0 = this.request.replace("{{passage}}", it.passageValue);
}
if (idx == 1) {
this.url1 = this.request.replace("{{passage}}", it.passageValue);
}
if (idx == 2) {
this.url2 = this.request.replace("{{passage}}", it.passageValue);
}
if (idx == 3) {
this.url3 = this.request.replace("{{passage}}", it.passageValue);
}
});
});
},
},
};
</script>
<style lang="scss" scoped>
@import "@/styles/mixin.scss";
::v-deep .el-drawer__header {
display: none;
}
.videoView {
color: aliceblue;
float: left;
width: 50%;
height: 50%;
}
</style>

View File

@ -0,0 +1,156 @@
<template>
<div class="app-container">
<div class="left">
<div class="side-nav el-scrollbar" style="opacity: 1">
<div class="nav-item" v-for="(item, index) in videoConfigList">
<span
:title="item.videoName"
@click="handlePlay(item, index)"
:class="{ bg_color: currentIndex == index }"
>{{ item.videoName }}</span
>
</div>
</div>
</div>
<div class="right" v-if="showVideo">
<div class="videoView">
<H265Player :url="url0" @on-error="handleOnError" />
</div>
<div class="videoView">
<H265Player :url="url1" @on-error="handleOnError" />
</div>
<div class="videoView">
<H265Player :url="url2" @on-error="handleOnError" />
</div>
<div class="videoView">
<H265Player :url="url3" @on-error="handleOnError" />
</div>
</div>
</div>
</template>
<script>
import { listVideoView, getVideoPassage } from "@/api/video/videoConfig";
import H265Player from "vue-h265-player";
export default {
name: "VideoPlay",
components: {
H265Player,
},
data() {
return {
//
loading: true,
showVideo: false,
//
videoConfigList: [],
currentIndex: null,
request:
"http://111.21.209.230:7086/live/cameraid/{{videoDvrNumber}}${{passage}}/substream/2.m3u8",
url0: "",
url1: "",
url2: "",
url3: "",
};
},
created() {
this.initMenu();
},
methods: {
/** 查询视频配置列表 */
initMenu() {
let param = {};
listVideoView(param).then((response) => {
this.videoConfigList = response.data;
});
},
handlePlay(it, idx) {
this.currentIndex = idx;
this.showVideo = false;
this.url0 = "";
this.url1 = "";
this.url2 = "";
this.url3 = "";
this.initVideo(
it.videoDvrNumber,
this.request.replace("{{videoDvrNumber}}", it.videoDvrNumber)
);
},
//
initVideo(videoDvrNumber, url) {
let that = this;
getVideoPassage(videoDvrNumber).then((response) => {
let data = response.data;
that.showVideo = true;
data.forEach((it, idx) => {
if (idx == 0) {
that.url0 = url.replace("{{passage}}", it.passageValue);
}
if (idx == 1) {
that.url1 = url.replace("{{passage}}", it.passageValue);
}
if (idx == 2) {
that.url2 = url.replace("{{passage}}", it.passageValue);
}
if (idx == 3) {
that.url3 = url.replace("{{passage}}", it.passageValue);
}
});
});
},
handleOnError(error) {
console.log("error: ", error);
},
},
};
</script>
<style lang="scss" scoped>
.app-container {
.left {
width: 220px;
height: calc(100% - 45px);
float: left;
overflow: hidden;
.side-nav {
margin-left: 20px;
height: 820px;
overflow-y: scroll;
.nav-item {
width: 200px;
overflow: hidden;
display: block;
height: 40px;
color: #444;
font-size: 14px;
white-space: nowrap;
text-overflow: ellipsis;
font-weight: 400;
span {
cursor: pointer;
}
.bg_color {
color: #409eff;
}
}
.nav-item :hover {
color: #409eff;
}
}
}
.right {
width: calc(100% - 240px);
margin-left: 15px;
height: 820px;
float: left;
.videoView {
color: aliceblue;
float: left;
width: 50%;
height: 50%;
}
}
}
</style>

View File

@ -1,29 +1,23 @@
package com.yanzhu.jh.project.controller;
package com.yanzhu.jh.video.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.SysRoleEnum;
import com.ruoyi.system.service.ISysDeptService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.yanzhu.jh.project.domain.SurProjectVideoConfig;
import com.yanzhu.jh.project.service.ISurProjectVideoConfigService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.enums.SysRoleEnum;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDeptService;
import com.yanzhu.jh.video.domain.SurProjectVideoConfig;
import com.yanzhu.jh.video.domain.SurProjectVideoPassage;
import com.yanzhu.jh.video.service.ISurProjectVideoConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
@ -32,7 +26,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @date 2023-08-25
*/
@RestController
@RequestMapping("/project/videoConfig")
@RequestMapping("/video/videoConfig")
public class SurProjectVideoConfigController extends BaseController
{
@Autowired
@ -44,7 +38,7 @@ public class SurProjectVideoConfigController extends BaseController
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:videoConfig:list')")
@PreAuthorize("@ss.hasPermi('video:videoConfig:list')")
@GetMapping("/list")
public TableDataInfo list(SurProjectVideoConfig surProjectVideoConfig)
{
@ -60,10 +54,28 @@ public class SurProjectVideoConfigController extends BaseController
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('video:videoConfig:list')")
@GetMapping("/listView")
public AjaxResult listView(SurProjectVideoConfig surProjectVideoConfig)
{
surProjectVideoConfig.setNowRole(Convert.toStr(getUserFirstRole()));
if(SysRoleEnum.ZGS.getCode().equals(surProjectVideoConfig.getNowRole())){
surProjectVideoConfig.setNowDept(Convert.toStr(sysDeptService.getZGSDeptId(getDeptId())));
}else{
surProjectVideoConfig.setNowDept(Convert.toStr(getDeptId()));
}
surProjectVideoConfig.setNowUser(Convert.toStr(getUserId()));
List<SurProjectVideoConfig> list = surProjectVideoConfigService.selectSurProjectVideoConfigList(surProjectVideoConfig);
return success(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:videoConfig:export')")
@PreAuthorize("@ss.hasPermi('video:videoConfig:export')")
@Log(title = "视频配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SurProjectVideoConfig surProjectVideoConfig)
@ -83,7 +95,7 @@ public class SurProjectVideoConfigController extends BaseController
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:videoConfig:query')")
@PreAuthorize("@ss.hasPermi('video:videoConfig:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
@ -93,7 +105,7 @@ public class SurProjectVideoConfigController extends BaseController
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:videoConfig:add')")
@PreAuthorize("@ss.hasPermi('video:videoConfig:add')")
@Log(title = "视频配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SurProjectVideoConfig surProjectVideoConfig)
@ -104,7 +116,7 @@ public class SurProjectVideoConfigController extends BaseController
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:videoConfig:edit')")
@PreAuthorize("@ss.hasPermi('video:videoConfig:edit')")
@Log(title = "视频配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SurProjectVideoConfig surProjectVideoConfig)
@ -112,14 +124,45 @@ public class SurProjectVideoConfigController extends BaseController
return toAjax(surProjectVideoConfigService.updateSurProjectVideoConfig(surProjectVideoConfig));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('video:videoConfig:edit')")
@Log(title = "视频配置排序", businessType = BusinessType.UPDATE)
@PostMapping("/updateVideoConfigSort")
public AjaxResult updateVideoConfigSort(@RequestBody SurProjectVideoConfig surProjectVideoConfig)
{
return toAjax(surProjectVideoConfigService.updateVideoConfig(surProjectVideoConfig));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('project:videoConfig:remove')")
@PreAuthorize("@ss.hasPermi('video:videoConfig:remove')")
@Log(title = "视频配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(surProjectVideoConfigService.deleteSurProjectVideoConfigByIds(ids));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('video:videoConfig:query')")
@PostMapping("/editPassageState")
public AjaxResult editPassageState(SurProjectVideoPassage SurProjectVideoPassage)
{
return success(surProjectVideoConfigService.editPassageState(SurProjectVideoPassage));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('video:videoConfig:query')")
@GetMapping(value = "/getVideoPassage/{videoDvrNumberd}")
public AjaxResult getVideoPassage(@PathVariable("videoDvrNumberd") String videoDvrNumberd)
{
return success(surProjectVideoConfigService.getVideoPassage(videoDvrNumberd));
}
}

View File

@ -1,10 +1,11 @@
package com.yanzhu.jh.project.domain;
package com.yanzhu.jh.video.domain;
import java.util.List;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* sur_project_video_config
@ -43,6 +44,14 @@ public class SurProjectVideoConfig extends BaseEntity
@Excel(name = "通道数量")
private int videoPassageCount;
/** 通道连通数量 */
@Excel(name = "通道连通数量")
private int passagePassCount;
/** 设备排序 */
@Excel(name = "设备排序")
private int videoSort;
/** 通信类型 */
@Excel(name = "通信类型")
private String signalType;
@ -182,6 +191,22 @@ public class SurProjectVideoConfig extends BaseEntity
this.videoName = videoName;
}
public int getPassagePassCount() {
return passagePassCount;
}
public void setPassagePassCount(int passagePassCount) {
this.passagePassCount = passagePassCount;
}
public int getVideoSort() {
return videoSort;
}
public void setVideoSort(int videoSort) {
this.videoSort = videoSort;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -1,9 +1,9 @@
package com.yanzhu.jh.project.domain;
package com.yanzhu.jh.video.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* sur_project_video_passage
@ -34,6 +34,10 @@ public class SurProjectVideoPassage extends BaseEntity
@Excel(name = "视频通道")
private Long passageValue;
/** 视频通道状态 */
@Excel(name = "视频通道状态")
private String passageState;
public void setId(Long id)
{
this.id = id;
@ -80,6 +84,14 @@ public class SurProjectVideoPassage extends BaseEntity
return passageValue;
}
public String getPassageState() {
return passageState;
}
public void setPassageState(String passageState) {
this.passageState = passageState;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -1,8 +1,9 @@
package com.yanzhu.jh.project.mapper;
package com.yanzhu.jh.video.mapper;
import com.yanzhu.jh.video.domain.SurProjectVideoConfig;
import com.yanzhu.jh.video.domain.SurProjectVideoPassage;
import java.util.List;
import com.yanzhu.jh.project.domain.SurProjectVideoConfig;
import com.yanzhu.jh.project.domain.SurProjectVideoPassage;
/**
* Mapper
@ -20,6 +21,14 @@ public interface SurProjectVideoConfigMapper
*/
public SurProjectVideoConfig selectSurProjectVideoConfigById(Long id);
/**
*
*
* @param videoDvrNumber
* @return
*/
public SurProjectVideoConfig selectSurProjectVideoConfigByDvrNumber(String videoDvrNumber);
/**
*
*
@ -84,4 +93,12 @@ public interface SurProjectVideoConfigMapper
* @return
*/
public int deleteSurProjectVideoPassageByVideoId(Long id);
/**
*
*
* @param surProjectVideoPassage
* @return
*/
public int updateProjectVideoPassageState(SurProjectVideoPassage surProjectVideoPassage);
}

View File

@ -1,7 +1,9 @@
package com.yanzhu.jh.project.service;
package com.yanzhu.jh.video.service;
import com.yanzhu.jh.video.domain.SurProjectVideoConfig;
import com.yanzhu.jh.video.domain.SurProjectVideoPassage;
import java.util.List;
import com.yanzhu.jh.project.domain.SurProjectVideoConfig;
/**
* Service
@ -43,6 +45,15 @@ public interface ISurProjectVideoConfigService
*/
public int updateSurProjectVideoConfig(SurProjectVideoConfig surProjectVideoConfig);
/**
*
*
* @param surProjectVideoConfig
* @return
*/
public int updateVideoConfig(SurProjectVideoConfig surProjectVideoConfig);
/**
*
*
@ -58,4 +69,20 @@ public interface ISurProjectVideoConfigService
* @return
*/
public int deleteSurProjectVideoConfigById(Long id);
/**
*
*
* @param SurProjectVideoPassage
* @return
*/
public int editPassageState(SurProjectVideoPassage SurProjectVideoPassage);
/**
*
*
* @param videoDvrNumberd
* @return
*/
public List<SurProjectVideoPassage> getVideoPassage(String videoDvrNumberd);
}

View File

@ -1,19 +1,20 @@
package com.yanzhu.jh.project.service.impl;
import java.util.List;
package com.yanzhu.jh.video.service.impl;
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.yanzhu.jh.video.domain.SurProjectVideoConfig;
import com.yanzhu.jh.video.domain.SurProjectVideoPassage;
import com.yanzhu.jh.video.mapper.SurProjectVideoConfigMapper;
import com.yanzhu.jh.video.service.ISurProjectVideoConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.yanzhu.jh.project.domain.SurProjectVideoPassage;
import com.yanzhu.jh.project.mapper.SurProjectVideoConfigMapper;
import com.yanzhu.jh.project.domain.SurProjectVideoConfig;
import com.yanzhu.jh.project.service.ISurProjectVideoConfigService;
import com.ruoyi.common.utils.SecurityUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Service
*
@ -21,7 +22,7 @@ import com.ruoyi.common.utils.SecurityUtils;
* @date 2023-08-25
*/
@Service
public class SurProjectVideoConfigServiceImpl implements ISurProjectVideoConfigService
public class SurProjectVideoConfigServiceImpl implements ISurProjectVideoConfigService
{
@Autowired
private SurProjectVideoConfigMapper surProjectVideoConfigMapper;
@ -60,8 +61,11 @@ public class SurProjectVideoConfigServiceImpl implements ISurProjectVideoConfigS
@Override
public int insertSurProjectVideoConfig(SurProjectVideoConfig surProjectVideoConfig)
{
surProjectVideoConfig.setVideoPassageCount(surProjectVideoConfig.getSurProjectVideoPassageList().size());
surProjectVideoConfig.setIsDel(PublicStateEnum.OK.getCode());
//新增的视频为离线
surProjectVideoConfig.setSignalState(PublicStateEnum.VIDEO_UNKNOWN.getCode());
surProjectVideoConfig.setCreateBy(SecurityUtils.getUsername());
surProjectVideoConfig.setCreateTime(DateUtils.getNowDate());
int rows = surProjectVideoConfigMapper.insertSurProjectVideoConfig(surProjectVideoConfig);
@ -79,7 +83,9 @@ public class SurProjectVideoConfigServiceImpl implements ISurProjectVideoConfigS
@Override
public int updateSurProjectVideoConfig(SurProjectVideoConfig surProjectVideoConfig)
{
if(surProjectVideoConfig.getProjectId()==null){
surProjectVideoConfig.setProjectId(0L);
}
surProjectVideoConfig.setVideoPassageCount(surProjectVideoConfig.getSurProjectVideoPassageList().size());
surProjectVideoConfig.setUpdateBy(SecurityUtils.getUsername());
surProjectVideoConfig.setUpdateTime(DateUtils.getNowDate());
@ -88,6 +94,18 @@ public class SurProjectVideoConfigServiceImpl implements ISurProjectVideoConfigS
return surProjectVideoConfigMapper.updateSurProjectVideoConfig(surProjectVideoConfig);
}
/**
*
*
* @param surProjectVideoConfig
* @return
*/
@Transactional
@Override
public int updateVideoConfig(SurProjectVideoConfig surProjectVideoConfig){
return surProjectVideoConfigMapper.updateSurProjectVideoConfig(surProjectVideoConfig);
}
/**
*
*
@ -116,6 +134,44 @@ public class SurProjectVideoConfigServiceImpl implements ISurProjectVideoConfigS
return surProjectVideoConfigMapper.deleteSurProjectVideoConfigById(id);
}
/**
*
*
* @param SurProjectVideoPassage
* @return
*/
@Override
@Transactional
public int editPassageState(SurProjectVideoPassage SurProjectVideoPassage) {
surProjectVideoConfigMapper.updateProjectVideoPassageState(SurProjectVideoPassage);
SurProjectVideoConfig surProjectVideoConfig = surProjectVideoConfigMapper.selectSurProjectVideoConfigByDvrNumber(SurProjectVideoPassage.getVideoDvrNumber());
int res = 0;
for(SurProjectVideoPassage passage:surProjectVideoConfig.getSurProjectVideoPassageList()){
if(passage.getPassageState().equals(PublicStateEnum.VIDEO_ONLINE.getCode())){
res++;
}
}
surProjectVideoConfig.setPassagePassCount(res);
//判断设备是否在线,一个通道在线则显示设备在线
if(res>0){
surProjectVideoConfig.setSignalState(PublicStateEnum.VIDEO_ONLINE.getCode());
}else{
surProjectVideoConfig.setSignalState(PublicStateEnum.VIDEO_OFFLINE.getCode());
}
surProjectVideoConfigMapper.updateSurProjectVideoConfig(surProjectVideoConfig);
return 1;
}
/**
*
*
* @param videoDvrNumberd
* @return
*/
public List<SurProjectVideoPassage> getVideoPassage(String videoDvrNumberd) {
return surProjectVideoConfigMapper.selectSurProjectVideoConfigByDvrNumber(videoDvrNumberd).getSurProjectVideoPassageList();
}
/**
*
*
@ -132,6 +188,7 @@ public class SurProjectVideoConfigServiceImpl implements ISurProjectVideoConfigS
{
surProjectVideoPassage.setVideoId(id);
surProjectVideoPassage.setVideoDvrNumber(surProjectVideoConfig.getVideoDvrNumber());
surProjectVideoPassage.setPassageState(PublicStateEnum.VIDEO_UNKNOWN.getCode());
list.add(surProjectVideoPassage);
}
if (list.size() > 0)

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yanzhu.jh.project.mapper.SurProjectVideoConfigMapper">
<mapper namespace="com.yanzhu.jh.video.mapper.SurProjectVideoConfigMapper">
<resultMap type="SurProjectVideoConfig" id="SurProjectVideoConfigResult">
<result property="id" column="id" />
@ -13,6 +13,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="videoDvrNumber" column="video_dvr_number" />
<result property="videoDvrSecurity" column="video_dvr_security" />
<result property="videoPassageCount" column="video_passage_count" />
<result property="passagePassCount" column="passage_pass_count" />
<result property="videoSort" column="video_sort" />
<result property="signalType" column="signal_type" />
<result property="signalState" column="signal_state" />
<result property="signalCode" column="signal_code" />
@ -37,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectSurProjectVideoConfigVo">
select spvc.id, spvc.project_id, spvc.video_name, spvc.video_only_type, spvc.video_dvr_number, spvc.video_dvr_security, spvc.video_passage_count, spvc.signal_type, spvc.signal_state, spvc.signal_code, spvc.is_del, spvc.create_by, spvc.create_time, spvc.update_by, spvc.update_time, spvc.remark, sp.projectName from sur_project_video_config spvc
select spvc.id, spvc.project_id, spvc.video_name, spvc.video_only_type, spvc.video_dvr_number, spvc.video_dvr_security, spvc.video_passage_count, spvc.passage_pass_count, spvc.video_sort, spvc.signal_type, spvc.signal_state, spvc.signal_code, spvc.is_del, spvc.create_by, spvc.create_time, spvc.update_by, spvc.update_time, spvc.remark, sp.projectName from sur_project_video_config spvc
left join sur_project sp on sp.id=spvc.project_id
</sql>
@ -63,16 +65,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and sp.id in (select DISTINCT spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept})</if>
<if test='nowRole == "99"'> and sp.id in (select DISTINCT spu.project_id from sur_project_userinfo spu where spu.user_id = #{nowUser} and spu.is_del=0)</if>
</where>
order by spvc.video_sort asc, spvc.video_name
</select>
<select id="selectSurProjectVideoConfigById" parameterType="Long" 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.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,
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, b.passage_name as sub_passage_name, b.passage_value as sub_passage_value
from sur_project_video_config a
left join sur_project p on a.project_id=p.id
left join sur_project_video_passage b on b.video_id = a.id
where a.id = #{id}
</select>
<select id="selectSurProjectVideoConfigByDvrNumber" parameterType="String" 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, b.passage_name as sub_passage_name, b.passage_value as sub_passage_value
from sur_project_video_config a
left join sur_project p on a.project_id=p.id
left join sur_project_video_passage b on b.video_id = a.id
where a.video_dvr_number = #{videoDvrNumber}
</select>
<insert id="insertSurProjectVideoConfig" parameterType="SurProjectVideoConfig" useGeneratedKeys="true" keyProperty="id">
insert into sur_project_video_config
@ -83,6 +95,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="videoDvrNumber != null">video_dvr_number,</if>
<if test="videoDvrSecurity != null">video_dvr_security,</if>
<if test="videoPassageCount != null">video_passage_count,</if>
<if test="passagePassCount != null">passage_pass_count,</if>
<if test="videoSort != null">video_sort,</if>
<if test="signalType != null">signal_type,</if>
<if test="signalState != null">signal_state,</if>
<if test="signalCode != null">signal_code,</if>
@ -100,6 +114,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="videoDvrNumber != null">#{videoDvrNumber},</if>
<if test="videoDvrSecurity != null">#{videoDvrSecurity},</if>
<if test="videoPassageCount != null">#{videoPassageCount},</if>
<if test="passagePassCount != null">#{passagePassCount},</if>
<if test="videoSort != null">#{videoSort},</if>
<if test="signalType != null">#{signalType},</if>
<if test="signalState != null">#{signalState},</if>
<if test="signalCode != null">#{signalCode},</if>
@ -115,12 +131,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateSurProjectVideoConfig" parameterType="SurProjectVideoConfig">
update sur_project_video_config
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null">project_id = #{projectId},</if>
<if test="projectId != null and projectId>0">project_id = #{projectId},</if>
<if test="projectId == 0">project_id = NULL,</if>
<if test="videoName != null">video_name = #{videoName},</if>
<if test="videoOnlyType != null">video_only_type = #{videoOnlyType},</if>
<if test="videoDvrNumber != null">video_dvr_number = #{videoDvrNumber},</if>
<if test="videoDvrSecurity != null">video_dvr_security = #{videoDvrSecurity},</if>
<if test="videoPassageCount != null">video_passage_count = #{videoPassageCount},</if>
<if test="passagePassCount != null">passage_pass_count = #{passagePassCount},</if>
<if test="videoSort != null">video_sort = #{videoSort},</if>
<if test="signalType != null">signal_type = #{signalType},</if>
<if test="signalState != null">signal_state = #{signalState},</if>
<if test="signalCode != null">signal_code = #{signalCode},</if>
@ -134,16 +153,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<delete id="deleteSurProjectVideoConfigById" parameterType="Long">
delete from sur_project_video_config where id = #{id}
</delete>
<update id="deleteSurProjectVideoConfigById" parameterType="Long">
update sur_project_video_config set is_del=1 where id = #{id}
</update>
<delete id="deleteSurProjectVideoConfigByIds" parameterType="String">
delete from sur_project_video_config where id in
<update id="deleteSurProjectVideoConfigByIds" parameterType="String">
update sur_project_video_config set is_del=1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</update>
<delete id="deleteSurProjectVideoPassageByVideoIds" parameterType="String">
delete from sur_project_video_passage where video_id in
@ -162,4 +181,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
( #{item.id}, #{item.videoId}, #{item.videoDvrNumber}, #{item.passageName}, #{item.passageValue})
</foreach>
</insert>
<update id="updateProjectVideoPassageState" parameterType="SurProjectVideoPassage">
update sur_project_video_passage set passage_state=#{passageState} where id = #{id}
</update>
</mapper>