| | |
| | | |
| | | # VUE_APP_API_URL = 'https://atwl.ahzyssl.com/zhyq_interface' |
| | | |
| | | VUE_APP_API_URL = 'http://localhost:10010' |
| | | # VUE_APP_API_URL = 'http://192.168.1.45:10010' |
| | | |
| | | #VUE_APP_API_URL = 'http://192.168.0.7/system_gateway' |
| | | |
| | | # VUE_APP_API_URL = 'http://localhost:10010' |
| | | |
| | | # VUE_APP_API_URL = 'https://atwl.ahzyssl.com/zhyq_interface' |
| | | VUE_APP_API_URL = 'http://localhost:10010' |
| | | |
| | | #key:045542fc5f436b75e6c911c5c84ff8cd |
| | | #密钥:8bd38497f9aee2b75e7a888a4dfd1e6c |
| | |
| | | VUE_APP_AMAP_KEY='045542fc5f436b75e6c911c5c84ff8cd' |
| | | |
| | | |
| | | |
| | |
| | | export function getList (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/device/getList', data) |
| | | } |
| | | export function allList (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/device/list', data) |
| | | } |
| | | export function getDeviceRoleList (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/deviceRole/list', data) |
| | | } |
| | |
| | | return request.post('/visitsAdmin/cloudService/business/warningRule/create', data) |
| | | } |
| | | export function updateStatus (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/warning/updateStatus', data) |
| | | return request.post('/visitsAdmin/cloudService/business/warningRule/updateStatus', data) |
| | | } |
| | | // 修改 |
| | | export function updateById (data) { |
| | |
| | | <span style="margin-left: 20px;">单位:分钟</span> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="酒精检测" prop="doubleAuth"> |
| | | <div style="width: 100%; display: flex; align-items: center;"> |
| | | <el-switch |
| | | v-model="form.alcoholStatus" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | :active-value="0" |
| | | :inactive-value="1"> |
| | | </el-switch> |
| | | <span style="margin-left: 20px; color: #999999;">开启后,需要酒精检测通过后,才能开门</span> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="双重验证" prop="doubleAuth"> |
| | | <div style="width: 100%; display: flex; align-items: center;"> |
| | | <el-switch |
| | |
| | | noLength: '', |
| | | noIndex: '', |
| | | sortType: 0, |
| | | activateFile: null |
| | | activateFile: null, |
| | | alcoholStatus: 0 |
| | | }, |
| | | // 验证规则 |
| | | rules: { |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | width="50%" |
| | | width="80%" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | |
| | | 2.发生区域非必填,不填则表示该规则下所有区域的相应报警类型均通知;<br> |
| | | </p> |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="选择签到通知人员" prop="memberIds" style="margin-bottom: 30px" > |
| | | <el-select v-model="memberSelect" filterable multiple clearable placeholder="请选择" @change="changeMembers"> |
| | | <el-option v-for="item in memberList" :key="'member_'+item.id" :label="item.name+'-'+item.companyName" :value="item.id+''"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <div style="display: flex;" v-for="(item,index) in form.detailList" :key="'region_'+item.random" > |
| | | <div style="display: flex;" v-for="(item,index) in form.detailList" :key="'warning_'+index" > |
| | | <span style="line-height: 32px;font-size: 14px;"><b style="color: #F56C6C;margin-right: 4px;font-size: 11px;">*</b>{{'规则'+(index +1)}}</span> |
| | | <el-form-item label="" style="display: inline-block;margin-left: 10px; " > |
| | | <el-select v-model="item.warningId" filterable placeholder="请选择报警类型" > |
| | |
| | | </el-form-item> |
| | | <el-button type="danger" style="margin-left: 10px;height: 32px; " @click="delDo(index)" v-if="index>0 || form.detailList.length>1">删除</el-button> |
| | | </div> |
| | | <el-button type="primary" style="margin-left: 10px;margin-bottom: 20px;" @click="addDo">增加规则</el-button> |
| | | <el-form-item label="" prop="detailList" style="width: 150px"> |
| | | <el-button type="primary" style="margin-left: 10px;margin-bottom: 20px;" @click="addDo">增加规则</el-button> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio :label="0" :value="0">禁用</el-radio> |
| | |
| | | <el-form-item label="发生间隔时间(秒)" prop="intervalSec"> |
| | | <el-input type="number" v-model="form.intervalSec" placeholder="请输入多规则间隔时间(秒)" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="钉钉通知" prop="memberNotice" > |
| | | <el-switch style="margin-right:30px;width:100px" v-model="form.memberNotice" :active-value="1" :inactive-value="0" active-text="开" inactive-text="关"></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="选择钉钉通知人员" v-if="form.memberNotice ==1" prop="memberIds" style="margin-bottom: 30px" > |
| | | <el-select v-model="memberSelect" filterable multiple clearable placeholder="请选择" @change="changeMembers"> |
| | | <el-option v-for="item in memberList" :key="'member_'+item.id" :label="item.name+'-'+item.companyName" :value="item.id+''"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="广播通知" prop="deviceNotice" > |
| | | <el-switch style="margin-right:30px;width: 100px" v-model="form.deviceNotice" :active-value="1" :inactive-value="0" active-text="开" inactive-text="关">></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="选择播报广播" v-if="form.deviceNotice ==1" prop="deviceIds" style="margin-bottom: 30px" > |
| | | <el-select v-model="deviceSelect" filterable multiple clearable placeholder="请选择" @change="changeDevices"> |
| | | <el-option v-for="item in deviceList" :key="'device_'+item.id" :label="item.name" :value="item.id+''"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="广播播报内容" v-if="form.deviceNotice ==1" prop="deviceNoticeContent"> |
| | | <el-input type="text" v-model="form.deviceNoticeContent" placeholder="请输入播报内容" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | | </template> |
| | |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { allList } from '@/api/business/member' |
| | | import { allList as allDveiceList } from '@/api/business/device' |
| | | import { allList as warningList, regionList } from '@/api/business/warning' |
| | | export default { |
| | | name: 'OperaWarningRuleWindow', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | var validIdDetals = (rule, value, callback) => { |
| | | if (this.form.detailList == null || this.form.detailList.length==0) { |
| | | callback(new Error('请配置规则')) |
| | | return |
| | | } |
| | | for (let i = 0; i < this.form.detailList.length; i++) { |
| | | var item = this.form.detailList[i] |
| | | if (!item || item.warningId === undefined || !item.warningId || item.warningId == null) { |
| | | callback(new Error('请正确配置规则')) |
| | | return |
| | | } |
| | | } |
| | | callback() |
| | | } |
| | | return { |
| | | // 表单数据 |
| | | form: { |
| | | id: null, |
| | | memberIds: '', |
| | | deviceIds: '', |
| | | deviceNoticeContent: '', |
| | | deviceNotice: 1, |
| | | memberNotice: 1, |
| | | intervalSec: '', |
| | | sortnum: '', |
| | | status: 0, |
| | | detailList: [{ random:Math.random(),regionId: null, regionName: null, regionCode: null ,warningId:null}] |
| | | detailList: [{ random: Math.random(), regionId: null, regionName: null, regionCode: null, warningId: null }] |
| | | }, |
| | | deviceSelect: [], |
| | | memberSelect: [], |
| | | memberList: [], |
| | | deviceList: [], |
| | | warningList: [], |
| | | regionList: [], |
| | | // 验证规则 |
| | | rules: { |
| | | memberIds: [{ required: true, message: '请选择通知人员', tigger: 'blur' }], |
| | | status: [{ required: true, message: '请选择状态'}] |
| | | detailList: [{ required: true, validator: validIdDetals, message: '请正确配置规则', tigger: 'blur' }], |
| | | memberNotice: [{ required: true, message: '请选择钉钉通知' }], |
| | | deviceNotice: [{ required: true, message: '请选择是否广播通知' }], |
| | | deviceIds: [{ required: true, message: '请选择播报广播'}], |
| | | memberIds: [{ required: true, message: '请选择通知人员'}], |
| | | status: [{ required: true, message: '请选择状态' }] |
| | | } |
| | | } |
| | | }, |
| | |
| | | children: node.childList |
| | | } |
| | | }, |
| | | changeSel(opt){ |
| | | changeSel (opt) { |
| | | var item = this.form.detailList[opt] |
| | | this.form.detailList[opt].regionCode = null |
| | | this.form.detailList[opt].regionName = null |
| | | if(item.regionId){ |
| | | if (item.regionId) { |
| | | var reg = this.getSelectedObject(item.regionId) |
| | | if(reg){ |
| | | if (reg) { |
| | | this.form.detailList[opt].regionCode = reg.indexCode |
| | | this.form.detailList[opt].regionName = reg.name |
| | | } |
| | | } |
| | | console.log(" this.form.detailList[opt]",reg, this.form.detailList[opt]) |
| | | console.log(' this.form.detailList[opt]', reg, this.form.detailList[opt]) |
| | | }, |
| | | getSelectedObject(id) { |
| | | getSelectedObject (id) { |
| | | if (!id) { |
| | | return null // 没有选中项时返回 null 或 {} 根据需要处理 |
| | | return null // 没有选中项时返回 null 或 {} 根据需要处理 |
| | | } |
| | | const findSelected = (options) => { |
| | | for (const option of options) { |
| | |
| | | if (found) return found // 如果找到返回该对象 |
| | | } |
| | | } |
| | | return null; // 未找到返回 null 或 {} 根据需要处理 |
| | | return null // 未找到返回 null 或 {} 根据需要处理 |
| | | } |
| | | return findSelected(this.regionList); // 开始搜索并返回结果 |
| | | return findSelected(this.regionList) // 开始搜索并返回结果 |
| | | }, |
| | | addDo () { |
| | | this.form.detailList.push({random:Math.random(), regionId: null, regionName: null, regionCode: null,warningId:null }) |
| | | this.form.detailList.push({ random: Math.random(), regionId: null, regionName: null, regionCode: null, warningId: null }) |
| | | }, |
| | | delDo (index) { |
| | | if (this.form.detailList.length > 1 && this.form.detailList.length > index) { |
| | |
| | | } |
| | | this.form.memberIds = this.memberSelect.join(',') |
| | | }, |
| | | changeDevices () { |
| | | console.log(this.deviceSelect) |
| | | this.form.deviceIds = '' |
| | | if (!this.deviceSelect || !this.deviceSelect.length) { |
| | | return |
| | | } |
| | | this.form.deviceIds = this.deviceSelect.join(',') |
| | | }, |
| | | open (title, target) { |
| | | this.memberSelect =[] |
| | | this.memberSelect = [] |
| | | this.deviceSelect = [] |
| | | this.title = title |
| | | this.loadMember() |
| | | this.loadDevice() |
| | | this.loadRegions() |
| | | this.loadWarning() |
| | | this.visible = true |
| | | this.form = { |
| | | id: null, |
| | | memberIds: '', |
| | | deviceIds: '', |
| | | intervalSec: '', |
| | | sortnum: '', |
| | | deviceNotice: 1, |
| | | deviceNoticeContent: '', |
| | | memberNotice: 1, |
| | | status: 0, |
| | | detailList: [{ random:Math.random(),regionId: null, regionName: null, regionCode: null,warningId:null }] |
| | | detailList: [{ random: Math.random(), regionId: null, regionName: null, regionCode: null, warningId: null }] |
| | | } |
| | | // 新建 |
| | | if (target == null) { |
| | |
| | | this.$refs.form.resetFields() |
| | | this.form[this.configData['field.id']] = null |
| | | }) |
| | | |
| | | return |
| | | } |
| | | // 编辑 |
| | | this.$nextTick(() => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | this.form.memberNotice = this.form.memberNotice || 0 |
| | | this.form.deviceNotice = this.form.deviceNotice || 0 |
| | | this.form.status = this.form.status || 0 |
| | | } |
| | | if (!this.form.detailList || !this.form.detailList.length) { |
| | | this.form.detailList = [{ random:Math.random(),regionId: null, regionName: null, regionCode: null,warningId:null }] |
| | | this.form.detailList = [{ random: Math.random(), regionId: null, regionName: null, regionCode: null, warningId: null }] |
| | | } |
| | | if(this.form.memberIds){ |
| | | this.memberSelect = this.form.memberIds.split(",") |
| | | if (this.form.memberIds) { |
| | | this.memberSelect = this.form.memberIds.split(',') |
| | | } |
| | | if (this.form.deviceIds) { |
| | | this.deviceSelect = this.form.deviceIds.split(',') |
| | | } |
| | | }) |
| | | }, |
| | |
| | | this.memberList = res |
| | | }) |
| | | }, |
| | | loadDevice () { |
| | | allDveiceList({ |
| | | type: 4 |
| | | }).then(res => { |
| | | this.deviceList = res |
| | | }) |
| | | }, |
| | | loadWarning () { |
| | | warningList({ |
| | | }).then(res => { |
| | |
| | | <div class="line"> |
| | | <span>用车时段</span> |
| | | <span> |
| | | {{ item.startTime.slice(5, 16) }}至{{ |
| | | item.endTime.slice(5, 16) |
| | | }}</span> |
| | | {{ item.startTime.slice(5, 16) }}至{{ item.endTime.slice(5, 16) }}</span> |
| | | </div> |
| | | <div class="line"> |
| | | <span>目的地</span> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="editDate" label="最近更新时间"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:devicerole:update', 'business:devicerole:delete'])" |
| | | label="操作" |
| | | align="center" |
| | | min-width="120" |
| | |
| | | <el-table-column prop="channelNo" label="通道号"></el-table-column> |
| | | <el-table-column prop="regionName" label="区域名称"></el-table-column> |
| | | <el-table-column prop="hkDate" label="同步时间"></el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | align="center" |
| | | min-width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="send(row)" icon="el-icon-edit" >发送播报</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | |
| | | </pagination> |
| | | </template> |
| | | <!-- 新建/修改 --> |
| | | <!-- <OperaDeviceWindow ref="operaDeviceWindow" @success="handlePageChange"/>--> |
| | | <el-dialog |
| | | :visible.sync="visibleSend" |
| | | style="z-index: 100000" |
| | | append-to-body |
| | | width="50%" |
| | | height="50%" |
| | | :title="'发送播报-'+ form.name" |
| | | > |
| | | <el-form :model="form" ref="form" > |
| | | <el-form-item label="播报内容" prop="name" required> |
| | | <el-input v-model="form.sendInfo" type="textarea" placeholder="请输入播报内容" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template v-slot:footer > |
| | | <el-button @click="sendBobao()" type="primary" :loading="isWorkSending">确认</el-button> |
| | | <el-button @click="sendClose()">返回</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaDeviceWindow from '@/components/business/OperaDeviceWindow' |
| | | import { syncDevices, updateEntranceById } from '@/api/business/device' |
| | | export default { |
| | | name: 'Device', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaDeviceWindow }, |
| | | components: { TableLayout, Pagination }, |
| | | data () { |
| | | return { |
| | | // 搜索 |
| | |
| | | online: '', |
| | | type: 3 |
| | | }, |
| | | isWorkSending: false, |
| | | form: { |
| | | sendInfo: '', |
| | | id: '', |
| | | hkId: '', |
| | | name: '' |
| | | }, |
| | | visibleSend: false, |
| | | options: [] |
| | | } |
| | | }, |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | changeManufature(e, row) { |
| | | sendBobao () { |
| | | if (!this.form.sendInfo) { |
| | | return |
| | | } |
| | | this.$dialog.actionConfirm('确认进行广播播报吗?', '操作确认提醒') |
| | | .then(() => { |
| | | this.isWorkSending = true |
| | | this.api.sendBobao(this.form) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || '播报请求成功') |
| | | this.sendClose() |
| | | }) |
| | | .catch(e => { |
| | | }) |
| | | .finally(() => { |
| | | this.isWorkSending = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | send (row) { |
| | | this.visibleSend = true |
| | | this.form = { sendInfo: '', id: row.id, hkId: row.hkId, name: row.name } |
| | | }, |
| | | sendClose () { |
| | | this.visibleSend = false |
| | | this.isWorkSending = false |
| | | this.form = { sendInfo: '', id: '', hkId: '', name: '' } |
| | | }, |
| | | changeManufature (e, row) { |
| | | updateEntranceById({ |
| | | id: row.id, |
| | | isEntrance: e |
| | |
| | | this.$dialog.actionConfirm('操作确认提醒', '您确认同步全部信息吗?') |
| | | .then(() => { |
| | | this.isWorking.delete = true |
| | | syncDevices({type: 3}) |
| | | syncDevices({ type: 3 }) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || '同步成功') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | // this.$tip.apiFailed(e) |
| | | // this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.delete = false |
| | |
| | | <el-form-item label="人员/部门" prop="memberNames"> |
| | | <el-input v-model="searchForm.memberNames" placeholder="请输入人员或部门名" clearable @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="广播名称" prop="memberNames"> |
| | | <el-input v-model="searchForm.deviceNames" placeholder="请输入广播名称" clearable @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status" > |
| | | <el-select v-model="searchForm.status" placeholder="请选择状态" clearable @change="search"> |
| | | <el-option label="禁用" value="0"></el-option> |
| | |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="title" label="报警规则" min-width="200px" show-tooltip-when-overflow></el-table-column> |
| | | <el-table-column prop="memberNames" label="报警接收人" min-width="200px" show-tooltip-when-overflow></el-table-column> |
| | | <el-table-column prop="memberNames" label="报警接收人" min-width="200px" show-tooltip-when-overflow> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.memberNotice === 1">{{row.memberNames}}</span> |
| | | <span v-else class="red">未开启</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceNames" label="报警播报广播" min-width="200px" show-tooltip-when-overflow> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.deviceNotice === 1">{{row.deviceNames}}</span> |
| | | <span v-else class="red">未开启</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="intervalSec" label="间隔时间(秒)" min-width="100px" ></el-table-column> |
| | | <el-table-column prop="status" label="状态" min-width="100px" > |
| | | <template slot-scope="{row}"> |
| | |
| | | searchForm: { |
| | | title: '', |
| | | memberNames: '', |
| | | deviceNames: '', |
| | | status:'', |
| | | } |
| | | } |
| | |
| | | import org.apache.http.client.ClientProtocolException; |
| | | import org.apache.http.client.CredentialsProvider; |
| | | import org.apache.http.client.config.RequestConfig; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpDelete; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.client.methods.HttpRequestBase; |
| | | import org.apache.http.client.methods.*; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.BasicCredentialsProvider; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | |
| | | httpRequestBase.setConfig(requestConfig); |
| | | } |
| | | |
| | | public static String doPostHk(String host,int port,String UserName,String Password,String url, String Input) { |
| | | public static String doPutHk(String host,int port,String UserName,String Password,String url, String Input) { |
| | | try { |
| | | CloseableHttpResponse responseBody = null; |
| | | HttpPost httpPost = new HttpPost("http://"+host+":"+port+url); |
| | | setRequestConfig(httpPost); |
| | | httpPost.setEntity(new StringEntity(Input, "UTF-8")); |
| | | HttpPut httpPut = new HttpPut("http://"+host+":"+port+url); |
| | | log.error("====================海康isapi接口:http://"+host+":"+port+url); |
| | | httpPut.setHeader("Content-Type", "application/json"); |
| | | setRequestConfig(httpPut); |
| | | httpPut.setEntity(new StringEntity(Input, "UTF-8")); |
| | | CredentialsProvider credsProvider = new BasicCredentialsProvider(); |
| | | credsProvider.setCredentials(new AuthScope(host, port), |
| | | new UsernamePasswordCredentials(UserName, Password)); |
| | |
| | | String response = ""; |
| | | |
| | | // 由客户端执行(发送)Post请求 |
| | | responseBody = httpClient.execute(httpPost); |
| | | responseBody = httpClient.execute(httpPut); |
| | | // 从响应模型中获取响应实体 |
| | | HttpEntity responseEntity = responseBody.getEntity(); |
| | | log.error("doPostHk响应状态为:" + responseBody.getStatusLine()); |
| | |
| | | String redirectLocation = responseBody.getHeaders("Location")[0].getValue(); |
| | | log.error("doPostHkRedirected to: " + redirectLocation); |
| | | // 在这里,你可以发送一个新的请求到redirectLocation |
| | | httpPost.setURI(URI.create(redirectLocation)); |
| | | CloseableHttpResponse responseBody2 = httpClient.execute(httpPost); |
| | | httpPut.setURI(URI.create(redirectLocation)); |
| | | CloseableHttpResponse responseBody2 = httpClient.execute(httpPut); |
| | | log.error("doPostHk重定向后响应状态为:" + responseBody2.getStatusLine()); |
| | | HttpEntity responseEntity2 = responseBody2.getEntity(); |
| | | log.error("doPostHk重定向后响应内容长度为:" + responseEntity2.getContentLength()); |
| | |
| | | public ApiResponse<PageData<Device>> findPage (@RequestBody PageWrap<Device> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(deviceService.findPage(pageWrap)); |
| | | } |
| | | @ApiOperation("查询全部") |
| | | @PostMapping("/list") |
| | | @CloudRequiredPermission("business:device:query") |
| | | public ApiResponse<List<Device>> findPage (@RequestBody Device model,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(deviceService.findList(model)); |
| | | } |
| | | |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcel") |
| | |
| | | //同步LED |
| | | result = hkSyncDeviceService.syncHkLed(param); |
| | | }else if(Constants.equalsInteger(param.getType(),Constants.THREE)){ |
| | | //同步广播 |
| | | //同步广播点 |
| | | result = hkSyncDeviceService.syncHkBroadcast(param); |
| | | }else if(Constants.equalsInteger(param.getType(),Constants.FOUR)){ |
| | | //同步广播 |
| | |
| | | param.setWithCameras(0); |
| | | List<PageRegionInfoResponse> result = new ArrayList<>(); |
| | | try { |
| | | // result = boardService.getRegionTree( param); |
| | | result = boardService.getRegionTree( param); |
| | | //------TODO---------测试模拟数据----start----- |
| | | for (int i = 0; i < 5; i++) { |
| | | /* for (int i = 0; i < 5; i++) { |
| | | PageRegionInfoResponse t = new PageRegionInfoResponse(); |
| | | t.setName("总区域_"+i); |
| | | t.setIndexCode(i+"_code"); |
| | |
| | | t.getChildList().add(t1); |
| | | } |
| | | result.add(t); |
| | | } |
| | | }*/ |
| | | //------TODO---------测试模拟数据----end----- |
| | | }catch (Exception e){ |
| | | |
| | |
| | | return ApiResponse.success( deviceService.setBroadcaseBobaoHttp(body)); |
| | | } |
| | | @ApiOperation("【海康】广播播报") |
| | | @PostMapping("/sendBobaoOpenapi") |
| | | @PostMapping("/sendBobaoOpenApi") |
| | | public ApiResponse<List<Map<String,Object>>> sendBobaoOpenapi(@RequestBody Device body , HttpServletResponse response) { |
| | | deviceService.setBroadcaseBobao(body); |
| | | return ApiResponse.success(null); |
| | |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.Warning; |
| | | import com.doumee.dao.business.model.WarningRule; |
| | | import com.doumee.service.business.WarningRuleService; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | |
| | | public ApiResponse findById(@PathVariable Integer id, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(warningRuleService.findById(id)); |
| | | } |
| | | @ApiOperation("根据ID 禁启用 ") |
| | | @PostMapping("/updateStatus") |
| | | @CloudRequiredPermission("business:warningrule:update") |
| | | public ApiResponse updateStatus(@RequestBody WarningRule param, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | param.setLoginUserInfo(this.getLoginUser(token)); |
| | | warningRuleService.updateStatus(param); |
| | | return ApiResponse.success(null); |
| | | } |
| | | } |
| | |
| | | String[] minitorDataSearch= new String[]{"/api/fpms/v2/minitor/data/search","分页查询设备监测历史数据"};//分页查询设备监测历史数据 |
| | | String[] monitorDataSearch= new String[]{"/api/fpms/v2/monitor/data/search","分页查询设备监测历史数据"};//分页查询设备监测历史数据 |
| | | String[] fireMonitorData= new String[]{"/api/v2/monitor/fireMonitorData","分页查询设备监测历史数据"};//分页查询设备监测历史数据 |
| | | |
| | | String[] userOpenidSave= new String[]{"/api/v1/oa/userOpenId/saveV2","保存用户及openId绑定信息微信公众号"};//保存用户及openId绑定信息微信公众号 |
| | | String[] userOpenidDel= new String[]{"/api/v1/oa/userOpenId/delete","通过openId或userName等删除绑定信息"};//通过openId或userName等删除绑定信息 |
| | | String[] temperatureHumidityDataStatistic= new String[]{"/api/v2/public/monitor/sensor/list","消防看板-4温湿度统计"};//消防看板-温湿度 |
| | |
| | | private Integer state ;//Number false 广播点在线状态0-在线 1-离线 |
| | | private String regionName ;//String false 区域名称 |
| | | private String volume ;//String false 广播点音量 |
| | | |
| | | private String ip ;//String false ip地址 |
| | | private String port ;//String false 端口 |
| | | private Integer isMachineSync ;//Number false 是否广播主机数据,1-同步数据,0-本级数据 |
| | | private Integer isCascadeSync;// Number false 是否广播级联数据,1-同步数据,0-本级数据 |
| | | |
| | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class FetchAudioDeviceInfoResponse { |
| | | |
| | |
| | | private String deviceCode ;//String false 设备主动注册编码 |
| | | private String deviceUseType ;//String false 设备功能类型loudspeaker: '网络功放', box: '网络音箱', microphone: '网络寻呼话筒', machine: '广播主机' |
| | | private String desc ;//String false 广播设备描述信息 |
| | | |
| | | private List<FetchAudioChannelInfoResponse> channels; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | |
| | | import java.util.Collection; |
| | | |
| | |
| | | * @author 江蹄蹄 |
| | | * @date 2023/11/30 15:33 |
| | | */ |
| | | public interface DeviceMapper extends BaseMapper<Device> { |
| | | public interface DeviceMapper extends MPJBaseMapper<Device> { |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="起始编码") |
| | | private Integer noIndex; |
| | | |
| | | @ApiModelProperty(value = "酒精检测开启:0=开启;1=关闭", example = "1") |
| | | private Integer alcoholStatus; |
| | | |
| | | @ApiModelProperty(value = "经纬度信息 参数值:经度,纬度") |
| | | @TableField(exist = false) |
| | | private String jwd; |
| | |
| | | @ApiModelProperty(value = "状态 0禁用 1启用", example = "1") |
| | | @ExcelColumn(name="状态 0禁用 1启用") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "是否人员通知 0否 1是", example = "1") |
| | | private Integer memberNotice; |
| | | @ApiModelProperty(value = "是否广播通知 0否 1是", example = "1") |
| | | private Integer deviceNotice; |
| | | |
| | | @ApiModelProperty(value = "报警类型编码(关联warning)", example = "1") |
| | | @ExcelColumn(name="报警类型编码(关联warning)") |
| | |
| | | |
| | | @ApiModelProperty(value = "通知人员-部门集合,多个英文分号隔开", example = "1") |
| | | private String memberNames; |
| | | |
| | | |
| | | @ApiModelProperty(value = "广播编码集合(关联device),多个英文逗号隔开", example = "1") |
| | | private String deviceIds; |
| | | @ApiModelProperty(value = "广播名称集合,多个英文分号隔开", example = "1") |
| | | private String deviceNames; |
| | | @ApiModelProperty(value = "广播播报内容", example = "1") |
| | | private String deviceNoticeContent; |
| | | |
| | | @ApiModelProperty(value = "人员部门", example = "1") |
| | | @TableField(exist = false) |
| | | private String companyName; |
| | |
| | | @ApiModelProperty(value = "激活文件地址") |
| | | private String activateFileUrl; |
| | | |
| | | @ApiModelProperty(value = "酒精检测开启:0=开启;1=关闭", example = "1") |
| | | private Integer alcoholStatus; |
| | | |
| | | @ApiModelProperty(value = "轮播图地址", example = "1") |
| | | private List<String> bannerList; |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.dao.business.model.Warning; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | |
| | | * @return long |
| | | */ |
| | | long count(WarningRule warningRule); |
| | | |
| | | void updateStatus(WarningRule param); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<Device> findList(Device device) { |
| | | device.setIsdeleted(Constants.ZERO); |
| | | QueryWrapper<Device> wrapper = new QueryWrapper<>(device); |
| | | return deviceMapper.selectList(wrapper); |
| | | } |
| | |
| | | } |
| | | @Override |
| | | public String setBroadcaseBobaoHttp(Device param){ |
| | | /* Device model = deviceMapper.selectById(param.getId()); |
| | | Device model = deviceMapper.selectById(param.getId()); |
| | | if(model ==null && Constants.equalsInteger(param.getType(),Constants.FOUR)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | String input = ""; |
| | | JSONObject objext = new JSONObject(); |
| | | |
| | | model.setSendInfo(param.getSendInfo()); |
| | | return sendBroadcaseBobaoHttpBiz(model); |
| | | } |
| | | public static String sendBroadcaseBobaoHttpBiz(Device model){ |
| | | //重新下发计划 |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //第一层 |
| | | JSONArray firstJsonArray = new JSONArray(); |
| | | JSONObject downJson = new JSONObject(); |
| | | downJson.put("terminalID",1); |
| | | //不填默认对所有通道下发 |
| | | JSONArray audioJsonArray = new JSONArray(); |
| | | audioJsonArray.add(1); |
| | | downJson.put("audioOutID",audioJsonArray); |
| | | firstJsonArray.add(downJson); |
| | | jsonObject.put("TerminalInfoList",firstJsonArray); |
| | | //第一层数组 |
| | | JSONArray allJsonArray = new JSONArray(); |
| | | //数组中对象 |
| | | for (WaterTimingBroadcastDO waterTimingBroadcastDO : searchList) { |
| | | JSONObject downArrayData = new JSONObject(); |
| | | downArrayData.put("audioOutID",audioJsonArray); |
| | | downArrayData.put("enabled",true); |
| | | downArrayData.put("planSchemeID",waterTimingBroadcastDO.getName()); |
| | | JSONObject executeJson = new JSONObject(); |
| | | executeJson.put("startTime", getDateStringByZones(waterTimingBroadcastDO.getStartDate())); |
| | | executeJson.put("stopTime",getDateStringByZones(waterTimingBroadcastDO.getEndDate())); |
| | | if (Constant.ONE.equals(waterTimingBroadcastDO.getPeriodType())){ |
| | | //日计划 |
| | | JSONArray executeJsonArray = new JSONArray(); |
| | | JSONObject executeJsonDataItem = new JSONObject(); |
| | | executeJsonDataItem.put("beginTime",waterTimingBroadcastDO.getStartTime()+"+08:00"); |
| | | executeJsonDataItem.put("endTime",waterTimingBroadcastDO.getEndTime()+"+08:00"); |
| | | executeJsonDataItem.put("playMode","loop"); |
| | | executeJsonDataItem.put("playNowTime",""); |
| | | executeJsonDataItem.put("planSchemeExecID",0); |
| | | JSONObject secondDownOperationJson = new JSONObject(); |
| | | if (Constant.ONE.equals(waterTimingBroadcastDO.getContentType())){ |
| | | //文本 |
| | | secondDownOperationJson.put("audioSource","speechSynthesis"); |
| | | secondDownOperationJson.put("speechSynthesisContent",waterTimingBroadcastDO.getContent()); |
| | | }else if (Constant.TWO.equals(waterTimingBroadcastDO.getContentType())){ |
| | | //音频 |
| | | secondDownOperationJson.put("audioSource","customAudio"); |
| | | String json = waterTimingBroadcastDO.getJson(); |
| | | JSONObject jsonData = JSONObject.parseObject(json); |
| | | List<Integer> hkAudioIds = new ArrayList<>(); |
| | | hkAudioIds.add(jsonData.getIntValue(waterDeviceDO.getIp())); |
| | | secondDownOperationJson.put("customAudioID",hkAudioIds); |
| | | } |
| | | secondDownOperationJson.put("audioLevel",5); |
| | | //语言类型 |
| | | secondDownOperationJson.put("TTSLanguageType","chinese"); |
| | | secondDownOperationJson.put("voiceType","female"); |
| | | secondDownOperationJson.put("audioVolume",100); |
| | | executeJsonDataItem.put("Operation",secondDownOperationJson); |
| | | executeJsonArray.add(executeJsonDataItem); |
| | | executeJson.put("dailyScheduleList",executeJsonArray); |
| | | }else { |
| | | //周计划 |
| | | JSONArray executeJsonArray = new JSONArray(); |
| | | List<String> executeTime = new ArrayList<>(); |
| | | if (Constant.ONE.equals(waterTimingBroadcastDO.getPeriodType())){ |
| | | //日计划 循环一次 |
| | | executeTime.add("1"); |
| | | }else if (Constant.TWO.equals(waterTimingBroadcastDO.getPeriodType())){ |
| | | //周计划多一个周几 |
| | | executeTime = Arrays.asList(waterTimingBroadcastDO.getExecuteTime().split(",")); |
| | | } |
| | | for (String s : executeTime) { |
| | | JSONObject executeJsonData = new JSONObject(); |
| | | if (Constant.TWO.equals(waterTimingBroadcastDO.getPeriodType())){ |
| | | //周计划多一个周几 |
| | | executeJsonData.put("dayOfWeek",Integer.parseInt(s)); |
| | | } |
| | | JSONArray executeJsonDataArray = new JSONArray(); |
| | | JSONObject executeJsonDataItem = new JSONObject(); |
| | | executeJsonDataItem.put("beginTime",waterTimingBroadcastDO.getStartTime()+"+08:00"); |
| | | executeJsonDataItem.put("endTime",waterTimingBroadcastDO.getEndTime()+"+08:00"); |
| | | executeJsonDataItem.put("playMode","loop"); |
| | | executeJsonDataItem.put("playNowTime",""); |
| | | executeJsonDataItem.put("planSchemeExecID",0); |
| | | JSONObject secondDownOperationJson = new JSONObject(); |
| | | if (Constant.ONE.equals(waterTimingBroadcastDO.getContentType())){ |
| | | //文本 |
| | | secondDownOperationJson.put("audioSource","speechSynthesis"); |
| | | secondDownOperationJson.put("speechSynthesisContent",waterTimingBroadcastDO.getContent()); |
| | | }else if (Constant.TWO.equals(waterTimingBroadcastDO.getContentType())){ |
| | | //音频 |
| | | secondDownOperationJson.put("audioSource","customAudio"); |
| | | String json = waterTimingBroadcastDO.getJson(); |
| | | JSONObject jsonData = JSONObject.parseObject(json); |
| | | List<Integer> hkAudioIds = new ArrayList<>(); |
| | | hkAudioIds.add(jsonData.getIntValue(waterDeviceDO.getIp())); |
| | | secondDownOperationJson.put("customAudioID",hkAudioIds); |
| | | } |
| | | secondDownOperationJson.put("audioLevel",5); |
| | | //语言类型 |
| | | secondDownOperationJson.put("TTSLanguageType","chinese"); |
| | | secondDownOperationJson.put("voiceType","female"); |
| | | secondDownOperationJson.put("audioVolume",10); |
| | | executeJsonDataItem.put("Operation",secondDownOperationJson); |
| | | executeJsonDataArray.add(executeJsonDataItem); |
| | | executeJsonData.put("scheduleList",executeJsonDataArray); |
| | | executeJsonArray.add(executeJsonData); |
| | | jsonObject.put("command","start"); |
| | | jsonObject.put("TTSContent",model.getSendInfo()); |
| | | jsonObject.put("audioLevel",6); |
| | | jsonObject.put("audioVolume",100); |
| | | jsonObject.put("TTSLanguageType","chinese"); |
| | | jsonObject.put("voiceType","female"); |
| | | jsonObject.put("pace",50); |
| | | JSONArray a = new JSONArray(); |
| | | a.add(1); |
| | | jsonObject.put("audioOutID",a); |
| | | String params =jsonObject.toJSONString(); |
| | | log.error("========海康广播播放入参内容 : " + params); |
| | | String result = HttpsUtil.doPutHk(model.getIp(),Integer.parseInt(StringUtils.defaultString(model.getPort(),"80")),model.getDoorId(), model.getDoorName() |
| | | ,"/ISAPI/AccessControl/EventCardLinkageCfg/TTSAudio?format=json",params); |
| | | |
| | | } |
| | | executeJson.put("weeklyScheduleList",executeJsonArray); |
| | | } |
| | | |
| | | if (Constant.ONE.equals(waterTimingBroadcastDO.getPeriodType())){ |
| | | //日计划 |
| | | downArrayData.put("dailyScheduleInfo",executeJson); |
| | | }else { |
| | | //周计划 |
| | | downArrayData.put("weklyScheduleInfo",executeJson); |
| | | } |
| | | allJsonArray.add(downArrayData); |
| | | } |
| | | jsonObject.put("broadcastPlanSchemeList",allJsonArray); |
| | | log.info("海康播放计划下发入参内容 : " + jsonObject); |
| | | |
| | | String result = HttpsUtil.doPostHk(param.getIp(),Integer.parseInt(StringUtils.defaultString(param.getPort(),"80")) |
| | | ,"/ISAPI/VideoIntercom/broadcast/AddPlanScheme?format=json",param.getDoorId(), param.getDoorName(),jsonObject.toJSONString()); |
| | | return result;*/ |
| | | return null; |
| | | log.error("========海康广播播放返回内容 : " + result); |
| | | return result; |
| | | } |
| | | @Override |
| | | public void setLedContent(TransparentChannelSingleRequest model) { |
| | |
| | | }catch (Exception e){ |
| | | log.error( "对不起,屏幕内容设置异常"+ device.getName()); |
| | | } |
| | | |
| | | } |
| | | log.error( "屏幕内容设置=======================结束========" ); |
| | | } |
| | |
| | | || CollectionUtils.isEmpty(jkCabinet.getManagerIdList()) |
| | | || CollectionUtils.isEmpty(jkCabinet.getAuthMemberIdList()) |
| | | || Objects.isNull(jkCabinet.getDoubleAuth()) |
| | | || Objects.isNull(jkCabinet.getAlcoholStatus()) |
| | | |
| | | || Objects.isNull(jkCabinet.getRowNum()) |
| | | || jkCabinet.getRowNum() <= Constants.ZERO |
| | |
| | | || CollectionUtils.isEmpty(jkCabinet.getAuthMemberIdList()) |
| | | || Objects.isNull(jkCabinet.getPort()) |
| | | || Objects.isNull(jkCabinet.getDoubleAuth()) |
| | | || Objects.isNull(jkCabinet.getAlcoholStatus()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.param.request.EventSubRequest; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.DeviceMapper; |
| | | import com.doumee.dao.business.WarningMapper; |
| | | import com.doumee.dao.business.WarningRuleDetailMapper; |
| | | import com.doumee.dao.business.dao.MemberMapper; |
| | |
| | | @Autowired |
| | | private MemberMapper memberMapper; |
| | | @Autowired |
| | | private DeviceMapper deviceMapper; |
| | | @Autowired |
| | | private WarningRuleDetailMapper warningRuleDetailMapper; |
| | | |
| | | @Override |
| | |
| | | detail.setEditor(warning.getCreator()); |
| | | } |
| | | |
| | | warning.setMemberNames( initMemberInfo(warning)); |
| | | initMemberInfo(warning); |
| | | initDeviceInfo(warning); |
| | | warning.setTitle(title); |
| | | warningRuleMapper.insert(warning); |
| | | for(WarningRuleDetail detail : warning.getDetailList()){ |
| | |
| | | } |
| | | |
| | | private String initMemberInfo(WarningRule warning) { |
| | | if(Constants.equalsInteger(warning.getMemberNotice(),Constants.ZERO)){ |
| | | return null; |
| | | } |
| | | String[] members = warning.getMemberIds().split(","); |
| | | List<Integer> mIds = new ArrayList<>(); |
| | | for(String str :members){ |
| | |
| | | warning.setMemberIds(memberIds); |
| | | warning.setMemberNames(memberNames); |
| | | return memberNames; |
| | | } |
| | | private String initDeviceInfo(WarningRule warning) { |
| | | if(Constants.equalsInteger(warning.getDeviceNotice(),Constants.ZERO)){ |
| | | return null; |
| | | } |
| | | String[] ids = warning.getDeviceIds().split(","); |
| | | List<Integer> mIds = new ArrayList<>(); |
| | | for(String str :ids){ |
| | | try { |
| | | mIds.add(Integer.parseInt(str)); |
| | | }catch (Exception e){ |
| | | } |
| | | } |
| | | if(mIds.size() ==0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请选择正确的设备信息"); |
| | | } |
| | | List<Device> list = deviceMapper.selectJoinList(Device.class,new MPJLambdaWrapper<Device>() |
| | | .selectAll(Device.class ) |
| | | .eq(Device::getIsdeleted,Constants.ZERO ) |
| | | .eq(Device::getType,Constants.FOUR ) |
| | | .in(Device::getId,mIds )); |
| | | if(list == null || list.size() ==0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请选择正确的设备信息!"); |
| | | } |
| | | String dids = ""; |
| | | String names = ""; |
| | | for(Device m : list){ |
| | | dids += (StringUtils.isNotBlank(dids)?",":"")+m.getId(); |
| | | names += StringUtils.defaultString(m.getName(),"") +"; "; |
| | | } |
| | | warning.setDeviceIds(dids); |
| | | warning.setDeviceNames(names); |
| | | return names; |
| | | } |
| | | |
| | | @Override |
| | |
| | | detail.setEditDate(warning.getCreateDate()); |
| | | detail.setEditor(warning.getCreator()); |
| | | } |
| | | warning.setMemberNames( initMemberInfo(warning)); |
| | | initMemberInfo(warning); |
| | | initDeviceInfo(warning); |
| | | warning.setTitle(title); |
| | | warningRuleMapper.updateById(warning); |
| | | for(WarningRuleDetail detail : warning.getDetailList()){ |
| | |
| | | queryWrapper.selectAll(WarningRule.class ); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getMemberNames()),WarningRule::getMemberNames, pageWrap.getModel().getMemberNames()); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getTitle()),WarningRule::getTitle, pageWrap.getModel().getTitle()); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getDeviceNames()),WarningRule::getDeviceNames, pageWrap.getModel().getDeviceNames()); |
| | | |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.eq(WarningRule::getId, pageWrap.getModel().getId()); |
| | |
| | | } |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.eq(WarningRule::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | | if (pageWrap.getModel().getMemberNotice() != null) { |
| | | queryWrapper.eq(WarningRule::getMemberNotice, pageWrap.getModel().getMemberNotice()); |
| | | } |
| | | if (pageWrap.getModel().getDeviceNotice() != null) { |
| | | queryWrapper.eq(WarningRule::getDeviceNotice, pageWrap.getModel().getDeviceNotice()); |
| | | } |
| | | if (pageWrap.getModel().getInfo() != null) { |
| | | queryWrapper.eq(WarningRule::getInfo, pageWrap.getModel().getInfo()); |
| | |
| | | QueryWrapper<WarningRule> wrapper = new QueryWrapper<>(warningRule); |
| | | return warningRuleMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void updateStatus(WarningRule param) { |
| | | WarningRule model = warningRuleMapper.selectById(param.getId()); |
| | | if (model==null || Constants.equalsInteger(model.getIsdeleted(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(Constants.equalsInteger(model.getStatus(),param.getStatus())){ |
| | | return; |
| | | } |
| | | model.setStatus(param.getStatus()); |
| | | model.setEditDate(new Date()); |
| | | model.setEditor(param.getLoginUserInfo().getId()); |
| | | warningRuleMapper.updateById(model); |
| | | } |
| | | } |
| | |
| | | model.setChannelNo(device.getChannelNo()); |
| | | model.setChannelInfo(device.getChannelType()); |
| | | model.setResourceType(device.getAudioChannelType()); |
| | | model.setIp(device.getIp()); |
| | | model.setPort(device.getPort()); |
| | | model.setDoorId(device.getParentDevIndexCode()); |
| | | model.setStatus(device.getState()); |
| | | model.setRegionName(device.getRegionName()); |
| | | model.setRemark(JSONObject.toJSONString(device)); |
| | | return model; |
| | | } |
| | | private Device initBroadcastDeviceDataByHkData(Device model, FetchAudioDeviceInfoResponse device, Date date) { |
| | |
| | | model.setHkId(device.getDeviceIndexCode()); |
| | | model.setName(device.getDeviceName()); |
| | | model.setHkStatus(Constants.ONE); |
| | | model.setType(Constants.THREE); |
| | | model.setChannelNo(device.getDeviceCode()); |
| | | model.setChannelInfo(device.getDeviceType()); |
| | | model.setType(Constants.FOUR); |
| | | model.setIp(device.getIp()); |
| | | model.setPort(device.getPort()); |
| | | // model.setChannelInfo(device.getDeviceType()); |
| | | model.setResourceType(device.getDeviceType()); |
| | | model.setStatus(Constants.ZERO); |
| | | model.setRemark(device.getDesc()); |
| | | model.setRegionName(device.getRegionIndexCode()); |
| | | if(device.getChannels()!=null &&device.getChannels().size()>0){ |
| | | model.setRegionPathName(device.getChannels().get(0).getRegionName()); |
| | | } |
| | | return model; |
| | | } |
| | | private Device initDoorDataByHkData(Device model, DoorsInfoResponse door, Date date, List<AcsDeviceInfoResponse> allHkList) { |