update current
This commit is contained in:
parent
b0f5ff78d8
commit
8b7de2a0ba
6 changed files with 86 additions and 54 deletions
|
|
@ -3120,7 +3120,10 @@ export class CommandController extends Controller {
|
|||
orgRevisionId: posMaster.orgRevisionId,
|
||||
},
|
||||
});
|
||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
||||
if (posMasterOld != null) {
|
||||
posMasterOld.current_holderId = null;
|
||||
posMasterOld.lastUpdatedAt = new Date();
|
||||
}
|
||||
|
||||
const positionOld = await this.positionRepository.findOne({
|
||||
where: {
|
||||
|
|
@ -3148,6 +3151,7 @@ export class CommandController extends Controller {
|
|||
}
|
||||
|
||||
posMaster.current_holderId = item.profileId;
|
||||
posMaster.lastUpdatedAt = new Date();
|
||||
posMaster.conditionReason = _null;
|
||||
posMaster.isCondition = false;
|
||||
if (posMasterOld != null) await this.posMasterRepository.save(posMasterOld);
|
||||
|
|
@ -3304,7 +3308,10 @@ export class CommandController extends Controller {
|
|||
orgRevisionId: posMaster.orgRevisionId,
|
||||
},
|
||||
});
|
||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
||||
if (posMasterOld != null) {
|
||||
posMasterOld.current_holderId = null;
|
||||
posMasterOld.lastUpdatedAt = new Date();
|
||||
}
|
||||
// if (posMasterOld != null) posMasterOld.next_holderId = null;
|
||||
|
||||
const positionOld = await this.employeePositionRepository.findOne({
|
||||
|
|
@ -3333,6 +3340,7 @@ export class CommandController extends Controller {
|
|||
}
|
||||
|
||||
posMaster.current_holderId = item.profileId;
|
||||
posMaster.lastUpdatedAt = new Date();
|
||||
posMaster.next_holderId = null;
|
||||
if (posMasterOld != null) await this.employeePosMasterRepository.save(posMasterOld);
|
||||
await this.employeePosMasterRepository.save(posMaster);
|
||||
|
|
@ -3561,6 +3569,7 @@ export class CommandController extends Controller {
|
|||
await this.positionRepository.save(clearPosition);
|
||||
}
|
||||
posMaster.current_holderId = profile.id;
|
||||
posMaster.lastUpdatedAt = new Date();
|
||||
posMaster.conditionReason = _null;
|
||||
posMaster.isCondition = false;
|
||||
await this.posMasterRepository.save(posMaster);
|
||||
|
|
@ -5987,7 +5996,10 @@ export class CommandController extends Controller {
|
|||
orgRevisionId: posMaster.orgRevisionId,
|
||||
},
|
||||
});
|
||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
||||
if (posMasterOld != null) {
|
||||
posMasterOld.current_holderId = null;
|
||||
posMasterOld.lastUpdatedAt = new Date();
|
||||
}
|
||||
|
||||
const positionOld = await this.positionRepository.findOne({
|
||||
where: {
|
||||
|
|
@ -6015,6 +6027,7 @@ export class CommandController extends Controller {
|
|||
}
|
||||
|
||||
posMaster.current_holderId = profile.id;
|
||||
posMaster.lastUpdatedAt = new Date();
|
||||
posMaster.conditionReason = _null;
|
||||
posMaster.isCondition = false;
|
||||
if (posMasterOld != null) await this.posMasterRepository.save(posMasterOld);
|
||||
|
|
@ -6364,7 +6377,10 @@ export class CommandController extends Controller {
|
|||
orgRevisionId: posMaster.orgRevisionId,
|
||||
},
|
||||
});
|
||||
if (posMasterOld != null) posMasterOld.current_holderId = null;
|
||||
if (posMasterOld != null) {
|
||||
posMasterOld.current_holderId = null;
|
||||
posMasterOld.lastUpdatedAt = new Date();
|
||||
}
|
||||
// if (posMasterOld != null) posMasterOld.next_holderId = null;
|
||||
|
||||
const positionOld = await this.employeePositionRepository.findOne({
|
||||
|
|
@ -6393,6 +6409,7 @@ export class CommandController extends Controller {
|
|||
}
|
||||
|
||||
posMaster.current_holderId = profile.id;
|
||||
posMaster.lastUpdatedAt = new Date();
|
||||
posMaster.next_holderId = null;
|
||||
if (posMasterOld != null) await this.employeePosMasterRepository.save(posMasterOld);
|
||||
await this.employeePosMasterRepository.save(posMaster);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue