提交代码
parent
1b0eb695d9
commit
b9e62739ea
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备配置列表
|
||||
export function listAiBoxProjectConfig(query) {
|
||||
return request({
|
||||
url: '/video/aiBoxProjectConfig/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备配置详细
|
||||
export function getAiBoxProjectConfig(id) {
|
||||
return request({
|
||||
url: '/video/aiBoxProjectConfig/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设备配置
|
||||
export function addAiBoxProjectConfig(data) {
|
||||
return request({
|
||||
url: '/video/aiBoxProjectConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备配置
|
||||
export function updateAiBoxProjectConfig(data) {
|
||||
return request({
|
||||
url: '/video/aiBoxProjectConfig',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备配置
|
||||
export function delAiBoxProjectConfig(id) {
|
||||
return request({
|
||||
url: '/video/aiBoxProjectConfig/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -374,6 +374,7 @@
|
|||
'project:projectDeptWroks:list',
|
||||
'project:surProjectAttendance:add',
|
||||
'video:videoConfig:list',
|
||||
'video:aiBoxProjectConfig:list',
|
||||
'project:checkDetection:list',
|
||||
'project:costOutput:edit',
|
||||
'project:projectStandard:edit',
|
||||
|
@ -447,17 +448,28 @@
|
|||
>在岗人员管理</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
command="handleAttendanceData"
|
||||
icon="el-icon-s-grid"
|
||||
v-hasPermi="['project:attendance:list']"
|
||||
>劳务实名管理</el-dropdown-item>
|
||||
<!-- <el-dropdown-item
|
||||
command="handleProjectAttendance"
|
||||
icon="el-icon-trophy"
|
||||
v-hasPermi="['project:surProjectAttendance:add']"
|
||||
>今日出勤</el-dropdown-item
|
||||
>
|
||||
> -->
|
||||
<el-dropdown-item
|
||||
command="handleVideoConfig"
|
||||
icon="el-icon-video-camera-solid"
|
||||
v-hasPermi="['video:videoConfig:list']"
|
||||
>视频配置</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
command="handleAiBoxVideoConfig"
|
||||
icon="el-icon-camera"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:list']"
|
||||
>AI视频配置</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
command="handleCheckDetection"
|
||||
icon="el-icon-c-scale-to-original"
|
||||
|
@ -475,11 +487,6 @@
|
|||
icon="el-icon-s-grid"
|
||||
v-hasPermi="['project:projectStandard:list']"
|
||||
>标准化管理</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
command="handleAttendanceData"
|
||||
icon="el-icon-s-grid"
|
||||
v-hasPermi="['project:attendance:list']"
|
||||
>劳务实名管理</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
command="handleDelete"
|
||||
icon="el-icon-delete"
|
||||
|
@ -763,7 +770,8 @@
|
|||
<costOutputDrawer ref="costOutput"></costOutputDrawer>
|
||||
<checkDetectionDrawer ref="checkDetection"></checkDetectionDrawer>
|
||||
<standardDrawer ref="standard"></standardDrawer>
|
||||
<attendanceDataDrawer ref="attendanceData"></attendanceDataDrawer>
|
||||
<attendanceDataDrawer ref="attendanceData"></attendanceDataDrawer>
|
||||
<aiBoxVideoConfigDrawer ref="aiBoxVideoConfigDrawer"></aiBoxVideoConfigDrawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -794,8 +802,9 @@ import projectMeasureDrawer from "../projectMeasure/projectMeasureDrawer.vue";
|
|||
import videoConfigDrawer from "@/views/video/videoConfig/videoConfigDrawer";
|
||||
import costOutputDrawer from "@/views/project/costOutput/costOutputDrawer.vue";
|
||||
import checkDetectionDrawer from "../checkDetection/checkDetectionDrawer.vue";
|
||||
import standardDrawer from '@/views/project/projectStandard/projectStandardDrawer.vue'
|
||||
import attendanceDataDrawer from '@/views/project/attendance/attendanceDrawer.vue'
|
||||
import standardDrawer from '@/views/project/projectStandard/projectStandardDrawer.vue';
|
||||
import attendanceDataDrawer from '@/views/project/attendance/attendanceDrawer.vue';
|
||||
import aiBoxVideoConfigDrawer from '@/views/video/aiBoxProjectConfig/aiBoxVideoConfigDrawer';
|
||||
import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
|
||||
|
||||
export default {
|
||||
|
@ -819,7 +828,8 @@ export default {
|
|||
costOutputDrawer,
|
||||
checkDetectionDrawer,
|
||||
standardDrawer,
|
||||
attendanceDataDrawer,
|
||||
attendanceDataDrawer,
|
||||
aiBoxVideoConfigDrawer,
|
||||
},
|
||||
dicts: [
|
||||
"sur_project_xmjd",
|
||||
|
@ -1078,6 +1088,9 @@ export default {
|
|||
case "handleAttendanceData":
|
||||
this.$refs.attendanceData.show(row);
|
||||
break;
|
||||
case "handleAiBoxVideoConfig":
|
||||
this.$refs.aiBoxVideoConfigDrawer.show(row);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -146,8 +146,8 @@
|
|||
icon="el-icon-coordinate">季度考核管理</el-button>
|
||||
<el-button type="primary" @click="doPrjBuildNode" v-hasPermi="['project:build_node_data:list']"
|
||||
icon="el-icon-data-analysis">计划节点管理</el-button>
|
||||
<el-button type="primary" @click="doPrjAttendance" v-hasPermi="['project:surProjectAttendance:add']"
|
||||
icon="el-icon-s-check">今日出勤</el-button>
|
||||
<!-- <el-button type="primary" @click="doPrjAttendance" v-hasPermi="['project:surProjectAttendance:add']"
|
||||
icon="el-icon-s-check">今日出勤</el-button> -->
|
||||
<el-button type="primary" @click="doPrjCostOutput" v-hasPermi="['project:costOutput:edit']"
|
||||
icon="el-icon-money">项目成本产值管理</el-button>
|
||||
<el-button type="primary" @click="doPrjStandard" v-hasPermi="['project:projectStandard:list']"
|
||||
|
|
|
@ -89,6 +89,7 @@
|
|||
v-loading="loading"
|
||||
:data="dataList"
|
||||
:span-method="objectSpanMethod"
|
||||
height="700"
|
||||
stripe border
|
||||
>
|
||||
<el-table-column
|
||||
|
|
|
@ -0,0 +1,415 @@
|
|||
<template>
|
||||
<div class="projectect-attendance-drawer">
|
||||
<el-drawer
|
||||
v-if="isOpen"
|
||||
:visible.sync="isOpen"
|
||||
direction="rtl"
|
||||
size="65%"
|
||||
style="padding-left: 20px"
|
||||
>
|
||||
<template slot="title">
|
||||
<div>{{ drawerTitle + " 【AI视频配置】" }}</div>
|
||||
</template>
|
||||
<el-tabs
|
||||
v-model="unitActiveName"
|
||||
style="margin-left: 20px; margin-right: 20px"
|
||||
@tab-click="getList"
|
||||
>
|
||||
<el-tab-pane
|
||||
v-for="(it, idx) in nodes"
|
||||
:label="it.unitName + ''"
|
||||
:name="it.unitId + ''"
|
||||
:key="idx"
|
||||
></el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-row :gutter="10" class="mb8" style="margin-left: 20px; margin-top: 10px; margin-right: 20px"
|
||||
>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-if="deptVideo"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="aiBoxProjectConfigList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" />
|
||||
<el-table-column label="设备序列号" align="center" prop="serialNumber" />
|
||||
<el-table-column label="厂商名称" align="center" prop="manufacturer" />
|
||||
<el-table-column label="设备状态" align="center" prop="isDel">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.isDel"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改AI视频配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="720px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input v-model="form.projectName" placeholder="请输入项目名称" :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="deptName">
|
||||
<el-input v-model="form.deptName" placeholder="请输入单位名称" :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="serialNumber">
|
||||
<el-input v-model="form.serialNumber" placeholder="请输入设备序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="厂商名称" prop="manufacturer">
|
||||
<el-input v-model="form.manufacturer" placeholder="请输入厂商名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态" prop="isDel">
|
||||
<el-switch v-model="form.isDel" active-value="0" inactive-value="1"></el-switch>
|
||||
</el-form-item>
|
||||
<el-divider content-position="center">AI视频通道信息</el-divider>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddDevAiProjectConfigPassage">添加</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteDevAiProjectConfigPassage">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="devAiProjectConfigPassageList" :row-class-name="rowDevAiProjectConfigPassageIndex" @selection-change="handleDevAiProjectConfigPassageSelectionChange" ref="devAiProjectConfigPassage">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="60"/>
|
||||
<el-table-column label="AI通道号" prop="channelId" width="150" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.channelId" placeholder="请输入AI通道号" required maxlength="10"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="AI通道名称" prop="channelName" width="210" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.channelName" placeholder="请输入AI通道名称" required maxlength="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否重要" prop="isImportance" width="210" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isImportance" active-value="Y" inactive-value="N"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listAiBoxProjectConfig, getAiBoxProjectConfig, delAiBoxProjectConfig, addAiBoxProjectConfig, updateAiBoxProjectConfig } from "@/api/video/aiBoxProjectConfig";
|
||||
import { listVideoConfig } from "@/api/video/videoConfig";
|
||||
|
||||
export default {
|
||||
name: "AiBoxProjectConfig",
|
||||
dicts: ["project_video_type", "project_video_signal_state"],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 子表选中数据
|
||||
checkedSurProjectVideoPassage: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 视频配置表格数据
|
||||
aiBoxProjectConfigList: [],
|
||||
// 视频通道表格数据
|
||||
devAiProjectConfigPassageList: [],
|
||||
//抽屉标题
|
||||
drawerTitle: "",
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
project: null,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
projectName: null,
|
||||
videoOnlyType: null,
|
||||
videoDvrNumber: null,
|
||||
videoDvrSecurity: null,
|
||||
videoPassageCount: null,
|
||||
signalType: null,
|
||||
signalState: null,
|
||||
signalCode: null,
|
||||
isDel: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
projectId: [{ required: true, message: "请选择所属项目", trigger: "blur" }],
|
||||
deptId: [{ required: true, message: "请选择所属单位", trigger: "blur" }],
|
||||
deviceName: [
|
||||
{ required: true, message: "请输入设备名称", trigger: "blur" },
|
||||
{ max: 50, message: "设备名称最多50字符", trigger: "blur" },
|
||||
],
|
||||
serialNumber: [
|
||||
{ required: true, message: "请输入设备序列号", trigger: "blur" },
|
||||
{ max: 100, message: "设备序列号最多100字符", trigger: "blur" },
|
||||
],
|
||||
manufacturer: [{ required: true, message: "请输入厂商名称", trigger: "blur" },
|
||||
{ max: 50, message: "厂商名称最多50字符", trigger: "blur" },
|
||||
],
|
||||
isDel: [{ required: true, message: "请选择设备状态", trigger: "blur" }],
|
||||
},
|
||||
isOpen: false,
|
||||
deptVideo:false,
|
||||
projectOptions:[],
|
||||
nodes:[],
|
||||
unitActiveName: "",
|
||||
deptName:"",
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
show(project) {
|
||||
this.project = project;
|
||||
this.drawerTitle = project.projectName;
|
||||
this.isOpen = true;
|
||||
this.queryParams.projectId = project.id;
|
||||
this.$api.publics
|
||||
.queryUnitList({
|
||||
projectId: project.id,
|
||||
unitType: 2
|
||||
})
|
||||
.then((d) => {
|
||||
this.nodes = d.rows;
|
||||
if (d.rows.length > 0) {
|
||||
this.unitActiveName = this.nodes[0].unitId + "";
|
||||
this.getList();
|
||||
} else {
|
||||
this.aiBoxProjectConfigList = [];
|
||||
this.$message.error("当前项目未分配总包单位,不能配置AI视频预警!");
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 查询视频配置列表 */
|
||||
getList() {
|
||||
this.nodes.forEach((item) => {
|
||||
if (item.unitId == this.unitActiveName) {
|
||||
this.form.deptName = item.unitName;
|
||||
}
|
||||
});
|
||||
this.loading = true;
|
||||
listAiBoxProjectConfig(this.queryParams).then((response) => {
|
||||
this.aiBoxProjectConfigList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
// 查询当前总包单位是否配置视频
|
||||
let param = {
|
||||
projectId:this.project.id,
|
||||
deptId:this.unitActiveName
|
||||
}
|
||||
listVideoConfig(param).then(response => {
|
||||
if(response.total>0){
|
||||
this.deptVideo=true;
|
||||
}else{
|
||||
this.deptVideo=false;
|
||||
this.$message.error(this.deptName+"未配置视频监控信息,请先配置实时视频!");
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
projectId: null,
|
||||
deptId: null,
|
||||
ipcName: null,
|
||||
deviceName: null,
|
||||
serialNumber: null,
|
||||
manufacturer: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.devAiProjectConfigPassageList = [];
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.id);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加视频配置";
|
||||
this.form.isDel="0";
|
||||
this.form.projectId = this.project.id;
|
||||
this.form.projectName = this.project.projectName;
|
||||
this.form.deptId = this.unitActiveName;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getAiBoxProjectConfig(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.devAiProjectConfigPassageList = response.data.devAiProjectConfigPassageList;
|
||||
this.open = true;
|
||||
this.title = "修改视频配置";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.devAiProjectConfigPassageList = this.devAiProjectConfigPassageList;
|
||||
if (this.form.id != null) {
|
||||
updateAiBoxProjectConfig(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
this.form.videoOnlyType = "1";
|
||||
addAiBoxProjectConfig(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal
|
||||
.confirm('是否确认删除AI视频配置编号为"' + ids + '"的数据项?')
|
||||
.then(function () {
|
||||
return delAiBoxProjectConfig(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 视频通道序号 */
|
||||
rowSurProjectVideoPassageIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
},
|
||||
/** 视频通道添加按钮操作 */
|
||||
handleAddSurProjectVideoPassage() {
|
||||
let obj = {};
|
||||
obj.channelId = "";
|
||||
obj.channelName = "";
|
||||
obj.isImportance = "";
|
||||
obj.isDel = "0";
|
||||
this.devAiProjectConfigPassageList.push(obj);
|
||||
},
|
||||
/** 视频通道删除按钮操作 */
|
||||
handleDeleteSurProjectVideoPassage() {
|
||||
if (this.checkedDevAiProjectConfigPassage.length == 0) {
|
||||
this.$modal.msgError("请先选择要删除的AI视频配置通道数据");
|
||||
} else {
|
||||
const devAiProjectConfigPassageList = this.devAiProjectConfigPassageList;
|
||||
const checkedDevAiProjectConfigPassage = this.checkedDevAiProjectConfigPassage;
|
||||
this.devAiProjectConfigPassageList = devAiProjectConfigPassageList.filter(function(item) {
|
||||
return checkedDevAiProjectConfigPassage.indexOf(item.index) == -1
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 复选框选中数据 */
|
||||
handleSurProjectVideoPassageSelectionChange(selection) {
|
||||
this.checkedDevAiProjectConfigPassage = selection.map(item => item.index)
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -1,42 +1,18 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目主键" prop="projectId">
|
||||
<el-form-item label="项目名称" prop="projectName">
|
||||
<el-input
|
||||
v-model="queryParams.projectId"
|
||||
placeholder="请输入项目主键"
|
||||
v-model="queryParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位主键" prop="deptId">
|
||||
<el-form-item label="单位名称" prop="deptName">
|
||||
<el-input
|
||||
v-model="queryParams.deptId"
|
||||
placeholder="请输入单位主键"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通道号" prop="channelId">
|
||||
<el-input
|
||||
v-model="queryParams.channelId"
|
||||
placeholder="请输入通道号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通道名称" prop="channelName">
|
||||
<el-input
|
||||
v-model="queryParams.channelName"
|
||||
placeholder="请输入通道名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="相机名称" prop="ipcName">
|
||||
<el-input
|
||||
v-model="queryParams.ipcName"
|
||||
placeholder="请输入相机名称"
|
||||
v-model="queryParams.deptName"
|
||||
placeholder="请输入单位名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
|
@ -44,15 +20,7 @@
|
|||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input
|
||||
v-model="queryParams.deviceName"
|
||||
placeholder="请输入设备名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="serialNumber">
|
||||
<el-input
|
||||
v-model="queryParams.serialNumber"
|
||||
placeholder="请输入设备序列号"
|
||||
placeholder="请输入设备名称/序列号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
|
@ -65,26 +33,20 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据状态" prop="isDel">
|
||||
<el-select v-model="queryParams.isDel" placeholder="请选择数据状态" clearable>
|
||||
<el-form-item label="设备状态" prop="isDel" v-if="false">
|
||||
<el-select
|
||||
v-model="queryParams.isDel"
|
||||
placeholder="请选择设备状态"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_common_isdel"
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否重要" prop="isImportance">
|
||||
<el-select v-model="queryParams.isImportance" placeholder="请选择是否重要" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
@ -99,7 +61,7 @@
|
|||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['project:aiBoxProjectConfig:add']"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
|
@ -110,7 +72,7 @@
|
|||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['project:aiBoxProjectConfig:edit']"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
|
@ -121,7 +83,7 @@
|
|||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['project:aiBoxProjectConfig:remove']"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
|
@ -131,7 +93,7 @@
|
|||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['project:aiBoxProjectConfig:export']"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
|
@ -139,26 +101,16 @@
|
|||
|
||||
<el-table v-loading="loading" :data="aiBoxProjectConfigList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键" align="center" prop="id" />
|
||||
<el-table-column label="项目主键" align="center" prop="projectId" />
|
||||
<el-table-column label="单位主键" align="center" prop="deptId" />
|
||||
<el-table-column label="通道号" align="center" prop="channelId" />
|
||||
<el-table-column label="通道名称" align="center" prop="channelName" />
|
||||
<el-table-column label="相机名称" align="center" prop="ipcName" />
|
||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||
<el-table-column label="单位名称" align="center" prop="deptName" />
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" />
|
||||
<el-table-column label="设备序列号" align="center" prop="serialNumber" />
|
||||
<el-table-column label="厂商名称" align="center" prop="manufacturer" />
|
||||
<el-table-column label="数据状态" align="center" prop="isDel">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_common_isdel" :value="scope.row.isDel"/>
|
||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.isDel"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否重要" align="center" prop="isImportance">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isImportance"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -166,14 +118,14 @@
|
|||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['project:aiBoxProjectConfig:edit']"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['project:aiBoxProjectConfig:remove']"
|
||||
v-hasPermi="['video:aiBoxProjectConfig:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -187,23 +139,43 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改设备配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="项目主键" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目主键" />
|
||||
<!-- 添加或修改AI视频配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="720px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="项目名称" prop="projectId">
|
||||
<el-select
|
||||
v-model="form.projectId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择所属项目"
|
||||
style="width: 100%"
|
||||
@change="projectChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in projectOptions"
|
||||
:key="item.id"
|
||||
:label="item.projectName"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位主键" prop="deptId">
|
||||
<el-input v-model="form.deptId" placeholder="请输入单位主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通道号" prop="channelId">
|
||||
<el-input v-model="form.channelId" placeholder="请输入通道号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通道名称" prop="channelName">
|
||||
<el-input v-model="form.channelName" placeholder="请输入通道名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="相机名称" prop="ipcName">
|
||||
<el-input v-model="form.ipcName" placeholder="请输入相机名称" />
|
||||
<el-form-item label="单位名称" prop="deptId">
|
||||
<el-select
|
||||
v-model="form.deptId"
|
||||
clearable
|
||||
placeholder="请选择所属项目"
|
||||
style="width: 100%"
|
||||
@change="deptChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptOptions"
|
||||
:key="item.deptId"
|
||||
:label="item.deptName"
|
||||
:value="item.deptId"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="deviceName">
|
||||
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
|
||||
|
@ -214,29 +186,37 @@
|
|||
<el-form-item label="厂商名称" prop="manufacturer">
|
||||
<el-input v-model="form.manufacturer" placeholder="请输入厂商名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据状态" prop="isDel">
|
||||
<el-select v-model="form.isDel" placeholder="请选择数据状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_common_isdel"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否重要" prop="isImportance">
|
||||
<el-select v-model="form.isImportance" placeholder="请选择是否重要">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
<el-form-item label="设备状态" prop="isDel">
|
||||
<el-switch v-model="form.isDel" active-value="0" inactive-value="1"></el-switch>
|
||||
</el-form-item>
|
||||
<el-divider content-position="center">AI视频通道信息</el-divider>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddDevAiProjectConfigPassage">添加</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteDevAiProjectConfigPassage">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="devAiProjectConfigPassageList" :row-class-name="rowDevAiProjectConfigPassageIndex" @selection-change="handleDevAiProjectConfigPassageSelectionChange" ref="devAiProjectConfigPassage">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="60"/>
|
||||
<el-table-column label="AI通道号" prop="channelId" width="150" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.channelId" placeholder="请输入AI通道号" required maxlength="10"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="AI通道名称" prop="channelName" width="210" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.channelName" placeholder="请输入AI通道名称" required maxlength="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否重要" prop="isImportance" width="210" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isImportance" active-value="Y" inactive-value="N"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -247,17 +227,19 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listAiBoxProjectConfig, getAiBoxProjectConfig, delAiBoxProjectConfig, addAiBoxProjectConfig, updateAiBoxProjectConfig } from "@/api/project/aiBoxProjectConfig";
|
||||
|
||||
import { listAiBoxProjectConfig, getAiBoxProjectConfig, delAiBoxProjectConfig, addAiBoxProjectConfig, updateAiBoxProjectConfig } from "@/api/video/aiBoxProjectConfig";
|
||||
import { listVideoConfig } from "@/api/video/videoConfig";
|
||||
export default {
|
||||
name: "AiBoxProjectConfig",
|
||||
dicts: ['sys_yes_no', 'sys_common_isdel'],
|
||||
dicts: ["sys_normal_disable"],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 子表选中数据
|
||||
checkedDevAiProjectConfigPassage: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
|
@ -268,6 +250,8 @@ export default {
|
|||
total: 0,
|
||||
// 设备配置表格数据
|
||||
aiBoxProjectConfigList: [],
|
||||
// 设备配置通道表格数据
|
||||
devAiProjectConfigPassageList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
|
@ -278,26 +262,81 @@ export default {
|
|||
pageSize: 10,
|
||||
projectId: null,
|
||||
deptId: null,
|
||||
channelId: null,
|
||||
channelName: null,
|
||||
ipcName: null,
|
||||
deviceName: null,
|
||||
serialNumber: null,
|
||||
manufacturer: null,
|
||||
isDel: null,
|
||||
isImportance: null,
|
||||
projectName:null,
|
||||
deptName:null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
projectId: [{ required: true, message: "请选择所属项目", trigger: "blur" }],
|
||||
deptId: [{ required: true, message: "请选择所属单位", trigger: "blur" }],
|
||||
deviceName: [
|
||||
{ required: true, message: "请输入设备名称", trigger: "blur" },
|
||||
{ max: 50, message: "设备名称最多50字符", trigger: "blur" },
|
||||
],
|
||||
serialNumber: [
|
||||
{ required: true, message: "请输入设备序列号", trigger: "blur" },
|
||||
{ max: 100, message: "设备序列号最多100字符", trigger: "blur" },
|
||||
],
|
||||
manufacturer: [{ required: true, message: "请输入厂商名称", trigger: "blur" },
|
||||
{ max: 50, message: "厂商名称最多50字符", trigger: "blur" },
|
||||
],
|
||||
isDel: [{ required: true, message: "请选择设备状态", trigger: "blur" }],
|
||||
},
|
||||
deptVideo:false,
|
||||
projectOptions:[],
|
||||
deptOptions:[]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
//获取项目列表的接口
|
||||
this.$api.publics.getProjectList({}).then((response) => {
|
||||
this.projectOptions = response.rows;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
projectChange(val){
|
||||
// 根据项目查询总包单位
|
||||
this.form.deptId=null;
|
||||
this.initDept(val)
|
||||
},
|
||||
initDept(val){
|
||||
this.$api.publics
|
||||
.queryUnitList({
|
||||
projectId: val,
|
||||
unitType: 2
|
||||
})
|
||||
.then((d) => {
|
||||
this.deptOptions = d.rows;
|
||||
if (d.rows.length > 0) {
|
||||
// 有总包单位
|
||||
} else {
|
||||
this.$message.error("当前项目未分配总包单位,不能配置AI视频!");
|
||||
}
|
||||
});
|
||||
},
|
||||
deptChange(val){
|
||||
// 查询当前总包单位是否配置视频
|
||||
let param = {
|
||||
projectId:this.form.projectId,
|
||||
deptId:val
|
||||
}
|
||||
listVideoConfig(param).then(response => {
|
||||
if(response.total>0){
|
||||
this.deptVideo=true;
|
||||
}else{
|
||||
this.deptVideo=false;
|
||||
this.$message.error("当前单位未配置视频监控信息,请先配置实时视频!");
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 查询设备配置列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
@ -318,20 +357,18 @@ export default {
|
|||
id: null,
|
||||
projectId: null,
|
||||
deptId: null,
|
||||
channelId: null,
|
||||
channelName: null,
|
||||
ipcName: null,
|
||||
deviceName: null,
|
||||
serialNumber: null,
|
||||
manufacturer: null,
|
||||
isDel: null,
|
||||
isImportance: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.devAiProjectConfigPassageList = [];
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
|
@ -353,8 +390,9 @@ export default {
|
|||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.form.isDel="0";
|
||||
this.open = true;
|
||||
this.title = "添加设备配置";
|
||||
this.title = "添加AI视频配置";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
@ -362,14 +400,17 @@ export default {
|
|||
const id = row.id || this.ids
|
||||
getAiBoxProjectConfig(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.initDept(response.data.projectId);
|
||||
this.devAiProjectConfigPassageList = response.data.devAiProjectConfigPassageList;
|
||||
this.open = true;
|
||||
this.title = "修改设备配置";
|
||||
this.title = "修改AI视频配置";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.devAiProjectConfigPassageList = this.devAiProjectConfigPassageList;
|
||||
if (this.form.id != null) {
|
||||
updateAiBoxProjectConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
|
@ -389,16 +430,45 @@ export default {
|
|||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除设备配置编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除AI视频配置编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delAiBoxProjectConfig(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** AI视频配置通道序号 */
|
||||
rowDevAiProjectConfigPassageIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
},
|
||||
/** AI视频配置通道添加按钮操作 */
|
||||
handleAddDevAiProjectConfigPassage() {
|
||||
let obj = {};
|
||||
obj.channelId = "";
|
||||
obj.channelName = "";
|
||||
obj.isImportance = "";
|
||||
obj.isDel = "0";
|
||||
this.devAiProjectConfigPassageList.push(obj);
|
||||
},
|
||||
/** AI视频配置通道删除按钮操作 */
|
||||
handleDeleteDevAiProjectConfigPassage() {
|
||||
if (this.checkedDevAiProjectConfigPassage.length == 0) {
|
||||
this.$modal.msgError("请先选择要删除的AI视频配置通道数据");
|
||||
} else {
|
||||
const devAiProjectConfigPassageList = this.devAiProjectConfigPassageList;
|
||||
const checkedDevAiProjectConfigPassage = this.checkedDevAiProjectConfigPassage;
|
||||
this.devAiProjectConfigPassageList = devAiProjectConfigPassageList.filter(function(item) {
|
||||
return checkedDevAiProjectConfigPassage.indexOf(item.index) == -1
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 复选框选中数据 */
|
||||
handleDevAiProjectConfigPassageSelectionChange(selection) {
|
||||
this.checkedDevAiProjectConfigPassage = selection.map(item => item.index)
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('project/aiBoxProjectConfig/export', {
|
||||
this.download('video/aiBoxProjectConfig/export', {
|
||||
...this.queryParams
|
||||
}, `aiBoxProjectConfig_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
|
|
@ -79,13 +79,13 @@
|
|||
label="项目名称"
|
||||
align="center"
|
||||
prop="projectName"
|
||||
width="260"
|
||||
width="240"
|
||||
/>
|
||||
<el-table-column
|
||||
label="单位名称"
|
||||
align="center"
|
||||
prop="deptName"
|
||||
width="220"
|
||||
width="210"
|
||||
/>
|
||||
<el-table-column label="预警图片" align="center" property="path" width="220">
|
||||
<template slot-scope="scope">
|
||||
|
@ -114,14 +114,13 @@
|
|||
label="设备名称"
|
||||
align="center"
|
||||
prop="deviceName"
|
||||
width="220"
|
||||
/>
|
||||
<el-table-column
|
||||
label="设备名称"
|
||||
align="center"
|
||||
prop="serialNumber"
|
||||
width="220"
|
||||
/>
|
||||
width="250"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="info">{{ scope.row.deviceName }}</el-tag>
|
||||
<div>{{ scope.row.serialNumber }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="预警时间"
|
||||
align="center"
|
||||
|
|
|
@ -16,6 +16,14 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="deptName">
|
||||
<el-input
|
||||
v-model="queryParams.deptName"
|
||||
placeholder="请输入单位名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="videoName">
|
||||
<el-input
|
||||
v-model="queryParams.videoName"
|
||||
|
@ -117,11 +125,18 @@
|
|||
width="250"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="单位名称"
|
||||
align="center"
|
||||
prop="deptName"
|
||||
width="200"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="设备名称"
|
||||
align="center"
|
||||
prop="videoName"
|
||||
width="250"
|
||||
width="150"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="设备类型" align="center" prop="videoOnlyType">
|
||||
|
@ -223,6 +238,7 @@
|
|||
clearable
|
||||
placeholder="请选择所属项目"
|
||||
style="width: 100%"
|
||||
@change="projectChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in projectOptions"
|
||||
|
@ -233,6 +249,22 @@
|
|||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="deptId">
|
||||
<el-select
|
||||
v-model="form.deptId"
|
||||
clearable
|
||||
placeholder="请选择所属单位"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deptOptions"
|
||||
:key="item.deptId"
|
||||
:label="item.deptName"
|
||||
:value="item.deptId"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="videoName">
|
||||
<el-input v-model="form.videoName" placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
|
@ -326,6 +358,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
projectOptions: [],
|
||||
deptOptions :[],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
|
@ -354,6 +387,8 @@ export default {
|
|||
pageSize: 10,
|
||||
projectId: null,
|
||||
projectName: null,
|
||||
deptId: null,
|
||||
deptName: null,
|
||||
videoName: null,
|
||||
videoOnlyType: null,
|
||||
videoDvrNumber: null,
|
||||
|
@ -368,6 +403,12 @@ export default {
|
|||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
projectId: [
|
||||
{ required: true, message: "请选择所属项目", trigger: "blur" },
|
||||
],
|
||||
deptId: [
|
||||
{ required: true, message: "请选择所属单位", trigger: "blur" },
|
||||
],
|
||||
videoName: [
|
||||
{ required: true, message: "请输入设备名称", trigger: "blur" },
|
||||
{ maxlength: 20, message: "设备名称最多20字符", trigger: "blur" },
|
||||
|
@ -400,6 +441,26 @@ export default {
|
|||
this.getProjectList();
|
||||
},
|
||||
methods: {
|
||||
projectChange(val){
|
||||
this.form.deptId=null;
|
||||
// 根据项目查询总包单位
|
||||
this.initDept(val);
|
||||
},
|
||||
initDept(val){
|
||||
this.$api.publics
|
||||
.queryUnitList({
|
||||
projectId: val,
|
||||
unitType: 2
|
||||
})
|
||||
.then((d) => {
|
||||
this.deptOptions = d.rows;
|
||||
if (d.rows.length > 0) {
|
||||
// 有总包单位
|
||||
} else {
|
||||
this.$message.error("当前项目未分配总包单位,不能配置视频!");
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 查询视频配置列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
@ -429,6 +490,7 @@ export default {
|
|||
this.form = {
|
||||
id: null,
|
||||
projectId: null,
|
||||
deptId: null,
|
||||
videoOnlyType: null,
|
||||
videoDvrNumber: null,
|
||||
videoDvrSecurity: null,
|
||||
|
@ -474,6 +536,7 @@ export default {
|
|||
const id = row.id || this.ids;
|
||||
getVideoConfig(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.initDept(response.data.projectId);
|
||||
this.surProjectVideoPassageList = response.data.surProjectVideoPassageList;
|
||||
this.open = true;
|
||||
this.title = "修改视频配置";
|
||||
|
|
|
@ -10,6 +10,18 @@
|
|||
<template slot="title">
|
||||
<div>{{ drawerTitle + " 【视频配置】" }}</div>
|
||||
</template>
|
||||
<el-tabs
|
||||
v-model="unitActiveName"
|
||||
style="margin-left: 20px; margin-right: 20px"
|
||||
@tab-click="getList"
|
||||
>
|
||||
<el-tab-pane
|
||||
v-for="(it, idx) in nodes"
|
||||
:label="it.unitName + ''"
|
||||
:name="it.unitId + ''"
|
||||
:key="idx"
|
||||
></el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-row
|
||||
:gutter="10"
|
||||
class="mb8"
|
||||
|
@ -22,6 +34,7 @@
|
|||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-if="video"
|
||||
v-hasPermi="['video:videoConfig:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
|
@ -158,6 +171,13 @@
|
|||
:disabled="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="deptName">
|
||||
<el-input
|
||||
v-model="form.deptName"
|
||||
placeholder="请输入单位名称"
|
||||
:disabled="true"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="videoName">
|
||||
<el-input v-model="form.videoName" placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
|
@ -269,6 +289,7 @@ export default {
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: null,
|
||||
deptId:null,
|
||||
projectName: null,
|
||||
videoOnlyType: null,
|
||||
videoDvrNumber: null,
|
||||
|
@ -305,6 +326,9 @@ export default {
|
|||
],
|
||||
},
|
||||
isOpen: false,
|
||||
nodes: [],
|
||||
unitActiveName: "",
|
||||
video:false,
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
|
@ -314,11 +338,33 @@ export default {
|
|||
this.drawerTitle = project.projectName;
|
||||
this.isOpen = true;
|
||||
this.queryParams.projectId = project.id;
|
||||
this.getList();
|
||||
this.$api.publics
|
||||
.queryUnitList({
|
||||
projectId: project.id,
|
||||
unitType: 2
|
||||
})
|
||||
.then((d) => {
|
||||
this.nodes = d.rows;
|
||||
if (d.rows.length > 0) {
|
||||
this.video=true;
|
||||
this.unitActiveName = this.nodes[0].unitId + "";
|
||||
this.getList();
|
||||
} else {
|
||||
this.video=false;
|
||||
this.videoConfigList = [];
|
||||
this.$message.error("当前项目未分配总包单位,不能配置视频!");
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 查询视频配置列表 */
|
||||
getList() {
|
||||
this.nodes.forEach((item) => {
|
||||
if (item.unitId == this.unitActiveName) {
|
||||
this.form.deptName = item.unitName;
|
||||
}
|
||||
});
|
||||
this.loading = true;
|
||||
this.queryParams.deptId=this.unitActiveName;
|
||||
listVideoConfig(this.queryParams).then((response) => {
|
||||
this.videoConfigList = response.rows;
|
||||
this.total = response.total;
|
||||
|
@ -375,6 +421,7 @@ export default {
|
|||
this.title = "添加视频配置";
|
||||
this.form.projectId = this.project.id;
|
||||
this.form.projectName = this.project.projectName;
|
||||
this.form.deptId = this.unitActiveName;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
|
|
@ -9,6 +9,10 @@ public class ProjectViewExport implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long projectId;
|
||||
|
||||
private Long unitId;
|
||||
|
||||
@Excel(name = "项目名称", width = 30,align = HorizontalAlignment.LEFT)
|
||||
private String projectName;
|
||||
|
||||
|
@ -195,4 +199,20 @@ public class ProjectViewExport implements Serializable {
|
|||
public void setJpys(String jpys) {
|
||||
this.jpys = jpys;
|
||||
}
|
||||
|
||||
public Long getProjectId() {
|
||||
return projectId;
|
||||
}
|
||||
|
||||
public void setProjectId(Long projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getUnitId() {
|
||||
return unitId;
|
||||
}
|
||||
|
||||
public void setUnitId(Long unitId) {
|
||||
this.unitId = unitId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,10 +25,10 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||
* 设备配置Controller
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2023-09-27
|
||||
* @date 2023-10-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/project/aiBoxProjectConfig")
|
||||
@RequestMapping("/video/aiBoxProjectConfig")
|
||||
public class DevAiProjectConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
|
@ -37,7 +37,7 @@ public class DevAiProjectConfigController extends BaseController
|
|||
/**
|
||||
* 查询设备配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:aiBoxProjectConfig:list')")
|
||||
@PreAuthorize("@ss.hasPermi('video:aiBoxProjectConfig:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ public class DevAiProjectConfigController extends BaseController
|
|||
/**
|
||||
* 导出设备配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:aiBoxProjectConfig:export')")
|
||||
@PreAuthorize("@ss.hasPermi('video:aiBoxProjectConfig:export')")
|
||||
@Log(title = "设备配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DevAiProjectConfig devAiProjectConfig)
|
||||
|
@ -62,7 +62,7 @@ public class DevAiProjectConfigController extends BaseController
|
|||
/**
|
||||
* 获取设备配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:aiBoxProjectConfig:query')")
|
||||
@PreAuthorize("@ss.hasPermi('video:aiBoxProjectConfig:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ public class DevAiProjectConfigController extends BaseController
|
|||
/**
|
||||
* 新增设备配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:aiBoxProjectConfig:add')")
|
||||
@PreAuthorize("@ss.hasPermi('video:aiBoxProjectConfig:add')")
|
||||
@Log(title = "设备配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DevAiProjectConfig devAiProjectConfig)
|
||||
|
@ -83,7 +83,7 @@ public class DevAiProjectConfigController extends BaseController
|
|||
/**
|
||||
* 修改设备配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:aiBoxProjectConfig:edit')")
|
||||
@PreAuthorize("@ss.hasPermi('video:aiBoxProjectConfig:edit')")
|
||||
@Log(title = "设备配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DevAiProjectConfig devAiProjectConfig)
|
||||
|
@ -94,7 +94,7 @@ public class DevAiProjectConfigController extends BaseController
|
|||
/**
|
||||
* 删除设备配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('project:aiBoxProjectConfig:remove')")
|
||||
@PreAuthorize("@ss.hasPermi('video:aiBoxProjectConfig:remove')")
|
||||
@Log(title = "设备配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package com.yanzhu.jh.video.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.yanzhu.jh.video.domain.DevAiProjectConfigPassage;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
@ -9,7 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
* 设备配置对象 dev_ai_project_config
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2023-09-27
|
||||
* @date 2023-10-03
|
||||
*/
|
||||
public class DevAiProjectConfig extends BaseEntity
|
||||
{
|
||||
|
@ -22,17 +25,13 @@ public class DevAiProjectConfig extends BaseEntity
|
|||
@Excel(name = "项目主键")
|
||||
private Long projectId;
|
||||
|
||||
private String projectName;
|
||||
|
||||
/** 单位主键 */
|
||||
@Excel(name = "单位主键")
|
||||
private Long deptId;
|
||||
|
||||
/** 通道号 */
|
||||
@Excel(name = "通道号")
|
||||
private Long channelId;
|
||||
|
||||
/** 通道名称 */
|
||||
@Excel(name = "通道名称")
|
||||
private String channelName;
|
||||
private String deptName;
|
||||
|
||||
/** 相机名称 */
|
||||
@Excel(name = "相机名称")
|
||||
|
@ -54,9 +53,8 @@ public class DevAiProjectConfig extends BaseEntity
|
|||
@Excel(name = "数据状态")
|
||||
private String isDel;
|
||||
|
||||
/** 是否重要 */
|
||||
@Excel(name = "是否重要")
|
||||
private String isImportance;
|
||||
/** 设备配置通道信息 */
|
||||
private List<DevAiProjectConfigPassage> devAiProjectConfigPassageList;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
|
@ -85,24 +83,6 @@ public class DevAiProjectConfig extends BaseEntity
|
|||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setChannelId(Long channelId)
|
||||
{
|
||||
this.channelId = channelId;
|
||||
}
|
||||
|
||||
public Long getChannelId()
|
||||
{
|
||||
return channelId;
|
||||
}
|
||||
public void setChannelName(String channelName)
|
||||
{
|
||||
this.channelName = channelName;
|
||||
}
|
||||
|
||||
public String getChannelName()
|
||||
{
|
||||
return channelName;
|
||||
}
|
||||
public void setIpcName(String ipcName)
|
||||
{
|
||||
this.ipcName = ipcName;
|
||||
|
@ -148,14 +128,31 @@ public class DevAiProjectConfig extends BaseEntity
|
|||
{
|
||||
return isDel;
|
||||
}
|
||||
public void setIsImportance(String isImportance)
|
||||
|
||||
public List<DevAiProjectConfigPassage> getDevAiProjectConfigPassageList()
|
||||
{
|
||||
this.isImportance = isImportance;
|
||||
return devAiProjectConfigPassageList;
|
||||
}
|
||||
|
||||
public String getIsImportance()
|
||||
public void setDevAiProjectConfigPassageList(List<DevAiProjectConfigPassage> devAiProjectConfigPassageList)
|
||||
{
|
||||
return isImportance;
|
||||
this.devAiProjectConfigPassageList = devAiProjectConfigPassageList;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -164,19 +161,17 @@ public class DevAiProjectConfig extends BaseEntity
|
|||
.append("id", getId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("channelId", getChannelId())
|
||||
.append("channelName", getChannelName())
|
||||
.append("ipcName", getIpcName())
|
||||
.append("deviceName", getDeviceName())
|
||||
.append("serialNumber", getSerialNumber())
|
||||
.append("manufacturer", getManufacturer())
|
||||
.append("isDel", getIsDel())
|
||||
.append("isImportance", getIsImportance())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("devAiProjectConfigPassageList", getDevAiProjectConfigPassageList())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* 设备配置通道对象 dev_ai_project_config_passage
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2023-10-03
|
||||
*/
|
||||
public class DevAiProjectConfigPassage extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** ai盒子主键 */
|
||||
@Excel(name = "ai盒子主键")
|
||||
private Long aiboxId;
|
||||
|
||||
/** 通道主键 */
|
||||
@Excel(name = "通道主键")
|
||||
private Long channelId;
|
||||
|
||||
/** 通道名称 */
|
||||
@Excel(name = "通道名称")
|
||||
private String channelName;
|
||||
|
||||
/** 是否重要 */
|
||||
@Excel(name = "是否重要")
|
||||
private String isImportance;
|
||||
|
||||
/** 数据状态 */
|
||||
@Excel(name = "数据状态")
|
||||
private String isDel;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setAiboxId(Long aiboxId)
|
||||
{
|
||||
this.aiboxId = aiboxId;
|
||||
}
|
||||
|
||||
public Long getAiboxId()
|
||||
{
|
||||
return aiboxId;
|
||||
}
|
||||
public void setChannelId(Long channelId)
|
||||
{
|
||||
this.channelId = channelId;
|
||||
}
|
||||
|
||||
public Long getChannelId()
|
||||
{
|
||||
return channelId;
|
||||
}
|
||||
public void setChannelName(String channelName)
|
||||
{
|
||||
this.channelName = channelName;
|
||||
}
|
||||
|
||||
public String getChannelName()
|
||||
{
|
||||
return channelName;
|
||||
}
|
||||
public void setIsImportance(String isImportance)
|
||||
{
|
||||
this.isImportance = isImportance;
|
||||
}
|
||||
|
||||
public String getIsImportance()
|
||||
{
|
||||
return isImportance;
|
||||
}
|
||||
public void setIsDel(String isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public String getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("aiboxId", getAiboxId())
|
||||
.append("channelId", getChannelId())
|
||||
.append("channelName", getChannelName())
|
||||
.append("isImportance", getIsImportance())
|
||||
.append("isDel", getIsDel())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -24,6 +24,10 @@ public class SurProjectVideoConfig extends BaseEntity
|
|||
@Excel(name = "项目主键")
|
||||
private Long projectId;
|
||||
|
||||
/** 单位主键 */
|
||||
@Excel(name = "单位主键")
|
||||
private Long deptId;
|
||||
|
||||
/** 视频名称 */
|
||||
@Excel(name = "视频名称")
|
||||
private String videoName;
|
||||
|
@ -70,6 +74,8 @@ public class SurProjectVideoConfig extends BaseEntity
|
|||
|
||||
private String projectName;
|
||||
|
||||
private String deptName;
|
||||
|
||||
/** 视频通道信息 */
|
||||
private List<SurProjectVideoPassage> surProjectVideoPassageList;
|
||||
|
||||
|
@ -207,11 +213,28 @@ public class SurProjectVideoConfig extends BaseEntity
|
|||
this.videoSort = videoSort;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("videoName", getVideoName())
|
||||
.append("videoOnlyType", getVideoOnlyType())
|
||||
.append("videoDvrNumber", getVideoDvrNumber())
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
package com.yanzhu.jh.project.mapper;
|
||||
package com.yanzhu.jh.video.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.jh.video.domain.DevAiProjectConfig;
|
||||
import com.yanzhu.jh.video.domain.DevAiProjectConfigPassage;
|
||||
|
||||
/**
|
||||
* 设备配置Mapper接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2023-09-27
|
||||
* @date 2023-10-03
|
||||
*/
|
||||
public interface DevAiProjectConfigMapper
|
||||
{
|
||||
|
@ -58,4 +59,29 @@ public interface DevAiProjectConfigMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除设备配置通道
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectConfigPassageByAiboxIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 批量新增设备配置通道
|
||||
*
|
||||
* @param devAiProjectConfigPassageList 设备配置通道列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchDevAiProjectConfigPassage(List<DevAiProjectConfigPassage> devAiProjectConfigPassageList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过设备配置主键删除设备配置通道信息
|
||||
*
|
||||
* @param id 设备配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevAiProjectConfigPassageByAiboxId(Long id);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.yanzhu.jh.project.mapper;
|
||||
package com.yanzhu.jh.video.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.jh.video.domain.DevAiProjectData;
|
|
@ -7,7 +7,7 @@ import com.yanzhu.jh.video.domain.DevAiProjectConfig;
|
|||
* 设备配置Service接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2023-09-27
|
||||
* @date 2023-10-03
|
||||
*/
|
||||
public interface IDevAiProjectConfigService
|
||||
{
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
package com.yanzhu.jh.video.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.enums.PublicStateEnum;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.jh.project.mapper.DevAiProjectConfigMapper;
|
||||
import java.util.ArrayList;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.yanzhu.jh.video.domain.DevAiProjectConfigPassage;
|
||||
import com.yanzhu.jh.video.mapper.DevAiProjectConfigMapper;
|
||||
import com.yanzhu.jh.video.domain.DevAiProjectConfig;
|
||||
import com.yanzhu.jh.video.service.IDevAiProjectConfigService;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
|
@ -12,7 +18,7 @@ import com.ruoyi.common.utils.SecurityUtils;
|
|||
* 设备配置Service业务层处理
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2023-09-27
|
||||
* @date 2023-10-03
|
||||
*/
|
||||
@Service
|
||||
public class DevAiProjectConfigServiceImpl implements IDevAiProjectConfigService
|
||||
|
@ -50,12 +56,15 @@ public class DevAiProjectConfigServiceImpl implements IDevAiProjectConfigService
|
|||
* @param devAiProjectConfig 设备配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertDevAiProjectConfig(DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
devAiProjectConfig.setCreateBy(SecurityUtils.getUsername());
|
||||
devAiProjectConfig.setCreateTime(DateUtils.getNowDate());
|
||||
return devAiProjectConfigMapper.insertDevAiProjectConfig(devAiProjectConfig);
|
||||
int rows = devAiProjectConfigMapper.insertDevAiProjectConfig(devAiProjectConfig);
|
||||
insertDevAiProjectConfigPassage(devAiProjectConfig);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,11 +73,14 @@ public class DevAiProjectConfigServiceImpl implements IDevAiProjectConfigService
|
|||
* @param devAiProjectConfig 设备配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateDevAiProjectConfig(DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
devAiProjectConfig.setUpdateBy(SecurityUtils.getUsername());
|
||||
devAiProjectConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
devAiProjectConfigMapper.deleteDevAiProjectConfigPassageByAiboxId(devAiProjectConfig.getId());
|
||||
insertDevAiProjectConfigPassage(devAiProjectConfig);
|
||||
return devAiProjectConfigMapper.updateDevAiProjectConfig(devAiProjectConfig);
|
||||
}
|
||||
|
||||
|
@ -78,9 +90,11 @@ public class DevAiProjectConfigServiceImpl implements IDevAiProjectConfigService
|
|||
* @param ids 需要删除的设备配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteDevAiProjectConfigByIds(Long[] ids)
|
||||
{
|
||||
devAiProjectConfigMapper.deleteDevAiProjectConfigPassageByAiboxIds(ids);
|
||||
return devAiProjectConfigMapper.deleteDevAiProjectConfigByIds(ids);
|
||||
}
|
||||
|
||||
|
@ -90,9 +104,36 @@ public class DevAiProjectConfigServiceImpl implements IDevAiProjectConfigService
|
|||
* @param id 设备配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteDevAiProjectConfigById(Long id)
|
||||
{
|
||||
devAiProjectConfigMapper.deleteDevAiProjectConfigPassageByAiboxId(id);
|
||||
return devAiProjectConfigMapper.deleteDevAiProjectConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备配置通道信息
|
||||
*
|
||||
* @param devAiProjectConfig 设备配置对象
|
||||
*/
|
||||
public void insertDevAiProjectConfigPassage(DevAiProjectConfig devAiProjectConfig)
|
||||
{
|
||||
List<DevAiProjectConfigPassage> devAiProjectConfigPassageList = devAiProjectConfig.getDevAiProjectConfigPassageList();
|
||||
Long id = devAiProjectConfig.getId();
|
||||
if (StringUtils.isNotNull(devAiProjectConfigPassageList))
|
||||
{
|
||||
List<DevAiProjectConfigPassage> list = new ArrayList<DevAiProjectConfigPassage>();
|
||||
for (DevAiProjectConfigPassage devAiProjectConfigPassage : devAiProjectConfigPassageList)
|
||||
{
|
||||
devAiProjectConfigPassage.setAiboxId(id);
|
||||
devAiProjectConfigPassage.setIsDel(PublicStateEnum.OK.getCode());
|
||||
list.add(devAiProjectConfigPassage);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
devAiProjectConfigMapper.batchDevAiProjectConfigPassage(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,12 +8,14 @@ import com.ruoyi.common.enums.PublicStateEnum;
|
|||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.MultipartFileUtils;
|
||||
import com.yanzhu.jh.video.domain.DevAiProjectConfig;
|
||||
import com.yanzhu.jh.video.domain.DevAiProjectDataVO;
|
||||
import com.yanzhu.jh.video.mapper.DevAiProjectConfigMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.jh.project.mapper.DevAiProjectDataMapper;
|
||||
import com.yanzhu.jh.video.mapper.DevAiProjectDataMapper;
|
||||
import com.yanzhu.jh.video.domain.DevAiProjectData;
|
||||
import com.yanzhu.jh.video.service.IDevAiProjectDataService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
@ -32,6 +34,9 @@ public class DevAiProjectDataServiceImpl implements IDevAiProjectDataService
|
|||
@Autowired
|
||||
private DevAiProjectDataMapper devAiProjectDataMapper;
|
||||
|
||||
@Autowired
|
||||
private DevAiProjectConfigMapper devAiProjectConfigMapper;
|
||||
|
||||
/**
|
||||
* 查询设备数据
|
||||
*
|
||||
|
@ -144,6 +149,14 @@ public class DevAiProjectDataServiceImpl implements IDevAiProjectDataService
|
|||
}
|
||||
devAiProjectData.setCreateTime(DateUtils.getNowDate());
|
||||
devAiProjectData.setIsDel(PublicStateEnum.OK.getCode());
|
||||
//根据设备配置查询设备绑定的项目和单位信息
|
||||
DevAiProjectConfig devAiProjectConfig = new DevAiProjectConfig();
|
||||
devAiProjectConfig.setSerialNumber(devAiProjectData.getSerialNumber());
|
||||
List<DevAiProjectConfig> devAiProjectConfigList = devAiProjectConfigMapper.selectDevAiProjectConfigList(devAiProjectConfig);
|
||||
if(devAiProjectConfigList!=null && devAiProjectConfigList.size()>0){
|
||||
devAiProjectData.setProjectId(devAiProjectConfigList.get(0).getProjectId());
|
||||
devAiProjectData.setDeptId(devAiProjectConfigList.get(0).getDeptId());
|
||||
}
|
||||
logger.info("新增AI设备数据成功");
|
||||
devAiProjectDataMapper.insertDevAiProjectData(devAiProjectData);
|
||||
}
|
||||
|
|
|
@ -2,20 +2,19 @@
|
|||
<!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.DevAiProjectConfigMapper">
|
||||
<mapper namespace="com.yanzhu.jh.video.mapper.DevAiProjectConfigMapper">
|
||||
|
||||
<resultMap type="DevAiProjectConfig" id="DevAiProjectConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="projectName" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="channelId" column="channel_id" />
|
||||
<result property="channelName" column="channel_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="ipcName" column="ipc_name" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="serialNumber" column="serial_number" />
|
||||
<result property="manufacturer" column="manufacturer" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="isImportance" column="is_importance" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
|
@ -23,29 +22,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="DevAiProjectConfigDevAiProjectConfigPassageResult" type="DevAiProjectConfig" extends="DevAiProjectConfigResult">
|
||||
<collection property="devAiProjectConfigPassageList" notNullColumn="sub_id" javaType="java.util.List" resultMap="DevAiProjectConfigPassageResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="DevAiProjectConfigPassage" id="DevAiProjectConfigPassageResult">
|
||||
<result property="id" column="sub_id" />
|
||||
<result property="aiboxId" column="sub_aibox_id" />
|
||||
<result property="channelId" column="sub_channel_id" />
|
||||
<result property="channelName" column="sub_channel_name" />
|
||||
<result property="isImportance" column="sub_is_importance" />
|
||||
<result property="isDel" column="sub_is_del" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDevAiProjectConfigVo">
|
||||
select id, project_id, dept_id, channel_id, channel_name, ipc_name, device_name, serial_number, manufacturer, is_del, is_importance, create_by, create_time, update_by, update_time, remark from dev_ai_project_config
|
||||
select dapc.id, dapc.project_id, sp.projectName, dapc.dept_id, sd.dept_name, dapc.ipc_name, dapc.device_name, dapc.serial_number, dapc.manufacturer, dapc.is_del, dapc.create_by, dapc.create_time, dapc.update_by, dapc.update_time, dapc.remark from dev_ai_project_config dapc
|
||||
left join sur_project sp on sp.id=dapc.project_id
|
||||
left join sys_dept sd on sd.dept_id=dapc.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectDevAiProjectConfigList" parameterType="DevAiProjectConfig" resultMap="DevAiProjectConfigResult">
|
||||
<include refid="selectDevAiProjectConfigVo"/>
|
||||
<where>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="channelId != null "> and channel_id = #{channelId}</if>
|
||||
<if test="channelName != null and channelName != ''"> and channel_name like concat('%', #{channelName}, '%')</if>
|
||||
<if test="ipcName != null and ipcName != ''"> and ipc_name like concat('%', #{ipcName}, '%')</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
||||
<if test="serialNumber != null and serialNumber != ''"> and serial_number = #{serialNumber}</if>
|
||||
<if test="manufacturer != null and manufacturer != ''"> and manufacturer like concat('%', #{manufacturer}, '%')</if>
|
||||
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
|
||||
<if test="isImportance != null and isImportance != ''"> and is_importance = #{isImportance}</if>
|
||||
<if test="projectId != null "> and dapc.project_id like concat('%', #{projectId}, '%')</if>
|
||||
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
|
||||
<if test="deptId != null "> and dapc.dept_id like concat('%', #{deptId}, '%')</if>
|
||||
<if test="deptName != null and deptName != ''"> and sd.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="ipcName != null and ipcName != ''"> and dapc.ipc_name like concat('%', #{ipcName}, '%')</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and (dapc.device_name like concat('%', #{deviceName}, '%') or dapc.serial_number like concat('%', #{deviceName}, '%'))</if>
|
||||
<if test="serialNumber != null and serialNumber != ''"> and dapc.serial_number = #{serialNumber}</if>
|
||||
<if test="manufacturer != null and manufacturer != ''"> and dapc.manufacturer like concat('%', #{manufacturer}, '%')</if>
|
||||
<if test="isDel != null and isDel != ''"> and dapc.is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDevAiProjectConfigById" parameterType="Long" resultMap="DevAiProjectConfigResult">
|
||||
<include refid="selectDevAiProjectConfigVo"/>
|
||||
where id = #{id}
|
||||
<select id="selectDevAiProjectConfigById" parameterType="Long" resultMap="DevAiProjectConfigDevAiProjectConfigPassageResult">
|
||||
select a.id, a.project_id, sp.projectName, a.dept_id, sd.dept_name, a.ipc_name, a.device_name, a.serial_number, a.manufacturer, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
||||
b.id as sub_id, b.aibox_id as sub_aibox_id, b.channel_id as sub_channel_id, b.channel_name as sub_channel_name, b.is_importance as sub_is_importance, b.is_del as sub_is_del
|
||||
from dev_ai_project_config a
|
||||
left join sur_project sp on sp.id=a.project_id
|
||||
left join sys_dept sd on sd.dept_id=a.dept_id
|
||||
left join dev_ai_project_config_passage b on b.aibox_id = a.id
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevAiProjectConfig" parameterType="DevAiProjectConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
|
@ -53,14 +71,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="channelId != null">channel_id,</if>
|
||||
<if test="channelName != null">channel_name,</if>
|
||||
<if test="ipcName != null">ipc_name,</if>
|
||||
<if test="deviceName != null">device_name,</if>
|
||||
<if test="serialNumber != null">serial_number,</if>
|
||||
<if test="manufacturer != null">manufacturer,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="isImportance != null">is_importance,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
|
@ -70,14 +85,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="channelId != null">#{channelId},</if>
|
||||
<if test="channelName != null">#{channelName},</if>
|
||||
<if test="ipcName != null">#{ipcName},</if>
|
||||
<if test="deviceName != null">#{deviceName},</if>
|
||||
<if test="serialNumber != null">#{serialNumber},</if>
|
||||
<if test="manufacturer != null">#{manufacturer},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="isImportance != null">#{isImportance},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
|
@ -91,14 +103,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="channelId != null">channel_id = #{channelId},</if>
|
||||
<if test="channelName != null">channel_name = #{channelName},</if>
|
||||
<if test="ipcName != null">ipc_name = #{ipcName},</if>
|
||||
<if test="deviceName != null">device_name = #{deviceName},</if>
|
||||
<if test="serialNumber != null">serial_number = #{serialNumber},</if>
|
||||
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="isImportance != null">is_importance = #{isImportance},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
|
@ -118,4 +127,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDevAiProjectConfigPassageByAiboxIds" parameterType="String">
|
||||
delete from dev_ai_project_config_passage where aibox_id in
|
||||
<foreach item="aiboxId" collection="array" open="(" separator="," close=")">
|
||||
#{aiboxId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDevAiProjectConfigPassageByAiboxId" parameterType="Long">
|
||||
delete from dev_ai_project_config_passage where aibox_id = #{aiboxId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchDevAiProjectConfigPassage">
|
||||
insert into dev_ai_project_config_passage( id, aibox_id, channel_id, channel_name, is_importance, is_del) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.aiboxId}, #{item.channelId}, #{item.channelName}, #{item.isImportance}, #{item.isDel})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
|
@ -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.DevAiProjectDataMapper">
|
||||
<mapper namespace="com.yanzhu.jh.video.mapper.DevAiProjectDataMapper">
|
||||
|
||||
<resultMap type="DevAiProjectData" id="DevAiProjectDataResult">
|
||||
<result property="id" column="id" />
|
||||
|
@ -68,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and sp.id in (select spu.project_id from sur_project_userinfo spu where spu.user_id = #{nowUser} and spu.is_del=0)
|
||||
</if>
|
||||
</where>
|
||||
order by dapd.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectDevAiProjectDataById" parameterType="Long" resultMap="DevAiProjectDataResult">
|
||||
|
|
|
@ -8,6 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="id" column="id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="projectName" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="videoName" column="video_name" />
|
||||
<result property="videoOnlyType" column="video_only_type" />
|
||||
<result property="videoDvrNumber" column="video_dvr_number" />
|
||||
|
@ -40,8 +42,9 @@ 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.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
|
||||
select spvc.id, spvc.project_id, spvc.dept_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, sd.dept_name from sur_project_video_config spvc
|
||||
left join sur_project sp on sp.id=spvc.project_id
|
||||
left join sys_dept sd on sd.dept_id= spvc.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSurProjectVideoConfigList" parameterType="SurProjectVideoConfig" resultMap="SurProjectVideoConfigResult">
|
||||
|
@ -50,6 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and spvc.is_del='0'
|
||||
<if test="projectId != null "> and spvc.project_id = #{projectId}</if>
|
||||
<if test="projectName != null "> and sp.projectName like concat('%', #{projectName}, '%')</if>
|
||||
<if test="deptId != null "> and spvc.dept_id = #{deptId}</if>
|
||||
<if test="deptName != null "> and sd.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="videoName != null "> and spvc.video_name like concat('%', #{videoName}, '%')</if>
|
||||
<if test="videoOnlyType != null and videoOnlyType != ''"> and spvc.video_only_type = #{videoOnlyType}</if>
|
||||
<if test="videoDvrNumber != null and videoDvrNumber != ''"> and spvc.video_dvr_number like concat('%', #{videoDvrNumber}, '%')</if>
|
||||
|
@ -70,10 +75,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</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.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,
|
||||
select a.id, a.project_id, p.projectName, a.dept_id, d.dept_name, 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 sys_dept d on a.dept_id=d.dept_id
|
||||
left join sur_project_video_passage b on b.video_id = a.id
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
@ -91,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
insert into sur_project_video_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="videoName != null">video_name,</if>
|
||||
<if test="videoOnlyType != null">video_only_type,</if>
|
||||
<if test="videoDvrNumber != null">video_dvr_number,</if>
|
||||
|
@ -110,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="videoName != null">#{videoName},</if>
|
||||
<if test="videoOnlyType != null">#{videoOnlyType},</if>
|
||||
<if test="videoDvrNumber != null">#{videoDvrNumber},</if>
|
||||
|
@ -134,6 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="projectId != null and projectId>0">project_id = #{projectId},</if>
|
||||
<if test="projectId == 0">project_id = NULL,</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</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>
|
||||
|
|
Loading…
Reference in New Issue