fix
This commit is contained in:
parent
4d3769e4b4
commit
7b29823f9e
2 changed files with 33 additions and 4 deletions
|
|
@ -1473,6 +1473,12 @@ export class PositionController extends Controller {
|
|||
posMaster.orgRootId = org.id;
|
||||
posMaster.orgRevisionId = org.orgRevisionId;
|
||||
}
|
||||
const lastPosMasterNo = await this.posMasterRepository.find({
|
||||
where:{
|
||||
orgRootId:requestBody.id,
|
||||
orgChild1Id: Not(IsNull())
|
||||
}
|
||||
})
|
||||
}
|
||||
if (requestBody.type == 1) {
|
||||
const org = await this.child1Repository.findOne({
|
||||
|
|
@ -1483,6 +1489,12 @@ export class PositionController extends Controller {
|
|||
posMaster.orgChild1Id = org.id;
|
||||
posMaster.orgRevisionId = org.orgRevisionId;
|
||||
}
|
||||
const lastPosMasterNo = await this.posMasterRepository.find({
|
||||
where:{
|
||||
orgChild1Id:requestBody.id,
|
||||
orgChild2Id: Not(IsNull())
|
||||
}
|
||||
})
|
||||
}
|
||||
if (requestBody.type == 2) {
|
||||
const org = await this.child2Repository.findOne({
|
||||
|
|
@ -1494,6 +1506,12 @@ export class PositionController extends Controller {
|
|||
posMaster.orgChild2Id = org.id;
|
||||
posMaster.orgRevisionId = org.orgRevisionId;
|
||||
}
|
||||
const lastPosMasterNo = await this.posMasterRepository.find({
|
||||
where:{
|
||||
orgChild2Id:requestBody.id,
|
||||
orgChild3Id: Not(IsNull())
|
||||
}
|
||||
})
|
||||
}
|
||||
if (requestBody.type == 3) {
|
||||
const org = await this.child3Repository.findOne({
|
||||
|
|
@ -1507,6 +1525,12 @@ export class PositionController extends Controller {
|
|||
posMaster.orgRevisionId = org.orgRevisionId;
|
||||
}
|
||||
}
|
||||
const lastPosMasterNo = await this.posMasterRepository.find({
|
||||
where:{
|
||||
orgChild3Id:requestBody.id,
|
||||
orgChild4Id: Not(IsNull())
|
||||
}
|
||||
})
|
||||
if (requestBody.type == 4) {
|
||||
const org = await this.child4Repository.findOne({
|
||||
where: { id: requestBody.id },
|
||||
|
|
@ -1519,6 +1543,11 @@ export class PositionController extends Controller {
|
|||
posMaster.orgChild4Id = org.id;
|
||||
posMaster.orgRevisionId = org.orgRevisionId;
|
||||
}
|
||||
const lastPosMasterNo = await this.posMasterRepository.find({
|
||||
where:{
|
||||
orgChild4Id:requestBody.id
|
||||
}
|
||||
})
|
||||
}
|
||||
const allPosMasterNo = posMasters.map(posMaster => posMaster.posMasterNo);
|
||||
const maxPosMasterNo = Math.max(...allPosMasterNo);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue