From 09a703e26ca9df173b8f59653f7d91e5eb52629d Mon Sep 17 00:00:00 2001 From: hwd <582708352@qq.com> Date: Fri, 10 Oct 2025 10:43:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=99=E5=8D=95=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=97=A0=E6=95=88=EF=BC=8C=E4=BE=9B=E8=B4=A7?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E7=9A=84=E4=BC=98=E5=85=88=E7=BA=A7=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E8=AE=BE=E7=BD=AE=E6=9C=80=E5=A4=A7=E5=80=BC?= =?UTF-8?q?=EF=BC=88=E4=BC=98=E5=85=88=E7=BA=A7=E6=9C=80=E4=BD=8E=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vverp/service/MaterialOrderService.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/vverp/service/MaterialOrderService.java b/src/main/java/com/vverp/service/MaterialOrderService.java index fb789b6..27eb7c6 100644 --- a/src/main/java/com/vverp/service/MaterialOrderService.java +++ b/src/main/java/com/vverp/service/MaterialOrderService.java @@ -2504,27 +2504,28 @@ public class MaterialOrderService extends BaseOrderService } //确认供应商列表 Integer ind = indMap.getOrDefault(supplierProduct.getSupplier().getId(), null); + Integer supplierProductInd = Optional.ofNullable(supplierProduct.getInd()).orElse(Integer.MAX_VALUE); if (ind == null) { if (maxInd == null) { - indMap.put(supplierProduct.getSupplier().getId(), supplierProduct.getInd()); - maxInd = supplierProduct.getInd(); + indMap.put(supplierProduct.getSupplier().getId(), supplierProductInd); + maxInd = supplierProductInd; maxIndSupplier = supplierProduct.getSupplier().getId(); } else { - if (indMap.size() >= number && supplierProduct.getInd().compareTo(maxInd) < 0) { + if (indMap.size() >= number && supplierProductInd.compareTo(maxInd) < 0) { indMap.remove(maxIndSupplier); - indMap.put(supplierProduct.getSupplier().getId(), supplierProduct.getInd()); - maxInd = supplierProduct.getInd(); + indMap.put(supplierProduct.getSupplier().getId(), supplierProductInd); + maxInd = supplierProductInd; maxIndSupplier = supplierProduct.getSupplier().getId(); }else if(indMap.size()0){ - maxInd = supplierProduct.getInd(); + indMap.put(supplierProduct.getSupplier().getId(), supplierProductInd); + if (supplierProductInd.compareTo(maxInd)>0){ + maxInd = supplierProductInd; maxIndSupplier = supplierProduct.getSupplier().getId(); } } } - } else if (ind.compareTo(supplierProduct.getInd()) > 0) { - indMap.put(supplierProduct.getSupplier().getId(), supplierProduct.getInd()); + } else if (ind.compareTo(supplierProductInd) > 0) { + indMap.put(supplierProduct.getSupplier().getId(), supplierProductInd); } } }