fix: 修复导入SAP时添加直发包parent的一个bug

This commit is contained in:
曹鹏飞 2024-08-22 16:22:29 +08:00
parent 5eea13aaa4
commit be8d4fab44
1 changed files with 5 additions and 1 deletions

View File

@ -160,6 +160,10 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
}
private BomNewPbomParentEntity addZFBParent(BomNewPbomChildEntity child) {
BomNewPbomParentEntity tp = bomNewPbomParentService.lambdaQuery()
.eq(BomNewPbomParentEntity::getMaterialNo, child.getMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, child.getFacCode())
.one();
BomNewPbomParentEntity parent = new BomNewPbomParentEntity();
parent.setRowId(IdWorker.getId());
parent.setCreatedTime(LocalDateTime.now());
@ -170,7 +174,7 @@ public class BomNewPbomExportToSAPImpl implements IBomNewPbomExportToSAP {
parent.setBatchNo("");
parent.setCreatedBy(SessionUtil.getUserCode());
parent.setCreatedJob(UserJobEnum.ENGINEER.getValue());
parent.setCurrentVersion(VersionUtil.getNextVersion(""));
parent.setCurrentVersion(Objects.isNull(tp) ? VersionUtil.getNextVersion("") : VersionUtil.getNextVersion(tp.getCurrentVersion()));
parent.setDeptRowId(SessionUtil.getDepartRowId());
parent.setDeptName(SessionUtil.getDepartName());
parent.setDeviseName(SessionUtil.getRealName());