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
97273525
Commit
97273525
authored
Jul 04, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
告警内容修改
parent
79c919f9
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
183 additions
and
87 deletions
+183
-87
device-manager-ui/admin/src/assets/mixins/form.js
device-manager-ui/admin/src/assets/mixins/form.js
+3
-4
device-manager-ui/admin/src/assets/mixins/table.js
device-manager-ui/admin/src/assets/mixins/table.js
+1
-1
device-manager-ui/admin/src/components/Pagination.vue
device-manager-ui/admin/src/components/Pagination.vue
+4
-1
device-manager-ui/admin/src/views/alarm/config/list.vue
device-manager-ui/admin/src/views/alarm/config/list.vue
+1
-1
device-manager-ui/admin/src/views/device/alarm/info/list.vue
device-manager-ui/admin/src/views/device/alarm/info/list.vue
+51
-16
device-manager-ui/admin/src/views/device/list.vue
device-manager-ui/admin/src/views/device/list.vue
+31
-8
device-manager-ui/admin/src/views/device/module/list.vue
device-manager-ui/admin/src/views/device/module/list.vue
+4
-0
device-manager-ui/admin/src/views/product/list.vue
device-manager-ui/admin/src/views/product/list.vue
+5
-14
device-manager/src/main/java/com/mortals/xhx/base/system/oper/web/OperLogController.java
...m/mortals/xhx/base/system/oper/web/OperLogController.java
+29
-29
device-manager/src/main/java/com/mortals/xhx/module/alarm/service/impl/AlarmConfigServiceImpl.java
...xhx/module/alarm/service/impl/AlarmConfigServiceImpl.java
+14
-11
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceModuleServiceImpl.java
...x/module/device/service/impl/DeviceModuleServiceImpl.java
+20
-1
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+3
-0
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceAlarmInfoController.java
...tals/xhx/module/device/web/DeviceAlarmInfoController.java
+17
-1
No files found.
device-manager-ui/admin/src/assets/mixins/form.js
View file @
97273525
...
@@ -55,10 +55,9 @@ export default {
...
@@ -55,10 +55,9 @@ export default {
el
.
validate
((
valid
)
=>
{
el
.
validate
((
valid
)
=>
{
if
(
!
valid
)
return
;
if
(
!
valid
)
return
;
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
$post
(
this
.
urls
.
saveUrl
||
this
.
pageInfo
.
saveUrl
,
{
this
.
$post
(
this
.
urls
.
saveUrl
||
this
.
pageInfo
.
saveUrl
,
entity
:
this
.
beforeSubmit
(
this
.
form
),
this
.
beforeSubmit
(
this
.
form
)
...
this
.
extendFormData
)
})
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
$message
.
success
(
res
.
msg
);
this
.
$message
.
success
(
res
.
msg
);
this
.
afterSubmit
(
res
);
this
.
afterSubmit
(
res
);
...
...
device-manager-ui/admin/src/assets/mixins/table.js
View file @
97273525
...
@@ -14,7 +14,7 @@ export default {
...
@@ -14,7 +14,7 @@ export default {
},
},
watch
:
{
watch
:
{
'
$route
'
(
route
)
{
'
$route
'
(
route
)
{
//
this.query = Object.assign({}, this.query, route.query);
this
.
query
=
Object
.
assign
({},
this
.
query
,
route
.
query
);
this
.
getData
();
this
.
getData
();
}
}
},
},
...
...
device-manager-ui/admin/src/components/Pagination.vue
View file @
97273525
...
@@ -40,6 +40,9 @@ export default {
...
@@ -40,6 +40,9 @@ export default {
console
.
log
(
"
query
"
,
query
)
console
.
log
(
"
query
"
,
query
)
this
.
currPage
=
parseInt
(
query
[
'
page
'
])
||
1
;
this
.
currPage
=
parseInt
(
query
[
'
page
'
])
||
1
;
this
.
currSize
=
parseInt
(
query
[
'
size
'
])
||
this
.
prePageResult
;
this
.
currSize
=
parseInt
(
query
[
'
size
'
])
||
this
.
prePageResult
;
console
.
log
(
"
this.currPage
"
,
this
.
currPage
,
this
.
currSize
)
},
},
changeHash
(
key
,
val
)
{
changeHash
(
key
,
val
)
{
let
{
path
,
query
}
=
this
.
$route
;
let
{
path
,
query
}
=
this
.
$route
;
...
@@ -49,7 +52,7 @@ export default {
...
@@ -49,7 +52,7 @@ export default {
})
})
},
},
handleSizeChange
(
currSize
)
{
handleSizeChange
(
currSize
)
{
console
.
log
(
"
currsize
"
+
s
ize
)
console
.
log
(
"
currsize
"
+
currS
ize
)
this
.
changeHash
(
'
size
'
,
currSize
);
this
.
changeHash
(
'
size
'
,
currSize
);
},
},
handleCurrentChange
(
currPage
)
{
handleCurrentChange
(
currPage
)
{
...
...
device-manager-ui/admin/src/views/alarm/config/list.vue
View file @
97273525
<
template
>
<
template
>
<div
class=
"page"
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<LayoutTable
:data=
"tableData"
notSearch
:config=
"tableConfig"
>
</LayoutTable>
</LayoutTable>
<!--
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
-->
<!--
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
-->
...
...
device-manager-ui/admin/src/views/device/alarm/info/list.vue
View file @
97273525
<
template
>
<
template
>
<div
class=
"page"
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
notAdd
notDel
:config=
"tableConfig"
>
</LayoutTable>
<LayoutTable
:data=
"tableData"
notAdd
notDel
:config=
"tableConfig"
>
<el-button
slot=
"table-head-left2"
style=
"margin-left: 10px"
icon=
"el-icon-tickets"
size=
"mini"
@
click=
"doExport"
:disabled=
"isExport"
>
导出
</el-button
>
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin-left: 20px"
>
告警次数:
{{
tableData
.
totalCount
}}
次
</el-tag
>
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"danger"
>
危险:
{{
tableData
.
dangerCount
}}
次
</el-tag
>
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"warning"
>
次要:
{{
tableData
.
subCount
}}
次
</el-tag
>
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"info"
>
一般:
{{
tableData
.
normalCount
}}
次
</el-tag
>
</LayoutTable>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
</div>
</div>
...
@@ -23,25 +52,11 @@ export default {
...
@@ -23,25 +52,11 @@ export default {
created
()
{
created
()
{
console
.
log
(
"
queryIn:
"
,
this
.
queryIn
);
console
.
log
(
"
queryIn:
"
,
this
.
queryIn
);
//this.config.addQuery = { deviceId, deviceType };
if
(
this
.
queryIn
.
alarmDevice
)
{
if
(
this
.
queryIn
.
alarmDevice
)
{
this
.
query
=
{}
this
.
query
=
{}
this
.
query
[
"
alarmDevice
"
]
=
this
.
queryIn
.
alarmDevice
;
this
.
query
[
"
alarmDevice
"
]
=
this
.
queryIn
.
alarmDevice
;
}
}
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";
console
.
log
(
"
pageInfo
"
,
this
.
pageInfo
)
},
},
methods
:
{
methods
:
{
/** 重写新增方法 */
/** 重写新增方法 */
...
@@ -56,6 +71,19 @@ export default {
...
@@ -56,6 +71,19 @@ export default {
// toView(row) {
// toView(row) {
// this.$refs.dialogform.view(row);
// this.$refs.dialogform.view(row);
// },
// },
/** 导出Excel */
doExport
()
{
this
.
isExport
=
true
;
this
.
$download
(
"
/device/alarm/info/exportExcel
"
,
{
"
idList
"
:
this
.
selection
,
'
alarmDevice
'
:
this
.
$route
.
query
[
'
alarmDevice
'
],
'
alarmType
'
:
this
.
$route
.
query
[
'
alarmType
'
],
'
alarmStatus
'
:
this
.
$route
.
query
[
'
alarmStatus
'
],
},
{
type
:
"
excel
"
}).
then
(()
=>
this
.
isExport
=
false
).
catch
(
error
=>
{
this
.
isExport
=
false
;
this
.
$message
.
error
(
error
.
message
);
});
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -84,6 +112,13 @@ export default {
...
@@ -84,6 +112,13 @@ export default {
],
],
columns
:
[
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
{
label
:
"
告警时间
"
,
label
:
"
告警时间
"
,
...
@@ -94,7 +129,7 @@ export default {
...
@@ -94,7 +129,7 @@ export default {
{
{
label
:
"
告警设备
"
,
label
:
"
告警设备
"
,
prop
:
"
alarmDevice
"
,
prop
:
"
alarmDevice
"
,
formatter
:
this
.
formatter
String
,
formatter
:
this
.
formatter
,
},
},
{
{
label
:
"
告警内容
"
,
label
:
"
告警内容
"
,
...
...
device-manager-ui/admin/src/views/device/list.vue
View file @
97273525
...
@@ -35,22 +35,37 @@
...
@@ -35,22 +35,37 @@
>
设备总数:
{{
tableData
.
totalCount
}}
台
</el-tag
>
设备总数:
{{
tableData
.
totalCount
}}
台
</el-tag
>
>
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"success"
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"success"
>
在线:
{{
tableData
.
onlineCount
}}
台
</el-tag
>
在线:
{{
tableData
.
onlineCount
}}
台
</el-tag
>
>
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"danger"
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"danger"
>
离线:
{{
tableData
.
offlineCount
}}
台
</el-tag
>
离线:
{{
tableData
.
offlineCount
}}
台
</el-tag
>
>
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"danger"
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"danger"
>
停用:
{{
tableData
.
stopCount
}}
台
</el-tag
>
停用:
{{
tableData
.
stopCount
}}
台
</el-tag
>
>
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"danger"
<el-tag
slot=
"table-head-left2"
size=
"mini"
style=
"margin: 5px"
type=
"danger"
>
未激活:
{{
tableData
.
unActiveCount
}}
台
</el-tag
>
未激活:
{{
tableData
.
unActiveCount
}}
台
</el-tag
>
>
</LayoutTable>
</LayoutTable>
<!-- 设备导入对话框 -->
<!-- 设备导入对话框 -->
...
@@ -165,7 +180,15 @@ export default {
...
@@ -165,7 +180,15 @@ export default {
/** 导出Excel */
/** 导出Excel */
doExport
()
{
doExport
()
{
this
.
isExport
=
true
;
this
.
isExport
=
true
;
this
.
$download
(
"
/device/exportExcel
"
,
{},
{
type
:
"
excel
"
})
this
.
$download
(
"
/device/exportExcel
"
,
{
"
idList
"
:
this
.
selection
,
"
deviceName
"
:
this
.
$route
.
query
[
"
deviceName
"
],
"
siteId
"
:
this
.
$route
.
query
[
"
siteId
"
],
},
{
type
:
"
excel
"
}
)
.
then
(()
=>
(
this
.
isExport
=
false
))
.
then
(()
=>
(
this
.
isExport
=
false
))
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
this
.
isExport
=
false
;
this
.
isExport
=
false
;
...
...
device-manager-ui/admin/src/views/device/module/list.vue
View file @
97273525
...
@@ -41,6 +41,10 @@
...
@@ -41,6 +41,10 @@
],
],
columns
:
[
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
selection
"
,
width
:
60
},
{
label
:
"
模块名称
"
,
prop
:
"
moduleName
"
},
{
label
:
"
模块消息编码
"
,
prop
:
"
moduleMsgCode
"
},
{
{
label
:
"
操作
"
,
label
:
"
操作
"
,
width
:
240
,
width
:
240
,
...
...
device-manager-ui/admin/src/views/product/list.vue
View file @
97273525
<
template
>
<
template
>
<div
class=
"page"
>
<div
class=
"page"
>
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
<LayoutTable
:data=
"tableData"
notAdd
notDel
notSearch
:config=
"tableConfig"
>
</LayoutTable>
</LayoutTable>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
...
@@ -40,20 +40,11 @@
...
@@ -40,20 +40,11 @@
search
:
[
search
:
[
],
],
columns
:
[
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
label
:
"
产品名称
"
,
prop
:
"
productName
"
},
{
label
:
"
产品名称,名称唯一
"
,
prop
:
"
productName
"
},
{
label
:
"
产品编码
"
,
prop
:
"
productCode
"
},
{
label
:
"
产品编码,编码唯一
"
,
prop
:
"
productCode
"
},
{
label
:
"
操作
"
,
width
:
240
,
formatter
:
row
=>
{
return
(
<
table
-
buttons
noAdd
row
=
{
row
}
onEdit
=
{
this
.
toEdit
}
onView
=
{
this
.
toView
}
onDel
=
{
this
.
toDel
}
/
>
);
}
}
]
]
}
}
};
};
...
...
device-manager/src/main/java/com/mortals/xhx/base/system/oper/web/OperLogController.java
View file @
97273525
/**
/**
* 文件:OperLogController.java
* 文件:OperLogController.java
* 版本:1.0.0
* 版本:1.0.0
* 日期:
* 日期:
* Copyright ®
* Copyright ®
* All right reserved.
* All right reserved.
*/
*/
package
com.mortals.xhx.base.system.oper.web
;
package
com.mortals.xhx.base.system.oper.web
;
...
@@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.model.OrderCol
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.oper.model.OperLogEntity
;
import
com.mortals.xhx.base.system.oper.model.OperLogEntity
;
import
com.mortals.xhx.base.system.oper.service.OperLogService
;
import
com.mortals.xhx.base.system.oper.service.OperLogService
;
import
com.mortals.xhx.common.code.OperTypeEnum
;
import
com.mortals.xhx.common.code.OperTypeEnum
;
...
@@ -33,33 +34,32 @@ import java.util.Map;
...
@@ -33,33 +34,32 @@ import java.util.Map;
* <p>Description: OperLogController </p>
* <p>Description: OperLogController </p>
* <p>Copyright: Copyright ® </p>
* <p>Copyright: Copyright ® </p>
* <p>Company: </p>
* <p>Company: </p>
*
* @author
* @author
* @version 1.0.0
* @version 1.0.0
*/
*/
@RestController
@RestController
@RequestMapping
(
"oper/log"
)
@RequestMapping
(
"oper/log"
)
public
class
OperLogController
extends
BaseCRUDJson
MappingController
<
OperLogService
,
OperLogForm
,
OperLogEntity
,
Long
>
{
public
class
OperLogController
extends
BaseCRUDJson
BodyMappingController
<
OperLogService
,
OperLogEntity
,
Long
>
{
public
OperLogController
()
{
public
OperLogController
()
{
super
.
setFormClass
(
OperLogForm
.
class
);
super
.
setFormClass
(
OperLogForm
.
class
);
super
.
setModuleDesc
(
"操作日志"
);
super
.
setModuleDesc
(
"操作日志"
);
}
}
@Override
@Override
protected
void
init
(
HttpServletRequest
request
,
HttpServletResponse
response
,
OperLogForm
form
,
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
Map
<
String
,
Object
>
model
,
Context
context
)
{
Map
<
String
,
Object
>
status
=
new
HashMap
<
String
,
Object
>(
1
);
Map
<
String
,
Object
>
status
=
new
HashMap
<
String
,
Object
>(
1
);
// 返回日志类型
// 返回日志类型
status
.
put
(
"operType"
,
OperTypeEnum
.
getEnumMap
());
status
.
put
(
"operType"
,
OperTypeEnum
.
getEnumMap
());
model
.
put
(
KEY_RESULT_DICT
,
status
);
model
.
put
(
KEY_RESULT_DICT
,
status
);
super
.
init
(
request
,
response
,
form
,
model
,
context
);
}
}
@Override
@Override
protected
void
doListBefore
(
HttpServletRequest
request
,
HttpServletResponse
response
,
OperLogForm
form
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
protected
void
doListBefore
(
OperLogEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
form
.
getQuery
()
.
setOrderColList
(
new
ArrayList
<
OrderCol
>()
{
query
.
setOrderColList
(
new
ArrayList
<
OrderCol
>()
{
{
{
add
(
new
OrderCol
(
"a.logDate"
,
"desc"
));
add
(
new
OrderCol
(
"a.logDate"
,
"desc"
));
}
}
...
...
device-manager/src/main/java/com/mortals/xhx/module/alarm/service/impl/AlarmConfigServiceImpl.java
View file @
97273525
package
com.mortals.xhx.module.alarm.service.impl
;
package
com.mortals.xhx.module.alarm.service.impl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.xhx.module.alarm.model.AlarmConfigQuery
;
import
com.mortals.xhx.module.alarm.model.AlarmConfigQuery
;
...
@@ -10,12 +11,12 @@ import com.mortals.xhx.module.alarm.service.AlarmConfigService;
...
@@ -10,12 +11,12 @@ import com.mortals.xhx.module.alarm.service.AlarmConfigService;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
/**
/**
* AlarmConfigService
* AlarmConfigService
* 设备告警配置 service实现
* 设备告警配置 service实现
*
*
* @author zxfei
* @author zxfei
* @date 2022-06-27
* @date 2022-06-27
*/
*/
@Service
(
"alarmConfigService"
)
@Service
(
"alarmConfigService"
)
public
class
AlarmConfigServiceImpl
extends
AbstractCRUDServiceImpl
<
AlarmConfigDao
,
AlarmConfigEntity
,
Long
>
implements
AlarmConfigService
{
public
class
AlarmConfigServiceImpl
extends
AbstractCRUDServiceImpl
<
AlarmConfigDao
,
AlarmConfigEntity
,
Long
>
implements
AlarmConfigService
{
...
@@ -24,7 +25,7 @@ public class AlarmConfigServiceImpl extends AbstractCRUDServiceImpl<AlarmConfigD
...
@@ -24,7 +25,7 @@ public class AlarmConfigServiceImpl extends AbstractCRUDServiceImpl<AlarmConfigD
protected
void
saveBefore
(
AlarmConfigEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
saveBefore
(
AlarmConfigEntity
entity
,
Context
context
)
throws
AppException
{
//校验产品是否已经存在配置
//校验产品是否已经存在配置
AlarmConfigEntity
alarmConfigEntity
=
this
.
selectOne
(
new
AlarmConfigQuery
().
productId
(
entity
.
getProductId
()));
AlarmConfigEntity
alarmConfigEntity
=
this
.
selectOne
(
new
AlarmConfigQuery
().
productId
(
entity
.
getProductId
()));
if
(!
ObjectUtils
.
isEmpty
(
alarmConfigEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
alarmConfigEntity
))
{
throw
new
AppException
(
"当前产品已存在告警配置!"
);
throw
new
AppException
(
"当前产品已存在告警配置!"
);
}
}
super
.
saveBefore
(
entity
,
context
);
super
.
saveBefore
(
entity
,
context
);
...
@@ -33,10 +34,12 @@ public class AlarmConfigServiceImpl extends AbstractCRUDServiceImpl<AlarmConfigD
...
@@ -33,10 +34,12 @@ public class AlarmConfigServiceImpl extends AbstractCRUDServiceImpl<AlarmConfigD
@Override
@Override
protected
void
updateBefore
(
AlarmConfigEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
updateBefore
(
AlarmConfigEntity
entity
,
Context
context
)
throws
AppException
{
//校验
//校验
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getProductId
()))
{
AlarmConfigEntity
alarmConfigEntity
=
this
.
selectOne
(
new
AlarmConfigQuery
().
productId
(
entity
.
getProductId
()));
AlarmConfigEntity
alarmConfigEntity
=
this
.
selectOne
(
new
AlarmConfigQuery
().
productId
(
entity
.
getProductId
()));
if
(!
ObjectUtils
.
isEmpty
(
alarmConfigEntity
)&&
entity
.
getId
()!=
alarmConfigEntity
.
getId
())
{
if
(!
ObjectUtils
.
isEmpty
(
alarmConfigEntity
)
&&
entity
.
getId
()
!=
alarmConfigEntity
.
getId
())
{
entity
.
setId
(
alarmConfigEntity
.
getId
());
entity
.
setId
(
alarmConfigEntity
.
getId
());
}
}
}
super
.
updateBefore
(
entity
,
context
);
super
.
updateBefore
(
entity
,
context
);
}
}
}
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceModuleServiceImpl.java
View file @
97273525
...
@@ -4,7 +4,10 @@ import com.mortals.framework.exception.AppException;
...
@@ -4,7 +4,10 @@ import com.mortals.framework.exception.AppException;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.model.Result
;
import
com.mortals.xhx.module.alarm.model.AlarmConfigEntity
;
import
com.mortals.xhx.module.alarm.model.AlarmConfigQuery
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceModuleQuery
;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
com.mortals.xhx.module.platform.model.PlatformEntity
;
import
com.mortals.xhx.module.platform.model.PlatformEntity
;
import
com.mortals.xhx.module.platform.service.PlatformService
;
import
com.mortals.xhx.module.platform.service.PlatformService
;
...
@@ -31,5 +34,21 @@ import java.util.List;
...
@@ -31,5 +34,21 @@ import java.util.List;
public
class
DeviceModuleServiceImpl
extends
AbstractCRUDServiceImpl
<
DeviceModuleDao
,
DeviceModuleEntity
,
Long
>
implements
DeviceModuleService
{
public
class
DeviceModuleServiceImpl
extends
AbstractCRUDServiceImpl
<
DeviceModuleDao
,
DeviceModuleEntity
,
Long
>
implements
DeviceModuleService
{
@Override
protected
void
validData
(
DeviceModuleEntity
entity
,
Context
context
)
throws
AppException
{
if
(
entity
.
newEntity
())
{
DeviceModuleEntity
deviceModuleEntity
=
this
.
selectOne
(
new
DeviceModuleQuery
().
moduleMsgCode
(
entity
.
getModuleMsgCode
()));
if
(!
ObjectUtils
.
isEmpty
(
deviceModuleEntity
))
{
throw
new
AppException
(
"设备模块消息编码已存在"
);
}
}
else
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getModuleMsgCode
()))
{
DeviceModuleEntity
deviceModuleEntity
=
this
.
selectOne
(
new
DeviceModuleQuery
().
moduleMsgCode
(
entity
.
getModuleMsgCode
()));
if
(!
ObjectUtils
.
isEmpty
(
deviceModuleEntity
)
&&
entity
.
getId
()
!=
deviceModuleEntity
.
getId
())
{
throw
new
AppException
(
"设备模块消息编码已存在"
);
}
}
}
super
.
validData
(
entity
,
context
);
}
}
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
97273525
...
@@ -289,6 +289,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
...
@@ -289,6 +289,9 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
throw
new
AppException
(
"设备编码重复!"
);
throw
new
AppException
(
"设备编码重复!"
);
}
}
entity
.
setDeviceCode
(
StrUtil
.
replace
(
entity
.
getDeviceCode
(),
":"
,
"-"
));
super
.
saveBefore
(
entity
,
context
);
super
.
saveBefore
(
entity
,
context
);
}
}
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/web/DeviceAlarmInfoController.java
View file @
97273525
package
com.mortals.xhx.module.device.web
;
package
com.mortals.xhx.module.device.web
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
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.common.code.DeviceStatusEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.module.device.model.DeviceAlarmInfoEntity
;
import
com.mortals.xhx.module.device.model.DeviceAlarmInfoEntity
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.model.DeviceQuery
;
import
com.mortals.xhx.module.device.model.DeviceQuery
;
import
com.mortals.xhx.module.device.service.DeviceAlarmInfoService
;
import
com.mortals.xhx.module.device.service.DeviceAlarmInfoService
;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
com.mortals.xhx.module.device.service.DeviceService
;
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
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -42,5 +48,15 @@ public class DeviceAlarmInfoController extends BaseCRUDJsonBodyMappingController
...
@@ -42,5 +48,15 @@ public class DeviceAlarmInfoController extends BaseCRUDJsonBodyMappingController
super
.
init
(
model
,
context
);
super
.
init
(
model
,
context
);
}
}
@Override
protected
int
doListAfter
(
DeviceAlarmInfoEntity
query
,
Map
<
String
,
Object
>
model
,
Context
context
)
throws
AppException
{
List
<
DeviceAlarmInfoEntity
>
alarmInfoEntityList
=
this
.
service
.
find
(
query
,
context
);
Map
<
Integer
,
Long
>
collect
=
alarmInfoEntityList
.
stream
().
collect
(
Collectors
.
groupingBy
(
DeviceAlarmInfoEntity:
:
getAlarmLevel
,
Collectors
.
counting
()));
model
.
put
(
"totalCount"
,
alarmInfoEntityList
.
size
());
model
.
put
(
"dangerCount"
,
collect
.
getOrDefault
(
0
,
0L
));
model
.
put
(
"subCount"
,
collect
.
getOrDefault
(
1
,
0L
));
model
.
put
(
"normalCount"
,
collect
.
getOrDefault
(
2
,
0L
));
return
super
.
doListAfter
(
query
,
model
,
context
);
}
}
}
\ No newline at end of file
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