fix(dqbom): 优化查询条件

This commit is contained in:
曹鹏飞 2024-08-26 10:12:14 +08:00
parent 14fa056416
commit a77936dc42
1 changed files with 5 additions and 3 deletions

View File

@ -584,7 +584,7 @@ public class DQBomService {
p.setReleaseTime(LocalDateTime.now());
p.setReleaseUserName(SessionUtil.getUserName());
p.setDeptRowId(SessionUtil.getDepartRowId());
p.setSource(2);
p.setSource(PbomSourceEnum.FROM_DQBOM.getValue());
});
bomNewPbomParentService.saveBatch(pparents);
}
@ -600,8 +600,10 @@ public class DQBomService {
wrapper.ne(BomNewDQbomParentEntity::getRowId, parent.getRowId());
dQBomParentService.getBaseMapper().delete(wrapper);
BomNewPbomParentEntity pp = bomNewPbomParentService.lambdaQuery().eq(BomNewPbomParentEntity::getMaterialNo, parent.getMaterialNo())
.orderByDesc(BomNewPbomParentEntity::getRowId)
BomNewPbomParentEntity pp = bomNewPbomParentService.lambdaQuery()
.eq(BomNewPbomParentEntity::getMaterialNo, parent.getMaterialNo())
.eq(BomNewPbomParentEntity::getFacCode, FactoryCodeEnum.FACTORY_1010.getValue())
.orderByDesc(BomNewPbomParentEntity::getCurrentVersion)
.last(" limit 1")
.one();
if (!Objects.isNull(pp)) {