From e9dbf203f14e406b864a38c300d28d5af3353983 Mon Sep 17 00:00:00 2001 From: gaoqr <13665037151@163.com> Date: Fri, 3 Jul 2026 16:19:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E9=85=8D=E8=AE=A2=E5=8D=95=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../executor/dal/mysql/order/OrderMapper.java | 2 +- .../assemblylist/AssemblyListServiceImpl.java | 7 +- .../service/order/OrderServiceImpl.java | 7 +- .../resources/mapper/order/OrderMapper.xml | 69 +++++++++---------- 4 files changed, 43 insertions(+), 42 deletions(-) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/order/OrderMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/order/OrderMapper.java index 216c37553..b5217889f 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/order/OrderMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/order/OrderMapper.java @@ -143,7 +143,7 @@ public interface OrderMapper extends BaseMapperX { * @param parentIds * @return */ - List selectChildList(@Param("reqVO") OrderPageReqVO reqVO, @Param("parentIds") List parentIds); + List selectChildIdList(@Param("reqVO") OrderPageReqVO reqVO, @Param("parentIds") List parentIds); IPage selectOrderPage(@Param("page") IPage page, @Param(Constants.WRAPPER) Wrapper wrapper); diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListServiceImpl.java index 780112c65..be0bb97ba 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/assemblylist/AssemblyListServiceImpl.java @@ -108,9 +108,12 @@ public class AssemblyListServiceImpl implements AssemblyListService { orderDOS.sort(Comparator.comparing(o -> sortMap.get(o.getId()))); // 3. 查询子单 - List childList = - orderMapper.selectChildList(pageReqVO, orderIds); + List childIdList = orderMapper.selectChildIdList(pageReqVO, orderIds); + if (CollUtil.isEmpty(childIdList)) { + return new PageResult<>(orderDOS, pageResultTotal); + } + List childList = orderMapper.selectByIds(childIdList); if (CollUtil.isEmpty(childList)) { return new PageResult<>(orderDOS, pageResultTotal); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java index 1aa5a7e75..906361bef 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/order/OrderServiceImpl.java @@ -356,9 +356,12 @@ public class OrderServiceImpl implements OrderService { orderDOS.sort(Comparator.comparing(o -> sortMap.get(o.getId()))); // 3. 查询子单 - List childList = - orderMapper.selectChildList(pageReqVO, orderIds); + List childIdList = orderMapper.selectChildIdList(pageReqVO, orderIds); + if (CollUtil.isEmpty(childIdList)) { + return new PageResult<>(orderDOS, pageResultTotal); + } + List childList = orderMapper.selectByIds(childIdList); if (CollUtil.isEmpty(childList)) { return new PageResult<>(orderDOS, pageResultTotal); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml index 6dff9c445..88fba4087 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/order/OrderMapper.xml @@ -34,13 +34,10 @@ t.root_id FROM orders t - where 1=1 - - AND EXISTS ( - SELECT 1 - FROM order_component oc - WHERE oc.order_id = t.id + JOIN order_component oc + ON oc.organ_id = t.organ_id + AND oc.order_id = t.id AND oc.deleted = 0 AND oc.pid = 0 @@ -60,8 +57,8 @@ - ) + where 1=1 AND CAST(t.id AS CHAR) LIKE CONCAT('%', #{reqVO.id}, '%') @@ -171,11 +168,36 @@ - - SELECT * + SELECT DISTINCT + t.id FROM orders t + + JOIN order_component oc + ON oc.organ_id = t.organ_id + AND oc.order_id = t.id + AND oc.deleted = 0 + AND oc.pid = 0 + + + + AND oc.extra_process_status = 0 + + + AND oc.process_status = 1 + AND (oc.extra_process_status IS NULL OR oc.extra_process_status != 0) + + + AND oc.process_status = 2 + + + AND oc.extra_process_status = 3 + + + + WHERE t.parent_id IN - - AND EXISTS ( - SELECT 1 - FROM order_component oc - WHERE oc.order_id = t.id - AND oc.deleted = 0 - AND oc.pid = 0 - - - - AND oc.extra_process_status = 0 - - - AND oc.process_status = 1 - AND (oc.extra_process_status IS NULL OR oc.extra_process_status != 0) - - - AND oc.process_status = 2 - - - AND oc.extra_process_status = 3 - - - - ) - - AND CAST(t.id AS CHAR) LIKE CONCAT('%', #{reqVO.id}, '%')