Commit be651873 authored by Your Name's avatar Your Name

fix:修改地图图标

parents b09dfbf0 ad2b5239
...@@ -6,3 +6,11 @@ ALTER TABLE mortals_xhx_device ADD COLUMN `deviceSN` varchar (512) COMMENT ' ...@@ -6,3 +6,11 @@ ALTER TABLE mortals_xhx_device ADD COLUMN `deviceSN` varchar (512) COMMENT '
ALTER TABLE mortals_xhx_product ADD COLUMN `skinId` bigint (20) COMMENT '皮肤id' AFTER productCode; ALTER TABLE mortals_xhx_product ADD COLUMN `skinId` bigint (20) COMMENT '皮肤id' AFTER productCode;
ALTER TABLE mortals_xhx_product ADD COLUMN `skinName` varchar (512) COMMENT '皮肤名称' AFTER skinId; ALTER TABLE mortals_xhx_product ADD COLUMN `skinName` varchar (512) COMMENT '皮肤名称' AFTER skinId;
-- ----------------------------
2022-08-20
-- ----------------------------
ALTER TABLE mortals_xhx_device ADD COLUMN `deviceVersion` varchar (64) COMMENT '设备版本' AFTER deleted;
...@@ -5,7 +5,7 @@ DROP TABLE IF EXISTS `mortals_xhx_device`; ...@@ -5,7 +5,7 @@ DROP TABLE IF EXISTS `mortals_xhx_device`;
CREATE TABLE mortals_xhx_device( CREATE TABLE mortals_xhx_device(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长', `id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`deviceName` varchar(20) NOT NULL COMMENT '设备名称', `deviceName` varchar(20) NOT NULL COMMENT '设备名称',
`deviceCode` varchar(256) COMMENT '设备编码,默认为MAC地址', `deviceCode` varchar(256) COMMENT '设备编码,SN码等,默认为MAC地址',
`deviceSN` varchar(256) COMMENT '设备SN码', `deviceSN` varchar(256) COMMENT '设备SN码',
`deviceMac` varchar(64) COMMENT '设备的MAC地址', `deviceMac` varchar(64) COMMENT '设备的MAC地址',
`siteId` bigint(20) COMMENT '站点Id,来源基础服务平台', `siteId` bigint(20) COMMENT '站点Id,来源基础服务平台',
...@@ -42,6 +42,7 @@ CREATE TABLE mortals_xhx_device( ...@@ -42,6 +42,7 @@ CREATE TABLE mortals_xhx_device(
`onlineTime` datetime COMMENT '最近上线时间', `onlineTime` datetime COMMENT '最近上线时间',
`offlineTime` datetime COMMENT '最近离线时间', `offlineTime` datetime COMMENT '最近离线时间',
`deleted` tinyint(2) COMMENT '是否删除(0.否,1.是)', `deleted` tinyint(2) COMMENT '是否删除(0.否,1.是)',
`deviceVersion` varchar(64) COMMENT '设备版本',
`source` tinyint(2) COMMENT '设备来源(0.旧设备,1.新设备)', `source` tinyint(2) COMMENT '设备来源(0.旧设备,1.新设备)',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户', `createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间', `createTime` datetime NOT NULL COMMENT '创建时间',
...@@ -52,6 +53,8 @@ PRIMARY KEY (`id`) ...@@ -52,6 +53,8 @@ PRIMARY KEY (`id`)
-- ---------------------------- -- ----------------------------
-- 平台系统表 -- 平台系统表
-- ---------------------------- -- ----------------------------
...@@ -118,7 +121,8 @@ DROP TABLE IF EXISTS `mortals_xhx_device_alarm_info`; ...@@ -118,7 +121,8 @@ DROP TABLE IF EXISTS `mortals_xhx_device_alarm_info`;
CREATE TABLE mortals_xhx_device_alarm_info( CREATE TABLE mortals_xhx_device_alarm_info(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长', `id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`alarmTime` datetime NOT NULL COMMENT '告警时间', `alarmTime` datetime NOT NULL COMMENT '告警时间',
`alarmDevice` bigint(20) NOT NULL COMMENT '告警设备', `alarmDevice` bigint(20) NOT NULL COMMENT '告警设备Id',
`siteId` bigint(20) COMMENT '站点Id,来源基础服务平台',
`alarmType` tinyint(2) NOT NULL COMMENT '告警类型,(0.离线)', `alarmType` tinyint(2) NOT NULL COMMENT '告警类型,(0.离线)',
`alarmLevel` tinyint(2) NOT NULL COMMENT '告警级别(0.危险,1.次要,2.一般)', `alarmLevel` tinyint(2) NOT NULL COMMENT '告警级别(0.危险,1.次要,2.一般)',
`alarmReceivePersonnel` varchar(32) NOT NULL COMMENT '接收人员[设备管理的责任人]', `alarmReceivePersonnel` varchar(32) NOT NULL COMMENT '接收人员[设备管理的责任人]',
...@@ -131,6 +135,8 @@ CREATE TABLE mortals_xhx_device_alarm_info( ...@@ -131,6 +135,8 @@ CREATE TABLE mortals_xhx_device_alarm_info(
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备告警日志'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备告警日志';
-- ---------------------------- -- ----------------------------
-- 设备模块信息表 -- 设备模块信息表
-- ---------------------------- -- ----------------------------
...@@ -190,17 +196,19 @@ PRIMARY KEY (`id`) ...@@ -190,17 +196,19 @@ PRIMARY KEY (`id`)
DROP TABLE IF EXISTS `mortals_xhx_alarm_sms_send`; DROP TABLE IF EXISTS `mortals_xhx_alarm_sms_send`;
CREATE TABLE mortals_xhx_alarm_sms_send( CREATE TABLE mortals_xhx_alarm_sms_send(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长', `id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`mobile` varchar(11) NOT NULL COMMENT '电话号码', `mobile` varchar(11) NOT NULL COMMENT '联系电话',
`receiver` varchar(200) NOT NULL COMMENT '接收人员',
`sendMess` varchar(200) NOT NULL COMMENT '发送内容', `sendMess` varchar(200) NOT NULL COMMENT '发送内容',
`sendStatus` tinyint(2) NOT NULL COMMENT '发送状态(0.未发送,1.提交,2.发送成功,3.发生失败)', `sendStatus` tinyint(2) NOT NULL COMMENT '发送状态(0.未发送,1.提交,2.发送成功,3.发生失败)',
`sendTime` datetime NOT NULL COMMENT '发送时间', `sendTime` datetime NOT NULL COMMENT '发送时间',
`siteId` bigint(20) COMMENT '站点Id,来源基础服务平台',
`createTime` datetime NOT NULL COMMENT '创建时间', `createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户', `updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间', `updateTime` datetime COMMENT '更新时间',
`receiver` varchar(200) NOT NULL COMMENT '接收人',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='短信发送记录'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='短信发送记录';
-- ---------------------------- -- ----------------------------
-- 设备日志表 -- 设备日志表
-- ---------------------------- -- ----------------------------
...@@ -208,6 +216,7 @@ DROP TABLE IF EXISTS `mortals_xhx_device_log`; ...@@ -208,6 +216,7 @@ DROP TABLE IF EXISTS `mortals_xhx_device_log`;
CREATE TABLE mortals_xhx_device_log( CREATE TABLE mortals_xhx_device_log(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长', `id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`traceID` varchar(64) COMMENT 'traceId,日志追踪id', `traceID` varchar(64) COMMENT 'traceId,日志追踪id',
`siteId` bigint(20) COMMENT '站点Id,来源基础服务平台',
`deviceId` bigint(20) COMMENT '设备ID', `deviceId` bigint(20) COMMENT '设备ID',
`deviceCode` varchar(32) NOT NULL COMMENT '设备编号', `deviceCode` varchar(32) NOT NULL COMMENT '设备编号',
`deviceName` varchar(32) NOT NULL COMMENT '设备名称,设置设备名称。', `deviceName` varchar(32) NOT NULL COMMENT '设备名称,设置设备名称。',
...@@ -223,6 +232,8 @@ PRIMARY KEY (`id`) ...@@ -223,6 +232,8 @@ PRIMARY KEY (`id`)
-- ---------------------------- -- ----------------------------
-- 站点统计表 -- 站点统计表
-- ---------------------------- -- ----------------------------
...@@ -249,16 +260,19 @@ PRIMARY KEY (`id`) ...@@ -249,16 +260,19 @@ PRIMARY KEY (`id`)
DROP TABLE IF EXISTS `mortals_xhx_device_stat`; DROP TABLE IF EXISTS `mortals_xhx_device_stat`;
CREATE TABLE mortals_xhx_device_stat( CREATE TABLE mortals_xhx_device_stat(
`id` bigint(20) AUTO_INCREMENT COMMENT 'ID', `id` bigint(20) AUTO_INCREMENT COMMENT 'ID',
`siteId` bigint(20) COMMENT '站点Id,来源基础服务平台',
`deviceTotalCount` int(9) COMMENT '设备总数', `deviceTotalCount` int(9) COMMENT '设备总数',
`deviceAddCount` int(9) COMMENT '昨日新增减少设备数量', `deviceAddCount` int(9) COMMENT '昨日新增减少设备数量',
`siteTotalCount` int(9) COMMENT '监控站点数量', `siteTotalCount` int(9) COMMENT '监控站点数量',
`siteAddCount` int(9) COMMENT '昨日新增站点数量', `siteAddCount` int(9) COMMENT '昨日新增站点数量',
`deviceOnlineCount` int(9) COMMENT '在线设备数量', `deviceOnlineCount` int(9) COMMENT '在线设备数量',
`deviceOnlineRatio` double COMMENT '在线率', `deviceOnlineRatio` double(6,2) COMMENT '在线率',
`deviceOfflineCount` int(9) NOT NULL COMMENT '离线设备数量', `deviceOfflineCount` int(9) NOT NULL COMMENT '离线设备数量',
`deviceOfflineRatio` double NOT NULL COMMENT '离线率', `deviceOfflineRatio` double(6,2) NOT NULL COMMENT '离线率',
`deviceStopCount` int(9) NOT NULL COMMENT '停用设备数量', `deviceStopCount` int(9) NOT NULL COMMENT '停用设备数量',
`deviceStopRatio` double NOT NULL COMMENT '停用率', `deviceStopRatio` double(6,2) NOT NULL COMMENT '停用率',
`deviceUnActiveCount` int(9) NOT NULL COMMENT '未激活设备数量',
`deviceUnActiveRatio` double(6,2) NOT NULL COMMENT '未激活率',
`alarmTotalCount` int(9) NOT NULL COMMENT '今日告警数量', `alarmTotalCount` int(9) NOT NULL COMMENT '今日告警数量',
`alarmAddCount` int(9) NOT NULL COMMENT '昨日新增减少数量', `alarmAddCount` int(9) NOT NULL COMMENT '昨日新增减少数量',
`pushTotalCount` int(9) NOT NULL COMMENT '今日消息推送数量', `pushTotalCount` int(9) NOT NULL COMMENT '今日消息推送数量',
...@@ -274,3 +288,26 @@ CREATE TABLE mortals_xhx_device_stat( ...@@ -274,3 +288,26 @@ CREATE TABLE mortals_xhx_device_stat(
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备统计'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='设备统计';
-- ----------------------------
-- 产品客户端版本表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_product_version`;
CREATE TABLE mortals_xhx_product_version(
`id` bigint(20) AUTO_INCREMENT COMMENT '主键ID,主键,自增长',
`productId` bigint(20) COMMENT '产品Id',
`productCode` varchar(256) COMMENT '产品编码',
`productName` varchar(256) COMMENT '产品名称',
`filePath` varchar(256) COMMENT '文件相对路径地址',
`version` int(4) COMMENT '版本号',
`remark` varchar(256) COMMENT '备注信息',
`createTime` datetime COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='产品客户端版本';
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
"js-cookie": "2.2.1", "js-cookie": "2.2.1",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"json-bigint": "^0.3.0", "json-bigint": "^0.3.0",
"moment": "^2.29.4",
"muse-ui": "^3.0.2", "muse-ui": "^3.0.2",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"quill": "1.3.7", "quill": "1.3.7",
......
...@@ -54,6 +54,8 @@ const router = new Router({ ...@@ -54,6 +54,8 @@ const router = new Router({
...restBuilder('alarm/config', 'alarm/config'),//设备告警配置 ...restBuilder('alarm/config', 'alarm/config'),//设备告警配置
...restBuilder('alarm/sms/send', 'alarm/sms/send'),//设备告警短信 ...restBuilder('alarm/sms/send', 'alarm/sms/send'),//设备告警短信
...restBuilder('product/version', 'product/version'),//产品
//以下为基础路由配置 //以下为基础路由配置
builder('', 'Home'), builder('', 'Home'),
builder('index', 'Home'), builder('index', 'Home'),
......
...@@ -120,11 +120,11 @@ ...@@ -120,11 +120,11 @@
</div> </div>
<!-- 未激活设备 --> <!-- 未激活设备 -->
<div class="total-item"> <div class="total-item">
<p class="total-item-count">{{ statData.deviceStopRatio }}</p> <p class="total-item-count">{{ statData.deviceUnActiveRatio }}</p>
<span style="font-size: 12px" <span style="font-size: 12px"
><span style="color: #6182f6">未激活率 </span ><span style="color: #6182f6">未激活率 </span
><span v-bind:class="{ warn: statData.deviceStopRatio >= 0 }" ><span v-bind:class="{ warn: statData.deviceUnActiveRatio >= 0 }"
>{{ statData.deviceStopRatio * 100 }}%</span >{{ statData.deviceUnActiveRatio * 100 }}%</span
></span ></span
> >
<p class="total-item-title"> <p class="total-item-title">
...@@ -444,6 +444,7 @@ ...@@ -444,6 +444,7 @@
</template> </template>
<script> <script>
import { formatterDate } from "@/assets/utils/index";
export default { export default {
computed: { computed: {
userData() { userData() {
...@@ -498,6 +499,7 @@ export default { ...@@ -498,6 +499,7 @@ export default {
this.findDevicePush(beforeday); this.findDevicePush(beforeday);
}, },
methods: { methods: {
formatterDate,
// echarts 适配函数 // echarts 适配函数
adapterEcharts() { adapterEcharts() {
this.deviceTotalChart.resize(); this.deviceTotalChart.resize();
...@@ -507,7 +509,7 @@ export default { ...@@ -507,7 +509,7 @@ export default {
this.pushChart.resize(); this.pushChart.resize();
}, },
syncDeviceStat() { syncDeviceStat() {
this.$post("/device/stat/syncDeviceStat", {}) this.$post("/device/stat/syncDeviceStat", {siteId:1})
.then((res) => { .then((res) => {
console.log(res.data); console.log(res.data);
if (res.code == 1) { if (res.code == 1) {
...@@ -523,6 +525,8 @@ export default { ...@@ -523,6 +525,8 @@ export default {
findDeviceTotalStat(beforeday) { findDeviceTotalStat(beforeday) {
let query = { createTimeStart: this.formatterDate(beforeday) }; let query = { createTimeStart: this.formatterDate(beforeday) };
//当前选择站点id
query.siteId=1
console.log(query); console.log(query);
this.$post("/device/stat/list", query) this.$post("/device/stat/list", query)
.then((res) => { .then((res) => {
...@@ -554,6 +558,7 @@ export default { ...@@ -554,6 +558,7 @@ export default {
findDeviceStat(beforeday) { findDeviceStat(beforeday) {
let query = { createTimeStart: this.formatterDate(beforeday) }; let query = { createTimeStart: this.formatterDate(beforeday) };
query.siteId=1
this.$post("/device/stat/list", query) this.$post("/device/stat/list", query)
.then((res) => { .then((res) => {
if (res.code == 1) { if (res.code == 1) {
...@@ -583,6 +588,7 @@ export default { ...@@ -583,6 +588,7 @@ export default {
findDeviceAlarm(beforeday) { findDeviceAlarm(beforeday) {
let query = { createTimeStart: this.formatterDate(beforeday) }; let query = { createTimeStart: this.formatterDate(beforeday) };
query.siteId=1
this.$post("/device/stat/list", query) this.$post("/device/stat/list", query)
.then((res) => { .then((res) => {
if (res.code == 1) { if (res.code == 1) {
...@@ -611,6 +617,7 @@ export default { ...@@ -611,6 +617,7 @@ export default {
findDevicePush(beforeday) { findDevicePush(beforeday) {
let query = { createTimeStart: this.formatterDate(beforeday) }; let query = { createTimeStart: this.formatterDate(beforeday) };
query.siteId=1
this.$post("/device/stat/list", query) this.$post("/device/stat/list", query)
.then((res) => { .then((res) => {
if (res.code == 1) { if (res.code == 1) {
...@@ -636,37 +643,6 @@ export default { ...@@ -636,37 +643,6 @@ export default {
}); });
}, },
formatterDate(time) {
let date = new Date(Number(time));
let Y = date.getFullYear() + "-";
let M =
(date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) + "-";
let D = this.panLeft(date.getDate()) + " ";
let h = this.panLeft(date.getHours()) + ":";
let m = this.panLeft(date.getMinutes()) + ":";
let s = this.panLeft(date.getSeconds());
return Y + M + D + h + m + s;
},
getYear(time) {
let date = new Date(Number(time));
let Y = date.getFullYear() + "-";
let M =
(date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) + "-";
let D = this.panLeft(date.getDate()) + " ";
let h = this.panLeft(date.getHours()) + ":";
let m = this.panLeft(date.getMinutes()) + ":";
let s = this.panLeft(date.getSeconds());
return Y + M + D + h + m + s;
},
panLeft(num) {
return num < 10 ? "0" + num : num;
},
// 设备数据图 // 设备数据图
myEcharts() { myEcharts() {
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
......
...@@ -24,7 +24,11 @@ export default { ...@@ -24,7 +24,11 @@ export default {
name: "AlarmSmsSend", name: "AlarmSmsSend",
components: { drawerShow }, components: { drawerShow },
mixins: [table], mixins: [table],
created() {}, created() {
this.query= Object.assign({}, this.query, {siteId:1});
},
methods: { methods: {
/** 重写新增方法 */ /** 重写新增方法 */
toAdd(row) { toAdd(row) {
......
...@@ -66,6 +66,8 @@ export default { ...@@ -66,6 +66,8 @@ export default {
this.query["alarmDevice"] = this.queryIn.alarmDevice; this.query["alarmDevice"] = this.queryIn.alarmDevice;
} }
this.changePath("/device/alarm/info"); this.changePath("/device/alarm/info");
this.query= Object.assign({}, this.query, {siteId:1});
}, },
methods: { methods: {
/** 重写新增方法 */ /** 重写新增方法 */
......
...@@ -15,7 +15,10 @@ export default { ...@@ -15,7 +15,10 @@ export default {
name: "DeviceLog", name: "DeviceLog",
components: { dialogShow }, components: { dialogShow },
mixins: [table], mixins: [table],
created() {}, created() {
this.query= Object.assign({}, this.query, {siteId:1});
},
methods: { methods: {
/** 重写新增方法 */ /** 重写新增方法 */
toAdd(row) { toAdd(row) {
......
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
size="50%">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="产品类型" :span="20" prop="productId" type="select" :enumData="dict.productId" v-model="form.productId" placeholder="请选择产品"/>
<Field label="文件地址" :span="20" prop="filePath"><fileUpload v-model="form.filePath" prePath="/file/uploadfile"/></Field>
<Field label="版本号" :span="20" prop="version" v-model="form.version" placeholder="请输入版本号"/>
<Field label="备注信息" :span="20" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注信息"/>
</el-row>
<form-buttons @submit='submitForm' noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "ProductVersionDetail",
mixins: [form],
components: {
},
created() {
this.changePath("product/version")
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "产品客户端版本",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
],
toDate:[
],
// 表单校验
rules: {
productId: [
{required: true,message: "请选择产品类型", trigger: "blur" },
],
filePath: [
{required: true,message: "请上传文件", trigger: "blur" },
],
version: [
{required: true,message: "请选择版本信息" },
],
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="product/version/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改产品客户端版本";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "product/version/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增产品客户端版本";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="product/version/view";
this.getData();
this.pageInfo.type="view"
this.title = "产品客户端版本详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
productId : null,
productCode : "",
productName : "",
filePath : "",
version : null,
remark : "",
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "ProductVersionList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
data() {
return {
config: {
search: [
],
columns: [
{type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{label: "产品类型", prop: "productId", formatter: this.formatter},
{label: "文件相对路径地址", prop: "filePath"},
{label: "版本号", prop: "version",formatter: this.formatter},
{label: "备注信息", prop: "remark"},
{label: "创建时间", prop: "createTime", formatter: this.formatterDate},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
};
</script>
\ No newline at end of file
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="产品Id" label-class-name="labelClass" content-class-name="contentClass">
{{form.productId}}
</el-descriptions-item>
<el-descriptions-item label="产品编码" label-class-name="labelClass" content-class-name="contentClass">
{{form.productCode}}
</el-descriptions-item>
<el-descriptions-item label="产品名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.productName}}
</el-descriptions-item>
<el-descriptions-item label="文件相对路径地址" label-class-name="labelClass" content-class-name="contentClass">
<fileUpload v-model="form.filePath" prePath="/file/uploadfile"/>
</el-descriptions-item>
<el-descriptions-item label="版本号" label-class-name="labelClass" content-class-name="contentClass">
{{form.version}}
</el-descriptions-item>
<el-descriptions-item label="备注信息" label-class-name="labelClass" content-class-name="contentClass">
{{form.remark}}
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
import FileUpload from '@/components/FileUpload';
export default {
mixins: [view],
components: {
FileUpload,
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
...@@ -17,7 +17,11 @@ module.exports = { ...@@ -17,7 +17,11 @@ module.exports = {
hot: true,//自动保存 hot: true,//自动保存
proxy: { proxy: {
'/m': { '/m': {
<<<<<<< HEAD
target: 'http://192.168.0.98:11078', target: 'http://192.168.0.98:11078',
=======
target: 'http://localhost:18222',
>>>>>>> ad2b523910bb4a6a40f0558c71647fb6ec299e09
changeOrigin: true, changeOrigin: true,
secure: false, secure: false,
cookieDomainRewrite: 'plm.testnew.com', cookieDomainRewrite: 'plm.testnew.com',
......
This diff is collapsed.
...@@ -65,7 +65,7 @@ public class CustomerKeyExpirationListener implements MessageListener { ...@@ -65,7 +65,7 @@ public class CustomerKeyExpirationListener implements MessageListener {
public void onMessage(Message message, byte[] bytes) { public void onMessage(Message message, byte[] bytes) {
String key = message.toString(); String key = message.toString();
String subStr = StrUtil.removePrefix(key, RedisKey.KEY_DEVICE_ONLINE_CACHE); String subStr = StrUtil.removePrefix(key, RedisKey.KEY_DEVICE_ONLINE_CACHE);
if(!subStr.equals(key)){ if (!subStr.equals(key)) {
DeviceEntity deviceEntity = deviceService.getExtCache(subStr); DeviceEntity deviceEntity = deviceService.getExtCache(subStr);
if (!ObjectUtils.isEmpty(deviceEntity)) { if (!ObjectUtils.isEmpty(deviceEntity)) {
if (deviceEntity.getDeviceStatus() == DeviceStatusEnum.在线.getValue()) { if (deviceEntity.getDeviceStatus() == DeviceStatusEnum.在线.getValue()) {
...@@ -80,32 +80,51 @@ public class CustomerKeyExpirationListener implements MessageListener { ...@@ -80,32 +80,51 @@ public class CustomerKeyExpirationListener implements MessageListener {
deviceService.sendThirdParty(deviceEntity, productEntity, platformEntity, DeviceMethodEnum.OFFLINE); deviceService.sendThirdParty(deviceEntity, productEntity, platformEntity, DeviceMethodEnum.OFFLINE);
} }
//保存离线告警消息
DeviceAlarmInfoEntity alarmInfoEntity = new DeviceAlarmInfoEntity();
alarmInfoEntity.initAttrValue();
alarmInfoEntity.setAlarmDevice(deviceEntity.getId());
alarmInfoEntity.setSiteId(deviceEntity.getSiteId());
alarmInfoEntity.setAlarmContent(deviceEntity.getDeviceName() + "已离线!");
alarmInfoEntity.setAlarmType(AlarmTypeEnum.离线.getValue());
alarmInfoEntity.setAlarmLevel(AlarmLevelEnum.一般.getValue());
alarmInfoEntity.setAlarmStatus(AlarmStatusEnum.未清除.getValue());
alarmInfoEntity.setAlarmReceivePersonnel(deviceEntity.getLeadingOfficial());
alarmInfoEntity.setReceivePersonnelTelephone(deviceEntity.getLeadingOfficialTelephone());
alarmInfoEntity.setCreateTime(new Date());
alarmInfoEntity.setCreateUserId(1L);
deviceAlarmInfoService.save(alarmInfoEntity);
// TODO: 2022/6/23 告警信息保存与发送 // TODO: 2022/6/23 告警信息保存与发送
AlarmConfigEntity alarmConfigEntity = alarmConfigService.selectOne(new AlarmConfigQuery().productId(productEntity.getId())); AlarmConfigEntity alarmConfigEntity = alarmConfigService.selectOne(new AlarmConfigQuery().productId(productEntity.getId()));
if (!ObjectUtils.isEmpty(alarmConfigEntity)) { if (!ObjectUtils.isEmpty(alarmConfigEntity)) {
if(alarmConfigEntity.getAlarmPusW1ay()== AlarmPusW1ayEnum.短信.getValue()){ if (alarmConfigEntity.getAlarmPusW1ay() == AlarmPusW1ayEnum.短信.getValue()) {
// TODO: 2022/7/4 发送短信 // TODO: 2022/7/4 发送短信
Rest<RespData<List<SmsSetPdu>>> respDataRest = smsSetFeign.list(new SmsSetPdu().siteId(deviceEntity.getSiteId())); Rest<RespData<List<SmsSetPdu>>> respDataRest = smsSetFeign.list(new SmsSetPdu().siteId(deviceEntity.getSiteId()));
if(respDataRest.getCode()==YesNoEnum.YES.getValue()){ if (respDataRest.getCode() == YesNoEnum.YES.getValue()) {
List<SmsSetPdu> data = respDataRest.getData().getData(); List<SmsSetPdu> data = respDataRest.getData().getData();
if(!ObjectUtils.isEmpty(data)){ if (!ObjectUtils.isEmpty(data)) {
Integer messageoff = data.get(0).getMessageoff(); Integer messageoff = data.get(0).getMessageoff();
if(messageoff==YesNoEnum.YES.getValue()){ if (messageoff == YesNoEnum.YES.getValue()) {
// todo 发送短信 // todo 发送短信
DeviceAlarmInfoEntity deviceAlarmInfoEntity = deviceAlarmInfoService.selectOne(new DeviceAlarmInfoQuery().alarmDevice(deviceEntity.getId())); DeviceAlarmInfoEntity deviceAlarmInfoEntity = deviceAlarmInfoService.selectOne(new DeviceAlarmInfoQuery().alarmDevice(deviceEntity.getId()));
if(!ObjectUtils.isEmpty(deviceAlarmInfoEntity)){ if (!ObjectUtils.isEmpty(deviceAlarmInfoEntity)) {
AlarmSmsSendEntity alarmSmsSendEntity = new AlarmSmsSendEntity(); AlarmSmsSendEntity alarmSmsSendEntity = new AlarmSmsSendEntity();
alarmSmsSendEntity.initAttrValue(); alarmSmsSendEntity.initAttrValue();
alarmSmsSendEntity.setId(IdUtil.getSnowflake().nextId()); alarmSmsSendEntity.setId(IdUtil.getSnowflake().nextId());
alarmSmsSendEntity.setSiteId(deviceAlarmInfoEntity.getSiteId());
alarmSmsSendEntity.setMobile(deviceAlarmInfoEntity.getReceivePersonnelTelephone()); alarmSmsSendEntity.setMobile(deviceAlarmInfoEntity.getReceivePersonnelTelephone());
alarmSmsSendEntity.setReceiver(deviceAlarmInfoEntity.getAlarmReceivePersonnel()); alarmSmsSendEntity.setReceiver(deviceAlarmInfoEntity.getAlarmReceivePersonnel());
alarmSmsSendEntity.setSendMess(deviceAlarmInfoEntity.getAlarmContent()); alarmSmsSendEntity.setSendMess(deviceAlarmInfoEntity.getAlarmContent());
alarmSmsSendEntity.setSendStatus(SendStatusEnum.未发送.getValue()); alarmSmsSendEntity.setSendStatus(SendStatusEnum.未发送.getValue());
alarmSmsSendService.save(alarmSmsSendEntity,null); alarmSmsSendService.save(alarmSmsSendEntity, null);
} }
}else{ } else {
} }
} }
......
...@@ -82,6 +82,7 @@ public class DownMsgTask implements Runnable { ...@@ -82,6 +82,7 @@ public class DownMsgTask implements Runnable {
DeviceLogEntity deviceLogEntity = new DeviceLogEntity(); DeviceLogEntity deviceLogEntity = new DeviceLogEntity();
deviceLogEntity.initAttrValue(); deviceLogEntity.initAttrValue();
deviceLogEntity.setTraceID(metadata.getMessageId()); deviceLogEntity.setTraceID(metadata.getMessageId());
deviceLogEntity.setSiteId(deviceEntity.getSiteId());
deviceLogEntity.setDeviceId(deviceEntity.getId()); deviceLogEntity.setDeviceId(deviceEntity.getId());
deviceLogEntity.setDeviceName(deviceEntity.getDeviceName()); deviceLogEntity.setDeviceName(deviceEntity.getDeviceName());
deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode()); deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode());
...@@ -102,6 +103,7 @@ public class DownMsgTask implements Runnable { ...@@ -102,6 +103,7 @@ public class DownMsgTask implements Runnable {
String traceID = IdUtil.fastSimpleUUID(); String traceID = IdUtil.fastSimpleUUID();
deviceLogEntity.setTraceID(traceID); deviceLogEntity.setTraceID(traceID);
deviceLogEntity.setDeviceId(deviceEntity.getId()); deviceLogEntity.setDeviceId(deviceEntity.getId());
deviceLogEntity.setSiteId(deviceEntity.getSiteId());
deviceLogEntity.setDeviceName(deviceEntity.getDeviceName()); deviceLogEntity.setDeviceName(deviceEntity.getDeviceName());
deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode()); deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode());
deviceLogEntity.setMessageHead(item.getMessageType()); deviceLogEntity.setMessageHead(item.getMessageType());
......
...@@ -179,6 +179,7 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi ...@@ -179,6 +179,7 @@ public class DeviceMsgComsumerStartedService implements IApplicationStartedServi
DeviceLogEntity deviceLogEntity = new DeviceLogEntity(); DeviceLogEntity deviceLogEntity = new DeviceLogEntity();
deviceLogEntity.initAttrValue(); deviceLogEntity.initAttrValue();
deviceLogEntity.setTraceID(IdUtil.fastSimpleUUID()); deviceLogEntity.setTraceID(IdUtil.fastSimpleUUID());
deviceLogEntity.setSiteId(deviceEntity.getSiteId());
deviceLogEntity.setDeviceId(deviceEntity.getId()); deviceLogEntity.setDeviceId(deviceEntity.getId());
deviceLogEntity.setDeviceName(deviceEntity.getDeviceName()); deviceLogEntity.setDeviceName(deviceEntity.getDeviceName());
deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode()); deviceLogEntity.setDeviceCode(deviceEntity.getDeviceCode());
......
...@@ -46,138 +46,18 @@ public class DeviceTotalStatTaskImpl implements ITaskExcuteService { ...@@ -46,138 +46,18 @@ public class DeviceTotalStatTaskImpl implements ITaskExcuteService {
@Autowired @Autowired
private DeviceService deviceService; private DeviceService deviceService;
@Autowired @Autowired
private DeviceLogService deviceLogService;
@Autowired
private DeviceStatService deviceStatService;
@Autowired
private ISiteFeign siteFeign; private ISiteFeign siteFeign;
@Autowired
private DeviceAlarmInfoService deviceAlarmInfoService;
@Autowired
private AlarmSmsSendService alarmSmsSendService;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
deviceService.deviceStat(null); //统计所有站点
//doDeviceStat();
}
/**
* 统计设备
* 全部设备-》激活设备与未激活-》启用与停用设备-》离线与在线设备
*/
private void doDeviceStat() {
//查询当天统计,如果有 则更新统计结果,否则新增
DeviceStatEntity deviceStatEntity = deviceStatService.selectOne(new DeviceStatQuery()
.year(DateUtil.year(new Date()))
.month(DateUtil.month(new Date()) + 1)
.day(DateUtil.dayOfMonth(new Date())));
if (ObjectUtils.isEmpty(deviceStatEntity)) {
deviceStatEntity = new DeviceStatEntity();
deviceStatEntity.initAttrValue();
deviceStatEntity.setCreateTime(new Date());
deviceStatEntity.setYear(DateUtil.year(new Date()));
deviceStatEntity.setMonth(DateUtil.month(new Date()) + 1);
deviceStatEntity.setDay(DateUtil.dayOfMonth(new Date()));
}
//获取昨天统计数据
DeviceStatEntity yesterdayDeviceStat = deviceStatService.selectOne(new DeviceStatQuery()
.year(DateUtil.year(DateUtil.yesterday()))
.month(DateUtil.month(DateUtil.yesterday()) + 1)
.day(DateUtil.dayOfMonth(DateUtil.yesterday())));
if (ObjectUtils.isEmpty(yesterdayDeviceStat)) {
yesterdayDeviceStat = new DeviceStatEntity();
yesterdayDeviceStat.initAttrValue();
}
try {
//获取设备总数
List<DeviceEntity> deviceList = deviceService.find(new DeviceQuery());
Integer deviceTotalCount = deviceList.size();
deviceStatEntity.setDeviceTotalCount(deviceTotalCount);
deviceStatEntity.setDeviceAddCount(deviceTotalCount - yesterdayDeviceStat.getDeviceTotalCount());
//站点数量
SitePdu sitePdu = new SitePdu(); SitePdu sitePdu = new SitePdu();
sitePdu.setSize(-1); sitePdu.setSize(-1);
Rest<RespData<List<SitePdu>>> resp = siteFeign.list(sitePdu); siteFeign.list(sitePdu).getData().getData().parallelStream().forEach(item -> {
deviceService.deviceStat(item.getId(), null);
if(resp.getCode()==1) { });
List<SitePdu> sitePduList = resp.getData().getData();
deviceStatEntity.setSiteTotalCount(sitePduList.size());
deviceStatEntity.setSiteAddCount(sitePduList.size() - yesterdayDeviceStat.getSiteTotalCount());
}
//在线数量
Long deviceOnlineCount = deviceList.parallelStream()
.filter(f->f.getDeviceStatus()>DeviceStatusEnum.未激活.getValue())
.filter(f->f.getEnabled()== EnabledEnum.启用.getValue())
.filter(f -> f.getDeviceStatus() == DeviceStatusEnum.在线.getValue())
.count();
deviceStatEntity.setDeviceOnlineCount(deviceOnlineCount.intValue());
deviceStatEntity.setDeviceOnlineRatio(new BigDecimal(deviceOnlineCount).divide(new BigDecimal(deviceList.size()),ROUND_HALF_DOWN).setScale(2));
//离线数量
Long deviceOfflineCount = deviceList.parallelStream()
.filter(f->f.getDeviceStatus()>DeviceStatusEnum.未激活.getValue())
.filter(f->f.getEnabled()== EnabledEnum.启用.getValue())
.filter(f -> f.getDeviceStatus() == DeviceStatusEnum.离线.getValue())
.count();
deviceStatEntity.setDeviceOfflineCount(deviceOfflineCount.intValue());
deviceStatEntity.setDeviceOfflineRatio(new BigDecimal(deviceOfflineCount).divide(new BigDecimal(deviceList.size()),ROUND_HALF_DOWN).setScale(2));
//停用数量
Long deviceStopCount = deviceList.parallelStream()
.filter(f->f.getDeviceStatus()>DeviceStatusEnum.未激活.getValue())
.filter(f -> f.getEnabled() == YesNoEnum.NO.getValue())
.count();
deviceStatEntity.setDeviceStopCount(deviceStopCount.intValue());
deviceStatEntity.setDeviceStopRatio(new BigDecimal(deviceStopCount).divide(new BigDecimal(deviceList.size()),ROUND_HALF_DOWN).setScale(2));
//今日告警数量
DeviceAlarmInfoQuery deviceAlarmInfoQuery = new DeviceAlarmInfoQuery();
deviceAlarmInfoQuery.setCreateTimeStart(DateUtils.getCurrStrDate());
deviceAlarmInfoQuery.setCreateTimeEnd(DateUtils.getCurrStrDate());
List<DeviceAlarmInfoEntity> deviceAlarmInfoList = deviceAlarmInfoService.find(deviceAlarmInfoQuery);
deviceStatEntity.setAlarmTotalCount(deviceAlarmInfoList.size());
deviceStatEntity.setAlarmAddCount(deviceAlarmInfoList.size() - yesterdayDeviceStat.getAlarmTotalCount());
//推送数量
AlarmSmsSendQuery alarmSmsSendQuery = new AlarmSmsSendQuery();
alarmSmsSendQuery.setSendTimeStart(DateUtils.getCurrStrDate());
alarmSmsSendQuery.setSendTimeEnd(DateUtils.getCurrStrDate());
alarmSmsSendQuery.setSendStatus(SendStatusEnum.发送成功.getValue());
List<AlarmSmsSendEntity> alarmSmsSendEntities = alarmSmsSendService.find(alarmSmsSendQuery);
deviceStatEntity.setPushTotalCount(alarmSmsSendEntities.size());
deviceStatEntity.setPushAddCount(alarmSmsSendEntities.size()-yesterdayDeviceStat.getPushTotalCount());
//上行下行数量
DeviceLogQuery deviceLogQuery = new DeviceLogQuery();
deviceLogQuery.setCreateTimeStart(DateUtils.getCurrStrDate());
deviceLogQuery.setCreateTimeEnd(DateUtils.getCurrStrDate());
Map<Boolean, Long> collect = deviceLogService.find(deviceLogQuery).parallelStream().collect(Collectors.partitioningBy(x -> x.getLogType() == LogTypeEnum.上报事件.getValue(), counting()));
deviceStatEntity.setUploadMessageTotalCount(collect.getOrDefault(true,0L).intValue());
deviceStatEntity.setDownloadMessageTotalCount(collect.getOrDefault(false,0L).intValue());
if (deviceStatEntity.newEntity()) {
deviceStatEntity.setCreateTime(new Date());
deviceStatService.save(deviceStatEntity);
} else {
deviceStatEntity.setUpdateTime(new Date());
deviceStatService.update(deviceStatEntity);
} }
} catch (Exception e) {
log.error("更新任务异常,结束执行", e);
}
}
@Override @Override
public void stopTask(ITask task) throws AppException { public void stopTask(ITask task) throws AppException {
......
...@@ -8,53 +8,75 @@ import com.mortals.framework.annotation.Excel; ...@@ -8,53 +8,75 @@ import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.alarm.model.vo.AlarmSmsSendVo; import com.mortals.xhx.module.alarm.model.vo.AlarmSmsSendVo;
/** /**
* 短信发送记录实体对象 * 短信发送记录实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-08-22
*/ */
public class AlarmSmsSendEntity extends AlarmSmsSendVo { public class AlarmSmsSendEntity extends AlarmSmsSendVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 电话号码 * 联系电话
*/ */
@Excel(name = "联系电话")
private String mobile; private String mobile;
/**
* 接收人员
*/
@Excel(name = "接收人员")
private String receiver;
/** /**
* 发送内容 * 发送内容
*/ */
@Excel(name = "发送内容")
private String sendMess; private String sendMess;
/** /**
* 发送状态(0.未发送,1.提交,2.发送成功,3.发生失败) * 发送状态(0.未发送,1.提交,2.发送成功,3.发生失败)
*/ */
@Excel(name = "发送状态", readConverterExp = "0=未发送,1=提交,2=发送成功,3=发生失败")
private Integer sendStatus; private Integer sendStatus;
/** /**
* 发送时间 * 发送时间
*/ */
private Date sendTime; private Date sendTime;
/** /**
* 接收人 * 站点Id,来源基础服务平台
*/ */
private String receiver; private Long siteId;
public AlarmSmsSendEntity(){} public AlarmSmsSendEntity(){}
/** /**
* 获取 电话号码 * 获取 联系电话
* @return String * @return String
*/ */
public String getMobile(){ public String getMobile(){
return mobile; return mobile;
} }
/** /**
* 设置 电话号码 * 设置 联系电话
* @param mobile * @param mobile
*/ */
public void setMobile(String mobile){ public void setMobile(String mobile){
this.mobile = mobile; this.mobile = mobile;
} }
/**
* 获取 接收人员
* @return String
*/
public String getReceiver(){
return receiver;
}
/**
* 设置 接收人员
* @param receiver
*/
public void setReceiver(String receiver){
this.receiver = receiver;
}
/** /**
* 获取 发送内容 * 获取 发送内容
* @return String * @return String
...@@ -98,18 +120,18 @@ public class AlarmSmsSendEntity extends AlarmSmsSendVo { ...@@ -98,18 +120,18 @@ public class AlarmSmsSendEntity extends AlarmSmsSendVo {
this.sendTime = sendTime; this.sendTime = sendTime;
} }
/** /**
* 获取 接收人 * 获取 站点Id,来源基础服务平台
* @return String * @return Long
*/ */
public String getReceiver(){ public Long getSiteId(){
return receiver; return siteId;
} }
/** /**
* 设置 接收人 * 设置 站点Id,来源基础服务平台
* @param receiver * @param siteId
*/ */
public void setReceiver(String receiver){ public void setSiteId(Long siteId){
this.receiver = receiver; this.siteId = siteId;
} }
...@@ -134,10 +156,11 @@ public class AlarmSmsSendEntity extends AlarmSmsSendVo { ...@@ -134,10 +156,11 @@ public class AlarmSmsSendEntity extends AlarmSmsSendVo {
public String toString(){ public String toString(){
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
sb.append(",mobile:").append(getMobile()); sb.append(",mobile:").append(getMobile());
sb.append(",receiver:").append(getReceiver());
sb.append(",sendMess:").append(getSendMess()); sb.append(",sendMess:").append(getSendMess());
sb.append(",sendStatus:").append(getSendStatus()); sb.append(",sendStatus:").append(getSendStatus());
sb.append(",sendTime:").append(getSendTime()); sb.append(",sendTime:").append(getSendTime());
sb.append(",receiver:").append(getReceiver()); sb.append(",siteId:").append(getSiteId());
return sb.toString(); return sb.toString();
} }
...@@ -145,12 +168,14 @@ public class AlarmSmsSendEntity extends AlarmSmsSendVo { ...@@ -145,12 +168,14 @@ public class AlarmSmsSendEntity extends AlarmSmsSendVo {
this.mobile = ""; this.mobile = "";
this.receiver = "";
this.sendMess = ""; this.sendMess = "";
this.sendStatus = null; this.sendStatus = null;
this.sendTime = null; this.sendTime = null;
this.receiver = ""; this.siteId = null;
} }
} }
\ No newline at end of file
...@@ -4,11 +4,11 @@ import java.util.Date; ...@@ -4,11 +4,11 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity; import com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity;
/** /**
* 短信发送记录查询对象 * 短信发送记录查询对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-08-22
*/ */
public class AlarmSmsSendQuery extends AlarmSmsSendEntity { public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -22,9 +22,12 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -22,9 +22,12 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
/** 主键ID,主键,自增长列表 */ /** 主键ID,主键,自增长列表 */
private List <Long> idList; private List <Long> idList;
/** 电话号码 */ /** 联系电话 */
private List<String> mobileList; private List<String> mobileList;
/** 接收人员 */
private List<String> receiverList;
/** 发送内容 */ /** 发送内容 */
private List<String> sendMessList; private List<String> sendMessList;
...@@ -46,6 +49,18 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -46,6 +49,18 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
/** 结束 发送时间 */ /** 结束 发送时间 */
private String sendTimeEnd; private String sendTimeEnd;
/** 开始 站点Id,来源基础服务平台 */
private Long siteIdStart;
/** 结束 站点Id,来源基础服务平台 */
private Long siteIdEnd;
/** 增加 站点Id,来源基础服务平台 */
private Long siteIdIncrement;
/** 站点Id,来源基础服务平台列表 */
private List <Long> siteIdList;
/** 开始 创建时间 */ /** 开始 创建时间 */
private String createTimeStart; private String createTimeStart;
...@@ -70,9 +85,6 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -70,9 +85,6 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
/** 结束 更新时间 */ /** 结束 更新时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 接收人 */
private List<String> receiverList;
/** 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<AlarmSmsSendQuery> orConditionList; private List<AlarmSmsSendQuery> orConditionList;
...@@ -146,7 +158,7 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -146,7 +158,7 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
} }
/** /**
* 获取 电话号码 * 获取 联系电话
* @return mobileList * @return mobileList
*/ */
public List<String> getMobileList(){ public List<String> getMobileList(){
...@@ -154,12 +166,27 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -154,12 +166,27 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
} }
/** /**
* 设置 电话号码 * 设置 联系电话
* @param mobileList * @param mobileList
*/ */
public void setMobileList(List<String> mobileList){ public void setMobileList(List<String> mobileList){
this.mobileList = mobileList; this.mobileList = mobileList;
} }
/**
* 获取 接收人员
* @return receiverList
*/
public List<String> getReceiverList(){
return this.receiverList;
}
/**
* 设置 接收人员
* @param receiverList
*/
public void setReceiverList(List<String> receiverList){
this.receiverList = receiverList;
}
/** /**
* 获取 发送内容 * 获取 发送内容
* @return sendMessList * @return sendMessList
...@@ -271,6 +298,70 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -271,6 +298,70 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
this.sendTimeEnd = sendTimeEnd; this.sendTimeEnd = sendTimeEnd;
} }
/**
* 获取 开始 站点Id,来源基础服务平台
* @return siteIdStart
*/
public Long getSiteIdStart(){
return this.siteIdStart;
}
/**
* 设置 开始 站点Id,来源基础服务平台
* @param siteIdStart
*/
public void setSiteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
}
/**
* 获取 结束 站点Id,来源基础服务平台
* @return $siteIdEnd
*/
public Long getSiteIdEnd(){
return this.siteIdEnd;
}
/**
* 设置 结束 站点Id,来源基础服务平台
* @param siteIdEnd
*/
public void setSiteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
}
/**
* 获取 增加 站点Id,来源基础服务平台
* @return siteIdIncrement
*/
public Long getSiteIdIncrement(){
return this.siteIdIncrement;
}
/**
* 设置 增加 站点Id,来源基础服务平台
* @param siteIdIncrement
*/
public void setSiteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
}
/**
* 获取 站点Id,来源基础服务平台
* @return siteIdList
*/
public List<Long> getSiteIdList(){
return this.siteIdList;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteIdList
*/
public void setSiteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
}
/** /**
* 获取 开始 创建时间 * 获取 开始 创建时间
* @return createTimeStart * @return createTimeStart
...@@ -399,21 +490,6 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -399,21 +490,6 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 接收人
* @return receiverList
*/
public List<String> getReceiverList(){
return this.receiverList;
}
/**
* 设置 接收人
* @param receiverList
*/
public void setReceiverList(List<String> receiverList){
this.receiverList = receiverList;
}
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param id * @param id
...@@ -461,7 +537,7 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -461,7 +537,7 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
/** /**
* 设置 电话号码 * 设置 联系电话
* @param mobile * @param mobile
*/ */
public AlarmSmsSendQuery mobile(String mobile){ public AlarmSmsSendQuery mobile(String mobile){
...@@ -470,7 +546,7 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -470,7 +546,7 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
} }
/** /**
* 设置 电话号码 * 设置 联系电话
* @param mobileList * @param mobileList
*/ */
public AlarmSmsSendQuery mobileList(List<String> mobileList){ public AlarmSmsSendQuery mobileList(List<String> mobileList){
...@@ -479,6 +555,25 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -479,6 +555,25 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
} }
/**
* 设置 接收人员
* @param receiver
*/
public AlarmSmsSendQuery receiver(String receiver){
setReceiver(receiver);
return this;
}
/**
* 设置 接收人员
* @param receiverList
*/
public AlarmSmsSendQuery receiverList(List<String> receiverList){
this.receiverList = receiverList;
return this;
}
/** /**
* 设置 发送内容 * 设置 发送内容
* @param sendMess * @param sendMess
...@@ -543,6 +638,51 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -543,6 +638,51 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
} }
/**
* 设置 站点Id,来源基础服务平台
* @param siteId
*/
public AlarmSmsSendQuery siteId(Long siteId){
setSiteId(siteId);
return this;
}
/**
* 设置 开始 站点Id,来源基础服务平台
* @param siteIdStart
*/
public AlarmSmsSendQuery siteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
return this;
}
/**
* 设置 结束 站点Id,来源基础服务平台
* @param siteIdEnd
*/
public AlarmSmsSendQuery siteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
return this;
}
/**
* 设置 增加 站点Id,来源基础服务平台
* @param siteIdIncrement
*/
public AlarmSmsSendQuery siteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
return this;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteIdList
*/
public AlarmSmsSendQuery siteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
return this;
}
/** /**
* 设置 更新用户 * 设置 更新用户
...@@ -590,25 +730,6 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity { ...@@ -590,25 +730,6 @@ public class AlarmSmsSendQuery extends AlarmSmsSendEntity {
} }
/**
* 设置 接收人
* @param receiver
*/
public AlarmSmsSendQuery receiver(String receiver){
setReceiver(receiver);
return this;
}
/**
* 设置 接收人
* @param receiverList
*/
public AlarmSmsSendQuery receiverList(List<String> receiverList){
this.receiverList = receiverList;
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
......
...@@ -8,11 +8,11 @@ import com.mortals.framework.annotation.Excel; ...@@ -8,11 +8,11 @@ import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.vo.DeviceAlarmInfoVo; import com.mortals.xhx.module.device.model.vo.DeviceAlarmInfoVo;
/** /**
* 设备告警日志实体对象 * 设备告警日志实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-08-22
*/ */
public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo { public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -22,9 +22,13 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo { ...@@ -22,9 +22,13 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
*/ */
private Date alarmTime; private Date alarmTime;
/** /**
* 告警设备 * 告警设备Id
*/ */
private Long alarmDevice; private Long alarmDevice;
/**
* 站点Id,来源基础服务平台
*/
private Long siteId;
/** /**
* 告警类型,(0.离线) * 告警类型,(0.离线)
*/ */
...@@ -68,19 +72,33 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo { ...@@ -68,19 +72,33 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
this.alarmTime = alarmTime; this.alarmTime = alarmTime;
} }
/** /**
* 获取 告警设备 * 获取 告警设备Id
* @return Long * @return Long
*/ */
public Long getAlarmDevice(){ public Long getAlarmDevice(){
return alarmDevice; return alarmDevice;
} }
/** /**
* 设置 告警设备 * 设置 告警设备Id
* @param alarmDevice * @param alarmDevice
*/ */
public void setAlarmDevice(Long alarmDevice){ public void setAlarmDevice(Long alarmDevice){
this.alarmDevice = alarmDevice; this.alarmDevice = alarmDevice;
} }
/**
* 获取 站点Id,来源基础服务平台
* @return Long
*/
public Long getSiteId(){
return siteId;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteId
*/
public void setSiteId(Long siteId){
this.siteId = siteId;
}
/** /**
* 获取 告警类型,(0.离线) * 获取 告警类型,(0.离线)
* @return Integer * @return Integer
...@@ -189,6 +207,7 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo { ...@@ -189,6 +207,7 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
sb.append(",alarmTime:").append(getAlarmTime()); sb.append(",alarmTime:").append(getAlarmTime());
sb.append(",alarmDevice:").append(getAlarmDevice()); sb.append(",alarmDevice:").append(getAlarmDevice());
sb.append(",siteId:").append(getSiteId());
sb.append(",alarmType:").append(getAlarmType()); sb.append(",alarmType:").append(getAlarmType());
sb.append(",alarmLevel:").append(getAlarmLevel()); sb.append(",alarmLevel:").append(getAlarmLevel());
sb.append(",alarmReceivePersonnel:").append(getAlarmReceivePersonnel()); sb.append(",alarmReceivePersonnel:").append(getAlarmReceivePersonnel());
...@@ -204,6 +223,8 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo { ...@@ -204,6 +223,8 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
this.alarmDevice = null; this.alarmDevice = null;
this.siteId = null;
this.alarmType = null; this.alarmType = null;
this.alarmLevel = null; this.alarmLevel = null;
......
...@@ -4,11 +4,11 @@ import java.util.Date; ...@@ -4,11 +4,11 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.device.model.DeviceAlarmInfoEntity; import com.mortals.xhx.module.device.model.DeviceAlarmInfoEntity;
/** /**
* 设备告警日志查询对象 * 设备告警日志查询对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-08-22
*/ */
public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -28,18 +28,30 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -28,18 +28,30 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
/** 结束 告警时间 */ /** 结束 告警时间 */
private String alarmTimeEnd; private String alarmTimeEnd;
/** 开始 告警设备 */ /** 开始 告警设备Id */
private Long alarmDeviceStart; private Long alarmDeviceStart;
/** 结束 告警设备 */ /** 结束 告警设备Id */
private Long alarmDeviceEnd; private Long alarmDeviceEnd;
/** 增加 告警设备 */ /** 增加 告警设备Id */
private Long alarmDeviceIncrement; private Long alarmDeviceIncrement;
/** 告警设备列表 */ /** 告警设备Id列表 */
private List <Long> alarmDeviceList; private List <Long> alarmDeviceList;
/** 开始 站点Id,来源基础服务平台 */
private Long siteIdStart;
/** 结束 站点Id,来源基础服务平台 */
private Long siteIdEnd;
/** 增加 站点Id,来源基础服务平台 */
private Long siteIdIncrement;
/** 站点Id,来源基础服务平台列表 */
private List <Long> siteIdList;
/** 开始 告警类型,(0.离线) */ /** 开始 告警类型,(0.离线) */
private Integer alarmTypeStart; private Integer alarmTypeStart;
...@@ -214,7 +226,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -214,7 +226,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 获取 开始 告警设备 * 获取 开始 告警设备Id
* @return alarmDeviceStart * @return alarmDeviceStart
*/ */
public Long getAlarmDeviceStart(){ public Long getAlarmDeviceStart(){
...@@ -222,7 +234,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -222,7 +234,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 设置 开始 告警设备 * 设置 开始 告警设备Id
* @param alarmDeviceStart * @param alarmDeviceStart
*/ */
public void setAlarmDeviceStart(Long alarmDeviceStart){ public void setAlarmDeviceStart(Long alarmDeviceStart){
...@@ -230,7 +242,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -230,7 +242,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 获取 结束 告警设备 * 获取 结束 告警设备Id
* @return $alarmDeviceEnd * @return $alarmDeviceEnd
*/ */
public Long getAlarmDeviceEnd(){ public Long getAlarmDeviceEnd(){
...@@ -238,7 +250,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -238,7 +250,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 设置 结束 告警设备 * 设置 结束 告警设备Id
* @param alarmDeviceEnd * @param alarmDeviceEnd
*/ */
public void setAlarmDeviceEnd(Long alarmDeviceEnd){ public void setAlarmDeviceEnd(Long alarmDeviceEnd){
...@@ -246,7 +258,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -246,7 +258,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 获取 增加 告警设备 * 获取 增加 告警设备Id
* @return alarmDeviceIncrement * @return alarmDeviceIncrement
*/ */
public Long getAlarmDeviceIncrement(){ public Long getAlarmDeviceIncrement(){
...@@ -254,7 +266,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -254,7 +266,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 设置 增加 告警设备 * 设置 增加 告警设备Id
* @param alarmDeviceIncrement * @param alarmDeviceIncrement
*/ */
public void setAlarmDeviceIncrement(Long alarmDeviceIncrement){ public void setAlarmDeviceIncrement(Long alarmDeviceIncrement){
...@@ -262,7 +274,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -262,7 +274,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 获取 告警设备 * 获取 告警设备Id
* @return alarmDeviceList * @return alarmDeviceList
*/ */
public List<Long> getAlarmDeviceList(){ public List<Long> getAlarmDeviceList(){
...@@ -270,13 +282,77 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -270,13 +282,77 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 设置 告警设备 * 设置 告警设备Id
* @param alarmDeviceList * @param alarmDeviceList
*/ */
public void setAlarmDeviceList(List<Long> alarmDeviceList){ public void setAlarmDeviceList(List<Long> alarmDeviceList){
this.alarmDeviceList = alarmDeviceList; this.alarmDeviceList = alarmDeviceList;
} }
/**
* 获取 开始 站点Id,来源基础服务平台
* @return siteIdStart
*/
public Long getSiteIdStart(){
return this.siteIdStart;
}
/**
* 设置 开始 站点Id,来源基础服务平台
* @param siteIdStart
*/
public void setSiteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
}
/**
* 获取 结束 站点Id,来源基础服务平台
* @return $siteIdEnd
*/
public Long getSiteIdEnd(){
return this.siteIdEnd;
}
/**
* 设置 结束 站点Id,来源基础服务平台
* @param siteIdEnd
*/
public void setSiteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
}
/**
* 获取 增加 站点Id,来源基础服务平台
* @return siteIdIncrement
*/
public Long getSiteIdIncrement(){
return this.siteIdIncrement;
}
/**
* 设置 增加 站点Id,来源基础服务平台
* @param siteIdIncrement
*/
public void setSiteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
}
/**
* 获取 站点Id,来源基础服务平台
* @return siteIdList
*/
public List<Long> getSiteIdList(){
return this.siteIdList;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteIdList
*/
public void setSiteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
}
/** /**
* 获取 开始 告警类型,(0.离线) * 获取 开始 告警类型,(0.离线)
* @return alarmTypeStart * @return alarmTypeStart
...@@ -689,7 +765,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -689,7 +765,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
/** /**
* 设置 告警设备 * 设置 告警设备Id
* @param alarmDevice * @param alarmDevice
*/ */
public DeviceAlarmInfoQuery alarmDevice(Long alarmDevice){ public DeviceAlarmInfoQuery alarmDevice(Long alarmDevice){
...@@ -698,7 +774,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -698,7 +774,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 设置 开始 告警设备 * 设置 开始 告警设备Id
* @param alarmDeviceStart * @param alarmDeviceStart
*/ */
public DeviceAlarmInfoQuery alarmDeviceStart(Long alarmDeviceStart){ public DeviceAlarmInfoQuery alarmDeviceStart(Long alarmDeviceStart){
...@@ -707,7 +783,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -707,7 +783,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 设置 结束 告警设备 * 设置 结束 告警设备Id
* @param alarmDeviceEnd * @param alarmDeviceEnd
*/ */
public DeviceAlarmInfoQuery alarmDeviceEnd(Long alarmDeviceEnd){ public DeviceAlarmInfoQuery alarmDeviceEnd(Long alarmDeviceEnd){
...@@ -716,7 +792,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -716,7 +792,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 设置 增加 告警设备 * 设置 增加 告警设备Id
* @param alarmDeviceIncrement * @param alarmDeviceIncrement
*/ */
public DeviceAlarmInfoQuery alarmDeviceIncrement(Long alarmDeviceIncrement){ public DeviceAlarmInfoQuery alarmDeviceIncrement(Long alarmDeviceIncrement){
...@@ -725,7 +801,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -725,7 +801,7 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
} }
/** /**
* 设置 告警设备 * 设置 告警设备Id
* @param alarmDeviceList * @param alarmDeviceList
*/ */
public DeviceAlarmInfoQuery alarmDeviceList(List<Long> alarmDeviceList){ public DeviceAlarmInfoQuery alarmDeviceList(List<Long> alarmDeviceList){
...@@ -733,6 +809,51 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity { ...@@ -733,6 +809,51 @@ public class DeviceAlarmInfoQuery extends DeviceAlarmInfoEntity {
return this; return this;
} }
/**
* 设置 站点Id,来源基础服务平台
* @param siteId
*/
public DeviceAlarmInfoQuery siteId(Long siteId){
setSiteId(siteId);
return this;
}
/**
* 设置 开始 站点Id,来源基础服务平台
* @param siteIdStart
*/
public DeviceAlarmInfoQuery siteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
return this;
}
/**
* 设置 结束 站点Id,来源基础服务平台
* @param siteIdEnd
*/
public DeviceAlarmInfoQuery siteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
return this;
}
/**
* 设置 增加 站点Id,来源基础服务平台
* @param siteIdIncrement
*/
public DeviceAlarmInfoQuery siteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
return this;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteIdList
*/
public DeviceAlarmInfoQuery siteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
return this;
}
/** /**
* 设置 告警类型,(0.离线) * 设置 告警类型,(0.离线)
* @param alarmType * @param alarmType
......
...@@ -188,6 +188,11 @@ public class DeviceEntity extends DeviceVo { ...@@ -188,6 +188,11 @@ public class DeviceEntity extends DeviceVo {
*/ */
private String homeUrl; private String homeUrl;
/**
* 设备版本
*/
private String deviceVersion;
public DeviceEntity(){} public DeviceEntity(){}
...@@ -715,6 +720,14 @@ public class DeviceEntity extends DeviceVo { ...@@ -715,6 +720,14 @@ public class DeviceEntity extends DeviceVo {
this.deviceSN = 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();
...@@ -849,6 +862,8 @@ public class DeviceEntity extends DeviceVo { ...@@ -849,6 +862,8 @@ public class DeviceEntity extends DeviceVo {
this.skinName = ""; this.skinName = "";
this.deviceVersion = "";
this.homeUrl = ""; this.homeUrl = "";
} }
} }
\ No newline at end of file
...@@ -10,7 +10,7 @@ import com.mortals.xhx.module.device.model.vo.DeviceLogVo; ...@@ -10,7 +10,7 @@ import com.mortals.xhx.module.device.model.vo.DeviceLogVo;
* 设备日志实体对象 * 设备日志实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-02 * @date 2022-08-22
*/ */
public class DeviceLogEntity extends DeviceLogVo { public class DeviceLogEntity extends DeviceLogVo {
...@@ -20,6 +20,10 @@ public class DeviceLogEntity extends DeviceLogVo { ...@@ -20,6 +20,10 @@ public class DeviceLogEntity extends DeviceLogVo {
* traceId,日志追踪id * traceId,日志追踪id
*/ */
private String traceID; private String traceID;
/**
* 站点Id,来源基础服务平台
*/
private Long siteId;
/** /**
* 设备ID * 设备ID
*/ */
...@@ -62,6 +66,20 @@ public class DeviceLogEntity extends DeviceLogVo { ...@@ -62,6 +66,20 @@ public class DeviceLogEntity extends DeviceLogVo {
public void setTraceID(String traceID){ public void setTraceID(String traceID){
this.traceID = traceID; this.traceID = traceID;
} }
/**
* 获取 站点Id,来源基础服务平台
* @return Long
*/
public Long getSiteId(){
return siteId;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteId
*/
public void setSiteId(Long siteId){
this.siteId = siteId;
}
/** /**
* 获取 设备ID * 获取 设备ID
* @return Long * @return Long
...@@ -169,6 +187,7 @@ public class DeviceLogEntity extends DeviceLogVo { ...@@ -169,6 +187,7 @@ public class DeviceLogEntity extends DeviceLogVo {
public String toString(){ public String toString(){
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
sb.append(",traceID:").append(getTraceID()); sb.append(",traceID:").append(getTraceID());
sb.append(",siteId:").append(getSiteId());
sb.append(",deviceId:").append(getDeviceId()); sb.append(",deviceId:").append(getDeviceId());
sb.append(",deviceCode:").append(getDeviceCode()); sb.append(",deviceCode:").append(getDeviceCode());
sb.append(",deviceName:").append(getDeviceName()); sb.append(",deviceName:").append(getDeviceName());
...@@ -182,6 +201,8 @@ public class DeviceLogEntity extends DeviceLogVo { ...@@ -182,6 +201,8 @@ public class DeviceLogEntity extends DeviceLogVo {
this.traceID = ""; this.traceID = "";
this.siteId = null;
this.deviceId = null; this.deviceId = null;
this.deviceCode = ""; this.deviceCode = "";
......
...@@ -6,7 +6,7 @@ import com.mortals.xhx.module.device.model.DeviceLogEntity; ...@@ -6,7 +6,7 @@ import com.mortals.xhx.module.device.model.DeviceLogEntity;
* 设备日志查询对象 * 设备日志查询对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-02 * @date 2022-08-22
*/ */
public class DeviceLogQuery extends DeviceLogEntity { public class DeviceLogQuery extends DeviceLogEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
...@@ -24,6 +24,18 @@ public class DeviceLogQuery extends DeviceLogEntity { ...@@ -24,6 +24,18 @@ public class DeviceLogQuery extends DeviceLogEntity {
/** traceId,日志追踪id */ /** traceId,日志追踪id */
private List<String> traceIDList; private List<String> traceIDList;
/** 开始 站点Id,来源基础服务平台 */
private Long siteIdStart;
/** 结束 站点Id,来源基础服务平台 */
private Long siteIdEnd;
/** 增加 站点Id,来源基础服务平台 */
private Long siteIdIncrement;
/** 站点Id,来源基础服务平台列表 */
private List <Long> siteIdList;
/** 开始 设备ID */ /** 开始 设备ID */
private Long deviceIdStart; private Long deviceIdStart;
...@@ -183,6 +195,70 @@ public class DeviceLogQuery extends DeviceLogEntity { ...@@ -183,6 +195,70 @@ public class DeviceLogQuery extends DeviceLogEntity {
public void setTraceIDList(List<String> traceIDList){ public void setTraceIDList(List<String> traceIDList){
this.traceIDList = traceIDList; this.traceIDList = traceIDList;
} }
/**
* 获取 开始 站点Id,来源基础服务平台
* @return siteIdStart
*/
public Long getSiteIdStart(){
return this.siteIdStart;
}
/**
* 设置 开始 站点Id,来源基础服务平台
* @param siteIdStart
*/
public void setSiteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
}
/**
* 获取 结束 站点Id,来源基础服务平台
* @return $siteIdEnd
*/
public Long getSiteIdEnd(){
return this.siteIdEnd;
}
/**
* 设置 结束 站点Id,来源基础服务平台
* @param siteIdEnd
*/
public void setSiteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
}
/**
* 获取 增加 站点Id,来源基础服务平台
* @return siteIdIncrement
*/
public Long getSiteIdIncrement(){
return this.siteIdIncrement;
}
/**
* 设置 增加 站点Id,来源基础服务平台
* @param siteIdIncrement
*/
public void setSiteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
}
/**
* 获取 站点Id,来源基础服务平台
* @return siteIdList
*/
public List<Long> getSiteIdList(){
return this.siteIdList;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteIdList
*/
public void setSiteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
}
/** /**
* 获取 开始 设备ID * 获取 开始 设备ID
* @return deviceIdStart * @return deviceIdStart
...@@ -627,6 +703,51 @@ public class DeviceLogQuery extends DeviceLogEntity { ...@@ -627,6 +703,51 @@ public class DeviceLogQuery extends DeviceLogEntity {
return this; return this;
} }
/**
* 设置 站点Id,来源基础服务平台
* @param siteId
*/
public DeviceLogQuery siteId(Long siteId){
setSiteId(siteId);
return this;
}
/**
* 设置 开始 站点Id,来源基础服务平台
* @param siteIdStart
*/
public DeviceLogQuery siteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
return this;
}
/**
* 设置 结束 站点Id,来源基础服务平台
* @param siteIdEnd
*/
public DeviceLogQuery siteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
return this;
}
/**
* 设置 增加 站点Id,来源基础服务平台
* @param siteIdIncrement
*/
public DeviceLogQuery siteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
return this;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteIdList
*/
public DeviceLogQuery siteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
return this;
}
/** /**
* 设置 设备ID * 设置 设备ID
* @param deviceId * @param deviceId
......
...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.device.model.DeviceEntity; ...@@ -7,7 +7,7 @@ import com.mortals.xhx.module.device.model.DeviceEntity;
* 设备查询对象 * 设备查询对象
* *
* @author zxfei * @author zxfei
* @date 2022-08-12 * @date 2022-08-22
*/ */
public class DeviceQuery extends DeviceEntity { public class DeviceQuery extends DeviceEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
...@@ -28,6 +28,9 @@ public class DeviceQuery extends DeviceEntity { ...@@ -28,6 +28,9 @@ public class DeviceQuery extends DeviceEntity {
/** 设备编码,SN码等,默认为MAC地址 */ /** 设备编码,SN码等,默认为MAC地址 */
private List<String> deviceCodeList; private List<String> deviceCodeList;
/** 设备SN码 */
private List<String> deviceSNList;
/** 设备的MAC地址 */ /** 设备的MAC地址 */
private List<String> deviceMacList; private List<String> deviceMacList;
...@@ -259,6 +262,9 @@ public class DeviceQuery extends DeviceEntity { ...@@ -259,6 +262,9 @@ public class DeviceQuery extends DeviceEntity {
/** 是否删除(0.否,1.是)列表 */ /** 是否删除(0.否,1.是)列表 */
private List <Integer> deletedList; private List <Integer> deletedList;
/** 设备版本 */
private List<String> deviceVersionList;
/** 开始 设备来源(0.旧设备,1.新设备) */ /** 开始 设备来源(0.旧设备,1.新设备) */
private Integer sourceStart; private Integer sourceStart;
...@@ -307,9 +313,6 @@ public class DeviceQuery extends DeviceEntity { ...@@ -307,9 +313,6 @@ public class DeviceQuery extends DeviceEntity {
/** 结束 更新时间 */ /** 结束 更新时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 设备SN码 */
private List<String> deviceSNList;
/** 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;
...@@ -412,6 +415,21 @@ public class DeviceQuery extends DeviceEntity { ...@@ -412,6 +415,21 @@ public class DeviceQuery extends DeviceEntity {
public void setDeviceCodeList(List<String> deviceCodeList){ public void setDeviceCodeList(List<String> deviceCodeList){
this.deviceCodeList = deviceCodeList; this.deviceCodeList = deviceCodeList;
} }
/**
* 获取 设备SN码
* @return deviceSNList
*/
public List<String> getDeviceSNList(){
return this.deviceSNList;
}
/**
* 设置 设备SN码
* @param deviceSNList
*/
public void setDeviceSNList(List<String> deviceSNList){
this.deviceSNList = deviceSNList;
}
/** /**
* 获取 设备的MAC地址 * 获取 设备的MAC地址
* @return deviceMacList * @return deviceMacList
...@@ -1625,6 +1643,21 @@ public class DeviceQuery extends DeviceEntity { ...@@ -1625,6 +1643,21 @@ public class DeviceQuery extends DeviceEntity {
this.deletedList = deletedList; this.deletedList = deletedList;
} }
/**
* 获取 设备版本
* @return deviceVersionList
*/
public List<String> getDeviceVersionList(){
return this.deviceVersionList;
}
/**
* 设置 设备版本
* @param deviceVersionList
*/
public void setDeviceVersionList(List<String> deviceVersionList){
this.deviceVersionList = deviceVersionList;
}
/** /**
* 获取 开始 设备来源(0.旧设备,1.新设备) * 获取 开始 设备来源(0.旧设备,1.新设备)
* @return sourceStart * @return sourceStart
...@@ -1881,21 +1914,6 @@ public class DeviceQuery extends DeviceEntity { ...@@ -1881,21 +1914,6 @@ public class DeviceQuery extends DeviceEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 设备SN码
* @return deviceSNList
*/
public List<String> getDeviceSNList(){
return this.deviceSNList;
}
/**
* 设置 设备SN码
* @param deviceSNList
*/
public void setDeviceSNList(List<String> deviceSNList){
this.deviceSNList = deviceSNList;
}
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param id * @param id
...@@ -1980,6 +1998,25 @@ public class DeviceQuery extends DeviceEntity { ...@@ -1980,6 +1998,25 @@ public class DeviceQuery extends DeviceEntity {
} }
/**
* 设置 设备SN码
* @param deviceSN
*/
public DeviceQuery deviceSN(String deviceSN){
setDeviceSN(deviceSN);
return this;
}
/**
* 设置 设备SN码
* @param deviceSNList
*/
public DeviceQuery deviceSNList(List<String> deviceSNList){
this.deviceSNList = deviceSNList;
return this;
}
/** /**
* 设置 设备的MAC地址 * 设置 设备的MAC地址
* @param deviceMac * @param deviceMac
...@@ -2928,6 +2965,25 @@ public class DeviceQuery extends DeviceEntity { ...@@ -2928,6 +2965,25 @@ public class DeviceQuery extends DeviceEntity {
return this; return this;
} }
/**
* 设置 设备版本
* @param deviceVersion
*/
public DeviceQuery deviceVersion(String deviceVersion){
setDeviceVersion(deviceVersion);
return this;
}
/**
* 设置 设备版本
* @param deviceVersionList
*/
public DeviceQuery deviceVersionList(List<String> deviceVersionList){
this.deviceVersionList = deviceVersionList;
return this;
}
/** /**
* 设置 设备来源(0.旧设备,1.新设备) * 设置 设备来源(0.旧设备,1.新设备)
* @param source * @param source
...@@ -3065,25 +3121,6 @@ public class DeviceQuery extends DeviceEntity { ...@@ -3065,25 +3121,6 @@ public class DeviceQuery extends DeviceEntity {
} }
/**
* 设置 设备SN码
* @param deviceSN
*/
public DeviceQuery deviceSN(String deviceSN){
setDeviceSN(deviceSN);
return this;
}
/**
* 设置 设备SN码
* @param deviceSNList
*/
public DeviceQuery deviceSNList(List<String> deviceSNList){
this.deviceSNList = deviceSNList;
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
......
...@@ -11,12 +11,16 @@ import com.mortals.xhx.module.device.model.vo.DeviceStatVo; ...@@ -11,12 +11,16 @@ import com.mortals.xhx.module.device.model.vo.DeviceStatVo;
* 设备统计实体对象 * 设备统计实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-05 * @date 2022-08-22
*/ */
public class DeviceStatEntity extends DeviceStatVo { public class DeviceStatEntity extends DeviceStatVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 站点Id,来源基础服务平台
*/
private Long siteId;
/** /**
* 设备总数 * 设备总数
*/ */
...@@ -57,6 +61,14 @@ public class DeviceStatEntity extends DeviceStatVo { ...@@ -57,6 +61,14 @@ public class DeviceStatEntity extends DeviceStatVo {
* 停用率 * 停用率
*/ */
private BigDecimal deviceStopRatio; private BigDecimal deviceStopRatio;
/**
* 未激活设备数量
*/
private Integer deviceUnActiveCount;
/**
* 未激活率
*/
private BigDecimal deviceUnActiveRatio;
/** /**
* 今日告警数量 * 今日告警数量
*/ */
...@@ -97,6 +109,20 @@ public class DeviceStatEntity extends DeviceStatVo { ...@@ -97,6 +109,20 @@ public class DeviceStatEntity extends DeviceStatVo {
public DeviceStatEntity(){} public DeviceStatEntity(){}
/**
* 获取 站点Id,来源基础服务平台
* @return Long
*/
public Long getSiteId(){
return siteId;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteId
*/
public void setSiteId(Long siteId){
this.siteId = siteId;
}
/** /**
* 获取 设备总数 * 获取 设备总数
* @return Integer * @return Integer
...@@ -237,6 +263,34 @@ public class DeviceStatEntity extends DeviceStatVo { ...@@ -237,6 +263,34 @@ public class DeviceStatEntity extends DeviceStatVo {
public void setDeviceStopRatio(BigDecimal deviceStopRatio){ public void setDeviceStopRatio(BigDecimal deviceStopRatio){
this.deviceStopRatio = deviceStopRatio; this.deviceStopRatio = deviceStopRatio;
} }
/**
* 获取 未激活设备数量
* @return Integer
*/
public Integer getDeviceUnActiveCount(){
return deviceUnActiveCount;
}
/**
* 设置 未激活设备数量
* @param deviceUnActiveCount
*/
public void setDeviceUnActiveCount(Integer deviceUnActiveCount){
this.deviceUnActiveCount = deviceUnActiveCount;
}
/**
* 获取 未激活率
* @return BigDecimal
*/
public BigDecimal getDeviceUnActiveRatio(){
return deviceUnActiveRatio;
}
/**
* 设置 未激活率
* @param deviceUnActiveRatio
*/
public void setDeviceUnActiveRatio(BigDecimal deviceUnActiveRatio){
this.deviceUnActiveRatio = deviceUnActiveRatio;
}
/** /**
* 获取 今日告警数量 * 获取 今日告警数量
* @return Integer * @return Integer
...@@ -385,6 +439,7 @@ public class DeviceStatEntity extends DeviceStatVo { ...@@ -385,6 +439,7 @@ public class DeviceStatEntity extends DeviceStatVo {
public String toString(){ public String toString(){
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
sb.append(",siteId:").append(getSiteId());
sb.append(",deviceTotalCount:").append(getDeviceTotalCount()); sb.append(",deviceTotalCount:").append(getDeviceTotalCount());
sb.append(",deviceAddCount:").append(getDeviceAddCount()); sb.append(",deviceAddCount:").append(getDeviceAddCount());
sb.append(",siteTotalCount:").append(getSiteTotalCount()); sb.append(",siteTotalCount:").append(getSiteTotalCount());
...@@ -395,6 +450,8 @@ public class DeviceStatEntity extends DeviceStatVo { ...@@ -395,6 +450,8 @@ public class DeviceStatEntity extends DeviceStatVo {
sb.append(",deviceOfflineRatio:").append(getDeviceOfflineRatio()); sb.append(",deviceOfflineRatio:").append(getDeviceOfflineRatio());
sb.append(",deviceStopCount:").append(getDeviceStopCount()); sb.append(",deviceStopCount:").append(getDeviceStopCount());
sb.append(",deviceStopRatio:").append(getDeviceStopRatio()); sb.append(",deviceStopRatio:").append(getDeviceStopRatio());
sb.append(",deviceUnActiveCount:").append(getDeviceUnActiveCount());
sb.append(",deviceUnActiveRatio:").append(getDeviceUnActiveRatio());
sb.append(",alarmTotalCount:").append(getAlarmTotalCount()); sb.append(",alarmTotalCount:").append(getAlarmTotalCount());
sb.append(",alarmAddCount:").append(getAlarmAddCount()); sb.append(",alarmAddCount:").append(getAlarmAddCount());
sb.append(",pushTotalCount:").append(getPushTotalCount()); sb.append(",pushTotalCount:").append(getPushTotalCount());
...@@ -409,6 +466,8 @@ public class DeviceStatEntity extends DeviceStatVo { ...@@ -409,6 +466,8 @@ public class DeviceStatEntity extends DeviceStatVo {
public void initAttrValue(){ public void initAttrValue(){
this.siteId = null;
this.deviceTotalCount = 0; this.deviceTotalCount = 0;
this.deviceAddCount = 0; this.deviceAddCount = 0;
...@@ -429,6 +488,10 @@ public class DeviceStatEntity extends DeviceStatVo { ...@@ -429,6 +488,10 @@ public class DeviceStatEntity extends DeviceStatVo {
this.deviceStopRatio = BigDecimal.valueOf(0.00); this.deviceStopRatio = BigDecimal.valueOf(0.00);
this.deviceUnActiveCount = 0;
this.deviceUnActiveRatio = BigDecimal.valueOf(0.00);
this.alarmTotalCount = 0; this.alarmTotalCount = 0;
this.alarmAddCount = 0; this.alarmAddCount = 0;
......
...@@ -58,7 +58,7 @@ public interface DeviceService extends ICRUDCacheService<DeviceEntity,Long>{ ...@@ -58,7 +58,7 @@ public interface DeviceService extends ICRUDCacheService<DeviceEntity,Long>{
* 设备统计当天情况 * 设备统计当天情况
* @param context * @param context
*/ */
void deviceStat(Context context); void deviceStat(Long siteId,Context context);
List<DeviceMapEntity> deviceMap(DeviceEntity query, Context context); List<DeviceMapEntity> deviceMap(DeviceEntity query, Context context);
......
...@@ -337,15 +337,17 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -337,15 +337,17 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
* @param context * @param context
*/ */
@Override @Override
public void deviceStat(Context context) { public void deviceStat(Long siteId,Context context) {
//查询当天统计,如果有 则更新统计结果,否则新增 //查询当天统计,如果有 则更新统计结果,否则新增
DeviceStatEntity deviceStatEntity = deviceStatService.selectOne(new DeviceStatQuery() DeviceStatEntity deviceStatEntity = deviceStatService.selectOne(new DeviceStatQuery()
.siteId(siteId)
.year(DateUtil.year(new Date())) .year(DateUtil.year(new Date()))
.month(DateUtil.month(new Date()) + 1) .month(DateUtil.month(new Date()) + 1)
.day(DateUtil.dayOfMonth(new Date()))); .day(DateUtil.dayOfMonth(new Date())));
if (ObjectUtils.isEmpty(deviceStatEntity)) { if (ObjectUtils.isEmpty(deviceStatEntity)) {
deviceStatEntity = new DeviceStatEntity(); deviceStatEntity = new DeviceStatEntity();
deviceStatEntity.initAttrValue(); deviceStatEntity.initAttrValue();
deviceStatEntity.setSiteId(siteId);
deviceStatEntity.setCreateTime(new Date()); deviceStatEntity.setCreateTime(new Date());
deviceStatEntity.setYear(DateUtil.year(new Date())); deviceStatEntity.setYear(DateUtil.year(new Date()));
deviceStatEntity.setMonth(DateUtil.month(new Date()) + 1); deviceStatEntity.setMonth(DateUtil.month(new Date()) + 1);
...@@ -354,28 +356,40 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -354,28 +356,40 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
//获取昨天统计数据 //获取昨天统计数据
DeviceStatEntity yesterdayDeviceStat = deviceStatService.selectOne(new DeviceStatQuery() DeviceStatEntity yesterdayDeviceStat = deviceStatService.selectOne(new DeviceStatQuery()
.siteId(siteId)
.year(DateUtil.year(DateUtil.yesterday())) .year(DateUtil.year(DateUtil.yesterday()))
.month(DateUtil.month(DateUtil.yesterday()) + 1) .month(DateUtil.month(DateUtil.yesterday()) + 1)
.day(DateUtil.dayOfMonth(DateUtil.yesterday()))); .day(DateUtil.dayOfMonth(DateUtil.yesterday())));
if (ObjectUtils.isEmpty(yesterdayDeviceStat)) { if (ObjectUtils.isEmpty(yesterdayDeviceStat)) {
yesterdayDeviceStat = new DeviceStatEntity(); yesterdayDeviceStat = new DeviceStatEntity();
yesterdayDeviceStat.initAttrValue(); yesterdayDeviceStat.initAttrValue();
yesterdayDeviceStat.setSiteId(siteId);
yesterdayDeviceStat.setYear(DateUtil.year(DateUtil.yesterday()));
} }
try { try {
//获取设备总数 //获取设备总数
List<DeviceEntity> deviceList = this.find(new DeviceQuery()); List<DeviceEntity> deviceList = this.find(new DeviceQuery().siteId(siteId));
Integer deviceTotalCount = deviceList.size(); Integer deviceTotalCount = deviceList.size();
//未激活数量
Long deviceUnActiveCount = deviceList.parallelStream()
.filter(f -> f.getDeviceStatus() == DeviceStatusEnum.未激活.getValue())
.count();
//激活设备
Integer deviceActiveCount = deviceList.size() - deviceUnActiveCount.intValue();
deviceStatEntity.setDeviceTotalCount(deviceTotalCount); deviceStatEntity.setDeviceTotalCount(deviceTotalCount);
deviceStatEntity.setDeviceAddCount(deviceTotalCount - yesterdayDeviceStat.getDeviceTotalCount()); deviceStatEntity.setDeviceAddCount(deviceTotalCount - yesterdayDeviceStat.getDeviceTotalCount());
//站点数量 ///统计按当前站点归集 // TODO: 2022/8/22
SitePdu sitePdu = new SitePdu(); Rest<List<SitePdu>> resp = siteFeign.getFlatSitesBySiteId(new SitePdu().id(siteId));
sitePdu.setSize(-1); // SitePdu sitePdu = new SitePdu();
Rest<RespData<List<SitePdu>>> resp = siteFeign.list(sitePdu); // sitePdu.setSize(-1);
// Rest<RespData<List<SitePdu>>> resp = siteFeign.list(sitePdu);
//
if (resp.getCode() == 1) { if (resp.getCode() == 1) {
List<SitePdu> sitePduList = resp.getData().getData(); List<SitePdu> sitePduList = resp.getData();
deviceStatEntity.setSiteTotalCount(sitePduList.size()); deviceStatEntity.setSiteTotalCount(sitePduList.size());
deviceStatEntity.setSiteAddCount(sitePduList.size() - yesterdayDeviceStat.getSiteTotalCount()); deviceStatEntity.setSiteAddCount(sitePduList.size() - yesterdayDeviceStat.getSiteTotalCount());
} }
...@@ -387,7 +401,10 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -387,7 +401,10 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
.filter(f -> f.getDeviceStatus() == DeviceStatusEnum.在线.getValue()) .filter(f -> f.getDeviceStatus() == DeviceStatusEnum.在线.getValue())
.count(); .count();
deviceStatEntity.setDeviceOnlineCount(deviceOnlineCount.intValue()); deviceStatEntity.setDeviceOnlineCount(deviceOnlineCount.intValue());
deviceStatEntity.setDeviceOnlineRatio(new BigDecimal(deviceOnlineCount).divide(new BigDecimal(deviceList.size()), ROUND_HALF_DOWN).setScale(2)); //在线率=在线设备/所有激活设备
if(deviceActiveCount>0){
deviceStatEntity.setDeviceOnlineRatio(new BigDecimal(deviceOnlineCount).divide(new BigDecimal(deviceActiveCount), ROUND_HALF_DOWN).setScale(2));
}
//离线数量 //离线数量
Long deviceOfflineCount = deviceList.parallelStream() Long deviceOfflineCount = deviceList.parallelStream()
...@@ -396,15 +413,24 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -396,15 +413,24 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
.filter(f -> f.getDeviceStatus() == DeviceStatusEnum.离线.getValue()) .filter(f -> f.getDeviceStatus() == DeviceStatusEnum.离线.getValue())
.count(); .count();
deviceStatEntity.setDeviceOfflineCount(deviceOfflineCount.intValue()); deviceStatEntity.setDeviceOfflineCount(deviceOfflineCount.intValue());
deviceStatEntity.setDeviceOfflineRatio(new BigDecimal(deviceOfflineCount).divide(new BigDecimal(deviceList.size()), ROUND_HALF_DOWN).setScale(2)); if(deviceActiveCount>0) {
deviceStatEntity.setDeviceOfflineRatio(new BigDecimal(deviceOfflineCount).divide(new BigDecimal(deviceActiveCount), ROUND_HALF_DOWN).setScale(2));
}
//停用数量 //停用数量
Long deviceStopCount = deviceList.parallelStream() Long deviceStopCount = deviceList.parallelStream()
.filter(f -> f.getDeviceStatus() > DeviceStatusEnum.未激活.getValue()) .filter(f -> f.getDeviceStatus() > DeviceStatusEnum.未激活.getValue())
.filter(f -> f.getEnabled() == YesNoEnum.NO.getValue()) .filter(f -> f.getEnabled() == YesNoEnum.NO.getValue())
.count(); .count();
deviceStatEntity.setDeviceStopCount(deviceStopCount.intValue()); deviceStatEntity.setDeviceStopCount(deviceStopCount.intValue());
deviceStatEntity.setDeviceStopRatio(new BigDecimal(deviceStopCount).divide(new BigDecimal(deviceList.size()), ROUND_HALF_DOWN).setScale(2)); if(deviceActiveCount>0) {
deviceStatEntity.setDeviceStopRatio(new BigDecimal(deviceStopCount).divide(new BigDecimal(deviceActiveCount), ROUND_HALF_DOWN).setScale(2));
}
deviceStatEntity.setDeviceUnActiveCount(deviceUnActiveCount.intValue());
if(deviceActiveCount>0) {
deviceStatEntity.setDeviceUnActiveRatio(new BigDecimal(deviceUnActiveCount).divide(new BigDecimal(deviceActiveCount), ROUND_HALF_DOWN).setScale(2));
}
//今日告警数量 //今日告警数量
DeviceAlarmInfoQuery deviceAlarmInfoQuery = new DeviceAlarmInfoQuery(); DeviceAlarmInfoQuery deviceAlarmInfoQuery = new DeviceAlarmInfoQuery();
...@@ -432,6 +458,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -432,6 +458,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
deviceStatEntity.setUploadMessageTotalCount(collect.getOrDefault(true, 0L).intValue()); deviceStatEntity.setUploadMessageTotalCount(collect.getOrDefault(true, 0L).intValue());
deviceStatEntity.setDownloadMessageTotalCount(collect.getOrDefault(false, 0L).intValue()); deviceStatEntity.setDownloadMessageTotalCount(collect.getOrDefault(false, 0L).intValue());
deviceStatEntity.setSiteId(siteId);
if (deviceStatEntity.newEntity()) { if (deviceStatEntity.newEntity()) {
deviceStatEntity.setCreateTime(new Date()); deviceStatEntity.setCreateTime(new Date());
deviceStatService.save(deviceStatEntity); deviceStatService.save(deviceStatEntity);
......
package com.mortals.xhx.module.device.service.impl; package com.mortals.xhx.module.device.service.impl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.feign.site.ISiteFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.device.dao.DeviceStatDao; import com.mortals.xhx.module.device.dao.DeviceStatDao;
import com.mortals.xhx.module.device.model.DeviceStatEntity; import com.mortals.xhx.module.device.model.DeviceStatEntity;
import com.mortals.xhx.module.device.service.DeviceStatService; import com.mortals.xhx.module.device.service.DeviceStatService;
import org.springframework.util.ObjectUtils; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* DeviceStatService * DeviceStatService
......
...@@ -51,6 +51,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -51,6 +51,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.IntStream; import java.util.stream.IntStream;
...@@ -112,7 +113,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -112,7 +113,7 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
Rest<RespData<List<SkinBasePdu>>> resp = skinBaseFeign.list(new SkinBasePdu()); Rest<RespData<List<SkinBasePdu>>> resp = skinBaseFeign.list(new SkinBasePdu());
log.info("skinBaseFeignResp:{}",JSON.toJSONString(resp)); log.info("skinBaseFeignResp:{}",JSON.toJSONString(resp));
if (resp.getCode() == YesNoEnum.YES.getValue()) { if (resp.getCode() == YesNoEnum.YES.getValue()) {
Map<String, Map<String, String>> skinProductCodeMap = resp.getData().getData().stream().collect(Collectors.groupingBy(x -> x.getProductCode(), Collectors.toMap(a -> a.getImageResolution()==null?"":a.getImageResolution(), b -> b.getImageResolutionValue(),(o,n)->n))); Map<String, Map<String, String>> skinProductCodeMap = resp.getData().getData().stream().collect(Collectors.groupingBy(x -> x.getProductCode(), Collectors.toMap(a -> a.getImageResolution()==null?"":a.getImageResolution(), b -> b.getImageResolutionValue()==null?"":b.getImageResolutionValue(),(o,n)->n)));
this.addDict(model, "skinProductCodeMap", skinProductCodeMap); this.addDict(model, "skinProductCodeMap", skinProductCodeMap);
} }
super.init(model, context); super.init(model, context);
...@@ -297,4 +298,10 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -297,4 +298,10 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
} }
return super.editAfter(id, model, entity, context); return super.editAfter(id, model, entity, context);
} }
public static void main(String[] args) {
String str2 = "510000000000".replaceAll("(0)+$", "");
System.out.println(str2);
//System.out.println(new BigDecimal("510105000000").stripTrailingZeros().toPlainString());
}
} }
\ No newline at end of file
...@@ -2,12 +2,15 @@ package com.mortals.xhx.module.device.web; ...@@ -2,12 +2,15 @@ package com.mortals.xhx.module.device.web;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.device.model.DeviceStatQuery; import com.mortals.xhx.module.device.model.DeviceStatQuery;
import com.mortals.xhx.module.device.service.DeviceService; import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.sitestat.model.SitestatQuery; import com.mortals.xhx.module.sitestat.model.SitestatQuery;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -45,6 +48,8 @@ public class DeviceStatController extends BaseCRUDJsonBodyMappingController<Devi ...@@ -45,6 +48,8 @@ public class DeviceStatController extends BaseCRUDJsonBodyMappingController<Devi
@Autowired @Autowired
private DeviceService deviceService; private DeviceService deviceService;
public DeviceStatController() { public DeviceStatController() {
super.setModuleDesc("设备统计"); super.setModuleDesc("设备统计");
} }
...@@ -56,17 +61,19 @@ public class DeviceStatController extends BaseCRUDJsonBodyMappingController<Devi ...@@ -56,17 +61,19 @@ public class DeviceStatController extends BaseCRUDJsonBodyMappingController<Devi
/** /**
* 站点信息 * 同步当前站点
*/ */
@PostMapping(value = "syncDeviceStat") @PostMapping(value = "syncDeviceStat")
public Rest<Object> syncDeviceStat() { public Rest<Object> syncDeviceStat(@RequestBody DeviceQuery deviceQuery) {
try { try {
//刷新成功,返回列表 if(ObjectUtils.isEmpty(deviceQuery)||ObjectUtils.isEmpty(deviceQuery.getSiteId())) throw new AppException("请求站点Id不能为空!");
deviceService.deviceStat(getContext()); //刷新成功,返回列
deviceService.deviceStat(deviceQuery.getSiteId(),getContext());
DeviceStatQuery deviceStatQuery = new DeviceStatQuery(); DeviceStatQuery deviceStatQuery = new DeviceStatQuery();
deviceStatQuery.setYear(DateUtil.year(new Date())); deviceStatQuery.setYear(DateUtil.year(new Date()));
deviceStatQuery.setMonth(DateUtil.month(new Date()) + 1); deviceStatQuery.setMonth(DateUtil.month(new Date()) + 1);
deviceStatQuery.setDay(DateUtil.dayOfMonth(new Date())); deviceStatQuery.setDay(DateUtil.dayOfMonth(new Date()));
deviceStatQuery.setSiteId(deviceQuery.getSiteId());
Rest<Object> resp = this.list(deviceStatQuery); Rest<Object> resp = this.list(deviceStatQuery);
return resp; return resp;
} catch (Exception e) { } catch (Exception e) {
......
package com.mortals.xhx.module.product.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.product.model.ProductVersionEntity;
import java.util.List;
/**
* 产品客户端版本Dao
* 产品客户端版本 DAO接口
*
* @author zxfei
* @date 2022-08-22
*/
public interface ProductVersionDao extends ICRUDDao<ProductVersionEntity,Long>{
}
package com.mortals.xhx.module.product.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.product.dao.ProductVersionDao;
import com.mortals.xhx.module.product.model.ProductVersionEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 产品客户端版本DaoImpl DAO接口
*
* @author zxfei
* @date 2022-08-22
*/
@Repository("productVersionDao")
public class ProductVersionDaoImpl extends BaseCRUDDaoMybatis<ProductVersionEntity,Long> implements ProductVersionDao {
}
package com.mortals.xhx.module.product.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.product.model.vo.ProductVersionVo;
/**
* 产品客户端版本实体对象
*
* @author zxfei
* @date 2022-08-22
*/
public class ProductVersionEntity extends ProductVersionVo {
private static final long serialVersionUID = 1L;
/**
* 产品Id
*/
private Long productId;
/**
* 产品编码
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* 文件相对路径地址
*/
@Excel(name = "文件相对路径地址")
private String filePath;
/**
* 版本号
*/
@Excel(name = "版本号")
private Integer version;
/**
* 备注信息
*/
@Excel(name = "备注信息")
private String remark;
public ProductVersionEntity(){}
/**
* 获取 产品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;
}
/**
* 获取 文件相对路径地址
* @return String
*/
public String getFilePath(){
return filePath;
}
/**
* 设置 文件相对路径地址
* @param filePath
*/
public void setFilePath(String filePath){
this.filePath = filePath;
}
/**
* 获取 版本号
* @return Integer
*/
public Integer getVersion(){
return version;
}
/**
* 设置 版本号
* @param version
*/
public void setVersion(Integer version){
this.version = version;
}
/**
* 获取 备注信息
* @return String
*/
public String getRemark(){
return remark;
}
/**
* 设置 备注信息
* @param remark
*/
public void setRemark(String remark){
this.remark = remark;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof ProductVersionEntity) {
ProductVersionEntity tmp = (ProductVersionEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",productId:").append(getProductId());
sb.append(",productCode:").append(getProductCode());
sb.append(",productName:").append(getProductName());
sb.append(",filePath:").append(getFilePath());
sb.append(",version:").append(getVersion());
sb.append(",remark:").append(getRemark());
return sb.toString();
}
public void initAttrValue(){
this.productId = null;
this.productCode = "";
this.productName = "";
this.filePath = "";
this.version = null;
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.product.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.product.model.ProductVersionEntity;
import java.util.ArrayList;
import java.util.List;
/**
* 产品客户端版本视图对象
*
* @author zxfei
* @date 2022-08-22
*/
public class ProductVersionVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.product.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.product.model.ProductVersionEntity;
/**
* ProductVersionService
*
* 产品客户端版本 service接口
*
* @author zxfei
* @date 2022-08-22
*/
public interface ProductVersionService extends ICRUDService<ProductVersionEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.product.service.impl;
import com.mortals.xhx.module.product.model.ProductVersionQuery;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.product.dao.ProductVersionDao;
import com.mortals.xhx.module.product.model.ProductVersionEntity;
import com.mortals.xhx.module.product.service.ProductVersionService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
/**
* ProductVersionService
* 产品客户端版本 service实现
*
* @author zxfei
* @date 2022-08-22
*/
@Service("productVersionService")
public class ProductVersionServiceImpl extends AbstractCRUDServiceImpl<ProductVersionDao, ProductVersionEntity, Long> implements ProductVersionService {
@Override
protected void saveBefore(ProductVersionEntity entity, Context context) throws AppException {
super.saveBefore(entity, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.product.web; package com.mortals.xhx.module.product.web;
import cn.hutool.core.util.IdUtil;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
...@@ -45,7 +46,7 @@ public class ProductController extends BaseCRUDJsonBodyMappingController<Product ...@@ -45,7 +46,7 @@ public class ProductController extends BaseCRUDJsonBodyMappingController<Product
//获取所有产品皮肤 分组显示 //获取所有产品皮肤 分组显示
Rest<RespData<List<SkinBasePdu>>> resp = skinBaseFeign.list(new SkinBasePdu()); Rest<RespData<List<SkinBasePdu>>> resp = skinBaseFeign.list(new SkinBasePdu());
if (resp.getCode() == YesNoEnum.YES.getValue()) { if (resp.getCode() == YesNoEnum.YES.getValue()) {
Map<String, Map<String, String>> skinProductCodeMap = resp.getData().getData().stream().collect(Collectors.groupingBy(x -> x.getProductCode(), Collectors.toMap(a -> a.getImageResolution()==null?"":a.getImageResolution(), b -> b.getImageResolutionValue(),(o,n)->n))); Map<String, Map<String, String>> skinProductCodeMap = resp.getData().getData().stream().collect(Collectors.groupingBy(x -> x.getProductCode(), Collectors.toMap(a -> a.getImageResolution()==null?"":a.getImageResolution(), b -> b.getImageResolutionValue()==null?"":b.getImageResolutionValue(),(o,n)->n)));
this.addDict(model, "skinProductCodeMap", skinProductCodeMap); this.addDict(model, "skinProductCodeMap", skinProductCodeMap);
} }
...@@ -55,4 +56,11 @@ public class ProductController extends BaseCRUDJsonBodyMappingController<Product ...@@ -55,4 +56,11 @@ public class ProductController extends BaseCRUDJsonBodyMappingController<Product
} }
public static void main(String[] args) {
System.out.println(IdUtil.objectId());
System.out.println(IdUtil.fastSimpleUUID());
}
} }
\ No newline at end of file
package com.mortals.xhx.module.product.web;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.product.model.ProductVersionQuery;
import com.mortals.xhx.module.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.product.model.ProductVersionEntity;
import com.mortals.xhx.module.product.service.ProductVersionService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 产品客户端版本
*
* @author zxfei
* @date 2022-08-22
*/
@RestController
@RequestMapping("product/version")
public class ProductVersionController extends BaseCRUDJsonBodyMappingController<ProductVersionService,ProductVersionEntity,Long> {
@Autowired
private ProductService productService;
public ProductVersionController(){
super.setModuleDesc( "产品客户端版本");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "productId", productService.find(new ProductEntity()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getProductName())));
super.init(model, context);
}
@Override
protected void saveBefore(ProductVersionEntity entity, Map<String, Object> model, Context context) throws AppException {
ProductVersionEntity productVersionEntity = this.service.selectOne(new ProductVersionQuery().productId(entity.getProductId()).version(entity.getVersion()));
if(!ObjectUtils.isEmpty(productVersionEntity)){
entity.setId(productVersionEntity.getId());
entity.setUpdateUserId(super.getContextUserId(context));
entity.setUpdateTime(new Date());
}
super.saveBefore(entity, model, context);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.device.dao.ibatis.DeviceAlarmInfoDaoImpl"> <mapper namespace="com.mortals.xhx.module.device.dao.ibatis.DeviceAlarmInfoDaoImpl">
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<id property="id" column="id" /> <id property="id" column="id" />
<result property="alarmTime" column="alarmTime" /> <result property="alarmTime" column="alarmTime" />
<result property="alarmDevice" column="alarmDevice" /> <result property="alarmDevice" column="alarmDevice" />
<result property="siteId" column="siteId" />
<result property="alarmType" column="alarmType" /> <result property="alarmType" column="alarmType" />
<result property="alarmLevel" column="alarmLevel" /> <result property="alarmLevel" column="alarmLevel" />
<result property="alarmReceivePersonnel" column="alarmReceivePersonnel" /> <result property="alarmReceivePersonnel" column="alarmReceivePersonnel" />
...@@ -33,6 +34,9 @@ ...@@ -33,6 +34,9 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('alarmDevice') or colPickMode == 1 and data.containsKey('alarmDevice')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('alarmDevice') or colPickMode == 1 and data.containsKey('alarmDevice')))">
a.alarmDevice, a.alarmDevice,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteId') or colPickMode == 1 and data.containsKey('siteId')))">
a.siteId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('alarmType') or colPickMode == 1 and data.containsKey('alarmType')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('alarmType') or colPickMode == 1 and data.containsKey('alarmType')))">
a.alarmType, a.alarmType,
</if> </if>
...@@ -65,18 +69,18 @@ ...@@ -65,18 +69,18 @@
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DeviceAlarmInfoEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="DeviceAlarmInfoEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_device_alarm_info insert into mortals_xhx_device_alarm_info
(alarmTime,alarmDevice,alarmType,alarmLevel,alarmReceivePersonnel,receivePersonnelTelephone,alarmStatus,alarmContent,createTime,updateUserId,updateTime) (alarmTime,alarmDevice,siteId,alarmType,alarmLevel,alarmReceivePersonnel,receivePersonnelTelephone,alarmStatus,alarmContent,createTime,updateUserId,updateTime)
VALUES VALUES
(#{alarmTime},#{alarmDevice},#{alarmType},#{alarmLevel},#{alarmReceivePersonnel},#{receivePersonnelTelephone},#{alarmStatus},#{alarmContent},#{createTime},#{updateUserId},#{updateTime}) (#{alarmTime},#{alarmDevice},#{siteId},#{alarmType},#{alarmLevel},#{alarmReceivePersonnel},#{receivePersonnelTelephone},#{alarmStatus},#{alarmContent},#{createTime},#{updateUserId},#{updateTime})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_device_alarm_info insert into mortals_xhx_device_alarm_info
(alarmTime,alarmDevice,alarmType,alarmLevel,alarmReceivePersonnel,receivePersonnelTelephone,alarmStatus,alarmContent,createTime,updateUserId,updateTime) (alarmTime,alarmDevice,siteId,alarmType,alarmLevel,alarmReceivePersonnel,receivePersonnelTelephone,alarmStatus,alarmContent,createTime,updateUserId,updateTime)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.alarmTime},#{item.alarmDevice},#{item.alarmType},#{item.alarmLevel},#{item.alarmReceivePersonnel},#{item.receivePersonnelTelephone},#{item.alarmStatus},#{item.alarmContent},#{item.createTime},#{item.updateUserId},#{item.updateTime}) (#{item.alarmTime},#{item.alarmDevice},#{item.siteId},#{item.alarmType},#{item.alarmLevel},#{item.alarmReceivePersonnel},#{item.receivePersonnelTelephone},#{item.alarmStatus},#{item.alarmContent},#{item.createTime},#{item.updateUserId},#{item.updateTime})
</foreach> </foreach>
</insert> </insert>
...@@ -95,6 +99,12 @@ ...@@ -95,6 +99,12 @@
<if test="(colPickMode==0 and data.containsKey('alarmDeviceIncrement')) or (colPickMode==1 and !data.containsKey('alarmDeviceIncrement'))"> <if test="(colPickMode==0 and data.containsKey('alarmDeviceIncrement')) or (colPickMode==1 and !data.containsKey('alarmDeviceIncrement'))">
a.alarmDevice=ifnull(a.alarmDevice,0) + #{data.alarmDeviceIncrement}, a.alarmDevice=ifnull(a.alarmDevice,0) + #{data.alarmDeviceIncrement},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('siteId')) or (colPickMode==1 and !data.containsKey('siteId'))">
a.siteId=#{data.siteId},
</if>
<if test="(colPickMode==0 and data.containsKey('siteIdIncrement')) or (colPickMode==1 and !data.containsKey('siteIdIncrement'))">
a.siteId=ifnull(a.siteId,0) + #{data.siteIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('alarmType')) or (colPickMode==1 and !data.containsKey('alarmType'))"> <if test="(colPickMode==0 and data.containsKey('alarmType')) or (colPickMode==1 and !data.containsKey('alarmType'))">
a.alarmType=#{data.alarmType}, a.alarmType=#{data.alarmType},
</if> </if>
...@@ -165,6 +175,18 @@ ...@@ -165,6 +175,18 @@
</choose> </choose>
</foreach> </foreach>
</trim> </trim>
<trim prefix="siteId=(case" suffix="ELSE siteId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('siteId')) or (colPickMode==1 and !item.containsKey('siteId'))">
when a.id=#{item.id} then #{item.siteId}
</when>
<when test="(colPickMode==0 and item.containsKey('siteIdIncrement')) or (colPickMode==1 and !item.containsKey('siteIdIncrement'))">
when a.id=#{item.id} then ifnull(a.siteId,0) + #{item.siteIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="alarmType=(case" suffix="ELSE alarmType end),"> <trim prefix="alarmType=(case" suffix="ELSE alarmType end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <choose>
...@@ -406,6 +428,27 @@ ...@@ -406,6 +428,27 @@
${_conditionType_} a.alarmDevice <![CDATA[ <= ]]> #{${_conditionParam_}.alarmDeviceEnd} ${_conditionType_} a.alarmDevice <![CDATA[ <= ]]> #{${_conditionParam_}.alarmDeviceEnd}
</if> </if>
<if test="conditionParamRef.containsKey('siteId')">
<if test="conditionParamRef.siteId != null ">
${_conditionType_} a.siteId = #{${_conditionParam_}.siteId}
</if>
<if test="conditionParamRef.siteId == null">
${_conditionType_} a.siteId is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteIdList')">
${_conditionType_} a.siteId in
<foreach collection="conditionParamRef.siteIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIdStart') and conditionParamRef.siteIdStart != null">
${_conditionType_} a.siteId <![CDATA[ >= ]]> #{${_conditionParam_}.siteIdStart}
</if>
<if test="conditionParamRef.containsKey('siteIdEnd') and conditionParamRef.siteIdEnd != null">
${_conditionType_} a.siteId <![CDATA[ <= ]]> #{${_conditionParam_}.siteIdEnd}
</if>
<if test="conditionParamRef.containsKey('alarmType')"> <if test="conditionParamRef.containsKey('alarmType')">
<if test="conditionParamRef.alarmType != null "> <if test="conditionParamRef.alarmType != null ">
${_conditionType_} a.alarmType = #{${_conditionParam_}.alarmType} ${_conditionType_} a.alarmType = #{${_conditionParam_}.alarmType}
...@@ -593,6 +636,11 @@ ...@@ -593,6 +636,11 @@
<if test='orderCol.alarmDevice != null and "DESC".equalsIgnoreCase(orderCol.alarmDevice)'>DESC</if> <if test='orderCol.alarmDevice != null and "DESC".equalsIgnoreCase(orderCol.alarmDevice)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('siteId')">
a.siteId
<if test='orderCol.siteId != null and "DESC".equalsIgnoreCase(orderCol.siteId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('alarmType')"> <if test="orderCol.containsKey('alarmType')">
a.alarmType a.alarmType
<if test='orderCol.alarmType != null and "DESC".equalsIgnoreCase(orderCol.alarmType)'>DESC</if> <if test='orderCol.alarmType != null and "DESC".equalsIgnoreCase(orderCol.alarmType)'>DESC</if>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<resultMap type="DeviceLogEntity" id="DeviceLogEntity-Map"> <resultMap type="DeviceLogEntity" id="DeviceLogEntity-Map">
<id property="id" column="id" /> <id property="id" column="id" />
<result property="traceID" column="traceID" /> <result property="traceID" column="traceID" />
<result property="siteId" column="siteId" />
<result property="deviceId" column="deviceId" /> <result property="deviceId" column="deviceId" />
<result property="deviceCode" column="deviceCode" /> <result property="deviceCode" column="deviceCode" />
<result property="deviceName" column="deviceName" /> <result property="deviceName" column="deviceName" />
...@@ -30,6 +31,9 @@ ...@@ -30,6 +31,9 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('traceID') or colPickMode == 1 and data.containsKey('traceID')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('traceID') or colPickMode == 1 and data.containsKey('traceID')))">
a.traceID, a.traceID,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteId') or colPickMode == 1 and data.containsKey('siteId')))">
a.siteId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceId') or colPickMode == 1 and data.containsKey('deviceId')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceId') or colPickMode == 1 and data.containsKey('deviceId')))">
a.deviceId, a.deviceId,
</if> </if>
...@@ -65,18 +69,18 @@ ...@@ -65,18 +69,18 @@
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DeviceLogEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="DeviceLogEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_device_log insert into mortals_xhx_device_log
(traceID,deviceId,deviceCode,deviceName,messageHead,logType,content,createUserId,createTime,updateUserId,updateTime) (traceID,siteId,deviceId,deviceCode,deviceName,messageHead,logType,content,createUserId,createTime,updateUserId,updateTime)
VALUES VALUES
(#{traceID},#{deviceId},#{deviceCode},#{deviceName},#{messageHead},#{logType},#{content},#{createUserId},#{createTime},#{updateUserId},#{updateTime}) (#{traceID},#{siteId},#{deviceId},#{deviceCode},#{deviceName},#{messageHead},#{logType},#{content},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_device_log insert into mortals_xhx_device_log
(traceID,deviceId,deviceCode,deviceName,messageHead,logType,content,createUserId,createTime,updateUserId,updateTime) (traceID,siteId,deviceId,deviceCode,deviceName,messageHead,logType,content,createUserId,createTime,updateUserId,updateTime)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.traceID},#{item.deviceId},#{item.deviceCode},#{item.deviceName},#{item.messageHead},#{item.logType},#{item.content},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime}) (#{item.traceID},#{item.siteId},#{item.deviceId},#{item.deviceCode},#{item.deviceName},#{item.messageHead},#{item.logType},#{item.content},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
</foreach> </foreach>
</insert> </insert>
...@@ -89,6 +93,12 @@ ...@@ -89,6 +93,12 @@
<if test="(colPickMode==0 and data.containsKey('traceID')) or (colPickMode==1 and !data.containsKey('traceID'))"> <if test="(colPickMode==0 and data.containsKey('traceID')) or (colPickMode==1 and !data.containsKey('traceID'))">
a.traceID=#{data.traceID}, a.traceID=#{data.traceID},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('siteId')) or (colPickMode==1 and !data.containsKey('siteId'))">
a.siteId=#{data.siteId},
</if>
<if test="(colPickMode==0 and data.containsKey('siteIdIncrement')) or (colPickMode==1 and !data.containsKey('siteIdIncrement'))">
a.siteId=ifnull(a.siteId,0) + #{data.siteIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceId')) or (colPickMode==1 and !data.containsKey('deviceId'))"> <if test="(colPickMode==0 and data.containsKey('deviceId')) or (colPickMode==1 and !data.containsKey('deviceId'))">
a.deviceId=#{data.deviceId}, a.deviceId=#{data.deviceId},
</if> </if>
...@@ -150,6 +160,18 @@ ...@@ -150,6 +160,18 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="siteId=(case" suffix="ELSE siteId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('siteId')) or (colPickMode==1 and !item.containsKey('siteId'))">
when a.id=#{item.id} then #{item.siteId}
</when>
<when test="(colPickMode==0 and item.containsKey('siteIdIncrement')) or (colPickMode==1 and !item.containsKey('siteIdIncrement'))">
when a.id=#{item.id} then ifnull(a.siteId,0) + #{item.siteIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deviceId=(case" suffix="ELSE deviceId end),"> <trim prefix="deviceId=(case" suffix="ELSE deviceId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <choose>
...@@ -377,6 +399,27 @@ ...@@ -377,6 +399,27 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('siteId')">
<if test="conditionParamRef.siteId != null ">
${_conditionType_} a.siteId = #{${_conditionParam_}.siteId}
</if>
<if test="conditionParamRef.siteId == null">
${_conditionType_} a.siteId is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteIdList')">
${_conditionType_} a.siteId in
<foreach collection="conditionParamRef.siteIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIdStart') and conditionParamRef.siteIdStart != null">
${_conditionType_} a.siteId <![CDATA[ >= ]]> #{${_conditionParam_}.siteIdStart}
</if>
<if test="conditionParamRef.containsKey('siteIdEnd') and conditionParamRef.siteIdEnd != null">
${_conditionType_} a.siteId <![CDATA[ <= ]]> #{${_conditionParam_}.siteIdEnd}
</if>
<if test="conditionParamRef.containsKey('deviceId')"> <if test="conditionParamRef.containsKey('deviceId')">
<if test="conditionParamRef.deviceId != null "> <if test="conditionParamRef.deviceId != null ">
${_conditionType_} a.deviceId = #{${_conditionParam_}.deviceId} ${_conditionType_} a.deviceId = #{${_conditionParam_}.deviceId}
...@@ -574,6 +617,11 @@ ...@@ -574,6 +617,11 @@
<if test='orderCol.traceID != null and "DESC".equalsIgnoreCase(orderCol.traceID)'>DESC</if> <if test='orderCol.traceID != null and "DESC".equalsIgnoreCase(orderCol.traceID)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('siteId')">
a.siteId
<if test='orderCol.siteId != null and "DESC".equalsIgnoreCase(orderCol.siteId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceId')"> <if test="orderCol.containsKey('deviceId')">
a.deviceId a.deviceId
<if test='orderCol.deviceId != null and "DESC".equalsIgnoreCase(orderCol.deviceId)'>DESC</if> <if test='orderCol.deviceId != null and "DESC".equalsIgnoreCase(orderCol.deviceId)'>DESC</if>
......
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