From cdb8bdbd3868a43d8f81b952b3354ea189c02dbe Mon Sep 17 00:00:00 2001 From: freedakgmail Date: Mon, 17 Aug 2026 21:28:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E4=B8=89=E6=9C=9F/?= =?UTF-8?q?=E5=8C=BB=E7=96=97=E6=9C=9F/=E5=B7=A5=E4=BC=A4=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E4=B8=BB=E5=8A=A8=E6=8E=A8=E9=80=81=E8=A7=A3=E8=81=98?= =?UTF-8?q?=E5=8F=97=E9=99=90=E9=A3=8E=E9=99=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这些是被动合规检查,在 termination.service.ts 解聘流程中已实现 不应作为主动风险推送到工作台 --- backend/src/services/risk.service.ts | 43 ++-------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) 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 [] } /**