Commit d4c8c650 by 416409548@qq.com

bug优化,视频安防模块优化

parent cb12baa3
......@@ -4,15 +4,14 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-col :md="4" :sm="8">
<a-form-item label="设备类型">
<j-dict-select-tag v-model="queryParam.type" placeholder="请选择设备类型" dict-code="alarm_query_equipmentType"/>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-col :md="4" :sm="8">
<a-space style="float: left">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button type="default" @click="searchReset">重置</a-button>
</a-space>
</a-col>
</a-row>
......@@ -141,9 +140,6 @@ export default {
})
});
},
searchReset() {
this.searchQuery();
},
floorImgLoadComplete() {
this.searchQuery();
}
......
......@@ -143,19 +143,23 @@ export default {
},
confirmLoading: false,
validatorRules: {
code: [
{
required: true,
message: '请输入设备编码',
trigger: 'blur'
}
},
{min: 0, max: 50, message: '长度不超过50个字符', trigger: 'blur' }
],
name: [
{
required: true,
message: '请输入设备名称',
trigger: 'blur'
}
},
{min: 0, max: 50, message: '长度不超过50个字符', trigger: 'blur' }
],
ip: [
{
......@@ -164,24 +168,19 @@ export default {
trigger: 'blur'
}
],
type: [
{
required: true,
message: '选择设备类型',
trigger: 'change'
}
],
buildingName: [
place: [
{
required: true,
message: '选择楼栋',
message: '选择设备位置',
trigger: 'change'
}
},
{min: 0, max: 50, message: '长度不超过50个字符', trigger: 'blur' }
],
floor: [
type: [
{
required: true,
message: '选择楼层',
message: '选择设备类型',
trigger: 'change'
}
],
......@@ -218,7 +217,9 @@ export default {
required: true,
message: '请输入生产厂商',
trigger: 'blur'
}
},
{min: 0, max: 50, message: '长度不超过50个字符', trigger: 'blur' }
],
warrantyPeriod: [
{
......
......@@ -5,7 +5,7 @@
<a-row>
<a-col :span="24">
<a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-select placeholder="设备名称选择" v-model="model.settingId">
<a-select placeholder="设备名称选择" v-model="model.settingId">
<a-select-option v-for="route in routes" :key="route.id">
{{ route.name }}
</a-select-option>
......
......@@ -15,12 +15,12 @@
<a-col :span="4">
<a-form-model-item label="开始时间" prop="createTime">
<j-date v-model="queryParam.createTime" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
<j-date v-model="queryParam.createTime" placeholder="请选择开始时间" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
</a-form-model-item>
</a-col>
<a-col :span="4">
<a-form-model-item label="结束时间" prop="stopTime" >
<j-date v-model="queryParam.stopTime" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
<j-date v-model="queryParam.stopTime" placeholder="请选择结束时间" :showTime="true" dateFormat="YYYY-MM-DD HH:mm:ss"/>
</a-form-model-item>
</a-col>
......
......@@ -4,24 +4,21 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="区域">
<a-select placeholder="选择区域" v-model="queryParam.area" @change="buildingChange">
<a-select-option v-for="area in areas" :key="area">
{{ area }}
</a-select-option>
</a-select>
<a-col :md="4" :sm="8">
<a-form-item label="设备名称">
<j-input placeholder="请输入设备名称" v-model="queryParam.name"></j-input>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-col :md="4" :sm="8">
<a-space style="float: left">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button type="default" @click="searchReset">重置</a-button>
</a-space>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-col :md="16" :sm="8">
<a-space style="float: right">
<a-button @click="handleExportXls('pm_access_control_device')" type="primary">导出</a-button>
<!-- <a-button @click="handleAdd" type="primary">新增</a-button> -->
<a-button @click="handleExportXls('视频安防导出')" type="primary">导出</a-button>
</a-space>
</a-col>
</a-row>
......@@ -30,36 +27,28 @@
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<!--<div class="table-operator">
<!-- <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('pm_access_control_device')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="download" @click="handleExportXls('pm_monitoring_device')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
&lt;!&ndash; 高级查询区域 &ndash;&gt;
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
</a-upload> -->
<!-- 高级查询区域 -->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>-->
</div> -->
<!-- table区域-begin -->
<div>
<!--<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>-->
</div> -->
<a-table
ref="table"
......@@ -80,8 +69,7 @@
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"/>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
......@@ -97,18 +85,13 @@
</template>
<span slot="action" slot-scope="text, record">
<a-space>
<a href="/static/mpb/mpb.html" target="_blank">视频</a>
<a @click="handleDetail(record)">查看</a>
<a @click="handleEdit(record)">修改</a>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-space>
<a-divider type="vertical" />
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a href="/static/mpb/mpb.html" target="_blank">视频</a>
</span>
</a-table>
<!-- <iframe src="/static/spb/spb.html" frameborder="0" width="1000" height="1000"></iframe> -->
</div>
<pm-monitoring-device-modal ref="modalForm" @ok="modalFormOk"></pm-monitoring-device-modal>
......@@ -121,7 +104,6 @@
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PmMonitoringDeviceModal from './modules/PmMonitoringDeviceModal'
import {getAction} from '@/api/manage'
export default {
name: 'PmMonitoringDeviceList',
......@@ -145,14 +127,9 @@
}
},
{
title:'设备编码',
title:'区域名称',
align:"center",
dataIndex: 'code'
},
{
title: '设备类型',
align: "center",
dataIndex: 'type'
dataIndex: 'districtName'
},
{
title:'设备名称',
......@@ -160,89 +137,49 @@
dataIndex: 'name'
},
{
title:'设备ip',
align:"center",
dataIndex: 'ip'
},
{
title:'楼栋',
align:"center",
dataIndex: 'buildingName'
},
{
title:'楼层',
align:"center",
dataIndex: 'floor'
},
{
title:'设备位置',
title:'设备编码',
align:"center",
dataIndex: 'place'
},
{
title: 'xy值',
align: "center",
dataIndex: 'coordinate',
customRender(t, r, index) {
if (t) {
return t.x + ',' + t.y;
}
},
dataIndex: 'code'
},
{
title:'生产日期',
title:'设备类型',
align:"center",
dataIndex: 'dateOfProduction',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
dataIndex: 'type_dictText'
},
{
title:'安装日期',
title:'设备ip',
align:"center",
dataIndex: 'installationDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
dataIndex: 'ip'
},
{
title:'保修截止日期',
title:'所属设备',
align:"center",
dataIndex: 'warrantyPeriod',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
dataIndex: 'theirEquipment'
},
{
title:'生产厂商',
title:'xy值',
align:"center",
dataIndex: 'manufacturer',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
dataIndex: 'coordinate'
},
{
title:'状态',
title:'设备状态',
align:"center",
dataIndex: 'status'
dataIndex: 'status_dictText'
},
{
title:'创建人Id(sys_user)',
title:'端口',
align:"center",
dataIndex: 'createUserId'
dataIndex: 'port'
},
{
title:'修改人Id(sys_user)',
title:'通道号',
align:"center",
dataIndex: 'modifyUserId'
dataIndex: 'chanelNum'
},
{
title:'修改时间',
title:'创建人',
align:"center",
dataIndex: 'modifyTime',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
dataIndex: 'createUserId_dictText'
},
{
title: '操作',
......@@ -259,59 +196,43 @@
deleteBatch: "/pm/pmMonitoringDevice/deleteBatch",
exportXlsUrl: "/pm/pmMonitoringDevice/exportXls",
importExcelUrl: "pm/pmMonitoringDevice/importExcel",
},
dictOptions:{},
superFieldList: [],
buildingInfos: [],
targetFloorList: [],
types: [],
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
getAction('/pm/pmBuildingInfo/list')
.then(value => this.buildingInfos = value.result);
getAction('/pm/pmAccessControlDevice/types')
.then(value => this.types = value.result);
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig() {
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'code', text: '设备编码'})
fieldList.push({type: 'string', value: 'name', text: '设备名称'})
fieldList.push({type: 'string', value: 'ip', text: '设备ip'})
fieldList.push({type: 'string', value: 'buildingName', text: '楼栋'})
fieldList.push({type: 'int', value: 'floor', text: '楼层'})
fieldList.push({type: 'string', value: 'place', text: '设备位置'})
fieldList.push({type: 'string', value: 'coordinate', text: 'xy值'})
fieldList.push({type: 'int', value: 'doorOpenTime', text: '开门时间'})
fieldList.push({type: 'date', value: 'dateOfProduction', text: '生产日期'})
fieldList.push({type: 'date', value: 'installationDate', text: '安装日期'})
fieldList.push({type: 'date', value: 'warrantyPeriod', text: '保修截止日期'})
fieldList.push({type: 'date', value: 'manufacturer', text: '生产厂商'})
fieldList.push({type: 'string', value: 'status', text: '状态'})
fieldList.push({type: 'string', value: 'createUserId', text: '创建人Id(sys_user)'})
fieldList.push({type: 'string', value: 'modifyUserId', text: '修改人Id(sys_user)'})
fieldList.push({type: 'date', value: 'modifyTime', text: '修改时间'})
this.superFieldList = fieldList
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
buildingChange(value) {
let targetList = this.buildingInfos.filter(buildingInfo => buildingInfo.name === value);
if (targetList != null && targetList.length > 0) {
this.targetFloorList = targetList[0].floorList;
} else {
this.targetFloorList = [];
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'districtName',text:'区域名称'})
fieldList.push({type:'string',value:'name',text:'设备名称'})
fieldList.push({type:'string',value:'code',text:'设备编码'})
fieldList.push({type:'string',value:'type',text:'设备类型'})
fieldList.push({type:'string',value:'ip',text:'设备ip'})
fieldList.push({type:'string',value:'theirEquipment',text:'所属设备'})
fieldList.push({type:'string',value:'coordinate',text:'xy值'})
fieldList.push({type:'string',value:'status',text:'状态 1:正常 2:离线 3:维修'})
fieldList.push({type:'string',value:'port',text:'端口'})
fieldList.push({type:'string',value:'chanelNum',text:'通道号'})
fieldList.push({type:'string',value:'createUserId',text:'创建人Id(sys_user)'})
fieldList.push({type:'string',value:'modifyUserId',text:'修改人Id(sys_user)'})
fieldList.push({type:'date',value:'modifyTime',text:'修改时间'})
fieldList.push({type:'int',value:'deleted',text:'删除状态'})
this.superFieldList = fieldList
}
},
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
......
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="选择楼栋">
<a-select placeholder="选择楼栋" v-model="queryParam.buildingName" @change="buildingChange">
<a-select-option v-for="buildingInfo in buildingInfos" :key="buildingInfo.name">
{{ buildingInfo.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-form-item label="选择楼层">
<a-select placeholder="选择楼层" v-model="queryParam.floor">
<a-select-option v-for="floor in targetFloorList" :key="floor">
{{ floor }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="4" :lg="4" :md="5" :sm="24">
<a-space style="float: left">
<a-button type="primary" @click="searchQuery">查询</a-button>
<a-button type="default" @click="searchReset">重置</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<!--<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('pm_access_control_device')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
&lt;!&ndash; 高级查询区域 &ndash;&gt;
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>-->
<!-- table区域-begin -->
<div>
<a-row>
<a-col :span="24">
<div style="position: relative">
<img ref="floorImg" src="@/assets/floor.png" alt="floor" width="100%" height="100%"
@load="floorImgLoadComplete()"/>
<img v-for="(item, index) in list"
ref="icon"
:src="item.status === 'NORMAL'
? statusList[0].imgPath
: (item.status === 'OFFLINE' ? statusList[1].imgPath : statusList[2].imgPath)"
:alt="item.name + ':' + item.ip"/>
</div>
</a-col>
</a-row>
</div>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {getAction} from '@/api/manage'
export default {
name: 'PmMonitoringDeviceOverview',
components: {},
data() {
return {
queryParam: {deleted: false},
description: 'pm_monitoring_device管理页面',
url: {
list: "/pm/pmMonitoringDevice/list",
delete: "/pm/pmMonitoringDevice/delete",
deleteBatch: "/pm/pmMonitoringDevice/deleteBatch",
exportXlsUrl: "/pm/pmMonitoringDevice/exportXls",
importExcelUrl: "pm/pmMonitoringDevice/importExcel",
},
list: [],
dictOptions: {},
superFieldList: [],
buildingInfos: [],
targetFloorList: [],
types: [],
statusList: [
{name: '正常', value: 'NORMAL', imgPath: require('@/assets/door-close.png')},
{name: '离线', value: 'OFFLINE', imgPath: require('@/assets/door-offline.png')},
{name: '损坏', value: 'BREAKDOWN', imgPath: require('@/assets/door-warning.png')}],
}
},
created() {
getAction('/pm/pmBuildingInfo/list')
.then(value => this.buildingInfos = value.result);
getAction('/pm/pmAccessControlDevice/types')
.then(value => this.types = value.result);
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig() {
},
buildingChange(value) {
let targetList = this.buildingInfos.filter(buildingInfo => buildingInfo.name === value);
if (targetList != null && targetList.length > 0) {
this.targetFloorList = targetList[0].floorList;
} else {
this.targetFloorList = [];
}
},
loadComplete() {
if (this.list.length > 0) {
this.list.forEach((item, index) => {
console.log(item);
let fixX = 20;
let fixY = 20;
let offsetWidth = this.$refs.floorImg.offsetWidth;
let offsetHeight = this.$refs.floorImg.offsetHeight;
this.$refs.icon[index].style.position = 'absolute';
this.$refs.icon[index].style.width = '40px';
this.$refs.icon[index].style.top = item.coordinate.y * offsetHeight - fixY + 'px';
this.$refs.icon[index].style.left = item.coordinate.x * offsetWidth - fixX + 'px';
});
}
},
searchQuery() {
getAction(this.url.list, this.queryParam)
.then(value => {
this.list = value.result.records;
this.$nextTick(()=>{
this.loadComplete();
})
});
},
searchReset() {
this.searchQuery();
},
floorImgLoadComplete() {
this.searchQuery();
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
\ No newline at end of file
......@@ -4,102 +4,72 @@
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="12">
<a-form-model-item label="设备编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code">
<a-input v-model="model.code" placeholder="请输入设备编码"></a-input>
<a-form-model-item label="区域名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="districtName">
<a-input v-model="model.districtName" placeholder="请输入区域名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
<a-input v-model="model.name" placeholder="请输入设备名称"></a-input>
<a-input v-model="model.name" placeholder="请输入设备名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="设备ip" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ip">
<a-input v-model="model.ip" placeholder="请输入设备ip"></a-input>
<a-form-model-item label="设备编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code">
<a-input v-model="model.code" placeholder="请输入设备编码" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="设备类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ip">
<a-select placeholder="选择设备类型" v-model="model.type">
<a-select-option v-for="type in types" :key="type">
{{ type }}
<a-form-model-item label="设备类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
<a-select placeholder="设备类型" v-model="model.type">
<a-select-option value="1">
枪机
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="楼栋" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="buildingName">
<a-select placeholder="选择楼栋" v-model="model.buildingName" @change="buildingChange">
<a-select-option v-for="buildingInfo in buildingInfos" :key="buildingInfo.name">
{{ buildingInfo.name }}
<a-select-option value="2">
球形
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="楼层" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="floor">
<a-select placeholder="选择楼层" v-model="model.floor">
<a-select-option v-for="floor in targetFloorList" :key="floor">
{{ floor }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="开门时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="doorOpenTime">
<a-input-number :min="0" :formatter="value => `${value}s`"
:parser="value => value.replace('s', '')" v-model="model.doorOpenTime"
placeholder="请输入开门时间" style="width: 100%" suffix="RMB"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="设备位置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="place">
<a-input v-model="model.place" placeholder="请输入设备位置"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="出产日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dateOfProduction">
<j-date placeholder="请选择生产日期" v-model="model.dateOfProduction" style="width: 100%"/>
<a-form-model-item label="设备ip" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ip">
<a-input v-model="model.ip" placeholder="请输入设备ip" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="安装日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="installationDate">
<j-date placeholder="请选择安装日期" v-model="model.installationDate" style="width: 100%"/>
<a-form-model-item label="所属设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="theirEquipment">
<a-input v-model="model.theirEquipment" placeholder="请输入所属设备" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="生产厂商" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manufacturer">
<a-input v-model="model.manufacturer" placeholder="请输入生产厂商"></a-input>
<a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<a-select placeholder="设备状态" v-model="model.status">
<a-select-option value="1">
正常
</a-select-option>
<a-select-option value="2">
离线
</a-select-option>
<a-select-option value="3">
维修
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="保修截止日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warrantyPeriod">
<j-date placeholder="请选择保修截止日期" v-model="model.warrantyPeriod" style="width: 100%"/>
<a-form-model-item label="端口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="port">
<a-input v-model="model.port" placeholder="请输入端口" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<a-select placeholder="选择状态" v-model="model.status" @change="statusChange">
<a-select-option v-for="status in statusList" :key="status.value">
{{ status.name }}
</a-select-option>
</a-select>
<a-form-model-item label="通道号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chanelNum">
<a-input v-model="model.chanelNum" placeholder="请输入通道号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="xy值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="coordinateTmp">
<a-input v-model="model.coordinateTmp" disabled></a-input>
<a-form-model-item label="xy值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="coordinate">
<a-input v-model="model.coordinate" placeholder="请输入xy值" disabled ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<div style="position: relative">
<img src="@/assets/floor.png" alt="floor" width="100%" height="100%"
@click="imgClick($event)" ref="imgBg" @load="floorImgLoadComplete($event)"/>
<img :src="doorIconPath" alt="door"
:style="doorIconStyle"
v-show="doorIconPath"/>
</div>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
......@@ -108,265 +78,89 @@
<script>
import {httpAction, getAction} from '@/api/manage'
import {validateDuplicateValue} from '@/utils/util'
export default {
name: 'PmAccessControlDeviceForm',
components: {},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
data() {
return {
model: {
doorOpenTime: 0,
coordinateTmp: null,
},
labelCol: {
xs: {span: 24},
sm: {span: 5},
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
confirmLoading: false,
validatorRules: {
code: [
{
required: true,
message: '请输入设备编码',
trigger: 'blur'
}
],
name: [
{
required: true,
message: '请输入设备名称',
trigger: 'blur'
}
],
ip: [
{
required: true,
message: '请输入设备ip',
trigger: 'blur'
}
],
type: [
{
required: true,
message: '选择设备类型',
trigger: 'change'
}
],
buildingName: [
{
required: true,
message: '选择楼栋',
trigger: 'change'
}
],
floor: [
{
required: true,
message: '选择楼层',
trigger: 'change'
}
],
doorOpenTime: [
{
required: true,
message: '请输入开门时间',
trigger: 'blur'
}
],
place: [
{
required: true,
message: '请输入设备位置',
trigger: 'blur'
}
],
dateOfProduction: [
{
required: true,
message: '请选择生产日期',
trigger: 'change'
}
],
installationDate: [
{
required: true,
message: '请选择安装日期',
trigger: 'change'
}
],
manufacturer: [
{
required: true,
message: '请输入生产厂商',
trigger: 'blur'
}
],
warrantyPeriod: [
{
required: true,
message: '请选择保修截止日期',
trigger: 'change'
}
],
status: [
{
required: true,
message: '选择状态',
trigger: 'change'
}
],
coordinateTmp: [
{
required: true,
message: '请点击平面图设置设备坐标',
trigger: ['change', 'blur']
}
],
},
url: {
add: "/pm/pmAccessControlDevice/add",
edit: "/pm/pmAccessControlDevice/edit",
queryById: "/pm/pmAccessControlDevice/queryById"
},
statusList: [
{name: '正常', value: 'NORMAL', imgPath: require('@/assets/door-close.png')},
{name: '离线', value: 'OFFLINE', imgPath: require('@/assets/door-offline.png')},
{name: '损坏', value: 'BREAKDOWN', imgPath: require('@/assets/door-warning.png')}],
doorIconStyle: {
position: 'absolute',
top: '0px',
left: '0px',
width: '40px'
},
doorIconPath: null,
buildingInfos: [],
targetFloorList: [],
types: [],
}
},
computed: {
formDisabled() {
return this.disabled
},
},
created() {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
getAction('/pm/pmBuildingInfo/list')
.then(value => this.buildingInfos = value.result);
getAction('/pm/pmAccessControlDevice/types')
.then(value => this.types = value.result);
},
methods: {
add() {
this.edit(this.modelDefault);
},
edit(record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm() {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if (!this.model.id) {
// 设置创建用户Id
this.model.createUserId = this.$store.getters.userInfo.id;
httpurl += this.url.add;
method = 'post';
} else {
httpurl += this.url.edit;
method = 'put';
}
// 初始化坐标对象并赋值
let coordinate = this.model.coordinateTmp.split(',');
this.model.coordinate = {
x: coordinate[0],
y: coordinate[1]
}
// 设置修改用户Id
this.model.modifyUserId = this.$store.getters.userInfo.id;
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
httpAction(httpurl, this.model, method).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
imgClick(e) {
// 获取点击目标的x,y坐标
// let target = e.target;
var event = e || window.event;
var target = event.target || event.srcElement;
console.log(target.pageX);
let fixX = this.$refs.imgBg.getBoundingClientRect().left;
let fixY = this.$refs.imgBg.getBoundingClientRect().top;
// let fixX = target.x;
// let fixY = target.y;
console.log(fixX, fixY);
// console.log(e.x, e.y);
let offsetWidth = target.offsetWidth;
let offsetHeight = target.offsetHeight;
let offsetX = (event.x - fixX);
let offsetY = (event.y - fixY);
this.doorIconStyle.top = offsetY - 20 + 'px';
this.doorIconStyle.left = offsetX - 20 + 'px';
let x = ((event.x - fixX) / offsetWidth).toFixed(4);
let y = ((event.y - fixY) / offsetHeight).toFixed(4);
this.model.coordinateTmp = x + "," + y;
this.$refs.form.validateField('coordinateTmp');
},
statusChange(value) {
let targetList = this.statusList.filter(status => status.value === value);
this.doorIconPath = targetList.length > 0 ? targetList[0].imgPath : null;
export default {
name: 'PmMonitoringDeviceForm',
components: {
},
buildingChange(value) {
let targetList = this.buildingInfos.filter(buildingInfo => buildingInfo.name === value);
if (targetList != null && targetList.length > 0) {
this.targetFloorList = targetList[0].floorList;
} else {
this.targetFloorList = [];
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false
}
},
floorImgLoadComplete(e) {
if (this.model.coordinate) {
this.model.coordinateTmp = this.model.coordinate.x + ',' + this.model.coordinate.y;
this.statusChange(this.model.status);
let target = e.target;
let fixX = 20;
let fixY = 20;
let offsetWidth = target.offsetWidth;
let offsetHeight = target.offsetHeight;
this.doorIconStyle.top = this.model.coordinate.y * offsetHeight - fixY + 'px'
this.doorIconStyle.left = this.model.coordinate.x * offsetWidth - fixX + 'px';
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/pm/pmMonitoringDevice/add",
edit: "/pm/pmMonitoringDevice/edit",
queryById: "/pm/pmMonitoringDevice/queryById"
},
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
// 触发表单验证
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
}
}
}
</script>
\ No newline at end of file
......@@ -141,7 +141,7 @@ public class PmAccessControlDeviceController extends JeecgController<PmAccessCon
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PmAccessControlDevice pmAccessControlDevice) {
return super.exportXls(request, pmAccessControlDevice, PmAccessControlDevice.class, "pm_access_control_device");
return super.exportXls(request, pmAccessControlDevice, PmAccessControlDevice.class, "门禁设备");
}
/**
......
package org.jeecg.pm.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
......@@ -10,9 +8,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.pm.entity.PmAccessControlDeviceRecord;
......
package org.jeecg.pm.controller;
import java.util.Arrays;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.pm.entity.PmMonitoringDevice;
import org.jeecg.pm.service.IPmMonitoringDeviceService;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
/**
* @Description: pm_monitoring_device
* @Author: jeecg-boot
* @Date: 2022-03-15
* @Date: 2022-05-25
* @Version: V1.0
*/
@Api(tags = "pm_monitoring_device")
@Api(tags="pm_monitoring_device")
@RestController
@RequestMapping("/pm/pmMonitoringDevice")
@Slf4j
public class PmMonitoringDeviceController extends JeecgController<PmMonitoringDevice, IPmMonitoringDeviceService> {
@Autowired
private IPmMonitoringDeviceService pmMonitoringDeviceService;
/**
* 分页列表查询
*
* @param pmMonitoringDevice
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "pm_monitoring_device-分页列表查询")
@ApiOperation(value = "pm_monitoring_device-分页列表查询", notes = "pm_monitoring_device-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<PmMonitoringDevice>> queryPageList(PmMonitoringDevice pmMonitoringDevice,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<PmMonitoringDevice> queryWrapper = QueryGenerator.initQueryWrapper(pmMonitoringDevice, req.getParameterMap());
Page<PmMonitoringDevice> page = new Page<PmMonitoringDevice>(pageNo, pageSize);
IPage<PmMonitoringDevice> pageList = pmMonitoringDeviceService.page(page, queryWrapper);
return Result.OK(pageList);
}
@GetMapping("/listByFloorId")
public Result<List<PmMonitoringDevice>> listByFloorId(Long floorId) {
return null;
}
/**
* 添加
*
* @param pmMonitoringDevice
* @return
*/
@AutoLog(value = "pm_monitoring_device-添加")
@ApiOperation(value = "pm_monitoring_device-添加", notes = "pm_monitoring_device-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody PmMonitoringDevice pmMonitoringDevice) {
pmMonitoringDeviceService.save(pmMonitoringDevice);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param pmMonitoringDevice
* @return
*/
@AutoLog(value = "pm_monitoring_device-编辑")
@ApiOperation(value = "pm_monitoring_device-编辑", notes = "pm_monitoring_device-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody PmMonitoringDevice pmMonitoringDevice) {
pmMonitoringDeviceService.updateById(pmMonitoringDevice);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "pm_monitoring_device-通过id删除")
@ApiOperation(value = "pm_monitoring_device-通过id删除", notes = "pm_monitoring_device-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
pmMonitoringDeviceService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "pm_monitoring_device-批量删除")
@ApiOperation(value = "pm_monitoring_device-批量删除", notes = "pm_monitoring_device-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.pmMonitoringDeviceService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "pm_monitoring_device-通过id查询")
@ApiOperation(value = "pm_monitoring_device-通过id查询", notes = "pm_monitoring_device-通过id查询")
@GetMapping(value = "/queryById")
public Result<PmMonitoringDevice> queryById(@RequestParam(name = "id", required = true) String id) {
PmMonitoringDevice pmMonitoringDevice = pmMonitoringDeviceService.getById(id);
if (pmMonitoringDevice == null) {
return Result.error("未找到对应数据", null);
}
return Result.OK(pmMonitoringDevice);
}
@Autowired
private IPmMonitoringDeviceService pmMonitoringDeviceService;
/**
* 分页列表查询
*
* @param pmMonitoringDevice
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "pm_monitoring_device-分页列表查询")
@ApiOperation(value="pm_monitoring_device-分页列表查询", notes="pm_monitoring_device-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<PmMonitoringDevice>> queryPageList(PmMonitoringDevice pmMonitoringDevice,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<PmMonitoringDevice> queryWrapper = QueryGenerator.initQueryWrapper(pmMonitoringDevice, req.getParameterMap());
Page<PmMonitoringDevice> page = new Page<PmMonitoringDevice>(pageNo, pageSize);
IPage<PmMonitoringDevice> pageList = pmMonitoringDeviceService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param pmMonitoringDevice
* @return
*/
@AutoLog(value = "pm_monitoring_device-添加")
@ApiOperation(value="pm_monitoring_device-添加", notes="pm_monitoring_device-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody PmMonitoringDevice pmMonitoringDevice) {
pmMonitoringDeviceService.save(pmMonitoringDevice);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param pmMonitoringDevice
* @return
*/
@AutoLog(value = "pm_monitoring_device-编辑")
@ApiOperation(value="pm_monitoring_device-编辑", notes="pm_monitoring_device-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody PmMonitoringDevice pmMonitoringDevice) {
pmMonitoringDeviceService.updateById(pmMonitoringDevice);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "pm_monitoring_device-通过id删除")
@ApiOperation(value="pm_monitoring_device-通过id删除", notes="pm_monitoring_device-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
pmMonitoringDeviceService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "pm_monitoring_device-批量删除")
@ApiOperation(value="pm_monitoring_device-批量删除", notes="pm_monitoring_device-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.pmMonitoringDeviceService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "pm_monitoring_device-通过id查询")
@ApiOperation(value="pm_monitoring_device-通过id查询", notes="pm_monitoring_device-通过id查询")
@GetMapping(value = "/queryById")
public Result<PmMonitoringDevice> queryById(@RequestParam(name="id",required=true) String id) {
PmMonitoringDevice pmMonitoringDevice = pmMonitoringDeviceService.getById(id);
if(pmMonitoringDevice==null) {
return Result.error("未找到对应数据",null);
}
return Result.OK(pmMonitoringDevice);
}
/**
* 导出excel
*
* @param request
* @param pmMonitoringDevice
*/
* 导出excel
*
* @param request
* @param pmMonitoringDevice
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PmMonitoringDevice pmMonitoringDevice) {
return super.exportXls(request, pmMonitoringDevice, PmMonitoringDevice.class, "pm_monitoring_device");
return super.exportXls(request, pmMonitoringDevice, PmMonitoringDevice.class, "视频安防");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, PmMonitoringDevice.class);
......
......@@ -72,7 +72,6 @@ public class AlarmQuery implements Serializable {
@ApiModelProperty(value = "修改时间")
private Date modifyTime;
/**删除状态*/
@Excel(name = "删除状态", width = 15)
@ApiModelProperty(value = "删除状态")
private Boolean deleted;
}
......@@ -39,7 +39,6 @@ public class PmAccessControlDeviceRecord implements Serializable {
/**
* 门禁设备Id
*/
@Excel(name = "门禁设备Id", width = 15)
@ApiModelProperty(value = "门禁设备Id")
private Long pmAccessControlDeviceId;
......@@ -59,7 +58,7 @@ public class PmAccessControlDeviceRecord implements Serializable {
/**
* 状态
*/
@Excel(name = "状态", width = 15,dicCode = "access_control_classify")
@Excel(name = "员工归类", width = 15,dicCode = "access_control_classify")
@Dict(dicCode = "access_control_classify")
@ApiModelProperty(value = "员工归类 1:员工 2:访客 3:租户")
private Integer classify;
......
package org.jeecg.pm.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: pm_monitoring_device
* @Author: jeecg-boot
* @Date: 2022-03-15
* @Date: 2022-05-25
* @Version: V1.0
*/
@Data
@TableName(value = "pm_monitoring_device", autoResultMap = true)
@TableName("pm_monitoring_device")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "pm_monitoring_device对象", description = "pm_monitoring_device")
@ApiModel(value="pm_monitoring_device对象", description="pm_monitoring_device")
public class PmMonitoringDevice implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private Long id;
/**
* 设备编码
*/
@Excel(name = "设备编码", width = 15)
/**区域名称*/
@Excel(name = "区域名称", width = 15)
@ApiModelProperty(value = "区域名称")
private String districtName;
/**设备名称*/
@Excel(name = "设备名称", width = 15)
@ApiModelProperty(value = "设备名称")
private String name;
/**设备编码*/
@Excel(name = "设备编码", width = 15)
@ApiModelProperty(value = "设备编码")
private String code;
/**
* 设备类型
*/
@Excel(name = "设备类型", width = 15)
/**设备类型*/
@Excel(name = "设备类型", width = 15,dicCode = "monitoring_type")
@ApiModelProperty(value = "设备类型")
@Dict(dicCode = "monitoring_type")
private String type;
/**
* 设备名称
*/
@Excel(name = "设备名称", width = 15)
@ApiModelProperty(value = "设备名称")
private String name;
/**
* 设备ip
*/
@Excel(name = "设备ip", width = 15)
/**设备ip*/
@Excel(name = "设备ip", width = 15)
@ApiModelProperty(value = "设备ip")
private String ip;
/**
* 楼栋
*/
@Excel(name = "楼栋", width = 15)
@ApiModelProperty(value = "楼栋")
private String buildingName;
/**
* 楼层
*/
@Excel(name = "楼层", width = 15)
@ApiModelProperty(value = "楼层")
private String floor;
/**
* 设备位置
*/
@Excel(name = "设备位置", width = 15)
@ApiModelProperty(value = "设备位置")
private String place;
/**
* xy值
*/
@Excel(name = "xy值", width = 15)
/**所属设备*/
@Excel(name = "所属设备", width = 15)
@ApiModelProperty(value = "所属设备")
private String theirEquipment;
/**xy值*/
@Excel(name = "xy值", width = 15)
@ApiModelProperty(value = "xy值")
@TableField(typeHandler = Coordinate.TypeHandler.class)
private Coordinate coordinate;
/**
* 生产日期
*/
@Excel(name = "生产日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "生产日期")
private Date dateOfProduction;
/**
* 安装日期
*/
@Excel(name = "安装日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "安装日期")
private Date installationDate;
/**
* 保修截止日期
*/
@Excel(name = "保修截止日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "保修截止日期")
private Date warrantyPeriod;
/**
* 生产厂商
*/
@Excel(name = "生产厂商", width = 15)
@ApiModelProperty(value = "生产厂商")
private String manufacturer;
/**
* 状态
*/
@Excel(name = "状态", width = 15)
@ApiModelProperty(value = "状态")
private Status status;
/**
* 创建人Id(sys_user)
*/
@Excel(name = "创建人Id(sys_user)", width = 15)
private String coordinate;
/**状态 1:正常 2:离线 3:维修*/
@Excel(name = "状态", width = 15,dicCode = "access_control_status")
@ApiModelProperty(value = "状态 1:正常 2:离线 3:维修")
@Dict(dicCode = "access_control_status")
private String status;
/**端口*/
@Excel(name = "端口", width = 15)
@ApiModelProperty(value = "端口")
private String port;
/**通道号*/
@Excel(name = "通道号", width = 15)
@ApiModelProperty(value = "通道号")
private String chanelNum;
/**创建人Id(sys_user)*/
@Excel(name = "创建人", width = 15,dictTable = "sys_user", dicText = "realname", dicCode = "id")
@ApiModelProperty(value = "创建人Id(sys_user)")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
private String createUserId;
/**
* 修改人Id(sys_user)
*/
@Excel(name = "修改人Id(sys_user)", width = 15)
/**修改人Id(sys_user)*/
@ApiModelProperty(value = "修改人Id(sys_user)")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
private String modifyUserId;
/**
* 删除状态
*/
@Excel(name = "删除状态", width = 15)
@ApiModelProperty(value = "删除状态")
private Boolean deleted;
/**
* 创建时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd hh:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd")
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* 修改时间
*/
@Excel(name = "修改时间", width = 15, format = "yyyy-MM-dd hh:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd hh:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd")
/**修改时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "修改时间")
private Date modifyTime;
public enum Status {
NORMAL,
OFFLINE,
BREAKDOWN
}
/**删除状态*/
@ApiModelProperty(value = "删除状态")
private Boolean deleted;
}
......@@ -6,7 +6,7 @@ import org.jeecg.pm.entity.PmMonitoringDevice;
/**
* @Description: pm_monitoring_device
* @Author: jeecg-boot
* @Date: 2022-03-15
* @Date: 2022-05-25
* @Version: V1.0
*/
public interface PmMonitoringDeviceMapper extends BaseMapper<PmMonitoringDevice> {
......
......@@ -3,14 +3,12 @@ package org.jeecg.pm.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.pm.entity.PmMonitoringDevice;
import java.util.List;
/**
* @Description: pm_monitoring_device
* @Author: jeecg-boot
* @Date: 2022-03-15
* @Date: 2022-05-25
* @Version: V1.0
*/
public interface IPmMonitoringDeviceService extends IService<PmMonitoringDevice> {
List<PmMonitoringDevice> listByFloorId(Long floorId);
}
package org.jeecg.pm.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.pm.entity.PmMonitoringDevice;
import org.jeecg.pm.hikvision.sdk.client.HikvisionClient;
import org.jeecg.pm.mapper.PmMonitoringDeviceMapper;
import org.jeecg.pm.service.IPmMonitoringDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: pm_monitoring_device
* @Author: jeecg-boot
* @Date: 2022-03-15
* @Date: 2022-05-25
* @Version: V1.0
*/
@Service
public class PmMonitoringDeviceServiceImpl extends ServiceImpl<PmMonitoringDeviceMapper, PmMonitoringDevice> implements IPmMonitoringDeviceService {
@Autowired
private HikvisionClient hikvisionClient;
@Override
public boolean save(PmMonitoringDevice entity) {
entity.setId(IdWorker.getId())
.setDeleted(false)
.setCreateTime(new Date())
.setModifyTime(new Date());
return super.save(entity);
}
@Override
public boolean updateById(PmMonitoringDevice entity) {
entity.setModifyTime(new Date());
return super.updateById(entity);
}
@Override
public boolean removeById(Serializable id) {
return update(
new UpdateWrapper<PmMonitoringDevice>()
.lambda()
.eq(PmMonitoringDevice::getId, id)
.set(PmMonitoringDevice::getDeleted, true)
.set(PmMonitoringDevice::getModifyTime, new Date()));
}
@Override
public List<PmMonitoringDevice> listByFloorId(Long floorId) {
new QueryWrapper<PmMonitoringDevice>()
.lambda()
.eq(PmMonitoringDevice::getFloor, floorId);
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment