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 });
|
||||
}
|
||||
/**
|
||||
* 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)
|
||||
|
|
@ -5023,7 +5064,7 @@ export class ProfileController extends Controller {
|
|||
* @summary (ADMIN)
|
||||
*
|
||||
*/
|
||||
@Get("salarym/ock")
|
||||
@Get("gensalary/latest")
|
||||
async calSalaryDate() {
|
||||
const profile = await this.profileRepo.find();
|
||||
const _null: any = null;
|
||||
|
|
@ -5054,15 +5095,15 @@ export class ProfileController extends Controller {
|
|||
}),
|
||||
);
|
||||
await this.profileRepo.save(profiles);
|
||||
return new HttpSuccess("zxczx");
|
||||
return new HttpSuccess();
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary (ADMIN)
|
||||
*
|
||||
*/
|
||||
@Get("salarym/zxczxcsa")
|
||||
async zxczxczxczxczxc() {
|
||||
@Get("deleteprofile/all")
|
||||
async deleteHistoryLatest() {
|
||||
const [profile, total] = await this.profileRepo
|
||||
.createQueryBuilder("profile")
|
||||
.leftJoinAndSelect("profile.current_holders", "current_holders")
|
||||
|
|
@ -5096,6 +5137,6 @@ export class ProfileController extends Controller {
|
|||
}
|
||||
}),
|
||||
);
|
||||
return new HttpSuccess("zxczx");
|
||||
return new HttpSuccess();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue