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
3075ac2d
Commit
3075ac2d
authored
Oct 15, 2025
by
gdj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
智测型号放行
parent
55a407c7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
sample/src/main/java/com/dji/sample/common/util/DeviceUtil.java
+33
-0
sample/src/main/java/com/dji/sample/control/service/impl/ControlServiceImpl.java
+8
-0
sample/src/main/java/com/dji/sample/control/service/impl/PayloadCommandsHandler.java
+6
-0
No files found.
sample/src/main/java/com/dji/sample/common/util/DeviceUtil.java
0 → 100644
View file @
3075ac2d
package
com
.
dji
.
sample
.
common
.
util
;
import
org.springframework.util.StringUtils
;
import
static
com
.
dji
.
sample
.
common
.
constant
.
DeviceConstant
.
CUSTOM_DOCK_LIST
;
import
static
com
.
dji
.
sample
.
common
.
constant
.
DeviceConstant
.
CUSTOM_DOCK_START
;
/**
* 设备常用工具类
* @author guan
*/
public
class
DeviceUtil
{
/**
* 是否智测系列设备
* @param dockSn
* @return
*/
public
static
boolean
isCustomDevice
(
String
dockSn
)
{
if
(!
StringUtils
.
hasText
(
dockSn
))
{
return
false
;
}
if
(
dockSn
.
startsWith
(
CUSTOM_DOCK_START
))
{
return
true
;
}
if
(
CUSTOM_DOCK_LIST
.
contains
(
dockSn
)
||
dockSn
.
contains
(
"12345"
))
{
return
true
;
}
return
false
;
}
}
sample/src/main/java/com/dji/sample/control/service/impl/ControlServiceImpl.java
View file @
3075ac2d
...
@@ -41,6 +41,8 @@ import java.util.Objects;
...
@@ -41,6 +41,8 @@ import java.util.Objects;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.UUID
;
import
java.util.UUID
;
import
static
com
.
dji
.
sample
.
common
.
util
.
DeviceUtil
.
isCustomDevice
;
/**
/**
* @author sean
* @author sean
* @version 1.2
* @version 1.2
...
@@ -120,6 +122,9 @@ public class ControlServiceImpl implements IControlService {
...
@@ -120,6 +122,9 @@ public class ControlServiceImpl implements IControlService {
}
}
private
void
checkFlyToCondition
(
String
dockSn
)
{
private
void
checkFlyToCondition
(
String
dockSn
)
{
if
(
isCustomDevice
(
dockSn
))
{
return
;
}
// TODO 设备固件版本不兼容情况
// TODO 设备固件版本不兼容情况
Optional
<
DeviceDTO
>
dockOpt
=
deviceRedisService
.
getDeviceOnline
(
dockSn
);
Optional
<
DeviceDTO
>
dockOpt
=
deviceRedisService
.
getDeviceOnline
(
dockSn
);
if
(
dockOpt
.
isEmpty
())
{
if
(
dockOpt
.
isEmpty
())
{
...
@@ -165,6 +170,9 @@ public class ControlServiceImpl implements IControlService {
...
@@ -165,6 +170,9 @@ public class ControlServiceImpl implements IControlService {
}
}
private
void
checkTakeoffCondition
(
String
dockSn
)
{
private
void
checkTakeoffCondition
(
String
dockSn
)
{
if
(
isCustomDevice
(
dockSn
))
{
return
;
}
Optional
<
DeviceDTO
>
dockOpt
=
deviceRedisService
.
getDeviceOnline
(
dockSn
);
Optional
<
DeviceDTO
>
dockOpt
=
deviceRedisService
.
getDeviceOnline
(
dockSn
);
if
(
dockOpt
.
isEmpty
()
||
DockModeCodeEnum
.
IDLE
!=
deviceService
.
getDockMode
(
dockSn
))
{
if
(
dockOpt
.
isEmpty
()
||
DockModeCodeEnum
.
IDLE
!=
deviceService
.
getDockMode
(
dockSn
))
{
throw
new
RuntimeException
(
"The current state does not support takeoff."
);
throw
new
RuntimeException
(
"The current state does not support takeoff."
);
...
...
sample/src/main/java/com/dji/sample/control/service/impl/PayloadCommandsHandler.java
View file @
3075ac2d
...
@@ -10,6 +10,8 @@ import com.dji.sdk.cloudapi.device.OsdDockDrone;
...
@@ -10,6 +10,8 @@ import com.dji.sdk.cloudapi.device.OsdDockDrone;
import
java.util.Optional
;
import
java.util.Optional
;
import
static
com
.
dji
.
sample
.
common
.
util
.
DeviceUtil
.
isCustomDevice
;
/**
/**
* @author sean
* @author sean
* @version 1.4
* @version 1.4
...
@@ -69,6 +71,10 @@ public abstract class PayloadCommandsHandler {
...
@@ -69,6 +71,10 @@ public abstract class PayloadCommandsHandler {
if
(!
valid
())
{
if
(!
valid
())
{
throw
new
RuntimeException
(
"illegal argument"
);
throw
new
RuntimeException
(
"illegal argument"
);
}
}
// 智测放行
if
(
isCustomDevice
(
dockSn
))
{
return
;
}
String
deviceSn
=
checkDockOnline
(
dockSn
);
String
deviceSn
=
checkDockOnline
(
dockSn
);
checkDeviceOnline
(
deviceSn
);
checkDeviceOnline
(
deviceSn
);
...
...
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