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