From e38d214438dcf60ca521fec47c35fd1963b7befc Mon Sep 17 00:00:00 2001 From: liuzhaotian Date: Mon, 21 Apr 2025 10:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=9F=A5=E8=AF=A2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=8F=A3=E5=8F=82=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/plan/PlanController.java | 4 +- .../dal/mysql/planitem/PlanItemMapper.java | 2 + .../executor/service/plan/PlanService.java | 2 +- .../service/plan/PlanServiceImpl.java | 32 ++----------- .../service/plate/PlateServiceImpl.java | 3 +- .../mapper/planitem/PlanItemMapper.xml | 46 +++++++++++++++++++ 6 files changed, 57 insertions(+), 32 deletions(-) diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java index de5d7b9bf..bb3f54617 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/plan/PlanController.java @@ -200,9 +200,9 @@ public class PlanController { @GetMapping("getPlanPlate") @Operation(summary = "根据排单ID获取打印标签需要的小板信息") @PreAuthorize("@ss.hasAnyPermissions('placeorder:print-label','producePlan:print-label')") - public CommonResult> getPlanPlateList(@Valid PlanPageReqVO pageReqVO) { + public CommonResult> getPlanPlateList(@Valid @RequestParam("planId") Long planId) { - return success(planService.getPlanPlateList(pageReqVO)); + return success(planService.getPlanPlateList(planId)); } diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/planitem/PlanItemMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/planitem/PlanItemMapper.java index 313a661af..93d085efa 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/planitem/PlanItemMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/planitem/PlanItemMapper.java @@ -46,6 +46,8 @@ public interface PlanItemMapper extends BaseMapperX { List selectPlateListByPlateIds(@Param(Constants.WRAPPER) Wrapper wrapper,@Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize); + List selectPlateListByPlateId(@Param("planId") Long planId, @Param("organId") Long organId); + Long selectPlateCountByPlateIds(@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/plan/PlanService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanService.java index 5a40054aa..ccedbc789 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanService.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/plan/PlanService.java @@ -73,6 +73,6 @@ public interface PlanService { List getPlanGoodsList(SavePlanPlateList savePlanPlateList); - PageResult getPlanPlateList(PlanPageReqVO pageReqVO); + List getPlanPlateList(Long planId); } \ 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/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 7cc8ba529..9a085ac94 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 @@ -1022,26 +1022,14 @@ public class PlanServiceImpl implements PlanService { @Override - public PageResult getPlanPlateList(PlanPageReqVO pageReqVO) { - - Long planId = Long.valueOf(pageReqVO.getId()); - - QueryWrapperX queryWrapperX = new QueryWrapperX<>(); - - queryWrapperX.eq("opi.organ_id",getUserOrganId()) - .eq(FIELD_PLAN_ID,planId); - - Integer pageNo = (pageReqVO.getPageNo() - 1) * pageReqVO.getPageSize(); - - List plateResLists = planItemMapper.selectPlateListByPlateIds(queryWrapperX,pageNo,pageReqVO.getPageSize()); + public List getPlanPlateList(Long planId) { + List plateResLists = planItemMapper.selectPlateListByPlateId(planId,getUserOrganId()); if (CollUtil.isEmpty(plateResLists)) { - return new PageResult<>(); + return new ArrayList<>(); } - Long sum = planItemMapper.selectPlateCountByPlateIds(queryWrapperX); - List boardModelDOS = esUtils.getEsDocument(FIELD_PLANID, planId, ORDER_REMAIN_PLATE_MODEL, OptimizeBoardModelDO.class); if(CollUtil.isNotEmpty(boardModelDOS)) { @@ -1088,9 +1076,8 @@ public class PlanServiceImpl implements PlanService { } + return plateResLists; - - return new PageResult<>(plateResLists, sum); } @@ -1382,14 +1369,6 @@ public class PlanServiceImpl implements PlanService { } - - - // 查询删除的小板对应的生产单信息,如果生产单的小板全部改成了未优化,修改状态 -// List plateIsOptimizedList = plateMapper.selectPlateIsOptimized(deleteOrderIds, getUserOrganId()); -// if(CollUtil.isNotEmpty(plateIsOptimizedList)){ -// List orderIds = plateIsOptimizedList.stream().map(PlateDO::getOrderId).distinct().toList(); - - List orderIds = planItemMapper.selectOrderPlateList(deleteOrderIds, getUserOrganId()); List diff = Stream.concat( @@ -1406,8 +1385,6 @@ public class PlanServiceImpl implements PlanService { orderMapper.updateBatch(orderList); } -// } - } @@ -1475,7 +1452,6 @@ public class PlanServiceImpl implements PlanService { } - // 修改排单加工方案的优化状态 updateProcessSchemeStatus(insertPlanIds); 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 4a7c4aba5..fccd10f3d 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 @@ -272,7 +272,8 @@ public class PlateServiceImpl implements PlateService { .eq("o.deleted",false) .in("o.status",statusList) .isNull("opi.plan_id") - .isNotNull("op.id"); + .isNotNull("op.id") + .eq("op.deleted",false); if(pageReqVO.getPlanId() != null){ 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 ad9552484..3bc615fe2 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 @@ -136,6 +136,52 @@ + + + + + + + +