Merge branch 'develop' into adiDev
This commit is contained in:
commit
aaf2ad880d
8 changed files with 162 additions and 16 deletions
|
|
@ -263,6 +263,7 @@ export class DevelopmentRequestController extends Controller {
|
||||||
sysName: "REGISTRY_IDP",
|
sysName: "REGISTRY_IDP",
|
||||||
posLevelName: profile.posLevel.posLevelName,
|
posLevelName: profile.posLevel.posLevelName,
|
||||||
posTypeName: profile.posType.posTypeName,
|
posTypeName: profile.posType.posTypeName,
|
||||||
|
fullName: `${profile.prefix}${profile.firstName} ${profile.lastName}`
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("Error calling API:", error);
|
console.error("Error calling API:", error);
|
||||||
|
|
|
||||||
|
|
@ -888,6 +888,31 @@ export class EmployeePositionController extends Controller {
|
||||||
await this.employeePositionRepository.save(position, { data: request });
|
await this.employeePositionRepository.save(position, { data: request });
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (posMaster.current_holderId != null) {
|
||||||
|
const profile = await this.profileRepository.findOne({
|
||||||
|
where: {
|
||||||
|
id: posMaster.current_holderId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (profile != null) {
|
||||||
|
const positionNew = await this.employeePositionRepository.findOne({
|
||||||
|
where: {
|
||||||
|
// positionIsSelected: true,
|
||||||
|
posMasterId: posMaster.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (positionNew != null) {
|
||||||
|
profile.posLevelId = positionNew.posLevelId;
|
||||||
|
profile.posTypeId = positionNew.posTypeId;
|
||||||
|
profile.position = positionNew.positionName;
|
||||||
|
profile.employeeOc = posMaster?.orgRoot?.orgRootName ?? null;
|
||||||
|
profile.positionEmployeePositionId = positionNew.positionName;
|
||||||
|
|
||||||
|
await this.profileRepository.save(profile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return new HttpSuccess(posMaster.id);
|
return new HttpSuccess(posMaster.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2242,6 +2267,23 @@ export class EmployeePositionController extends Controller {
|
||||||
if (!dataMaster) {
|
if (!dataMaster) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้");
|
||||||
}
|
}
|
||||||
|
if (dataMaster.current_holderId != null) {
|
||||||
|
const profile = await this.profileRepository.findOne({
|
||||||
|
where: {
|
||||||
|
id: dataMaster.current_holderId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const _null: any = null;
|
||||||
|
if (profile != null) {
|
||||||
|
profile.posLevelId = _null;
|
||||||
|
profile.posTypeId = _null;
|
||||||
|
profile.position = _null;
|
||||||
|
profile.employeeOc = _null;
|
||||||
|
profile.positionEmployeePositionId = _null;
|
||||||
|
await this.profileRepository.save(profile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await this.employeePosMasterRepository.update(id, {
|
await this.employeePosMasterRepository.update(id, {
|
||||||
isSit: false,
|
isSit: false,
|
||||||
next_holderId: null,
|
next_holderId: null,
|
||||||
|
|
|
||||||
|
|
@ -689,6 +689,31 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
await this.employeePositionRepository.save(position, { data: request });
|
await this.employeePositionRepository.save(position, { data: request });
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (posMaster.current_holderId != null) {
|
||||||
|
const profile = await this.profileRepository.findOne({
|
||||||
|
where: {
|
||||||
|
id: posMaster.current_holderId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (profile != null) {
|
||||||
|
const positionNew = await this.employeePositionRepository.findOne({
|
||||||
|
where: {
|
||||||
|
// positionIsSelected: true,
|
||||||
|
posMasterId: posMaster.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (positionNew != null) {
|
||||||
|
profile.posLevelId = positionNew.posLevelId;
|
||||||
|
profile.posTypeId = positionNew.posTypeId;
|
||||||
|
profile.position = positionNew.positionName;
|
||||||
|
profile.employeeOc = posMaster?.orgRoot?.orgRootName ?? null;
|
||||||
|
profile.positionEmployeePositionId = positionNew.positionName;
|
||||||
|
|
||||||
|
await this.profileRepository.save(profile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return new HttpSuccess(posMaster.id);
|
return new HttpSuccess(posMaster.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1966,6 +1991,23 @@ export class EmployeeTempPositionController extends Controller {
|
||||||
if (!dataMaster) {
|
if (!dataMaster) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลตำแหน่งนี้");
|
||||||
}
|
}
|
||||||
|
if (dataMaster.current_holderId != null) {
|
||||||
|
const profile = await this.profileRepository.findOne({
|
||||||
|
where: {
|
||||||
|
id: dataMaster.current_holderId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const _null: any = null;
|
||||||
|
if (profile != null) {
|
||||||
|
profile.posLevelId = _null;
|
||||||
|
profile.posTypeId = _null;
|
||||||
|
profile.position = _null;
|
||||||
|
profile.employeeOc = _null;
|
||||||
|
profile.positionEmployeePositionId = _null;
|
||||||
|
await this.profileRepository.save(profile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await this.employeeTempPosMasterRepository.update(id, {
|
await this.employeeTempPosMasterRepository.update(id, {
|
||||||
isSit: false,
|
isSit: false,
|
||||||
next_holderId: null,
|
next_holderId: null,
|
||||||
|
|
|
||||||
|
|
@ -639,6 +639,36 @@ export class OrganizationDotnetController extends Controller {
|
||||||
x.orgRevision?.orgRevisionIsDraft == false &&
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
x.orgRevision?.orgRevisionIsCurrent == true,
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
)?.orgChild4Id ?? null,
|
)?.orgChild4Id ?? null,
|
||||||
|
rootDnaId:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgRoot?.ancestorDNA ?? null,
|
||||||
|
child1DnaId:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild1?.ancestorDNA ?? null,
|
||||||
|
child2DnaId:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild2?.ancestorDNA ?? null,
|
||||||
|
child3DnaId:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild3?.ancestorDNA ?? null,
|
||||||
|
child4DnaId:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild4?.ancestorDNA ?? null,
|
||||||
commander: fullname,
|
commander: fullname,
|
||||||
commanderPositionName,
|
commanderPositionName,
|
||||||
commanderId,
|
commanderId,
|
||||||
|
|
@ -965,6 +995,36 @@ export class OrganizationDotnetController extends Controller {
|
||||||
x.orgRevision?.orgRevisionIsDraft == false &&
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
x.orgRevision?.orgRevisionIsCurrent == true,
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
)?.orgChild4Id ?? null,
|
)?.orgChild4Id ?? null,
|
||||||
|
rootDnaId:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgRoot?.ancestorDNA ?? null,
|
||||||
|
child1DnaId:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild1?.ancestorDNA ?? null,
|
||||||
|
child2DnaId:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild2?.ancestorDNA ?? null,
|
||||||
|
child3DnaId:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild3?.ancestorDNA ?? null,
|
||||||
|
child4DnaId:
|
||||||
|
profile?.current_holders?.find(
|
||||||
|
(x) =>
|
||||||
|
x.orgRevision?.orgRevisionIsDraft == false &&
|
||||||
|
x.orgRevision?.orgRevisionIsCurrent == true,
|
||||||
|
)?.orgChild4?.ancestorDNA ?? null,
|
||||||
commander: fullname,
|
commander: fullname,
|
||||||
commanderPositionName,
|
commanderPositionName,
|
||||||
commanderId,
|
commanderId,
|
||||||
|
|
@ -2875,6 +2935,7 @@ export class OrganizationDotnetController extends Controller {
|
||||||
rootId: root == null ? null : root.id,
|
rootId: root == null ? null : root.id,
|
||||||
root: root == null ? null : root.orgRootName,
|
root: root == null ? null : root.orgRootName,
|
||||||
rootShortName: root == null ? null : root.orgRootShortName,
|
rootShortName: root == null ? null : root.orgRootShortName,
|
||||||
|
rootDnaId: root == null ? null : root.ancestorDNA,
|
||||||
};
|
};
|
||||||
return new HttpSuccess(_profile);
|
return new HttpSuccess(_profile);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1615,7 +1615,7 @@ export class ProfileController extends Controller {
|
||||||
).toLocaleString(),
|
).toLocaleString(),
|
||||||
)
|
)
|
||||||
: "";
|
: "";
|
||||||
const fullCurrentAddress = profiles
|
const fullCurrentAddress = profiles && profiles.currentAddress
|
||||||
? Extension.ToThaiNumber(
|
? Extension.ToThaiNumber(
|
||||||
profiles.currentAddress +
|
profiles.currentAddress +
|
||||||
" ตำบล/แขวง " +
|
" ตำบล/แขวง " +
|
||||||
|
|
@ -1627,7 +1627,7 @@ export class ProfileController extends Controller {
|
||||||
profiles.currentZipCode,
|
profiles.currentZipCode,
|
||||||
)
|
)
|
||||||
: "";
|
: "";
|
||||||
const fullRegistrationAddress = profiles
|
const fullRegistrationAddress = profiles && profiles.registrationAddress
|
||||||
? Extension.ToThaiNumber(
|
? Extension.ToThaiNumber(
|
||||||
profiles.registrationAddress +
|
profiles.registrationAddress +
|
||||||
" ตำบล/แขวง " +
|
" ตำบล/แขวง " +
|
||||||
|
|
@ -5860,11 +5860,9 @@ export class ProfileController extends Controller {
|
||||||
? null
|
? null
|
||||||
: _data.profileSalary[0].positionExecutive,
|
: _data.profileSalary[0].positionExecutive,
|
||||||
posNo:
|
posNo:
|
||||||
_data.profileSalary[0].posNoAbb == ""
|
_data.profileSalary[0].posNoAbb && _data.profileSalary[0].posNo
|
||||||
? ""
|
? _data.profileSalary[0].posNoAbb + _data.profileSalary[0].posNo
|
||||||
: _data.profileSalary[0].posNoAbb + _data.profileSalary[0].posNo == ""
|
: _data.profileSalary[0].posNo || "",
|
||||||
? ""
|
|
||||||
: _data.profileSalary[0].posNo,
|
|
||||||
rootId: null,
|
rootId: null,
|
||||||
root: _data.profileSalary[0].orgRoot == null ? null : _data.profileSalary[0].orgRoot,
|
root: _data.profileSalary[0].orgRoot == null ? null : _data.profileSalary[0].orgRoot,
|
||||||
orgRootShortName:
|
orgRootShortName:
|
||||||
|
|
|
||||||
|
|
@ -230,6 +230,7 @@ export class ProfileEditController extends Controller {
|
||||||
sysName: "REGISTRY_PROFILE",
|
sysName: "REGISTRY_PROFILE",
|
||||||
posLevelName: profile.posLevel.posLevelName,
|
posLevelName: profile.posLevel.posLevelName,
|
||||||
posTypeName: profile.posType.posTypeName,
|
posTypeName: profile.posType.posTypeName,
|
||||||
|
fullName: `${profile.prefix}${profile.firstName} ${profile.lastName}`
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("Error calling API:", error);
|
console.error("Error calling API:", error);
|
||||||
|
|
|
||||||
|
|
@ -2032,11 +2032,9 @@ export class ProfileEmployeeController extends Controller {
|
||||||
posmasterId: _data.posmasterIdTemp,
|
posmasterId: _data.posmasterIdTemp,
|
||||||
position: _data.position,
|
position: _data.position,
|
||||||
posNo:
|
posNo:
|
||||||
_data.profileSalary[0].posNoAbb == ""
|
_data.profileSalary[0].posNoAbb && _data.profileSalary[0].posNo
|
||||||
? ""
|
? _data.profileSalary[0].posNoAbb + _data.profileSalary[0].posNo
|
||||||
: _data.profileSalary[0].posNoAbb + _data.profileSalary[0].posNo == ""
|
: _data.profileSalary[0].posNo || "",
|
||||||
? ""
|
|
||||||
: _data.profileSalary[0].posNo,
|
|
||||||
employeeClass: _data.employeeClass == null ? null : _data.employeeClass,
|
employeeClass: _data.employeeClass == null ? null : _data.employeeClass,
|
||||||
govAge: Extension.CalculateGovAge(_data.dateAppoint, 0, 0),
|
govAge: Extension.CalculateGovAge(_data.dateAppoint, 0, 0),
|
||||||
age: Extension.CalculateAgeStrV2(_data.birthDate, 0, 0),
|
age: Extension.CalculateAgeStrV2(_data.birthDate, 0, 0),
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ export class WorkflowController extends Controller {
|
||||||
sysName: string;
|
sysName: string;
|
||||||
posLevelName: string;
|
posLevelName: string;
|
||||||
posTypeName: string;
|
posTypeName: string;
|
||||||
|
fullName?: string|null
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
let profileType = "OFFICER";
|
let profileType = "OFFICER";
|
||||||
|
|
@ -199,8 +200,10 @@ export class WorkflowController extends Controller {
|
||||||
}));
|
}));
|
||||||
await new CallAPI()
|
await new CallAPI()
|
||||||
.PostData(req, "/placement/noti/profiles", {
|
.PostData(req, "/placement/noti/profiles", {
|
||||||
subject: `รายการถูกส่ง`,
|
// subject: `รายการถูกส่ง`,
|
||||||
body: `รายการถูกส่ง`,
|
// body: `รายการถูกส่ง`,
|
||||||
|
subject: `แจ้ง${workflow.name}ของ ${body.fullName}`,
|
||||||
|
body: `แจ้ง${workflow.name}ของ ${body.fullName}`,
|
||||||
receiverUserIds: profileNow,
|
receiverUserIds: profileNow,
|
||||||
payload: "", //แนบไฟล์
|
payload: "", //แนบไฟล์
|
||||||
isSendMail: true,
|
isSendMail: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue