| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '../../utils/request' |
| | | |
| | | // æ¥è¯¢ |
| | | export function fetchList (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/platformGroup/page', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | export function allList (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/platformGroup/list', data, { |
| | | trim: true |
| | | }) |
| | | } |
| | | |
| | | // 导åºExcel |
| | | export function exportExcel (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/platformGroup/exportExcel', data, { |
| | | trim: true, |
| | | download: true |
| | | }) |
| | | } |
| | | |
| | | // å建 |
| | | export function create (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/platformGroup/create', data) |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateById (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/platformGroup/updateById', data) |
| | | } |
| | | |
| | | // å é¤ |
| | | export function deleteById (id) { |
| | | return request.get(`/visitsAdmin/cloudService/business/platformGroup/delete/${id}`) |
| | | } |
| | | |
| | | // æ¹éå é¤ |
| | | export function deleteByIdInBatch (ids) { |
| | | return request.get('/visitsAdmin/cloudService/business/platformGroup/delete/batch', { |
| | | params: { |
| | | ids |
| | | } |
| | | }) |
| | | } |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | width="50%" |
| | | :visible.sync="visible" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="å建人ç¼ç " prop="creator"> |
| | | <el-input v-model="form.creator" placeholder="请è¾å
¥å建人ç¼ç " v-trim/> |
| | | <el-form-item label="æå°åç§°ï¼" > |
| | | <span>{{form.name}}</span> |
| | | </el-form-item> |
| | | <el-form-item label="å建æ¶é´" prop="createDate"> |
| | | <el-date-picker v-model="form.createDate" value-format="yyyy-MM-dd" placeholder="请è¾å
¥å建æ¶é´"></el-date-picker> |
| | | <el-form-item label="æå°ç¼ç ï¼" prop="code"> |
| | | <el-input v-model="form.code" placeholder="请è¾å
¥æå°ç¼ç " v-trim/> |
| | | <span class="tip-warn"><i class="el-icon-warning"></i>说æï¼å¯¹åºWMSç³»ç»ä¸çç¼ç </span> |
| | | </el-form-item> |
| | | <el-form-item label="æ´æ°äººç¼ç " prop="editor"> |
| | | <el-input v-model="form.editor" placeholder="请è¾å
¥æ´æ°äººç¼ç " v-trim/> |
| | | <el-form-item label="æå±æå°åç»ï¼" prop="groupId"> |
| | | <el-select v-model="form.groupId" > |
| | | <el-option |
| | | v-for="item in groupList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ´æ°æ¶é´" prop="editDate"> |
| | | <el-date-picker v-model="form.editDate" value-format="yyyy-MM-dd" placeholder="请è¾å
¥æ´æ°æ¶é´"></el-date-picker> |
| | | <el-form-item label="广æè®¾å¤ï¼" prop="broadcastIds"> |
| | | <el-select v-model="form.broadcastIds" multiple > |
| | | <el-option |
| | | v-for="item in broadcastList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦å é¤0å¦ 1æ¯" prop="isdeleted"> |
| | | <el-input v-model="form.isdeleted" placeholder="请è¾å
¥æ¯å¦å é¤0å¦ 1æ¯" v-trim/> |
| | | <el-form-item label="LED设å¤ï¼" prop="ledIds"> |
| | | <el-select v-model="form.ledIds" multiple > |
| | | <el-option |
| | | v-for="item in ledList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥åç§°" v-trim/> |
| | | <el-form-item label="åæ¶ä½ä¸æ°éï¼" prop="workingNum" > |
| | | <el-input type="number" v-model="form.workingNum" placeholder="请è¾å
¥åæ¶ä½ä¸æ°é" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥å¤æ³¨" v-trim/> |
| | | <el-form-item label="æå°ä½ä¸æç(ä¸åª/å°æ¶)ï¼" prop="workRate"> |
| | | <el-input type="number" v-model="form.workRate" placeholder="请è¾å
¥æå°ä½ä¸æç(ä¸åª/å°æ¶)" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ 0å¯ç¨ 1ç¦ç¨" prop="status"> |
| | | <el-input v-model="form.status" placeholder="请è¾å
¥ç¶æ 0å¯ç¨ 1ç¦ç¨" v-trim/> |
| | | <el-form-item label="ä½ä¸è¶
æ¶æ¥è¦æ¶é´(åé)ï¼" prop="waitCallTime"> |
| | | <el-input type="number" v-model="form.waitCallTime" placeholder="请è¾å
¥ä½ä¸è¶
æ¶æ¥è¦æ¶é´(åé)" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="æåºç " prop="sortnum"> |
| | | <el-input v-model="form.sortnum" placeholder="请è¾å
¥æåºç " v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="æå±æå°åéç¼ç ï¼gå
³èplatform_group)" prop="groupId"> |
| | | <el-input v-model="form.groupId" placeholder="请è¾å
¥æå±æå°åéç¼ç ï¼gå
³èplatform_group)" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥ä½å¼å§æ¶é´" prop="startTime"> |
| | | <el-input v-model="form.startTime" placeholder="请è¾å
¥å·¥ä½å¼å§æ¶é´" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥ä½ç»ææ¶é´" prop="endTime"> |
| | | <el-input v-model="form.endTime" placeholder="请è¾å
¥å·¥ä½ç»ææ¶é´" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="åæ¶ä½ä¸æ°é" prop="workingNum"> |
| | | <el-input v-model="form.workingNum" placeholder="请è¾å
¥åæ¶ä½ä¸æ°é" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="çå¾
æå¥½æ¶é´(ç§ï¼" prop="wariCallTime"> |
| | | <el-input v-model="form.wariCallTime" placeholder="请è¾å
¥çå¾
æå¥½æ¶é´(ç§ï¼" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="åçè¶
æ¶æ¥è¦æ¶é´(ç§ï¼" prop="alermTime"> |
| | | <el-input v-model="form.alermTime" placeholder="请è¾å
¥åçè¶
æ¶æ¥è¦æ¶é´(ç§ï¼" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="æåäºä»¶æ¨éæ¶é´" prop="lastEventTime"> |
| | | <el-date-picker v-model="form.lastEventTime" value-format="yyyy-MM-dd" placeholder="请è¾å
¥æåäºä»¶æ¨éæ¶é´"></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="çæ§ç¹åç§°ï¼å¤ä¸ªç¨è±æéå·éå¼" prop="deviceNames"> |
| | | <el-input v-model="form.deviceNames" placeholder="请è¾å
¥çæ§ç¹åç§°ï¼å¤ä¸ªç¨è±æéå·éå¼" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="æå°å±å¹åç§°ï¼å¤ä¸ªç¨è±æéå·éå¼" prop="screenName"> |
| | | <el-input v-model="form.screenName" placeholder="请è¾å
¥æå°å±å¹åç§°ï¼å¤ä¸ªç¨è±æéå·éå¼" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="海康æ è¯" prop="hkId"> |
| | | <el-input v-model="form.hkId" placeholder="请è¾å
¥æµ·åº·æ è¯" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="å
³èæ¿ç§å
¬å¸" prop="companys"> |
| | | <el-input v-model="form.companys" placeholder="请è¾å
¥å
³èæ¿ç§å
¬å¸" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="Xåæ " prop="xpos"> |
| | | <el-input v-model="form.xpos" placeholder="请è¾å
¥Xåæ " v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="Yåæ " prop="ypos"> |
| | | <el-input v-model="form.ypos" placeholder="请è¾å
¥Yåæ " v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="宽度" prop="width"> |
| | | <el-input v-model="form.width" placeholder="请è¾å
¥å®½åº¦" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="é«åº¦" prop="height"> |
| | | <el-input v-model="form.height" placeholder="请è¾å
¥é«åº¦" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="è§åº¦" prop="angle"> |
| | | <el-input v-model="form.angle" placeholder="请è¾å
¥è§åº¦" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="海康æ è¯åæ¥æ¶é´" prop="hkData"> |
| | | <el-date-picker v-model="form.hkData" value-format="yyyy-MM-dd" placeholder="请è¾å
¥æµ·åº·æ è¯åæ¥æ¶é´"></el-date-picker> |
| | | <el-form-item label="åçè¶
æ¶æ¥è¦æ¶é´(åéï¼ï¼" prop="alermTime"> |
| | | <el-input type="number" v-model="form.alermTime" placeholder="请è¾å
¥è¯·è¾å
¥åçè¶
æ¶æ¥è¦æ¶é´(åé)" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { numRuleGtZero } from '@/utils/form' |
| | | import { allList } from '@/api/platform/platformGroup' |
| | | import { getList as deviceList } from '@/api/business/device' |
| | | export default { |
| | | name: 'OperaPlatformWindow', |
| | | extends: BaseOpera, |
| | |
| | | data () { |
| | | return { |
| | | // è¡¨åæ°æ® |
| | | groupList: [], |
| | | broadcastList: [], |
| | | ledList: [], |
| | | form: { |
| | | id: null, |
| | | creator: '', |
| | | createDate: '', |
| | | editor: '', |
| | | editDate: '', |
| | | isdeleted: '', |
| | | ledIds: null, |
| | | broadcastIds: null, |
| | | name: '', |
| | | remark: '', |
| | | status: '', |
| | | sortnum: '', |
| | | groupId: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | workingNum: '', |
| | | wariCallTime: '', |
| | | alermTime: '', |
| | | lastEventTime: '', |
| | | deviceNames: '', |
| | | screenName: '', |
| | | hkId: '', |
| | | companys: '', |
| | | xpos: '', |
| | | ypos: '', |
| | | width: '', |
| | | height: '', |
| | | angle: '', |
| | | hkData: '' |
| | | workingNum: 1, |
| | | workRate: '', |
| | | waitCallTime: '', |
| | | alermTime: '' |
| | | }, |
| | | // éªè¯è§å |
| | | rules: { |
| | | workingNum: [{ required: true, validator: numRuleGtZero, message: '请è¾å
¥åæ¶ä½ä¸æ°é,å¿
须大äº0! ', trigger: 'blur' }] |
| | | } |
| | | } |
| | | }, |
| | |
| | | api: '/platform/platform', |
| | | 'field.id': 'id' |
| | | }) |
| | | }, |
| | | methods: { |
| | | /** |
| | | * æå¼çªå£ |
| | | * @title çªå£æ é¢ |
| | | * @target ç¼è¾ç对象 |
| | | */ |
| | | open (title, target) { |
| | | this.title = title |
| | | this.visible = true |
| | | // æ°å»º |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form[this.configData['field.id']] = null |
| | | this.form.company = [] |
| | | }) |
| | | return |
| | | } |
| | | // ç¼è¾ |
| | | this.$nextTick(() => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | this.form.workingNum = this.form.workingNum || 1 |
| | | }) |
| | | this.loadGroupList() |
| | | this.loadLedList() |
| | | this.loadBroadcastList() |
| | | }, |
| | | loadGroupList () { |
| | | allList({}) |
| | | .then(res => { |
| | | this.groupList = res || [] |
| | | }) |
| | | }, |
| | | loadLedList () { |
| | | deviceList({ type: 2 }) |
| | | .then(res => { |
| | | this.ledList = res || [] |
| | | }) |
| | | }, |
| | | loadBroadcastList () { |
| | | deviceList({ type: 3 }) |
| | | .then(res => { |
| | | this.broadcastList = res || [] |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | .labelTip{ |
| | | font-size: 12px; |
| | | color: #666666; |
| | | } |
| | | </style> |
| | |
| | | |
| | | export function numRule (rule, value, callback) { |
| | | // debugger |
| | | if (value == null || value < 0 || !value) { |
| | | if (value == null || !value || value < 0) { |
| | | callback(new Error()) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | export function numRuleGtZero (rule, value, callback) { |
| | | // debugger |
| | | if (value == null || !value || value <= 0) { |
| | | callback(new Error()) |
| | | } else { |
| | | callback() |
| | |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaDeviceWindow from '@/components/business/OperaDeviceWindow' |
| | | import { syncDevices, updateEntranceById } from '@/api/business/device' |
| | | import { memberSync } from '@/api/business/member' |
| | | export default { |
| | | name: 'Device', |
| | | extends: BaseTable, |
| | |
| | | doorName: '', |
| | | regionPathName: '', |
| | | isEntrance: '', |
| | | online: '' |
| | | online: '', |
| | | type:0 |
| | | }, |
| | | options: [] |
| | | } |
| | |
| | | this.$dialog.actionConfirm('æä½ç¡®è®¤æé', 'æ¨ç¡®è®¤åæ¥å
¨é¨ä¿¡æ¯åï¼') |
| | | .then(() => { |
| | | this.isWorking.delete = true |
| | | syncDevices({}) |
| | | syncDevices({type:0}) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || '忥æå') |
| | | this.search() |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:device:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥åç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar"> |
| | | <li><el-button type="primary" @click="synchronousData">忥</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column prop="name" label="设å¤åç§°"></el-table-column> |
| | | <el-table-column prop="doorName" label="é¨ç¦ç¹åç§°"></el-table-column> |
| | | <el-table-column prop="regionPathName" label="åºååç§°"></el-table-column> |
| | | <el-table-column prop="doorNo" label="é¨ç¦ç¹ç¼å·"></el-table-column> |
| | | <el-table-column prop="manufature" label="åå"></el-table-column> |
| | | <el-table-column prop="online" label="å¨çº¿ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.online == 0">离线</span> |
| | | <span v-if="row.online == 1">å¨çº¿</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="ip" label="设å¤ip"></el-table-column> |
| | | <el-table-column prop="port" label="设å¤ç«¯å£"></el-table-column> |
| | | <el-table-column label="æ¯å¦ååºå
¥å£"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch |
| | | @change="changeManufature($event, row)" |
| | | v-model="row.isEntrance" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | :active-value="1" |
| | | :inactive-value="0"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="no" label="设å¤å·"></el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <!-- <OperaDeviceWindow ref="operaDeviceWindow" @success="handlePageChange"/>--> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | 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 }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | doorName: '', |
| | | regionPathName: '', |
| | | isEntrance: '', |
| | | online: '', |
| | | type: 3 |
| | | }, |
| | | options: [] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: '设å¤ä¿¡æ¯è¡¨', |
| | | api: '/business/device', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | changeManufature(e, row) { |
| | | updateEntranceById({ |
| | | id: row.id, |
| | | isEntrance: e |
| | | }) |
| | | }, |
| | | synchronousData () { |
| | | this.$dialog.actionConfirm('æä½ç¡®è®¤æé', 'æ¨ç¡®è®¤åæ¥å
¨é¨ä¿¡æ¯åï¼') |
| | | .then(() => { |
| | | this.isWorking.delete = true |
| | | syncDevices({type: 3}) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || '忥æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.delete = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:device:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥åç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar"> |
| | | <li><el-button type="primary" @click="synchronousData">忥</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | > |
| | | <el-table-column prop="name" label="设å¤åç§°"></el-table-column> |
| | | <el-table-column prop="doorName" label="é¨ç¦ç¹åç§°"></el-table-column> |
| | | <el-table-column prop="regionPathName" label="åºååç§°"></el-table-column> |
| | | <el-table-column prop="doorNo" label="é¨ç¦ç¹ç¼å·"></el-table-column> |
| | | <el-table-column prop="manufature" label="åå"></el-table-column> |
| | | <el-table-column prop="online" label="å¨çº¿ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.online == 0">离线</span> |
| | | <span v-if="row.online == 1">å¨çº¿</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="ip" label="设å¤ip"></el-table-column> |
| | | <el-table-column prop="port" label="设å¤ç«¯å£"></el-table-column> |
| | | <el-table-column label="æ¯å¦ååºå
¥å£"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch |
| | | @change="changeManufature($event, row)" |
| | | v-model="row.isEntrance" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | :active-value="1" |
| | | :inactive-value="0"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="no" label="设å¤å·"></el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <!-- <OperaDeviceWindow ref="operaDeviceWindow" @success="handlePageChange"/>--> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | 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 }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | doorName: '', |
| | | regionPathName: '', |
| | | isEntrance: '', |
| | | online: '', |
| | | type:2 |
| | | }, |
| | | options: [] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: '设å¤ä¿¡æ¯è¡¨', |
| | | api: '/business/device', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | changeManufature(e, row) { |
| | | updateEntranceById({ |
| | | id: row.id, |
| | | isEntrance: e |
| | | }) |
| | | }, |
| | | synchronousData () { |
| | | this.$dialog.actionConfirm('æä½ç¡®è®¤æé', 'æ¨ç¡®è®¤åæ¥å
¨é¨ä¿¡æ¯åï¼') |
| | | .then(() => { |
| | | this.isWorking.delete = true |
| | | syncDevices({type:2}) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || '忥æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.delete = false |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="name" label="æå°åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="hkId" label="æå°ç¼ç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="groupName" label="æå±æå°ç»" min-width="100px"></el-table-column> |
| | | <el-table-column prop="workingNum" label="åæ¶å«å·è½¦è¾æ°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="alermTime" label="åçè¶
æ¶æ¥è¦æ¶é´(åéï¼" min-width="100px"> |
| | | <template scope="{row}">{{row.alermTime?(row.alermTime/60):'-'}}</template> |
| | | <el-table-column prop="name" label="æå°åç§°" fixed min-width="100px"></el-table-column> |
| | | <el-table-column prop="code" label="æå°ç¼ç " fixed min-width="100px"></el-table-column> |
| | | <el-table-column prop="groupName" label="æå±æå°ç»" fixed min-width="100px"></el-table-column> |
| | | <el-table-column prop="workingNum" label="åæ¶å«å·è½¦è¾æ°" min-width="120px"></el-table-column> |
| | | <el-table-column prop="alermTime" label="åçè¶
æ¶æ¥è¦æ¶é´(åéï¼" min-width="180px"> |
| | | <template scope="{row}">{{row.alermTime?(row.alermTime):'-'}}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="waitCallTime" label="ä½ä¸è¶
æ¶æ¥è¦æ¶é´(åéï¼" min-width="100px"> |
| | | <template scope="{row}"> {{row.waitCallTime?(row.alermTime/60):'-'}}</template> |
| | | <el-table-column prop="waitCallTime" label="ä½ä¸è¶
æ¶æ¥è¦æ¶é´(åéï¼" min-width="180px"> |
| | | <template scope="{row}"> {{row.waitCallTime?(row.alermTime):'-'}}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="workRate" label="æå°ä½ä¸æç(ä¸åª/å°æ¶)" min-width="100px"></el-table-column> |
| | | <el-table-column prop="status" label="ç¶æ" min-width="100px"></el-table-column> |
| | | <el-table-column prop="broadcastName" label="å
³è广æ" min-width="100px"></el-table-column> |
| | | <el-table-column prop="ledName" label="å
³èLED" min-width="100px"></el-table-column> |
| | | <el-table-column prop="hkDate" label="忥æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="workRate" label="æå°ä½ä¸æç(ä¸åª/å°æ¶)" min-width="180px"></el-table-column> |
| | | <el-table-column prop="status" label="ç¶æ" min-width="100px"> |
| | | <template scope="{row}"> |
| | | <span v-if="row.status == 0">æ 车</span> |
| | | <span v-if="row.status == 1">æè½¦</span> |
| | | <span v-if="row.status == 2">è¶
æ¶åé </span> |
| | | <span v-if="row.status == 3">é误åé </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="broadcastNames" label="å
³è广æ" min-width="100px"></el-table-column> |
| | | <el-table-column prop="ledNames" label="å
³èLED" min-width="100px"></el-table-column> |
| | | <el-table-column prop="hkDate" label="忥æ¶é´" min-width="140px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:platform:update', 'business:platform:delete'])" |
| | | label="æä½" |
| | |
| | | import SearchFormCollapse from '@/components/common/SearchFormCollapse' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaPlatformWindow from '@/components/business/OperaPlatformWindow' |
| | | import { syncDevices, updateEntranceById } from '@/api/business/device' |
| | | import { syncPlatforms } from '@/api/platform/platform' |
| | | export default { |
| | | name: 'Platform', |
| | | extends: BaseTable, |
| | |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | changeManufature (e, row) { |
| | | updateEntranceById({ |
| | | id: row.id, |
| | | isEntrance: e |
| | | }) |
| | | }, |
| | | syncData () { |
| | | this.$dialog.actionConfirm('æä½ç¡®è®¤æé', 'æ¨ç¡®è®¤åæ¥å
¨é¨ä¿¡æ¯åï¼') |
| | | .then(() => { |
| | |
| | | this.$dialog.actionConfirm('æä½ç¡®è®¤æé', 'æ¨ç¡®è®¤åæ¥å
¨é¨ä¿¡æ¯åï¼') |
| | | .then(() => { |
| | | this.isWorking.working = true |
| | | this.api.syncPlatforms({}) |
| | | this.api.syncPlatformStatus({}) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || '忥æå') |
| | | this.search() |
| | |
| | | import com.doumee.core.haikang.model.param.request.event.parks.EventPlatWorkstatusRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitRequest; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.doumee.service.business.impl.hksync.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @ApiOperation("ãæµ·åº·ãå
¨é忥é¨ç¦è®¾å¤æ¥å£") |
| | | @PostMapping("/syncDevices") |
| | | @RequiresPermissions("business:hksync:device") |
| | | public ApiResponse syncHkDevices(@RequestBody AcsDeviceListRequest param) { |
| | | public ApiResponse syncHkDevices(@RequestBody Device param) { |
| | | String result = hkSyncDeviceService.syncHkDevices(param); |
| | | return ApiResponse.success(result); |
| | | } |
| | |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitRequest; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.doumee.service.business.impl.hksync.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @ApiOperation("ãæµ·åº·ãå
¨é忥é¨ç¦è®¾å¤æ¥å£") |
| | | @PostMapping("/syncDevices") |
| | | @CloudRequiredPermission("business:hksync:device") |
| | | public ApiResponse syncHkDevices(@RequestBody AcsDeviceListRequest param,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | String result = hkSyncDeviceService.syncHkDevices(param); |
| | | public ApiResponse syncHkDevices(@RequestBody Device param, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | String result = null; |
| | | if(Constants.equalsInteger(param.getType(),Constants.ZERO)){ |
| | | result = hkSyncDeviceService.syncHkDevices(param); |
| | | }else if(Constants.equalsInteger(param.getType(),Constants.TWO)){ |
| | | //忥LED |
| | | result = hkSyncDeviceService.syncHkLed(param); |
| | | }else if(Constants.equalsInteger(param.getType(),Constants.THREE)){ |
| | | //åæ¥å¹¿æ |
| | | result = hkSyncDeviceService.syncHkBroadcast(param); |
| | | } |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @since 2024/04/28 16:06 |
| | |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:platformgroup:query") |
| | | public ApiResponse<PageData<PlatformGroup>> findPage (@RequestBody PageWrap<PlatformGroup> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | pageWrap.getModel().setIsdeleted(Constants.ZERO); |
| | | return ApiResponse.success(platformGroupService.findPage(pageWrap)); |
| | | } |
| | | @ApiOperation("æ¥è¯¢å表") |
| | | @PostMapping("/list") |
| | | @CloudRequiredPermission("business:platformgroup:query") |
| | | public ApiResponse<List<PlatformGroup>> list (@RequestBody PlatformGroup pageWrap, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | pageWrap.setIsdeleted(Constants.ZERO); |
| | | return ApiResponse.success(platformGroupService.findList(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | |
| | | import com.hikvision.artemis.sdk.ArtemisHttpUtil; |
| | | import com.hikvision.artemis.sdk.config.ArtemisConfig; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.tomcat.util.bcel.Const; |
| | |
| | | } |
| | | /** |
| | | * è·åæå°ç¶æ |
| | | * @param body |
| | | * @return |
| | | */ |
| | | public static String platformStatus(String param) { |
| | | return startDoPostStringArtemis(HKConstants.InterfacePath.platformStatus+"?platformIds="+param,null); |
| | | if(StringUtils.isNotBlank(param)){ |
| | | return startDoPostStringArtemis(HKConstants.InterfacePath.platformStatus+"?platformIds="+param,null); |
| | | }else{ |
| | | return startDoPostStringArtemis(HKConstants.InterfacePath.platformStatus,null); |
| | | } |
| | | } |
| | | /** |
| | | * è·åæå°ç»ä»¶é
ç½®çLEDè®¾å¤æ¸
å |
| | |
| | | |
| | | @Data |
| | | public class LedRecordsRequest { |
| | | |
| | | private Integer pageNo ;//String true å页页ç |
| | | private Integer pageSize ;//String true åé¡µå¤§å° |
| | | } |
| | |
| | | @Data |
| | | public class LedRecordsInfoResponse { |
| | | |
| | | private String indexCode; |
| | | } |
| | |
| | | public class PlatformStatusInfoResponse { |
| | | |
| | | |
| | | private String platformtId ;//String false æå°ID |
| | | private String platformId ;//String false æå°ID |
| | | private String cameraIndexcode ;//String false æå°å
³èçæ§ç¹ |
| | | private String plateNo ;//String false 车çå· |
| | | private String name;// String false æå°åç§° |
| | |
| | | *ç¨äºè®¾ç½®å¹¿æçèªå®ææ¾å忢 |
| | | * @return |
| | | */ |
| | | public static BaseResponse<BaseListPageResponse<LedRecordsInfoResponse>> customBroadcast(CustomBroadcastRequest param){ |
| | | public static BaseResponse customBroadcast(CustomBroadcastRequest param){ |
| | | log.info("ãæµ·åº·ç¨äºè®¾ç½®å¹¿æçèªå®ææ¾å忢ã================å¼å§===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.customBroadcast(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<BaseListPageResponse<LedRecordsInfoResponse>> >(){}; |
| | | BaseResponse<BaseListPageResponse<LedRecordsInfoResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | new TypeReference< BaseResponse>(){}; |
| | | BaseResponse result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康ç¨äºè®¾ç½®å¹¿æçèªå®ææ¾å忢"); |
| | | return result; |
| | | }catch (Exception e){ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.Platform; |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2024/06/28 10:03 |
| | | */ |
| | | public interface PlatformMapper extends BaseMapper<Platform> { |
| | | public interface PlatformMapper extends MPJBaseMapper<Platform> { |
| | | |
| | | } |
| | |
| | | @ExcelColumn(name="æåºç ") |
| | | private Integer sortnum; |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0é¨ç¦ 1车åº", example = "1") |
| | | @ExcelColumn(name="ç±»å 0é¨ç¦ 1车åº") |
| | | @ApiModelProperty(value = "ç±»å 0é¨ç¦ 1è½¦åº 2LED 3广æ", example = "1") |
| | | @ExcelColumn(name="ç±»å 0é¨ç¦ 1è½¦åº 2LED 3广æ") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "æ¯å¦ååºåºå
¥å£ 0䏿¯ 1æ¯", example = "1") |
| | | @ExcelColumn(name="æ¯å¦ååºåºå
¥å£ 0䏿¯ 1æ¯") |
| | |
| | | @ApiModelProperty(value = "åç§°") |
| | | @ExcelColumn(name="åç§°") |
| | | private String name; |
| | | @ApiModelProperty(value = "ç¼ç ") |
| | | @ExcelColumn(name="ç¼ç ") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | @ExcelColumn(name="夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ 0å¯ç¨ 1ç¦ç¨", example = "1") |
| | | @ExcelColumn(name="ç¶æ 0å¯ç¨ 1ç¦ç¨") |
| | | @ApiModelProperty(value = "æå°ç¶æ 0-æ 车 1-æè½¦ 2-è¶
æ¶åé 3-é误åé ", example = "1") |
| | | @ExcelColumn(name="æå°ç¶æ 0-æ 车 1-æè½¦ 2-è¶
æ¶åé 3-é误åé ") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "æåºç ", example = "1") |
| | |
| | | @ApiModelProperty(value = "ledåç§°", example = "1") |
| | | @TableField(exist = false) |
| | | private String ledName; |
| | | @ApiModelProperty(value = "åç»åç§°", example = "1") |
| | | @TableField(exist = false) |
| | | private String groupName; |
| | | @ApiModelProperty(value = "å
³èLEDç¼ç éåï¼è±æéå·éå¼", example = "1") |
| | | @TableField(exist = false) |
| | | private String ledIds; |
| | | @ApiModelProperty(value = "å
³è广æç¼ç éåï¼è±æéå·éå¼", example = "1") |
| | | @TableField(exist = false) |
| | | private String broadcaseIds; |
| | | @ApiModelProperty(value = "å
³èLEDåç§°éåï¼è±æéå·éå¼", example = "1") |
| | | @TableField(exist = false) |
| | | private String ledNames; |
| | | @ApiModelProperty(value = "å
³è广æç¼åç§°éåï¼è±æéå·éå¼", example = "1") |
| | | @TableField(exist = false) |
| | | private String broadcaseNames; |
| | | |
| | | } |
| | |
| | | import com.doumee.core.haikang.model.param.request.event.parks.EventPlatWorkstatusRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitRequest; |
| | | import com.doumee.core.haikang.model.param.respose.AppointmentInfoResponse; |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.doumee.dao.business.model.ParkBook; |
| | | import io.swagger.models.auth.In; |
| | | |
| | |
| | | * @param param |
| | | * @return |
| | | */ |
| | | String syncHkDevices(AcsDeviceListRequest param); |
| | | String syncHkDevices(Device param); |
| | | |
| | | /** |
| | | * åæ¥æµ·åº·åè½¦åº |
| | |
| | | void dealWorkstatusEvent(EventPlatWorkstatusRequest param, HttpServletResponse response); |
| | | |
| | | void dealCarstatusEvent(EventPlatCarstatusRequest param, HttpServletResponse response); |
| | | |
| | | String syncHkLed(Device param); |
| | | |
| | | String syncHkBroadcast(Device param); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.DeviceMapper; |
| | | import com.doumee.dao.business.model.Device; |
| | |
| | | public PageData<Device> findPage(PageWrap<Device> pageWrap) { |
| | | IPage<Device> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<Device> queryWrapper = new QueryWrapper<>(); |
| | | pageWrap.getModel().setIsdeleted(Constants.ZERO); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(Device::getId, pageWrap.getModel().getId()); |
| | |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.PlatformMapper; |
| | | import com.doumee.dao.business.model.Platform; |
| | | import com.doumee.dao.business.model.PlatformGroup; |
| | | import com.doumee.service.business.PlatformService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | @Override |
| | | public PageData<Platform> findPage(PageWrap<Platform> pageWrap) { |
| | | IPage<Platform> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<Platform> queryWrapper = new QueryWrapper<>(); |
| | | MPJLambdaWrapper<Platform> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(Platform.class) |
| | | .selectAs(PlatformGroup::getName,Platform::getGroupName) |
| | | .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | queryWrapper.lambda() |
| | | pageWrap.getModel().setIsdeleted(Constants.ZERO); |
| | | queryWrapper |
| | | .eq(pageWrap.getModel().getId() != null, Platform::getId, pageWrap.getModel().getId()) |
| | | .eq(pageWrap.getModel().getCreator() != null, Platform::getCreator, pageWrap.getModel().getCreator()) |
| | | .ge(pageWrap.getModel().getCreateDate() != null, Platform::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())) |
| | |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(platformMapper.selectPage(page, queryWrapper)); |
| | | return PageData.from(platformMapper.selectJoinPage(page,Platform.class, queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | // @Async |
| | | public String syncHkDevices(AcsDeviceListRequest param){ |
| | | public String syncHkDevices(Device param){ |
| | | |
| | | return null; |
| | | } |
| | | @Override |
| | | public String syncHkLed(Device param){ |
| | | |
| | | return null; |
| | | } |
| | | @Override |
| | | public String syncHkBroadcast(Device param){ |
| | | |
| | | return null; |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aliyun.tea.TeaException; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.param.BaseListPageResponse; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; |
| | | import com.doumee.core.haikang.model.param.request.AcsDeviceStatusListRequest; |
| | | import com.doumee.core.haikang.model.param.request.DoorsListRequest; |
| | | import com.doumee.core.haikang.model.param.request.ParkListRequest; |
| | | import com.doumee.core.haikang.model.param.request.*; |
| | | import com.doumee.core.haikang.model.param.respose.*; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.Constants; |
| | |
| | | */ |
| | | @Override |
| | | // @Async |
| | | public String syncHkDevices(AcsDeviceListRequest param){ |
| | | public String syncHkDevices(Device param){ |
| | | if(Constants.DEALING_HK_SYNCDEVICE){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "忥任塿£å¨æ§è¡å¦ï¼è¯·ç¨åæ¥çç»æï¼") ; |
| | | } |
| | |
| | | List<Device> editList = new ArrayList<>(); |
| | | Date date = new Date(); |
| | | //æ¥è¯¢å
¨é¨é¨ç¦è®¾å¤æ°æ® |
| | | List<Device> allList = deviceMapper.selectList(null); |
| | | List<Device> allList = deviceMapper.selectList(new QueryWrapper<Device>().lambda() |
| | | .eq(Device::getType,Constants.ZERO)); |
| | | List<DoorsInfoResponse> allDoors = getAllDoorList(); |
| | | List<AcsDeviceInfoResponse> allHkList = getAllDeViceList(); |
| | | /** |
| | | * è·åå¢å æ¹æ°æ®éå |
| | | */ |
| | | getDataChangeList(allList,allDoors,allHkList,addList,editList,deleteList,date); |
| | | getDataChangeList(allList,allDoors,allHkList,addList,editList,deleteList,date ); |
| | | if(deleteList.size()>0){ |
| | | //é»è¾å é¤ |
| | | for(Device d : deleteList){ |
| | |
| | | Constants.DEALING_HK_SYNCDEVICE =false; |
| | | } |
| | | } |
| | | /** |
| | | * åæ¥æµ·åº·é¨ç¦è®¾å¤æ°æ® |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @Override |
| | | // @Async |
| | | public String syncHkLed(Device param){ |
| | | if(Constants.DEALING_HK_SYNCDEVICE){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "忥任塿£å¨æ§è¡å¦ï¼è¯·ç¨åæ¥çç»æï¼") ; |
| | | } |
| | | Constants.DEALING_HK_SYNCDEVICE =true; |
| | | try { |
| | | List<Device> deleteList = new ArrayList<>(); |
| | | List<Device> addList = new ArrayList<>(); |
| | | List<Device> editList = new ArrayList<>(); |
| | | Date date = new Date(); |
| | | //æ¥è¯¢å
¨é¨é¨ç¦è®¾å¤æ°æ® |
| | | List<Device> allList = deviceMapper.selectList(new QueryWrapper<Device>().lambda() |
| | | .eq(Device::getType,Constants.TWO)); |
| | | List<LedRecordsInfoResponse> allHkList = getAllLedList(); |
| | | /** |
| | | * è·åå¢å æ¹æ°æ®éå |
| | | */ |
| | | getLedDataChangeList(allList,allHkList,addList,editList,deleteList,date); |
| | | if(deleteList.size()>0){ |
| | | //é»è¾å é¤ |
| | | for(Device d : deleteList){ |
| | | deviceMapper.updateById(d); |
| | | } |
| | | } |
| | | if(addList.size()>0){ |
| | | deviceMapper.insert(addList); |
| | | } |
| | | if(editList.size()>0){ |
| | | for(Device d : editList){ |
| | | deviceMapper.updateById(d); |
| | | } |
| | | } |
| | | return "åæ¥æ°æ®ï¼æ°å¢ã"+addList.size()+"ãæ¡ï¼æ´æ°ã"+editList.size()+"ãæ¡ï¼å é¤ã"+deleteList.size()+"ãæ¡"; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "åæ¥å¤±è´¥ï¼"); |
| | | }finally { |
| | | Constants.DEALING_HK_SYNCDEVICE =false; |
| | | } |
| | | } |
| | | |
| | | private void getLedDataChangeList(List<Device> allList, List<LedRecordsInfoResponse> allHkList, List<Device> addList, List<Device> editList, List<Device> deleteList, Date date) { |
| | | if(allHkList!=null && allHkList.size()>0){ |
| | | //è·å海康å
¨é¨é¨ç¦ç»æ°æ® |
| | | for(LedRecordsInfoResponse device : allHkList){ |
| | | Device model = getExistedLed(device,allList); |
| | | if(model !=null){ |
| | | //妿已åå¨ï¼åæ´æ°æ°æ® |
| | | model = initLedDataByHkData(model,device,date); |
| | | editList.add(model); |
| | | }else{ |
| | | //妿ä¸åå¨ï¼åæ°å¢æ°æ® |
| | | model = new Device(); |
| | | model = initLedDataByHkData(model,device,date); |
| | | model.setIsEntrance(Constants.ZERO); |
| | | addList.add(model); |
| | | } |
| | | } |
| | | } |
| | | //夿è·åå é¤çé¨ç¦è®¾å¤ï¼é»è¾å é¤ |
| | | getDeleteLedList(allList,allHkList,deleteList,date); |
| | | } |
| | | |
| | | /** |
| | | * åæ¥æµ·åº·é¨ç¦è®¾å¤æ°æ® |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @Override |
| | | // @Async |
| | | public String syncHkBroadcast(Device param){ |
| | | if(Constants.DEALING_HK_SYNCDEVICE){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "忥任塿£å¨æ§è¡å¦ï¼è¯·ç¨åæ¥çç»æï¼") ; |
| | | } |
| | | Constants.DEALING_HK_SYNCDEVICE =true; |
| | | try { |
| | | List<Device> deleteList = new ArrayList<>(); |
| | | List<Device> addList = new ArrayList<>(); |
| | | List<Device> editList = new ArrayList<>(); |
| | | Date date = new Date(); |
| | | //æ¥è¯¢å
¨é¨å¹¿æç¹è®¾å¤æ°æ® |
| | | List<Device> allList = deviceMapper.selectList(new QueryWrapper<Device>().lambda() |
| | | .eq(Device::getType,Constants.THREE)); |
| | | List<FetchAudioChannelInfoResponse> allHkList = getAllBroadcastList(); |
| | | /** |
| | | * è·åå¢å æ¹æ°æ®éå |
| | | */ |
| | | getBroadcastDataChangeList(allList,allHkList,addList,editList,deleteList,date); |
| | | if(deleteList.size()>0){ |
| | | //é»è¾å é¤ |
| | | for(Device d : deleteList){ |
| | | deviceMapper.updateById(d); |
| | | } |
| | | } |
| | | if(addList.size()>0){ |
| | | deviceMapper.insert(addList); |
| | | } |
| | | if(editList.size()>0){ |
| | | for(Device d : editList){ |
| | | deviceMapper.updateById(d); |
| | | } |
| | | } |
| | | return "åæ¥æ°æ®ï¼æ°å¢ã"+addList.size()+"ãæ¡ï¼æ´æ°ã"+editList.size()+"ãæ¡ï¼å é¤ã"+deleteList.size()+"ãæ¡"; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "åæ¥å¤±è´¥ï¼"); |
| | | }finally { |
| | | Constants.DEALING_HK_SYNCDEVICE =false; |
| | | } |
| | | } |
| | | |
| | | private void getBroadcastDataChangeList(List<Device> allList, List<FetchAudioChannelInfoResponse> allHkList, List<Device> addList, List<Device> editList, List<Device> deleteList, Date date) { |
| | | if(allHkList!=null && allHkList.size()>0){ |
| | | //è·å海康å
¨é¨é¨ç¦ç»æ°æ® |
| | | for(FetchAudioChannelInfoResponse device : allHkList){ |
| | | Device model = getExistedBroadcast(device,allList); |
| | | if(model !=null){ |
| | | //妿已åå¨ï¼åæ´æ°æ°æ® |
| | | model = initBroadcastDataByHkData(model,device,date); |
| | | editList.add(model); |
| | | }else{ |
| | | //妿ä¸åå¨ï¼åæ°å¢æ°æ® |
| | | model = new Device(); |
| | | model = initBroadcastDataByHkData(model,device,date); |
| | | model.setIsEntrance(Constants.ZERO); |
| | | addList.add(model); |
| | | } |
| | | } |
| | | } |
| | | //夿è·åå é¤çé¨ç¦è®¾å¤ï¼é»è¾å é¤ |
| | | getDeleteBroadcastList(allList,allHkList,deleteList,date); |
| | | } |
| | | |
| | | @Override |
| | | // @Async |
| | | public void getAscDeviceStatus(){ |
| | |
| | | } |
| | | return allDoorList; |
| | | } |
| | | |
| | | /** |
| | | * è·åå
¨é¨å¹¿æç¹æ°æ® |
| | | * @return |
| | | */ |
| | | public List<FetchAudioChannelInfoResponse> getAllBroadcastList(){ |
| | | List<FetchAudioChannelInfoResponse> allDoorList = new ArrayList<>(); |
| | | Date date = new Date(); |
| | | boolean hasNext = true; |
| | | int curTotal = 0; |
| | | int curPage = 1; |
| | | while (hasNext){ |
| | | //å页éåå¾ªç¯æ¥è¯¢ææé¨ç¦è®¾å¤æ°æ® |
| | | FetchAudioChannelRequest param = new FetchAudioChannelRequest(); |
| | | param.setPageNo(curPage); |
| | | param.setPageSize(100); |
| | | BaseResponse<BaseListPageResponse<FetchAudioChannelInfoResponse>> response = HKService.fetchAudioChannel(param); |
| | | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对ä¸èµ·ï¼æµ·åº·åæ¥æ°æ®å¤±è´¥~"); |
| | | } |
| | | BaseListPageResponse<FetchAudioChannelInfoResponse> r = response.getData(); |
| | | curTotal += 100; |
| | | if(curTotal >= r.getTotal()){ |
| | | hasNext = false; |
| | | } |
| | | if(r.getList() == null || r.getList().size()==0){ |
| | | hasNext =false; |
| | | }else{ |
| | | allDoorList.addAll(r.getList()); |
| | | } |
| | | curPage++; |
| | | } |
| | | return allDoorList; |
| | | } |
| | | /** |
| | | * è·åå
¨é¨LEDæ°æ® |
| | | * @return |
| | | */ |
| | | public List<LedRecordsInfoResponse> getAllLedList(){ |
| | | List<LedRecordsInfoResponse> allDoorList = new ArrayList<>(); |
| | | Date date = new Date(); |
| | | boolean hasNext = true; |
| | | int curTotal = 0; |
| | | int curPage = 1; |
| | | while (hasNext){ |
| | | //å页éåå¾ªç¯æ¥è¯¢ææé¨ç¦è®¾å¤æ°æ® |
| | | LedRecordsRequest param = new LedRecordsRequest(); |
| | | param.setPageNo(curPage); |
| | | param.setPageSize(100); |
| | | BaseResponse<BaseListPageResponse<LedRecordsInfoResponse>> response = HKService.ledRecords(param); |
| | | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对ä¸èµ·ï¼æµ·åº·åæ¥æ°æ®å¤±è´¥~"); |
| | | } |
| | | BaseListPageResponse<LedRecordsInfoResponse> r = response.getData(); |
| | | curTotal += 100; |
| | | if(curTotal >= r.getTotal()){ |
| | | hasNext = false; |
| | | } |
| | | if(r.getList() == null || r.getList().size()==0){ |
| | | hasNext =false; |
| | | }else{ |
| | | allDoorList.addAll(r.getList()); |
| | | } |
| | | curPage++; |
| | | } |
| | | return allDoorList; |
| | | } |
| | | public List<AscDeviceStatusInfoResponse> getAllDeviceStatusList(){ |
| | | List<AscDeviceStatusInfoResponse> allDoorList = new ArrayList<>(); |
| | | Date date = new Date(); |
| | |
| | | return allDoorList; |
| | | } |
| | | |
| | | private void getDataChangeList(List<Device> allList, List<DoorsInfoResponse> hkDoorList , List<AcsDeviceInfoResponse> allHkList, List<Device> addList, List<Device> editList,List<Device> deleteList, Date date) { |
| | | private void getDataChangeList(List<Device> allList, |
| | | List<DoorsInfoResponse> hkDoorList , |
| | | List<AcsDeviceInfoResponse> allHkList, |
| | | List<Device> addList, |
| | | List<Device> editList, |
| | | List<Device> deleteList, |
| | | Date date ) { |
| | | if(hkDoorList!=null && hkDoorList.size()>0){ |
| | | //è·å海康å
¨é¨é¨ç¦ç»æ°æ® |
| | | for(DoorsInfoResponse device : hkDoorList){ |
| | |
| | | getDeleteDoorList(allList,hkDoorList,deleteList,date); |
| | | } |
| | | |
| | | private Device initLedDataByHkData(Device model, LedRecordsInfoResponse door, Date date) { |
| | | model.setIsdeleted(Constants.ZERO); |
| | | model.setHkId(door.getIndexCode()); |
| | | model.setHkDate(date); |
| | | model.setHkStatus(Constants.ONE); |
| | | model.setType(Constants.TWO); |
| | | model.setRemark(JSONObject.toJSONString(door)); |
| | | model.setDoorId(door.getIndexCode()); |
| | | return model; |
| | | } |
| | | private Device initBroadcastDataByHkData(Device model, FetchAudioChannelInfoResponse device, Date date) { |
| | | model.setIsdeleted(Constants.ZERO); |
| | | model.setHkDate(date); |
| | | model.setHkId(device.getAudioChannelIndexCode()); |
| | | model.setName(device.getAudioChannelName()); |
| | | model.setHkStatus(Constants.ONE); |
| | | model.setType(Constants.THREE); |
| | | model.setChannelNo(device.getChannelNo()); |
| | | model.setChannelInfo(device.getChannelType()); |
| | | model.setResourceType(device.getAudioChannelType()); |
| | | model.setStatus(device.getState()); |
| | | model.setRegionName(device.getRegionName()); |
| | | return model; |
| | | } |
| | | private Device initDoorDataByHkData(Device model, DoorsInfoResponse door, Date date, List<AcsDeviceInfoResponse> allHkList) { |
| | | AcsDeviceInfoResponse device = getDeviceByDoorid(door.getParentIndexCode(),allHkList); |
| | | model.setIsdeleted(Constants.ZERO); |
| | |
| | | } |
| | | return null; |
| | | } |
| | | private Device getExistedLed(LedRecordsInfoResponse device, List<Device> allList) { |
| | | if(allList.size()>0){ |
| | | for(Device r : allList){ |
| | | if(StringUtils.equals(r.getHkId(), device.getIndexCode())){ |
| | | //表示æªå é¤ |
| | | return r; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | private Device getExistedBroadcast(FetchAudioChannelInfoResponse device, List<Device> allList) { |
| | | if(allList.size()>0){ |
| | | for(Device r : allList){ |
| | | if(StringUtils.equals(r.getHkId(), device.getAudioChannelIndexCode())){ |
| | | //表示æªå é¤ |
| | | return r; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | private Device getExistedDevice(AcsDeviceInfoResponse device, List<Device> allList) { |
| | | if(allList.size()>0){ |
| | | for(Device r : allList){ |
| | |
| | | } |
| | | } |
| | | } |
| | | private void getDeleteLedList(List<Device> allList, List<LedRecordsInfoResponse> allHkList,List<Device> deleteList ,Date date) { |
| | | if(allList!=null && allList.size()>0){ |
| | | for(Device device : allList){ |
| | | if(isDeletedLedDevice(device,allHkList)){ |
| | | device.setIsdeleted(Constants.ONE); |
| | | device.setEditDate(date); |
| | | deleteList.add(device); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | private void getDeleteBroadcastList(List<Device> allList, List<FetchAudioChannelInfoResponse> allHkList,List<Device> deleteList ,Date date) { |
| | | if(allList!=null && allList.size()>0){ |
| | | for(Device device : allList){ |
| | | if(isDeletedBroadcastDevice(device,allHkList)){ |
| | | device.setIsdeleted(Constants.ONE); |
| | | device.setEditDate(date); |
| | | deleteList.add(device); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private boolean isDeletedDoorDevice(Device device, List<DoorsInfoResponse> allHkList) { |
| | | if(allHkList.size()>0){ |
| | |
| | | return true; |
| | | |
| | | } |
| | | private boolean isDeletedLedDevice(Device device, List<LedRecordsInfoResponse> allHkList) { |
| | | if(allHkList.size()>0){ |
| | | for(LedRecordsInfoResponse r : allHkList){ |
| | | if(StringUtils.equals(device.getDoorId(), r.getIndexCode())){ |
| | | //表示æªå é¤ |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | |
| | | } |
| | | private boolean isDeletedBroadcastDevice(Device device, List<FetchAudioChannelInfoResponse> allHkList) { |
| | | if(allHkList.size()>0){ |
| | | for(FetchAudioChannelInfoResponse r : allHkList){ |
| | | if(StringUtils.equals(device.getDoorId(), r.getAudioChannelIndexCode())){ |
| | | //表示æªå é¤ |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | |
| | | } |
| | | private boolean isDeletedDevice(Device device, List<AcsDeviceInfoResponse> allHkList) { |
| | | if(allHkList.size()>0){ |
| | | for(AcsDeviceInfoResponse r : allHkList){ |
| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.business.DeviceMapper; |
| | | import com.doumee.dao.business.PlatformDeviceMapper; |
| | | import com.doumee.dao.business.PlatformMapper; |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.doumee.dao.business.model.Platform; |
| | | import com.doumee.dao.business.model.PlatformDevice; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private PlatformMapper platformMapper; |
| | | @Autowired |
| | | private PlatformDeviceMapper platformDeviceMapper; |
| | | |
| | | /** |
| | | * åæ¥æµ·åº·æå°æ°æ® |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | // @Async |
| | | @Transactional |
| | | public String syncPlatforms(PlatformsListRequest param){ |
| | | if(Constants.DEALING_HK_SYNCPLATFORM){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "忥任塿£å¨æ§è¡å¦ï¼è¯·ç¨åæ¥çç»æï¼") ; |
| | |
| | | List<Platform> deleteList = new ArrayList<>(); |
| | | List<Platform> addList = new ArrayList<>(); |
| | | List<Platform> editList = new ArrayList<>(); |
| | | List<PlatformDevice> deviceList = new ArrayList<>(); |
| | | Date date = new Date(); |
| | | //æ¥è¯¢å
¨é¨é¨ç¦è®¾å¤æ°æ® |
| | | List<Platform> allList = platformMapper.selectList(null); |
| | |
| | | /** |
| | | * è·åå¢å æ¹æ°æ®éå |
| | | */ |
| | | getDataChangeList(allList,allHkList,addList,editList,deleteList,date); |
| | | getDataChangeList(allList,allHkList,addList,deviceList,editList,deleteList,date); |
| | | if(deleteList.size()>0){ |
| | | //é»è¾å é¤ |
| | | for(Platform d : deleteList){ |
| | | platformMapper.updateById(d); |
| | | } |
| | | } |
| | | if(addList.size()>0){ |
| | | platformMapper.insert(addList); |
| | | if(deviceList.size()>0){ |
| | | platformDeviceMapper.insert(deviceList); |
| | | } |
| | | if(editList.size()>0){ |
| | | for(Platform d : editList){ |
| | |
| | | platformMapper.update(null,new UpdateWrapper<Platform>().lambda() |
| | | .set(Platform::getStatus,d.getStatus()) |
| | | .set(Platform::getEditDate,date) |
| | | .eq(Platform::getHkId,d.getPlatformtId())); |
| | | .eq(Platform::getHkId,d.getPlatformId())); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | |
| | | } |
| | | private void getDataChangeList(List<Platform> allList, |
| | | List<PlatformListInfoResponse> allHkList, |
| | | List<Platform> addList, |
| | | List<Platform> addList , |
| | | List<PlatformDevice> deviceList, |
| | | List<Platform> editList, |
| | | List<Platform> deleteList, Date date) { |
| | | if(allHkList!=null && allHkList.size()>0){ |
| | |
| | | //妿已åå¨ï¼åæ´æ°æ°æ® |
| | | model = initDataByHkData(model,device,date); |
| | | editList.add(model); |
| | | //æ¸
ç©ºçæ§ç¹æ°æ® |
| | | platformDeviceMapper.delete(new UpdateWrapper<PlatformDevice>().lambda() |
| | | .eq(PlatformDevice::getPlatformId,model.getId())); |
| | | deviceList.addAll(getCameraList(device.getCameras(),model)); |
| | | }else{ |
| | | //妿ä¸åå¨ï¼åæ°å¢æ°æ® |
| | | model = new Platform(); |
| | | model = initDataByHkData(model,device,date); |
| | | platformMapper.insert(model); |
| | | addList.add(model); |
| | | deviceList.addAll(getCameraList(device.getCameras(),model)); |
| | | } |
| | | } |
| | | } |
| | | //夿è·åå é¤çé¨ç¦è®¾å¤ï¼é»è¾å é¤ |
| | | getDeleteList(allList,allHkList,deleteList,date); |
| | | } |
| | | |
| | | private List<PlatformDevice> getCameraList(List<PlatformCameraInfoResponse> cameras, Platform model) { |
| | | List<PlatformDevice> list = new ArrayList<>(); |
| | | if(cameras!=null || cameras.size()>0){ |
| | | for(PlatformCameraInfoResponse param :cameras){ |
| | | PlatformDevice d = new PlatformDevice(); |
| | | d.setCreateDate(model.getCreateDate()); |
| | | d.setPlatformId(model.getId()); |
| | | d.setIsdeleted(Constants.ZERO); |
| | | d.setDeviceId(param.getCameraIdompan()); |
| | | d.setName(param.getCameraName()); |
| | | d.setType(Constants.ONE); |
| | | list.add(d); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Platform initDataByHkData(Platform model, PlatformListInfoResponse device,Date date ) { |
| | | model.setIsdeleted(Constants.ZERO); |
| | | model.setCreateDate(date); |
| | | model.setHkDate(date); |
| | | model.setHkId(device.getPlatformId()); |
| | | model.setCreateDate(DateUtil.getISO8601DateByStr(device.getCreateTime())); |