1、昨天问题修复

This commit is contained in:
大米 2024-06-18 10:37:28 +08:00
parent 5b3509dccd
commit 7c4da752c0
2 changed files with 10 additions and 12 deletions

View File

@ -910,7 +910,7 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
List<Long> 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<BomNewEbomParentMapper,
if(CollUtil.isNotEmpty(materialNos)){
pBomParentService.getBaseMapper().updateWaitPublicRootState(materialNos);
}
List<Long> bomRowIds = bomTree.stream().filter(u -> u.getBomRowId() > 0).map(u -> u.getBomRowId()).collect(Collectors.toList());
List<Long> 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<BomNewEbomChildEntity> bomChildren = new ArrayList<>();

View File

@ -512,26 +512,24 @@
<insert id="insertEBomFormalParent">
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
<foreach collection="parentRowIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach> 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
<foreach collection="parentRowIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
)
and b.row_id is null
</insert>
<insert id="insertEBomFormalChild">
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
<foreach collection="parentRowIds" item="parentRowId" open="(" separator="," close=")">
#{parentRowId}
</foreach> and row_id not in (
</foreach> and parent_row_id not in(
select row_id from t_bom_new_ebom_parent_formal where row_id in
<foreach collection="parentRowIds" item="item" index="index" open="(" close=")" separator=",">
#{item}