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