From 7c4da752c0d5ab8483b5789a89944a3fca8555c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Tue, 18 Jun 2024 10:37:28 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=98=A8=E5=A4=A9=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bomnew/service/BomNewEbomParentService.java | 6 +++--- .../mapper/master/BomNewEbomParentMapper.xml | 16 +++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java index 7ed66be7..334a220e 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/BomNewEbomParentService.java @@ -910,7 +910,7 @@ public class BomNewEbomParentService extends ServiceImpl delParentBom = delEBomParents.stream().filter(u -> u.getBomRowId() > 0).map(BomNewEbomParentVO::getBomRowId).collect(Collectors.toList()); if(CollUtil.isNotEmpty(delParentBom)){ this.getBaseMapper().delBatch(delParentBom); - ebomChildService.getBaseMapper().delBomChild(delParentBom); +// ebomChildService.getBaseMapper().delBomChild(delParentBom); } } //需修改正式版BOM的版本 @@ -933,11 +933,11 @@ public class BomNewEbomParentService extends ServiceImpl bomRowIds = bomTree.stream().filter(u -> u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList()); + List bomRowIds = bomTree.stream().filter(u ->!EBomStatusEnum.PUBLISHED.equalsValue(u.getStatus()) && u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList()); if (CollUtil.isNotEmpty(bomRowIds)) { this.getBaseMapper().updateStateBatchByRowIds(EBomStatusEnum.PUBLISHED.getValue(), bomRowIds); //将历史已发布版-转移到正式历史表 - eBomToFormal(bomRowIds, bomTree.stream().filter(u -> u.getBomRowId() > 0).collect(Collectors.toList()) ); + eBomToFormal(bomRowIds, bomTree.stream().filter(u ->!EBomStatusEnum.PUBLISHED.equalsValue(u.getStatus()) && u.getBomRowId() > 0).collect(Collectors.toList()) ); } //子级记录-bom版本 List bomChildren = new ArrayList<>(); diff --git a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomParentMapper.xml b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomParentMapper.xml index 18b0d035..e33fb42e 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomParentMapper.xml +++ b/nflg_project_dev/nflg-bom-new/src/main/resources/mapper/master/BomNewEbomParentMapper.xml @@ -512,26 +512,24 @@ INSERT INTO `t_bom_new_ebom_parent_formal` (`row_id`, `batch_no`, `drawing_no`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_original_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `source`, `root_is`, `should_bom_exist`, `super_material_status`, `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtrual_package_enum`, `exception_status`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `created_job`, `audit_time`, `audit_user_name`, `release_time`, `release_user_name`, `revert_time`, `revert_user_name`, `expire_end_time`, `convert_to_ebom_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `sap_state`, `sap_time`) - select `row_id`, `batch_no`, `drawing_no`, `material_no`, `order_number`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_original_unit`, `unit_weight`, `total_weight`, `current_version`, `num`, `source`, `root_is`, `should_bom_exist`, `super_material_status`, `bom_exist`, `last_version_is`, `edit_status`, `status`, `user_root_is`, `virtrual_package_enum`, `exception_status`, `virtual_package_is`, `source_row_id`, `devise_user_code`, `devise_name`, `created_by`, `created_time`, `created_job`, `audit_time`, `audit_user_name`, `release_time`, `release_user_name`, `revert_time`, `revert_user_name`, `expire_end_time`, `convert_to_ebom_time`, `remark`, `dept_name`, `level_num`, `change_desc`, `notice_nums`, `modify_time`, `sap_state`, `sap_time` from t_bom_new_ebom_parent - where row_id in - - #{item} - and row_id not in ( - select row_id from t_bom_new_ebom_parent_formal where row_id in + select a.`row_id`, a.`batch_no`, a.`drawing_no`, a.`material_no`, a.`order_number`, a.`material_name`, a.`material_desc`, a.`material_texture`, a.`material_unit`, a.`material_original_unit`, a.`unit_weight`, a.`total_weight`, a.`current_version`, a.`num`, a.`source`, a.`root_is`, a.`should_bom_exist`, a.`super_material_status`, a.`bom_exist`, a.`last_version_is`, a.`edit_status`, a.`status`, a.`user_root_is`, a.`virtrual_package_enum`, a.`exception_status`, a.`virtual_package_is`, a.`source_row_id`, a.`devise_user_code`, a.`devise_name`, a.`created_by`, a.`created_time`, a.`created_job`, a.`audit_time`, a.`audit_user_name`, a.`release_time`, a.`release_user_name`, a.`revert_time`, a.`revert_user_name`, a.`expire_end_time`, a.`convert_to_ebom_time`, a.`remark`, a.`dept_name`, a.`level_num`, a.`change_desc`, a.`notice_nums`, a.`modify_time`, a.`sap_state`, a.`sap_time` + from t_bom_new_ebom_parent a + left join t_bom_new_ebom_parent_formal b on a.row_id = b.row_id + where a.row_id in #{item} - ) + and b.row_id is null INSERT INTO `t_bom_new_ebom_child_formal` (`row_id`, `parent_row_id`, `identity_no`, `order_number`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_category_code`, `unit_weight`, `num`, `total_weight`, `project_type`, `project_type_input_type`, `created_by`, `virtual_part_is`, `created_time`, `modify_time`, `edit_status`, `exception_status`, `source`, `source_row_id`, `remark`, `virtual_part_type`, `virtual_part_root_material_no`, `bom_version_row_id`) select `row_id`, `parent_row_id`, `identity_no`, `order_number`, `drawing_no`, `material_no`, `material_name`, `material_desc`, `material_texture`, `material_unit`, `material_category_code`, `unit_weight`, `num`, `total_weight`, `project_type`, `project_type_input_type`, `created_by`, `virtual_part_is`, `created_time`, `modify_time`, `edit_status`, `exception_status`, `source`, `source_row_id`, `remark`, `virtual_part_type`, `virtual_part_root_material_no`, `bom_version_row_id` - from t_bom_new_ebom_child + from t_bom_new_ebom_child a where parent_row_id in #{parentRowId} - and row_id not in ( + and parent_row_id not in( select row_id from t_bom_new_ebom_parent_formal where row_id in #{item}