From 41efa061341f0a8a0b6523a42c98d8e28feddfe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=B1=B3?= <470431449@qq.com> Date: Sun, 17 Dec 2023 15:32:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.ebom-=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/bomnew/service/BomNewEbomParentService.java | 8 +++++--- .../resources/mapper/master/BomNewEbomParentMapper.xml | 2 +- 2 files changed, 6 insertions(+), 4 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 32154d32..e14d3398 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 @@ -98,10 +98,12 @@ public class BomNewEbomParentService extends ServiceImpl parentMaterialByMaterialNo = getParentMaterialByMaterialNo(materialNo, !userRoleService.technician()); - List parents = this.getBaseMapper().getParentForMaterialNoSeach(parentMaterialByMaterialNo); - List childs = this.getBaseMapper().getChildForMaterialNoSeach(parentMaterialByMaterialNo); + if(CollUtil.isNotEmpty(parentMaterialByMaterialNo)) { + List parents = this.getBaseMapper().getParentForMaterialNoSeach(parentMaterialByMaterialNo); + List childs = this.getBaseMapper().getChildForMaterialNoSeach(parentMaterialByMaterialNo); - returnResult= handSeachToTree(parents,childs); + returnResult = handSeachToTree(parents, childs); + } } }else { Page result = this.getBaseMapper().getEBomListPage(new Page<>(query.getPage(), query.getPageSize()), query, userRoleService.getUserJob(), SessionUtil.getUserCode()); 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 08f68070..4ca707d6 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 @@ -150,7 +150,7 @@