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
8dcea44a
Commit
8dcea44a
authored
Aug 22, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 托盘信息维护开发
parent
face7351
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
140 additions
and
74 deletions
+140
-74
application-dev.yml
zhmes-agecal-admin/src/main/resources/application-dev.yml
+2
-2
application-prd.yml
zhmes-agecal-admin/src/main/resources/application-prd.yml
+1
-1
application-test.yml
zhmes-agecal-admin/src/main/resources/application-test.yml
+1
-1
TStoreyInfoMapper.java
...main/java/com/zehong/system/mapper/TStoreyInfoMapper.java
+4
-0
RobotArmCommandServiceImpl.java
...ehong/system/service/impl/RobotArmCommandServiceImpl.java
+13
-13
SysUserServiceImpl.java
...va/com/zehong/system/service/impl/SysUserServiceImpl.java
+0
-45
TStoreyInfoServiceImpl.java
...om/zehong/system/service/impl/TStoreyInfoServiceImpl.java
+88
-0
UdpCommandSender.java
...src/main/java/com/zehong/system/udp/UdpCommandSender.java
+2
-5
TStoreyInfoMapper.xml
...em/src/main/resources/mapper/system/TStoreyInfoMapper.xml
+21
-3
AgingLayer.vue
zhmes-agecal-web/src/views/screen/components/AgingLayer.vue
+0
-1
index.vue
zhmes-agecal-web/src/views/storey/index.vue
+8
-3
No files found.
zhmes-agecal-admin/src/main/resources/application-dev.yml
View file @
8dcea44a
...
...
@@ -109,5 +109,5 @@ netty:
robot
:
arm
:
udp
:
ip
:
1
92.168.2.14
port
:
6000
ip
:
1
27.0.0.1
port
:
6000
\ No newline at end of file
zhmes-agecal-admin/src/main/resources/application-prd.yml
View file @
8dcea44a
...
...
@@ -109,5 +109,5 @@ netty:
robot
:
arm
:
udp
:
ip
:
1
92.168.2.16
ip
:
1
27.0.0.1
port
:
6000
\ No newline at end of file
zhmes-agecal-admin/src/main/resources/application-test.yml
View file @
8dcea44a
...
...
@@ -106,5 +106,5 @@ netty:
robot
:
arm
:
udp
:
ip
:
1
92.168.2.16
ip
:
1
27.0.0.1
port
:
6000
\ No newline at end of file
zhmes-agecal-system/src/main/java/com/zehong/system/mapper/TStoreyInfoMapper.java
View file @
8dcea44a
...
...
@@ -40,6 +40,8 @@ public interface TStoreyInfoMapper
*/
public
List
<
TStoreyInfo
>
selectTStoreyInfoList
(
TStoreyInfo
tStoreyInfo
);
public
List
<
TStoreyInfo
>
selectByEquipmentIds
(
@Param
(
"list"
)
List
<
Long
>
fEquipmentIds
);
public
List
<
TStoreyInfo
>
queryByDepartmentId
(
Long
fEquipmentId
);
/**
...
...
@@ -60,6 +62,8 @@ public interface TStoreyInfoMapper
*/
public
int
updateTStoreyInfo
(
TStoreyInfo
tStoreyInfo
);
public
int
updateBatch
(
@Param
(
"storeyInfos"
)
List
<
TStoreyInfo
>
storeyInfos
);
/**
* 删除老化层信息
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/RobotArmCommandServiceImpl.java
View file @
8dcea44a
...
...
@@ -87,14 +87,15 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
List
<
RobotArmCommand
>
loadingCommands
=
robotArmCommandMapper
.
selectPendingLoadingCommands
();
if
(!
loadingCommands
.
isEmpty
())
{
boolean
[]
roboticArmEntryConveyorData
=
Modbus4jUtils
.
getRoboticArmEntryConveyorData
();
log
.
info
(
"机械臂入口 conveyor 0状态: "
+
roboticArmEntryConveyorData
[
0
]);
log
.
info
(
"机械臂入口 conveyor 1状态: "
+
roboticArmEntryConveyorData
[
1
]);
if
(
roboticArmEntryConveyorData
[
1
])
{
sendCommand
(
loadingCommands
.
get
(
0
),
"LOAD"
);
return
;
}
// 传送带检测先去掉
// boolean[] roboticArmEntryConveyorData = Modbus4jUtils.getRoboticArmEntryConveyorData();
// log.info("机械臂入口 conveyor 0状态: " + roboticArmEntryConveyorData[0]);
// log.info("机械臂入口 conveyor 1状态: " + roboticArmEntryConveyorData[1]);
// if(roboticArmEntryConveyorData[1]) {
// sendCommand(loadingCommands.get(0), "LOAD");
// return;
// }
sendCommand
(
loadingCommands
.
get
(
0
),
"LOAD"
);
}
// 2. 处理待执行的下料指令
...
...
@@ -123,10 +124,7 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
SocketAddress
address
=
getRobotAddress
();
udpCommandSender
.
sendCommandWithId
(
address
,
command
.
getRobotArmCommandId
(),
commandType
,
command
.
getTrayCode
(),
command
.
getStoreyCode
()
command
.
getCommand
()
);
// 注册指令跟踪
...
...
@@ -259,6 +257,8 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
throw
new
RuntimeException
(
"当前托盘正在执行指令"
);
}
TStoreyInfo
tStoreyInfo
=
storeyInfoMapper
.
selectNearestFreeStorey
();
robotArmCommand
.
setCommand
(
tStoreyInfo
.
getBlankingCommand
());
robotArmCommand
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
robotArmCommandMapper
.
insertRobotArmCommand
(
robotArmCommand
);
...
...
@@ -293,7 +293,7 @@ public class RobotArmCommandServiceImpl implements IRobotArmCommandService
if
(
tStoreyInfo
!=
null
)
{
robotArmCommand
.
setStatus
(
"1"
);
robotArmCommand
.
setStoreyCode
(
tStoreyInfo
.
getfStoreyCode
());
robotArmCommand
.
setCommand
(
tStoreyInfo
.
getFeedingCommand
());
tTrayInfo
.
setfStoreyCode
(
tStoreyInfo
.
getfStoreyCode
());
tTrayInfo
.
setfBindingTime
(
new
Date
());
tTrayInfoMapper
.
updateTTrayInfo
(
tTrayInfo
);
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/SysUserServiceImpl.java
View file @
8dcea44a
...
...
@@ -93,51 +93,6 @@ public class SysUserServiceImpl implements ISysUserService
@Override
public
SysUser
selectUserById
(
Long
userId
)
{
// List<TEquipmentInfo> equipmentInfos1 = equipmentInfoMapper.selectTEquipmentInfoList(new TEquipmentInfo());
// List<TStoreyInfo> tStoreyInfos = tStoreyInfoMapper.selectTStoreyInfoList(new TStoreyInfo());
//
// if (tStoreyInfos.size() < 16) {
// TStoreyInfo storeyInfo;
// List<TStoreyInfo> storeyInfoList = new ArrayList<>();
//
// for (TEquipmentInfo tEquipmentInfo : equipmentInfos1) {
// String ip = tEquipmentInfo.getfIp();
// if (ip == null || !ip.matches("\\d+\\.\\d+\\.\\d+\\.\\d+")) {
// continue;
// }
//
// String[] split = ip.split("\\.");
// if (split.length != 4) {
// continue;
// }
//
// try {
// int start = Integer.parseInt(split[3]) + 9; // 起始值(如IP最后一段为81,则start=90)
// String baseIp = split[0] + "." + split[1] + "." + split[2] + ".";
// int code = 1;
//
// // 核心修改:循环10次(i从start递减到start-9,共10个值)
// for (int i = start; i >= start - 9; i--) {
// storeyInfo = new TStoreyInfo();
// storeyInfo.setfEquipmentId(tEquipmentInfo.getfEquipmentId());
// storeyInfo.setfStoreyCode(tEquipmentInfo.getfEquipmentCode() + "-" + code);
// storeyInfo.setfIp(baseIp + i); // 生成IP:如192.168.2.90、192.168.2.89...192.168.2.81
// storeyInfo.setfPort("501,502,503");
// storeyInfo.setfStatus("0");
// storeyInfo.setfCreateTime(new Date());
// storeyInfoList.add(storeyInfo);
// code++;
// }
// } catch (NumberFormatException e) {
// continue;
// }
// }
//
// if (!storeyInfoList.isEmpty()) {
// tStoreyInfoMapper.insertBatch(storeyInfoList);
// }
// }
return
userMapper
.
selectUserById
(
userId
);
}
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/service/impl/TStoreyInfoServiceImpl.java
View file @
8dcea44a
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
com.zehong.common.utils.DateUtils
;
...
...
@@ -41,6 +44,91 @@ public class TStoreyInfoServiceImpl implements ITStoreyInfoService
return
tStoreyInfoMapper
.
selectTStoreyInfoById
(
fStoreyId
);
}
/**
* 更新南边指令
*/
private
void
updateNCommand
()
{
List
<
Long
>
equipmentIds
=
Arrays
.
asList
(
18L
,
19L
,
20L
,
21L
,
22L
,
23L
,
24L
,
25L
,
26L
,
27L
,
28L
,
29L
,
30L
,
31L
,
32L
);
List
<
TStoreyInfo
>
tStoreyInfos
=
tStoreyInfoMapper
.
selectByEquipmentIds
(
equipmentIds
);
if
(
tStoreyInfos
.
size
()
>
0
)
{
for
(
TStoreyInfo
tStoreyInfo
:
tStoreyInfos
)
{
String
s
=
tStoreyInfo
.
getfStoreyCode
();
Long
aLong
=
tStoreyInfo
.
getfEquipmentId
();
String
[]
split
=
s
.
split
(
"-"
);
String
feedingCommand
=
"NSL"
+
(
aLong
-
17L
)
+
split
[
1
];
String
blankingCommand
=
"NXL"
+
(
aLong
-
17L
)
+
split
[
1
];
tStoreyInfo
.
setFeedingCommand
(
feedingCommand
);
tStoreyInfo
.
setBlankingCommand
(
blankingCommand
);
}
tStoreyInfoMapper
.
updateBatch
(
tStoreyInfos
);
}
}
/**
* 更新北边指令
*/
private
void
updateBCommand
(){
List
<
Long
>
equipmentIds
=
Arrays
.
asList
(
3L
,
4L
,
5L
,
6L
,
7L
,
8L
,
9L
,
10L
,
11L
,
12L
,
13L
,
14L
,
15L
,
16L
,
17L
);
List
<
TStoreyInfo
>
tStoreyInfos
=
tStoreyInfoMapper
.
selectByEquipmentIds
(
equipmentIds
);
if
(
tStoreyInfos
.
size
()
>
0
)
{
for
(
TStoreyInfo
tStoreyInfo
:
tStoreyInfos
)
{
String
s
=
tStoreyInfo
.
getfStoreyCode
();
String
[]
split
=
s
.
split
(
"-"
);
String
feedingCommand
=
"BSL"
+
split
[
0
]
+
split
[
1
];
String
blankingCommand
=
"BXL"
+
split
[
0
]
+
split
[
1
];
tStoreyInfo
.
setFeedingCommand
(
feedingCommand
);
tStoreyInfo
.
setBlankingCommand
(
blankingCommand
);
}
tStoreyInfoMapper
.
updateBatch
(
tStoreyInfos
);
}
}
private
void
initStoreyInfo
()
{
List
<
TEquipmentInfo
>
equipmentInfos1
=
equipmentInfoMapper
.
selectTEquipmentInfoList
(
new
TEquipmentInfo
());
List
<
TStoreyInfo
>
tStoreyInfos
=
tStoreyInfoMapper
.
selectTStoreyInfoList
(
new
TStoreyInfo
());
if
(
tStoreyInfos
.
size
()
<
16
)
{
TStoreyInfo
storeyInfo
;
List
<
TStoreyInfo
>
storeyInfoList
=
new
ArrayList
<>();
for
(
TEquipmentInfo
tEquipmentInfo
:
equipmentInfos1
)
{
String
ip
=
tEquipmentInfo
.
getfIp
();
if
(
ip
==
null
||
!
ip
.
matches
(
"\\d+\\.\\d+\\.\\d+\\.\\d+"
))
{
continue
;
}
String
[]
split
=
ip
.
split
(
"\\."
);
if
(
split
.
length
!=
4
)
{
continue
;
}
try
{
int
start
=
Integer
.
parseInt
(
split
[
3
])
+
9
;
// 起始值(如IP最后一段为81,则start=90)
String
baseIp
=
split
[
0
]
+
"."
+
split
[
1
]
+
"."
+
split
[
2
]
+
"."
;
int
code
=
1
;
// 核心修改:循环10次(i从start递减到start-9,共10个值)
for
(
int
i
=
start
;
i
>=
start
-
9
;
i
--)
{
storeyInfo
=
new
TStoreyInfo
();
storeyInfo
.
setfEquipmentId
(
tEquipmentInfo
.
getfEquipmentId
());
storeyInfo
.
setfStoreyCode
(
tEquipmentInfo
.
getfEquipmentCode
()
+
"-"
+
code
);
storeyInfo
.
setfIp
(
baseIp
+
i
);
// 生成IP:如192.168.2.90、192.168.2.89...192.168.2.81
storeyInfo
.
setfPort
(
"501,502,503"
);
storeyInfo
.
setfStatus
(
"0"
);
storeyInfo
.
setfCreateTime
(
new
Date
());
storeyInfoList
.
add
(
storeyInfo
);
code
++;
}
}
catch
(
NumberFormatException
e
)
{
continue
;
}
}
if
(!
storeyInfoList
.
isEmpty
())
{
tStoreyInfoMapper
.
insertBatch
(
storeyInfoList
);
}
}
}
/**
* 查询老化层信息
*
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/udp/UdpCommandSender.java
View file @
8dcea44a
...
...
@@ -70,11 +70,8 @@ public class UdpCommandSender {
/**
* 发送带指令ID的命令
*/
public
void
sendCommandWithId
(
SocketAddress
address
,
Long
commandId
,
String
commandType
,
String
trayCode
,
String
storeyCode
)
{
String
message
=
String
.
format
(
"CMD_ID:%d#%s#%s#%s"
,
commandId
,
commandType
,
trayCode
,
storeyCode
);
sendCommand
(
address
,
message
);
public
void
sendCommandWithId
(
SocketAddress
address
,
String
command
)
{
sendCommand
(
address
,
command
);
}
public
void
sendCommandThrowError
(
String
message
)
throws
IOException
{
...
...
zhmes-agecal-system/src/main/resources/mapper/system/TStoreyInfoMapper.xml
View file @
8dcea44a
...
...
@@ -42,6 +42,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join t_equipment_info equipmentInfo on storeyInfo.f_equipment_id = equipmentInfo.f_equipment_id
</sql>
<select
id=
"selectByEquipmentIds"
parameterType=
"list"
resultMap=
"TStoreyInfoResult"
>
<include
refid=
"selectTStoreyInfoVo"
/>
where storeyInfo.f_equipment_id in
<foreach
item=
"item"
collection=
"list"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
<select
id=
"selectTStoreyInfoList"
parameterType=
"TStoreyInfo"
resultMap=
"TStoreyInfoResult"
>
<include
refid=
"selectTStoreyInfoVo"
/>
<where>
...
...
@@ -73,13 +81,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectNearestFreeStorey"
resultMap=
"TStoreyInfoResult"
>
SELECT
f_storey_id, f_equipment_id, f_storey_code, f_ip, f_status, f_port,
f_aging_start_time, f_update_time, f_create_time, f_alarm_time
l
, f_blanking_command, f_feeding_command
f_aging_start_time, f_update_time, f_create_time, f_alarm_time, f_blanking_command, f_feeding_command
FROM (
SELECT
*,
CASE
WHEN cabinet_num BETWEEN 1 AND 1
8
THEN (cabinet_num - 1) * 10 + layer_num
WHEN cabinet_num BETWEEN 1
9 AND 36 THEN (cabinet_num - 19
) * 10 + layer_num
WHEN cabinet_num BETWEEN 1 AND 1
5
THEN (cabinet_num - 1) * 10 + layer_num
WHEN cabinet_num BETWEEN 1
6 AND 36 THEN (cabinet_num - 16
) * 10 + layer_num
END AS distance
FROM (
SELECT
...
...
@@ -131,6 +139,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update
id=
"updateBatch"
parameterType=
"list"
>
<foreach
collection=
"storeyInfos"
item=
"item"
index=
"index"
separator=
";"
>
update t_storey_info
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"item.blankingCommand != null"
>
f_blanking_command = #{item.blankingCommand},
</if>
<if
test=
"item.feedingCommand != null"
>
f_feeding_command = #{item.feedingCommand},
</if>
</trim>
where f_storey_id = #{item.fStoreyId}
</foreach>
</update>
<update
id=
"updateTStoreyInfo"
parameterType=
"TStoreyInfo"
>
update t_storey_info
<trim
prefix=
"SET"
suffixOverrides=
","
>
...
...
zhmes-agecal-web/src/views/screen/components/AgingLayer.vue
View file @
8dcea44a
...
...
@@ -244,7 +244,6 @@ export default {
loadTray
()
{
this
.
$message
.
success
(
"下料操作已执行"
);
const
robotArmCommand
=
{
trayCode
:
this
.
trayInfo
.
fTrayCode
,
storeyCode
:
this
.
trayInfo
.
storeyCode
,
...
...
zhmes-agecal-web/src/views/storey/index.vue
View file @
8dcea44a
...
...
@@ -64,9 +64,14 @@
<el-table-column
label=
"端口号"
align=
"center"
prop=
"fPort"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"fStatus"
>
<template
slot-scope=
"scope"
>
<el-tag
v-if =
"scope.row.fStatus === '0'"
>
空闲
</el-tag>
<el-tag
v-else-if =
"scope.row.fStatus === '1'"
>
故障
</el-tag>
<el-tag
v-else-if =
"scope.row.fStatus === '2'"
>
断电
</el-tag>
<!-- 空闲状态 - 灰色(info) -->
<el-tag
type=
"info"
v-if=
"scope.row.fStatus === '0'"
>
空闲
</el-tag>
<!-- 运行状态 - 绿色(success) -->
<el-tag
type=
"success"
v-else-if=
"scope.row.fStatus === '1'"
>
运行
</el-tag>
<!-- 故障状态 - 红色(danger) -->
<el-tag
type=
"danger"
v-else-if=
"scope.row.fStatus === '2'"
>
故障
</el-tag>
<!-- 断电状态 - 橙色(warning) -->
<el-tag
type=
"warning"
v-else-if=
"scope.row.fStatus === '3'"
>
断电
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"报警时间"
align=
"center"
prop=
"fAlarmTime"
width=
"180"
>
...
...
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