fix: 年度价值报告待处理风险排除employeeId为null的未知员工

This commit is contained in:
selfrelease
2026-07-31 11:44:37 +08:00
parent ebebe1814f
commit 9df147ce59
+2 -1
View File
@@ -1707,11 +1707,12 @@ export async function getAnnualValueReport(orgId: string, year: number) {
}, },
orderBy: { estimatedLoss: 'desc' }, orderBy: { estimatedLoss: 'desc' },
}), }),
// 未解决的风险列表(PENDING状态),按预估损失降序,最多100条 // 未解决的风险列表(PENDING状态),排除无关联员工的月度任务,按预估损失降序,最多100条
prisma.riskItem.findMany({ prisma.riskItem.findMany({
where: { where: {
orgId, status: 'PENDING', orgId, status: 'PENDING',
estimatedLoss: { gt: 0 }, estimatedLoss: { gt: 0 },
employeeId: { not: null },
}, },
include: { include: {
employee: { employee: {