From 646bba889381ba8d3699c743a1d6b7d896a8f6c1 Mon Sep 17 00:00:00 2001 From: zhouz <> Date: Fri, 14 Aug 2026 14:53:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=A5=E6=A0=BC=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=97=A5=E8=AE=A1=E5=88=92=E9=A2=86=E5=8F=96=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dailyplan/DailyPlanScheduleServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nl-module-lms/nl-module-lms-server/src/main/java/cn/code/nl/module/lms/service/dailyplan/DailyPlanScheduleServiceImpl.java b/nl-module-lms/nl-module-lms-server/src/main/java/cn/code/nl/module/lms/service/dailyplan/DailyPlanScheduleServiceImpl.java index 6253fd8a..5f126a5f 100644 --- a/nl-module-lms/nl-module-lms-server/src/main/java/cn/code/nl/module/lms/service/dailyplan/DailyPlanScheduleServiceImpl.java +++ b/nl-module-lms/nl-module-lms-server/src/main/java/cn/code/nl/module/lms/service/dailyplan/DailyPlanScheduleServiceImpl.java @@ -180,6 +180,10 @@ public class DailyPlanScheduleServiceImpl implements DailyPlanScheduleService { if (plan == null) { throw exception(DAILY_PLAN_NOT_EXISTS); } + if (!plan.getVersion().equals(claim.getPlanVersion())) { + // 领取后的任何计划变更都会使旧领取失效;不确认 claim,调用方可处理冲突后主动释放或续租。 + throw exception(DAILY_PLAN_VERSION_CONFLICT); + } Integer workStatus = type == DailyPlanStrategyTypeEnum.STOCKING ? plan.getStockingStatus() : plan.getSleevingStatus(); if (!DailyPlanOrderStatusEnum.IN_PROGRESS.getCode().equals(plan.getOrderStatus()) @@ -193,8 +197,8 @@ public class DailyPlanScheduleServiceImpl implements DailyPlanScheduleService { throw exception(DAILY_PLAN_COMPLETED_QTY_EXCEEDS_TOTAL); } int affected = type == DailyPlanStrategyTypeEnum.STOCKING - ? dailyPlanMapper.increaseStockedQuantity(dailyPlanId, quantity, plan.getVersion(), normalizedOperator(operator)) - : dailyPlanMapper.increaseSleevedQuantity(dailyPlanId, quantity, plan.getVersion(), normalizedOperator(operator)); + ? dailyPlanMapper.increaseStockedQuantity(dailyPlanId, quantity, version, normalizedOperator(operator)) + : dailyPlanMapper.increaseSleevedQuantity(dailyPlanId, quantity, version, normalizedOperator(operator)); if (affected != 1) { throw exception(DAILY_PLAN_VERSION_CONFLICT); }