|
|
|
@ -717,6 +717,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
List<PartIfsInventoryProperty> ifsProperty = savePartItemInfo2(data); |
|
|
|
|
|
|
|
PartRevisionEntity partRevision = partInformationMapper.getPartRevision(data); |
|
|
|
// 从 Purchased (raw) 改为其他 |
|
|
|
if ("Purchased (raw)".equals(partData.getPartType()) && !data.getPartType().equals(partData.getPartType())) { |
|
|
|
// 查版本为1的版本 |
|
|
|
if (partRevision != null) { // 该物料存在版本为1的版本 |
|
|
|
@ -742,23 +743,40 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
savePartRoutingInfo2(data); |
|
|
|
} |
|
|
|
} |
|
|
|
// 类型由 Manufactured 或 Purchased 改为 Manufactured Recipe |
|
|
|
// 类型由 Manufactured 或 Purchased 改为 Manufactured Recipe 删除BOM 新增配方 |
|
|
|
if (("Manufactured".equals(partData.getPartType()) || "Purchased".equals(partData.getPartType())) && "Manufactured Recipe".equals(data.getPartType())) { |
|
|
|
if (partRevision != null) { |
|
|
|
partTypeChangeToManufacturedRecipe(data, partRevision); |
|
|
|
} |
|
|
|
} |
|
|
|
// 类型由 Manufactured Recipe 改为 Manufactured Recipe 或 Purchased |
|
|
|
|
|
|
|
// 类型由 Manufactured Recipe 改为 Manufactured 或 Purchased 删除配方 新增BOM |
|
|
|
if ("Manufactured Recipe".equals(partData.getPartType()) && ("Manufactured".equals(data.getPartType()) || "Purchased".equals(data.getPartType()))) { |
|
|
|
if (partRevision != null) { |
|
|
|
partTypeChangeToManufactured(data, partRevision); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 类型由 Purchased 改为 Manufactured 新增Routing 增加新类型的BOM |
|
|
|
if ("Purchased".equals(partData.getPartType()) && "Manufactured".equals(data.getPartType())) { |
|
|
|
if (partRevision != null) { |
|
|
|
BomHeaderEntity bomHeader = new BomHeaderEntity(); |
|
|
|
bomHeader.setSite(data.getSite()); |
|
|
|
bomHeader.setPartNo(data.getPartNo()); |
|
|
|
bomHeader.setBomType("Manufacturing"); |
|
|
|
bomHeader.setEffPhaseInDate(partRevision.getEffPhaseInDate()); |
|
|
|
bomHeader.setEngRevision(partRevision.getEngRevision()); |
|
|
|
bomHeader.setEngChgLevel(1); |
|
|
|
savePartBomInfo(bomHeader); |
|
|
|
} |
|
|
|
savePartRoutingInfo2(data); |
|
|
|
} |
|
|
|
|
|
|
|
// 如果物料类型改为了 Purchased (raw) 则删除 BOM、recipe 和 routing |
|
|
|
if ("Purchased (raw)".equals(data.getPartType()) && !data.getPartType().equals(partData.getPartType())) { |
|
|
|
delBomAndRecipeAndRoutingByPartNo(data); |
|
|
|
} |
|
|
|
|
|
|
|
// 编辑材料信息 |
|
|
|
UpdateWrapper<PartInformationEntity> updateInformationWrapper = new UpdateWrapper<>(); |
|
|
|
updateInformationWrapper.eq("site", data.getSite()); |
|
|
|
@ -843,7 +861,7 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
|
|
|
|
@Transactional |
|
|
|
public void partTypeChangeToManufactured(PartInformationVo data, PartRevisionEntity partRevision) { |
|
|
|
// 新增配方 |
|
|
|
// 新增BOM |
|
|
|
BomHeaderEntity bomHeader = new BomHeaderEntity(); |
|
|
|
bomHeader.setSite(data.getSite()); |
|
|
|
bomHeader.setPartNo(data.getPartNo()); |
|
|
|
|