Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop
This commit is contained in:
commit
cc04d34ca2
1 changed files with 54 additions and 0 deletions
|
|
@ -4678,4 +4678,58 @@ export class OrganizationDotnetController extends Controller {
|
||||||
};
|
};
|
||||||
return new HttpSuccess(mapProfile);
|
return new HttpSuccess(mapProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API Get Profile ใช้อัพเดทสถานะ Mark ในระบบเครื่องราช
|
||||||
|
*
|
||||||
|
* @summary API Get Profile ใช้อัพเดทสถานะ Mark ในระบบเครื่องราช
|
||||||
|
*
|
||||||
|
* @param {string} type ประเภท (ข้าราชการ หรือ ลูกจ้าง)
|
||||||
|
*/
|
||||||
|
@Post("find/insignia-requests-profile/{type}")
|
||||||
|
async GetInsigniaRequestsProfileAsync(
|
||||||
|
@Request() req: RequestWithUser,
|
||||||
|
@Path() type: string,
|
||||||
|
@Body()
|
||||||
|
body: {
|
||||||
|
profileIds: string[];
|
||||||
|
},
|
||||||
|
) {
|
||||||
|
let profile;
|
||||||
|
if (type.trim().toLocaleUpperCase() == "OFFICER") {
|
||||||
|
profile = await this.profileRepo.find({
|
||||||
|
relations: [
|
||||||
|
"profileSalary",
|
||||||
|
"profileInsignias",
|
||||||
|
"profileDisciplines",
|
||||||
|
"profileAssessments"
|
||||||
|
],
|
||||||
|
where: { id: In(body.profileIds) }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
profile = await this.profileEmpRepo.find({
|
||||||
|
relations: [
|
||||||
|
"profileSalary",
|
||||||
|
"profileInsignias",
|
||||||
|
"profileDisciplines",
|
||||||
|
"profileAssessments"
|
||||||
|
],
|
||||||
|
where: { id: In(body.profileIds) }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
||||||
|
const mapProfile = profile.map((x) => {
|
||||||
|
return {
|
||||||
|
id: x.id,
|
||||||
|
markDiscipline: x.profileDisciplines.length > 0 ? true : false,
|
||||||
|
markLeave: false,
|
||||||
|
markRate: x.profileAssessments.length > 0 ? true : false,
|
||||||
|
markInsignia: x.profileInsignias.length > 0 ? true : false,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return new HttpSuccess(mapProfile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue