fix: 年度价值报告待处理风险排除employeeId为null的未知员工
This commit is contained in:
@@ -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: {
|
||||||
|
|||||||
Reference in New Issue
Block a user