Просмотр исходного кода

fix: 修复企业首页分配人才显示为空的问题

- 移除 getRecentAllocations 的30天时间限制
- 改为显示按入职时间倒序的前5名在职员工
- 修复了在职人员因入职时间较早而不显示的问题

Generated with [Claude Code](https://claude.com/claude-code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 3 недель назад
Родитель
Сommit
035350bd99
1 измененных файлов с 3 добавлено и 9 удалено
  1. 3 9
      allin-packages/company-module/src/services/company.service.ts

+ 3 - 9
allin-packages/company-module/src/services/company.service.ts

@@ -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' },