|
|
|
@ -2134,47 +2134,48 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
// 2025-06-27(Inventory Part编辑中的Copy Part功能) |
|
|
|
// Copy后根据原料号的项目+BU(BU放出来,默认原料号的BU) |
|
|
|
// Copy后的料号插入到项目料号中(如果没有项目则不处理) |
|
|
|
if (!"Y".equals(inData.getCopyFlag())) { // 不是转正页面 |
|
|
|
// 校验原物料有没有项目 |
|
|
|
List<PartInformationVo> projectParts = partInformationMapper.getProjectPartByPartNo(inData.getSite(), fromPart.getPartNo()); |
|
|
|
if (!projectParts.isEmpty()) { |
|
|
|
// 判断是不是临时物料 如果是临时物料 则给BaseNo 和 RevNo赋值 |
|
|
|
String baseNo; |
|
|
|
String revNo; |
|
|
|
if (!"Y".equals(fromPart.getStatus())) { |
|
|
|
TransNoControlData noData = partInformationMapper.getTranNoData(inData.getSite(), "project_part_no"); |
|
|
|
int a = noData.getTransNo().length() + noData.getLength(); |
|
|
|
baseNo = toPart.getPartNo().substring(0, a); |
|
|
|
revNo = toPart.getPartNo().substring(a); |
|
|
|
} else { |
|
|
|
baseNo = ""; |
|
|
|
revNo = ""; |
|
|
|
} |
|
|
|
List<PartInformationVo> projectPartList = projectParts.stream().map(a -> { |
|
|
|
a.setPartNo(toPart.getPartNo()); |
|
|
|
a.setBaseNo(baseNo); |
|
|
|
a.setRevNo(revNo); |
|
|
|
a.setPartNoSource("料号导入"); |
|
|
|
a.setVirtualPartNo(toPart.getPartNo()); |
|
|
|
a.setCreateBy(inData.getCreateBy()); |
|
|
|
a.setFinalPartNo(toPart.getPartNo()); |
|
|
|
return a; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
// 新增项目物料 |
|
|
|
partInformationMapper.batchSaveProjectPart(projectPartList); |
|
|
|
|
|
|
|
// List<PartInformationVo> projectCustomers = partInformationMapper.getProjectCustomerPartByPartNo(inData.getSite(), fromPart.getPartNo()); |
|
|
|
// if (!projectCustomers.isEmpty()) { |
|
|
|
// List<PartInformationVo> customerPartList = projectCustomers.stream().map(a -> { |
|
|
|
// a.setPartNo(toPart.getPartNo()); |
|
|
|
// a.setCreateBy(inData.getCreateBy()); |
|
|
|
// return a; |
|
|
|
// }).collect(Collectors.toList()); |
|
|
|
// // 新增客户物料 |
|
|
|
// partInformationMapper.batchSaveCustomerPart(customerPartList); |
|
|
|
// 2026-03-13 不按照原料号的项目信息将新料号保存到项目料号中 |
|
|
|
// if (!"Y".equals(inData.getCopyFlag())) { // 不是转正页面 |
|
|
|
// // 校验原物料有没有项目 |
|
|
|
// List<PartInformationVo> projectParts = partInformationMapper.getProjectPartByPartNo(inData.getSite(), fromPart.getPartNo()); |
|
|
|
// if (!projectParts.isEmpty()) { |
|
|
|
// // 判断是不是临时物料 如果是临时物料 则给BaseNo 和 RevNo赋值 |
|
|
|
// String baseNo; |
|
|
|
// String revNo; |
|
|
|
// if (!"Y".equals(fromPart.getStatus())) { |
|
|
|
// TransNoControlData noData = partInformationMapper.getTranNoData(inData.getSite(), "project_part_no"); |
|
|
|
// int a = noData.getTransNo().length() + noData.getLength(); |
|
|
|
// baseNo = toPart.getPartNo().substring(0, a); |
|
|
|
// revNo = toPart.getPartNo().substring(a); |
|
|
|
// } else { |
|
|
|
// baseNo = ""; |
|
|
|
// revNo = ""; |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
// List<PartInformationVo> projectPartList = projectParts.stream().map(a -> { |
|
|
|
// a.setPartNo(toPart.getPartNo()); |
|
|
|
// a.setBaseNo(baseNo); |
|
|
|
// a.setRevNo(revNo); |
|
|
|
// a.setPartNoSource("料号导入"); |
|
|
|
// a.setVirtualPartNo(toPart.getPartNo()); |
|
|
|
// a.setCreateBy(inData.getCreateBy()); |
|
|
|
// a.setFinalPartNo(toPart.getPartNo()); |
|
|
|
// return a; |
|
|
|
// }).collect(Collectors.toList()); |
|
|
|
// // 新增项目物料 |
|
|
|
// partInformationMapper.batchSaveProjectPart(projectPartList); |
|
|
|
// |
|
|
|
//// List<PartInformationVo> projectCustomers = partInformationMapper.getProjectCustomerPartByPartNo(inData.getSite(), fromPart.getPartNo()); |
|
|
|
//// if (!projectCustomers.isEmpty()) { |
|
|
|
//// List<PartInformationVo> customerPartList = projectCustomers.stream().map(a -> { |
|
|
|
//// a.setPartNo(toPart.getPartNo()); |
|
|
|
//// a.setCreateBy(inData.getCreateBy()); |
|
|
|
//// return a; |
|
|
|
//// }).collect(Collectors.toList()); |
|
|
|
//// // 新增客户物料 |
|
|
|
//// partInformationMapper.batchSaveCustomerPart(customerPartList); |
|
|
|
//// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
public PartInformationEntity createCopyToPart(PartInformationVo inData, PartInformationEntity fromPart) { |
|
|
|
|