Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
517e7875
Commit
517e7875
authored
Jul 04, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物联网1.0
parent
84e02b55
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
1136 additions
and
887 deletions
+1136
-887
db/module.sql
db/module.sql
+3
-0
device-manager-ui/admin/src/assets/mixins/formdialog.js
device-manager-ui/admin/src/assets/mixins/formdialog.js
+8
-0
device-manager-ui/admin/src/assets/mixins/table.js
device-manager-ui/admin/src/assets/mixins/table.js
+14
-4
device-manager-ui/admin/src/components/Table.vue
device-manager-ui/admin/src/components/Table.vue
+2
-1
device-manager-ui/admin/src/views/alarm/config/list.vue
device-manager-ui/admin/src/views/alarm/config/list.vue
+8
-4
device-manager-ui/admin/src/views/device/alarm/info/list.vue
device-manager-ui/admin/src/views/device/alarm/info/list.vue
+6
-6
device-manager-ui/admin/src/views/device/drawerview.vue
device-manager-ui/admin/src/views/device/drawerview.vue
+1
-1
device-manager-ui/admin/src/views/device/list.vue
device-manager-ui/admin/src/views/device/list.vue
+26
-23
device-manager-ui/admin/src/views/device/module/use/list.vue
device-manager-ui/admin/src/views/device/module/use/list.vue
+82
-51
device-manager-ui/admin/src/views/device/view.vue
device-manager-ui/admin/src/views/device/view.vue
+3
-1
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
...n/java/com/mortals/xhx/busiz/web/DeviceApiController.java
+1
-0
device-manager/src/main/java/com/mortals/xhx/module/alarm/model/AlarmConfigEntity.java
...com/mortals/xhx/module/alarm/model/AlarmConfigEntity.java
+73
-52
device-manager/src/main/java/com/mortals/xhx/module/alarm/model/AlarmConfigQuery.java
.../com/mortals/xhx/module/alarm/model/AlarmConfigQuery.java
+443
-406
device-manager/src/main/java/com/mortals/xhx/module/alarm/web/AlarmConfigController.java
...m/mortals/xhx/module/alarm/web/AlarmConfigController.java
+9
-0
device-manager/src/main/java/com/mortals/xhx/module/device/model/vo/DeviceModuleUseVo.java
...mortals/xhx/module/device/model/vo/DeviceModuleUseVo.java
+7
-0
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceModuleServiceImpl.java
...x/module/device/service/impl/DeviceModuleServiceImpl.java
+25
-7
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceModuleUseServiceImpl.java
...odule/device/service/impl/DeviceModuleUseServiceImpl.java
+43
-7
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+2
-2
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
...a/com/mortals/xhx/module/device/web/DeviceController.java
+19
-0
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceModuleUseController.java
...tals/xhx/module/device/web/DeviceModuleUseController.java
+5
-0
device-manager/src/main/resources/sqlmap/module/alarm/AlarmConfigMapper.xml
.../main/resources/sqlmap/module/alarm/AlarmConfigMapper.xml
+356
-322
doc/设备管理系统.docx
doc/设备管理系统.docx
+0
-0
No files found.
db/module.sql
View file @
517e7875
...
...
@@ -166,12 +166,15 @@ CREATE TABLE mortals_xhx_alarm_config(
`alarmLevel`
tinyint
(
2
)
NOT
NULL
COMMENT
'告警级别,(0.危险,1.次要,2.一般)'
,
`alarmPusW1ay`
tinyint
(
2
)
NOT
NULL
COMMENT
'推送方式,(0.不推送,1.短信)'
,
`isUse`
tinyint
(
2
)
NOT
NULL
COMMENT
'是否启用(0.不启动,1.启动)'
,
`remark`
varchar
(
2048
)
COMMENT
'备注'
,
`createTime`
datetime
NOT
NULL
COMMENT
'创建时间'
,
`updateUserId`
bigint
(
20
)
COMMENT
'更新用户'
,
`updateTime`
datetime
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COMMENT
=
'设备告警配置'
;
-- ----------------------------
-- 短信发送记录表
-- ----------------------------
...
...
device-manager-ui/admin/src/assets/mixins/formdialog.js
View file @
517e7875
...
...
@@ -23,6 +23,14 @@ export default {
this
.
$router
.
go
(
-
1
);
},
// 开启、关闭
changePath
(
path
)
{
this
.
pageInfo
.
list
=
path
+
"
/list
"
;
this
.
pageInfo
.
del
=
path
+
"
/delete
"
;
this
.
pageInfo
.
add
=
path
+
"
/add
"
;
this
.
pageInfo
.
edit
=
path
+
"
/edit
"
;
this
.
pageInfo
.
view
=
path
+
"
/view
"
;
},
// 默认拉取数据
getData
()
{
...
...
device-manager-ui/admin/src/assets/mixins/table.js
View file @
517e7875
...
...
@@ -14,8 +14,7 @@ export default {
},
watch
:
{
'
$route
'
(
route
)
{
// this.query = Object.assign({}, this.query, route.query);
// this.query = Object.assign({}, this.query, route.query);
this
.
getData
();
}
},
...
...
@@ -24,6 +23,17 @@ export default {
clearTimeout
(
this
.
loadingTimer
);
},
methods
:
{
test
(){
console
.
log
(
"
test
"
)
},
// 开启、关闭
changePath
(
path
)
{
this
.
pageInfo
.
list
=
path
+
"
/list
"
;
this
.
pageInfo
.
del
=
path
+
"
/delete
"
;
this
.
pageInfo
.
add
=
path
+
"
/add
"
;
this
.
pageInfo
.
edit
=
path
+
"
/edit
"
;
this
.
pageInfo
.
view
=
path
+
"
/view
"
;
},
beforeFecth
()
{
return
Promise
.
resolve
();
},
...
...
@@ -242,7 +252,7 @@ export default {
return
this
.
$message
.
warning
(
'
请选中一条记录
'
);
}
this
.
$get
(
this
.
pageInfo
.
del
,
{
id
:
id
})
this
.
$get
(
this
.
pageInfo
.
del
,
{
id
:
id
})
.
then
(
res
=>
{
this
.
$message
.
success
(
res
.
msg
)
// 更新数据
...
...
@@ -299,13 +309,13 @@ export default {
open
()
{
},
},
computed
:
{
tableConfig
()
{
return
Object
.
assign
({},
this
.
defaultConfig
,
this
.
config
)
},
pageInfo
()
{
console
.
log
(
3333333
+
this
.
$route
.
path
)
const
urls
=
{
// 操作所需的url地址,和url同路径
list
:
this
.
$route
.
path
,
edit
:
this
.
$route
.
path
.
replace
(
'
/list
'
,
'
/edit
'
),
...
...
device-manager-ui/admin/src/components/Table.vue
View file @
517e7875
...
...
@@ -111,6 +111,7 @@
<slot
name=
"table-search-left"
></slot>
<SearchForm
:search=
"config.search"
v-if=
"isShowButton('notSearch')"
:table=
"data"
:downloadUrl=
"config.downloadUrl"
:areaSelect=
"config.areaSelect"
...
...
@@ -190,7 +191,7 @@
class=
"table-foot"
v-if=
"!isShowButton('notPagination') ? false : data.pageInfo.totalResult"
>
<Pagination
<Pagination
style=
"float:left"
:total=
"data.pageInfo.totalResult"
:prePageResult=
"data.pageInfo.prePageResult"
/>
...
...
device-manager-ui/admin/src/views/alarm/config/list.vue
View file @
517e7875
...
...
@@ -3,17 +3,19 @@
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
<!--
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
-->
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
dialogShow
from
"
./dialog
show
"
;
import
drawerShow
from
"
./drawer
show
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
AlarmConfig
"
,
components
:
{
d
ialog
Show
},
components
:
{
d
rawer
Show
},
mixins
:
[
table
],
created
()
{
},
...
...
@@ -21,7 +23,9 @@
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
dialogform
.
add
(
row
);
//this.$refs.dialogform.add(row);
this
.
$refs
.
drawerform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
...
...
device-manager-ui/admin/src/views/device/alarm/info/list.vue
View file @
517e7875
...
...
@@ -32,13 +32,13 @@ export default {
console
.
log
(
"
pageInfo--before
"
,
this
.
pageInfo
)
//
this.changePath("/device/alarm/info")
this
.
changePath
(
"
/device/alarm/info
"
)
this
.
pageInfo
.
list
=
"
/device/alarm/info/list
"
;
this
.
pageInfo
.
del
=
"
/device/alarm/info/delete
"
;
this
.
pageInfo
.
add
=
"
/device/alarm/info/add
"
;
this
.
pageInfo
.
edit
=
"
/device/alarm/info/edit
"
;
this
.
pageInfo
.
view
=
"
/device/alarm/info/view
"
;
//
this.pageInfo.list = "/device/alarm/info/list";
//
this.pageInfo.del = "/device/alarm/info/delete";
//
this.pageInfo.add = "/device/alarm/info/add";
//
this.pageInfo.edit = "/device/alarm/info/edit";
//
this.pageInfo.view = "/device/alarm/info/view";
console
.
log
(
"
pageInfo
"
,
this
.
pageInfo
)
...
...
device-manager-ui/admin/src/views/device/drawerview.vue
View file @
517e7875
...
...
@@ -34,7 +34,7 @@
import
form
from
"
@/assets/mixins/formdialog
"
;
import
viewShow
from
"
./view
"
;
import
alarmList
from
"
./alarm/info/list
"
;
import
moduleList
from
"
./module/list
"
;
import
moduleList
from
"
./module/
use/
list
"
;
import
ImageUpload
from
"
@/components/ImageUpload
"
;
export
default
{
mixins
:
[
form
],
...
...
device-manager-ui/admin/src/views/device/list.vue
View file @
517e7875
...
...
@@ -31,23 +31,26 @@
:disabled=
"isExport"
>
导出
</el-button
>
<el-tag
slot=
"table-
body-head"
style=
"margin: 5px"
type=
"success"
>
当前在线设备总计:
{{
tableData
.
onlineCount
}}
个
</el-tag
<el-tag
slot=
"table-
head-left2"
size=
"mini"
style=
"margin-left: 20px"
>
设备总数:
{{
tableData
.
totalCount
}}
台
</el-tag
>
<el-tag
slot=
"table-
body-head"
style=
"margin: 5px"
type=
"danger
"
>
当前离线设备总计:
{{
tableData
.
offlineCount
}}
个
</el-tag
<el-tag
slot=
"table-
head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"success
"
>
在线:
{{
tableData
.
onlineCount
}}
台
</el-tag
>
<el-tag
v-for=
"($label, $value) in tableData.offlineDeviceType"
:key=
"$value"
:label=
"$value"
slot=
"table-body-head"
style=
"margin: 5px"
type=
"danger"
>
{{
$value
}}
离线设备:
{{
$label
}}
个
</el-tag
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"danger"
>
离线:
{{
tableData
.
offlineCount
}}
台
</el-tag
>
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"danger"
>
停用:
{{
tableData
.
stopCount
}}
台
</el-tag
>
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"danger"
>
未激活:
{{
tableData
.
unActiveCount
}}
台
</el-tag
>
</LayoutTable>
<!-- 设备导入对话框 -->
...
...
@@ -268,29 +271,29 @@ export default {
config
:
{
getsocketData
:
null
,
search
:
[
{
name
:
"
deviceNum
"
,
type
:
"
text
"
,
label
:
"
设备编号
"
,
},
//
{
//
name: "deviceNum",
//
type: "text",
//
label: "设备编号",
//
},
{
name
:
"
deviceStatus
"
,
type
:
"
select
"
,
label
:
"
状态
"
,
},
{
name
:
"
porductId
"
,
type
:
"
select
"
,
label
:
"
产品类型
"
,
},
//
{
//
name: "porductId",
//
type: "select",
//
label: "产品类型",
//
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
label
:
"
设备名称
"
,
prop
:
"
deviceName
"
},
{
label
:
"
设备类型
"
,
prop
:
"
p
or
ductId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
设备类型
"
,
prop
:
"
p
ro
ductId
"
,
formatter
:
this
.
formatter
},
{
label
:
"
设备编码
"
,
prop
:
"
deviceCode
"
},
...
...
device-manager-ui/admin/src/views/device/module/use/list.vue
View file @
517e7875
<
template
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
notAdd
notDel
notSearch
:config=
"tableConfig"
>
</LayoutTable>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
</div>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
dialogShow
from
"
./dialogshow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
DeviceModuleUse
"
,
components
:
{
dialogShow
},
mixins
:
[
table
],
created
()
{
},
methods
:
{
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
dialogform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
dialogform
.
edit
(
row
);
},
/** 重写查看方法 */
// toView(row) {
// this.$refs.dialogform.view(row);
// },
},
data
()
{
return
{
config
:
{
search
:
[
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
row
=>
{
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
}
}
]
}
};
}
/** 表单弹出框模式需引入 */
import
dialogShow
from
"
./dialogshow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
DeviceModuleUse
"
,
props
:
{
queryIn
:
{
type
:
Object
,
default
:
null
,
},
},
components
:
{
dialogShow
},
mixins
:
[
table
],
created
()
{
console
.
log
(
"
queryIn:
"
,
this
.
queryIn
);
//this.config.addQuery = { deviceId, deviceType };
if
(
this
.
queryIn
.
deviceId
)
{
this
.
query
=
{};
this
.
query
[
"
deviceId
"
]
=
this
.
queryIn
.
deviceId
;
}
console
.
log
(
"
pageInfo--before
"
,
this
.
pageInfo
);
// this.changePath("/device/alarm/info")
this
.
pageInfo
.
list
=
"
/device/module/use/list
"
;
this
.
pageInfo
.
del
=
"
/device/module/use/delete
"
;
this
.
pageInfo
.
add
=
"
/device/module/use/add
"
;
this
.
pageInfo
.
edit
=
"
/device/module/use/edit
"
;
this
.
pageInfo
.
view
=
"
/device/module/use/view
"
;
console
.
log
(
"
pageInfo
"
,
this
.
pageInfo
);
},
methods
:
{
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
dialogform
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
dialogform
.
edit
(
row
);
},
/** 重写查看方法 */
// toView(row) {
// this.$refs.dialogform.view(row);
// },
},
data
()
{
return
{
config
:
{
search
:
[],
columns
:
[
{
label
:
"
模块名称
"
,
prop
:
"
moduleName
"
},
// { label: "模块消息编码", prop: "moduleMsgCode" },
{
label
:
"
设备名称
"
,
prop
:
"
deviceId
"
,
formatter
:
this
.
formatterString
,
},
{
label
:
"
产品名称
"
,
prop
:
"
platformAndProductName
"
},
{
label
:
"
调用次数
"
,
prop
:
"
useNum
"
},
],
},
};
},
};
</
script
>
\ No newline at end of file
device-manager-ui/admin/src/views/device/view.vue
View file @
517e7875
...
...
@@ -148,7 +148,9 @@
label-class-name=
"labelClass"
content-class-name=
"contentClass"
>
{{
form
.
devicePhotoPath
}}
<ImageUpload
v-model=
"form.devicePhotoPath"
prePath=
"/file/preview"
/>
</el-descriptions-item>
<el-descriptions-item
...
...
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
View file @
517e7875
...
...
@@ -145,6 +145,7 @@ public class DeviceApiController {
ServerInfo
serverInfo
=
new
ServerInfo
();
serverInfo
.
setHomeUrl
(
platformEntity
.
getHomeUrl
());
serverInfo
.
setServerUrl
(
platformEntity
.
getSendUrl
());
registerResp
.
setServiceInfo
(
serverInfo
);
String
content
=
EncryptUtil
.
myEnscrt
(
JSON
.
toJSONString
(
registerResp
),
9
,
DES_STR
,
ENCRYPT_STR
);
deviceResp
.
setContent
(
content
);
...
...
device-manager/src/main/java/com/mortals/xhx/module/alarm/model/AlarmConfigEntity.java
View file @
517e7875
...
...
@@ -7,116 +7,134 @@ import com.mortals.framework.annotation.Excel;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.alarm.model.vo.AlarmConfigVo
;
/**
* 设备告警配置实体对象
*
* @author zxfei
* @date 2022-07-01
*/
* 设备告警配置实体对象
*
* @author zxfei
* @date 2022-07-04
*/
public
class
AlarmConfigEntity
extends
AlarmConfigVo
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 产品
*/
* 产品
*/
private
Long
productId
;
/**
* 告警类型(0.离线)
*/
* 告警类型(0.离线)
*/
private
Integer
alarmType
;
/**
* 告警级别,(0.危险,1.次要,2.一般)
*/
* 告警级别,(0.危险,1.次要,2.一般)
*/
private
Integer
alarmLevel
;
/**
* 推送方式,(0.不推送,1.短信)
*/
* 推送方式,(0.不推送,1.短信)
*/
private
Integer
alarmPusW1ay
;
/**
* 是否启用(0.不启动,1.启动)
*/
* 是否启用(0.不启动,1.启动)
*/
private
Integer
isUse
;
/**
* 备注
*/
private
String
remark
;
public
AlarmConfigEntity
(){}
/**
* 获取 产品
* @return Long
*/
* 获取 产品
* @return Long
*/
public
Long
getProductId
(){
return
productId
;
}
/**
* 设置 产品
* @param productId
*/
* 设置 产品
* @param productId
*/
public
void
setProductId
(
Long
productId
){
this
.
productId
=
productId
;
}
/**
* 获取 告警类型(0.离线)
* @return Integer
*/
* 获取 告警类型(0.离线)
* @return Integer
*/
public
Integer
getAlarmType
(){
return
alarmType
;
}
/**
* 设置 告警类型(0.离线)
* @param alarmType
*/
* 设置 告警类型(0.离线)
* @param alarmType
*/
public
void
setAlarmType
(
Integer
alarmType
){
this
.
alarmType
=
alarmType
;
}
/**
* 获取 告警级别,(0.危险,1.次要,2.一般)
* @return Integer
*/
* 获取 告警级别,(0.危险,1.次要,2.一般)
* @return Integer
*/
public
Integer
getAlarmLevel
(){
return
alarmLevel
;
}
/**
* 设置 告警级别,(0.危险,1.次要,2.一般)
* @param alarmLevel
*/
* 设置 告警级别,(0.危险,1.次要,2.一般)
* @param alarmLevel
*/
public
void
setAlarmLevel
(
Integer
alarmLevel
){
this
.
alarmLevel
=
alarmLevel
;
}
/**
* 获取 推送方式,(0.不推送,1.短信)
* @return Integer
*/
* 获取 推送方式,(0.不推送,1.短信)
* @return Integer
*/
public
Integer
getAlarmPusW1ay
(){
return
alarmPusW1ay
;
}
/**
* 设置 推送方式,(0.不推送,1.短信)
* @param alarmPusW1ay
*/
* 设置 推送方式,(0.不推送,1.短信)
* @param alarmPusW1ay
*/
public
void
setAlarmPusW1ay
(
Integer
alarmPusW1ay
){
this
.
alarmPusW1ay
=
alarmPusW1ay
;
}
/**
* 获取 是否启用(0.不启动,1.启动)
* @return Integer
*/
* 获取 是否启用(0.不启动,1.启动)
* @return Integer
*/
public
Integer
getIsUse
(){
return
isUse
;
}
/**
* 设置 是否启用(0.不启动,1.启动)
* @param isUse
*/
* 设置 是否启用(0.不启动,1.启动)
* @param isUse
*/
public
void
setIsUse
(
Integer
isUse
){
this
.
isUse
=
isUse
;
}
/**
* 获取 备注
* @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
();
return
this
.
getId
().
hashCode
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
...
...
@@ -124,7 +142,7 @@ public class AlarmConfigEntity extends AlarmConfigVo {
if
(
obj
instanceof
AlarmConfigEntity
)
{
AlarmConfigEntity
tmp
=
(
AlarmConfigEntity
)
obj
;
if
(
this
.
getId
()
==
tmp
.
getId
())
{
return
true
;
return
true
;
}
}
return
false
;
...
...
@@ -137,19 +155,22 @@ public class AlarmConfigEntity extends AlarmConfigVo {
sb
.
append
(
",alarmLevel:"
).
append
(
getAlarmLevel
());
sb
.
append
(
",alarmPusW1ay:"
).
append
(
getAlarmPusW1ay
());
sb
.
append
(
",isUse:"
).
append
(
getIsUse
());
sb
.
append
(
",remark:"
).
append
(
getRemark
());
return
sb
.
toString
();
}
public
void
initAttrValue
(){
this
.
productId
=
null
;
this
.
productId
=
null
;
this
.
alarmType
=
0
;
this
.
alarmType
=
0
;
this
.
alarmLevel
=
null
;
this
.
alarmLevel
=
null
;
this
.
alarmPusW1ay
=
0
;
this
.
alarmPusW1ay
=
0
;
this
.
isUse
=
null
;
this
.
isUse
=
null
;
this
.
remark
=
""
;
}
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/alarm/model/AlarmConfigQuery.java
View file @
517e7875
This diff is collapsed.
Click to expand it.
device-manager/src/main/java/com/mortals/xhx/module/alarm/web/AlarmConfigController.java
View file @
517e7875
...
...
@@ -5,11 +5,15 @@ import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.alarm.model.AlarmConfigEntity
;
import
com.mortals.xhx.module.alarm.service.AlarmConfigService
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
import
com.mortals.xhx.module.product.service.ProductService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
*
* 设备告警配置
...
...
@@ -23,6 +27,8 @@ public class AlarmConfigController extends BaseCRUDJsonBodyMappingController<Ala
@Autowired
private
ParamService
paramService
;
@Autowired
private
ProductService
productService
;
public
AlarmConfigController
(){
super
.
setModuleDesc
(
"设备告警配置"
);
...
...
@@ -34,6 +40,9 @@ public class AlarmConfigController extends BaseCRUDJsonBodyMappingController<Ala
this
.
addDict
(
model
,
"alarmLevel"
,
paramService
.
getParamBySecondOrganize
(
"AlarmConfig"
,
"alarmLevel"
));
this
.
addDict
(
model
,
"alarmPusW1ay"
,
paramService
.
getParamBySecondOrganize
(
"AlarmConfig"
,
"alarmPusW1ay"
));
this
.
addDict
(
model
,
"isUse"
,
paramService
.
getParamBySecondOrganize
(
"AlarmConfig"
,
"isUse"
));
this
.
addDict
(
model
,
"productId"
,
productService
.
find
(
new
ProductEntity
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getProductName
())));
super
.
init
(
model
,
context
);
}
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/model/vo/DeviceModuleUseVo.java
View file @
517e7875
package
com.mortals.xhx.module.device.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.device.model.DeviceModuleUseEntity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -9,6 +11,11 @@ import java.util.List;
* @author zxfei
* @date 2022-07-02
*/
@Data
public
class
DeviceModuleUseVo
extends
BaseEntityLong
{
/**
* 平台与产品名称
*/
private
String
platformAndProductName
;
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceModuleServiceImpl.java
View file @
517e7875
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.framework.model.Result
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
com.mortals.xhx.module.platform.model.PlatformEntity
;
import
com.mortals.xhx.module.platform.service.PlatformService
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
import
com.mortals.xhx.module.product.service.ProductService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.module.device.dao.DeviceModuleDao
;
import
com.mortals.xhx.module.device.model.DeviceModuleEntity
;
import
com.mortals.xhx.module.device.service.DeviceModuleService
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
/**
* DeviceModuleService
* 设备模块信息 service实现
*
* @author zxfei
* @date 2022-07-02
*/
* DeviceModuleService
* 设备模块信息 service实现
*
* @author zxfei
* @date 2022-07-02
*/
@Service
(
"deviceModuleService"
)
public
class
DeviceModuleServiceImpl
extends
AbstractCRUDServiceImpl
<
DeviceModuleDao
,
DeviceModuleEntity
,
Long
>
implements
DeviceModuleService
{
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceModuleUseServiceImpl.java
View file @
517e7875
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.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
com.mortals.xhx.module.platform.model.PlatformEntity
;
import
com.mortals.xhx.module.platform.service.PlatformService
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
import
com.mortals.xhx.module.product.service.ProductService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.module.device.dao.DeviceModuleUseDao
;
import
com.mortals.xhx.module.device.model.DeviceModuleUseEntity
;
import
com.mortals.xhx.module.device.service.DeviceModuleUseService
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
/**
* DeviceModuleUseService
* 设备模块使用频率 service实现
*
* @author zxfei
* @date 2022-07-02
*/
* DeviceModuleUseService
* 设备模块使用频率 service实现
*
* @author zxfei
* @date 2022-07-02
*/
@Service
(
"deviceModuleUseService"
)
public
class
DeviceModuleUseServiceImpl
extends
AbstractCRUDServiceImpl
<
DeviceModuleUseDao
,
DeviceModuleUseEntity
,
Long
>
implements
DeviceModuleUseService
{
@Autowired
private
PlatformService
platformService
;
@Autowired
private
ProductService
productService
;
@Autowired
private
DeviceService
deviceService
;
@Override
protected
void
findAfter
(
DeviceModuleUseEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
DeviceModuleUseEntity
>
list
)
throws
AppException
{
list
.
stream
().
forEach
(
item
->
{
DeviceEntity
deviceEntity
=
deviceService
.
getExtCache
(
item
.
getDeviceId
().
toString
());
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
))
{
PlatformEntity
platformEntity
=
platformService
.
get
(
deviceEntity
.
getPlatformId
());
ProductEntity
productEntity
=
productService
.
get
(
deviceEntity
.
getProductId
());
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
item
.
setPlatformAndProductName
(
platformEntity
.
getPlatformName
()
+
"/"
+
productEntity
.
getProductName
());
}
}
});
super
.
findAfter
(
params
,
pageInfo
,
context
,
list
);
}
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
517e7875
...
...
@@ -240,8 +240,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
Arrays
.
asList
(
ids
).
stream
().
forEach
(
id
->
{
DeviceEntity
deviceEntity
=
this
.
get
(
id
,
context
);
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
))
{
TbQueueCallback
callback
=
new
TbQueueCallback
()
{
@Override
public
void
onSuccess
(
TbQueueMsgMetadata
metadata
)
{
...
...
@@ -293,4 +291,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
super
.
saveBefore
(
entity
,
context
);
}
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceController.java
View file @
517e7875
...
...
@@ -11,6 +11,8 @@ import com.mortals.xhx.base.system.message.MessageService;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.busiz.rsp.ApiResp
;
import
com.mortals.xhx.common.code.ApiRespCodeEnum
;
import
com.mortals.xhx.common.code.DeviceStatusEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.common.model.DefaultTbQueueMsgHeaders
;
import
com.mortals.xhx.common.model.MessageHeader
;
...
...
@@ -30,6 +32,7 @@ import org.springframework.util.ObjectUtils;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.IntStream
;
...
...
@@ -171,4 +174,20 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
return
jsonObject
.
toJSONString
();
}
@Override
protected
int
doListAfter
(
DeviceEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
//统计当前站点设备情况
if
(!
ObjectUtils
.
isEmpty
(
query
.
getSiteId
()))
{
List
<
DeviceEntity
>
deviceEntityList
=
this
.
service
.
find
(
query
,
context
);
if
(!
ObjectUtils
.
isEmpty
(
deviceEntityList
))
{
model
.
put
(
"totalCount"
,
deviceEntityList
.
size
());
model
.
put
(
"onlineCount"
,
deviceEntityList
.
stream
().
filter
(
f
->
f
.
getDeviceStatus
()
==
DeviceStatusEnum
.
在线
.
getValue
()).
count
());
model
.
put
(
"offlineCount"
,
deviceEntityList
.
stream
().
filter
(
f
->
f
.
getDeviceStatus
()
==
DeviceStatusEnum
.
离线
.
getValue
()).
count
());
model
.
put
(
"stopCount"
,
deviceEntityList
.
stream
().
filter
(
f
->
f
.
getDeviceStatus
()
!=
DeviceStatusEnum
.
未激活
.
getValue
()
&&
f
.
getEnabled
()
==
YesNoEnum
.
NO
.
getValue
()).
count
());
model
.
put
(
"unActiveCount"
,
deviceEntityList
.
stream
().
filter
(
f
->
f
.
getDeviceStatus
()
==
DeviceStatusEnum
.
未激活
.
getValue
()).
count
());
}
}
return
super
.
doListAfter
(
query
,
model
,
context
);
}
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceModuleUseController.java
View file @
517e7875
package
com.mortals.xhx.module.device.web
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.device.model.DeviceQuery
;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -35,6 +37,8 @@ public class DeviceModuleUseController extends BaseCRUDJsonBodyMappingController
@Autowired
private
ParamService
paramService
;
@Autowired
private
DeviceService
deviceService
;
public
DeviceModuleUseController
(){
super
.
setModuleDesc
(
"设备模块使用频率"
);
...
...
@@ -42,6 +46,7 @@ public class DeviceModuleUseController extends BaseCRUDJsonBodyMappingController
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"deviceId"
,
deviceService
.
find
(
new
DeviceQuery
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getDeviceName
())));
super
.
init
(
model
,
context
);
}
...
...
device-manager/src/main/resources/sqlmap/module/alarm/AlarmConfigMapper.xml
View file @
517e7875
This diff is collapsed.
Click to expand it.
doc/设备管理系统.docx
View file @
517e7875
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment