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
f1cfe901
Commit
f1cfe901
authored
Jul 19, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加设备上线和下线的业务日志记录
parent
edb164a4
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
669 additions
and
22 deletions
+669
-22
device-manager/db/add.sql
device-manager/db/add.sql
+8
-1
device-manager/src/main/java/com/mortals/xhx/base/framework/listener/CustomerKeyExpirationListener.java
...ase/framework/listener/CustomerKeyExpirationListener.java
+18
-1
device-manager/src/main/java/com/mortals/xhx/common/code/AlarmPusW1ayEnum.java
...in/java/com/mortals/xhx/common/code/AlarmPusW1ayEnum.java
+1
-1
device-manager/src/main/java/com/mortals/xhx/module/alarm/web/AlarmConfigController.java
...m/mortals/xhx/module/alarm/web/AlarmConfigController.java
+4
-2
device-manager/src/main/java/com/mortals/xhx/module/device/model/DeviceAlarmInfoEntity.java
...ortals/xhx/module/device/model/DeviceAlarmInfoEntity.java
+33
-12
device-manager/src/main/java/com/mortals/xhx/module/device/model/DeviceAlarmInfoQuery.java
...mortals/xhx/module/device/model/DeviceAlarmInfoQuery.java
+413
-1
device-manager/src/main/resources/sqlmap/module/device/DeviceAlarmInfoMapper.xml
.../resources/sqlmap/module/device/DeviceAlarmInfoMapper.xml
+192
-4
doc/设备管理系统.docx
doc/设备管理系统.docx
+0
-0
No files found.
device-manager/db/add.sql
View file @
f1cfe901
...
@@ -42,3 +42,10 @@ ALTER TABLE mortals_xhx_device ADD COLUMN `showWechatQrCode` tinyint(2) DEFA
...
@@ -42,3 +42,10 @@ ALTER TABLE mortals_xhx_device ADD COLUMN `showWechatQrCode` tinyint(2) DEFA
ALTER
TABLE
mortals_xhx_device
ADD
COLUMN
`orgName`
varchar
(
128
)
COMMENT
'所属机构'
AFTER
showWechatQrCode
;
ALTER
TABLE
mortals_xhx_device
ADD
COLUMN
`orgName`
varchar
(
128
)
COMMENT
'所属机构'
AFTER
showWechatQrCode
;
ALTER
TABLE
mortals_xhx_device_alarm_info
ADD
COLUMN
`push`
tinyint
(
2
)
DEFAULT
'0'
COMMENT
'是否推送'
,
ADD
COLUMN
`productId`
bigint
(
20
)
DEFAULT
'0'
COMMENT
'产品Id'
,
ADD
COLUMN
`productCode`
varchar
(
256
)
DEFAULT
''
COMMENT
'产品编码'
,
ADD
COLUMN
`productName`
varchar
(
256
)
DEFAULT
''
COMMENT
'产品名称'
device-manager/src/main/java/com/mortals/xhx/base/framework/listener/CustomerKeyExpirationListener.java
View file @
f1cfe901
...
@@ -146,10 +146,19 @@ public class CustomerKeyExpirationListener implements MessageListener {
...
@@ -146,10 +146,19 @@ public class CustomerKeyExpirationListener implements MessageListener {
alarmInfoEntity
.
setReceivePersonnelTelephone
(
deviceEntity
.
getLeadingOfficialTelephone
());
alarmInfoEntity
.
setReceivePersonnelTelephone
(
deviceEntity
.
getLeadingOfficialTelephone
());
alarmInfoEntity
.
setCreateTime
(
new
Date
());
alarmInfoEntity
.
setCreateTime
(
new
Date
());
alarmInfoEntity
.
setCreateUserId
(
1L
);
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
(
EnabledEnum
.
启用
.
getValue
()==
alarmConfigEntity
.
getEnabled
()){
alarmInfoEntity
.
setProductId
(
productEntity
.
getId
());
alarmInfoEntity
.
setProductCode
(
productEntity
.
getProductCode
());
alarmInfoEntity
.
setProductName
(
productEntity
.
getProductName
());
alarmInfoEntity
.
setPush
(
YesNoEnum
.
YES
.
getValue
());
deviceAlarmInfoService
.
save
(
alarmInfoEntity
);
}
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
()));
...
@@ -176,12 +185,20 @@ public class CustomerKeyExpirationListener implements MessageListener {
...
@@ -176,12 +185,20 @@ public class CustomerKeyExpirationListener implements MessageListener {
alarmSmsSendService
.
save
(
alarmSmsSendEntity
,
null
);
alarmSmsSendService
.
save
(
alarmSmsSendEntity
,
null
);
}
}
}
else
{
}
else
{
//推送站类
}
}
}
}
}
}
}
}
}
}
// deviceAlarmInfoService.save(alarmInfoEntity);
}
}
}
}
}
}
...
...
device-manager/src/main/java/com/mortals/xhx/common/code/AlarmPusW1ayEnum.java
View file @
f1cfe901
...
@@ -9,7 +9,7 @@ import java.util.Map;
...
@@ -9,7 +9,7 @@ import java.util.Map;
* @author zxfei
* @author zxfei
*/
*/
public
enum
AlarmPusW1ayEnum
{
public
enum
AlarmPusW1ayEnum
{
不推送
(
0
,
"不推送
"
),
站内信息
(
0
,
"站内信息
"
),
短信
(
1
,
"短信"
);
短信
(
1
,
"短信"
);
private
Integer
value
;
private
Integer
value
;
private
String
desc
;
private
String
desc
;
...
...
device-manager/src/main/java/com/mortals/xhx/module/alarm/web/AlarmConfigController.java
View file @
f1cfe901
...
@@ -3,6 +3,8 @@ package com.mortals.xhx.module.alarm.web;
...
@@ -3,6 +3,8 @@ package com.mortals.xhx.module.alarm.web;
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.AlarmPusW1ayEnum
;
import
com.mortals.xhx.common.code.EnabledEnum
;
import
com.mortals.xhx.module.alarm.model.AlarmConfigEntity
;
import
com.mortals.xhx.module.alarm.model.AlarmConfigEntity
;
import
com.mortals.xhx.module.alarm.service.AlarmConfigService
;
import
com.mortals.xhx.module.alarm.service.AlarmConfigService
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
import
com.mortals.xhx.module.product.model.ProductEntity
;
...
@@ -38,8 +40,8 @@ public class AlarmConfigController extends BaseCRUDJsonBodyMappingController<Ala
...
@@ -38,8 +40,8 @@ public class AlarmConfigController extends BaseCRUDJsonBodyMappingController<Ala
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"alarmType"
,
paramService
.
getParamBySecondOrganize
(
"AlarmConfig"
,
"alarmType"
));
this
.
addDict
(
model
,
"alarmType"
,
paramService
.
getParamBySecondOrganize
(
"AlarmConfig"
,
"alarmType"
));
this
.
addDict
(
model
,
"alarmLevel"
,
paramService
.
getParamBySecondOrganize
(
"AlarmConfig"
,
"alarmLevel"
));
this
.
addDict
(
model
,
"alarmLevel"
,
paramService
.
getParamBySecondOrganize
(
"AlarmConfig"
,
"alarmLevel"
));
this
.
addDict
(
model
,
"alarmPusW1ay"
,
paramService
.
getParamBySecondOrganize
(
"AlarmConfig"
,
"alarmPusW1ay"
));
this
.
addDict
(
model
,
"alarmPusW1ay"
,
AlarmPusW1ayEnum
.
getEnumMap
(
));
this
.
addDict
(
model
,
"enabled"
,
paramService
.
getParamBySecondOrganize
(
"AlarmConfig"
,
"isUse"
));
this
.
addDict
(
model
,
"enabled"
,
EnabledEnum
.
getEnumMap
(
));
this
.
addDict
(
model
,
"productId"
,
productService
.
find
(
new
ProductEntity
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getProductName
())));
this
.
addDict
(
model
,
"productId"
,
productService
.
find
(
new
ProductEntity
()).
stream
().
collect
(
Collectors
.
toMap
(
x
->
x
.
getId
().
toString
(),
y
->
y
.
getProductName
())));
super
.
init
(
model
,
context
);
super
.
init
(
model
,
context
);
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/model/DeviceAlarmInfoEntity.java
View file @
f1cfe901
...
@@ -4,12 +4,11 @@ import com.mortals.xhx.module.device.model.vo.DeviceAlarmInfoVo;
...
@@ -4,12 +4,11 @@ import com.mortals.xhx.module.device.model.vo.DeviceAlarmInfoVo;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
* 设备告警日志实体对象
* 设备告警日志实体对象
*
*
* @author zxfei
* @author zxfei
* @date 2023-0
4-27
* @date 2023-0
7-19
*/
*/
@Data
@Data
public
class
DeviceAlarmInfoEntity
extends
DeviceAlarmInfoVo
{
public
class
DeviceAlarmInfoEntity
extends
DeviceAlarmInfoVo
{
...
@@ -24,7 +23,7 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
...
@@ -24,7 +23,7 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
*/
*/
private
Long
alarmDevice
;
private
Long
alarmDevice
;
/**
/**
* 告警类型,(0.离线
,1.在线,2.缺纸
)
* 告警类型,(0.离线)
*/
*/
private
Integer
alarmType
;
private
Integer
alarmType
;
/**
/**
...
@@ -59,33 +58,47 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
...
@@ -59,33 +58,47 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
* 设备名称
* 设备名称
*/
*/
private
String
deviceName
;
private
String
deviceName
;
/**
* 是否推送
*/
private
Integer
push
;
/**
* 产品Id
*/
private
Long
productId
;
/**
* 产品编码
*/
private
String
productCode
;
/**
* 产品名称
*/
private
String
productName
;
@Override
@Override
public
int
hashCode
()
{
public
int
hashCode
()
{
return
this
.
get
AlarmDevice
().
hashCode
();
return
this
.
get
Id
().
hashCode
();
}
}
@Override
@Override
public
boolean
equals
(
Object
obj
)
{
public
boolean
equals
(
Object
obj
)
{
if
(
obj
==
null
)
return
false
;
if
(
obj
==
null
)
return
false
;
if
(
obj
instanceof
DeviceAlarmInfoEntity
)
{
if
(
obj
instanceof
DeviceAlarmInfoEntity
)
{
DeviceAlarmInfoEntity
tmp
=
(
DeviceAlarmInfoEntity
)
obj
;
DeviceAlarmInfoEntity
tmp
=
(
DeviceAlarmInfoEntity
)
obj
;
if
(
this
.
get
AlarmDevice
().
equals
(
tmp
.
getAlarmDevice
()
))
{
if
(
this
.
get
Id
()
==
tmp
.
getId
(
))
{
return
true
;
return
true
;
}
}
}
}
return
false
;
return
false
;
}
}
public
void
initAttrValue
()
{
public
void
initAttrValue
(){
this
.
alarmTime
=
null
;
this
.
alarmTime
=
null
;
this
.
alarmDevice
=
null
;
this
.
alarmDevice
=
-
1L
;
this
.
alarmType
=
null
;
this
.
alarmType
=
-
1
;
this
.
alarmLevel
=
null
;
this
.
alarmLevel
=
-
1
;
this
.
alarmReceivePersonnel
=
""
;
this
.
alarmReceivePersonnel
=
""
;
...
@@ -95,10 +108,18 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
...
@@ -95,10 +108,18 @@ public class DeviceAlarmInfoEntity extends DeviceAlarmInfoVo {
this
.
alarmContent
=
""
;
this
.
alarmContent
=
""
;
this
.
siteId
=
null
;
this
.
siteId
=
-
1L
;
this
.
deviceCode
=
""
;
this
.
deviceCode
=
""
;
this
.
deviceName
=
""
;
this
.
deviceName
=
""
;
this
.
push
=
0
;
this
.
productId
=
-
1L
;
this
.
productCode
=
""
;
this
.
productName
=
""
;
}
}
}
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/device/model/DeviceAlarmInfoQuery.java
View file @
f1cfe901
This diff is collapsed.
Click to expand it.
device-manager/src/main/resources/sqlmap/module/device/DeviceAlarmInfoMapper.xml
View file @
f1cfe901
This diff is collapsed.
Click to expand it.
doc/设备管理系统.docx
View file @
f1cfe901
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