From 9a45e8751ebeeae2733a3eebd83fcc4cd62bfdea Mon Sep 17 00:00:00 2001 From: gaoqr <13665037151@163.com> Date: Mon, 22 Jun 2026 17:37:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86=E3=80=81?= =?UTF-8?q?=E8=A3=85=E9=85=8D=E6=B8=85=E5=8D=95=20=E9=85=8D=E4=BB=B6?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E5=B1=95=E7=A4=BA=E6=9D=A1=E7=9B=AE=E5=92=8C?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/plate/PlateServiceImpl.java | 23 +++++++++---------- .../mapper/orderItem/OrderItemMapper.xml | 21 +++++++++++------ 2 files changed, 25 insertions(+), 19 deletions(-) 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 23af88cfe..0e891fd6b 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 @@ -1056,11 +1056,6 @@ public class PlateServiceImpl implements PlateService { .eq(OrderItemDO::getOrderId, pageReqVO.getOrderId()) .inIfPresent(OrderItemDO::getBodyId, bodyIds) .inIfPresent(OrderItemDO::getGroupId, groupIds) - .and(wrapper -> - wrapper.ne(OrderItemDO::getGroupId, 0L) - .or() - .isNull(OrderItemDO::getGroupId) - ) .in(OrderItemDO::getPartsId, partsIds) .select(OrderItemDO::getPartsId, OrderItemDO::getBodyId, OrderItemDO::getCadViewId, OrderItemDO::getGroupId, OrderItemDO::getCompId, OrderItemDO::getNum) ); @@ -1069,11 +1064,6 @@ public class PlateServiceImpl implements PlateService { .eq(OrderItemTempDO::getOrderId, pageReqVO.getOrderId()) .inIfPresent(OrderItemTempDO::getBodyId, bodyIds) .inIfPresent(OrderItemTempDO::getGroupId, groupIds) - .and(wrapper -> - wrapper.ne(OrderItemTempDO::getGroupId, 0L) - .or() - .isNull(OrderItemTempDO::getGroupId) - ) .in(OrderItemTempDO::getPartsId, partsIds) .select(OrderItemTempDO::getPartsId, OrderItemTempDO::getBodyId, OrderItemTempDO::getCadViewId, OrderItemTempDO::getGroupId, OrderItemTempDO::getCompId, OrderItemTempDO::getNum) ); @@ -1092,6 +1082,9 @@ public class PlateServiceImpl implements PlateService { // 暂存 partsId:bodyId Map, Long> partsBodyIdMap = new HashMap<>(); + // 是否加工组入口 + boolean comFromGroup = CollUtil.isNotEmpty(groupIds); + for (OrderItemDO item : orderItemRelation) { Long partsId = item.getPartsId(); @@ -1112,8 +1105,14 @@ public class PlateServiceImpl implements PlateService { .add(item.getCompId()); } - // num 汇总 - if (item.getNum() != null) { + // num + if (item.getNum() != null && + ( + (comFromGroup && ObjectUtil.isNotNull(item.getGroupId()) && ObjectUtil.notEqual(item.getGroupId(), 0L)) //加工组入口 统计groupId不是空的 + || + (!comFromGroup && (ObjectUtil.equals(item.getGroupId(), 0L) || (ObjectUtil.isNull(item.getGroupId()) && ObjectUtil.isNull(item.getCompId())))) // 非加工组入口,统计groupId = 0(加工组汇总的数量) 或者 null+不是部件item的(没有加工组的数量) + ) + ) { partsNumMap.merge( pair, item.getNum(), 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 97c2a98eb..9911005e6 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 @@ -105,7 +105,7 @@ RIGHT JOIN `order_parts` p ON i.organ_id = p.organ_id AND i.order_id = p.order_id AND i.parts_id = p.id RIGHT JOIN `order_body` ob ON i.organ_id = ob.organ_id AND i.order_id = ob.order_id AND i.body_id = ob.id - WHERE i.organ_id = #{organId} AND i.order_id = #{orderId} AND ob.deleted = #{deleted} AND (i.group_id is null or i.group_id = 0) AND p.category in + WHERE i.organ_id = #{organId} AND i.order_id = #{orderId} AND ob.deleted = #{deleted} AND ((i.group_id is null and i.comp_id is null) or i.group_id = 0) AND p.category in #{type} @@ -695,12 +695,19 @@ - - AND i.group_id IN - - #{groupId} - - + + + AND i.group_id IN + + #{groupId} + + + + + AND ((i.group_id is null and i.comp_id is null) or i.group_id = 0) + + + AND i.comp_id IN