From e6afa2ef2663a4bba2f13df92867b4ef656ee4e8 Mon Sep 17 00:00:00 2001 From: luoliming Date: Tue, 23 Jan 2024 22:58:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E8=8E=B7=E5=8F=96=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/BomNewEbomParentService.java | 1 + .../domain/EBom/VirtualPackageFor31.java | 3 +++ .../mapper/master/BomNewEbomParentMapper.xml | 23 +++++++++---------- 3 files changed, 15 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 e1ae2583..3f91b57b 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 @@ -134,6 +134,7 @@ public class BomNewEbomParentService extends ServiceImpl result = this.getBaseMapper().getEBomListPage(new Page<>(query.getPage(), query.getPageSize()), query, userRoleService.getUserJob(), SessionUtil.getUserCode()); + materialMainService.intiMaterialInfo(result.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT); returnResult = result; } diff --git a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageFor31.java b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageFor31.java index ed8afcca..93ff7380 100644 --- a/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageFor31.java +++ b/nflg_project_dev/nflg-bom-new/src/main/java/com/nflg/product/bomnew/service/domain/EBom/VirtualPackageFor31.java @@ -1,12 +1,14 @@ package com.nflg.product.bomnew.service.domain.EBom; import cn.hutool.core.collection.CollUtil; +import cn.hutool.extra.spring.SpringUtil; import com.google.common.collect.ImmutableList; import com.nflg.product.base.core.exception.NflgBusinessException; import com.nflg.product.bomnew.constant.VirtualPackageTypeEnum; import com.nflg.product.bomnew.pojo.entity.BomNewEbomChildEntity; import com.nflg.product.bomnew.pojo.entity.BomNewEbomParentEntity; import com.nflg.product.bomnew.pojo.vo.BomNewEbomParentVO; +import com.nflg.product.bomnew.service.MaterialMainService; import com.nflg.product.bomnew.util.EnumUtils; import com.nflg.product.bomnew.util.VUtils; import nflg.product.common.constant.STATE; @@ -38,6 +40,7 @@ public class VirtualPackageFor31 extends VirtualPackageBase { public void generateVirtualPackage() { List child = getChild(); + SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(child); BomNewEbomParentEntity parent = getParentByRowId(bomRowId); try { 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 fd4ca34d..849bea3e 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 @@ -182,20 +182,19 @@ set root_is=0, user_root_is=0 where last_version_is = 1; - update t_bom_new_ebom_parent a join ( - select a.row_id from t_bom_new_ebom_parent a - left join t_bom_new_ebom_child b - on a.material_no=b.material_no - where a.last_version_is=1 and b.row_id is null ) t - on a.row_id=t.row_id set a.root_is=1; + update t_bom_new_ebom_parent a set a.root_is=1 ,a.user_root_is=1 where material_no not in (select material_no from ( + select b.material_no from t_bom_new_ebom_parent a + join t_bom_new_ebom_child b on a.row_id=b.parent_row_id + where a.last_version_is=1 ) b ) and last_version_is=1; - update t_bom_new_ebom_parent a join ( - select a.row_id from t_bom_new_ebom_parent a - left join t_bom_new_ebom_child b - on a.material_no=b.material_no and a.created_by=b.created_by - where a.last_version_is=1 and b.row_id is null ) t - on a.row_id=t.row_id set a.user_root_is=1; + update t_bom_new_ebom_parent a left join (select material_no ,created_by from ( + select b.material_no ,b.created_by from t_bom_new_ebom_parent a + join t_bom_new_ebom_child b on a.row_id=b.parent_row_id + where a.last_version_is=1 ) b ) t on a.material_no=t.material_no and a.created_by=t.created_by + set user_root_is=1 + where a.last_version_is=1 and t.created_by is null +