Commit fca720f0 authored by “yiyousong”'s avatar “yiyousong”
parents 63ceb4f4 5204032c
package com.mortals.xhx.common.pdu.site;
import java.util.Date;
import java.util.List;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
/**
* 站点大厅信息Pdu对象
*
* @author zxfei
* @date 2023-04-26
*/
@Data
public class SiteHallPdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 站点ID
*/
private Long siteId;
/**
* 站点名称
*/
private String siteName;
/**
* 大厅名称
*/
private String hallName;
/**
* 地址
*/
private String address;
/**
* 楼层
*/
private Integer floor;
/**
* 楼栋
*/
private Integer build;
/**
* 备注
*/
private String remark;
public void initAttrValue(){
this.siteId = null;
this.siteName = "";
this.hallName = "";
this.address = "";
this.floor = 1;
this.build = 1;
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.feign.site;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.site.SiteHallPdu;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 站点大厅信息 Feign接口
*
* @author zxfei
* @date 2023-04-26
*/
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = SiteHallFeignFallbackFactory.class)
public interface ISiteHallFeign extends IFeign {
/**
* 查看站点大厅信息列表
*
* @param siteHallPdu
* @return
*/
@PostMapping(value = "/site/hall/list")
Rest<RespData<List<SiteHallPdu>>> list(@RequestBody SiteHallPdu siteHallPdu);
/**
* 查看站点大厅信息
*
* @param id
* @return
*/
@GetMapping(value = "/site/hall/info")
Rest<SiteHallPdu> info(@RequestParam(value = "id") Long id);
/**
* 删除站点大厅信息
*
* @param ids
* @return
*/
@GetMapping(value = "/site/hall/delete")
Rest<Void> delete(Long[] ids, @RequestHeader("Authorization") String authorization);
/**
* 站点大厅信息保存更新
*
* @param siteHallPdu
* @return
*/
@PostMapping(value = "/site/hall/save")
Rest<RespData<SiteHallPdu>> save(@RequestBody SiteHallPdu siteHallPdu, @RequestHeader("Authorization") String authorization);
}
@Slf4j
@Component
class SiteHallFeignFallbackFactory implements FallbackFactory<ISiteHallFeign> {
@Override
public ISiteHallFeign create(Throwable t) {
return new ISiteHallFeign() {
@Override
public Rest<RespData<List<SiteHallPdu>>> list(SiteHallPdu siteHallPdu) {
return Rest.fail("暂时无法获取站点大厅信息列表,请稍后再试!");
}
@Override
public Rest<SiteHallPdu> info(Long id) {
return Rest.fail("暂时无法获取站点大厅信息详细,请稍后再试!");
}
@Override
public Rest<Void> delete(Long[] ids, String authorization) {
return Rest.fail("暂时无法删除站点大厅信息,请稍后再试!");
}
@Override
public Rest<RespData<SiteHallPdu>> save(SiteHallPdu siteHallPdu, String authorization) {
return Rest.fail("暂时无法保存站点大厅信息,请稍后再试!");
}
};
}
}
...@@ -23,9 +23,6 @@ export default { ...@@ -23,9 +23,6 @@ export default {
clearTimeout(this.loadingTimer); clearTimeout(this.loadingTimer);
}, },
methods: { methods: {
test() {
console.log("test")
},
// 开启、关闭 // 开启、关闭
changePath(path) { changePath(path) {
this.pageInfo.list = path + "/list"; this.pageInfo.list = path + "/list";
...@@ -376,6 +373,7 @@ export default { ...@@ -376,6 +373,7 @@ export default {
toString: [], toString: [],
defaultConfig: { defaultConfig: {
search: [], // 头部搜索配置 search: [], // 头部搜索配置
tableName:"table",
columns: [], // 表格列信息配置 columns: [], // 表格列信息配置
addQuery: {}, // 新增按钮携带的参数 addQuery: {}, // 新增按钮携带的参数
buttons: [], // 增加查询区域自定义操作按钮,格式:[{label:'按钮显示名称',isShow:是否显示true/false,loading:true/false,type:'类型',icon:'图标',method:function(){}}] buttons: [], // 增加查询区域自定义操作按钮,格式:[{label:'按钮显示名称',isShow:是否显示true/false,loading:true/false,type:'类型',icon:'图标',method:function(){}}]
......
<template> <template>
<el-table <el-table
size='small' size='small'
:ref="tableName"
:data="tableData" :data="tableData"
:row-key="handleRowKeyMethod" :row-key="handleRowKeyMethod"
:span-method="handleSpanMethod" :span-method="handleSpanMethod"
...@@ -69,6 +70,11 @@ export default { ...@@ -69,6 +70,11 @@ export default {
required: false, required: false,
default: () => {} default: () => {}
}, },
toggleRowSelection: {
type: Function,
required: false,
default: () => {}
},
handleSelectionChange: { handleSelectionChange: {
type: Function, type: Function,
required: false, required: false,
...@@ -103,6 +109,11 @@ export default { ...@@ -103,6 +109,11 @@ export default {
type: Array, type: Array,
required: false, required: false,
default: ()=> [], default: ()=> [],
},
tableName: {
type: String,
required: false,
default: "table",
} }
}, },
computed: { computed: {
......
...@@ -156,6 +156,7 @@ ...@@ -156,6 +156,7 @@
v-if="showType == 'table'" v-if="showType == 'table'"
:tableData="data.data" :tableData="data.data"
:columns="config.columns" :columns="config.columns"
:tableName="config.tableName"
:loading="data.loading" :loading="data.loading"
:tableRowClassName="config.methods.tableRowClassName" :tableRowClassName="config.methods.tableRowClassName"
:handleSpanMethod="config.methods.handleSpanMethod" :handleSpanMethod="config.methods.handleSpanMethod"
......
// 管理后台通用表格,含:搜索,分页,表格
<template>
<div class="layout-table" :loading='data.loading'>
<div class="table-head flex flex-pack-justify">
<div class="table-head-left flex flex-align-center">
<slot name='breadcrumb'>
<Breadcrumb />
</slot>
<div class="buttons">
<slot name='table-head-left'></slot>
<slot name='table-head-center'>
<el-button v-if='isShowButton("notAdd")' type='primary' icon="el-icon-plus" size='mini' @click='config.methods.add' title="新增"></el-button>
<el-button v-if='isShowBtn("import")' size='mini' @click='config.methods.importView' class="el-icon-upload2" title="导入"></el-button>
<Confirm v-if='isShowButton("notDel")' @confirm='config.methods.del' message='确定要删除选中的多条记录吗?'>
<el-button icon="el-icon-delete" type="danger" size='mini' title="删除"></el-button>
</Confirm>
<el-button @click='item.method' size='mini' :key="item.label" :icon='item.icon' :type ='item.type' :loading="item.loading" v-if="item.isShow" v-for='(item) in config.buttons' circle :title="item.label"></el-button>
<el-button v-if='isShowBtn("back")' @click='config.methods.back' size='mini' icon='el-icon-back' circle title="返回"></el-button>
</slot>
<slot name='table-head-left2'></slot>
</div>
</div>
<div class="table-head-right">
<div class="extend flex flex-pack-justify">
<slot name='table-head-right'></slot>
<div>
<el-tooltip content="查询" placement="top" v-if='isShowButton("notSearch")'>
<el-button icon="el-icon-search" circle size='mini' @click='showSearch = !showSearch'></el-button>
</el-tooltip>
<el-tooltip content="刷新" placement="top" v-if='isShowButton("notFresh")'>
<el-button icon="el-icon-refresh" circle size='mini' @click='config.methods.refresh'></el-button>
</el-tooltip>
</div>
<el-radio-group v-model="showType" size='mini' v-if='isMobile'>
<el-radio-button label="card"><i class="el-icon-menu"></i></el-radio-button>
<el-radio-button label="table"><i class="el-icon-tickets"></i></el-radio-button>
<el-radio-button label="treetable"><i class="el-icon-tickets"></i></el-radio-button>
</el-radio-group>
<slot name='table-head-right2'></slot>
</div>
</div>
</div>
<!-- 表格查询条件-->
<div class="table-form" v-if='!isShowButton("notSearch") ? false : showSearch'>
<slot name="table-search-left"></slot>
<SearchForm :search='config.search' :table='data'
:downloadUrl='config.downloadUrl'
:areaSelect='config.areaSelect'
/>
</div>
<!-- 表格主体 -->
<div class="table-body">
<slot name='table-body-head'></slot>
<slot>
<DataTableMobile
v-if='showType == "card"'
:tableData='data.data'
:columns='config.columns'
:tableRowClassName='config.methods.tableRowClassName'
:handleSelectionChange='config.methods.handleSelectionChange'
:handleRowClick='config.methods.handleRowClick'/>
<DataTable
v-if='showType == "table"'
:tableData='data.data'
:columns='config.columns'
:loading='data.loading'
:tableRowClassName='config.methods.tableRowClassName'
:handleSpanMethod='config.methods.handleSpanMethod'
:handleSortChange='config.methods.handleSortChange'
:handleSelectionChange='config.methods.handleSelectionChange'
:handleRowClick='config.methods.handleRowClick'/>
<DataTableFlow
v-if='showType == "tableFlow"'
:tableData='data.data'
:columns='config.columns'
:dict='data.dict'
:loading='data.loading'
:tableRowClassName='config.methods.tableRowClassName'
:handleSpanMethod='config.methods.handleSpanMethod'
:handleSortChange='config.methods.handleSortChange'
:handleSelectionChange='config.methods.handleSelectionChange'
:handleRowClick='config.methods.handleRowClick'/>
<DataTreeTable
v-if='showType == "treetable"'
:tableData='data.data'
:columns='config.columns'
:loading='data.loading'
:expand='config.expand'
:tableRowClassName='config.methods.tableRowClassName'
:handleSpanMethod='config.methods.handleSpanMethod'
:handleSortChange='config.methods.handleSortChange'
:handleSelectionChange='config.methods.handleSelectionChange'
:handleRowClick='config.methods.handleRowClick'/>
</slot>
</div>
<!-- 分页器 -->
<div class="table-foot" v-if='!isShowButton("notPagination") ? false : data.pageInfo.totalResult'>
<Pagination :total='data.pageInfo.totalResult' :prePageResult='data.pageInfo.prePageResult'/>
</div>
</div>
</template>
<script>
import Pagination from '@/components/Pagination.vue';
import SearchForm from '@/components/SearchForm.vue';
import Confirm from '@/components/Confirm.vue';
import DataTable from '@/components/DataTable.vue';
import DataTableMobile from './DataTableMobile.js';
import DataTableFlow from './DataTableFlow.vue';
import DataTreeTable from '@/components/DataTreeTable.vue';
export default {
props: {
data: {
type: Object,
required: true,
default: () => {}
},
config: {
type: Object,
required: true,
default: () => {}
}
},
components: {
SearchForm,
Pagination,
Confirm,
DataTable,
DataTableMobile,
DataTableFlow,
DataTreeTable
},
methods: {
// 根据url的query参数判断是否展示查询条件
isShowSearch(query) {
if (!this.config.showSearch) {
return false
}
let showSearch = false;
Object.keys(query).forEach(item=>{
if(/^query\./.test(item)){
showSearch = true;
return;
}
});
if (this.config.showSearch) {
showSearch = true;
}
return showSearch;
},
isShowButton(name) {
return this.canShow.indexOf(name) === -1;
},
isShowBtn(name) {
return this.canShow.indexOf(name) !== -1;
},
},
watch: {
'$route'(route) {
this.showSearch = this.isShowSearch(route.query)
},
},
computed: {
isMobile() {
return this.$store.state.isMobile
},
canShow() {
this.showType=this.config.showType?this.config.showType:'table'
return Object.keys(this.$attrs) || [];
}
},
data() {
return {
loading: this.config.loading,
showSearch: this.isShowSearch(this.$route.query),
showType: 'table',
}
}
}
</script>
<style lang="less">
@media screen and (max-width: 800px){
.layout-table{
.table-head{
display: block;
width: 100%;
.el-button{
margin-bottom: 5px;
}
.table-head-left{
margin-bottom: 10px;
display: block;
width: 100%;
}
.el-breadcrumb{
margin-bottom: 10px;
display: block;
width: 100%;
}
}
}
}
.layout-table{
.table-head{
margin-bottom: 10px;
padding-bottom: 12px;
border-bottom: 1px solid #ededed;
.el-breadcrumb{
margin-right: 30px;
}
.table-head-left .buttons{
button + button{ margin-left: 10px}
button + span{ margin-left: 10px}
span + span{ margin-left: 10px}
span + button{ margin-left: 10px}
}
}
.table-form{
padding-top: 10px;
margin-top: 10px;
overflow: hidden;
}
.search-form-wapper{
float: left;
}
.table-foot{
width: 100%;
overflow: auto;
}
&[loading]{
pointer-events: none;
.my-compontent-switch span,
.el-button,
.el-input,
.el-tag,
input{
background: #eee;
color: transparent;
border-color: #eee;
}
input{color: #ccc}
td, th{
color: #eee;
}
.el-pagination{
color: #eee;
span, input, button, li{
color: #eee;
}
}
}
}
</style>
\ No newline at end of file
<template> <template>
<div class="page"> <div class="page">
<div class="page-header"> <div class="page-header">
<div> <div>
...@@ -14,11 +14,13 @@ ...@@ -14,11 +14,13 @@
type="primary" type="primary"
@click="switchMap" @click="switchMap"
:underline="false" :underline="false"
>地图模式</el-link >地图模式
</el-link
> >
</div> </div>
<el-button style="margin-right: 10px" @click="$router.back()" size="small" <el-button style="margin-right: 10px" @click="$router.back()" size="small"
>返回上一级</el-button >返回上一级
</el-button
> >
</div> </div>
<el-divider></el-divider> <el-divider></el-divider>
...@@ -29,7 +31,8 @@ ...@@ -29,7 +31,8 @@
icon="el-icon-tickets" icon="el-icon-tickets"
size="mini" size="mini"
@click="handleImport" @click="handleImport"
>导入</el-button >导入
</el-button
> >
<el-button <el-button
slot="table-head-left2" slot="table-head-left2"
...@@ -38,7 +41,8 @@ ...@@ -38,7 +41,8 @@
size="mini" size="mini"
@click="doExport" @click="doExport"
:disabled="isExport" :disabled="isExport"
>导出</el-button >导出
</el-button
> >
<el-button <el-button
...@@ -47,22 +51,37 @@ ...@@ -47,22 +51,37 @@
icon="el-icon-tickets" icon="el-icon-tickets"
size="mini" size="mini"
@click="batchActiveDevice" @click="batchActiveDevice"
>批量激活</el-button >批量激活
</el-button
> >
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="batchUpdateHall"
>更新大厅
</el-button
>
<el-button <el-button
slot="table-head-left2" slot="table-head-left2"
style="margin-left: 10px" style="margin-left: 10px"
icon="el-icon-tickets" icon="el-icon-tickets"
size="mini" size="mini"
@click="batchRestartApp" @click="batchRestartApp"
>批量重启</el-button >批量重启
</el-button
> >
<el-tag <el-tag
slot="table-body-head" slot="table-body-head"
size="mini" size="mini"
class="cursord" class="cursord"
@click="changeStatAll()" @click="changeStatAll()"
>设备总数:{{ tableData.totalCount }}</el-tag >设备总数:{{ tableData.totalCount }}
</el-tag
> >
<el-tag <el-tag
...@@ -72,7 +91,8 @@ ...@@ -72,7 +91,8 @@
type="success" type="success"
class="cursord" class="cursord"
@click="changeStat(2)" @click="changeStat(2)"
>在线:{{ tableData.onlineCount }}</el-tag >在线:{{ tableData.onlineCount }}
</el-tag
> >
<el-tag <el-tag
...@@ -82,7 +102,8 @@ ...@@ -82,7 +102,8 @@
type="danger" type="danger"
class="cursord" class="cursord"
@click="changeStat(1)" @click="changeStat(1)"
>离线:{{ tableData.offlineCount }}</el-tag >离线:{{ tableData.offlineCount }}
</el-tag
> >
<el-tag <el-tag
...@@ -92,7 +113,8 @@ ...@@ -92,7 +113,8 @@
type="danger" type="danger"
class="cursord" class="cursord"
@click="changeStatEnabled( 0)" @click="changeStatEnabled( 0)"
>停用:{{ tableData.stopCount }}</el-tag >停用:{{ tableData.stopCount }}
</el-tag
> >
<el-tag <el-tag
...@@ -102,7 +124,8 @@ ...@@ -102,7 +124,8 @@
type="danger" type="danger"
class="cursord" class="cursord"
@click="changeStat(0)" @click="changeStat(0)"
>未激活:{{ tableData.unActiveCount }}</el-tag >未激活:{{ tableData.unActiveCount }}
</el-tag
> >
</LayoutTable> </LayoutTable>
...@@ -131,12 +154,14 @@ ...@@ -131,12 +154,14 @@
<em>点击上传</em> <em>点击上传</em>
</div> </div>
<div class="el-upload__tip" slot="tip"> <div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据 <el-checkbox v-model="upload.updateSupport"/>
是否更新已经存在的数据
<el-link <el-link
type="primary" type="primary"
style="font-size: 14px" style="font-size: 14px"
@click="downloadTemplate" @click="downloadTemplate"
>下载模板</el-link >下载模板
</el-link
> >
</div> </div>
<div class="el-upload__tip" style="color: red" slot="tip"> <div class="el-upload__tip" style="color: red" slot="tip">
...@@ -190,20 +215,46 @@ ...@@ -190,20 +215,46 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 大厅修改对话框 -->
<el-dialog
:title="hallDialog.title"
:visible.sync="hallDialog.open"
width="60%"
append-to-body
>
<el-form label-width="120px">
<Field
label="站点大厅"
v-model="hallId"
type="radio"
:enumData="tableData.dict.hallId"
placeholder="请选择所属大厅"
/>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="updateBatchHallConform">确 定</el-button>
<el-button @click="hallDialog.open = false">取 消</el-button>
</div>
</el-dialog>
<!-- 查看二维码弹窗 --> <!-- 查看二维码弹窗 -->
<el-dialog <el-dialog
title="设备二维码" title="设备二维码"
:visible.sync="qrCodeDialog.visible" :visible.sync="qrCodeDialog.visible"
width="350px" width="350px"
> >
<img :src="qrCodeDialog.qrCode" /> <img :src="qrCodeDialog.qrCode"/>
<p style="word-wrap: break-word">{{ qrCodeDialog.qrCodeUrl }}</p> <p style="word-wrap: break-word">{{ qrCodeDialog.qrCodeUrl }}</p>
</el-dialog> </el-dialog>
<!-- <dialog-show ref="dialogform" @ok="getData" /> --> <!-- <dialog-show ref="dialogform" @ok="getData" /> -->
<drawer-show ref="drawerform" @ok="getData" /> <drawer-show ref="drawerform" @ok="getData"/>
<drawer-view ref="drawerViewform" @ok="getData" /> <drawer-view ref="drawerViewform" @ok="getData"/>
</div> </div>
</template> </template>
...@@ -213,14 +264,15 @@ import drawerView from "./drawerview"; ...@@ -213,14 +264,15 @@ import drawerView from "./drawerview";
import drawerShow from "./drawershow"; import drawerShow from "./drawershow";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
import tree from "@/assets/mixins/tree"; import tree from "@/assets/mixins/tree";
export default { export default {
name: "Device", name: "Device",
components: { drawerShow, drawerView }, components: {drawerShow, drawerView},
mixins: [table, tree], mixins: [table, tree],
created() { created() {
this.siteId = this.$route.query.siteId; this.siteId = this.$route.query.siteId;
this.info = this.$route.query; this.info = this.$route.query;
this.query = { siteId: this.siteId }; this.query = {siteId: this.siteId};
this.$get("/sitestat/siteInfo", { this.$get("/sitestat/siteInfo", {
siteId: this.siteId, siteId: this.siteId,
...@@ -250,13 +302,16 @@ export default { ...@@ -250,13 +302,16 @@ export default {
this.upload.title = "设备导入"; this.upload.title = "设备导入";
this.upload.open = true; this.upload.open = true;
}, },
/** 下载模板操作 */ /** 下载模板操作 */
downloadTemplate() { downloadTemplate() {
this.isExport = true; this.isExport = true;
this.$download( this.$download(
"/device/downloadTemplate", "/device/downloadTemplate",
{}, {},
{ type: "excel", fileName: "设备导入模板" } {type: "excel", fileName: "设备导入模板"}
) )
.then(() => (this.isExport = false)) .then(() => (this.isExport = false))
.catch((error) => { .catch((error) => {
...@@ -273,7 +328,7 @@ export default { ...@@ -273,7 +328,7 @@ export default {
this.upload.open = false; this.upload.open = false;
this.upload.isUploading = false; this.upload.isUploading = false;
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true }); this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
this.getData(); this.getData();
}, },
/** 提交上传文件 */ /** 提交上传文件 */
...@@ -290,7 +345,7 @@ export default { ...@@ -290,7 +345,7 @@ export default {
deviceName: this.$route.query["deviceName"], deviceName: this.$route.query["deviceName"],
siteId: this.$route.query["siteId"], siteId: this.$route.query["siteId"],
}, },
{ type: "excel", fileName: "设备表" } {type: "excel", fileName: "设备表"}
) )
.then(() => (this.isExport = false)) .then(() => (this.isExport = false))
.catch((error) => { .catch((error) => {
...@@ -324,7 +379,7 @@ export default { ...@@ -324,7 +379,7 @@ export default {
delete this.query["deviceCode"] delete this.query["deviceCode"]
delete this.query["deviceStatus"] delete this.query["deviceStatus"]
this.query["page"]=1 this.query["page"] = 1
this.query = Object.assign(this.query, { this.query = Object.assign(this.query, {
deviceStatusList: [1, 2], deviceStatusList: [1, 2],
enabled: 1, enabled: 1,
...@@ -333,23 +388,15 @@ export default { ...@@ -333,23 +388,15 @@ export default {
this.getData(); this.getData();
}, },
changeStatEnabled( enabled) { changeStatEnabled(enabled) {
//去除其它条件 //去除其它条件
// delete this.query["productId"] this.query["page"] = 1
//delete this.query["deviceName"]
//delete this.query["deviceCode"]
this.query["page"]=1
this.query = Object.assign(this.query, { this.query = Object.assign(this.query, {
deviceStatusList: [1, 2], deviceStatusList: [1, 2],
enabled: enabled, enabled: enabled,
}); });
this.getData(); this.getData();
// delete this.query.deviceStatus
// delete this.query.deviceStatusList
}, },
changeStat(val) { changeStat(val) {
...@@ -357,9 +404,8 @@ export default { ...@@ -357,9 +404,8 @@ export default {
// delete this.query["productId"] // delete this.query["productId"]
//delete this.query["deviceName"] //delete this.query["deviceName"]
// delete this.query["deviceCode"] // delete this.query["deviceCode"]
this.query = Object.assign(this.query, {deviceStatus: val});
this.query = Object.assign(this.query, { deviceStatus: val }); this.query["page"] = 1
this.query["page"]=1
this.getData(); this.getData();
}, },
...@@ -394,6 +440,37 @@ export default { ...@@ -394,6 +440,37 @@ export default {
}); });
}, },
batchUpdateHall() {
this.hallId=null;
this.hallName=""
this.hallDialog.title = "设备所属大厅设置";
this.hallDialog.open = true;
},
updateBatchHallConform(row) {
this.hallName=this.tableData.dict.hallId[this.hallId];
this.$post("/device/batchUpdateHall", {
idList: this.selection,
hallId: this.hallId,
hallName: this.hallName
})
.then((res) => {
if (res.code == 1) {
this.$message.success("批量更新大厅设备成功!");
this.hallDialog.open=false;
console.log(this.$refs)
this.selection=[]
this.getData();
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
batchRestartApp(row) { batchRestartApp(row) {
this.$post("/device/batchRestartApp", { this.$post("/device/batchRestartApp", {
idList: this.selection, idList: this.selection,
...@@ -425,7 +502,7 @@ export default { ...@@ -425,7 +502,7 @@ export default {
}, },
updateSite(row) { updateSite(row) {
this.$get("/sitestat/siteTree", {}).then(({ data }) => { this.$get("/sitestat/siteTree", {}).then(({data}) => {
this.areaData = data.siteTree; this.areaData = data.siteTree;
this.tree.open = true; this.tree.open = true;
this.tree.id = row.id; this.tree.id = row.id;
...@@ -479,7 +556,7 @@ export default { ...@@ -479,7 +556,7 @@ export default {
}, },
async viewQrCode(id) { async viewQrCode(id) {
try { try {
const { qrCode, qrCodeUrl } = await this.$post("/device/viewQrCode", { const {qrCode, qrCodeUrl} = await this.$post("/device/viewQrCode", {
id: id, id: id,
}); });
this.qrCodeDialog.qrCode = qrCode; this.qrCodeDialog.qrCode = qrCode;
...@@ -511,6 +588,14 @@ export default { ...@@ -511,6 +588,14 @@ export default {
// 上传的地址 // 上传的地址
url: "/m/device/importData", url: "/m/device/importData",
}, },
hallDialog: {
// 是否显示弹出层(设备导入)
open: false,
// 弹出层标题(设备导入)
title: "所属大厅选择",
},
info: {}, info: {},
// 站点树 // 站点树
tree: { tree: {
...@@ -528,8 +613,12 @@ export default { ...@@ -528,8 +613,12 @@ export default {
updateSiteName: "", updateSiteName: "",
updateSiteCode: "", updateSiteCode: "",
hallId: null,
hallName: "",
config: { config: {
getsocketData: null, getsocketData: null,
tableName:"table",
search: [ search: [
{ {
name: "deviceName", name: "deviceName",
...@@ -556,9 +645,9 @@ export default { ...@@ -556,9 +645,9 @@ export default {
reserveSelection: true, reserveSelection: true,
width: 60, width: 60,
}, },
{ type: "index", label: "序号", align: "center", width: 50 }, {type: "index", label: "序号", align: "center", width: 50},
{ label: "设备名称", align: "center", prop: "deviceName" }, {label: "设备名称", align: "center", prop: "deviceName"},
{ {
label: "设备类型", label: "设备类型",
...@@ -567,9 +656,9 @@ export default { ...@@ -567,9 +656,9 @@ export default {
formatter: this.formatter, formatter: this.formatter,
}, },
{ label: "设备编码", align: "center", prop: "deviceCode" }, {label: "设备编码", align: "center", prop: "deviceCode"},
// { label: "mac地址", prop: "deviceMac" }, { label: "所属大厅", prop: "hallName"},
{ {
label: "设备生产商", label: "设备生产商",
...@@ -578,7 +667,7 @@ export default { ...@@ -578,7 +667,7 @@ export default {
formatter: this.formatter, formatter: this.formatter,
width: 250, width: 250,
}, },
{ label: "负责人", align: "center", prop: "leadingOfficial" }, {label: "负责人", align: "center", prop: "leadingOfficial"},
{ {
label: "联系电话", label: "联系电话",
align: "center", align: "center",
...@@ -675,6 +764,7 @@ export default { ...@@ -675,6 +764,7 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.el-divider--horizontal { .el-divider--horizontal {
margin: 2px 0; margin: 2px 0;
background: 0 0; background: 0 0;
......
...@@ -119,6 +119,14 @@ export default { ...@@ -119,6 +119,14 @@ export default {
// toView(row) { // toView(row) {
// this.$refs.dialogform.view(row); // this.$refs.dialogform.view(row);
// }, // },
handAdd(row){
this.$router.push({
path: this.pageInfo.add,
query: {},
})
}
}, },
data() { data() {
return { return {
......
...@@ -20,3 +20,11 @@ ALTER TABLE mortals_xhx_device ADD COLUMN `deviceVersion` varchar (64) COMME ...@@ -20,3 +20,11 @@ ALTER TABLE mortals_xhx_device ADD COLUMN `deviceVersion` varchar (64) COMME
2023-02-2 2023-02-2
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_xhx_device ADD COLUMN `productCode` varchar (64) default '' COMMENT '产品编码' AFTER productId; ALTER TABLE mortals_xhx_device ADD COLUMN `productCode` varchar (64) default '' COMMENT '产品编码' AFTER productId;
-- ----------------------------
2023-04-26
-- ----------------------------
ALTER TABLE mortals_xhx_device ADD COLUMN `hallId` bigint(20) COMMENT '大厅Id' AFTER skinName;
ALTER TABLE mortals_xhx_device ADD COLUMN `hallName` varchar(256) default '' COMMENT '大厅名称' AFTER hallId;
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<profiles.active>develop</profiles.active> <profiles.active>develop</profiles.active>
<profiles.server.port>18222</profiles.server.port> <profiles.server.port>18222</profiles.server.port>
<!-- <profiles.platform.type>standalone</profiles.platform.type>--> <!-- <profiles.platform.type>standalone</profiles.platform.type>-->
<profiles.platform.type>cloud</profiles.platform.type> <profiles.platform.type>standalone</profiles.platform.type>
<profiles.datasource.uri> <profiles.datasource.uri>
<![CDATA[jdbc:mysql://192.168.0.98:3306/device-new-platform?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]></profiles.datasource.uri> <![CDATA[jdbc:mysql://192.168.0.98:3306/device-new-platform?allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]></profiles.datasource.uri>
<profiles.datasource.username>root</profiles.datasource.username> <profiles.datasource.username>root</profiles.datasource.username>
......
...@@ -603,7 +603,7 @@ public class DeviceApiController { ...@@ -603,7 +603,7 @@ public class DeviceApiController {
@PostMapping("callbackByProduct") @PostMapping("callbackByProduct")
@UnAuth @UnAuth
public String callbackByProduct(@RequestBody DeviceMsgReq deviceMsgReq) { public String callbackByProduct(@RequestBody DeviceMsgReq deviceMsgReq) {
log.info("【设备数据消息接收】【请求体】--> " + JSONObject.toJSONString(deviceMsgReq)); log.info("【设备产品数据消息接收】【请求体】--> " + JSONObject.toJSONString(deviceMsgReq));
ApiResp<String> rsp = new ApiResp<>(); ApiResp<String> rsp = new ApiResp<>();
rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel()); rsp.setMsg(ApiRespCodeEnum.SUCCESS.getLabel());
rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue()); rsp.setCode(ApiRespCodeEnum.SUCCESS.getValue());
......
...@@ -85,37 +85,6 @@ public class DownMsgTask implements Runnable { ...@@ -85,37 +85,6 @@ public class DownMsgTask implements Runnable {
TimeUnit.SECONDS.sleep(1); TimeUnit.SECONDS.sleep(1);
} }
/*
list.stream().sorted(Comparator.comparing(DeviceMsgReq::getTimestamp)).forEach(item -> {
//根据设备编码查询设备
DeviceEntity deviceEntity = deviceService.getExtCache(item.getDeviceCode());
if (!ObjectUtils.isEmpty(deviceEntity)) {
TbQueueMsgHeaders header = new DefaultTbQueueMsgHeaders();
header.put(MessageHeader.MESSAGETYPE, item.getMessageType());
header.put(MessageHeader.DEVICECODE, item.getDeviceCode());
header.put(MessageHeader.TIMESTAMP, item.getTimestamp().toString());
TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastUUID(), item.getData(), header);
messageProducer.sendMsg(QueueKey.DEFAULT_EXCHANGE,Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(),JSON.toJSONString(queueMsg));
DeviceLogEntity deviceLogEntity = new DeviceLogEntity();
deviceLogEntity.initAttrValue();
deviceLogEntity.setTraceID(IdUtil.fastSimpleUUID());
deviceLogEntity.setSiteId(deviceEntity.getSiteId());
deviceLogEntity.setDeviceId(deviceEntity.getId());
deviceLogEntity.setDeviceName(deviceEntity.getDeviceName());
deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode());
deviceLogEntity.setMessageHead(item.getMessageType());
deviceLogEntity.setContent(item.getData());
deviceLogEntity.setLogType(LogTypeEnum.下发服务.getValue());
deviceLogEntity.setCreateUserId(1L);
deviceLogEntity.setCreateTime(new Date());
deviceLogService.save(deviceLogEntity,null);
} else {
log.info("未找到设备,deviceCode:{}", item.getDeviceCode());
}
});*/
} catch (Exception e) { } catch (Exception e) {
log.error("异常:", e); log.error("异常:", e);
} }
......
package com.mortals.xhx.module.device.model; package com.mortals.xhx.module.device.model;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.mortals.framework.annotation.Excel;
import com.mortals.xhx.base.framework.CustomJsonDateDeserializer;
import com.mortals.xhx.module.device.model.vo.DeviceVo; import com.mortals.xhx.module.device.model.vo.DeviceVo;
import lombok.Data;
import java.util.Date; import java.util.Date;
/** /**
* 设备实体对象 * 设备实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-11 * @date 2023-04-26
*/ */
@Data
public class DeviceEntity extends DeviceVo { public class DeviceEntity extends DeviceVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 设备名称 * 设备名称
*/ */
@Excel(name = "设备名称")
private String deviceName; private String deviceName;
/**
* 设备SN码
*/
@Excel(name = "设备SN码")
private String deviceSN;
/** /**
* 设备编码,默认为MAC地址 * 设备编码,SN码等,默认为MAC地址
*/ */
@Excel(name = "设备编码")
private String deviceCode; private String deviceCode;
/** /**
* 设备的MAC地址 * 设备的MAC地址
*/ */
@Excel(name = "Mac地址",type = Excel.Type.EXPORT)
private String deviceMac; private String deviceMac;
/** /**
* 站点Id,来源基础服务平台 * 站点Id,来源基础服务平台
...@@ -62,15 +50,22 @@ public class DeviceEntity extends DeviceVo { ...@@ -62,15 +50,22 @@ public class DeviceEntity extends DeviceVo {
* 产品Id * 产品Id
*/ */
private Long productId; private Long productId;
/**
* 产品编码
*/
@Excel(name = "产品类型",cacheDict = "productDict" ,type = Excel.Type.IMPORT)
private String productCode;
/** /**
* 产品名称 * 产品名称
*/ */
private String productName; private String productName;
/**
* 皮肤id
*/
private Long skinId;
/**
* 皮肤名称
*/
private String skinName;
/**
* 首页地址
*/
private String homeUrl;
/** /**
* 设备生产厂商ID * 设备生产厂商ID
*/ */
...@@ -106,7 +101,6 @@ public class DeviceEntity extends DeviceVo { ...@@ -106,7 +101,6 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 保修期至 * 保修期至
*/ */
@JsonDeserialize(using = CustomJsonDateDeserializer.class)
private Date defectsLiabilityPeriod; private Date defectsLiabilityPeriod;
/** /**
* 负责人 * 负责人
...@@ -123,7 +117,6 @@ public class DeviceEntity extends DeviceVo { ...@@ -123,7 +117,6 @@ public class DeviceEntity extends DeviceVo {
/** /**
* 设备图片 * 设备图片
*/ */
@Excel(name = "设备图片",height = 90, type = Excel.Type.EXPORT, cellType = Excel.ColumnType.IMAGE)
private String devicePhotoPath; private String devicePhotoPath;
/** /**
* 设备访问ip * 设备访问ip
...@@ -173,574 +166,26 @@ public class DeviceEntity extends DeviceVo { ...@@ -173,574 +166,26 @@ public class DeviceEntity extends DeviceVo {
* 设备来源(0.旧设备,1.新设备) * 设备来源(0.旧设备,1.新设备)
*/ */
private Integer source; private Integer source;
/**
* 皮肤id
*/
private Long skinId;
/** /**
* 皮肤名称 * 设备SN码
*/
private String skinName;
/**
* 首页地址
*/ */
private String homeUrl; private String deviceSN;
/** /**
* 设备版本 * 设备版本
*/ */
private String deviceVersion; private String deviceVersion;
public DeviceEntity(){}
/**
* 获取 设备名称
* @return String
*/
public String getDeviceName(){
return deviceName;
}
/**
* 设置 设备名称
* @param deviceName
*/
public void setDeviceName(String deviceName){
this.deviceName = deviceName;
}
/**
* 获取 设备编码,SN码等,默认为MAC地址
* @return String
*/
public String getDeviceCode(){
return deviceCode;
}
/**
* 设置 设备编码,SN码等,默认为MAC地址
* @param deviceCode
*/
public void setDeviceCode(String deviceCode){
this.deviceCode = deviceCode;
}
/**
* 获取 设备的MAC地址
* @return String
*/
public String getDeviceMac(){
return deviceMac;
}
/**
* 设置 设备的MAC地址
* @param deviceMac
*/
public void setDeviceMac(String deviceMac){
this.deviceMac = deviceMac;
}
/**
* 获取 站点Id,来源基础服务平台
* @return Long
*/
public Long getSiteId(){
return siteId;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteId
*/
public void setSiteId(Long siteId){
this.siteId = siteId;
}
/**
* 获取 站点编号,来源基础服务平台
* @return String
*/
public String getSiteCode(){
return siteCode;
}
/**
* 设置 站点编号,来源基础服务平台
* @param siteCode
*/
public void setSiteCode(String siteCode){
this.siteCode = siteCode;
}
/**
* 获取 站点名称
* @return String
*/
public String getSiteName(){
return siteName;
}
/**
* 设置 站点名称
* @param siteName
*/
public void setSiteName(String siteName){
this.siteName = siteName;
}
/**
* 获取 平台系统Id
* @return Long
*/
public Long getPlatformId(){
return platformId;
}
/**
* 设置 平台系统Id
* @param platformId
*/
public void setPlatformId(Long platformId){
this.platformId = platformId;
}
/**
* 获取 平台系统名称
* @return String
*/
public String getPlatformName(){
return platformName;
}
/**
* 设置 平台系统名称
* @param platformName
*/
public void setPlatformName(String platformName){
this.platformName = platformName;
}
/**
* 获取 产品Id
* @return Long
*/
public Long getProductId(){
return productId;
}
/**
* 设置 产品Id
* @param productId
*/
public void setProductId(Long productId){
this.productId = productId;
}
/**
* 获取 产品编码
* @return String
*/
public String getProductCode(){
return productCode;
}
/**
* 设置 产品编码
* @param productCode
*/
public void setProductCode(String productCode) {
this.productCode = productCode;
}
/**
* 获取 产品名称
* @return String
*/
public String getProductName(){
return productName;
}
/**
* 设置 产品名称
* @param productName
*/
public void setProductName(String productName){
this.productName = productName;
}
/**
* 获取 设备生产厂商ID
* @return Long
*/
public Long getDeviceFirmId(){
return deviceFirmId;
}
/**
* 设置 设备生产厂商ID
* @param deviceFirmId
*/
public void setDeviceFirmId(Long deviceFirmId){
this.deviceFirmId = deviceFirmId;
}
/**
* 获取 设备生产厂商名称
* @return String
*/
public String getDeviceFirmname(){
return deviceFirmname;
}
/**
* 设置 设备生产厂商名称
* @param deviceFirmname
*/
public void setDeviceFirmname(String deviceFirmname){
this.deviceFirmname = deviceFirmname;
}
/**
* 获取 设备来源(0.子设备,1.网关设备,2.直连设备)
* @return Integer
*/
public Integer getDeviceSrc(){
return deviceSrc;
}
/**
* 设置 设备来源(0.子设备,1.网关设备,2.直连设备)
* @param deviceSrc
*/
public void setDeviceSrc(Integer deviceSrc){
this.deviceSrc = deviceSrc;
}
/**
* 获取 数据获取方式(0.主动上报,1.被动拉取)
* @return Integer
*/
public Integer getDeviceDataSourceWay(){
return deviceDataSourceWay;
}
/**
* 设置 数据获取方式(0.主动上报,1.被动拉取)
* @param deviceDataSourceWay
*/
public void setDeviceDataSourceWay(Integer deviceDataSourceWay){
this.deviceDataSourceWay = deviceDataSourceWay;
}
/**
* 获取 经度
* @return String
*/
public String getLon(){
return lon;
}
/**
* 设置 经度
* @param lon
*/
public void setLon(String lon){
this.lon = lon;
}
/**
* 获取 经度
* @return String
*/
public String getLati(){
return lati;
}
/**
* 设置 经度
* @param lati
*/
public void setLati(String lati){
this.lati = lati;
}
/**
* 获取 所属楼栋
* @return Integer
*/
public Integer getDeviceInBuilding(){
return deviceInBuilding;
}
/**
* 设置 所属楼栋
* @param deviceInBuilding
*/
public void setDeviceInBuilding(Integer deviceInBuilding){
this.deviceInBuilding = deviceInBuilding;
}
/**
* 获取 所属楼层
* @return Integer
*/
public Integer getDeviceInFloor(){
return deviceInFloor;
}
/**
* 设置 所属楼层
* @param deviceInFloor
*/
public void setDeviceInFloor(Integer deviceInFloor){
this.deviceInFloor = deviceInFloor;
}
/**
* 获取 保修期至
* @return Date
*/
public Date getDefectsLiabilityPeriod(){
return defectsLiabilityPeriod;
}
/**
* 设置 保修期至
* @param defectsLiabilityPeriod
*/
public void setDefectsLiabilityPeriod(Date defectsLiabilityPeriod){
this.defectsLiabilityPeriod = defectsLiabilityPeriod;
}
/**
* 获取 负责人
* @return String
*/
public String getLeadingOfficial(){
return leadingOfficial;
}
/**
* 设置 负责人
* @param leadingOfficial
*/
public void setLeadingOfficial(String leadingOfficial){
this.leadingOfficial = leadingOfficial;
}
/**
* 获取 联系电话
* @return String
*/
public String getLeadingOfficialTelephone(){
return leadingOfficialTelephone;
}
/**
* 设置 联系电话
* @param leadingOfficialTelephone
*/
public void setLeadingOfficialTelephone(String leadingOfficialTelephone){
this.leadingOfficialTelephone = leadingOfficialTelephone;
}
/**
* 获取 是否接收异常短(0.否,1.是)
* @return Integer
*/
public Integer getIsReceiveMess(){
return isReceiveMess;
}
/**
* 设置 是否接收异常短(0.否,1.是)
* @param isReceiveMess
*/
public void setIsReceiveMess(Integer isReceiveMess){
this.isReceiveMess = isReceiveMess;
}
/**
* 获取 设备图片
* @return String
*/
public String getDevicePhotoPath(){
return devicePhotoPath;
}
/**
* 设置 设备图片
* @param devicePhotoPath
*/
public void setDevicePhotoPath(String devicePhotoPath){
this.devicePhotoPath = devicePhotoPath;
}
/** /**
* 获取 设备访问ip * 产品编码
* @return String
*/
public String getIp(){
return ip;
}
/**
* 设置 设备访问ip
* @param ip
*/
public void setIp(String ip){
this.ip = ip;
}
/**
* 获取 中心设备编码
* @return String
*/
public String getCenternum(){
return centernum;
}
/**
* 设置 中心设备编码
* @param centernum
*/
public void setCenternum(String centernum){
this.centernum = centernum;
}
/**
* 获取 端口
* @return String
*/
public String getPort(){
return port;
}
/**
* 设置 端口
* @param port
*/
public void setPort(String port){
this.port = port;
}
/**
* 获取 设备topic信息
* @return String
*/
public String getDeviceTopic(){
return deviceTopic;
}
/**
* 设置 设备topic信息
* @param deviceTopic
*/
public void setDeviceTopic(String deviceTopic){
this.deviceTopic = deviceTopic;
}
/**
* 获取 设备状态 (0.未激活,1.离线,2.在线)
* @return Integer
*/
public Integer getDeviceStatus(){
return deviceStatus;
}
/**
* 设置 设备状态 (0.未激活,1.离线,2.在线)
* @param deviceStatus
*/
public void setDeviceStatus(Integer deviceStatus){
this.deviceStatus = deviceStatus;
}
/**
* 获取 启用状态 (0.停止,1.启用)
* @return Integer
*/
public Integer getEnabled(){
return enabled;
}
/**
* 设置 启用状态 (0.停止,1.启用)
* @param enabled
*/
public void setEnabled(Integer enabled){
this.enabled = enabled;
}
/**
* 获取 设备授权码
* @return String
*/
public String getDeviceAuthCode(){
return deviceAuthCode;
}
/**
* 设置 设备授权码
* @param deviceAuthCode
*/
public void setDeviceAuthCode(String deviceAuthCode){
this.deviceAuthCode = deviceAuthCode;
}
/**
* 获取 备注
* @return String
*/
public String getDeviceRemark(){
return deviceRemark;
}
/**
* 设置 备注
* @param deviceRemark
*/
public void setDeviceRemark(String deviceRemark){
this.deviceRemark = deviceRemark;
}
/**
* 获取 最近上线时间
* @return Date
*/
public Date getOnlineTime(){
return onlineTime;
}
/**
* 设置 最近上线时间
* @param onlineTime
*/
public void setOnlineTime(Date onlineTime){
this.onlineTime = onlineTime;
}
/**
* 获取 最近离线时间
* @return Date
*/
public Date getOfflineTime(){
return offlineTime;
}
/**
* 设置 最近离线时间
* @param offlineTime
*/
public void setOfflineTime(Date offlineTime){
this.offlineTime = offlineTime;
}
/**
* 获取 是否删除(0.否,1.是)
* @return Integer
*/
public Integer getDeleted(){
return deleted;
}
/**
* 设置 是否删除(0.否,1.是)
* @param deleted
*/ */
public void setDeleted(Integer deleted){ private String productCode;
this.deleted = deleted;
}
/** /**
* 获取 收不来源(0.旧设备,1.新设备) * 大厅Id
* @return Integer
*/ */
public Integer getSource(){ private Long hallId;
return source;
}
/** /**
* 设置 收不来源(0.旧设备,1.新设备) * 大厅名称
* @param source
*/ */
public void setSource(Integer source){ private String hallName;
this.source = source;
}
public Long getSkinId() {
return skinId;
}
public void setSkinId(Long skinId) {
this.skinId = skinId;
}
public String getSkinName() {
return skinName;
}
public void setSkinName(String skinName) {
this.skinName = skinName;
}
public String getHomeUrl() {
return homeUrl;
}
public void setHomeUrl(String homeUrl) {
this.homeUrl = homeUrl;
}
public String getDeviceSN() {
return deviceSN;
}
public void setDeviceSN(String deviceSN) {
this.deviceSN = deviceSN;
}
public String getDeviceVersion() {
return deviceVersion;
}
public void setDeviceVersion(String deviceVersion) {
this.deviceVersion = deviceVersion;
}
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -757,54 +202,12 @@ public class DeviceEntity extends DeviceVo { ...@@ -757,54 +202,12 @@ public class DeviceEntity extends DeviceVo {
return false; return false;
} }
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",deviceName:").append(getDeviceName());
sb.append(",deviceCode:").append(getDeviceCode());
sb.append(",deviceMac:").append(getDeviceMac());
sb.append(",siteId:").append(getSiteId());
sb.append(",siteCode:").append(getSiteCode());
sb.append(",siteName:").append(getSiteName());
sb.append(",platformId:").append(getPlatformId());
sb.append(",platformName:").append(getPlatformName());
sb.append(",productId:").append(getProductId());
sb.append(",productName:").append(getProductName());
sb.append(",deviceFirmId:").append(getDeviceFirmId());
sb.append(",deviceFirmname:").append(getDeviceFirmname());
sb.append(",deviceSrc:").append(getDeviceSrc());
sb.append(",deviceDataSourceWay:").append(getDeviceDataSourceWay());
sb.append(",lon:").append(getLon());
sb.append(",lati:").append(getLati());
sb.append(",deviceInBuilding:").append(getDeviceInBuilding());
sb.append(",deviceInFloor:").append(getDeviceInFloor());
sb.append(",defectsLiabilityPeriod:").append(getDefectsLiabilityPeriod());
sb.append(",leadingOfficial:").append(getLeadingOfficial());
sb.append(",leadingOfficialTelephone:").append(getLeadingOfficialTelephone());
sb.append(",isReceiveMess:").append(getIsReceiveMess());
sb.append(",devicePhotoPath:").append(getDevicePhotoPath());
sb.append(",ip:").append(getIp());
sb.append(",centernum:").append(getCenternum());
sb.append(",port:").append(getPort());
sb.append(",deviceTopic:").append(getDeviceTopic());
sb.append(",deviceStatus:").append(getDeviceStatus());
sb.append(",enabled:").append(getEnabled());
sb.append(",deviceAuthCode:").append(getDeviceAuthCode());
sb.append(",deviceRemark:").append(getDeviceRemark());
sb.append(",onlineTime:").append(getOnlineTime());
sb.append(",offlineTime:").append(getOfflineTime());
sb.append(",deleted:").append(getDeleted());
sb.append(",source:").append(getSource());
return sb.toString();
}
public void initAttrValue(){ public void initAttrValue(){
this.deviceName = ""; this.deviceName = "";
this.deviceCode = ""; this.deviceCode = "";
this.deviceSN = "";
this.deviceMac = ""; this.deviceMac = "";
this.siteId = null; this.siteId = null;
...@@ -819,10 +222,14 @@ public class DeviceEntity extends DeviceVo { ...@@ -819,10 +222,14 @@ public class DeviceEntity extends DeviceVo {
this.productId = null; this.productId = null;
this.productCode = "";
this.productName = ""; this.productName = "";
this.skinId = null;
this.skinName = "";
this.homeUrl = "";
this.deviceFirmId = null; this.deviceFirmId = null;
this.deviceFirmname = ""; this.deviceFirmname = "";
...@@ -873,12 +280,14 @@ public class DeviceEntity extends DeviceVo { ...@@ -873,12 +280,14 @@ public class DeviceEntity extends DeviceVo {
this.source = 1; this.source = 1;
this.skinId = null; this.deviceSN = "";
this.skinName = "";
this.deviceVersion = ""; this.deviceVersion = "";
this.homeUrl = ""; this.productCode = "";
this.hallId = null;
this.hallName = "";
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.device.model; package com.mortals.xhx.module.device.model;
import java.util.Date;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.device.model.DeviceEntity;
/** /**
* 设备查询对象 * 设备查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-02-25 * @date 2023-04-26
*/ */
public class DeviceQuery extends DeviceEntity { public class DeviceQuery extends DeviceEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
...@@ -413,6 +415,26 @@ public class DeviceQuery extends DeviceEntity { ...@@ -413,6 +415,26 @@ public class DeviceQuery extends DeviceEntity {
/** 产品编码排除列表 */ /** 产品编码排除列表 */
private List <String> productCodeNotList; private List <String> productCodeNotList;
/** 开始 大厅Id */
private Long hallIdStart;
/** 结束 大厅Id */
private Long hallIdEnd;
/** 增加 大厅Id */
private Long hallIdIncrement;
/** 大厅Id列表 */
private List <Long> hallIdList;
/** 大厅Id排除列表 */
private List <Long> hallIdNotList;
/** 大厅名称 */
private List<String> hallNameList;
/** 大厅名称排除列表 */
private List <String> hallNameNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DeviceQuery> orConditionList; private List<DeviceQuery> orConditionList;
...@@ -2726,6 +2748,119 @@ public class DeviceQuery extends DeviceEntity { ...@@ -2726,6 +2748,119 @@ public class DeviceQuery extends DeviceEntity {
this.productCodeNotList = productCodeNotList; this.productCodeNotList = productCodeNotList;
} }
/**
* 获取 开始 大厅Id
* @return hallIdStart
*/
public Long getHallIdStart(){
return this.hallIdStart;
}
/**
* 设置 开始 大厅Id
* @param hallIdStart
*/
public void setHallIdStart(Long hallIdStart){
this.hallIdStart = hallIdStart;
}
/**
* 获取 结束 大厅Id
* @return $hallIdEnd
*/
public Long getHallIdEnd(){
return this.hallIdEnd;
}
/**
* 设置 结束 大厅Id
* @param hallIdEnd
*/
public void setHallIdEnd(Long hallIdEnd){
this.hallIdEnd = hallIdEnd;
}
/**
* 获取 增加 大厅Id
* @return hallIdIncrement
*/
public Long getHallIdIncrement(){
return this.hallIdIncrement;
}
/**
* 设置 增加 大厅Id
* @param hallIdIncrement
*/
public void setHallIdIncrement(Long hallIdIncrement){
this.hallIdIncrement = hallIdIncrement;
}
/**
* 获取 大厅Id
* @return hallIdList
*/
public List<Long> getHallIdList(){
return this.hallIdList;
}
/**
* 设置 大厅Id
* @param hallIdList
*/
public void setHallIdList(List<Long> hallIdList){
this.hallIdList = hallIdList;
}
/**
* 获取 大厅Id
* @return hallIdNotList
*/
public List<Long> getHallIdNotList(){
return this.hallIdNotList;
}
/**
* 设置 大厅Id
* @param hallIdNotList
*/
public void setHallIdNotList(List<Long> hallIdNotList){
this.hallIdNotList = hallIdNotList;
}
/**
* 获取 大厅名称
* @return hallNameList
*/
public List<String> getHallNameList(){
return this.hallNameList;
}
/**
* 设置 大厅名称
* @param hallNameList
*/
public void setHallNameList(List<String> hallNameList){
this.hallNameList = hallNameList;
}
/**
* 获取 大厅名称
* @return hallNameNotList
*/
public List<String> getHallNameNotList(){
return this.hallNameNotList;
}
/**
* 设置 大厅名称
* @param hallNameNotList
*/
public void setHallNameNotList(List<String> hallNameNotList){
this.hallNameNotList = hallNameNotList;
}
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param id * @param id
...@@ -4105,6 +4240,79 @@ public class DeviceQuery extends DeviceEntity { ...@@ -4105,6 +4240,79 @@ public class DeviceQuery extends DeviceEntity {
return this; return this;
} }
/**
* 设置 大厅Id
* @param hallId
*/
public DeviceQuery hallId(Long hallId){
setHallId(hallId);
return this;
}
/**
* 设置 开始 大厅Id
* @param hallIdStart
*/
public DeviceQuery hallIdStart(Long hallIdStart){
this.hallIdStart = hallIdStart;
return this;
}
/**
* 设置 结束 大厅Id
* @param hallIdEnd
*/
public DeviceQuery hallIdEnd(Long hallIdEnd){
this.hallIdEnd = hallIdEnd;
return this;
}
/**
* 设置 增加 大厅Id
* @param hallIdIncrement
*/
public DeviceQuery hallIdIncrement(Long hallIdIncrement){
this.hallIdIncrement = hallIdIncrement;
return this;
}
/**
* 设置 大厅Id
* @param hallIdList
*/
public DeviceQuery hallIdList(List<Long> hallIdList){
this.hallIdList = hallIdList;
return this;
}
/**
* 设置 大厅Id
* @param hallIdNotList
*/
public DeviceQuery hallIdNotList(List<Long> hallIdNotList){
this.hallIdNotList = hallIdNotList;
return this;
}
/**
* 设置 大厅名称
* @param hallName
*/
public DeviceQuery hallName(String hallName){
setHallName(hallName);
return this;
}
/**
* 设置 大厅名称
* @param hallNameList
*/
public DeviceQuery hallNameList(List<String> hallNameList){
this.hallNameList = hallNameList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
...@@ -48,6 +48,9 @@ public interface DeviceService extends ICRUDCacheService<DeviceEntity,Long>{ ...@@ -48,6 +48,9 @@ public interface DeviceService extends ICRUDCacheService<DeviceEntity,Long>{
*/ */
void restartApp(DeviceEntity deviceEntity,Context context); void restartApp(DeviceEntity deviceEntity,Context context);
void batchUpdateHall(DeviceEntity deviceEntity,Context context);
/** /**
* 设备启用停用 * 设备启用停用
* @param id * @param id
......
...@@ -73,7 +73,7 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D ...@@ -73,7 +73,7 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D
//RuntimeUtil //RuntimeUtil
//部署路径是否存在 如果不存在 创建目录, //部署路径是否存在 如果不存在 创建目录,
String path = GlobalSysInfo.getParamValue(Constant.DISTRIBUTE_PATH, "/home/publish/device-manager-ui/homeDeviceUrl"); String path = GlobalSysInfo.getParamValue(Constant.DISTRIBUTE_PATH, "/home/publish/app/homeDeviceUrl");
String code = distributeEntity.getProductCode(); String code = distributeEntity.getProductCode();
String imageRe = distributeEntity.getImageResolutionValue(); String imageRe = distributeEntity.getImageResolutionValue();
String disPath = "/" + path + "/" + code + "/" + imageRe; String disPath = "/" + path + "/" + code + "/" + imageRe;
......
...@@ -261,6 +261,27 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -261,6 +261,27 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
} }
@Override
public void batchUpdateHall(DeviceEntity deviceEntity, Context context) {
if (ObjectUtils.isEmpty(deviceEntity.getIdList())) {
throw new AppException("请选择需要更新大厅的设备!");
}
if(ObjectUtils.isEmpty(deviceEntity.getHallId())){
throw new AppException("设备所属大厅不能为空!");
}
DeviceQuery condition = new DeviceQuery();
condition.setIdList(deviceEntity.getIdList());
DeviceQuery deviceQuery = new DeviceQuery();
deviceQuery.setHallId(deviceEntity.getHallId());
deviceQuery.setHallName(deviceEntity.getHallName());
deviceQuery.setUpdateTime(new Date());
this.getDeviceDao().update(deviceQuery, condition);
}
@Override @Override
public void deviceEnabled(Long id, Integer enabled, Context context) { public void deviceEnabled(Long id, Integer enabled, Context context) {
DeviceEntity deviceEntity = this.get(id, context); DeviceEntity deviceEntity = this.get(id, context);
......
...@@ -14,10 +14,12 @@ import com.mortals.xhx.base.system.param.service.ParamService; ...@@ -14,10 +14,12 @@ import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.*; import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.pdu.RespData; import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.site.SiteHallPdu;
import com.mortals.xhx.common.pdu.site.SitePdu; import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.common.pdu.skin.SkinBasePdu; import com.mortals.xhx.common.pdu.skin.SkinBasePdu;
import com.mortals.xhx.common.utils.QRCodeUtil; import com.mortals.xhx.common.utils.QRCodeUtil;
import com.mortals.xhx.feign.site.ISiteFeign; import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.feign.site.ISiteHallFeign;
import com.mortals.xhx.feign.skin.ISkinBaseFeign; import com.mortals.xhx.feign.skin.ISkinBaseFeign;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceMapEntity; import com.mortals.xhx.module.device.model.DeviceMapEntity;
...@@ -73,6 +75,8 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -73,6 +75,8 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
private String platFormType;//版本,默认云服务版本 private String platFormType;//版本,默认云服务版本
@Autowired @Autowired
private SiteService siteService; private SiteService siteService;
@Autowired
public ISiteHallFeign siteHallFeign;
public DeviceController() { public DeviceController() {
...@@ -100,6 +104,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -100,6 +104,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
this.addDict(model, "skinProductCodeMap", skinProductCodeMap); this.addDict(model, "skinProductCodeMap", skinProductCodeMap);
} }
} }
//siteHallFeign.list(new SiteHallPdu().setSiteId(context.g);)
super.init(model, context); super.init(model, context);
} }
...@@ -108,6 +113,14 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -108,6 +113,14 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
List<OrderCol> orderColList = new ArrayList<>(); List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("createTime", OrderCol.DESCENDING)); orderColList.add(new OrderCol("createTime", OrderCol.DESCENDING));
query.setOrderColList(orderColList); query.setOrderColList(orderColList);
SiteHallPdu siteHallPdu = new SiteHallPdu();
siteHallPdu.setSiteId(query.getSiteId());
Rest<RespData<List<SiteHallPdu>>> rest = siteHallFeign.list(siteHallPdu);
if(rest.getCode()==YesNoEnum.YES.getValue()){
Map<String, String> hallMap = rest.getData().getData().stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getHallName(), (o, n) -> n));
this.addDict(model, "hallId", hallMap);
}
super.doListBefore(query, model, context); super.doListBefore(query, model, context);
} }
...@@ -328,6 +341,25 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -328,6 +341,25 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
return Rest.ok(model); return Rest.ok(model);
} }
/**
* 设备批量更新设备所属大厅
*/
@PostMapping(value = "batchUpdateHall")
public Rest<Void> batchUpdateHall(@RequestBody DeviceEntity deviceEntity) {
log.info("批量设备重启", deviceEntity.getDeviceCode());
String busiDesc = this.getModuleDesc() + "批量更新所属大厅";
Rest<Void> rest = Rest.ok(busiDesc + " 【成功】");
try {
this.service.batchUpdateHall(deviceEntity,getContext());
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error("批量更新所属大厅", e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
@Override @Override
public void doImportDataBefore(List<DeviceEntity> list, boolean updateSupport, Context context) throws AppException { public void doImportDataBefore(List<DeviceEntity> list, boolean updateSupport, Context context) throws AppException {
......
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
<result property="deviceSN" column="deviceSN" /> <result property="deviceSN" column="deviceSN" />
<result property="deviceVersion" column="deviceVersion" /> <result property="deviceVersion" column="deviceVersion" />
<result property="productCode" column="productCode" /> <result property="productCode" column="productCode" />
<result property="hallId" column="hallId" />
<result property="hallName" column="hallName" />
</resultMap> </resultMap>
...@@ -196,23 +198,29 @@ ...@@ -196,23 +198,29 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productCode') or colPickMode == 1 and data.containsKey('productCode')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productCode') or colPickMode == 1 and data.containsKey('productCode')))">
a.productCode, a.productCode,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('hallId') or colPickMode == 1 and data.containsKey('hallId')))">
a.hallId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('hallName') or colPickMode == 1 and data.containsKey('hallName')))">
a.hallName,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DeviceEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="DeviceEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_device insert into mortals_xhx_device
(deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime,deviceSN,deviceVersion,productCode) (deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime,deviceSN,deviceVersion,productCode,hallId,hallName)
VALUES VALUES
(#{deviceName},#{deviceCode},#{deviceMac},#{siteId},#{siteCode},#{siteName},#{platformId},#{platformName},#{productId},#{productName},#{skinId},#{skinName},#{homeUrl},#{deviceFirmId},#{deviceFirmname},#{deviceSrc},#{deviceDataSourceWay},#{lon},#{lati},#{deviceInBuilding},#{deviceInFloor},#{defectsLiabilityPeriod},#{leadingOfficial},#{leadingOfficialTelephone},#{isReceiveMess},#{devicePhotoPath},#{ip},#{centernum},#{port},#{deviceTopic},#{deviceStatus},#{enabled},#{deviceAuthCode},#{deviceRemark},#{onlineTime},#{offlineTime},#{deleted},#{source},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{deviceSN},#{deviceVersion},#{productCode}) (#{deviceName},#{deviceCode},#{deviceMac},#{siteId},#{siteCode},#{siteName},#{platformId},#{platformName},#{productId},#{productName},#{skinId},#{skinName},#{homeUrl},#{deviceFirmId},#{deviceFirmname},#{deviceSrc},#{deviceDataSourceWay},#{lon},#{lati},#{deviceInBuilding},#{deviceInFloor},#{defectsLiabilityPeriod},#{leadingOfficial},#{leadingOfficialTelephone},#{isReceiveMess},#{devicePhotoPath},#{ip},#{centernum},#{port},#{deviceTopic},#{deviceStatus},#{enabled},#{deviceAuthCode},#{deviceRemark},#{onlineTime},#{offlineTime},#{deleted},#{source},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{deviceSN},#{deviceVersion},#{productCode},#{hallId},#{hallName})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_device insert into mortals_xhx_device
(deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime,deviceSN,deviceVersion,productCode) (deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime,deviceSN,deviceVersion,productCode,hallId,hallName)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.deviceName},#{item.deviceCode},#{item.deviceMac},#{item.siteId},#{item.siteCode},#{item.siteName},#{item.platformId},#{item.platformName},#{item.productId},#{item.productName},#{item.skinId},#{item.skinName},#{item.homeUrl},#{item.deviceFirmId},#{item.deviceFirmname},#{item.deviceSrc},#{item.deviceDataSourceWay},#{item.lon},#{item.lati},#{item.deviceInBuilding},#{item.deviceInFloor},#{item.defectsLiabilityPeriod},#{item.leadingOfficial},#{item.leadingOfficialTelephone},#{item.isReceiveMess},#{item.devicePhotoPath},#{item.ip},#{item.centernum},#{item.port},#{item.deviceTopic},#{item.deviceStatus},#{item.enabled},#{item.deviceAuthCode},#{item.deviceRemark},#{item.onlineTime},#{item.offlineTime},#{item.deleted},#{item.source},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.deviceSN},#{item.deviceVersion},#{item.productCode}) (#{item.deviceName},#{item.deviceCode},#{item.deviceMac},#{item.siteId},#{item.siteCode},#{item.siteName},#{item.platformId},#{item.platformName},#{item.productId},#{item.productName},#{item.skinId},#{item.skinName},#{item.homeUrl},#{item.deviceFirmId},#{item.deviceFirmname},#{item.deviceSrc},#{item.deviceDataSourceWay},#{item.lon},#{item.lati},#{item.deviceInBuilding},#{item.deviceInFloor},#{item.defectsLiabilityPeriod},#{item.leadingOfficial},#{item.leadingOfficialTelephone},#{item.isReceiveMess},#{item.devicePhotoPath},#{item.ip},#{item.centernum},#{item.port},#{item.deviceTopic},#{item.deviceStatus},#{item.enabled},#{item.deviceAuthCode},#{item.deviceRemark},#{item.onlineTime},#{item.offlineTime},#{item.deleted},#{item.source},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.deviceSN},#{item.deviceVersion},#{item.productCode},#{item.hallId},#{item.hallName})
</foreach> </foreach>
</insert> </insert>
...@@ -405,6 +413,15 @@ ...@@ -405,6 +413,15 @@
<if test="(colPickMode==0 and data.containsKey('productCode')) or (colPickMode==1 and !data.containsKey('productCode'))"> <if test="(colPickMode==0 and data.containsKey('productCode')) or (colPickMode==1 and !data.containsKey('productCode'))">
a.productCode=#{data.productCode}, a.productCode=#{data.productCode},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('hallId')) or (colPickMode==1 and !data.containsKey('hallId'))">
a.hallId=#{data.hallId},
</if>
<if test="(colPickMode==0 and data.containsKey('hallIdIncrement')) or (colPickMode==1 and !data.containsKey('hallIdIncrement'))">
a.hallId=ifnull(a.hallId,0) + #{data.hallIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('hallName')) or (colPickMode==1 and !data.containsKey('hallName'))">
a.hallName=#{data.hallName},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -812,6 +829,25 @@ ...@@ -812,6 +829,25 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="hallId=(case" suffix="ELSE hallId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('hallId')) or (colPickMode==1 and !item.containsKey('hallId'))">
when a.id=#{item.id} then #{item.hallId}
</when>
<when test="(colPickMode==0 and item.containsKey('hallIdIncrement')) or (colPickMode==1 and !item.containsKey('hallIdIncrement'))">
when a.id=#{item.id} then ifnull(a.hallId,0) + #{item.hallIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="hallName=(case" suffix="ELSE hallName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('hallName')) or (colPickMode==1 and !item.containsKey('hallName'))">
when a.id=#{item.id} then #{item.hallName}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -1966,6 +2002,54 @@ ...@@ -1966,6 +2002,54 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('hallId')">
<if test="conditionParamRef.hallId != null ">
${_conditionType_} a.hallId = #{${_conditionParam_}.hallId}
</if>
<if test="conditionParamRef.hallId == null">
${_conditionType_} a.hallId is null
</if>
</if>
<if test="conditionParamRef.containsKey('hallIdList') and conditionParamRef.hallIdList.size() > 0">
${_conditionType_} a.hallId in
<foreach collection="conditionParamRef.hallIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('hallIdNotList') and conditionParamRef.hallIdNotList.size() > 0">
${_conditionType_} a.hallId not in
<foreach collection="conditionParamRef.hallIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('hallIdStart') and conditionParamRef.hallIdStart != null">
${_conditionType_} a.hallId <![CDATA[ >= ]]> #{${_conditionParam_}.hallIdStart}
</if>
<if test="conditionParamRef.containsKey('hallIdEnd') and conditionParamRef.hallIdEnd != null">
${_conditionType_} a.hallId <![CDATA[ <= ]]> #{${_conditionParam_}.hallIdEnd}
</if>
<if test="conditionParamRef.containsKey('hallName')">
<if test="conditionParamRef.hallName != null and conditionParamRef.hallName != ''">
${_conditionType_} a.hallName like #{${_conditionParam_}.hallName}
</if>
<if test="conditionParamRef.hallName == null">
${_conditionType_} a.hallName is null
</if>
</if>
<if test="conditionParamRef.containsKey('hallNameList') and conditionParamRef.hallNameList.size() > 0">
${_conditionType_} a.hallName in
<foreach collection="conditionParamRef.hallNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('hallNameNotList') and conditionParamRef.hallNameNotList.size() > 0">
${_conditionType_} a.hallName not in
<foreach collection="conditionParamRef.hallNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -2209,6 +2293,16 @@ ...@@ -2209,6 +2293,16 @@
<if test='orderCol.productCode != null and "DESC".equalsIgnoreCase(orderCol.productCode)'>DESC</if> <if test='orderCol.productCode != null and "DESC".equalsIgnoreCase(orderCol.productCode)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('hallId')">
a.hallId
<if test='orderCol.hallId != null and "DESC".equalsIgnoreCase(orderCol.hallId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('hallName')">
a.hallName
<if test='orderCol.hallName != null and "DESC".equalsIgnoreCase(orderCol.hallName)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
......
...@@ -666,6 +666,9 @@ key|String|消息唯一标识|是|- ...@@ -666,6 +666,9 @@ key|String|消息唯一标识|是|-
} }
``` ```
## 码表 ## 码表
### 响应结果码表 ### 响应结果码表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment