From 812041adbdca9d3f8fbdd5abcb12a62d996450c7 Mon Sep 17 00:00:00 2001 From: x_z Date: Fri, 10 Jun 2022 11:17:00 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E5=8D=95?= =?UTF-8?q?=E5=8F=B7=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/inout/impl/OrderServiceImpl.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/OrderServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/OrderServiceImpl.java index a398723..0fe6d78 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/OrderServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/service/inout/impl/OrderServiceImpl.java @@ -331,13 +331,24 @@ public class OrderServiceImpl implements OrderService { //通过源单据查询所有关联的单据数据 public void getLinkedOrderId(String id, List orderIds) { List list = getOneOrderById(id); - if (orderIds.containsAll(list)) { - //已经包含源单据所关联的所有的单据号 - return; - } else { + if (!orderIds.containsAll(list)) { //找出不包含在原有集合中的单据号,回调方法 + String orderId = null; + boolean flag = false; + for (String temp : orderIds) { + if (!flag) { + for (String item : list) { + if (!temp.equals(item)) { + orderId = item; + flag = true; + break; + } + } + } + + } orderIds.addAll(list); - getLinkedOrderId(list.get(0), orderIds); + getLinkedOrderId(orderId, orderIds); } }