recheck เมนู ข้าราชการ กทม. สามัญ (list to get)

This commit is contained in:
AdisakKanthawilang 2024-08-29 09:34:13 +07:00
parent 7430c3c86f
commit 271e6964b3
17 changed files with 24 additions and 24 deletions

View file

@ -127,7 +127,7 @@ export class ProfileAbilityController extends Controller {
where: { id: abilityId },
});
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.profileAbilityHistoryRepo.find({
relations: ["histories"],

View file

@ -150,7 +150,7 @@ export class ProfileAssessmentsController extends Controller {
},
});
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
return new HttpSuccess(record);
}

View file

@ -113,7 +113,7 @@ export class ProfileCertificateController extends Controller {
public async certificateHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
const _record = await this.certificateRepo.findOneBy({ id: certificateId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.certificateHistoryRepo.findBy({
profileCertificateId: certificateId,

View file

@ -101,7 +101,7 @@ export class ProfileChangeNameController extends Controller {
public async changeNameHistory(@Path() changeNameId: string, @Request() req: RequestWithUser) {
const _record = await this.changeNameRepository.findOneBy({ id: changeNameId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.changeNameHistoryRepository.find({
where: { profileChangeNameId: changeNameId },

View file

@ -59,7 +59,7 @@ export class ProfileChildrenController extends Controller {
public async childrenHistory(@Path() childrenId: string, @Request() req: RequestWithUser) {
const _record = await this.childrenRepository.findOneBy({ id: childrenId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.childrenHistoryRepository.find({
where: { profileChildrenId: childrenId },

View file

@ -2518,7 +2518,7 @@ export class ProfileController extends Controller {
@Get("history/{id}")
async getProfileHistory(@Path() id: string, @Request() req: RequestWithUser) {
// await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
const profile = await this.profileHistoryRepo.find({
relations: {
posLevel: true,
@ -3396,7 +3396,7 @@ export class ProfileController extends Controller {
if (!profile) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
}
// await new permission().PermissionOrgUserList(request, "SYS_REGISTRY_OFFICER", profile.id);//ไม่แน่ใจOFFปิดไว้ก่อน
// await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", profile.id);//ไม่แน่ใจOFFปิดไว้ก่อน
return new HttpSuccess(profile);
}
@ -3416,7 +3416,7 @@ export class ProfileController extends Controller {
if (!profile) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
}
// await new permission().PermissionOrgUserList(request, "SYS_REGISTRY_OFFICER", profile.id);//ไม่แน่ใจOFFปิดไว้ก่อน
// await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", profile.id);//ไม่แน่ใจOFFปิดไว้ก่อน
const orgRevisionPublish = await this.orgRevisionRepo
.createQueryBuilder("orgRevision")
@ -3531,7 +3531,7 @@ export class ProfileController extends Controller {
*/
@Get("profileempid/position/{id}")
async getProfileByProfileempid(@Request() request: RequestWithUser, @Path() id: string) {
// await new permission().PermissionOrgUserList(request, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
// await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
const profile = await this.profileEmpRepo.findOne({
where: { id: id },
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],
@ -4853,7 +4853,7 @@ export class ProfileController extends Controller {
*/
@Get("profileid/retire/{year}")
async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) {
// await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
const profiles = await this.profileRepo
.createQueryBuilder("profile")
.leftJoinAndSelect("profile.posLevel", "posLevel")

View file

@ -124,7 +124,7 @@ export class ProfileDisciplineController extends Controller {
public async disciplineHistory(@Path() disciplineId: string, @Request() req: RequestWithUser) {
const _record = await this.disciplineRepository.findOneBy({ id: disciplineId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.disciplineHistoryRepository.find({
where: { profileDisciplineId: disciplineId },

View file

@ -111,7 +111,7 @@ export class ProfileDutyController extends Controller {
public async dutyHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
const _record = await this.dutyRepository.findOneBy({ id: dutyId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.dutyHistoryRepository.find({
where: { profileDutyId: dutyId },

View file

@ -170,7 +170,7 @@ export class ProfileEducationsController extends Controller {
public async getProfileEducationHistory(@Path() educationId: string, @Request() req: RequestWithUser) {
const _record = await this.profileEducationRepo.findOneBy({ id: educationId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.profileEducationHistoryRepo.findBy({
profileEducationId: educationId,

View file

@ -166,7 +166,7 @@ export class ProfileFamilyMotherController extends Controller {
],
})
public async familyMotherHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
const profile = await this.profileRepo.findOne({
where: { id: profileId },
});

View file

@ -133,7 +133,7 @@ export class ProfileHonorController extends Controller {
public async honorHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
const _record = await this.honorRepo.findOneBy({ id: honorId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.honorHistoryRepo.findBy({
profileHonorId: honorId,

View file

@ -154,7 +154,7 @@ export class ProfileInsigniaController extends Controller {
public async getInsigniaHistory(@Path() InsigniaId: string, @Request() req: RequestWithUser) {
const _record = await this.insigniaRepo.findOneBy({ id: InsigniaId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.insigniaHistoryRepo.find({
relations: {

View file

@ -251,7 +251,7 @@ export class ProfileLeaveController extends Controller {
public async leaveHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
const _record = await this.leaveRepo.findOneBy({ id: leaveId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.leaveHistoryRepo.find({
relations: { leaveType: true },

View file

@ -90,7 +90,7 @@ export class ProfileNopaidController extends Controller {
public async nopaidHistory(@Path() nopaidId: string, @Request() req: RequestWithUser) {
const _record = await this.nopaidRepository.findOneBy({ id: nopaidId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
};
const record = await this.nopaidHistoryRepository.find({
where: { profileNopaidId: nopaidId },

View file

@ -87,7 +87,7 @@ export class ProfileOtherController extends Controller {
public async otherHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
const _record = await this.otherRepository.findOneBy({ id: otherId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.otherHistoryRepository.find({
where: { profileOtherId: otherId },

View file

@ -145,7 +145,7 @@ export class ProfileSalaryController extends Controller {
public async salaryHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
const _record = await this.salaryRepo.findOneBy({ id: salaryId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.salaryHistoryRepo.findBy({
profileSalaryId: salaryId,
@ -241,9 +241,9 @@ export class ProfileSalaryController extends Controller {
@Get("swap/{direction}/{salaryId}")
public async swapSalary(@Path() direction: string, salaryId: string, @Request() req: RequestWithUser) {
const source_item = await this.salaryRepo.findOne({ where: { id: salaryId } });
if (source_item) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", source_item.profileId);
}
// if (source_item) {
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", source_item.profileId);//ไม่แน่ใจOFFปิดไว้ก่อน
// }
if (source_item == null) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
const sourceOrder = source_item.order;
if (direction.trim().toUpperCase() == "UP") {

View file

@ -134,7 +134,7 @@ export class ProfileTrainingController extends Controller {
public async trainingHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
const _record = await this.trainingRepo.findOneBy({ id: trainingId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_OFFICER", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
}
const record = await this.trainingHistoryRepo.findBy({
profileTrainingId: trainingId,