From af4352ae897e760447e7e82b8fbab3bf8f665a3b Mon Sep 17 00:00:00 2001 From: Ledo Date: Thu, 26 Jun 2025 14:37:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=A1=A5=E5=88=86=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=BF=85=E9=A1=BB=E5=BD=95=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/module/heli/enums/ErrorCodeConstants.java | 4 +++- .../vo/MaterialPlanBoomSaveReqVO.java | 9 +++++---- .../materialplanboom/MaterialPlanBoomMapper.java | 6 ++++-- .../materialplanboom/MaterialPlanBoomServiceImpl.java | 11 +++++++++-- .../src/views/heli/materialplan/purchasemake.vue | 6 ++++-- .../src/views/heli/materialplan/standardbuy.vue | 2 +- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java index c823619..cd975d3 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java @@ -102,8 +102,10 @@ public interface ErrorCodeConstants { ErrorCode PURCHASE_ORDER_MAKE_NOT_EXISTS = new ErrorCode(1_008_007, "采购单主不存在"); ErrorCode PURCHASE_ORDER_MAKE_DETAIL_NOT_EXISTS = new ErrorCode(1_008_008, "采购单明细不存在"); ErrorCode PURCHASE_ORDER_MAKE_DETAIL_IS_EXISTS = new ErrorCode(1_008_009, "存在物料清单已生成采购订单,请刷新界面!"); - ErrorCode PURCHASE_ORDER_MAKE_DETAIL_IS_STORAGE = new ErrorCode(1_008_010, "存在物料清单已转库存,请刷新界面!"); + ErrorCode PURCHASE_ORDER_MAKE_DETAIL_IS_STORAGE = new ErrorCode(1_008_010, "存在物料清单已转库存,请刷新界面!"); ErrorCode PURCHASE_ORDER_MAKE_DETAIL_MATERIAL_NOT_EXISTS = new ErrorCode(1_008_011, "物料数据不能为空,请选择物料后重试!"); + ErrorCode PURCHASE_ORDER_MAKE_DETAIL_BOOM_DETAIL_IS_EXISTS = new ErrorCode(1_008_012, "BOM明细ID不能为空!"); + ErrorCode PURCHASE_ORDER_MAKE_DETAIL_PROJECTSUB_DETAIL_NOT_EXISTS = new ErrorCode(1_008_013, "子项目ID不能为空!"); /************生产管理***********/ ErrorCode TASK_DISPATCH_NOT_EXISTS = new ErrorCode(1_009_001, "派工单不存在"); ErrorCode TASK_REPORT_NOT_EXISTS = new ErrorCode(1_009_002, "任务报工不存在"); diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomSaveReqVO.java index 7a2ff1a..920885a 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomSaveReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplanboom/vo/MaterialPlanBoomSaveReqVO.java @@ -21,12 +21,13 @@ public class MaterialPlanBoomSaveReqVO { @NotNull(message = "物料需求计划id不能为空") private Long projectMaterialPlanId; - @Schema(description = "工艺boom明细id,零件类型:加工件", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "工艺boom明细id,零件类型:加工件不能为空") + @Schema(description = "工艺boom明细id,零件类型:加工件") +// @NotNull(message = "工艺boom明细id,零件类型:加工件不能为空") private Long boomDetailId; - @Schema(description = "订单子项目id", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "订单子项目id不能为空") +// @Schema(description = "订单子项目id", requiredMode = Schema.RequiredMode.REQUIRED) +// @NotNull(message = "订单子项目id不能为空") + @Schema(description = "订单子项目id") private Long projectPlanSubId; @Schema(description = "需求数量") diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java index 6ef13c3..f7ba7ea 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java @@ -64,7 +64,9 @@ public interface MaterialPlanBoomMapper extends BaseMapperX query.selectAll(MaterialPlanBoomDO.class) // .select("mat.id as matId","mat.name as matName","mat.code as matCode","mat.spec as matSpec","mat.unit as matUnit","mat.material_type as matType") - .select("b.material_name as matName","m.code as matCode","b.spec as matSpec","b.unit as matUnit","b.blueprint_no as blueprintNo") + // .select("b.material_name as matName","m.code as matCode","b.spec as matSpec","b.unit as matUnit","b.blueprint_no as blueprintNo") + .select("b.material_name as matName","b.spec as matSpec","b.unit as matUnit","b.blueprint_no as blueprintNo") + .select("bc.`name` as compositionName","b.`composition_id` as compositionId") .select("ma.brief as customerBriefName,ma.project_name as projectName,ma.name as projectSubName,ma.project_id as projectId") .leftJoin(MaterialPlanDO.class,"ma",MaterialPlanDO::getId, MaterialPlanBoomDO::getProjectMaterialPlanId) @@ -73,7 +75,7 @@ public interface MaterialPlanBoomMapper extends BaseMapperX .leftJoin(CompositionDO.class, "bc", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) .leftJoin(ProjectOrderDO.class,"po",ProjectOrderDO::getId,MaterialPlanDO::getProjectId) .leftJoin(AdminUserDO.class,"u",AdminUserDO::getId, MaterialPlanBoomDO::getDuEmpId) - .leftJoin(MaterialDO.class,"m",MaterialDO::getId,MaterialPlanBoomDO::getMaterialId) +// .leftJoin(MaterialDO.class,"m",MaterialDO::getId,MaterialPlanBoomDO::getMaterialId) .eq(MaterialPlanDO::getMatType,0) .in(MaterialPlanBoomDO::getIsPurYard,Arrays.asList(0,5)) .disableSubLogicDel() diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplanboom/MaterialPlanBoomServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplanboom/MaterialPlanBoomServiceImpl.java index 7242542..76165d3 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplanboom/MaterialPlanBoomServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplanboom/MaterialPlanBoomServiceImpl.java @@ -114,6 +114,12 @@ public class MaterialPlanBoomServiceImpl implements MaterialPlanBoomService { HashMap planSubMap = new HashMap<>(); for (MaterialPlanBoomDO dp : materialPlanBoomDOList) { PurchaseOrderMakeDetailDO makeDetailDO = new PurchaseOrderMakeDetailDO(); + if (dp.getBoomDetailId() == null){ + throw exception(PURCHASE_ORDER_MAKE_DETAIL_BOOM_DETAIL_IS_EXISTS); + } + if(dp.getProjectPlanSubId() == null){ + throw exception(PURCHASE_ORDER_MAKE_DETAIL_PROJECTSUB_DETAIL_NOT_EXISTS); + } makeDetailDO.setBoomDetailId(dp.getBoomDetailId()); makeDetailDO.setBoomName(dp.getMatName()); makeDetailDO.setBoomSpec(dp.getMatSpec()); @@ -178,7 +184,8 @@ public class MaterialPlanBoomServiceImpl implements MaterialPlanBoomService { serialNumberDO.setSerialNumber(serialNumberDO.getSerialNumber()+1); // 入库前缀 - purchaseOrderMakeDO.setPurchaseNo(PURCHASE_ORDER.getCode(serialNumberDO.getSerialNumber().toString())); + String code = PURCHASE_ORDER.getCode(serialNumberDO.getSerialNumber().toString()); + purchaseOrderMakeDO.setPurchaseNo(code); purchaseOrderMakeDO.setGoodsType(1); purchaseOrderMakeDO.setStatus(1); purchaseOrderMakeDO.setSubmitUserId(loginUserId); @@ -206,7 +213,7 @@ public class MaterialPlanBoomServiceImpl implements MaterialPlanBoomService { dp.setMplanStatus(1); dp.setProjectPurchaseOrderMakeId(purchaseOrderMakeDO.getId()); dp.setProjectPurchaseOrderMakeDetailId(purchaseOrderMakeDetailDO.getId()); - dp.setPurchaseNo(purchaseOrderMakeDO.getPurchaseNo()); + dp.setPurchaseNo(code); } } } diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/materialplan/purchasemake.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/materialplan/purchasemake.vue index 4007c11..18edc0c 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/materialplan/purchasemake.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/materialplan/purchasemake.vue @@ -19,7 +19,7 @@ - + @@ -264,7 +264,9 @@ const getMateriallist = async(row) =>{ const handleSelectionChange = (selection) => { ids.value = selection; } - +const clearItem = (e) =>{ + multipleTable.value.clearSelection(); +} /** 导出按钮操作 */ const handleExportDetail = async () => { try { diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/materialplan/standardbuy.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/materialplan/standardbuy.vue index ca9200d..6d88fb7 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/materialplan/standardbuy.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/materialplan/standardbuy.vue @@ -237,7 +237,7 @@ const getRowKeys=(row)=>{ const handleSelectionChange = (selection) => { ids.value = selection; } -const clearItem = () =>{ +const clearItem = (e) =>{ multipleTable.value.clearSelection(); } /** 导出按钮操作 */