|
|
@@ -314,22 +314,16 @@ export class CompanyService extends GenericCrudService<Company> {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取近期分配人才列表(最近30天入职的在职人员)
|
|
|
+ * 获取近期分配人才列表(最近入职的在职人员,按入职时间倒序)
|
|
|
*/
|
|
|
async getRecentAllocations(companyId: number, limit: number = 5): Promise<any> {
|
|
|
const orderPersonRepo = this.dataSource.getRepository(OrderPerson);
|
|
|
|
|
|
- // 计算30天前的日期(时间设为00:00:00)
|
|
|
- const thirtyDaysAgo = new Date();
|
|
|
- thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
|
|
|
- thirtyDaysAgo.setHours(0, 0, 0, 0);
|
|
|
-
|
|
|
- // 获取近期分配人才列表
|
|
|
+ // 获取近期分配人才列表(按入职时间倒序,不限时间范围)
|
|
|
const talents = await orderPersonRepo.find({
|
|
|
where: {
|
|
|
order: { companyId },
|
|
|
- workStatus: WorkStatus.WORKING,
|
|
|
- joinDate: MoreThanOrEqual(thirtyDaysAgo)
|
|
|
+ workStatus: WorkStatus.WORKING
|
|
|
},
|
|
|
relations: ['order', 'person'],
|
|
|
order: { joinDate: 'DESC' },
|