From 320f4720435e7155abad7146bb6c7229827b2b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B3=89=E4=BD=B3?= <1107186916@qq.com> Date: Sun, 18 Oct 2026 21:30:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BC=80=E7=A5=A8=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=B8=8E=E6=AD=A3=E5=BC=8F=E7=BB=93=E7=AE=97=E5=8D=95=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E9=87=91=E8=9D=B6=E5=85=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=A1=8C=E9=94=81=E4=BA=92=E6=96=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - doSyncKingdee 首行改为 lockedExisting 行锁读(FOR UPDATE),审批自动推/手动按钮/定时重推三入口在同一单据上串行化 - 后到请求等锁后读到已提交状态,命中已同步幂等分支直接返回金蝶单号 - 修复并发推送触发金蝶「已提交状态下的单据不允许修改」的假失败与重复建单风险 --- .../service/impl/FormalSettlementServiceImpl.java | 10 +++++++++- .../service/impl/InvoiceApplicationServiceImpl.java | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/FormalSettlementServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/FormalSettlementServiceImpl.java index 4e58963f..f3b6ac7e 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/FormalSettlementServiceImpl.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/FormalSettlementServiceImpl.java @@ -981,7 +981,7 @@ public class FormalSettlementServiceImpl extends BaseServiceImpllambdaQuery() + .eq(FormalSettlement::getId, id).last("FOR UPDATE")); + if (entity == null || Objects.equals(entity.getIsDeleted(), 1)) throw new ServiceException("正式结算单不存在"); + return entity; + } + private FormalSettlement editable(Long id) { FormalSettlement entity = existing(id); if (!TransportBusiConstant.DRAFT.equals(entity.getApprovalStatus()) && !TransportBusiConstant.RETURNED.equals(entity.getApprovalStatus())) throw new ServiceException("仅草稿或已驳回的正式结算单允许编辑"); diff --git a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/InvoiceApplicationServiceImpl.java b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/InvoiceApplicationServiceImpl.java index 10b197a8..ab2d6bad 100644 --- a/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/InvoiceApplicationServiceImpl.java +++ b/blade-service/blade-transport/src/main/java/org/springblade/transport/service/impl/InvoiceApplicationServiceImpl.java @@ -701,7 +701,7 @@ public class InvoiceApplicationServiceImpl extends BaseServiceImpllambdaQuery() + .eq(InvoiceApplication::getId, id).last("FOR UPDATE")); + if (entity == null || Objects.equals(entity.getIsDeleted(), 1)) throw new ServiceException("开票申请不存在"); + return entity; + } + private InvoiceApplication editable(Long id) { InvoiceApplication entity = existing(id); if (!List.of(TransportBusiConstant.DRAFT, TransportBusiConstant.RETURNED).contains(entity.getApprovalStatus())) throw new ServiceException("当前状态不可编辑");