no message
This commit is contained in:
parent
360bfe22a8
commit
bfe281f3f3
2 changed files with 55 additions and 5 deletions
|
|
@ -4837,6 +4837,47 @@ export class ProfileController extends Controller {
|
||||||
|
|
||||||
return new HttpSuccess({ data: mapDataProfile, total });
|
return new HttpSuccess({ data: mapDataProfile, total });
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* API ค้นหาข้อมูลทะเบียนประวัติที่เกี่ยวข้องคำสั่ง
|
||||||
|
*
|
||||||
|
* @summary ค้นหาข้อมูลทะเบียนประวัติที่เกี่ยวข้องคำสั่ง
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Post("search/profile/command")
|
||||||
|
async searchProfileBycommand(
|
||||||
|
@Query("page") page: number = 1,
|
||||||
|
@Query("pageSize") pageSize: number = 10,
|
||||||
|
@Body()
|
||||||
|
body: {
|
||||||
|
commandType: string;
|
||||||
|
posno: string;
|
||||||
|
year: number;
|
||||||
|
},
|
||||||
|
) {
|
||||||
|
const [profiles, total] = await this.profileRepo
|
||||||
|
.createQueryBuilder("profile")
|
||||||
|
.leftJoinAndSelect("profile.profileSalary", "profileSalary")
|
||||||
|
// .where("YEAR(profileSalary.date) = :year", { year: body.year })
|
||||||
|
// .where("profileSalary.refCommandNo LIKE :refCommandNo", {
|
||||||
|
// refCommandNo: `%${body.posno}%`,
|
||||||
|
// })
|
||||||
|
// .andWhere("profileSalary.commandType LIKE :commandType", {
|
||||||
|
// commandType: `${body.commandType}`,
|
||||||
|
// })
|
||||||
|
.skip((page - 1) * pageSize)
|
||||||
|
.take(pageSize)
|
||||||
|
.distinct(true) // Ensure unique profiles
|
||||||
|
.getManyAndCount();
|
||||||
|
const _profiles = profiles.map((_data) => ({
|
||||||
|
id: _data.id,
|
||||||
|
fullName: `${_data.prefix}${_data.firstName} ${_data.lastName}`,
|
||||||
|
citizenId: _data.citizenId,
|
||||||
|
posNo: _data.profileSalary.filter((x) => x.id != null)[0].refCommandNo,
|
||||||
|
position: _data.profileSalary.filter((x) => x.id != null)[0].position,
|
||||||
|
}));
|
||||||
|
|
||||||
|
return new HttpSuccess({ data: _profiles, total });
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary ปรับคนเป็นทดลองงาน (ADMIN)
|
* @summary ปรับคนเป็นทดลองงาน (ADMIN)
|
||||||
|
|
@ -5023,7 +5064,7 @@ export class ProfileController extends Controller {
|
||||||
* @summary (ADMIN)
|
* @summary (ADMIN)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Get("salarym/ock")
|
@Get("gensalary/latest")
|
||||||
async calSalaryDate() {
|
async calSalaryDate() {
|
||||||
const profile = await this.profileRepo.find();
|
const profile = await this.profileRepo.find();
|
||||||
const _null: any = null;
|
const _null: any = null;
|
||||||
|
|
@ -5054,15 +5095,15 @@ export class ProfileController extends Controller {
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
await this.profileRepo.save(profiles);
|
await this.profileRepo.save(profiles);
|
||||||
return new HttpSuccess("zxczx");
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary (ADMIN)
|
* @summary (ADMIN)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Get("salarym/zxczxcsa")
|
@Get("deleteprofile/all")
|
||||||
async zxczxczxczxczxc() {
|
async deleteHistoryLatest() {
|
||||||
const [profile, total] = await this.profileRepo
|
const [profile, total] = await this.profileRepo
|
||||||
.createQueryBuilder("profile")
|
.createQueryBuilder("profile")
|
||||||
.leftJoinAndSelect("profile.current_holders", "current_holders")
|
.leftJoinAndSelect("profile.current_holders", "current_holders")
|
||||||
|
|
@ -5096,6 +5137,6 @@ export class ProfileController extends Controller {
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
return new HttpSuccess("zxczx");
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,14 @@ export class ProfileSalary extends EntityBase {
|
||||||
})
|
})
|
||||||
mouthSalaryAmount: Double;
|
mouthSalaryAmount: Double;
|
||||||
|
|
||||||
|
// @Column({
|
||||||
|
// nullable: true,
|
||||||
|
// comment: "ประเภทคำสั่ง",
|
||||||
|
// type: "text",
|
||||||
|
// default: null,
|
||||||
|
// })
|
||||||
|
// commandType: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "เลขที่คำสั่ง",
|
comment: "เลขที่คำสั่ง",
|
||||||
|
|
@ -168,6 +176,7 @@ export class CreateProfileSalary {
|
||||||
positionType: string | null;
|
positionType: string | null;
|
||||||
positionLevel: string | null;
|
positionLevel: string | null;
|
||||||
refCommandNo: string | null;
|
refCommandNo: string | null;
|
||||||
|
commandType?: string | null;
|
||||||
templateDoc: string | null;
|
templateDoc: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue