|
|
@@ -77,16 +77,8 @@ async def add_employee_controller(
|
|
|
"""添加员工"""
|
|
|
result = await EmployeeService.add_employee_service(auth=auth, data=data)
|
|
|
log.info(f"添加员工成功: {data.employee_name}, employee_id={result.employee_id}")
|
|
|
- # 联动:员工加入部门时,为引用该部门的制度创建额度记录
|
|
|
- if result.employee_id and data.enterprise_id and data.department_ids:
|
|
|
- try:
|
|
|
- from app.plugin.module_payment.expense.institution.scope_sync import sync_employee_add_to_department_institutions
|
|
|
- await sync_employee_add_to_department_institutions(
|
|
|
- auth=auth, enterprise_id=data.enterprise_id,
|
|
|
- employee_id=result.employee_id, department_ids=data.department_ids,
|
|
|
- )
|
|
|
- except Exception as e:
|
|
|
- log.warning(f"添加员工联动额度失败(不影响主体操作): {e}")
|
|
|
+ # 不触发额度联动:员工需完成签约激活后才享受费控制度
|
|
|
+ # 由 webhook employee.activated 通知触发
|
|
|
return SuccessResponse(data=result, msg="添加员工成功")
|
|
|
|
|
|
|