คำสั่งรักษาการแทน
This commit is contained in:
parent
87a49c5cc1
commit
1718176911
3 changed files with 269 additions and 114 deletions
|
|
@ -3373,28 +3373,28 @@ export class PositionController extends Controller {
|
|||
},
|
||||
});
|
||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
||||
|
||||
|
||||
const positionOld = await this.positionRepository.findOne({
|
||||
where: {
|
||||
posMasterId: posMasterOld?.id,
|
||||
positionIsSelected: true
|
||||
}
|
||||
})
|
||||
positionIsSelected: true,
|
||||
},
|
||||
});
|
||||
if (positionOld != null) {
|
||||
positionOld.positionIsSelected = false
|
||||
positionOld.positionIsSelected = false;
|
||||
await this.positionRepository.save(positionOld);
|
||||
}
|
||||
|
||||
const checkPosition = await this.positionRepository.find({
|
||||
where: {
|
||||
posMasterId: body.posmasterId,
|
||||
positionIsSelected: true
|
||||
}
|
||||
})
|
||||
positionIsSelected: true,
|
||||
},
|
||||
});
|
||||
if (checkPosition.length > 0) {
|
||||
const clearPosition = checkPosition.map(positions => ({
|
||||
const clearPosition = checkPosition.map((positions) => ({
|
||||
...positions,
|
||||
positionIsSelected: false
|
||||
positionIsSelected: false,
|
||||
}));
|
||||
await this.positionRepository.save(clearPosition);
|
||||
}
|
||||
|
|
@ -3412,11 +3412,11 @@ export class PositionController extends Controller {
|
|||
const positionNew = await this.positionRepository.findOne({
|
||||
where: {
|
||||
id: body.positionId,
|
||||
posMasterId: body.posmasterId
|
||||
}
|
||||
})
|
||||
if(positionNew != null) {
|
||||
positionNew.positionIsSelected = true
|
||||
posMasterId: body.posmasterId,
|
||||
},
|
||||
});
|
||||
if (positionNew != null) {
|
||||
positionNew.positionIsSelected = true;
|
||||
await this.positionRepository.save(positionNew);
|
||||
}
|
||||
return new HttpSuccess();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue