From 16b1e8e326f43e9f3268e05f6e43cf1e3189cb85 Mon Sep 17 00:00:00 2001 From: gaoqr <13665037151@163.com> Date: Wed, 3 Jun 2026 16:52:08 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A2=9E=E5=8A=A0=E6=88=BF=E9=97=B4=E6=9F=9C?= =?UTF-8?q?=E4=BD=93=E5=8A=A0=E5=B7=A5=E7=BB=84=E4=BF=A1=E6=81=AF=EF=BC=9B?= =?UTF-8?q?2=E3=80=81=E6=8E=92=E5=8D=95=E5=B0=8F=E6=9D=BF=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=9F=A5=E8=AF=A2=E4=BC=98=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/plan/vo/PlateDetailRespVO.java | 2 + .../dal/dataobject/plate/PlateDetailDO.java | 5 ++ .../executor/dal/mysql/plate/PlateMapper.java | 2 +- .../optimizeplan/OptimizePlanServiceImpl.java | 80 +++++++++---------- .../OrderComponentServiceImpl.java | 8 ++ .../service/plan/PlanServiceImpl.java | 5 +- .../service/plate/PlateServiceImpl.java | 6 ++ .../mapper/planitem/PlanItemMapper.xml | 11 ++- .../resources/mapper/plate/PlateMapper.xml | 17 +++- 9 files changed, 90 insertions(+), 46 deletions(-) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlateDetailRespVO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlateDetailRespVO.java index a5710994f..489796ab6 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlateDetailRespVO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/vo/PlateDetailRespVO.java @@ -184,6 +184,8 @@ public class PlateDetailRespVO { @Schema(description = "板类型,0 层板 1 立板 2 背板", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Integer type; + @Schema(description = "加工组ID") + private Long groupId; @Schema(description = "加工组名称", requiredMode = Schema.RequiredMode.REQUIRED) private String processGroupName; diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/plate/PlateDetailDO.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/plate/PlateDetailDO.java index fb8bb3ff6..eb671b3a9 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/plate/PlateDetailDO.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/dataobject/plate/PlateDetailDO.java @@ -243,6 +243,11 @@ public class PlateDetailDO { */ private Integer type; + /** + * 加工组id + */ + private Long groupId; + /** * 加工组名称 */ diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java index 522602a18..8c0de310c 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java @@ -444,5 +444,5 @@ public interface PlateMapper extends BaseMapperX { * @param planIds * @return */ - IPage selectPlanPlateInfoPage(@Param("page") IPage page, @Param("planIds") List planIds); + IPage selectPlanPlateInfoPage(@Param("page") IPage page, @Param("planIds") List planIds, @Param("orderIds") Set orderIds); } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/optimizeplan/OptimizePlanServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/optimizeplan/OptimizePlanServiceImpl.java index 469e3f4e4..2d9ec236b 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/optimizeplan/OptimizePlanServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/optimizeplan/OptimizePlanServiceImpl.java @@ -325,30 +325,30 @@ public class OptimizePlanServiceImpl implements OptimizePlanService { AssertUtils.notEmpty(models, ORDER_PLATE_MODEL_DATE_ERROR); // 查询订单对应的配件信息 - List printOrderPartsRespVOS = orderPartsMapper.selectPartList(Collections.singletonList(orderId), getUserOrganId()); +// List printOrderPartsRespVOS = orderPartsMapper.selectPartList(Collections.singletonList(orderId), getUserOrganId()); - // 查询订单对应的包裹信息 - List printOrderPackReqVOS = plateMapper.selectOrderPackList(orderId,getUserOrganId()); - - - if(CollUtil.isNotEmpty(printOrderPackReqVOS)) { - // 统计每个订单的包装数量 - printOrderPackReqVOS - .stream() - .filter(f -> f - .getOrderId().equals(orderId)) - .forEach(f -> f.setPackNum(printOrderPackReqVOS.stream().filter(e -> e.getOrderId().equals(orderId)).map(PrintOrderPackReqVO::getPackId).toList().size())); - } +// // 查询订单对应的包裹信息 +// List printOrderPackReqVOS = plateMapper.selectOrderPackList(orderId,getUserOrganId()); +// +// +// if(CollUtil.isNotEmpty(printOrderPackReqVOS)) { +// // 统计每个订单的包装数量 +// printOrderPackReqVOS +// .stream() +// .filter(f -> f +// .getOrderId().equals(orderId)) +// .forEach(f -> f.setPackNum(printOrderPackReqVOS.stream().filter(e -> e.getOrderId().equals(orderId)).map(PrintOrderPackReqVO::getPackId).toList().size())); +// } return OrderSource.builder() .orderList(Collections.singletonList(orderDO)) .goodsList(goodsDOS) .plateList(BeanUtil.copyToList(plateDOS, PlateDetailRespVO.class)) .plateModels(models) - .orderPartsRespVOS(printOrderPartsRespVOS) +// .orderPartsRespVOS(printOrderPartsRespVOS) .orderPartsRemarks(null) - .orderPackReqVOS(printOrderPackReqVOS) +// .orderPackReqVOS(printOrderPackReqVOS) .build(); } @@ -378,14 +378,12 @@ public class OptimizePlanServiceImpl implements OptimizePlanService { AssertUtils.notEmpty(plateDetailRespVOS, ORDER_PLAN_PLATE_ERROR); - List resultPlateList = mergeGroupAndComponentName(plateDetailRespVOS); - List orderDOS = orderMapper.selectBatchIds(orderIds); AssertUtils.notEmpty(orderDOS, ORDER_PLAN_ORDERS_EMPTY); List models = - resultPlateList.stream() + plateDetailRespVOS.stream() .map(PlateDetailDO::getModelData) .filter(StringUtils::isNotBlank) .map(json -> JsonUtils.parseObject(json, OrderModelDO.class)) @@ -394,10 +392,10 @@ public class OptimizePlanServiceImpl implements OptimizePlanService { AssertUtils.notEmpty(models, ORDER_PLAN_PLATE_MODEL_DATE_ERROR); - List remainPlateDOS = remainPlateMapper.selectByPlanId(planId,getUserOrganId()); +// List remainPlateDOS = remainPlateMapper.selectByPlanId(planId,getUserOrganId()); - List optimizeRemainPlates = BeanUtils.toBean(remainPlateDOS, OptimizeRemainPlate.class); +// List optimizeRemainPlates = BeanUtils.toBean(remainPlateDOS, OptimizeRemainPlate.class); // 查询混单实际请求大板信息 PlanActualGoodsModelDO planActualGoodsModelDO = null; @@ -410,36 +408,36 @@ public class OptimizePlanServiceImpl implements OptimizePlanService { } // 查询订单对应的配件信息 - List printOrderPartsRespVOS = orderPartsMapper.selectPartList(orderIds, getUserOrganId()); +// List printOrderPartsRespVOS = orderPartsMapper.selectPartList(orderIds, getUserOrganId()); - // 查询订单对应的包裹信息 - List printOrderPackReqVOS = plateMapper.selectPlanPackList(ids,getUserOrganId()); - - - if(CollUtil.isNotEmpty(printOrderPackReqVOS)) { - for (Long orderId : orderIds) { - // 统计每个订单的包装数量 - printOrderPackReqVOS - .stream() - .filter(f -> f.getOrderId().equals(orderId)) - .forEach(f -> f.setPackNum(printOrderPackReqVOS.stream() - .filter(e -> e.getOrderId().equals(orderId)) - .map(PrintOrderPackReqVO::getPackId).toList() - .size())); - } - } +// // 查询订单对应的包裹信息 +// List printOrderPackReqVOS = plateMapper.selectPlanPackList(ids,getUserOrganId()); +// +// +// if(CollUtil.isNotEmpty(printOrderPackReqVOS)) { +// for (Long orderId : orderIds) { +// // 统计每个订单的包装数量 +// printOrderPackReqVOS +// .stream() +// .filter(f -> f.getOrderId().equals(orderId)) +// .forEach(f -> f.setPackNum(printOrderPackReqVOS.stream() +// .filter(e -> e.getOrderId().equals(orderId)) +// .map(PrintOrderPackReqVO::getPackId).toList() +// .size())); +// } +// } return OrderSource.builder() .orderList(orderDOS) .plan(planDO) .goodsList(goodsDOS) - .plateList(BeanUtil.copyToList(resultPlateList, PlateDetailRespVO.class)) + .plateList(BeanUtil.copyToList(plateDetailRespVOS, PlateDetailRespVO.class)) .plateModels(models) .planActualGoodsModelDO(planActualGoodsModelDO) - .optimizeRemainPlates(optimizeRemainPlates) - .orderPartsRespVOS(printOrderPartsRespVOS) +// .optimizeRemainPlates(optimizeRemainPlates) +// .orderPartsRespVOS(printOrderPartsRespVOS) .orderPartsRemarks(null) - .orderPackReqVOS(printOrderPackReqVOS) +// .orderPackReqVOS(printOrderPackReqVOS) .build(); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentServiceImpl.java index 91954eac2..0bacb24f6 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/ordercomponent/OrderComponentServiceImpl.java @@ -249,6 +249,11 @@ public class OrderComponentServiceImpl implements OrderComponentService { // 查询板件+板材信息 List ordersViewPlatesPageDOS = plateMapper.selectPlateGoodsByIds(orderIds, plateIdPageRecords, deleted); + + if (CollUtil.isEmpty(plateIdPageRecords)) { + return new PageResult<>(); + } + // 查询关联关系 List orderItemRelation; // 查询关联关系 if (!deleted) { @@ -434,6 +439,9 @@ public class OrderComponentServiceImpl implements OrderComponentService { List partsIds = partsPageRecords.stream().map(OrdersViewPartsPageDO::getId).toList(); + if (CollUtil.isEmpty(partsIds)) { + return new PageResult<>(); + } // 查询关联关系 List orderItemRelation; if (!deleted) { diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java index 45a5119bc..e18e76207 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanServiceImpl.java @@ -710,7 +710,7 @@ public class PlanServiceImpl implements PlanService { // 分页查询排单板件 PageDTO page = new PageDTO<>(vo.getPageNo(), vo.getPageSize()); - IPage ordersViewPlatesPageDOIPage = plateMapper.selectPlanPlateInfoPage(page, planIds); + IPage ordersViewPlatesPageDOIPage = plateMapper.selectPlanPlateInfoPage(page, planIds, orderIdSet); long total = ordersViewPlatesPageDOIPage.getTotal(); if (total == 0) { @@ -720,6 +720,9 @@ public class PlanServiceImpl implements PlanService { List ordersViewPlatesPageDOIPageRecords = ordersViewPlatesPageDOIPage.getRecords(); List plateIds = ordersViewPlatesPageDOIPageRecords.stream().map(OrdersViewPlatesPageDO::getId).toList(); + if (CollUtil.isEmpty(plateIds)) { + return new PageResult<>(); + } // 查询关联关系 List orderItemRelation = orderItemMapper.selectList(new LambdaQueryWrapperX() .in(OrderItemDO::getOrderId, orderIdSet) 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 b49b446f3..0c91814b9 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 @@ -909,6 +909,9 @@ public class PlateServiceImpl implements PlateService { // 查询板件+板材信息 List ordersViewPlatesPageDOS = plateMapper.selectPlateGoodsByIds(orderIds, plateIdPageRecords, deleted); + if (CollUtil.isEmpty(plateIdPageRecords)) { + return new PageResult<>(); + } List orderItemRelation; // 查询关联关系 if(!deleted) { @@ -1077,6 +1080,9 @@ public class PlateServiceImpl implements PlateService { List partsIds = partsPageRecords.stream().map(OrdersViewPartsPageDO::getId).toList(); + if (CollUtil.isEmpty(partsIds)) { + return new PageResult<>(); + } // 查询关联关系 List orderItemRelation; if (!deleted) { diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/planitem/PlanItemMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/planitem/PlanItemMapper.xml index 1af649301..5f3653f2c 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/planitem/PlanItemMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/planitem/PlanItemMapper.xml @@ -441,7 +441,13 @@ op.is_sculpt as isSculpt, op.is_row_hole as hasHole, op.remark as remark, - op.model_data as modelData + op.model_data as modelData, + oi.body_id as bodyId, + oi.room_id as roomId, + oi.group_id as groupId, + ob.name as bodyName, + ob.room_name as roomName, + og.name as processGroupName FROM order_plate op @@ -449,6 +455,9 @@ ON op.organ_id = ogs.organ_id AND op.order_id = ogs.order_id AND op.goods_id = ogs.id + left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.plate_id + left join order_body ob on ob.organ_id = op.organ_id and ob.order_id = op.order_id and ob.id = oi.body_id + left join order_group og on og.organ_id = op.organ_id and og.order_id = op.order_id and og.id = oi.group_id WHERE op.organ_id = #{organId} and op.order_id in diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml index a013b62eb..15d808401 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml @@ -380,7 +380,7 @@