parent
e0e850b4c7
commit
6328de1a5c
1 changed files with 12 additions and 3 deletions
|
|
@ -1519,7 +1519,10 @@ export class CommandController extends Controller {
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
response_.data.result.profiles.map(async (x: any) => {
|
response_.data.result.profiles.map(async (x: any) => {
|
||||||
const _profile = await this.profileRepository.findOneBy({ id: x.profileId });
|
const _profile = await this.profileRepository.findOne({
|
||||||
|
where: { id: x.profileId },
|
||||||
|
relations: ["roleKeycloaks"],
|
||||||
|
});
|
||||||
if (_profile) {
|
if (_profile) {
|
||||||
// console.log("1. บันทึกลงประวัติตำแหน่ง")
|
// console.log("1. บันทึกลงประวัติตำแหน่ง")
|
||||||
await this.profileSalaryRetire(x.profileId, type, signDate, _Date);
|
await this.profileSalaryRetire(x.profileId, type, signDate, _Date);
|
||||||
|
|
@ -1572,7 +1575,10 @@ export class CommandController extends Controller {
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
response_.data.result.profiles.map(async (x: any) => {
|
response_.data.result.profiles.map(async (x: any) => {
|
||||||
const _profileEmp = await this.profileEmployeeRepository.findOneBy({ id: x.profileId });
|
const _profileEmp = await this.profileEmployeeRepository.findOne({
|
||||||
|
where: { id: x.profileId },
|
||||||
|
relations: ["roleKeycloaks"],
|
||||||
|
});
|
||||||
if (_profileEmp) {
|
if (_profileEmp) {
|
||||||
// บันทึกลงประวัติตำแหน่ง
|
// บันทึกลงประวัติตำแหน่ง
|
||||||
await this.profileSalaryRetire(x.profileId, type, signDate, _Date);
|
await this.profileSalaryRetire(x.profileId, type, signDate, _Date);
|
||||||
|
|
@ -4694,6 +4700,7 @@ export class CommandController extends Controller {
|
||||||
if (item.isLeave != null) {
|
if (item.isLeave != null) {
|
||||||
const _profile = await this.profileRepository.findOne({
|
const _profile = await this.profileRepository.findOne({
|
||||||
where: { id: item.profileId },
|
where: { id: item.profileId },
|
||||||
|
relations: ["roleKeycloaks"],
|
||||||
});
|
});
|
||||||
if (!_profile) {
|
if (!_profile) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
||||||
|
|
@ -4896,6 +4903,7 @@ export class CommandController extends Controller {
|
||||||
if (item.isLeave != null) {
|
if (item.isLeave != null) {
|
||||||
const _profile = await this.profileEmployeeRepository.findOne({
|
const _profile = await this.profileEmployeeRepository.findOne({
|
||||||
where: { id: item.profileId },
|
where: { id: item.profileId },
|
||||||
|
relations: ["roleKeycloaks"],
|
||||||
});
|
});
|
||||||
if (!_profile) {
|
if (!_profile) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
||||||
|
|
@ -5188,6 +5196,7 @@ export class CommandController extends Controller {
|
||||||
if (item.isLeave != null) {
|
if (item.isLeave != null) {
|
||||||
const _profile = await this.profileEmployeeRepository.findOne({
|
const _profile = await this.profileEmployeeRepository.findOne({
|
||||||
where: { id: item.profileId },
|
where: { id: item.profileId },
|
||||||
|
relations: ["roleKeycloaks"],
|
||||||
});
|
});
|
||||||
if (!_profile) {
|
if (!_profile) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
||||||
|
|
@ -5889,7 +5898,7 @@ export class CommandController extends Controller {
|
||||||
//กรณีลูกจ้างประจำมาสอบเป็นข้าราชการ ต้อง update สถานะโปรไฟล์เดิม
|
//กรณีลูกจ้างประจำมาสอบเป็นข้าราชการ ต้อง update สถานะโปรไฟล์เดิม
|
||||||
let profileEmployee: any = await this.profileEmployeeRepository.findOne({
|
let profileEmployee: any = await this.profileEmployeeRepository.findOne({
|
||||||
where: { citizenId: item.bodyProfile.citizenId },
|
where: { citizenId: item.bodyProfile.citizenId },
|
||||||
relations: ["profileInsignias"],
|
relations: ["profileInsignias", "roleKeycloaks"],
|
||||||
});
|
});
|
||||||
if (profileEmployee) {
|
if (profileEmployee) {
|
||||||
const _order = await this.salaryRepo.findOne({
|
const _order = await this.salaryRepo.findOne({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue