Browse Source

2025-08-08

master
fengyuan_yang 5 months ago
parent
commit
af5581465c
  1. 9
      src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java
  2. 13
      src/main/resources/mapper/part/PartInformationMapper.xml

9
src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

@ -2611,7 +2611,14 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
return a;
}).collect(Collectors.toList());
partInformationMapper.addProjectPart(partList);
partInformationMapper.addCustomerPartInfo(partList);
// 校验是否已经有了客户物料 没有则新增
List<PartInformationVo> customerPartToAdd = partList.stream()
.filter(a -> partInformationMapper.getProjectCustomerPartNo(a) == null)
.collect(Collectors.toList());
if (!customerPartToAdd.isEmpty()) {
partInformationMapper.addCustomerPartInfo(customerPartToAdd);
}
}
/**

13
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,
<!-- 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
<!-- left join plm_customer_part_info as d on a.site = d.site and a.test_part_no = d.part_no and d.customer_no = #{query.customerId}-->
where b.site is null and c.show_in_query_flag = 'Y'
and c.part_no not in
<foreach collection="query.arr" close=")" open="(" item="item" separator=",">
@ -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
<!-- left join plm_customer_part_info as d on a.site = d.site and a.part_no = d.part_no and customer_no = #{query.customerId}-->
where a.site = #{query.site}
and a.active = 'Y'
and a.show_in_query_flag = 'Y'

Loading…
Cancel
Save