From f2c30309f0911a420782174cf6a7f76d0568df44 Mon Sep 17 00:00:00 2001 From: zhaoyf <1783123481@qq.com> Date: Wed, 18 Nov 2026 08:41:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=B8=8B=E6=8E=A8=E4=B8=AD=E9=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demand/service/impl/PmDemandServiceImpl.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/impl/PmDemandServiceImpl.java b/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/impl/PmDemandServiceImpl.java index b3fdb349..4613173b 100644 --- a/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/impl/PmDemandServiceImpl.java +++ b/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/impl/PmDemandServiceImpl.java @@ -58,7 +58,6 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; @@ -372,7 +371,6 @@ public class PmDemandServiceImpl extends ServiceImpl i @Override - @Transactional(rollbackFor = Exception.class) public void pushDemand(List pmDemandDtos) { if (CollectionUtils.isEmpty(pmDemandDtos)) { throw new BadRequestException("下推失败,请求数据不能为空"); @@ -437,16 +435,21 @@ public class PmDemandServiceImpl extends ServiceImpl i inFinishParams.add(inFinishParam); zdDemand.setWorkOrder(zdDemand.getWorkOrder() + "-" + zdDemand.getPriority()); zd.add(zdDemand); - wmsToZDWmdService.syncDemandOrder(zd); try { + wmsToZDWmdService.syncDemandOrder(zd); iStInventoryService.changeInventory(InventoryChangeType.ADD_INV, addInvParams); iStInventoryService.changeInventory(InventoryChangeType.IN_FINISH, inFinishParams); - this.update(new LambdaUpdateWrapper() - .set(PmDemand::getStatus, DemandStatus.SEND.getValue()) - .eq(PmDemand::getId, zdDemand.getId())); } catch (Exception ex) { + if (StringUtils.contains(ex.getMessage(), "已存在")){ + zdDemand.setStatus(DemandStatus.SEND.getValue()); + }else { + throw ex; + } log.error("回传中鼎成功,WMS库存变动失败" + ex.getMessage()); } + this.update(new LambdaUpdateWrapper() + .set(PmDemand::getStatus, DemandStatus.SEND.getValue()) + .eq(PmDemand::getId, zdDemand.getId())); } }