diff --git a/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java b/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java index ec0cbd31..52699116 100644 --- a/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java +++ b/src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java @@ -2611,7 +2611,14 @@ public class PartInformationServiceImpl extends ServiceImpl customerPartToAdd = partList.stream() + .filter(a -> partInformationMapper.getProjectCustomerPartNo(a) == null) + .collect(Collectors.toList()); + if (!customerPartToAdd.isEmpty()) { + partInformationMapper.addCustomerPartInfo(customerPartToAdd); + } } /** diff --git a/src/main/resources/mapper/part/PartInformationMapper.xml b/src/main/resources/mapper/part/PartInformationMapper.xml index 6c54516b..a2b33074 100644 --- a/src/main/resources/mapper/part/PartInformationMapper.xml +++ b/src/main/resources/mapper/part/PartInformationMapper.xml @@ -1371,12 +1371,15 @@ a.test_part_no, c.part_desc, a.bu_no, - dbo.plm_get_bu_desc(a.site,a.bu_no) buDesc, + c.ifs_part_no as finalPartNo, - c.plm_part_no + c.plm_part_no, + dbo.get_customer_part_no(a.site, a.test_part_no, #{query.customerId}, 'ProjectPart') as customer_part_no from plm_project_part a - left join plm_project_part b on a.site = b.site and a.bu_no = b.bu_no and a.project_id = b.project_id and a.test_part_no = b.project_id and b.site = #{query.site} and b.project_id = #{query.projectId} + left join plm_project_part b on a.site = b.site and a.bu_no = b.bu_no and a.project_id = b.project_id + and a.test_part_no = b.project_id and b.site = #{query.site} and b.project_id = #{query.projectId} left join part as c on a.site = c.site and a.test_part_no = c.part_no + where b.site is null and c.show_in_query_flag = 'Y' and c.part_no not in @@ -1452,10 +1455,12 @@ a.status, a.temporary_part_flag, a.show_in_query_flag, - a.plm_part_no + a.plm_part_no, + dbo.get_customer_part_no(a.site, a.part_no, #{query.customerId}, 'InventoryPart') as customer_part_no FROM part as a left join plm_project_part as b on a.site = b.site and a.plm_part_no = b.test_part_no left join plm_project_part as c on a.site = c.site and a.ifs_part_no = c.test_part_no + where a.site = #{query.site} and a.active = 'Y' and a.show_in_query_flag = 'Y'