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
0d55f2f8
Commit
0d55f2f8
authored
Sep 29, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新电梯推送主屏接口
parent
f931ef1e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
2 deletions
+55
-2
ElevatorController.java
...os/boot/module/tzs/biz/controller/ElevatorController.java
+51
-0
application-dev.properties
...-system-tzs/src/main/resources/application-dev.properties
+4
-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/ElevatorController.java
View file @
0d55f2f8
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.feign.AmosFeignService
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
...
...
@@ -13,6 +15,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorMaintenanceInfoDto;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorNewDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorTestInfoDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.EsElevatorDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Elevator
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.MaintainInfo
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.TestInfo
;
...
...
@@ -22,19 +25,23 @@ import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.MaintainInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.TestInfoServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
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.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
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.Bean
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
...
@@ -42,6 +49,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.io.UnsupportedEncodingException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
...
...
@@ -77,6 +85,12 @@ public class ElevatorController extends BaseController {
@Autowired
ESElevatorServiceImpl
esElevatorService
;
@Autowired
private
EmqKeeper
emqKeeper
;
@Value
(
"${mqtt.topic.elevator.push}"
)
private
String
elevatorpushTopic
;
/**
* 新增电梯
*
...
...
@@ -382,5 +396,42 @@ public class ElevatorController extends BaseController {
List
<
EsElevatorDto
>
page
=
esElevatorService
.
queryByKeys
(
elevatorDto
);
return
ResponseHelper
.
buildResponse
(
page
);
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr sequenceNbr
* @return 返回结果
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/pushInfo/{sequenceNbr}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据电梯id 给主屏推送电梯信息"
,
notes
=
"根据电梯id 给主屏推送电梯信息"
)
public
ResponseModel
<
Boolean
>
pushElevatorInfo
(
@PathVariable
Long
sequenceNbr
)
{
ElevatorDto
elevator
=
elevatorService
.
selectBySeq
(
sequenceNbr
);
AgencyUserModel
user
=
getUserInfo
();
// 推送经纬度 人员姓名 电话 警情id
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
user
.
getUserId
());
jsonObject
.
put
(
"elevatorId"
,
elevator
.
getSequenceNbr
());
jsonObject
.
put
(
"rescueCode"
,
elevator
.
getRescueCode
());
jsonObject
.
put
(
"registerCode"
,
elevator
.
getRegisterCode
());
jsonObject
.
put
(
"address"
,
elevator
.
getAddress
());
jsonObject
.
put
(
"useUnit"
,
elevator
.
getUseUnit
());
jsonObject
.
put
(
"useStatus"
,
elevator
.
getUseStatus
());
jsonObject
.
put
(
"useSiteCategory"
,
elevator
.
getUseSiteCategory
());
jsonObject
.
put
(
"city"
,
elevator
.
getCity
());
jsonObject
.
put
(
"district"
,
elevator
.
getDistrict
());
try
{
emqKeeper
.
getMqttClient
().
publish
(
elevatorpushTopic
,
jsonObject
.
toString
().
getBytes
(
"UTF-8"
),
1
,
false
);
}
catch
(
MqttException
e
)
{
logger
.
error
(
"mqtt发送失败"
+
jsonObject
);
}
catch
(
UnsupportedEncodingException
e
)
{
logger
.
error
(
"mqtt发送失败"
+
jsonObject
);
}
return
ResponseHelper
.
buildResponse
(
true
);
}
}
amos-boot-system-tzs/src/main/resources/application-dev.properties
View file @
0d55f2f8
...
...
@@ -60,4 +60,6 @@ tzs.wechat.tempId.ts=SLjmNJoCNLC3FBcYzWzR-u3el0kqXf8WMTmzw8dAQm4
tzs.wechat.url.ts
=
tzs.yeeamos.com/persondetail.html
mqtt.topic.task.personinfo
=
tzs-task-personinfo
\ No newline at end of file
mqtt.topic.task.personinfo
=
tzs-task-personinfo
mqtt.topic.elevator.push
=
/tzs/tcb_elevator
\ 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