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
fc08911c
Commit
fc08911c
authored
Sep 25, 2025
by
wanghao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 指令指令完成,但是 没有检测到机械臂完成。
parent
56478f97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
6 deletions
+32
-6
BaseDeviceCommJob.java
...m/zehong/system/task/DeviceCommJob/BaseDeviceCommJob.java
+28
-2
DeviceTaskScheduler.java
...main/java/com/zehong/system/task/DeviceTaskScheduler.java
+4
-4
No files found.
zhmes-agecal-system/src/main/java/com/zehong/system/task/DeviceCommJob/BaseDeviceCommJob.java
View file @
fc08911c
...
...
@@ -86,6 +86,16 @@ public abstract class BaseDeviceCommJob implements Job {
// -------------------------- 核心执行逻辑(单设备直连,无冗余步骤) --------------------------
@Override
public
void
execute
(
JobExecutionContext
context
)
{
// 新增:校验依赖是否为null
log
.
info
(
"=== 依赖注入校验 ==="
);
log
.
info
(
"modbusMasterPool: {}"
,
modbusMasterPool
==
null
?
"NULL"
:
"OK"
);
log
.
info
(
"scheduler: {}"
,
scheduler
==
null
?
"NULL"
:
"OK"
);
log
.
info
(
"palletDeviceBindingMapper: {}"
,
palletDeviceBindingMapper
==
null
?
"NULL"
:
"OK"
);
log
.
info
(
"alarmDataService: {}"
,
alarmDataService
==
null
?
"NULL"
:
"OK"
);
log
.
info
(
"tStoreyInfoMapper: {}"
,
tStoreyInfoMapper
==
null
?
"NULL"
:
"OK"
);
log
.
info
(
"resultHandler: {}"
,
resultHandler
==
null
?
"NULL"
:
"OK"
);
long
taskStartTime
=
System
.
currentTimeMillis
();
String
storeyIdStr
=
getStoreyIdFromContext
(
context
);
// 单设备场景:直接获取唯一deviceId(子类返回的List仅1个元素)
...
...
@@ -347,9 +357,25 @@ public abstract class BaseDeviceCommJob implements Job {
*/
private
String
getStoreyIdFromContext
(
JobExecutionContext
context
)
{
try
{
return
context
.
getJobDetail
().
getJobDataMap
().
getString
(
"fStoreyId"
);
if
(
context
==
null
)
{
log
.
error
(
"getStoreyIdFromContext:context为null"
);
return
"unknown"
;
}
JobDetail
jobDetail
=
context
.
getJobDetail
();
if
(
jobDetail
==
null
)
{
log
.
error
(
"getStoreyIdFromContext:jobDetail为null"
);
return
"unknown"
;
}
JobDataMap
dataMap
=
jobDetail
.
getJobDataMap
();
if
(
dataMap
==
null
)
{
log
.
error
(
"getStoreyIdFromContext:dataMap为null"
);
return
"unknown"
;
}
String
storeyId
=
dataMap
.
getString
(
"fStoreyId"
);
log
.
info
(
"getStoreyIdFromContext:获取到storeyId={}"
,
storeyId
);
return
storeyId
;
}
catch
(
Exception
e
)
{
log
.
info
(
"获取storeyId失败
"
,
e
);
log
.
error
(
"getStoreyIdFromContext异常:
"
,
e
);
return
"unknown"
;
}
}
...
...
zhmes-agecal-system/src/main/java/com/zehong/system/task/DeviceTaskScheduler.java
View file @
fc08911c
...
...
@@ -31,10 +31,10 @@ public class DeviceTaskScheduler {
private
static
final
String
JOB_GROUP
=
"DEVICE_TASKS"
;
// 触发器组名(统一固定,与原有逻辑保持一致)
private
static
final
String
TRIGGER_GROUP
=
"DEVICE_TRIGGERS"
;
@PostConstruct
public
void
init
()
throws
SchedulerException
{
scheduler
.
getListenerManager
().
addJobListener
(
new
QuartzJobListener
());
}
//
@PostConstruct
//
public void init() throws SchedulerException {
//
scheduler.getListenerManager().addJobListener(new QuartzJobListener());
//
}
/**
* 创建设备监控任务(入口:增加调度器健康检查、任务去重)
...
...
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