|
|
@@ -318,23 +318,23 @@ class InstitutionService:
|
|
|
# 按员工选择 → 直接使用传入的员工ID
|
|
|
employee_ids = [str(i) for i in add_ids if i]
|
|
|
elif adapter_type == "EMPLOYEE_ALL":
|
|
|
- # 全部员工(包括未激活的,待后续激活时更新状态)
|
|
|
+ # 全体员工 → 仅已签约员工
|
|
|
from app.plugin.module_payment.employee.model import EmployeeModel
|
|
|
emp_stmt = select(EmployeeModel).where(
|
|
|
EmployeeModel.enterprise_id == enterprise_id,
|
|
|
- EmployeeModel.status != "EMPLOYEE_UNSIGN",
|
|
|
+ EmployeeModel.status == "ACTIVATED",
|
|
|
)
|
|
|
emp_result = await auth.db.execute(emp_stmt)
|
|
|
employee_ids = [emp.employee_id for emp in emp_result.scalars().all() if emp.employee_id]
|
|
|
|
|
|
elif adapter_type == "EMPLOYEE_DEPARTMENT":
|
|
|
- # 按部门 → 查该部门下的所有员工(包括未激活的)
|
|
|
+ # 按部门 → 仅已签约员工
|
|
|
for dept_id in add_ids:
|
|
|
dept_id_str = str(dept_id)
|
|
|
from app.plugin.module_payment.employee.model import EmployeeModel
|
|
|
emp_stmt = select(EmployeeModel).where(
|
|
|
EmployeeModel.enterprise_id == enterprise_id,
|
|
|
- EmployeeModel.status != "EMPLOYEE_UNSIGN",
|
|
|
+ EmployeeModel.status == "ACTIVATED",
|
|
|
)
|
|
|
emp_result = await auth.db.execute(emp_stmt)
|
|
|
for emp in emp_result.scalars().all():
|