recheck เมนู ลูกจ้างประจำ กทม และเปลี่ยนจาก list เป็น get

This commit is contained in:
AdisakKanthawilang 2024-08-28 18:10:58 +07:00
parent 2eb79a14b5
commit 057bda967f
21 changed files with 38 additions and 38 deletions

View file

@ -74,7 +74,7 @@ export class ProfileAbilityEmployeeController extends Controller {
],
})
public async detailProfileAbility(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const getProfileAbilityId = await this.profileAbilityRepo.findBy({ profileEmployeeId });
if (!getProfileAbilityId) {
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
@ -124,7 +124,7 @@ export class ProfileAbilityEmployeeController extends Controller {
public async getProfileAbilityHistory(@Path() abilityId: string, @Request() req: RequestWithUser) {
const _record = await this.profileAbilityRepo.findOneBy({ id: abilityId });
if (_record) {
await new permission().PermissionOrgUserList(
await new permission().PermissionOrgUserGet(
req,
"SYS_REGISTRY_EMP",
_record.profileEmployeeId,

View file

@ -142,7 +142,7 @@ export class ProfileAddressEmployeeController extends Controller {
*/
@Get("history/{profileId}")
public async getProfileAddressHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
const record = await this.profileAddressHistoryRepo.find({
where: { profileEmployeeId: profileId },
relations: {

View file

@ -79,7 +79,7 @@ export class ProfileAssessmentsEmployeeController extends Controller {
],
})
public async detailProfileAssessments(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const getProfileAssessments = await this.profileAssessmentsRepository.findBy({
profileEmployeeId,
});
@ -135,7 +135,7 @@ export class ProfileAssessmentsEmployeeController extends Controller {
public async getProfileAssessmentsHistory(@Path() assessmentId: string, @Request() req: RequestWithUser) {
const _record = await this.profileAssessmentsRepository.findOneBy({ id: assessmentId });
if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", _record.profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileId);
}
const record = await this.profileAssessmentsHistoryRepository.findBy({
profileAssessmentId: assessmentId,

View file

@ -19,7 +19,7 @@ export class ProfileAvatarEmployeeController extends Controller {
@Path() profileEmployeeId: string,
@Request() req: RequestWithUser,
) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const lists = await this.avatarRepository.find({
where: { profileEmployeeId },
});

View file

@ -68,7 +68,7 @@ export class ProfileCertificateEmployeeController extends Controller {
],
})
public async getCertificate(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const record = await this.certificateRepo.findBy({ profileEmployeeId });
return new HttpSuccess(record);
}
@ -113,7 +113,7 @@ export class ProfileCertificateEmployeeController extends Controller {
public async certificateHistory(@Path() certificateId: string, @Request() req: RequestWithUser) {
const _record = await this.certificateRepo.findOneBy({ id: certificateId });
if (_record) {
await new permission().PermissionOrgUserDelete(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
}
const record = await this.certificateHistoryRepo.findBy({
profileCertificateId: certificateId,

View file

@ -65,7 +65,7 @@ export class ProfileChangeNameEmployeeController extends Controller {
],
})
public async getChangeName(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const lists = await this.changeNameRepository.find({
where: { profileEmployeeId: profileEmployeeId },
select: ["id", "prefix", "firstName", "lastName", "status"],
@ -102,7 +102,7 @@ export class ProfileChangeNameEmployeeController 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_EMP", _record.profileEmployeeId,
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId,
);
}
const record = await this.changeNameHistoryRepository.find({

View file

@ -50,7 +50,7 @@ export class ProfileChildrenEmployeeController extends Controller {
@Get("{profileEmployeeId}")
public async getChildren(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const lists = await this.childrenRepository.find({
where: { profileEmployeeId: profileEmployeeId },
});
@ -61,7 +61,7 @@ export class ProfileChildrenEmployeeController 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_EMP", _record.profileEmployeeId,
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId,
);
}
const record = await this.childrenHistoryRepository.find({

View file

@ -47,7 +47,7 @@ export class ProfileDevelopmentEmployeeController extends Controller {
@Get("{profileId}")
public async getDevelopment(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
const lists = await this.developmentRepository.find({
where: { profileEmployeeId: profileId },
});
@ -58,7 +58,7 @@ export class ProfileDevelopmentEmployeeController extends Controller {
public async developmentHistory(@Path() developmentId: string, @Request() req: RequestWithUser) {
const _record = await this.developmentRepository.findOneBy({ id: developmentId });
if (_record) {
await new permission().PermissionOrgUserList(
await new permission().PermissionOrgUserGet(
req,
"SYS_REGISTRY_EMP",
_record.profileEmployeeId,

View file

@ -73,7 +73,7 @@ export class ProfileDisciplineEmployeeController extends Controller {
],
})
public async getDiscipline(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserCreate(req, "SYS_REGISTRY_EMP", profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
const lists = await this.disciplineRepository.find({
where: { profileEmployeeId: profileId },
select: [

View file

@ -52,7 +52,7 @@ export class ProfileDutyEmployeeController extends Controller {
@Get("{profileId}")
public async getDuty(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
const lists = await this.dutyRepository.find({
where: { profileEmployeeId: profileId },
select: [
@ -72,7 +72,7 @@ export class ProfileDutyEmployeeController 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_EMP", _record.profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
}
const record = await this.dutyHistoryRepository.find({
where: { profileDutyId: dutyId },

View file

@ -92,7 +92,7 @@ export class ProfileEducationsEmployeeController extends Controller {
],
})
public async detailProfileEducation(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const getProfileEducation = await this.profileEducationRepo.find({
where: { profileEmployeeId: profileEmployeeId },
});
@ -172,7 +172,7 @@ export class ProfileEducationsEmployeeController 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_EMP", _record.profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
}
const record = await this.profileEducationHistoryRepo.findBy({

View file

@ -2968,7 +2968,7 @@ export class ProfileEmployeeController extends Controller {
*/
@Get("information/history/{profileEmployeeId}")
async getInformationHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const profileInformation = await this.profileRepo.find({
relations: {
information_histories: true,
@ -3013,7 +3013,7 @@ export class ProfileEmployeeController extends Controller {
@Path() profileEmployeeId: string,
@Request() req: RequestWithUser,
) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const employment = await this.employmentRepository.find({
where: { profileEmployeeId: profileEmployeeId },
order: { createdAt: "ASC" },
@ -3061,7 +3061,7 @@ export class ProfileEmployeeController extends Controller {
where: { id: id },
});
if (employment) {
await new permission().PermissionOrgUserList(
await new permission().PermissionOrgUserGet(
req,
"SYS_REGISTRY_EMP",
employment.profileEmployeeId,

View file

@ -184,7 +184,7 @@ export class ProfileFamilyCoupleEmployeeController extends Controller {
if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
}
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profile.id);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profile.id);
const familyCouple = await this.ProfileFamilyCouple.find({
relations: ["histories"],

View file

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

View file

@ -343,7 +343,7 @@ export class ProfileGovernmentEmployeeController extends Controller {
@Get("history/{profileEmployeeId}")
@Example({})
public async govHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId)
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId)
const record = await this.govRepo.find({
order: { lastUpdatedAt: "DESC" },
where: { profileEmployeeId: profileEmployeeId },

View file

@ -69,7 +69,7 @@ export class ProfileHonorEmployeeController extends Controller {
],
})
public async getHonor(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const record = await this.honorRepo.findBy({ profileEmployeeId });
return new HttpSuccess(record);
}
@ -137,7 +137,7 @@ export class ProfileHonorEmployeeController extends Controller {
public async honorHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
const _record = await this.honorRepo.findOneBy({ id: honorId });
if (_record) {
await new permission().PermissionOrgUserDelete(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
}
const record = await this.honorHistoryRepo.findBy({

View file

@ -84,7 +84,7 @@ export class ProfileInsigniaEmployeeController extends Controller {
],
})
public async getInsignia(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const record = await this.insigniaRepo.find({
relations: {
insignia: {
@ -154,7 +154,7 @@ export class ProfileInsigniaEmployeeController 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_EMP", _record.profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
}
const record = await this.insigniaHistoryRepo.find({
relations: {

View file

@ -50,7 +50,7 @@ export class ProfileLeaveEmployeeController extends Controller {
@Get("{profileId}")
public async getLeave(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
const record = await this.leaveRepo.find({
relations: { leaveType: true },
where: { profileEmployeeId: profileId },
@ -72,7 +72,7 @@ export class ProfileLeaveEmployeeController extends Controller {
public async leaveHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
const _record = await this.leaveRepo.findOneBy({ id: leaveId });
if (_record) {
await new permission().PermissionOrgUserDelete(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
}
const record = await this.leaveHistoryRepo.find({
relations: { leaveType: true },

View file

@ -47,7 +47,7 @@ export class ProfileOtherEmployeeController extends Controller {
@Get("{profileId}")
public async getOther(@Path() profileId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
const lists = await this.otherRepository.find({
where: { profileEmployeeId: profileId },
});
@ -58,7 +58,7 @@ export class ProfileOtherEmployeeController extends Controller {
public async otherHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
const _record = await this.otherRepository.findOneBy({ id: otherId });
if (_record) {
await new permission().PermissionOrgUserDelete(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
}
const record = await this.otherHistoryRepository.find({
where: { profileOtherId: otherId },

View file

@ -51,7 +51,7 @@ export class ProfileSalaryEmployeeController extends Controller {
public async getSalaryEmployee(@Path() profileId: string, @Request() req: RequestWithUser) {
// const _record = await this.salaryRepo.findOneBy({ id: profileId });
// if (_record) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
// }
const record = await this.salaryRepo.find({
where: { profileEmployeeId: profileId },
@ -65,7 +65,7 @@ export class ProfileSalaryEmployeeController extends Controller {
await new permission().PermissionGet(req, "SYS_WAGE");
// const _record = await this.salaryRepo.findOneBy({ id: profileId });
// if (_record) {
// await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileId);
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
// }
const record = await this.salaryRepo.find({
where: { profileEmployeeId: profileId },
@ -78,7 +78,7 @@ export class ProfileSalaryEmployeeController extends Controller {
public async salaryHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
const _record = await this.salaryRepo.findOneBy({ id: salaryId });
if (_record) {
await new permission().PermissionOrgUserDelete(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
}
const record = await this.salaryHistoryRepo.findBy({
profileSalaryId: salaryId,

View file

@ -75,7 +75,7 @@ export class ProfileTrainingEmployeeController extends Controller {
],
})
public async getTraining(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
await new permission().PermissionOrgUserList(req, "SYS_REGISTRY_EMP", profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
const record = await this.trainingRepo.findBy({ profileEmployeeId });
return new HttpSuccess(record);
}
@ -134,7 +134,7 @@ export class ProfileTrainingEmployeeController 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_EMP", _record.profileEmployeeId);
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", _record.profileEmployeeId);
}
const record = await this.trainingHistoryRepo.findBy({