Forráskód Böngészése

fix: 员工激活状态ACTIVATED而非EMPLOYEE_ACTIVATED

- 数据库status字段值来自支付宝notify.activate字段
- 已激活员工status='ACTIVATED', 非'EMPLOYEE_ACTIVATED'
- 改为排除EMPLOYEE_UNSIGN即可覆盖所有有效员工
alphah 2 hete
szülő
commit
85aa05159b

+ 2 - 2
backend/app/plugin/module_payment/expense/institution/service.py

@@ -322,7 +322,7 @@ class InstitutionService:
             from app.plugin.module_payment.employee.model import EmployeeModel
             emp_stmt = select(EmployeeModel).where(
                 EmployeeModel.enterprise_id == enterprise_id,
-                EmployeeModel.status.in_(["EMPLOYEE_CREATE", "EMPLOYEE_ACTIVATED"]),
+                EmployeeModel.status != "EMPLOYEE_UNSIGN",
             )
             emp_result = await auth.db.execute(emp_stmt)
             employee_ids = [emp.employee_id for emp in emp_result.scalars().all() if emp.employee_id]
@@ -334,7 +334,7 @@ class InstitutionService:
                 from app.plugin.module_payment.employee.model import EmployeeModel
                 emp_stmt = select(EmployeeModel).where(
                     EmployeeModel.enterprise_id == enterprise_id,
-                    EmployeeModel.status.in_(["EMPLOYEE_CREATE", "EMPLOYEE_ACTIVATED"]),
+                    EmployeeModel.status != "EMPLOYEE_UNSIGN",
                 )
                 emp_result = await auth.db.execute(emp_stmt)
                 for emp in emp_result.scalars().all():