diff --git a/backend/src/services/risk.service.ts b/backend/src/services/risk.service.ts index 09cfaea..ec9129d 100644 --- a/backend/src/services/risk.service.ts +++ b/backend/src/services/risk.service.ts @@ -318,46 +318,9 @@ export async function detectOnboardingRisks(orgId: string) { } export async function detectTerminationRisks(orgId: string) { - const employees = await prisma.employee.findMany({ - where: { orgId, status: 'ACTIVE' }, - }) - - const risks: { employeeId: string; type: RiskType; level: RiskLevel; title: string; description: string; actionUrl: string }[] = [] - - for (const emp of employees) { - if (emp.isPregnant) { - risks.push({ - employeeId: emp.id, - type: 'TERMINATION', - level: 'HIGH', - title: `${emp.name}处于孕期/哺乳期,解聘受限`, - description: '三期女职工不得依非过错理由解除劳动合同,否则面临违法解除赔偿金风险。此为合规提示,请勿发起解聘;如需确认员工状态请查看特殊状态。', - actionUrl: `/special-status?employee=${encodeURIComponent(emp.name)}&type=PREGNANCY`, - }) - } - if (emp.isInMedicalPeriod) { - risks.push({ - employeeId: emp.id, - type: 'TERMINATION', - level: 'MEDIUM', - title: `${emp.name}处于医疗期,解聘需谨慎`, - description: '医疗期内不得解除劳动合同(非过错理由),需等待医疗期结束。此为合规提示,请勿发起解聘;如需确认员工状态请查看特殊状态。', - actionUrl: `/special-status?employee=${encodeURIComponent(emp.name)}&type=MEDICAL_PERIOD`, - }) - } - if (emp.isWorkInjured) { - risks.push({ - employeeId: emp.id, - type: 'TERMINATION', - level: 'HIGH', - title: `${emp.name}工伤期间,解聘受限`, - description: '工伤职工在停工留薪期内不得解除劳动合同。此为合规提示,请勿发起解聘;如需确认员工状态请查看特殊状态。', - actionUrl: `/special-status?employee=${encodeURIComponent(emp.name)}&type=WORK_INJURY`, - }) - } - } - - return risks + // 三期/医疗期/工伤员工的解聘限制为被动检查,在 termination.service.ts 中已实现 + // 不再作为主动风险推送到工作台 + return [] } /**