This commit is contained in:
van
2026-04-07 21:35:36 +08:00
parent a22d17de73
commit 2d4f933791
6 changed files with 70 additions and 2 deletions

View File

@@ -472,6 +472,11 @@ public class LogisticsServiceImpl implements ILogisticsService {
logger.warn("adhoc 入队跳过jobKey 或 trackingUrl 为空");
return;
}
WeComShareLinkLogisticsJob row = weComShareLinkLogisticsJobMapper.selectByJobKey(job.getJobKey().trim());
if (row != null && "CANCELLED".equalsIgnoreCase(row.getStatus())) {
logger.info("adhoc 入队跳过:任务已取消 jobKey={}", job.getJobKey());
return;
}
int attempts = job.getScanAttempts() != null ? job.getScanAttempts() : 0;
rightPushAdhocQueueJson(job.getJobKey().trim(), attempts, job.getTrackingUrl().trim(),
job.getUserRemark(), job.getTouserPush(), job.getFromUserName());
@@ -561,6 +566,13 @@ public class LogisticsServiceImpl implements ILogisticsService {
String touser = o.getString("touser");
String jobKey = o.getString("jobKey");
int attempts = o.getIntValue("attempts");
if (StringUtils.hasText(jobKey)) {
WeComShareLinkLogisticsJob row = weComShareLinkLogisticsJobMapper.selectByJobKey(jobKey.trim());
if (row == null || "CANCELLED".equalsIgnoreCase(row.getStatus())) {
logger.info("adhoc 队列项跳过(任务已删除或已取消扫描) jobKey={} rowNull={}", jobKey, row == null);
continue;
}
}
AdhocTryResult tr = tryAdhocShareLinkOnce(url, remark, touser, null);
if (tr.needsRequeue) {
int nextAttempts = attempts + 1;