แก้ออกคำสั่งวินัย
This commit is contained in:
parent
5c2bf5fb42
commit
828dd2a37d
1 changed files with 71 additions and 44 deletions
|
|
@ -1414,10 +1414,7 @@ export class ProfileController extends Controller {
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
});
|
});
|
||||||
await Promise.all([
|
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
||||||
this.profileRepo.save(profile),
|
|
||||||
this.salaryRepository.save(profileSalary),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -1451,14 +1448,20 @@ export class ProfileController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
}
|
}
|
||||||
|
const _profile = await this.profileRepo.findOne({
|
||||||
|
where: { id: body.profileId },
|
||||||
|
});
|
||||||
|
if (!_profile) {
|
||||||
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
|
}
|
||||||
let dateLeave_: any = body.date;
|
let dateLeave_: any = body.date;
|
||||||
await removeProfileInOrganize(profile.id,"OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
profile.isLeave = true;
|
_profile.isLeave = true;
|
||||||
profile.leaveReason =
|
_profile.leaveReason =
|
||||||
"คำสั่งให้ข้าราชการออกจากราชการเพราะผลการทดลองปฏิบัติหน้าที่ราชการต่ำกว่ามาตรฐานที่กำหนด";
|
"คำสั่งให้ข้าราชการออกจากราชการเพราะผลการทดลองปฏิบัติหน้าที่ราชการต่ำกว่ามาตรฐานที่กำหนด";
|
||||||
profile.dateLeave = dateLeave_;
|
_profile.dateLeave = dateLeave_;
|
||||||
profile.lastUpdateUserId = req.user.sub;
|
_profile.lastUpdateUserId = req.user.sub;
|
||||||
profile.lastUpdateFullName = req.user.name;
|
_profile.lastUpdateFullName = req.user.name;
|
||||||
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
|
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
|
||||||
profileId: body.profileId,
|
profileId: body.profileId,
|
||||||
date: body.date,
|
date: body.date,
|
||||||
|
|
@ -1490,7 +1493,7 @@ export class ProfileController extends Controller {
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
});
|
});
|
||||||
await Promise.all([this.profileRepo.save(profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.profileRepo.save(_profile), this.salaryRepository.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -1524,13 +1527,19 @@ export class ProfileController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
}
|
}
|
||||||
|
const _profile = await this.profileRepo.findOne({
|
||||||
|
where: { id: body.profileId },
|
||||||
|
});
|
||||||
|
if (!_profile) {
|
||||||
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
|
}
|
||||||
let dateLeave_: any = body.date;
|
let dateLeave_: any = body.date;
|
||||||
await removeProfileInOrganize(profile.id,"OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
profile.isLeave = true;
|
_profile.isLeave = true;
|
||||||
profile.leaveReason = "ได้รับโทษทางวินัย ปลดออกจากราชการ";
|
_profile.leaveReason = "ได้รับโทษทางวินัย ปลดออกจากราชการ";
|
||||||
profile.dateLeave = dateLeave_;
|
_profile.dateLeave = dateLeave_;
|
||||||
profile.lastUpdateUserId = req.user.sub;
|
_profile.lastUpdateUserId = req.user.sub;
|
||||||
profile.lastUpdateFullName = req.user.name;
|
_profile.lastUpdateFullName = req.user.name;
|
||||||
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
|
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
|
||||||
profileId: body.profileId,
|
profileId: body.profileId,
|
||||||
date: body.date,
|
date: body.date,
|
||||||
|
|
@ -1562,7 +1571,7 @@ export class ProfileController extends Controller {
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
});
|
});
|
||||||
await Promise.all([this.profileRepo.save(profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.profileRepo.save(_profile), this.salaryRepository.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -1596,13 +1605,19 @@ export class ProfileController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
}
|
}
|
||||||
|
const _profile = await this.profileRepo.findOne({
|
||||||
|
where: { id: body.profileId },
|
||||||
|
});
|
||||||
|
if (!_profile) {
|
||||||
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
|
}
|
||||||
let dateLeave_: any = body.date;
|
let dateLeave_: any = body.date;
|
||||||
await removeProfileInOrganize(profile.id,"OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
profile.isLeave = true;
|
_profile.isLeave = true;
|
||||||
profile.leaveReason = "ได้รับโทษทางวินัย ไล่ออกจากราชการ";
|
_profile.leaveReason = "ได้รับโทษทางวินัย ไล่ออกจากราชการ";
|
||||||
profile.dateLeave = dateLeave_;
|
_profile.dateLeave = dateLeave_;
|
||||||
profile.lastUpdateUserId = req.user.sub;
|
_profile.lastUpdateUserId = req.user.sub;
|
||||||
profile.lastUpdateFullName = req.user.name;
|
_profile.lastUpdateFullName = req.user.name;
|
||||||
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
|
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
|
||||||
profileId: body.profileId,
|
profileId: body.profileId,
|
||||||
date: body.date,
|
date: body.date,
|
||||||
|
|
@ -1645,7 +1660,7 @@ export class ProfileController extends Controller {
|
||||||
// lastUpdateFullName: req.user.name,
|
// lastUpdateFullName: req.user.name,
|
||||||
// });
|
// });
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
this.profileRepo.save(profile),
|
this.profileRepo.save(_profile),
|
||||||
this.salaryRepository.save(profileSalary),
|
this.salaryRepository.save(profileSalary),
|
||||||
// this.profileDisciplineRepo.save(profileDiscipline)
|
// this.profileDisciplineRepo.save(profileDiscipline)
|
||||||
]);
|
]);
|
||||||
|
|
@ -1682,13 +1697,19 @@ export class ProfileController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
}
|
}
|
||||||
|
const _profile = await this.profileRepo.findOne({
|
||||||
|
where: { id: body.profileId },
|
||||||
|
});
|
||||||
|
if (!_profile) {
|
||||||
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
|
}
|
||||||
let dateLeave_: any = body.date;
|
let dateLeave_: any = body.date;
|
||||||
await removeProfileInOrganize(profile.id,"OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
profile.isLeave = true;
|
_profile.isLeave = true;
|
||||||
profile.leaveReason = "ได้รับโทษทางวินัย พักจากราชการ";
|
_profile.leaveReason = "ได้รับโทษทางวินัย พักจากราชการ";
|
||||||
profile.dateLeave = dateLeave_;
|
_profile.dateLeave = dateLeave_;
|
||||||
profile.lastUpdateUserId = req.user.sub;
|
_profile.lastUpdateUserId = req.user.sub;
|
||||||
profile.lastUpdateFullName = req.user.name;
|
_profile.lastUpdateFullName = req.user.name;
|
||||||
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
|
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
|
||||||
profileId: body.profileId,
|
profileId: body.profileId,
|
||||||
date: body.date,
|
date: body.date,
|
||||||
|
|
@ -1720,7 +1741,7 @@ export class ProfileController extends Controller {
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
});
|
});
|
||||||
await Promise.all([this.profileRepo.save(profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.profileRepo.save(_profile), this.salaryRepository.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -1754,13 +1775,19 @@ export class ProfileController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
}
|
}
|
||||||
|
const _profile = await this.profileRepo.findOne({
|
||||||
|
where: { id: body.profileId },
|
||||||
|
});
|
||||||
|
if (!_profile) {
|
||||||
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์");
|
||||||
|
}
|
||||||
let dateLeave_: any = body.date;
|
let dateLeave_: any = body.date;
|
||||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
profile.isLeave = true;
|
_profile.isLeave = true;
|
||||||
profile.leaveReason = "ได้รับโทษทางวินัย ให้ออกจากราชการไว้ก่อน";
|
_profile.leaveReason = "ได้รับโทษทางวินัย ให้ออกจากราชการไว้ก่อน";
|
||||||
profile.dateLeave = dateLeave_;
|
_profile.dateLeave = dateLeave_;
|
||||||
profile.lastUpdateUserId = req.user.sub;
|
_profile.lastUpdateUserId = req.user.sub;
|
||||||
profile.lastUpdateFullName = req.user.name;
|
_profile.lastUpdateFullName = req.user.name;
|
||||||
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
|
const profileSalary: ProfileSalary = Object.assign(new ProfileSalary(), {
|
||||||
profileId: body.profileId,
|
profileId: body.profileId,
|
||||||
date: body.date,
|
date: body.date,
|
||||||
|
|
@ -1792,7 +1819,7 @@ export class ProfileController extends Controller {
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
});
|
});
|
||||||
await Promise.all([this.profileRepo.save(profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.profileRepo.save(_profile), this.salaryRepository.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -1863,7 +1890,7 @@ export class ProfileController extends Controller {
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
});
|
});
|
||||||
await Promise.all([this.profileRepo.save(profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -1934,7 +1961,7 @@ export class ProfileController extends Controller {
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
});
|
});
|
||||||
await Promise.all([this.profileRepo.save(profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2005,7 +2032,7 @@ export class ProfileController extends Controller {
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
});
|
});
|
||||||
await Promise.all([this.profileRepo.save(profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2076,7 +2103,7 @@ export class ProfileController extends Controller {
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
});
|
});
|
||||||
await Promise.all([this.profileRepo.save(profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2147,7 +2174,7 @@ export class ProfileController extends Controller {
|
||||||
lastUpdateUserId: req.user.sub,
|
lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
lastUpdateFullName: req.user.name,
|
||||||
});
|
});
|
||||||
await Promise.all([this.profileRepo.save(profile), this.salaryRepository.save(profileSalary)]);
|
await Promise.all([this.salaryRepository.save(profileSalary)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
@ -2250,7 +2277,7 @@ export class ProfileController extends Controller {
|
||||||
@Path() id: string,
|
@Path() id: string,
|
||||||
@Body() body: UpdateProfile,
|
@Body() body: UpdateProfile,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionUpdate(request,"SYS_REGISTRY");
|
await new permission().PermissionUpdate(request, "SYS_REGISTRY");
|
||||||
const exists =
|
const exists =
|
||||||
!!body.citizenId &&
|
!!body.citizenId &&
|
||||||
(await this.profileRepo.findOne({
|
(await this.profileRepo.findOne({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue