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
11e0e1cd
Commit
11e0e1cd
authored
Jun 01, 2022
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指令实施推送消息
parent
e75182c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
PowerTransferCompanyController.java
...le/jcs/biz/controller/PowerTransferCompanyController.java
+15
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/PowerTransferCompanyController.java
View file @
11e0e1cd
...
@@ -6,13 +6,17 @@ import java.util.Objects;
...
@@ -6,13 +6,17 @@ import java.util.Objects;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.JcSituationDetail
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.JcSituationDetail
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper
;
import
com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper
;
import
com.yeejoin.amos.component.rule.config.RuleConfig
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
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.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
@@ -51,6 +55,12 @@ public class PowerTransferCompanyController extends BaseController {
...
@@ -51,6 +55,12 @@ public class PowerTransferCompanyController extends BaseController {
@Autowired
@Autowired
JcSituationDetailMapper
jcSituationDetailMapper
;
JcSituationDetailMapper
jcSituationDetailMapper
;
@Autowired
private
EmqKeeper
emqKeeper
;
@Value
(
"${mqtt.topic.command.power.deployment}"
)
private
String
topic
;
/**
/**
* 新增调派单位
* 新增调派单位
*
*
...
@@ -161,7 +171,7 @@ public class PowerTransferCompanyController extends BaseController {
...
@@ -161,7 +171,7 @@ public class PowerTransferCompanyController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/jcSituationDetail/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/jcSituationDetail/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增文字信息图片信息"
,
notes
=
"新增文字信息图片信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增文字信息图片信息"
,
notes
=
"新增文字信息图片信息"
)
public
ResponseModel
<
Boolean
>
saveJcSituationDetail
(
@RequestBody
JcSituationDetail
jcSituationDetail
)
{
public
ResponseModel
<
Boolean
>
saveJcSituationDetail
(
@RequestBody
JcSituationDetail
jcSituationDetail
)
throws
MqttException
{
if
(
Objects
.
isNull
(
jcSituationDetail
.
getAlertCalledId
()))
{
if
(
Objects
.
isNull
(
jcSituationDetail
.
getAlertCalledId
()))
{
throw
new
BadRequest
(
"警情ID不能为空"
);
throw
new
BadRequest
(
"警情ID不能为空"
);
}
}
...
@@ -169,6 +179,10 @@ public class PowerTransferCompanyController extends BaseController {
...
@@ -169,6 +179,10 @@ public class PowerTransferCompanyController extends BaseController {
// if (ObjectUtils.isNotEmpty(jcSituationDetail.getAttachments())) {
// if (ObjectUtils.isNotEmpty(jcSituationDetail.getAttachments())) {
// sourceFileService.saveAttachments(jcSituationDetail.getSequenceNbr(), jcSituationDetail.getAttachments());
// sourceFileService.saveAttachments(jcSituationDetail.getSequenceNbr(), jcSituationDetail.getAttachments());
// }
// }
// 自定义指令信息消息推送
// 定义指令信息消息推送 页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper
.
getMqttClient
().
publish
(
topic
,
"0"
.
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
return
ResponseHelper
.
buildResponse
(
Boolean
.
TRUE
);
return
ResponseHelper
.
buildResponse
(
Boolean
.
TRUE
);
}
}
...
...
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