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
903d93b7
Commit
903d93b7
authored
Nov 06, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 上料时 先判断 托盘是否绑定了设备
parent
6cf1eae8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
8 deletions
+22
-8
PalletDeviceBindingMapper.java
...a/com/zehong/system/mapper/PalletDeviceBindingMapper.java
+2
-0
NettyUdpServerHandler.java
...om/zehong/system/netty/handler/NettyUdpServerHandler.java
+2
-2
RobotArmCommandServiceImpl.java
...ehong/system/service/impl/RobotArmCommandServiceImpl.java
+12
-6
AllCommandHandler.java
...c/main/java/com/zehong/system/task/AllCommandHandler.java
+2
-0
PalletDeviceBindingMapper.xml
...ain/resources/mapper/system/PalletDeviceBindingMapper.xml
+4
-0
No files found.
zhmes-agecal-system/src/main/java/com/zehong/system/mapper/PalletDeviceBindingMapper.java
View file @
903d93b7
...
...
@@ -40,6 +40,8 @@ public interface PalletDeviceBindingMapper
public
int
countErrorByTrayId
(
Long
trayId
);
public
int
countByTrayId
(
Long
trayId
);
/**
* 新增托盘绑定的设备列
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/netty/handler/NettyUdpServerHandler.java
View file @
903d93b7
...
...
@@ -104,7 +104,7 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP
if
(
status
!=
null
)
{
// 处理状态消息
processStatusMessage
(
status
,
packet
.
sender
()
);
processStatusMessage
(
status
);
// 检查是否为完全空闲状态
if
(
status
.
isFullyIdle
())
{
...
...
@@ -148,7 +148,7 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP
}
}
private
void
processStatusMessage
(
RobotArmMessageParser
.
RobotArmStatus
status
,
SocketAddress
sender
)
{
private
void
processStatusMessage
(
RobotArmMessageParser
.
RobotArmStatus
status
)
{
// 更新前端状态
if
(
status
.
isBusy
())
{
sendStatusToWebSocket
(
"running"
);
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/RobotArmCommandServiceImpl.java
View file @
903d93b7
...
...
@@ -16,9 +16,7 @@ import com.zehong.common.utils.StringUtils;
import
com.zehong.system.domain.TEquipmentInfo
;
import
com.zehong.system.domain.TStoreyInfo
;
import
com.zehong.system.domain.TTrayInfo
;
import
com.zehong.system.mapper.TEquipmentInfoMapper
;
import
com.zehong.system.mapper.TStoreyInfoMapper
;
import
com.zehong.system.mapper.TTrayInfoMapper
;
import
com.zehong.system.mapper.*
;
import
com.zehong.system.modbus.util.Modbus4jUtils
;
import
com.zehong.system.netty.handler.NettyUdpServerHandler
;
import
com.zehong.system.service.websocket.RobotArmWebSocketHandler
;
...
...
@@ -30,7 +28,6 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.RobotArmCommandMapper
;
import
com.zehong.system.domain.RobotArmCommand
;
import
com.zehong.system.service.IRobotArmCommandService
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -76,6 +73,9 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
@Resource
private
ApplicationEventPublisher
eventPublisher
;
// 新增事件发布器
@Resource
private
PalletDeviceBindingMapper
palletDeviceBindingMapper
;
private
SocketAddress
getRobotAddress
()
{
try
{
return
new
InetSocketAddress
(
...
...
@@ -218,8 +218,8 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
try
{
String
storeyCode
=
command
.
getStoreyCode
();
String
equitmentCode
=
""
;
Integer
registerOffset
=
null
;
String
equitmentCode
;
Integer
registerOffset
;
if
(
storeyCode
.
contains
(
"-"
))
{
log
.
info
(
"storeyCode.contains(\"-\")"
);
String
[]
parts
=
storeyCode
.
split
(
"-"
);
...
...
@@ -364,6 +364,12 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
throw
new
RuntimeException
(
"托盘不存在"
);
}
// 看看 此托盘绑定了数据了吗?
int
i1
=
palletDeviceBindingMapper
.
countByTrayId
(
tTrayInfo
.
getfTrayId
());
if
(
i1
==
0
)
{
throw
new
RuntimeException
(
"托盘未绑定设备"
);
}
// 20251104 上料 不需要看托盘状态了
// if(!"0".equals(tTrayInfo.getfStatus())) {
// throw new RuntimeException("托盘未解绑,请联系管理员");
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/task/AllCommandHandler.java
View file @
903d93b7
...
...
@@ -123,6 +123,8 @@ public class AllCommandHandler {
tStoreyInfo
.
setfStoreyCode
(
tStoreyInfo
.
getfStoreyCode
());
tStoreyInfo
.
setUpdateTime
(
new
Date
());
tStoreyInfo
.
setfStatus
(
"0"
);
tStoreyInfo
.
setfAgingStartTime
(
null
);
tStoreyInfo
.
setfAgingEndTime
(
null
);
tStoreyInfoMapper
.
unbindByCode
(
tStoreyInfo
);
// 清理 托盘 和 层的关联关系
...
...
zhmes-agecal-system/src/main/resources/mapper/system/PalletDeviceBindingMapper.xml
View file @
903d93b7
...
...
@@ -57,6 +57,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where palDeviceBinding.f_tray_id = #{trayId}
and (palDeviceBinding.f_status = '0' or palDeviceBinding.f_status = '5')
</select>
<select
id=
"countByTrayId"
parameterType=
"Long"
resultType=
"int"
>
select count(1) from t_pallet_device_binding palDeviceBinding
where palDeviceBinding.f_tray_id = #{trayId}
</select>
<select
id=
"selectPalletDeviceBindingList"
parameterType=
"PalletDeviceBinding"
resultMap=
"PalletDeviceBindingResult"
>
<include
refid=
"selectPalletDeviceBindingVo"
/>
<where>
...
...
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