Merge branch 'develop' into adiDev
This commit is contained in:
commit
66cce71f1d
79 changed files with 673 additions and 294 deletions
|
|
@ -2096,6 +2096,9 @@ export class CommandController extends Controller {
|
||||||
refCommandNo?: string | null;
|
refCommandNo?: string | null;
|
||||||
salaryRef?: string | null;
|
salaryRef?: string | null;
|
||||||
commandId?: string | null;
|
commandId?: string | null;
|
||||||
|
amount?: Double | null;
|
||||||
|
positionSalaryAmount?: Double | null;
|
||||||
|
mouthSalaryAmount?: Double | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2133,11 +2136,9 @@ export class CommandController extends Controller {
|
||||||
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionPathSide : null,
|
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionPathSide : null,
|
||||||
positionExecutive:
|
positionExecutive:
|
||||||
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionExecutive : null,
|
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionExecutive : null,
|
||||||
amount: profile.profileSalary.length > 0 ? profile.profileSalary[0].amount : null,
|
amount: item.amount ? item.amount : null,
|
||||||
positionSalaryAmount:
|
positionSalaryAmount: item.positionSalaryAmount ? item.positionSalaryAmount : null,
|
||||||
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionSalaryAmount : null,
|
mouthSalaryAmount: item.mouthSalaryAmount ? item.mouthSalaryAmount : null,
|
||||||
mouthSalaryAmount:
|
|
||||||
profile.profileSalary.length > 0 ? profile.profileSalary[0].mouthSalaryAmount : null,
|
|
||||||
order:
|
order:
|
||||||
profile.profileSalary.length >= 0
|
profile.profileSalary.length >= 0
|
||||||
? profile.profileSalary.length > 0
|
? profile.profileSalary.length > 0
|
||||||
|
|
@ -2176,6 +2177,9 @@ export class CommandController extends Controller {
|
||||||
refCommandNo?: string | null;
|
refCommandNo?: string | null;
|
||||||
salaryRef?: string | null;
|
salaryRef?: string | null;
|
||||||
commandId?: string | null;
|
commandId?: string | null;
|
||||||
|
amount?: Double | null;
|
||||||
|
positionSalaryAmount?: Double | null;
|
||||||
|
mouthSalaryAmount?: Double | null;
|
||||||
}[];
|
}[];
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
|
@ -2226,11 +2230,9 @@ export class CommandController extends Controller {
|
||||||
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionPathSide : null,
|
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionPathSide : null,
|
||||||
positionExecutive:
|
positionExecutive:
|
||||||
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionExecutive : null,
|
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionExecutive : null,
|
||||||
amount: profile.profileSalary.length > 0 ? profile.profileSalary[0].amount : null,
|
amount: item.amount ? item.amount : null,
|
||||||
positionSalaryAmount:
|
positionSalaryAmount: item.positionSalaryAmount ? item.positionSalaryAmount : null,
|
||||||
profile.profileSalary.length > 0 ? profile.profileSalary[0].positionSalaryAmount : null,
|
mouthSalaryAmount: item.mouthSalaryAmount ? item.mouthSalaryAmount : null,
|
||||||
mouthSalaryAmount:
|
|
||||||
profile.profileSalary.length > 0 ? profile.profileSalary[0].mouthSalaryAmount : null,
|
|
||||||
order:
|
order:
|
||||||
profile.profileSalary.length >= 0
|
profile.profileSalary.length >= 0
|
||||||
? profile.profileSalary.length > 0
|
? profile.profileSalary.length > 0
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,8 @@ export class DevelopmentRequestController extends Controller {
|
||||||
|
|
||||||
@Get("admin/{id}")
|
@Get("admin/{id}")
|
||||||
public async getDevelopmentRequestByUser(@Path() id: string, @Request() req: RequestWithUser) {
|
public async getDevelopmentRequestByUser(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_OFFICER");
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_OFFICER");
|
||||||
const data = await this.developmentRequestRepository.findOne({
|
const data = await this.developmentRequestRepository.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
relations: ["developmentProjects"],
|
relations: ["developmentProjects"],
|
||||||
|
|
@ -301,7 +302,7 @@ export class DevelopmentRequestController extends Controller {
|
||||||
});
|
});
|
||||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
await new permission().PermissionUpdate(req, "SYS_REGISTRY_OFFICER");
|
await new permission().PermissionUpdate(req, "SYS_REGISTRY_OFFICER");
|
||||||
|
|
||||||
if (requestBody.status == "APPROVE" && record.status == "PENDING") {
|
if (requestBody.status == "APPROVE" && record.status == "PENDING") {
|
||||||
let profileDevelopment = new ProfileDevelopment();
|
let profileDevelopment = new ProfileDevelopment();
|
||||||
const meta = {
|
const meta = {
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ export class OrgRootController extends Controller {
|
||||||
orgRootPhoneIn: orgRoot.orgRootPhoneIn,
|
orgRootPhoneIn: orgRoot.orgRootPhoneIn,
|
||||||
orgRootFax: orgRoot.orgRootFax,
|
orgRootFax: orgRoot.orgRootFax,
|
||||||
orgRevisionId: orgRoot.orgRevisionId,
|
orgRevisionId: orgRoot.orgRevisionId,
|
||||||
|
isDeputy: orgRoot.isDeputy,
|
||||||
orgCode: orgRoot.orgRootCode + "00",
|
orgCode: orgRoot.orgRootCode + "00",
|
||||||
};
|
};
|
||||||
return new HttpSuccess(getOrgRoot);
|
return new HttpSuccess(getOrgRoot);
|
||||||
|
|
@ -102,6 +103,24 @@ export class OrgRootController extends Controller {
|
||||||
@Request() request: RequestWithUser,
|
@Request() request: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionCreate(request, "SYS_ORG");
|
await new permission().PermissionCreate(request, "SYS_ORG");
|
||||||
|
|
||||||
|
if (requestBody.isDeputy == true) {
|
||||||
|
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||||
|
where: { id: requestBody.orgRevisionId },
|
||||||
|
relations: ["orgRoots"],
|
||||||
|
});
|
||||||
|
if (orgRevision != null) {
|
||||||
|
await Promise.all(
|
||||||
|
orgRevision.orgRoots
|
||||||
|
.filter((x: OrgRoot) => x.isDeputy == true)
|
||||||
|
.map(async (item: OrgRoot) => {
|
||||||
|
item.isDeputy = false;
|
||||||
|
await this.orgRootRepository.save(item);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const validOrgRootRanks = ["DEPARTMENT", "OFFICE", "DIVISION", "SECTION"];
|
const validOrgRootRanks = ["DEPARTMENT", "OFFICE", "DIVISION", "SECTION"];
|
||||||
if (!validOrgRootRanks.includes(requestBody.orgRootRank.toUpperCase())) {
|
if (!validOrgRootRanks.includes(requestBody.orgRootRank.toUpperCase())) {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgRootRank");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgRootRank");
|
||||||
|
|
@ -193,6 +212,23 @@ export class OrgRootController extends Controller {
|
||||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgRo otRank");
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. orgRo otRank");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (requestBody.isDeputy == true) {
|
||||||
|
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||||
|
where: { id: requestBody.orgRevisionId },
|
||||||
|
relations: ["orgRoots"],
|
||||||
|
});
|
||||||
|
if (orgRevision != null) {
|
||||||
|
await Promise.all(
|
||||||
|
orgRevision.orgRoots
|
||||||
|
.filter((x: OrgRoot) => x.isDeputy == true)
|
||||||
|
.map(async (item: OrgRoot) => {
|
||||||
|
item.isDeputy = false;
|
||||||
|
await this.orgRootRepository.save(item);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const revisionIdExits = await this.orgRevisionRepository.findOne({
|
const revisionIdExits = await this.orgRevisionRepository.findOne({
|
||||||
where: { id: requestBody.orgRevisionId },
|
where: { id: requestBody.orgRevisionId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -732,6 +732,7 @@ export class OrganizationController extends Controller {
|
||||||
// )
|
// )
|
||||||
.select([
|
.select([
|
||||||
"orgRoot.id",
|
"orgRoot.id",
|
||||||
|
"orgRoot.isDeputy",
|
||||||
"orgRoot.orgRootName",
|
"orgRoot.orgRootName",
|
||||||
"orgRoot.orgRootShortName",
|
"orgRoot.orgRootShortName",
|
||||||
"orgRoot.orgRootCode",
|
"orgRoot.orgRootCode",
|
||||||
|
|
@ -906,6 +907,7 @@ export class OrganizationController extends Controller {
|
||||||
orgRootName: orgRoot.orgRootName,
|
orgRootName: orgRoot.orgRootName,
|
||||||
responsibility: orgRoot.responsibility,
|
responsibility: orgRoot.responsibility,
|
||||||
isOfficer: false,
|
isOfficer: false,
|
||||||
|
isDeputy: orgRoot.isDeputy,
|
||||||
labelName:
|
labelName:
|
||||||
orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName,
|
orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName,
|
||||||
totalPosition: await this.posMasterRepository.count({
|
totalPosition: await this.posMasterRepository.count({
|
||||||
|
|
@ -1552,6 +1554,7 @@ export class OrganizationController extends Controller {
|
||||||
})
|
})
|
||||||
.select([
|
.select([
|
||||||
"orgRoot.id",
|
"orgRoot.id",
|
||||||
|
"orgRoot.isDeputy",
|
||||||
"orgRoot.orgRootName",
|
"orgRoot.orgRootName",
|
||||||
"orgRoot.orgRootShortName",
|
"orgRoot.orgRootShortName",
|
||||||
"orgRoot.orgRootCode",
|
"orgRoot.orgRootCode",
|
||||||
|
|
@ -1685,6 +1688,7 @@ export class OrganizationController extends Controller {
|
||||||
orgTreeFax: orgRoot.orgRootFax,
|
orgTreeFax: orgRoot.orgRootFax,
|
||||||
orgRevisionId: orgRoot.orgRevisionId,
|
orgRevisionId: orgRoot.orgRevisionId,
|
||||||
orgRootName: orgRoot.orgRootName,
|
orgRootName: orgRoot.orgRootName,
|
||||||
|
isDeputy: orgRoot.isDeputy,
|
||||||
responsibility: orgRoot.responsibility,
|
responsibility: orgRoot.responsibility,
|
||||||
labelName:
|
labelName:
|
||||||
orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName,
|
orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName,
|
||||||
|
|
@ -2322,6 +2326,7 @@ export class OrganizationController extends Controller {
|
||||||
)
|
)
|
||||||
.select([
|
.select([
|
||||||
"orgRoot.id",
|
"orgRoot.id",
|
||||||
|
"orgRoot.isDeputy",
|
||||||
"orgRoot.orgRootName",
|
"orgRoot.orgRootName",
|
||||||
"orgRoot.orgRootShortName",
|
"orgRoot.orgRootShortName",
|
||||||
"orgRoot.orgRootCode",
|
"orgRoot.orgRootCode",
|
||||||
|
|
@ -2495,6 +2500,7 @@ export class OrganizationController extends Controller {
|
||||||
orgTreeFax: orgRoot.orgRootFax,
|
orgTreeFax: orgRoot.orgRootFax,
|
||||||
orgRevisionId: orgRoot.orgRevisionId,
|
orgRevisionId: orgRoot.orgRevisionId,
|
||||||
orgRootName: orgRoot.orgRootName,
|
orgRootName: orgRoot.orgRootName,
|
||||||
|
isDeputy:orgRoot.isDeputy,
|
||||||
responsibility: orgRoot.responsibility,
|
responsibility: orgRoot.responsibility,
|
||||||
labelName:
|
labelName:
|
||||||
orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName,
|
orgRoot.orgRootName + " " + orgRoot.orgRootCode + "00" + " " + orgRoot.orgRootShortName,
|
||||||
|
|
@ -6561,6 +6567,24 @@ export class OrganizationController extends Controller {
|
||||||
const check = orgRevision.orgChild1s.find((x) => x.isOfficer == true);
|
const check = orgRevision.orgChild1s.find((x) => x.isOfficer == true);
|
||||||
return new HttpSuccess(check != null);
|
return new HttpSuccess(check != null);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* API เช็ค org ในระบบ
|
||||||
|
*
|
||||||
|
* @summary - เช็ค org ในระบบ (ADMIN)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Get("check/root/{id}")
|
||||||
|
async findIsDeputyRoot(@Path() id: string, @Request() request: RequestWithUser) {
|
||||||
|
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||||
|
where: { id },
|
||||||
|
relations: ["orgRoots"],
|
||||||
|
});
|
||||||
|
if (!orgRevision) {
|
||||||
|
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
}
|
||||||
|
const check = orgRevision.orgRoots.find((x) => x.isDeputy == true);
|
||||||
|
return new HttpSuccess(check != null);
|
||||||
|
}
|
||||||
public async listAuthSysOrgFuncByRevisionIdN(
|
public async listAuthSysOrgFuncByRevisionIdN(
|
||||||
request: RequestWithUser,
|
request: RequestWithUser,
|
||||||
system: string,
|
system: string,
|
||||||
|
|
|
||||||
|
|
@ -2152,7 +2152,8 @@ export class PositionController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("history/{id}")
|
@Get("history/{id}")
|
||||||
async getHistoryPosMater(@Path() id: string, @Request() request: RequestWithUser) {
|
async getHistoryPosMater(@Path() id: string, @Request() request: RequestWithUser) {
|
||||||
await new permission().PermissionGet(request, "SYS_ORG");
|
let _workflow = await new permission().Workflow(request, id, "SYS_ORG");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(request, "SYS_ORG");
|
||||||
const posMaster = await this.posMasterRepository.findOne({
|
const posMaster = await this.posMasterRepository.findOne({
|
||||||
where: { id },
|
where: { id },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ export class ProfileAbilityController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async detailProfileAbility(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async detailProfileAbility(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const getProfileAbilityId = await this.profileAbilityRepo.find({
|
const getProfileAbilityId = await this.profileAbilityRepo.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -69,7 +71,9 @@ export class ProfileAbilityController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.profileAbilityRepo.findOneBy({ id: abilityId });
|
const _record = await this.profileAbilityRepo.findOneBy({ id: abilityId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, abilityId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
const record = await this.profileAbilityHistoryRepo.find({
|
const record = await this.profileAbilityHistoryRepo.find({
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,9 @@ export class ProfileAbilityEmployeeController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const getProfileAbilityId = await this.profileAbilityRepo.find({
|
const getProfileAbilityId = await this.profileAbilityRepo.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -72,11 +74,13 @@ export class ProfileAbilityEmployeeController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.profileAbilityRepo.findOneBy({ id: abilityId });
|
const _record = await this.profileAbilityRepo.findOneBy({ id: abilityId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, abilityId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.profileAbilityHistoryRepo.find({
|
const record = await this.profileAbilityHistoryRepo.find({
|
||||||
where: { profileAbilityId: abilityId },
|
where: { profileAbilityId: abilityId },
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,8 @@ export class ProfileAbilityEmployeeTempController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const getProfileAbilityId = await this.profileAbilityRepo.find({
|
const getProfileAbilityId = await this.profileAbilityRepo.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -72,7 +73,8 @@ export class ProfileAbilityEmployeeTempController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.profileAbilityRepo.findOneBy({ id: abilityId });
|
const _record = await this.profileAbilityRepo.findOneBy({ id: abilityId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, abilityId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
}
|
}
|
||||||
const record = await this.profileAbilityHistoryRepo.find({
|
const record = await this.profileAbilityHistoryRepo.find({
|
||||||
where: { profileAbilityId: abilityId },
|
where: { profileAbilityId: abilityId },
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ export class ProfileAddressController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async detailProfileAddress(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async detailProfileAddress(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const getProfileAddress = await this.profileRepo.findOne({
|
const getProfileAddress = await this.profileRepo.findOne({
|
||||||
where: { id: profileId },
|
where: { id: profileId },
|
||||||
select: [
|
select: [
|
||||||
|
|
@ -125,7 +127,9 @@ export class ProfileAddressController extends Controller {
|
||||||
@Path() profileId: string,
|
@Path() profileId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const record = await this.profileAddressHistoryRepo.find({
|
const record = await this.profileAddressHistoryRepo.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
relations: [
|
relations: [
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,9 @@ export class ProfileAddressEmployeeController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const getProfileAddress = await this.profileEmployeeRepo.findOne({
|
const getProfileAddress = await this.profileEmployeeRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
select: [
|
select: [
|
||||||
|
|
@ -129,7 +131,9 @@ export class ProfileAddressEmployeeController extends Controller {
|
||||||
@Path() profileId: string,
|
@Path() profileId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
||||||
const record = await this.profileAddressHistoryRepo.find({
|
const record = await this.profileAddressHistoryRepo.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
relations: [
|
relations: [
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,8 @@ export class ProfileAddressEmployeeTempController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const getProfileAddress = await this.profileEmployeeRepo.findOne({
|
const getProfileAddress = await this.profileEmployeeRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
select: [
|
select: [
|
||||||
|
|
@ -129,7 +130,8 @@ export class ProfileAddressEmployeeTempController extends Controller {
|
||||||
@Path() profileId: string,
|
@Path() profileId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.profileAddressHistoryRepo.find({
|
const record = await this.profileAddressHistoryRepo.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
relations: [
|
relations: [
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,9 @@ export class ProfileAssessmentsController extends Controller {
|
||||||
@Path() profileId: string,
|
@Path() profileId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const getProfileAssessments = await this.profileAssessmentsRepository.find({
|
const getProfileAssessments = await this.profileAssessmentsRepository.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -77,7 +79,9 @@ export class ProfileAssessmentsController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, assessmentId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
|
|
||||||
const record = await this.profileAssessmentsHistoryRepository.find({
|
const record = await this.profileAssessmentsHistoryRepository.find({
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,9 @@ export class ProfileAssessmentsEmployeeController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const getProfileAssessments = await this.profileAssessmentsRepository.find({
|
const getProfileAssessments = await this.profileAssessmentsRepository.find({
|
||||||
where: {
|
where: {
|
||||||
profileEmployeeId: profileEmployeeId,
|
profileEmployeeId: profileEmployeeId,
|
||||||
|
|
@ -75,11 +77,13 @@ export class ProfileAssessmentsEmployeeController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.profileAssessmentsRepository.findOneBy({ id: assessmentId });
|
const _record = await this.profileAssessmentsRepository.findOneBy({ id: assessmentId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, assessmentId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.profileAssessmentsHistoryRepository.find({
|
const record = await this.profileAssessmentsHistoryRepository.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,8 @@ export class ProfileAssessmentsEmployeeTempController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const getProfileAssessments = await this.profileAssessmentsRepository.find({
|
const getProfileAssessments = await this.profileAssessmentsRepository.find({
|
||||||
where: {
|
where: {
|
||||||
profileEmployeeId: profileEmployeeId,
|
profileEmployeeId: profileEmployeeId,
|
||||||
|
|
@ -73,7 +74,8 @@ export class ProfileAssessmentsEmployeeTempController extends Controller {
|
||||||
@Path() assessmentId: string,
|
@Path() assessmentId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, assessmentId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.profileAssessmentsHistoryRepository.find({
|
const record = await this.profileAssessmentsHistoryRepository.find({
|
||||||
where: {
|
where: {
|
||||||
profileAssessmentId: assessmentId,
|
profileAssessmentId: assessmentId,
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,9 @@ export class ProfileAvatarController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getAvatar(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getAvatar(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const lists = await this.avatarRepository.find({
|
const lists = await this.avatarRepository.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -27,7 +29,9 @@ export class ProfileAvatarController extends Controller {
|
||||||
|
|
||||||
@Get("profileId/{id}")
|
@Get("profileId/{id}")
|
||||||
async getProfile(@Path() id: string, @Request() req: RequestWithUser) {
|
async getProfile(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);
|
||||||
const profile = await this.profileRepository.findOne({
|
const profile = await this.profileRepository.findOne({
|
||||||
where: { id },
|
where: { id },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,9 @@ export class ProfileAvatarEmployeeController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const lists = await this.avatarRepository.find({
|
const lists = await this.avatarRepository.find({
|
||||||
where: { profileEmployeeId },
|
where: { profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -30,7 +32,9 @@ export class ProfileAvatarEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("profileEmployeeId/{id}")
|
@Get("profileEmployeeId/{id}")
|
||||||
async getProfile(@Path() id: string, @Request() req: RequestWithUser) {
|
async getProfile(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", id);
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", id);
|
||||||
const profile = await this.profileRepository.findOne({
|
const profile = await this.profileRepository.findOne({
|
||||||
where: { id },
|
where: { id },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ export class ProfileAvatarEmployeeTempController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const lists = await this.avatarRepository.find({
|
const lists = await this.avatarRepository.find({
|
||||||
where: { profileEmployeeId },
|
where: { profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -30,7 +31,8 @@ export class ProfileAvatarEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("profileEmployeeId/{id}")
|
@Get("profileEmployeeId/{id}")
|
||||||
async getProfile(@Path() id: string, @Request() req: RequestWithUser) {
|
async getProfile(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profile = await this.profileRepository.findOne({
|
const profile = await this.profileRepository.findOne({
|
||||||
where: { id },
|
where: { id },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ export class ProfileCertificateController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getCertificate(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getCertificate(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const record = await this.certificateRepo.find({
|
const record = await this.certificateRepo.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -63,7 +65,9 @@ export class ProfileCertificateController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.certificateRepo.findOneBy({ id: certificateId });
|
const _record = await this.certificateRepo.findOneBy({ id: certificateId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, certificateId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.certificateHistoryRepo.find({
|
const record = await this.certificateHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ export class ProfileCertificateEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getCertificate(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getCertificate(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const record = await this.certificateRepo.find({
|
const record = await this.certificateRepo.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -63,11 +65,13 @@ export class ProfileCertificateEmployeeController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.certificateRepo.findOneBy({ id: certificateId });
|
const _record = await this.certificateRepo.findOneBy({ id: certificateId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, certificateId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.certificateHistoryRepo.find({
|
const record = await this.certificateHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ export class ProfileCertificateEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getCertificate(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getCertificate(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.certificateRepo.find({
|
const record = await this.certificateRepo.find({
|
||||||
where: { profileEmployeeId },
|
where: { profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -61,7 +62,8 @@ export class ProfileCertificateEmployeeTempController extends Controller {
|
||||||
@Path() certificateId: string,
|
@Path() certificateId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, certificateId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.certificateHistoryRepo.find({
|
const record = await this.certificateHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileCertificateId: certificateId,
|
profileCertificateId: certificateId,
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,9 @@ export class ProfileChangeNameController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getChangeName(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getChangeName(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const lists = await this.changeNameRepository.find({
|
const lists = await this.changeNameRepository.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -61,7 +63,9 @@ export class ProfileChangeNameController extends Controller {
|
||||||
public async changeNameHistory(@Path() changeNameId: string, @Request() req: RequestWithUser) {
|
public async changeNameHistory(@Path() changeNameId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.changeNameRepository.findOneBy({ id: changeNameId });
|
const _record = await this.changeNameRepository.findOneBy({ id: changeNameId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, changeNameId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.changeNameHistoryRepository.find({
|
const record = await this.changeNameHistoryRepository.find({
|
||||||
where: { profileChangeNameId: changeNameId },
|
where: { profileChangeNameId: changeNameId },
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,9 @@ export class ProfileChangeNameEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getChangeName(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getChangeName(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const lists = await this.changeNameRepository.find({
|
const lists = await this.changeNameRepository.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -61,11 +63,13 @@ export class ProfileChangeNameEmployeeController extends Controller {
|
||||||
public async changeNameHistory(@Path() changeNameId: string, @Request() req: RequestWithUser) {
|
public async changeNameHistory(@Path() changeNameId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.changeNameRepository.findOneBy({ id: changeNameId });
|
const _record = await this.changeNameRepository.findOneBy({ id: changeNameId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, changeNameId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.changeNameHistoryRepository.find({
|
const record = await this.changeNameHistoryRepository.find({
|
||||||
where: { profileChangeNameId: changeNameId },
|
where: { profileChangeNameId: changeNameId },
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,8 @@ export class ProfileChangeNameEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getChangeName(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getChangeName(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const lists = await this.changeNameRepository.find({
|
const lists = await this.changeNameRepository.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -59,7 +60,8 @@ export class ProfileChangeNameEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("history/{changeNameId}")
|
@Get("history/{changeNameId}")
|
||||||
public async changeNameHistory(@Path() changeNameId: string, @Request() req: RequestWithUser) {
|
public async changeNameHistory(@Path() changeNameId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, changeNameId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.changeNameHistoryRepository.find({
|
const record = await this.changeNameHistoryRepository.find({
|
||||||
where: { profileChangeNameId: changeNameId },
|
where: { profileChangeNameId: changeNameId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,9 @@ export class ProfileChildrenController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getChildren(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getChildren(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const lists = await this.childrenRepository.find({
|
const lists = await this.childrenRepository.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -61,7 +63,9 @@ export class ProfileChildrenController extends Controller {
|
||||||
public async childrenHistory(@Path() childrenId: string, @Request() req: RequestWithUser) {
|
public async childrenHistory(@Path() childrenId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.childrenRepository.findOneBy({ id: childrenId });
|
const _record = await this.childrenRepository.findOneBy({ id: childrenId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, childrenId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.childrenHistoryRepository.find({
|
const record = await this.childrenHistoryRepository.find({
|
||||||
where: { profileChildrenId: childrenId },
|
where: { profileChildrenId: childrenId },
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,9 @@ export class ProfileChildrenEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getChildren(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getChildren(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const lists = await this.childrenRepository.find({
|
const lists = await this.childrenRepository.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -61,11 +63,13 @@ export class ProfileChildrenEmployeeController extends Controller {
|
||||||
public async childrenHistory(@Path() childrenId: string, @Request() req: RequestWithUser) {
|
public async childrenHistory(@Path() childrenId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.childrenRepository.findOneBy({ id: childrenId });
|
const _record = await this.childrenRepository.findOneBy({ id: childrenId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, childrenId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.childrenHistoryRepository.find({
|
const record = await this.childrenHistoryRepository.find({
|
||||||
where: { profileChildrenId: childrenId },
|
where: { profileChildrenId: childrenId },
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,8 @@ export class ProfileChildrenEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getChildren(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getChildren(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const lists = await this.childrenRepository.find({
|
const lists = await this.childrenRepository.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -59,7 +60,8 @@ export class ProfileChildrenEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("history/{childrenId}")
|
@Get("history/{childrenId}")
|
||||||
public async childrenHistory(@Path() childrenId: string, @Request() req: RequestWithUser) {
|
public async childrenHistory(@Path() childrenId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, childrenId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.childrenHistoryRepository.find({
|
const record = await this.childrenHistoryRepository.find({
|
||||||
where: { profileChildrenId: childrenId },
|
where: { profileChildrenId: childrenId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ export class ProfileController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("kp7-short/{id}")
|
@Get("kp7-short/{id}")
|
||||||
async kp7ShortById(@Path() id: string, @Request() req: RequestWithUser) {
|
async kp7ShortById(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);
|
//await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);
|
||||||
const orgRevision = await this.orgRevisionRepo.findOne({
|
const orgRevision = await this.orgRevisionRepo.findOne({
|
||||||
where: { orgRevisionIsCurrent: true },
|
where: { orgRevisionIsCurrent: true },
|
||||||
});
|
});
|
||||||
|
|
@ -283,7 +283,7 @@ export class ProfileController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("kk1/{id}")
|
@Get("kk1/{id}")
|
||||||
public async getKk1(@Path() id: string, @Request() req: RequestWithUser) {
|
public async getKk1(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);
|
//await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);
|
||||||
const profiles = await this.profileRepo.findOne({
|
const profiles = await this.profileRepo.findOne({
|
||||||
// select: [
|
// select: [
|
||||||
// "citizenId",
|
// "citizenId",
|
||||||
|
|
@ -1234,7 +1234,7 @@ export class ProfileController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("commander/{profileId}")
|
@Get("commander/{profileId}")
|
||||||
async getProfileCommanderUser(@Request() request: RequestWithUser, @Path() profileId: string) {
|
async getProfileCommanderUser(@Request() request: RequestWithUser, @Path() profileId: string) {
|
||||||
// await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", profileId);//ไม่แน่ใจOFFปิดไว้ก่อน
|
//await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", profileId); //ไม่แน่ใจOFFปิดไว้ก่อน
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileId },
|
where: { id: profileId },
|
||||||
});
|
});
|
||||||
|
|
@ -2752,7 +2752,9 @@ export class ProfileController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("{id}")
|
@Get("{id}")
|
||||||
async getProfile(@Request() req: RequestWithUser, @Path() id: string) {
|
async getProfile(@Request() req: RequestWithUser, @Path() id: string) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);
|
||||||
let profile: any = await this.profileRepo.findOne({
|
let profile: any = await this.profileRepo.findOne({
|
||||||
relations: {
|
relations: {
|
||||||
posLevel: true,
|
posLevel: true,
|
||||||
|
|
@ -2798,7 +2800,7 @@ export class ProfileController extends Controller {
|
||||||
|
|
||||||
@Get("history/{id}")
|
@Get("history/{id}")
|
||||||
async getProfileHistory(@Path() id: string, @Request() req: RequestWithUser) {
|
async getProfileHistory(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
|
//await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id); //ไม่แน่ใจOFFปิดไว้ก่อน
|
||||||
const profile = await this.profileHistoryRepo.find({
|
const profile = await this.profileHistoryRepo.find({
|
||||||
relations: {
|
relations: {
|
||||||
posLevel: true,
|
posLevel: true,
|
||||||
|
|
@ -3975,7 +3977,7 @@ export class ProfileController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("profileid/position/{id}")
|
@Get("profileid/position/{id}")
|
||||||
async getProfileByProfileid(@Request() request: RequestWithUser, @Path() id: string) {
|
async getProfileByProfileid(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
// await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
|
//await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", id); //ไม่แน่ใจOFFปิดไว้ก่อน
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
relations: [
|
relations: [
|
||||||
|
|
@ -4208,7 +4210,7 @@ export class ProfileController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
||||||
}
|
}
|
||||||
// await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", profile.id);//ไม่แน่ใจOFFปิดไว้ก่อน
|
//await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", profile.id); //ไม่แน่ใจOFFปิดไว้ก่อน
|
||||||
return new HttpSuccess(profile);
|
return new HttpSuccess(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4228,7 +4230,7 @@ export class ProfileController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
||||||
}
|
}
|
||||||
// await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", profile.id);//ไม่แน่ใจOFFปิดไว้ก่อน
|
//await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", profile.id); //ไม่แน่ใจOFFปิดไว้ก่อน
|
||||||
|
|
||||||
const orgRevisionPublish = await this.orgRevisionRepo
|
const orgRevisionPublish = await this.orgRevisionRepo
|
||||||
.createQueryBuilder("orgRevision")
|
.createQueryBuilder("orgRevision")
|
||||||
|
|
@ -4343,7 +4345,7 @@ export class ProfileController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("profileempid/position/{id}")
|
@Get("profileempid/position/{id}")
|
||||||
async getProfileByProfileempid(@Request() request: RequestWithUser, @Path() id: string) {
|
async getProfileByProfileempid(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
// await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
|
//await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_OFFICER", id); //ไม่แน่ใจOFFปิดไว้ก่อน
|
||||||
const profile = await this.profileEmpRepo.findOne({
|
const profile = await this.profileEmpRepo.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],
|
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],
|
||||||
|
|
@ -5671,7 +5673,7 @@ export class ProfileController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("profileid/retire/{year}")
|
@Get("profileid/retire/{year}")
|
||||||
async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) {
|
async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) {
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id);//ไม่แน่ใจOFFปิดไว้ก่อน
|
//await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", id); //ไม่แน่ใจOFFปิดไว้ก่อน
|
||||||
const profiles = await this.profileRepo
|
const profiles = await this.profileRepo
|
||||||
.createQueryBuilder("profile")
|
.createQueryBuilder("profile")
|
||||||
.leftJoinAndSelect("profile.posLevel", "posLevel")
|
.leftJoinAndSelect("profile.posLevel", "posLevel")
|
||||||
|
|
@ -6363,15 +6365,16 @@ export class ProfileController extends Controller {
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API แก้ไขเบอร์โทรศัพท์
|
* API แก้ไขเบอร์โทรศัพท์
|
||||||
*
|
*
|
||||||
* @summary แก้ไขเบอร์โทรศัพท์ (USER)
|
* @summary แก้ไขเบอร์โทรศัพท์ (USER)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Put("updatePhoneNumber/user")
|
@Put("updatePhoneNumber/user")
|
||||||
async updatePhoneNumber(@Request() request: RequestWithUser,
|
async updatePhoneNumber(
|
||||||
@Body()
|
@Request() request: RequestWithUser,
|
||||||
|
@Body()
|
||||||
body: {
|
body: {
|
||||||
phone: string;
|
phone: string;
|
||||||
},
|
},
|
||||||
|
|
@ -6408,15 +6411,16 @@ export class ProfileController extends Controller {
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API แก้ไขอีเมล
|
* API แก้ไขอีเมล
|
||||||
*
|
*
|
||||||
* @summary แก้ไขอีเมล (USER)
|
* @summary แก้ไขอีเมล (USER)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Put("updateEmail/user")
|
@Put("updateEmail/user")
|
||||||
async updateEmail(@Request() request: RequestWithUser,
|
async updateEmail(
|
||||||
@Body()
|
@Request() request: RequestWithUser,
|
||||||
|
@Body()
|
||||||
body: {
|
body: {
|
||||||
email: string;
|
email: string;
|
||||||
},
|
},
|
||||||
|
|
@ -6453,7 +6457,4 @@ export class ProfileController extends Controller {
|
||||||
]);
|
]);
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import {
|
||||||
Route,
|
Route,
|
||||||
Security,
|
Security,
|
||||||
Tags,
|
Tags,
|
||||||
Query
|
Query,
|
||||||
} from "tsoa";
|
} from "tsoa";
|
||||||
import { AppDataSource } from "../database/data-source";
|
import { AppDataSource } from "../database/data-source";
|
||||||
import HttpSuccess from "../interfaces/http-success";
|
import HttpSuccess from "../interfaces/http-success";
|
||||||
|
|
@ -51,13 +51,15 @@ export class ProfileDevelopmentController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getDevelopment(
|
public async getDevelopment(
|
||||||
@Path() profileId: string,
|
@Path() profileId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Query("page") page: number = 1,
|
@Query("page") page: number = 1,
|
||||||
@Query("pageSize") pageSize: number = 10,
|
@Query("pageSize") pageSize: number = 10,
|
||||||
@Query() searchKeyword: string = "",
|
@Query() searchKeyword: string = "",
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const [profileDevelopment, total] = await AppDataSource.getRepository(ProfileDevelopment)
|
const [profileDevelopment, total] = await AppDataSource.getRepository(ProfileDevelopment)
|
||||||
.createQueryBuilder("profileDevelopment")
|
.createQueryBuilder("profileDevelopment")
|
||||||
.where({ profileId: profileId })
|
.where({ profileId: profileId })
|
||||||
|
|
@ -67,10 +69,10 @@ export class ProfileDevelopmentController extends Controller {
|
||||||
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
||||||
? "profileDevelopment.name LIKE :keyword"
|
? "profileDevelopment.name LIKE :keyword"
|
||||||
: "1=1",
|
: "1=1",
|
||||||
{
|
{
|
||||||
keyword: `%${searchKeyword}%`,
|
keyword: `%${searchKeyword}%`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.orWhere(
|
.orWhere(
|
||||||
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
searchKeyword != undefined && searchKeyword != null && searchKeyword != ""
|
||||||
? "profileDevelopment.developmentTarget LIKE :keyword"
|
? "profileDevelopment.developmentTarget LIKE :keyword"
|
||||||
|
|
@ -108,7 +110,9 @@ export class ProfileDevelopmentController extends Controller {
|
||||||
public async developmentHistory(@Path() developmentId: string, @Request() req: RequestWithUser) {
|
public async developmentHistory(@Path() developmentId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.developmentRepository.findOneBy({ id: developmentId });
|
const _record = await this.developmentRepository.findOneBy({ id: developmentId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, developmentId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.developmentHistoryRepository.find({
|
const record = await this.developmentHistoryRepository.find({
|
||||||
where: { profileDevelopmentId: developmentId },
|
where: { profileDevelopmentId: developmentId },
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,9 @@ export class ProfileDevelopmentEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getDevelopment(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDevelopment(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
||||||
const lists = await this.developmentRepository.find({
|
const lists = await this.developmentRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -61,11 +63,13 @@ export class ProfileDevelopmentEmployeeController extends Controller {
|
||||||
public async developmentHistory(@Path() developmentId: string, @Request() req: RequestWithUser) {
|
public async developmentHistory(@Path() developmentId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.developmentRepository.findOneBy({ id: developmentId });
|
const _record = await this.developmentRepository.findOneBy({ id: developmentId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, developmentId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.developmentHistoryRepository.find({
|
const record = await this.developmentHistoryRepository.find({
|
||||||
where: { profileDevelopmentId: developmentId },
|
where: { profileDevelopmentId: developmentId },
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,8 @@ export class ProfileDevelopmentEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getDevelopment(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDevelopment(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const lists = await this.developmentRepository.find({
|
const lists = await this.developmentRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -59,7 +60,8 @@ export class ProfileDevelopmentEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("history/{developmentId}")
|
@Get("history/{developmentId}")
|
||||||
public async developmentHistory(@Path() developmentId: string, @Request() req: RequestWithUser) {
|
public async developmentHistory(@Path() developmentId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, developmentId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.developmentHistoryRepository.find({
|
const record = await this.developmentHistoryRepository.find({
|
||||||
where: { profileDevelopmentId: developmentId },
|
where: { profileDevelopmentId: developmentId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ export class ProfileDisciplineController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getDiscipline(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDiscipline(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const lists = await this.disciplineRepository.find({
|
const lists = await this.disciplineRepository.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -58,7 +60,8 @@ export class ProfileDisciplineController extends Controller {
|
||||||
|
|
||||||
@Get("admin/{profileId}")
|
@Get("admin/{profileId}")
|
||||||
public async getDisciplineAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDisciplineAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_SALARY_OFFICER");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_SALARY_OFFICER");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_SALARY_OFFICER");
|
||||||
const lists = await this.disciplineRepository.find({
|
const lists = await this.disciplineRepository.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -73,7 +76,9 @@ export class ProfileDisciplineController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.disciplineRepository.findOneBy({ id: disciplineId });
|
const _record = await this.disciplineRepository.findOneBy({ id: disciplineId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, disciplineId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.disciplineHistoryRepository.find({
|
const record = await this.disciplineHistoryRepository.find({
|
||||||
where: { profileDisciplineId: disciplineId },
|
where: { profileDisciplineId: disciplineId },
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ export class ProfileDisciplineEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getDiscipline(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDiscipline(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
||||||
const lists = await this.disciplineRepository.find({
|
const lists = await this.disciplineRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -58,7 +60,8 @@ export class ProfileDisciplineEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("admin/{profileId}")
|
@Get("admin/{profileId}")
|
||||||
public async getDisciplineAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDisciplineAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_WAGE");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_WAGE");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_WAGE");
|
||||||
const lists = await this.disciplineRepository.find({
|
const lists = await this.disciplineRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -73,11 +76,13 @@ export class ProfileDisciplineEmployeeController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.disciplineRepository.findOneBy({ id: disciplineId });
|
const _record = await this.disciplineRepository.findOneBy({ id: disciplineId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, disciplineId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.disciplineHistoryRepository.find({
|
const record = await this.disciplineHistoryRepository.find({
|
||||||
where: { profileDisciplineId: disciplineId },
|
where: { profileDisciplineId: disciplineId },
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ export class ProfileDisciplineEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getDiscipline(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDiscipline(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const lists = await this.disciplineRepository.find({
|
const lists = await this.disciplineRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -58,7 +59,8 @@ export class ProfileDisciplineEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("admin/{profileId}")
|
@Get("admin/{profileId}")
|
||||||
public async getDisciplineAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDisciplineAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_WAGE");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_WAGE");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_WAGE");
|
||||||
const lists = await this.disciplineRepository.find({
|
const lists = await this.disciplineRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -71,7 +73,8 @@ export class ProfileDisciplineEmployeeTempController extends Controller {
|
||||||
@Path() disciplineId: string,
|
@Path() disciplineId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, disciplineId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.disciplineHistoryRepository.find({
|
const record = await this.disciplineHistoryRepository.find({
|
||||||
where: { profileDisciplineId: disciplineId },
|
where: { profileDisciplineId: disciplineId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,9 @@ export class ProfileDutyController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getDuty(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDuty(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const lists = await this.dutyRepository.find({
|
const lists = await this.dutyRepository.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -56,7 +58,9 @@ export class ProfileDutyController extends Controller {
|
||||||
public async dutyAdminHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
public async dutyAdminHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.dutyRepository.findOneBy({ id: dutyId });
|
const _record = await this.dutyRepository.findOneBy({ id: dutyId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, dutyId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.dutyHistoryRepository.find({
|
const record = await this.dutyHistoryRepository.find({
|
||||||
where: { profileDutyId: dutyId },
|
where: { profileDutyId: dutyId },
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,9 @@ export class ProfileDutyEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getDuty(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDuty(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
||||||
const lists = await this.dutyRepository.find({
|
const lists = await this.dutyRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -56,11 +58,13 @@ export class ProfileDutyEmployeeController extends Controller {
|
||||||
public async dutyAdminHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
public async dutyAdminHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.dutyRepository.findOneBy({ id: dutyId });
|
const _record = await this.dutyRepository.findOneBy({ id: dutyId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, dutyId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.dutyHistoryRepository.find({
|
const record = await this.dutyHistoryRepository.find({
|
||||||
where: { profileDutyId: dutyId },
|
where: { profileDutyId: dutyId },
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,8 @@ export class ProfileDutyEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getDuty(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getDuty(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const lists = await this.dutyRepository.find({
|
const lists = await this.dutyRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -54,7 +55,8 @@ export class ProfileDutyEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("admin/history/{dutyId}")
|
@Get("admin/history/{dutyId}")
|
||||||
public async dutyAdminHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
public async dutyAdminHistory(@Path() dutyId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, dutyId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.dutyHistoryRepository.find({
|
const record = await this.dutyHistoryRepository.find({
|
||||||
where: { profileDutyId: dutyId },
|
where: { profileDutyId: dutyId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ export class ProfileEditController extends Controller {
|
||||||
await new CallAPI()
|
await new CallAPI()
|
||||||
.PostData(req, "/org/workflow/add-workflow", {
|
.PostData(req, "/org/workflow/add-workflow", {
|
||||||
refId: data.id,
|
refId: data.id,
|
||||||
sysName: "REGISTRY_PROFILE",
|
sysName: "SYS_REGISTRY_OFFICER",
|
||||||
posLevelName: profile.posLevel.posLevelName,
|
posLevelName: profile.posLevel.posLevelName,
|
||||||
posTypeName: profile.posType.posTypeName,
|
posTypeName: profile.posType.posTypeName,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,9 @@ export class ProfileEducationsController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async detailProfileEducation(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async detailProfileEducation(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const getProfileEducation = await this.profileEducationRepo.find({
|
const getProfileEducation = await this.profileEducationRepo.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -71,7 +73,9 @@ export class ProfileEducationsController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.profileEducationRepo.findOneBy({ id: educationId });
|
const _record = await this.profileEducationRepo.findOneBy({ id: educationId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, educationId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.profileEducationHistoryRepo.find({
|
const record = await this.profileEducationHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,9 @@ export class ProfileEducationsEmployeeController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const getProfileEducation = await this.profileEducationRepo.find({
|
const getProfileEducation = await this.profileEducationRepo.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -72,11 +74,13 @@ export class ProfileEducationsEmployeeController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.profileEducationRepo.findOneBy({ id: educationId });
|
const _record = await this.profileEducationRepo.findOneBy({ id: educationId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, educationId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const record = await this.profileEducationHistoryRepo.find({
|
const record = await this.profileEducationHistoryRepo.find({
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,8 @@ export class ProfileEducationsEmployeeTempController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const getProfileEducation = await this.profileEducationRepo.find({
|
const getProfileEducation = await this.profileEducationRepo.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -70,7 +71,8 @@ export class ProfileEducationsEmployeeTempController extends Controller {
|
||||||
@Path() educationId: string,
|
@Path() educationId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, educationId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.profileEducationHistoryRepo.find({
|
const record = await this.profileEducationHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileEducationId: educationId,
|
profileEducationId: educationId,
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,9 @@ export class ProfileEmployeeController extends Controller {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profile.id);
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profile.id);
|
||||||
let ImgUrl: any;
|
let ImgUrl: any;
|
||||||
if (profile?.avatar != null && profile?.avatarName != null) {
|
if (profile?.avatar != null && profile?.avatarName != null) {
|
||||||
// await new CallAPI()
|
// await new CallAPI()
|
||||||
|
|
@ -305,7 +307,9 @@ export class ProfileEmployeeController extends Controller {
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
if (profiles) {
|
if (profiles) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profiles.id);
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profiles.id);
|
||||||
}
|
}
|
||||||
if (!profiles) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
if (!profiles) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
let ImgUrl: any;
|
let ImgUrl: any;
|
||||||
|
|
@ -1230,7 +1234,9 @@ export class ProfileEmployeeController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("{id}")
|
@Get("{id}")
|
||||||
async detailProfile(@Path() id: string, @Request() req: RequestWithUser) {
|
async detailProfile(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", id);
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", id);
|
||||||
const profile: any = await this.profileRepo.findOne({
|
const profile: any = await this.profileRepo.findOne({
|
||||||
relations: {
|
relations: {
|
||||||
posLevel: true,
|
posLevel: true,
|
||||||
|
|
@ -1585,7 +1591,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("history/{id}")
|
@Get("history/{id}")
|
||||||
async getProfileHistory(@Path() id: string, @Request() req: RequestWithUser) {
|
async getProfileHistory(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", id);ไม่แน่ใจEMPปิดไว้ก่อน
|
//await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", id); ไม่แน่ใจEMPปิดไว้ก่อน;
|
||||||
const profile = await this.profileHistoryRepo.find({
|
const profile = await this.profileHistoryRepo.find({
|
||||||
relations: {
|
relations: {
|
||||||
posLevel: true,
|
posLevel: true,
|
||||||
|
|
@ -3210,7 +3216,9 @@ export class ProfileEmployeeController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("information/{profileEmployeeId}")
|
@Get("information/{profileEmployeeId}")
|
||||||
async getInformationById(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
async getInformationById(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const profileInformation = await this.profileRepo.findOne({
|
const profileInformation = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
@ -3241,7 +3249,9 @@ export class ProfileEmployeeController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("information/history/{profileEmployeeId}")
|
@Get("information/history/{profileEmployeeId}")
|
||||||
async getInformationHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
async getInformationHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const profileInformation = await this.informationHistoryRepository.find({
|
const profileInformation = await this.informationHistoryRepository.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: {
|
order: {
|
||||||
|
|
@ -3263,7 +3273,9 @@ export class ProfileEmployeeController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const employment = await this.employmentRepository.find({
|
const employment = await this.employmentRepository.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -3289,11 +3301,13 @@ export class ProfileEmployeeController extends Controller {
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
if (employment) {
|
if (employment) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
employment.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
employment.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return new HttpSuccess(employment);
|
return new HttpSuccess(employment);
|
||||||
}
|
}
|
||||||
|
|
@ -3311,11 +3325,13 @@ export class ProfileEmployeeController extends Controller {
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
if (employment) {
|
if (employment) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
employment.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
employment.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const employmentHistory = await this.employmentHistoryRepository.find({
|
const employmentHistory = await this.employmentHistoryRepository.find({
|
||||||
where: { profileEmployeeEmploymentId: id },
|
where: { profileEmployeeEmploymentId: id },
|
||||||
|
|
@ -3705,17 +3721,23 @@ export class ProfileEmployeeController extends Controller {
|
||||||
async getProfileByProfileid(@Request() request: RequestWithUser, @Path() id: string) {
|
async getProfileByProfileid(@Request() request: RequestWithUser, @Path() id: string) {
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot", "profileSalarys"],
|
relations: [
|
||||||
|
"posLevel",
|
||||||
|
"posType",
|
||||||
|
"current_holders",
|
||||||
|
"current_holders.orgRoot",
|
||||||
|
"profileSalarys",
|
||||||
|
],
|
||||||
order: {
|
order: {
|
||||||
profileSalarys: {
|
profileSalarys: {
|
||||||
order: "DESC"
|
order: "DESC",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลบุคคลนี้ในระบบ");
|
||||||
}
|
}
|
||||||
// await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_EMP", profile.id);//ไม่แน่ใจEMPปิดไว้ก่อน
|
//await new permission().PermissionOrgUserGet(request, "SYS_REGISTRY_EMP", profile.id); //ไม่แน่ใจEMPปิดไว้ก่อน
|
||||||
|
|
||||||
const orgRevisionPublish = await this.orgRevisionRepo
|
const orgRevisionPublish = await this.orgRevisionRepo
|
||||||
.createQueryBuilder("orgRevision")
|
.createQueryBuilder("orgRevision")
|
||||||
|
|
@ -3831,7 +3853,8 @@ export class ProfileEmployeeController extends Controller {
|
||||||
node: null,
|
node: null,
|
||||||
nodeId: null,
|
nodeId: null,
|
||||||
posNo: shortName,
|
posNo: shortName,
|
||||||
salary: profile && profile.profileSalarys.length > 0 ? profile.profileSalarys[0].amount : null
|
salary:
|
||||||
|
profile && profile.profileSalarys.length > 0 ? profile.profileSalarys[0].amount : null,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_profile.child4Id != null) {
|
if (_profile.child4Id != null) {
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,8 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("kp7-short/{id}")
|
@Get("kp7-short/{id}")
|
||||||
async kp7ShortById(@Path() id: string, @Request() req: RequestWithUser) {
|
async kp7ShortById(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const orgRevision = await this.orgRevisionRepo.findOne({
|
const orgRevision = await this.orgRevisionRepo.findOne({
|
||||||
where: { orgRevisionIsCurrent: true },
|
where: { orgRevisionIsCurrent: true },
|
||||||
});
|
});
|
||||||
|
|
@ -239,7 +240,8 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("kk1/{id}")
|
@Get("kk1/{id}")
|
||||||
public async getKk1Employee(@Path() id: string, @Request() req: RequestWithUser) {
|
public async getKk1Employee(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profiles = await this.profileRepo.findOne({
|
const profiles = await this.profileRepo.findOne({
|
||||||
// select: [
|
// select: [
|
||||||
// "citizenId",
|
// "citizenId",
|
||||||
|
|
@ -1055,7 +1057,8 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("{id}")
|
@Get("{id}")
|
||||||
async detailProfile(@Path() id: string, @Request() req: RequestWithUser) {
|
async detailProfile(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
relations: {
|
relations: {
|
||||||
posLevel: true,
|
posLevel: true,
|
||||||
|
|
@ -2941,7 +2944,8 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("information/{profileEmployeeId}")
|
@Get("information/{profileEmployeeId}")
|
||||||
async getInformationById(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
async getInformationById(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profileInformation = await this.profileRepo.findOne({
|
const profileInformation = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
@ -2972,7 +2976,8 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("information/history/{profileEmployeeId}")
|
@Get("information/history/{profileEmployeeId}")
|
||||||
async getInformationHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
async getInformationHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profileInformation = await this.informationHistoryRepository.find({
|
const profileInformation = await this.informationHistoryRepository.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: {
|
order: {
|
||||||
|
|
@ -2994,7 +2999,8 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const employment = await this.employmentRepository.find({
|
const employment = await this.employmentRepository.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -3016,7 +3022,8 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("employment/id/{id}")
|
@Get("employment/id/{id}")
|
||||||
async GetEmploymentById(@Path() id: string, @Request() req: RequestWithUser) {
|
async GetEmploymentById(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const employment = await this.employmentRepository.findOne({
|
const employment = await this.employmentRepository.findOne({
|
||||||
where: { id: id },
|
where: { id: id },
|
||||||
});
|
});
|
||||||
|
|
@ -3032,7 +3039,8 @@ export class ProfileEmployeeTempController extends Controller {
|
||||||
*/
|
*/
|
||||||
@Get("employment/history/{id}")
|
@Get("employment/history/{id}")
|
||||||
async GetHistoryEmploymentById(@Path() id: string, @Request() req: RequestWithUser) {
|
async GetHistoryEmploymentById(@Path() id: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, id, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const employmentHistory = await this.employmentHistoryRepository.find({
|
const employmentHistory = await this.employmentHistoryRepository.find({
|
||||||
where: { profileEmployeeEmploymentId: id },
|
where: { profileEmployeeEmploymentId: id },
|
||||||
order: { lastUpdatedAt: "ASC" },
|
order: { lastUpdatedAt: "ASC" },
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,9 @@ export class ProfileFamilyCoupleController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getFamilyCouple(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getFamilyCouple(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileId },
|
where: { id: profileId },
|
||||||
});
|
});
|
||||||
|
|
@ -113,7 +115,9 @@ export class ProfileFamilyCoupleController extends Controller {
|
||||||
|
|
||||||
@Get("history/{profileId}")
|
@Get("history/{profileId}")
|
||||||
public async familyCoupleHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async familyCoupleHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileId },
|
where: { id: profileId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,9 @@ export class ProfileFamilyCoupleEmployeeController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||||
}
|
}
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profile.id);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profile.id);
|
||||||
|
|
||||||
const familyCouple = await this.ProfileFamilyCouple.findOne({
|
const familyCouple = await this.ProfileFamilyCouple.findOne({
|
||||||
where: { profileEmployeeId },
|
where: { profileEmployeeId },
|
||||||
|
|
@ -110,7 +112,9 @@ export class ProfileFamilyCoupleEmployeeController extends Controller {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||||
}
|
}
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profile.id);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profile.id);
|
||||||
|
|
||||||
const familyCouple = await this.ProfileFamilyCouple.find({
|
const familyCouple = await this.ProfileFamilyCouple.find({
|
||||||
relations: ["histories"],
|
relations: ["histories"],
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ export class ProfileFamilyCoupleEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getFamilyCouple(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getFamilyCouple(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
@ -105,7 +106,8 @@ export class ProfileFamilyCoupleEmployeeTempController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,9 @@ export class ProfileFamilyFatherController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getFamilyFather(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getFamilyFather(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileId },
|
where: { id: profileId },
|
||||||
});
|
});
|
||||||
|
|
@ -97,7 +99,9 @@ export class ProfileFamilyFatherController extends Controller {
|
||||||
|
|
||||||
@Get("history/{profileId}")
|
@Get("history/{profileId}")
|
||||||
public async familyFatherHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async familyFatherHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileId },
|
where: { id: profileId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,9 @@ export class ProfileFamilyFatherEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getFamilyFather(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getFamilyFather(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
@ -99,7 +101,9 @@ export class ProfileFamilyFatherEmployeeController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ export class ProfileFamilyFatherEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getFamilyFather(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getFamilyFather(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
@ -100,7 +101,8 @@ export class ProfileFamilyFatherEmployeeTempController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,9 @@ export class ProfileFamilyMotherController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getFamilyMother(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getFamilyMother(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileId },
|
where: { id: profileId },
|
||||||
});
|
});
|
||||||
|
|
@ -97,7 +99,9 @@ export class ProfileFamilyMotherController extends Controller {
|
||||||
|
|
||||||
@Get("history/{profileId}")
|
@Get("history/{profileId}")
|
||||||
public async familyMotherHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async familyMotherHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileId },
|
where: { id: profileId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,9 @@ export class ProfileFamilyMotherEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getFamilyMother(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getFamilyMother(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
@ -100,7 +102,9 @@ export class ProfileFamilyMotherEmployeeController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ export class ProfileFamilyMotherEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getFamilyMother(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getFamilyMother(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
@ -100,7 +101,8 @@ export class ProfileFamilyMotherEmployeeTempController extends Controller {
|
||||||
@Path() profileEmployeeId: string,
|
@Path() profileEmployeeId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const profile = await this.profileRepo.findOne({
|
const profile = await this.profileRepo.findOne({
|
||||||
where: { id: profileEmployeeId },
|
where: { id: profileEmployeeId },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,9 @@ export class ProfileGovernmentHistoryController extends Controller {
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
@Example({})
|
@Example({})
|
||||||
public async getGovHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getGovHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const orgRevision = await this.orgRevisionRepository.findOne({
|
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||||
select: ["id"],
|
select: ["id"],
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -357,7 +359,9 @@ export class ProfileGovernmentHistoryController extends Controller {
|
||||||
@Get("history/{profileId}")
|
@Get("history/{profileId}")
|
||||||
@Example({})
|
@Example({})
|
||||||
public async govHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async govHistory(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const record = await this.govRepo.find({
|
const record = await this.govRepo.find({
|
||||||
order: { lastUpdatedAt: "DESC" },
|
order: { lastUpdatedAt: "DESC" },
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,9 @@ export class ProfileGovernmentEmployeeController extends Controller {
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
@Example({})
|
@Example({})
|
||||||
public async getGovHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getGovHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const orgRevision = await this.orgRevisionRepository.findOne({
|
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||||
select: ["id"],
|
select: ["id"],
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -326,7 +328,9 @@ export class ProfileGovernmentEmployeeController extends Controller {
|
||||||
@Get("history/{profileEmployeeId}")
|
@Get("history/{profileEmployeeId}")
|
||||||
@Example({})
|
@Example({})
|
||||||
public async govHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async govHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const record = await this.govRepo.find({
|
const record = await this.govRepo.find({
|
||||||
order: { lastUpdatedAt: "DESC" },
|
order: { lastUpdatedAt: "DESC" },
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,8 @@ export class ProfileGovernmentEmployeeTempController extends Controller {
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
@Example({})
|
@Example({})
|
||||||
public async getGovHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getGovHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const orgRevision = await this.orgRevisionRepository.findOne({
|
const orgRevision = await this.orgRevisionRepository.findOne({
|
||||||
select: ["id"],
|
select: ["id"],
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -327,7 +328,8 @@ export class ProfileGovernmentEmployeeTempController extends Controller {
|
||||||
@Get("history/{profileEmployeeId}")
|
@Get("history/{profileEmployeeId}")
|
||||||
@Example({})
|
@Example({})
|
||||||
public async govHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async govHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.govRepo.find({
|
const record = await this.govRepo.find({
|
||||||
order: { lastUpdatedAt: "DESC" },
|
order: { lastUpdatedAt: "DESC" },
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,9 @@ export class ProfileHonorController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getHonor(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getHonor(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const record = await this.honorRepo.find({
|
const record = await this.honorRepo.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -78,7 +80,9 @@ export class ProfileHonorController extends Controller {
|
||||||
public async honorAdminHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
public async honorAdminHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.honorRepo.findOneBy({ id: honorId });
|
const _record = await this.honorRepo.findOneBy({ id: honorId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, honorId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.honorHistoryRepo.find({
|
const record = await this.honorHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ export class ProfileHonorEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getHonor(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getHonor(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const record = await this.honorRepo.find({
|
const record = await this.honorRepo.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -82,11 +84,13 @@ export class ProfileHonorEmployeeController extends Controller {
|
||||||
public async honorAdminHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
public async honorAdminHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.honorRepo.findOneBy({ id: honorId });
|
const _record = await this.honorRepo.findOneBy({ id: honorId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, honorId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const record = await this.honorHistoryRepo.find({
|
const record = await this.honorHistoryRepo.find({
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ export class ProfileHonorEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getHonor(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getHonor(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.honorRepo.find({
|
const record = await this.honorRepo.find({
|
||||||
where: { profileEmployeeId: profileEmployeeId },
|
where: { profileEmployeeId: profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -80,7 +81,8 @@ export class ProfileHonorEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("admin/history/{honorId}")
|
@Get("admin/history/{honorId}")
|
||||||
public async honorAdminHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
public async honorAdminHistory(@Path() honorId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, honorId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.honorHistoryRepo.find({
|
const record = await this.honorHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileHonorId: honorId,
|
profileHonorId: honorId,
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,9 @@ export class ProfileInsigniaController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getInsignia(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getInsignia(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const record = await this.insigniaRepo.find({
|
const record = await this.insigniaRepo.find({
|
||||||
relations: {
|
relations: {
|
||||||
insignia: {
|
insignia: {
|
||||||
|
|
@ -75,7 +77,9 @@ export class ProfileInsigniaController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.insigniaRepo.findOneBy({ id: InsigniaId });
|
const _record = await this.insigniaRepo.findOneBy({ id: InsigniaId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, InsigniaId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.insigniaHistoryRepo.find({
|
const record = await this.insigniaHistoryRepo.find({
|
||||||
relations: {
|
relations: {
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,9 @@ export class ProfileInsigniaEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getInsignia(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getInsignia(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const record = await this.insigniaRepo.find({
|
const record = await this.insigniaRepo.find({
|
||||||
relations: {
|
relations: {
|
||||||
insignia: {
|
insignia: {
|
||||||
|
|
@ -75,11 +77,13 @@ export class ProfileInsigniaEmployeeController extends Controller {
|
||||||
) {
|
) {
|
||||||
const _record = await this.insigniaRepo.findOneBy({ id: InsigniaId });
|
const _record = await this.insigniaRepo.findOneBy({ id: InsigniaId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, InsigniaId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.insigniaHistoryRepo.find({
|
const record = await this.insigniaHistoryRepo.find({
|
||||||
relations: {
|
relations: {
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,8 @@ export class ProfileInsigniaEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getInsignia(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getInsignia(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.insigniaRepo.find({
|
const record = await this.insigniaRepo.find({
|
||||||
relations: {
|
relations: {
|
||||||
insignia: {
|
insignia: {
|
||||||
|
|
@ -73,7 +74,8 @@ export class ProfileInsigniaEmployeeTempController extends Controller {
|
||||||
@Path() InsigniaId: string,
|
@Path() InsigniaId: string,
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
) {
|
) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, InsigniaId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.insigniaHistoryRepo.find({
|
const record = await this.insigniaHistoryRepo.find({
|
||||||
relations: {
|
relations: {
|
||||||
insignia: {
|
insignia: {
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,9 @@ export class ProfileLeaveController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getLeave(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getLeave(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const record = await this.leaveRepo.find({
|
const record = await this.leaveRepo.find({
|
||||||
relations: { leaveType: true },
|
relations: { leaveType: true },
|
||||||
where: { profileId },
|
where: { profileId },
|
||||||
|
|
@ -138,7 +140,8 @@ export class ProfileLeaveController extends Controller {
|
||||||
|
|
||||||
@Get("admin/{profileId}")
|
@Get("admin/{profileId}")
|
||||||
public async getLeaveAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getLeaveAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_SALARY_OFFICER");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_SALARY_OFFICER");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_SALARY_OFFICER");
|
||||||
const record = await this.leaveRepo.find({
|
const record = await this.leaveRepo.find({
|
||||||
relations: { leaveType: true },
|
relations: { leaveType: true },
|
||||||
where: { profileId },
|
where: { profileId },
|
||||||
|
|
@ -151,7 +154,9 @@ export class ProfileLeaveController extends Controller {
|
||||||
public async leaveAdminHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
public async leaveAdminHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.leaveRepo.findOneBy({ id: leaveId });
|
const _record = await this.leaveRepo.findOneBy({ id: leaveId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, leaveId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.leaveHistoryRepo.find({
|
const record = await this.leaveHistoryRepo.find({
|
||||||
relations: { leaveType: true },
|
relations: { leaveType: true },
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ export class ProfileLeaveEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getLeave(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getLeave(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
||||||
const record = await this.leaveRepo.find({
|
const record = await this.leaveRepo.find({
|
||||||
relations: { leaveType: true },
|
relations: { leaveType: true },
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
|
|
@ -62,7 +64,8 @@ export class ProfileLeaveEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("admin/{profileId}")
|
@Get("admin/{profileId}")
|
||||||
public async getLeaveAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getLeaveAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_WAGE");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_WAGE");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_WAGE");
|
||||||
const record = await this.leaveRepo.find({
|
const record = await this.leaveRepo.find({
|
||||||
relations: { leaveType: true },
|
relations: { leaveType: true },
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
|
|
@ -75,11 +78,13 @@ export class ProfileLeaveEmployeeController extends Controller {
|
||||||
public async leaveAdminHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
public async leaveAdminHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.leaveRepo.findOneBy({ id: leaveId });
|
const _record = await this.leaveRepo.findOneBy({ id: leaveId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, leaveId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.leaveHistoryRepo.find({
|
const record = await this.leaveHistoryRepo.find({
|
||||||
relations: { leaveType: true },
|
relations: { leaveType: true },
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,8 @@ export class ProfileLeaveEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getLeave(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getLeave(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.leaveRepo.find({
|
const record = await this.leaveRepo.find({
|
||||||
relations: { leaveType: true },
|
relations: { leaveType: true },
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
|
|
@ -62,7 +63,8 @@ export class ProfileLeaveEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("admin/{profileId}")
|
@Get("admin/{profileId}")
|
||||||
public async getLeaveAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getLeaveAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_WAGE");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_WAGE");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_WAGE");
|
||||||
const record = await this.leaveRepo.find({
|
const record = await this.leaveRepo.find({
|
||||||
relations: { leaveType: true },
|
relations: { leaveType: true },
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
|
|
@ -73,7 +75,8 @@ export class ProfileLeaveEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("admin/history/{leaveId}")
|
@Get("admin/history/{leaveId}")
|
||||||
public async leaveAdminHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
public async leaveAdminHistory(@Path() leaveId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, leaveId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.leaveHistoryRepo.find({
|
const record = await this.leaveHistoryRepo.find({
|
||||||
relations: { leaveType: true },
|
relations: { leaveType: true },
|
||||||
where: { profileLeaveId: leaveId },
|
where: { profileLeaveId: leaveId },
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,9 @@ export class ProfileNopaidController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getNopaid(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getNopaid(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const lists = await this.nopaidRepository.find({
|
const lists = await this.nopaidRepository.find({
|
||||||
where: { profileId },
|
where: { profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -56,7 +58,9 @@ export class ProfileNopaidController extends Controller {
|
||||||
public async nopaidHistory(@Path() nopaidId: string, @Request() req: RequestWithUser) {
|
public async nopaidHistory(@Path() nopaidId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.nopaidRepository.findOneBy({ id: nopaidId });
|
const _record = await this.nopaidRepository.findOneBy({ id: nopaidId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, nopaidId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.nopaidHistoryRepository.find({
|
const record = await this.nopaidHistoryRepository.find({
|
||||||
where: { profileNopaidId: nopaidId },
|
where: { profileNopaidId: nopaidId },
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ export class ProfileNopaidEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getNopaid(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getNopaid(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_EMP");
|
||||||
const lists = await this.nopaidRepository.find({
|
const lists = await this.nopaidRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -58,7 +59,8 @@ export class ProfileNopaidEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("history/{nopaidId}")
|
@Get("history/{nopaidId}")
|
||||||
public async nopaidHistory(@Path() nopaidId: string, @Request() req: RequestWithUser) {
|
public async nopaidHistory(@Path() nopaidId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, nopaidId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_EMP");
|
||||||
const record = await this.nopaidHistoryRepository.find({
|
const record = await this.nopaidHistoryRepository.find({
|
||||||
where: { profileNopaidId: nopaidId },
|
where: { profileNopaidId: nopaidId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ export class ProfileNopaidEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getNopaid(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getNopaid(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const lists = await this.nopaidRepository.find({
|
const lists = await this.nopaidRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -58,7 +59,8 @@ export class ProfileNopaidEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("history/{nopaidId}")
|
@Get("history/{nopaidId}")
|
||||||
public async nopaidHistory(@Path() nopaidId: string, @Request() req: RequestWithUser) {
|
public async nopaidHistory(@Path() nopaidId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, nopaidId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.nopaidHistoryRepository.find({
|
const record = await this.nopaidHistoryRepository.find({
|
||||||
where: { profileNopaidId: nopaidId },
|
where: { profileNopaidId: nopaidId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,9 @@ export class ProfileOtherController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getOther(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getOther(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const lists = await this.otherRepository.find({
|
const lists = await this.otherRepository.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -57,7 +59,9 @@ export class ProfileOtherController extends Controller {
|
||||||
public async otherAdminHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
public async otherAdminHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.otherRepository.findOneBy({ id: otherId });
|
const _record = await this.otherRepository.findOneBy({ id: otherId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, otherId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.otherHistoryRepository.find({
|
const record = await this.otherHistoryRepository.find({
|
||||||
where: { profileOtherId: otherId },
|
where: { profileOtherId: otherId },
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ export class ProfileOtherEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getOther(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getOther(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
||||||
const lists = await this.otherRepository.find({
|
const lists = await this.otherRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -60,11 +62,13 @@ export class ProfileOtherEmployeeController extends Controller {
|
||||||
public async otherAdminHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
public async otherAdminHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.otherRepository.findOneBy({ id: otherId });
|
const _record = await this.otherRepository.findOneBy({ id: otherId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, otherId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.otherHistoryRepository.find({
|
const record = await this.otherHistoryRepository.find({
|
||||||
where: { profileOtherId: otherId },
|
where: { profileOtherId: otherId },
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ export class ProfileOtherEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getOther(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getOther(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const lists = await this.otherRepository.find({
|
const lists = await this.otherRepository.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -58,7 +59,8 @@ export class ProfileOtherEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("admin/history/{otherId}")
|
@Get("admin/history/{otherId}")
|
||||||
public async otherAdminHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
public async otherAdminHistory(@Path() otherId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, otherId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.otherHistoryRepository.find({
|
const record = await this.otherHistoryRepository.find({
|
||||||
where: { profileOtherId: otherId },
|
where: { profileOtherId: otherId },
|
||||||
order: { createdAt: "DESC" },
|
order: { createdAt: "DESC" },
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,9 @@ export class ProfileSalaryController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getSalary(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getSalary(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const record = await this.salaryRepo.find({
|
const record = await this.salaryRepo.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { order: "ASC" },
|
order: { order: "ASC" },
|
||||||
|
|
@ -55,7 +57,8 @@ export class ProfileSalaryController extends Controller {
|
||||||
|
|
||||||
@Get("admin/{profileId}")
|
@Get("admin/{profileId}")
|
||||||
public async getSalaryAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getSalaryAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_SALARY_OFFICER");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_SALARY_OFFICER");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_SALARY_OFFICER");
|
||||||
const record = await this.salaryRepo.find({
|
const record = await this.salaryRepo.find({
|
||||||
where: { profileId: profileId },
|
where: { profileId: profileId },
|
||||||
order: { order: "ASC" },
|
order: { order: "ASC" },
|
||||||
|
|
@ -67,7 +70,9 @@ export class ProfileSalaryController extends Controller {
|
||||||
public async salaryAdminHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
public async salaryAdminHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.salaryRepo.findOneBy({ id: salaryId });
|
const _record = await this.salaryRepo.findOneBy({ id: salaryId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, salaryId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.salaryHistoryRepo.find({
|
const record = await this.salaryHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -208,7 +213,7 @@ export class ProfileSalaryController extends Controller {
|
||||||
) {
|
) {
|
||||||
const source_item = await this.salaryRepo.findOne({ where: { id: salaryId } });
|
const source_item = await this.salaryRepo.findOne({ where: { id: salaryId } });
|
||||||
// if (source_item) {
|
// if (source_item) {
|
||||||
// await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", source_item.profileId);//ไม่แน่ใจOFFปิดไว้ก่อน
|
//await new permission().PermissionOrgUserGet(req,"SYS_REGISTRY_OFFICER",source_item.profileId,); //ไม่แน่ใจOFFปิดไว้ก่อน
|
||||||
// }
|
// }
|
||||||
if (source_item == null) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
if (source_item == null) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
const sourceOrder = source_item.order;
|
const sourceOrder = source_item.order;
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,9 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getSalaryEmployee(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getSalaryEmployee(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileId);
|
||||||
const record = await this.salaryRepo.find({
|
const record = await this.salaryRepo.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { order: "ASC" },
|
order: { order: "ASC" },
|
||||||
|
|
@ -59,7 +61,8 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("admin/{profileId}")
|
@Get("admin/{profileId}")
|
||||||
public async getSalaryEmployeeAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getSalaryEmployeeAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_WAGE");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_WAGE");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_WAGE");
|
||||||
const record = await this.salaryRepo.find({
|
const record = await this.salaryRepo.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { order: "ASC" },
|
order: { order: "ASC" },
|
||||||
|
|
@ -71,11 +74,13 @@ export class ProfileSalaryEmployeeController extends Controller {
|
||||||
public async salaryAdminHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
public async salaryAdminHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.salaryRepo.findOneBy({ id: salaryId });
|
const _record = await this.salaryRepo.findOneBy({ id: salaryId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, salaryId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
const record = await this.salaryHistoryRepo.find({
|
const record = await this.salaryHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,8 @@ export class ProfileSalaryEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getSalaryEmployee(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getSalaryEmployee(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.salaryRepo.find({
|
const record = await this.salaryRepo.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { order: "ASC" },
|
order: { order: "ASC" },
|
||||||
|
|
@ -59,7 +60,8 @@ export class ProfileSalaryEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("admin/{profileId}")
|
@Get("admin/{profileId}")
|
||||||
public async getSalaryEmployeeAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getSalaryEmployeeAdmin(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_WAGE");
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_WAGE");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_WAGE");
|
||||||
const record = await this.salaryRepo.find({
|
const record = await this.salaryRepo.find({
|
||||||
where: { profileEmployeeId: profileId },
|
where: { profileEmployeeId: profileId },
|
||||||
order: { order: "ASC" },
|
order: { order: "ASC" },
|
||||||
|
|
@ -69,7 +71,8 @@ export class ProfileSalaryEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("admin/history/{salaryId}")
|
@Get("admin/history/{salaryId}")
|
||||||
public async salaryAdminHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
public async salaryAdminHistory(@Path() salaryId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, salaryId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.salaryHistoryRepo.find({
|
const record = await this.salaryHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileSalaryId: salaryId,
|
profileSalaryId: salaryId,
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ export class ProfileTrainingController extends Controller {
|
||||||
|
|
||||||
@Get("{profileId}")
|
@Get("{profileId}")
|
||||||
public async getTraining(@Path() profileId: string, @Request() req: RequestWithUser) {
|
public async getTraining(@Path() profileId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
let _workflow = await new permission().Workflow(req, profileId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", profileId);
|
||||||
const record = await this.trainingRepo.find({
|
const record = await this.trainingRepo.find({
|
||||||
where: { profileId },
|
where: { profileId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -60,7 +62,9 @@ export class ProfileTrainingController extends Controller {
|
||||||
public async trainingAdminHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
public async trainingAdminHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.trainingRepo.findOneBy({ id: trainingId });
|
const _record = await this.trainingRepo.findOneBy({ id: trainingId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
let _workflow = await new permission().Workflow(req, trainingId, "SYS_REGISTRY_OFFICER");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_OFFICER", _record.profileId);
|
||||||
}
|
}
|
||||||
const record = await this.trainingHistoryRepo.find({
|
const record = await this.trainingHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,9 @@ export class ProfileTrainingEmployeeController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getTraining(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getTraining(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_EMP");
|
||||||
|
if (_workflow == false)
|
||||||
|
await new permission().PermissionOrgUserGet(req, "SYS_REGISTRY_EMP", profileEmployeeId);
|
||||||
const record = await this.trainingRepo.find({
|
const record = await this.trainingRepo.find({
|
||||||
where: { profileEmployeeId },
|
where: { profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -60,11 +62,13 @@ export class ProfileTrainingEmployeeController extends Controller {
|
||||||
public async trainingAdminHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
public async trainingAdminHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||||
const _record = await this.trainingRepo.findOneBy({ id: trainingId });
|
const _record = await this.trainingRepo.findOneBy({ id: trainingId });
|
||||||
if (_record) {
|
if (_record) {
|
||||||
await new permission().PermissionOrgUserGet(
|
let _workflow = await new permission().Workflow(req, trainingId, "SYS_REGISTRY_EMP");
|
||||||
req,
|
if (_workflow == false)
|
||||||
"SYS_REGISTRY_EMP",
|
await new permission().PermissionOrgUserGet(
|
||||||
_record.profileEmployeeId,
|
req,
|
||||||
);
|
"SYS_REGISTRY_EMP",
|
||||||
|
_record.profileEmployeeId,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const record = await this.trainingHistoryRepo.find({
|
const record = await this.trainingHistoryRepo.find({
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ export class ProfileTrainingEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("{profileEmployeeId}")
|
@Get("{profileEmployeeId}")
|
||||||
public async getTraining(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
public async getTraining(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, profileEmployeeId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.trainingRepo.find({
|
const record = await this.trainingRepo.find({
|
||||||
where: { profileEmployeeId },
|
where: { profileEmployeeId },
|
||||||
order: { createdAt: "ASC" },
|
order: { createdAt: "ASC" },
|
||||||
|
|
@ -58,7 +59,8 @@ export class ProfileTrainingEmployeeTempController extends Controller {
|
||||||
|
|
||||||
@Get("admin/history/{trainingId}")
|
@Get("admin/history/{trainingId}")
|
||||||
public async trainingAdminHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
public async trainingAdminHistory(@Path() trainingId: string, @Request() req: RequestWithUser) {
|
||||||
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
let _workflow = await new permission().Workflow(req, trainingId, "SYS_REGISTRY_TEMP");
|
||||||
|
if (_workflow == false) await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
|
||||||
const record = await this.trainingHistoryRepo.find({
|
const record = await this.trainingHistoryRepo.find({
|
||||||
where: {
|
where: {
|
||||||
profileTrainingId: trainingId,
|
profileTrainingId: trainingId,
|
||||||
|
|
|
||||||
|
|
@ -700,4 +700,37 @@ export class WorkflowController extends Controller {
|
||||||
let isOfficer = profileOfficer.orgChild1 == null ? false : profileOfficer.orgChild1.isOfficer;
|
let isOfficer = profileOfficer.orgChild1 == null ? false : profileOfficer.orgChild1.isOfficer;
|
||||||
return new HttpSuccess({ isOfficer: isOfficer, isStaff: !isOfficer });
|
return new HttpSuccess({ isOfficer: isOfficer, isStaff: !isOfficer });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API เช็ค สกจ
|
||||||
|
*
|
||||||
|
* @summary เช็ค สกจ
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Post("keycloak/isofficer")
|
||||||
|
async checkPermissionWorkflow(
|
||||||
|
@Request() req: RequestWithUser,
|
||||||
|
@Body()
|
||||||
|
body: {
|
||||||
|
refId: string;
|
||||||
|
sysName: string;
|
||||||
|
},
|
||||||
|
) {
|
||||||
|
const profile = await this.profileRepo.findOne({
|
||||||
|
where: {
|
||||||
|
keycloak: req.user.sub,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลผู้ใช้งาน");
|
||||||
|
|
||||||
|
const profileOfficer = await this.workflowRepo.findOne({
|
||||||
|
where: {
|
||||||
|
states: { stateUserComments: { profile: { keycloak: req.user.sub } } },
|
||||||
|
refId: body.refId,
|
||||||
|
sysName: body.sysName,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (!profileOfficer) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์");
|
||||||
|
return new HttpSuccess();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,12 @@ export class OrgRoot extends EntityBase {
|
||||||
})
|
})
|
||||||
responsibility: string;
|
responsibility: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "เป็นปลัด",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isDeputy: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
length: 40,
|
length: 40,
|
||||||
comment: "คีย์นอก(FK)ของตาราง orgRevision",
|
comment: "คีย์นอก(FK)ของตาราง orgRevision",
|
||||||
|
|
@ -164,6 +170,9 @@ export class CreateOrgRoot {
|
||||||
|
|
||||||
@Column("uuid")
|
@Column("uuid")
|
||||||
orgRevisionId: string;
|
orgRevisionId: string;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
isDeputy: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type UpdateOrgRoot = Partial<CreateOrgRoot> & { orgRootRank?: OrgRootRank };
|
export type UpdateOrgRoot = Partial<CreateOrgRoot> & { orgRootRank?: OrgRootRank };
|
||||||
|
|
|
||||||
|
|
@ -54,16 +54,6 @@ class CheckAuth {
|
||||||
.GetData(req, `/org/permission/org/${system}/${action}`)
|
.GetData(req, `/org/permission/org/${system}/${action}`)
|
||||||
.then(async (x) => {
|
.then(async (x) => {
|
||||||
let privilege = x.privilege;
|
let privilege = x.privilege;
|
||||||
// if (action.trim().toLocaleUpperCase() == "CREATE")
|
|
||||||
// privilege = await this.PermissionCreate(req, system);
|
|
||||||
// if (action.trim().toLocaleUpperCase() == "DELETE")
|
|
||||||
// privilege = await this.PermissionDelete(req, system);
|
|
||||||
// if (action.trim().toLocaleUpperCase() == "GET")
|
|
||||||
// privilege = await this.PermissionGet(req, system);
|
|
||||||
// if (action.trim().toLocaleUpperCase() == "LIST")
|
|
||||||
// privilege = await this.PermissionList(req, system);
|
|
||||||
// if (action.trim().toLocaleUpperCase() == "UPDATE")
|
|
||||||
// privilege = await this.PermissionUpdate(req, system);
|
|
||||||
|
|
||||||
let data: any = {
|
let data: any = {
|
||||||
root: [null],
|
root: [null],
|
||||||
|
|
@ -149,16 +139,6 @@ class CheckAuth {
|
||||||
.GetData(req, `/org/permission/user/${system}/${action}/${profileId}`)
|
.GetData(req, `/org/permission/user/${system}/${action}/${profileId}`)
|
||||||
.then(async (x) => {
|
.then(async (x) => {
|
||||||
let org = x.org;
|
let org = x.org;
|
||||||
// if (action.trim().toLocaleUpperCase() == "CREATE")
|
|
||||||
// org = await this.PermissionOrgCreate(req, system);
|
|
||||||
// if (action.trim().toLocaleUpperCase() == "DELETE")
|
|
||||||
// org = await this.PermissionOrgDelete(req, system);
|
|
||||||
// if (action.trim().toLocaleUpperCase() == "GET")
|
|
||||||
// org = await this.PermissionOrgGet(req, system);
|
|
||||||
// if (action.trim().toLocaleUpperCase() == "LIST")
|
|
||||||
// org = await this.PermissionOrgList(req, system);
|
|
||||||
// if (action.trim().toLocaleUpperCase() == "UPDATE")
|
|
||||||
// org = await this.PermissionOrgUpdate(req, system);
|
|
||||||
|
|
||||||
if (org.root != null) if (x.orgRootId != org.root[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
if (org.root != null) if (x.orgRootId != org.root[0]) throw "ไม่มีสิทธิ์เข้าถึงข้อมูล";
|
||||||
if (org.child1 != null)
|
if (org.child1 != null)
|
||||||
|
|
@ -180,6 +160,26 @@ class CheckAuth {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
public async Workflow(req: RequestWithUser, id: string, sysName: string) {
|
||||||
|
if (
|
||||||
|
req.headers.hasOwnProperty("api_key") &&
|
||||||
|
req.headers["api_key"] &&
|
||||||
|
req.headers["api_key"] == process.env.API_KEY
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return await new CallAPI()
|
||||||
|
.PostData(req, "/org/workflow/keycloak/isofficer", {
|
||||||
|
refId: id,
|
||||||
|
sysName: sysName,
|
||||||
|
})
|
||||||
|
.then((x) => {
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch((x) => {
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
public async PermissionCreate(req: RequestWithUser, system: string) {
|
public async PermissionCreate(req: RequestWithUser, system: string) {
|
||||||
return await this.Permission(req, system, "CREATE");
|
return await this.Permission(req, system, "CREATE");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
src/migration/1729505298515-update_root_add_isdeputy.ts
Normal file
14
src/migration/1729505298515-update_root_add_isdeputy.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateRootAddIsdeputy1729505298515 implements MigrationInterface {
|
||||||
|
name = 'UpdateRootAddIsdeputy1729505298515'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`orgRoot\` ADD \`isDeputy\` tinyint NOT NULL COMMENT 'เป็นปลัด' DEFAULT 0`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`orgRoot\` DROP COLUMN \`isDeputy\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue