Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zhmes-agecal
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
耿迪迪
zhmes-agecal
Commits
b89df233
Commit
b89df233
authored
Sep 23, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1测试上电断电操作
parent
ae52307a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
0 deletions
+27
-0
RobotArmCommandMapper.java
.../java/com/zehong/system/mapper/RobotArmCommandMapper.java
+2
-0
NettyUdpServerHandler.java
...om/zehong/system/netty/handler/NettyUdpServerHandler.java
+14
-0
IRobotArmCommandService.java
...va/com/zehong/system/service/IRobotArmCommandService.java
+2
-0
RobotArmCommandServiceImpl.java
...ehong/system/service/impl/RobotArmCommandServiceImpl.java
+5
-0
RobotArmCommandMapper.xml
...rc/main/resources/mapper/system/RobotArmCommandMapper.xml
+4
-0
No files found.
zhmes-agecal-system/src/main/java/com/zehong/system/mapper/RobotArmCommandMapper.java
View file @
b89df233
...
...
@@ -35,6 +35,8 @@ public interface RobotArmCommandMapper
*/
public
List
<
RobotArmCommand
>
selectRobotArmCommandList
(
RobotArmCommand
robotArmCommand
);
public
List
<
RobotArmCommand
>
selectTopRunningRobotArmCommands
();
public
List
<
RobotArmCommand
>
findByType
(
String
type
);
/**
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/netty/handler/NettyUdpServerHandler.java
View file @
b89df233
package
com
.
zehong
.
system
.
netty
.
handler
;
import
com.zehong.system.domain.RobotArmCommand
;
import
com.zehong.system.service.IRobotArmCommandService
;
import
com.zehong.system.service.websocket.RobotArmWebSocketHandler
;
import
com.zehong.system.udp.RobotArmMessageParser
;
...
...
@@ -19,6 +20,7 @@ import java.net.SocketAddress;
import
java.nio.charset.StandardCharsets
;
import
java.text.SimpleDateFormat
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.locks.ReentrantLock
;
...
...
@@ -43,6 +45,8 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP
private
static
final
SimpleDateFormat
TIME_FORMATTER
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
private
volatile
long
lastActivityTime
=
System
.
currentTimeMillis
();
@Resource
private
NettyUdpServerHandler
nettyUdpServerHandler
;
/**
* 当前正在处理的指令信息
*/
...
...
@@ -142,6 +146,16 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP
status
.
getX
(),
status
.
getY
(),
status
.
getZ
(),
status
.
getR
());
CommandExecution
execution
=
currentCommands
.
get
(
"127.0.0.1"
);
// 如果指令追踪为空,则可能是 刚启动,再去 查一下有没有正在执行的任务
if
(
execution
==
null
)
{
List
<
RobotArmCommand
>
robotArmCommands
=
robotArmCommandService
.
selectTopRunningRobotArmCommands
();
if
(
robotArmCommands
!=
null
&&
!
robotArmCommands
.
isEmpty
())
{
// 注册指令跟踪
execution
=
new
CommandExecution
();
execution
.
commandId
=
robotArmCommands
.
get
(
0
).
getRobotArmCommandId
();
}
}
if
(
execution
!=
null
)
{
robotArmCommandService
.
completeCommand
(
execution
.
commandId
);
currentCommands
.
remove
(
"127.0.0.1"
);
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/IRobotArmCommandService.java
View file @
b89df233
...
...
@@ -27,6 +27,8 @@ public interface IRobotArmCommandService
*/
public
List
<
RobotArmCommand
>
selectRobotArmCommandList
(
RobotArmCommand
robotArmCommand
);
public
List
<
RobotArmCommand
>
selectTopRunningRobotArmCommands
();
public
List
<
RobotArmCommand
>
findByType
(
String
type
);
public
int
insertBlankingRobotArmCommand
(
RobotArmCommand
robotArmCommand
);
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/RobotArmCommandServiceImpl.java
View file @
b89df233
...
...
@@ -305,6 +305,11 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
return
robotArmCommandMapper
.
selectRobotArmCommandList
(
robotArmCommand
);
}
@Override
public
List
<
RobotArmCommand
>
selectTopRunningRobotArmCommands
()
{
return
robotArmCommandMapper
.
selectTopRunningRobotArmCommands
();
}
@Override
public
List
<
RobotArmCommand
>
findByType
(
String
type
)
{
return
robotArmCommandMapper
.
findByType
(
type
);
...
...
zhmes-agecal-system/src/main/resources/mapper/system/RobotArmCommandMapper.xml
View file @
b89df233
...
...
@@ -46,6 +46,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createTime != null "
>
and f_create_time = #{createTime}
</if>
</where>
</select>
<select
id=
"selectTopRunningRobotArmCommands"
resultMap=
"RobotArmCommandResult"
>
<include
refid=
"selectRobotArmCommandVo"
/>
where f_status = '2'
</select>
<select
id=
"selectRobotArmCommandById"
parameterType=
"Long"
resultMap=
"RobotArmCommandResult"
>
<include
refid=
"selectRobotArmCommandVo"
/>
...
...
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