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
faf4dc14
Commit
faf4dc14
authored
Jul 05, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信界面修改
parent
1a2832a2
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
9462 additions
and
9055 deletions
+9462
-9055
device-manager-ui/admin/src/views/alarm/sms/send/list.vue
device-manager-ui/admin/src/views/alarm/sms/send/list.vue
+12
-5
device-manager-ui/admin/src/views/device/alarm/info/list.vue
device-manager-ui/admin/src/views/device/alarm/info/list.vue
+1
-1
device-manager-ui/admin/src/views/firm/list.vue
device-manager-ui/admin/src/views/firm/list.vue
+24
-11
device-manager-ui/admin/yarn.lock
device-manager-ui/admin/yarn.lock
+9270
-9018
device-manager/src/main/java/com/mortals/xhx/base/framework/listener/CustomerKeyExpirationListener.java
...ase/framework/listener/CustomerKeyExpirationListener.java
+38
-7
device-manager/src/main/java/com/mortals/xhx/common/utils/SendSmsTask.java
...c/main/java/com/mortals/xhx/common/utils/SendSmsTask.java
+55
-0
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceStartService.java
...als/xhx/daemon/applicationservice/DeviceStartService.java
+38
-11
device-manager/src/main/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
+1
-0
device-manager/src/main/java/com/mortals/xhx/module/alarm/model/AlarmSmsSendEntity.java
...om/mortals/xhx/module/alarm/model/AlarmSmsSendEntity.java
+0
-1
device-manager/src/main/java/com/mortals/xhx/module/alarm/model/vo/AlarmSmsSendVo.java
...com/mortals/xhx/module/alarm/model/vo/AlarmSmsSendVo.java
+3
-0
device-manager/src/main/java/com/mortals/xhx/module/alarm/service/AlarmSmsSendService.java
...mortals/xhx/module/alarm/service/AlarmSmsSendService.java
+6
-0
device-manager/src/main/java/com/mortals/xhx/module/alarm/service/impl/AlarmSmsSendServiceImpl.java
...hx/module/alarm/service/impl/AlarmSmsSendServiceImpl.java
+14
-1
No files found.
device-manager-ui/admin/src/views/alarm/sms/send/list.vue
View file @
faf4dc14
...
...
@@ -65,12 +65,19 @@
label
:
"
发送状态
"
,
fuzzy
:
true
},
{
name
:
"
sendTime
"
,
type
:
"
date
"
,
label
:
"
发送时间
"
,
fuzzy
:
true
},
name
:
"
sendTimeStart
"
,
type
:
"
datetime
"
,
label
:
"
开始时间
"
,
},
{
name
:
"
sendTimeEnd
"
,
type
:
"
datetime
"
,
label
:
"
结束时间
"
,
placeholder
:
"
结束时间
"
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
...
...
device-manager-ui/admin/src/views/device/alarm/info/list.vue
View file @
faf4dc14
...
...
@@ -112,7 +112,7 @@ export default {
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
selection
"
,
width
:
60
,
label
:
"
全选
"
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
...
...
device-manager-ui/admin/src/views/firm/list.vue
View file @
faf4dc14
...
...
@@ -3,48 +3,61 @@
<LayoutTable
:data=
"tableData"
:config=
"tableConfig"
>
</LayoutTable>
<dialog-show
ref=
"dialogform"
@
ok=
"getData"
/>
<drawer-show
ref=
"drawerform"
@
ok=
"getData"
/>
</div>
</
template
>
<
script
>
/** 表单弹出框模式需引入 */
import
dialogShow
from
"
./dialogshow
"
;
import
drawerShow
from
"
./drawershow
"
;
import
table
from
"
@/assets/mixins/table
"
;
export
default
{
name
:
"
Firm
"
,
components
:
{
dialogShow
},
name
:
"
FirmList
"
,
components
:
{
drawerShow
},
mixins
:
[
table
],
created
()
{
},
methods
:
{
/** 重写新增方法 */
toAdd
(
row
)
{
this
.
$refs
.
d
ialog
form
.
add
(
row
);
this
.
$refs
.
d
rawer
form
.
add
(
row
);
},
/** 重写编辑方法 */
toEdit
(
row
)
{
this
.
$refs
.
dialogform
.
edit
(
row
);
this
.
$refs
.
drawerform
.
edit
(
row
);
},
/** 重写查看方法 */
//
toView(row) {
// this.$refs.dialog
form.view(row);
//
},
toView
(
row
)
{
this
.
$refs
.
drawer
form
.
view
(
row
);
},
},
data
()
{
return
{
config
:
{
search
:
[
{
name
:
"
firmName
"
,
type
:
"
text
"
,
label
:
"
设备生产厂商名称
"
,
fuzzy
:
true
},
],
columns
:
[
{
type
:
"
selection
"
,
width
:
60
},
{
type
:
"
index
"
,
label
:
"
序号
"
,
width
:
50
},
{
label
:
"
设备生产厂商名称
"
,
prop
:
"
firmName
"
},
{
label
:
"
设备生产商编码
"
,
prop
:
"
firmCode
"
},
{
label
:
"
备注
"
,
prop
:
"
firmRemark
"
},
{
label
:
"
创建时间
"
,
prop
:
"
createTime
"
,
formatter
:
this
.
formatterDate
},
{
label
:
"
操作
"
,
width
:
240
,
...
...
device-manager-ui/admin/yarn.lock
View file @
faf4dc14
This source diff could not be displayed because it is too large. You can
view the blob
instead.
device-manager/src/main/java/com/mortals/xhx/base/framework/listener/CustomerKeyExpirationListener.java
View file @
faf4dc14
package
com.mortals.xhx.base.framework.listener
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.mortals.xhx.common.code.DeviceOnlineStatusEnum
;
import
com.mortals.xhx.common.code.DeviceMethodEnum
;
import
com.mortals.xhx.common.code.DeviceStatusEnum
;
import
com.mortals.framework.util.UuidUtil
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.key.RedisKey
;
import
com.mortals.xhx.module.alarm.model.AlarmConfigEntity
;
import
com.mortals.xhx.module.alarm.model.AlarmConfigQuery
;
import
com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity
;
import
com.mortals.xhx.module.alarm.service.AlarmConfigService
;
import
com.mortals.xhx.module.alarm.service.AlarmSmsSendService
;
import
com.mortals.xhx.module.device.model.DeviceAlarmInfoEntity
;
import
com.mortals.xhx.module.device.model.DeviceAlarmInfoQuery
;
import
com.mortals.xhx.module.device.model.DeviceEntity
;
import
com.mortals.xhx.module.device.service.DeviceAlarmInfoService
;
import
com.mortals.xhx.module.device.service.DeviceService
;
import
com.mortals.xhx.module.platform.model.PlatformEntity
;
import
com.mortals.xhx.module.platform.service.PlatformService
;
...
...
@@ -21,6 +30,8 @@ import org.springframework.util.ObjectUtils;
import
java.util.Date
;
/**
* 离线通知
*
* @author: zxfei
* @date: 2022/6/22 16:40
* @description:
...
...
@@ -35,6 +46,13 @@ public class CustomerKeyExpirationListener implements MessageListener {
private
ProductService
productService
;
@Autowired
private
PlatformService
platformService
;
@Autowired
private
AlarmConfigService
alarmConfigService
;
@Autowired
private
DeviceAlarmInfoService
deviceAlarmInfoService
;
@Autowired
private
AlarmSmsSendService
alarmSmsSendService
;
@Override
public
void
onMessage
(
Message
message
,
byte
[]
bytes
)
{
...
...
@@ -54,13 +72,26 @@ public class CustomerKeyExpirationListener implements MessageListener {
//通知第三方平台
deviceService
.
sendThirdParty
(
deviceEntity
,
productEntity
,
platformEntity
,
DeviceMethodEnum
.
OFFLINE
);
}
}
// TODO: 2022/6/23 告警信息保存与发送
// TODO: 2022/6/23 告警信息保存与发送
AlarmConfigEntity
alarmConfigEntity
=
alarmConfigService
.
selectOne
(
new
AlarmConfigQuery
().
productId
(
productEntity
.
getId
()));
if
(!
ObjectUtils
.
isEmpty
(
alarmConfigEntity
))
{
if
(
alarmConfigEntity
.
getAlarmPusW1ay
()==
AlarmPusW1ayEnum
.
短信
.
getValue
()){
// TODO: 2022/7/4 发送短信
DeviceAlarmInfoEntity
deviceAlarmInfoEntity
=
deviceAlarmInfoService
.
selectOne
(
new
DeviceAlarmInfoQuery
().
alarmDevice
(
deviceEntity
.
getId
()));
AlarmSmsSendEntity
alarmSmsSendEntity
=
new
AlarmSmsSendEntity
();
alarmSmsSendEntity
.
initAttrValue
();
alarmSmsSendEntity
.
setId
(
IdUtil
.
getSnowflake
().
nextId
());
alarmSmsSendEntity
.
setMobile
(
deviceAlarmInfoEntity
.
getReceivePersonnelTelephone
());
alarmSmsSendEntity
.
setReceiver
(
deviceAlarmInfoEntity
.
getAlarmReceivePersonnel
());
alarmSmsSendEntity
.
setSendMess
(
deviceAlarmInfoEntity
.
getAlarmContent
());
alarmSmsSendEntity
.
setSendStatus
(
SendStatusEnum
.
未发送
.
getValue
());
alarmSmsSendService
.
save
(
alarmSmsSendEntity
,
null
);
}
}
}
}
}
log
.
info
(
"监听到key:"
+
key
+
"过期"
);
}
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/common/utils/SendSmsTask.java
0 → 100644
View file @
faf4dc14
package
com.mortals.xhx.common.utils
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.util.HttpUtil
;
import
com.mortals.xhx.busiz.req.ApiThirdPartyReq
;
import
com.mortals.xhx.common.code.MessageTypeEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
mortals
.
framework
.
util
.
HttpUtil
.
HEADER_CONTENT_TYPE
;
/**
* 短信发送任务
*
* @author: zxfei
* @date: 2022/4/28 10:56
* @description:
**/
@Slf4j
@AllArgsConstructor
public
class
SendSmsTask
implements
Runnable
{
/**
* 短信消息
*/
private
AlarmSmsSendEntity
alarmSmsSendEntity
;
/**
* 接口地址
*/
private
String
sendUrl
;
@Override
public
void
run
()
{
// TODO: 2022/7/5 短信发送
String
resp
=
null
;
try
{
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
HEADER_CONTENT_TYPE
,
"application/json"
);
// resp = HttpUtil.doPost(sendUrl, header, JSON.toJSONString(deviceReqApiReq));
//发送成功添加到响应队列,由线程批量更新
SmsQueueManager
.
offerRespQueue
(
alarmSmsSendEntity
);
log
.
debug
(
"resp:{}"
,
resp
);
}
catch
(
Exception
e
)
{
log
.
error
(
"异常:"
,
e
);
}
}
}
device-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DeviceStartService.java
View file @
faf4dc14
package
com.mortals.xhx.daemon.applicationservice
;
import
com.
mortals.framework.service.ICacheService
;
import
com.mortals.
xhx.base.framework.listener.CustomerKeyExpirationListener
;
import
com.
alibaba.fastjson.JSON
;
import
com.mortals.
framework.springcloud.service.IApplicationService
;
import
com.mortals.xhx.common.utils.SendTaskThreadPool
;
import
com.mortals.xhx.common.utils.SmsQueueManager
;
import
com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity
;
import
com.mortals.xhx.queue.TbQueueMsg
;
import
com.mortals.xhx.utils.IotThreadFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.connection.Message
;
import
org.springframework.data.redis.connection.MessageListener
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.ObjectUtils
;
import
com.mortals.framework.springcloud.service.IApplicationService
;
import
java.time.Duration
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
@Component
@Slf4j
...
...
@@ -23,10 +25,35 @@ public class DeviceStartService implements IApplicationService {
@Autowired
private
SendTaskThreadPool
sendTaskThreadPool
;
protected
Boolean
stopped
=
false
;
@Override
public
void
start
()
{
log
.
info
(
"初始化发送线程数量"
);
sendTaskThreadPool
.
init
(
20
);
//启动短信发送响应更新线程
sendTaskThreadPool
.
execute
(()
->
{
int
waitTime
=
1000
;
while
(!
stopped
)
{
try
{
AlarmSmsSendEntity
message
=
SmsQueueManager
.
pollRespQueue
();
if
(!
ObjectUtils
.
isEmpty
(
message
))
{
// TODO: 2022/7/5 更新响应
}
}
catch
(
Exception
e
)
{
if
(!
stopped
)
{
try
{
Thread
.
sleep
(
waitTime
);
}
catch
(
InterruptedException
e2
)
{
}
}
}
}
});
log
.
info
(
"开始服务..[配置已加载完成,但部分框架还未初始化,比如:Kafka]"
);
}
...
...
device-manager/src/main/java/com/mortals/xhx/daemon/task/SiteStatTaskImpl.java
View file @
faf4dc14
...
...
@@ -49,6 +49,7 @@ public class SiteStatTaskImpl implements ITaskExcuteService {
private
ISiteFeign
siteFeign
;
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
String
resp
=
siteFeign
.
list
(
new
SitePdu
());
...
...
device-manager/src/main/java/com/mortals/xhx/module/alarm/model/AlarmSmsSendEntity.java
View file @
faf4dc14
...
...
@@ -36,7 +36,6 @@ public class AlarmSmsSendEntity extends AlarmSmsSendVo {
/**
* 接收人
*/
@Excel
(
name
=
"接收人"
)
private
String
receiver
;
...
...
device-manager/src/main/java/com/mortals/xhx/module/alarm/model/vo/AlarmSmsSendVo.java
View file @
faf4dc14
package
com.mortals.xhx.module.alarm.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -9,6 +11,7 @@ import java.util.List;
* @author zxfei
* @date 2022-07-01
*/
@Data
public
class
AlarmSmsSendVo
extends
BaseEntityLong
{
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/alarm/service/AlarmSmsSendService.java
View file @
faf4dc14
package
com.mortals.xhx.module.alarm.service
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity
;
import
java.util.Queue
;
/**
* AlarmSmsSendService
*
...
...
@@ -11,4 +14,7 @@ import com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity;
*/
public
interface
AlarmSmsSendService
extends
ICRUDService
<
AlarmSmsSendEntity
,
Long
>{
Queue
getSmsRespQueue
();
}
\ No newline at end of file
device-manager/src/main/java/com/mortals/xhx/module/alarm/service/impl/AlarmSmsSendServiceImpl.java
View file @
faf4dc14
package
com.mortals.xhx.module.alarm.service.impl
;
import
com.mortals.xhx.queue.TbQueueMsg
;
import
lombok.Getter
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.module.alarm.dao.AlarmSmsSendDao
;
import
com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity
;
import
com.mortals.xhx.module.alarm.service.AlarmSmsSendService
;
import
java.util.Queue
;
import
java.util.concurrent.LinkedBlockingQueue
;
/**
* AlarmSmsSendService
* 短信发送记录 service实现
...
...
@@ -13,5 +19,12 @@ import com.mortals.xhx.module.alarm.service.AlarmSmsSendService;
*/
@Service
(
"alarmSmsSendService"
)
public
class
AlarmSmsSendServiceImpl
extends
AbstractCRUDServiceImpl
<
AlarmSmsSendDao
,
AlarmSmsSendEntity
,
Long
>
implements
AlarmSmsSendService
{
private
LinkedBlockingQueue
<
AlarmSmsSendEntity
>
smsRespQueue
=
new
LinkedBlockingQueue
<>();
@Override
public
Queue
getSmsRespQueue
()
{
return
smsRespQueue
;
}
}
\ 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