From bbb5c18066b5ea2e2727dbf20b5a356da196ee7a Mon Sep 17 00:00:00 2001 From: gaoqr <13665037151@163.com> Date: Mon, 8 Jun 2026 14:39:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BC=80=E5=A7=8B=E5=BC=80?= =?UTF-8?q?=E6=96=99=E7=9A=84=E5=B0=8F=E6=9D=BF=E5=BC=80=E6=96=99=E4=B8=AD?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/component/BoardLayoutResultSummary.java | 8 ++++++++ .../executor/dal/mysql/plate/PlateMapper.java | 9 +++++++++ .../optimizeplan/OptimizePlanServiceImpl.java | 6 +++++- .../main/resources/mapper/plate/PlateMapper.xml | 16 ++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/component/BoardLayoutResultSummary.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/component/BoardLayoutResultSummary.java index 40047a182..7637f1cf6 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/component/BoardLayoutResultSummary.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/component/BoardLayoutResultSummary.java @@ -85,5 +85,13 @@ public class BoardLayoutResultSummary { */ private List placedBlockIds; + /** + * 开始开料板ID列表 + */ + private List startCutBlockIds; + /** + * 结束开料板ID列表 + */ + private List endCutBlockIds; } 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 8c0de310c..5d97a0fa3 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 @@ -421,6 +421,15 @@ public interface PlateMapper extends BaseMapperX { */ int updatePlanPlateCutStatus(@Param("planId") Long planId, @Param("orderIds") List orderIds, @Param("plateNos") List plateNoList); + /** + * 更新计划板件开料中状态 + * + * @param planId + * @param orderIds + * @return + */ + int updatePlanPlateCuttingStatus(@Param("planId") Long planId, @Param("orderIds") List orderIds, @Param("plateNos") List plateNoList); + /** * 根据板件id列表查询板件信息 * 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 2d9ec236b..ba4240291 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 @@ -1853,6 +1853,10 @@ public class OptimizePlanServiceImpl implements OptimizePlanService { if (planDO.getStatus().equals(PlanStatusEnum.OPENING.getStatus()) || planDO.getStatus().equals(PlanStatusEnum.OPENED.getStatus())) { throw new ServiceException(PLAN_PLATE_IS_CUT); } + List optimizatePlateNoList = layoutResultSummary.stream().flatMap(summary -> summary.getStartCutBlockIds().stream()).toList(); + + // 更新开料中状态 + plateMapper.updatePlanPlateCuttingStatus(planId, orderIds, optimizatePlateNoList); List orderDOS = orderMapper.selectByIds(orderIds); AssertUtils.notEmpty(orderDOS, ORDER_PLAN_ORDERS_EMPTY); @@ -1876,7 +1880,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService { if (planDO.getStatus().equals(PlanStatusEnum.OPENED.getStatus())) { throw new ServiceException(PLAN_OPTIMIZE_DATA_ALL_OPENED); } - List optimizatePlateNoList = layoutResultSummary.stream().flatMap(summary -> summary.getPlacedBlockIds().stream()).toList(); + List optimizatePlateNoList = layoutResultSummary.stream().flatMap(summary -> summary.getEndCutBlockIds().stream()).toList(); // 累计开料大板数量 int endCutBoardCount = layoutResultSummary.stream().mapToInt(BoardLayoutResultSummary::getEndCutBoardCount).sum(); 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 325015f04..f703a5ea0 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 @@ -1542,6 +1542,22 @@ UPDATE order_plate op SET op.is_cutted = 2 WHERE op.deleted = false + AND op.is_cutted in ( 0,1 ) + AND op.order_id in + + #{orderId} + + AND op.plan_id = #{planId} + AND op.plate_no in + + #{plateNo} + + + + + UPDATE order_plate op + SET op.is_cutted = 1 + WHERE op.deleted = false AND op.is_cutted = 0 AND op.order_id in