This commit is contained in:
van
2026-04-03 17:18:27 +08:00
parent d4fdf076e9
commit fa7e26cf6e
6 changed files with 85 additions and 10 deletions

View File

@@ -79,15 +79,16 @@ public class WeComShareLinkLogisticsJobController extends BaseController {
job.getTrackingUrl(), remark, touser);
data.put("jobKey", jobKey);
int nextAttempts = job.getScanAttempts() == null ? 1 : job.getScanAttempts() + 1;
int successAttempts = job.getScanAttempts() == null ? 1 : job.getScanAttempts() + 1;
String adhocNote = data.get("adhocNote") != null ? data.get("adhocNote").toString() : "";
String note = "manual:" + adhocNote;
if (Boolean.TRUE.equals(data.get("terminalSuccess"))) {
String wb = data.get("waybillNo") != null ? data.get("waybillNo").toString() : null;
weComShareLinkLogisticsJobMapper.updateByJobKey(jobKey, "PUSHED", note, nextAttempts,
weComShareLinkLogisticsJobMapper.updateByJobKey(jobKey, "PUSHED", note, successAttempts,
StringUtils.hasText(wb) ? wb : null);
} else {
weComShareLinkLogisticsJobMapper.updateByJobKey(jobKey, "WAITING", note, nextAttempts, null);
/* 失败仍走自动队列时,不得垫高 scan_attempts否则 Redis attempts 与定时 drain 上限错位,未超限也会被放弃 */
weComShareLinkLogisticsJobMapper.updateByJobKey(jobKey, "WAITING", note, job.getScanAttempts(), null);
WeComShareLinkLogisticsJob refreshed = weComShareLinkLogisticsJobService.selectByJobKey(jobKey);
if (refreshed != null) {
logisticsService.pushShareLinkJobToRedis(refreshed);