Task #2207 กรณีคนขอโอนอยู่ในสำนักปลัดกรุงเทพมหานคร
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m2s

This commit is contained in:
harid 2026-01-20 16:40:10 +07:00
parent 7423a4f8b5
commit b1210d51e8
2 changed files with 12 additions and 3 deletions

View file

@ -7418,7 +7418,8 @@ export class ProfileController extends Controller {
posNo: null,
privacyCheckin: profile.privacyCheckin,
privacyUser: profile.privacyUser,
privacyMgt : profile.privacyMgt
privacyMgt : profile.privacyMgt,
isDeputy: root?.isDeputy ?? false,
// root?.orgRootShortName && posMaster?.posMasterNo
// ? `${root?.orgRootShortName} ${posMaster?.posMasterNo}`
// : "",
@ -7590,7 +7591,8 @@ export class ProfileController extends Controller {
posNo: null,
privacyCheckin: profile.privacyCheckin,
privacyUser: profile.privacyUser,
privacyMgt : profile.privacyMgt
privacyMgt : profile.privacyMgt,
isDeputy: root?.isDeputy ?? false,
// root?.orgRootShortName && posMaster?.posMasterNo
// ? `${root?.orgRootShortName} ${posMaster?.posMasterNo}`
// : "",

View file

@ -53,6 +53,7 @@ export class WorkflowController extends Controller {
posLevelName: string;
posTypeName: string;
fullName?: string | null;
isDeputy?: boolean | null;
},
) {
// ขั้นที่ 1: ทำการค้นหา profile และ metaWorkflow แบบ parallel
@ -144,7 +145,13 @@ export class WorkflowController extends Controller {
metaStates.find((metaState) => metaState.id === metaStateOp.metaStateId)?.order ===
state.order,
);
// Task #2207 กรณีคนขอโอนอยู่ในสำนักปลัดกรุงเทพมหานคร
if (body.isDeputy && metaStateOp.operator == "PersonnelOfficer" && correspondingState?.order == 1) {
return;
}
else if (body.isDeputy && metaStateOp.operator == "Officer" && [1, 2].includes(correspondingState?.order as number)) {
metaStateOp.operator = "PersonnelOfficer"
}
if (correspondingState) {
const stateOperator = new StateOperator();
Object.assign(stateOperator, {