Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
60b54653
Commit
60b54653
authored
Sep 30, 2021
by
李腾威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图消息接口
parent
cf9b0baa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
3 deletions
+50
-3
AlertCalledController.java
...boot/module/tzs/biz/controller/AlertCalledController.java
+39
-0
AlertCalledServiceImpl.java
...t/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
+1
-1
application-dev.properties
...-system-tzs/src/main/resources/application-dev.properties
+10
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertCalledController.java
View file @
60b54653
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
...
...
@@ -36,7 +37,11 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -44,6 +49,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
...
@@ -52,6 +58,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.UnsupportedEncodingException
;
import
java.text.ParseException
;
import
java.util.Date
;
import
java.util.LinkedHashMap
;
...
...
@@ -69,6 +76,8 @@ import java.util.Map;
@RequestMapping
(
value
=
"/alert-called"
)
public
class
AlertCalledController
extends
BaseController
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AlertCalledController
.
class
);
@Autowired
RedisUtils
redisUtils
;
...
...
@@ -96,6 +105,15 @@ public class AlertCalledController extends BaseController {
@Autowired
ElevatorServiceImpl
elevatorService
;
@Autowired
private
EmqKeeper
emqKeeper
;
@Value
(
"${mqtt.topic.alertReport.push}"
)
private
String
alertReportpushTopic
;
@Value
(
"${mqtt.topic.alertInfo.push}"
)
private
String
alertInfopushTopic
;
/**
* 新增警情接警填报记录
*
...
...
@@ -111,6 +129,27 @@ public class AlertCalledController extends BaseController {
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
alertCalledObjsDto
=
iAlertCalledService
.
createAlertCalled
(
alertCalledObjsDto
,
reginParams
.
getUserModel
());
// 坐席接警后,辅屏由常态化切换为处置态
AgencyUserModel
user
=
getUserInfo
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
user
.
getUserId
());
jsonObject
.
put
(
"alertId"
,
alertCalledObjsDto
.
getAlertCalledDto
().
getSequenceNbr
());
JSONObject
jsonObject1
=
new
JSONObject
();
jsonObject
.
put
(
"alertId"
,
alertCalledObjsDto
.
getAlertCalledDto
().
getSequenceNbr
());
try
{
emqKeeper
.
getMqttClient
().
publish
(
alertReportpushTopic
,
jsonObject
.
toString
().
getBytes
(
"UTF-8"
),
1
,
false
);
// 跑马灯消息提醒
if
(
null
!=
alertCalledObjsDto
.
getAlertCalledDto
().
getFatherAlert
())
{
emqKeeper
.
getMqttClient
().
publish
(
alertInfopushTopic
,
jsonObject1
.
toString
().
getBytes
(
"UTF-8"
),
1
,
false
);
}
}
catch
(
MqttException
e
)
{
logger
.
error
(
"mqtt发送失败"
+
jsonObject
);
}
catch
(
UnsupportedEncodingException
e
)
{
logger
.
error
(
"mqtt发送失败"
+
jsonObject
);
}
return
ResponseHelper
.
buildResponse
(
alertCalledObjsDto
.
getAlertCalledDto
());
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/AlertCalledServiceImpl.java
View file @
60b54653
...
...
@@ -331,7 +331,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
LambdaQueryWrapper
<
AlertCalled
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
eq
(
AlertCalled:
:
getAlertStageCode
,
"860"
);
queryWrapper
.
ge
(
AlertCalled:
:
getCallTime
,
DateUtils
.
stampToDate
(
System
.
currentTimeMillis
(),
DateUtils
.
DATE_PATTERN
));
queryWrapper
.
le
(
AlertCalled:
:
get
AlertStageCod
e
,
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
1
).
getTime
(),
DateUtils
.
DATE_PATTERN
));
queryWrapper
.
le
(
AlertCalled:
:
get
CallTim
e
,
DateUtils
.
stampToDate
(
DateUtils
.
dateAddDays
(
new
Date
(),
1
).
getTime
(),
DateUtils
.
DATE_PATTERN
));
Object
list
=
this
.
list
(
queryWrapper
);
return
list
;
}
...
...
amos-boot-system-tzs/src/main/resources/application-dev.properties
View file @
60b54653
...
...
@@ -63,4 +63,12 @@ mqtt.topic.task.newtask=tzs-task-newtask
mqtt.topic.task.personinfo
=
tzs-task-personinfo
mqtt.topic.elevator.push
=
/tzs/tcb_elevator
\ No newline at end of file
mqtt.topic.elevator.push
=
/tzs/tcb_elevator
mqtt.topic.alertInfo.push
=
/tzs/tcb_alertInfo
mqtt.topic.alertReport.push
=
/tzs/tcb_alertReport
mqtt.topic.alertHeart.push
=
/tzs/tcb_alertHeart
mqtt.topic.alertMatrix.push
=
/tzs/tcb_alertMatrix
\ 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