#2387 [กทม]. ระบบโครงสร้างอัตรากำลัง >> กรณีนั่งทับตำแหน่ง
This commit is contained in:
parent
dc31ec0d7d
commit
38e5ed0e91
4 changed files with 30 additions and 19 deletions
|
|
@ -3699,11 +3699,14 @@ export class CommandController extends Controller {
|
||||||
posMasterId: item.posmasterId,
|
posMasterId: item.posmasterId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
// ถ้าไม่ใช่ตำแหน่งนั่งทับ (isSit = false) ถึงจะอัพเดทตำแหน่งในทะเบียนประวัติ
|
||||||
if (positionNew != null) {
|
if (positionNew != null) {
|
||||||
positionNew.positionIsSelected = true;
|
positionNew.positionIsSelected = true;
|
||||||
profile.posLevelId = positionNew.posLevelId;
|
if(!posMaster.isSit){
|
||||||
profile.posTypeId = positionNew.posTypeId;
|
profile.posLevelId = positionNew.posLevelId;
|
||||||
profile.position = positionNew.positionName;
|
profile.posTypeId = positionNew.posTypeId;
|
||||||
|
profile.position = positionNew.positionName;
|
||||||
|
}
|
||||||
profile.amount = item.amount ?? null;
|
profile.amount = item.amount ?? null;
|
||||||
profile.amountSpecial = item.amountSpecial ?? null;
|
profile.amountSpecial = item.amountSpecial ?? null;
|
||||||
await this.profileRepository.save(profile);
|
await this.profileRepository.save(profile);
|
||||||
|
|
@ -6892,14 +6895,17 @@ export class CommandController extends Controller {
|
||||||
posMasterId: item.bodyPosition.posmasterId,
|
posMasterId: item.bodyPosition.posmasterId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
// ถ้าไม่ใช่ตำแหน่งนั่งทับ (isSit = false) ถึงจะอัพเดทตำแหน่งในทะเบียนประวัติ
|
||||||
if (positionNew != null) {
|
if (positionNew != null) {
|
||||||
positionNew.positionIsSelected = true;
|
positionNew.positionIsSelected = true;
|
||||||
profile.posLevelId = positionNew.posLevelId;
|
if(!posMaster.isSit){
|
||||||
profile.posTypeId = positionNew.posTypeId;
|
profile.posLevelId = positionNew.posLevelId;
|
||||||
profile.position = positionNew.positionName;
|
profile.posTypeId = positionNew.posTypeId;
|
||||||
// profile.dateStart = new Date();
|
profile.position = positionNew.positionName;
|
||||||
await this.profileRepository.save(profile, { data: req });
|
// profile.dateStart = new Date();
|
||||||
setLogDataDiff(req, { before, after: profile });
|
await this.profileRepository.save(profile, { data: req });
|
||||||
|
setLogDataDiff(req, { before, after: profile });
|
||||||
|
}
|
||||||
await this.positionRepository.save(positionNew, { data: req });
|
await this.positionRepository.save(positionNew, { data: req });
|
||||||
}
|
}
|
||||||
await CreatePosMasterHistoryOfficer(posMaster.id, req);
|
await CreatePosMasterHistoryOfficer(posMaster.id, req);
|
||||||
|
|
|
||||||
|
|
@ -8927,16 +8927,17 @@ export class OrganizationController extends Controller {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Collect history data for the selected position
|
||||||
|
const draftPosMaster = draftPosMasterMap.get(draftPosMasterId) as any;
|
||||||
|
|
||||||
// Collect profile update for the selected position
|
// Collect profile update for the selected position
|
||||||
if (nextHolderId != null && draftPos.positionIsSelected) {
|
// ถ้าไม่ใช่ตำแหน่งนั่งทับ (isSit = false) ถึงจะอัพเดทตำแหน่งในทะเบียนประวัติ
|
||||||
|
if (nextHolderId != null && draftPos.positionIsSelected && !draftPosMaster?.isSit) {
|
||||||
profileUpdates.set(nextHolderId, {
|
profileUpdates.set(nextHolderId, {
|
||||||
position: draftPos.positionName,
|
position: draftPos.positionName,
|
||||||
posTypeId: draftPos.posTypeId,
|
posTypeId: draftPos.posTypeId,
|
||||||
posLevelId: draftPos.posLevelId,
|
posLevelId: draftPos.posLevelId,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Collect history data for the selected position
|
|
||||||
const draftPosMaster = draftPosMasterMap.get(draftPosMasterId) as any;
|
|
||||||
if (draftPosMaster && draftPosMaster.ancestorDNA) {
|
if (draftPosMaster && draftPosMaster.ancestorDNA) {
|
||||||
// Find the selected position from draft positions
|
// Find the selected position from draft positions
|
||||||
const selectedPos =
|
const selectedPos =
|
||||||
|
|
|
||||||
|
|
@ -3826,11 +3826,14 @@ export class PositionController extends Controller {
|
||||||
where: { id: requestBody.position, posMasterId: requestBody.posMaster },
|
where: { id: requestBody.position, posMasterId: requestBody.posMaster },
|
||||||
});
|
});
|
||||||
if (_position) {
|
if (_position) {
|
||||||
_profile.position = _position.positionName;
|
// ถ้าไม่ใช่ตำแหน่งนั่งทับ (isSit = false) ถึงจะอัพเดทตำแหน่งในทะเบียนประวัติ
|
||||||
_profile.posTypeId = _position.posTypeId;
|
if(!dataMaster.isSit){
|
||||||
_profile.posLevelId = _position.posLevelId;
|
_profile.position = _position.positionName;
|
||||||
await this.profileRepository.save(_profile);
|
_profile.posTypeId = _position.posTypeId;
|
||||||
setLogDataDiff(request, { before, after: _profile });
|
_profile.posLevelId = _position.posLevelId;
|
||||||
|
await this.profileRepository.save(_profile);
|
||||||
|
setLogDataDiff(request, { before, after: _profile });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dataMaster.current_holderId = requestBody.profileId;
|
dataMaster.current_holderId = requestBody.profileId;
|
||||||
|
|
|
||||||
|
|
@ -651,7 +651,8 @@ async function handler_org(msg: amqp.ConsumeMessage): Promise<boolean> {
|
||||||
await posMasterAssignRepository.save(newAssigns);
|
await posMasterAssignRepository.save(newAssigns);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.next_holderId != null) {
|
// ถ้าไม่ใช่ตำแหน่งนั่งทับ (isSit = false) ถึงจะอัพเดทตำแหน่งในทะเบียนประวัติ
|
||||||
|
if (item.next_holderId != null && !item.isSit) {
|
||||||
const profile = await repoProfile.findOne({
|
const profile = await repoProfile.findOne({
|
||||||
where: { id: item.next_holderId == null ? "" : item.next_holderId },
|
where: { id: item.next_holderId == null ? "" : item.next_holderId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue