Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeoFlyApi
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GeoFly
GeoFlyApi
Commits
00dec344
Commit
00dec344
authored
Apr 29, 2025
by
gdj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新建机场时,自动更新没有workspaceId的空机场。
parent
1decbaa7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletions
+26
-1
sample/src/main/java/com/dji/sample/manage/service/impl/DeviceServiceImpl.java
+26
-1
No files found.
sample/src/main/java/com/dji/sample/manage/service/impl/DeviceServiceImpl.java
View file @
00dec344
...
...
@@ -758,7 +758,30 @@ public class DeviceServiceImpl implements IDeviceService {
// sn码不重复
List
<
DeviceEntity
>
dbDroneList
=
mapper
.
selectList
(
new
LambdaQueryWrapper
<
DeviceEntity
>().
eq
(
DeviceEntity:
:
getDeviceSn
,
droneDeviceSn
));
if
(!
CollectionUtils
.
isEmpty
(
dbDroneList
))
{
throw
new
RuntimeException
(
"droneSn is already exit"
);
if
(
dbDroneList
.
size
()
!=
1
)
{
throw
new
RuntimeException
(
"droneSn is already exit"
);
}
DeviceEntity
dbDrone
=
dbDroneList
.
get
(
0
);
// throw new RuntimeException("droneSn is already exit");
if
(
StringUtils
.
hasText
(
dbDrone
.
getWorkspaceId
()))
{
throw
new
RuntimeException
(
"droneSn is already exit"
);
}
// 修改当前无人机数据
DeviceEntity
updateDrone
=
new
DeviceEntity
();
updateDrone
.
setId
(
dbDrone
.
getId
());
updateDrone
.
setWorkspaceId
(
drone
.
getWorkspaceId
());
updateDrone
.
setNickname
(
drone
.
getNickname
());
deviceEntity
.
setDeviceName
(
drone
.
getDeviceName
());
// 类型
updateDrone
.
setDomain
(
DeviceDomainEnum
.
DRONE
.
getDomain
());
updateDrone
.
setDeviceType
(
drone
.
getType
().
getType
());
updateDrone
.
setSubType
(
drone
.
getSubType
().
getSubType
());
updateDrone
.
setBoundStatus
(
true
);
updateDrone
.
setBoundTime
(
System
.
currentTimeMillis
());
int
update
=
this
.
mapper
.
updateById
(
updateDrone
);
return
update
>
0
;
}
}
...
...
@@ -786,6 +809,8 @@ public class DeviceServiceImpl implements IDeviceService {
// bound_time bigint
// bound_status The status when the device is bound to the workspace. 1: bound; 0: not bound;
deviceEntity
.
setBoundStatus
(
true
);
deviceEntity
.
setBoundTime
(
System
.
currentTimeMillis
());
// deviceEntity.setDeviceDesc(drone.getDeviceDesc());
// url_normal The icon displayed on the remote control.
// url_select The icon displayed on the remote control when it is selected.
...
...
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