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
87bce0ed
Commit
87bce0ed
authored
Aug 26, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加车辆附加信息
parent
837e7a74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
+31
-5
CommandController.java
...boot/module/command/biz/controller/CommandController.java
+31
-5
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-command-biz/src/main/java/com/yeejoin/amos/boot/module/command/biz/controller/CommandController.java
View file @
87bce0ed
...
@@ -1737,17 +1737,43 @@ public class CommandController extends BaseController {
...
@@ -1737,17 +1737,43 @@ public class CommandController extends BaseController {
public
ResponseModel
<
Object
>
addESCar
(
@RequestBody
ESCar
esCar
)
{
public
ResponseModel
<
Object
>
addESCar
(
@RequestBody
ESCar
esCar
)
{
try
{
try
{
Date
date
=
new
Date
();
Date
date
1
=
new
Date
();
esCar
.
setTime
(
date
.
getTime
());
esCar
.
setTime
(
date
1
.
getTime
());
esCarService
.
saveESCar
(
esCar
);
esCarService
.
saveESCar
(
esCar
);
//给App端发送
//给App端发送
// TODO
// TODO
//给WEB端发送 前端传递的为高德经纬度 需转换为WGS84
//给WEB端发送 前端传递的为高德经纬度 需转换为WGS84
Gps
gps
=
PositionUtil
.
gcj02_To_Gps84
(
Double
.
valueOf
(
esCar
.
getLatitude
()),
Double
.
valueOf
(
esCar
.
getLongitude
()));
Gps
gps
=
PositionUtil
.
gcj02_To_Gps84
(
Double
.
valueOf
(
esCar
.
getLatitude
()),
Double
.
valueOf
(
esCar
.
getLongitude
()));
esCar
.
setLatitude
(
String
.
valueOf
(
gps
.
getWgLat
()));
// esCar.setLatitude(String.valueOf(gps.getWgLat()));
esCar
.
setLongitude
(
String
.
valueOf
(
gps
.
getWgLon
()));
// esCar.setLongitude(String.valueOf(gps.getWgLon()));
emqKeeper
.
getMqttClient
().
publish
(
topic
,
esCar
.
toString
().
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
date
=
equipFeignClient
.
getTeamCarList
(
esCar
.
getSequenceNbr
().
toString
(),
null
,
null
);
List
<
Map
<
String
,
Object
>>
result
=
date
.
getResult
();
QueryWrapper
<
PowerTransferCompanyResources
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"status"
,
FireCarStatusEnum
.
执行中
.
getCode
());
List
<
PowerTransferCompanyResources
>
alertFormValue
=
powerTransferCompanyResourcesMapper
.
selectList
(
queryWrapper
);
if
(
result
!=
null
){
result
.
stream
().
forEach
(
e
->
{
if
(
e
.
get
(
"carState"
).
equals
(
"在位"
))
{
e
.
put
(
"carState"
,
FireCarStatusEnum
.
执勤
.
getName
());
}
String
sequenceNbr
=
e
.
get
(
"sequenceNbr"
).
toString
();
//同步力量调派车辆任务状态
alertFormValue
.
stream
().
forEach
(
v
->
{
if
(
v
.
getResourcesId
().
equals
(
sequenceNbr
))
{
String
carStatus
=
v
.
getCarStatus
();
e
.
put
(
"carState"
,
carStatus
!=
null
?
FireCarStatusEnum
.
getEnum
(
carStatus
).
getName
()
:
null
);
}
});
e
.
put
(
"latitude"
,
String
.
valueOf
(
gps
.
getWgLat
()));
e
.
put
(
"longitude"
,
String
.
valueOf
(
gps
.
getWgLon
()));
});
emqKeeper
.
getMqttClient
().
publish
(
topic
,
result
.
toString
().
getBytes
(),
RuleConfig
.
DEFAULT_QOS
,
false
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
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