From 24027b939d2fc9741ed4f63bdda462f8ce315e2d Mon Sep 17 00:00:00 2001 From: gaoqr <13665037151@163.com> Date: Fri, 26 Jun 2026 15:05:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=20=E9=83=A8?= =?UTF-8?q?=E4=BB=B6=E6=9F=A5=E8=AF=A2=E9=85=8D=E4=BB=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=81=E9=80=9F=E5=BA=A6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/manage/pack/PackServiceImpl.java | 2 +- .../service/orderitem/OrderItemService.java | 2 +- .../orderitem/OrderItemServiceImpl.java | 3 +- .../service/plate/PlateServiceImpl.java | 2 +- .../mapper/orderItem/OrderItemMapper.xml | 31 +++++++++++-------- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java index e815fb425..8b6efda16 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/pack/PackServiceImpl.java @@ -1068,7 +1068,7 @@ public class PackServiceImpl implements PackService { PlateDO plate = plateService.getPlateByNo(id, ArrayUtil.toArray(orderIds, Long.class)); AssertUtils.notEmpty(plate, PLATE_NOT_EXISTS); // 查询关联部件id - itemDOS = orderItemService.getPlateItemCompId(plate.getId()); + itemDOS = orderItemService.getPlateItemCompId(plate.getOrderId(), plate.getId()); } else { Long partsId = Long.valueOf(id); // 配件 diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemService.java index 9561dcfce..6507b0853 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemService.java @@ -18,7 +18,7 @@ public interface OrderItemService { * @param plateId * @return */ - List getPlateItemCompId(Long plateId); + List getPlateItemCompId(Long orderId, Long plateId); /** * 查询配件订单明细关联的部件id diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemServiceImpl.java index c899e660e..a6e3011c4 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/orderitem/OrderItemServiceImpl.java @@ -22,9 +22,10 @@ public class OrderItemServiceImpl implements OrderItemService { private OrderItemMapper orderItemMapper; @Override - public List getPlateItemCompId(Long id) { + public List getPlateItemCompId(Long orderId, Long id) { List plateItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper() .eq(OrderItemDO::getPlateId, id) + .eq(OrderItemDO::getOrderId, orderId) .select(OrderItemDO::getCompId, OrderItemDO::getGroupId, OrderItemDO::getBodyId)); if (CollUtil.isNotEmpty(plateItemDOS)) { return plateItemDOS; diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java index 0e891fd6b..e46cd270a 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plate/PlateServiceImpl.java @@ -1431,7 +1431,7 @@ public class PlateServiceImpl implements PlateService { if (CollUtil.isNotEmpty(bodyIds)) { detailReqVO.setBodyIds(bodyIds); } else { - List plateItems = orderItemService.getPlateItemCompId(plateDO.getId()); + List plateItems = orderItemService.getPlateItemCompId(plateDO.getOrderId(), plateDO.getId()); if (CollUtil.isEmpty(plateItems)) { throw new ServiceException(PLATE_NOT_EXISTS); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml index 1a6982d1a..99cda02d8 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/orderItem/OrderItemMapper.xml @@ -889,25 +889,30 @@ SELECT parts_id, body_id, cad_view_id, - SUM(num) AS num - - , MIN(comp_id) AS comp_id - - FROM order_item - WHERE order_id = #{orderId} and parts_id != 0 and source_id = 0 - and ((group_id is null and comp_id is null) or group_id = 0) + + + MIN(num) AS num, + MIN(comp_id) AS comp_id + FROM order_item + WHERE order_id = #{orderId} and parts_id != 0 and source_id = 0 + AND comp_id IN + + #{componentId} + + + + SUM(num) AS num + FROM order_item + WHERE order_id = #{orderId} and parts_id != 0 and source_id = 0 + and ((group_id is null and comp_id is null) or group_id = 0) + + AND body_id IN #{bodyId} - - AND comp_id IN - - #{componentId} - - GROUP BY body_id, parts_id, cad_view_id ) t ON t.parts_id = op.id JOIN order_body ob ON ob.order_id = op.order_id and ob.id = t.body_id