This commit is contained in:
AdisakKanthawilang 2024-08-27 14:19:04 +07:00
parent eb1e797354
commit 79b652d628
9 changed files with 32 additions and 32 deletions

View file

@ -1056,7 +1056,7 @@ export class ProfileEmployeeTempController extends Controller {
*/
@Get("{id}")
async detailProfile(@Path() id: string, @Request() req: RequestWithUser) {
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP"); //ไม่แน่ใจTEMP
await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");
const profile = await this.profileRepo.findOne({
relations: {
posLevel: true,
@ -2075,7 +2075,7 @@ export class ProfileEmployeeTempController extends Controller {
@Path() id: string,
@Body() body: UpdatePositionTempProfileEmployee,
) {
// await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
if (body.posLevelId === "") body.posLevelId = null;
if (body.posTypeId === "") body.posTypeId = null;
@ -2555,7 +2555,7 @@ export class ProfileEmployeeTempController extends Controller {
*/
@Get("keycloak/position/{revisionId}")
async getProfileByKeycloakByRevision(
//ไม่แน่ใจTEMP
//ไม่แน่ใจTEMPปิดไว้ก่อน
@Path() revisionId: string,
@Request() request: { user: Record<string, any> },
) {
@ -2657,7 +2657,7 @@ export class ProfileEmployeeTempController extends Controller {
*/
@Get("profileid/retire/{year}")
async getProfileByRetireYear(@Path() year: number, @Request() req: RequestWithUser) {
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profiles = await this.profileRepo
.createQueryBuilder("profileEmployee")
.leftJoinAndSelect("profileEmployee.posLevel", "posLevel")
@ -2856,7 +2856,7 @@ export class ProfileEmployeeTempController extends Controller {
requestBody: { isLeave: boolean; leaveReason: string; dateLeave: Date },
@Request() request: { user: Record<string, any> },
) {
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profile = await this.profileRepo.findOne({
where: { id: id },
});
@ -2891,7 +2891,7 @@ export class ProfileEmployeeTempController extends Controller {
@Path() profileEmployeeId: string,
@Body() body: UpdateInformationProfileEmployee,
) {
// await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionUpdate(request, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profileEmp = await this.profileRepo.findOneBy({ id: profileEmployeeId });
if (!profileEmp) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้");
@ -2920,7 +2920,7 @@ export class ProfileEmployeeTempController extends Controller {
*/
@Get("information/{profileEmployeeId}")
async getInformationById(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profileInformation = await this.profileRepo.findOne({
where: { id: profileEmployeeId },
});
@ -2951,7 +2951,7 @@ export class ProfileEmployeeTempController extends Controller {
*/
@Get("information/history/{profileEmployeeId}")
async getInformationHistory(@Path() profileEmployeeId: string, @Request() req: RequestWithUser) {
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profileInformation = await this.profileRepo.find({
relations: {
information_histories: true,
@ -2996,7 +2996,7 @@ export class ProfileEmployeeTempController extends Controller {
@Path() profileEmployeeId: string,
@Request() req: RequestWithUser,
) {
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionList(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const employment = await this.employmentRepository.find({
where: { profileEmployeeId: profileEmployeeId },
order: { createdAt: "ASC" },
@ -3018,7 +3018,7 @@ export class ProfileEmployeeTempController extends Controller {
*/
@Get("employment/id/{id}")
async GetEmploymentById(@Path() id: string, @Request() req: RequestWithUser) {
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const employment = await this.employmentRepository.findOne({
where: { id: id },
});
@ -3034,7 +3034,7 @@ export class ProfileEmployeeTempController extends Controller {
*/
@Get("employment/history/{id}")
async GetHistoryEmploymentById(@Path() id: string, @Request() req: RequestWithUser) {
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const employmentHistory = await this.employmentHistoryRepository.find({
where: { profileEmployeeEmploymentId: id },
order: { lastUpdatedAt: "ASC" },
@ -3055,7 +3055,7 @@ export class ProfileEmployeeTempController extends Controller {
@Body() body: CreateEmploymentProfileEmployee,
@Request() request: RequestWithUser,
) {
// await new permission().PermissionCreate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionCreate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profile = await this.profileRepo.findOne({
where: { id: profileEmployeeId },
});
@ -3091,7 +3091,7 @@ export class ProfileEmployeeTempController extends Controller {
*/
@Delete("employment/{id}")
async DeleteEmployment(@Path() id: string) {
// await new permission().PermissionDelete(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionDelete(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
await this.employmentHistoryRepository.delete({
profileEmployeeEmploymentId: id,
});
@ -3116,7 +3116,7 @@ export class ProfileEmployeeTempController extends Controller {
@Path() id: string,
@Body() body: UpdateEmploymentProfileEmployee,
) {
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const employment = await this.employmentRepository.findOneBy({ id });
if (!employment) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
@ -3146,7 +3146,7 @@ export class ProfileEmployeeTempController extends Controller {
*/
@Post("report")
async sendReport(@Request() request: RequestWithUser, @Body() requestBody: { id: string[] }) {
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profiles = await this.profileRepo.find({ where: { id: In(requestBody.id) } });
const _profiles = await Promise.all(
@ -3185,7 +3185,7 @@ export class ProfileEmployeeTempController extends Controller {
},
@Request() request: { user: Record<string, any> },
) {
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionUpdate(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
await Promise.all(
body.result.map(async (v) => {
const profile = await this.profileRepo.findOne({
@ -3245,7 +3245,7 @@ export class ProfileEmployeeTempController extends Controller {
keyword?: string;
},
) {
// await new permission().PermissionPost(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionPost(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
let findProfile: any;
let total: any;
const skip = (page - 1) * pageSize;
@ -3404,7 +3404,7 @@ export class ProfileEmployeeTempController extends Controller {
*/
@Get("profileid/position/{id}")
async getProfileByProfileid(@Request() req: RequestWithUser, @Path() id: string) {
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMP
// await new permission().PermissionGet(req, "SYS_REGISTRY_TEMP");//ไม่แน่ใจTEMPปิดไว้ก่อน
const profile = await this.profileRepo.findOne({
where: { id: id },
relations: ["posLevel", "posType", "current_holders", "current_holders.orgRoot"],