fix: 员工规避损失明细排除无关联员工的月度任务记录
This commit is contained in:
@@ -1560,6 +1560,7 @@ export async function getAnnualValueReport(orgId: string, year: number) {
|
||||
orgId, status: 'RESOLVED',
|
||||
resolvedBy: { not: null },
|
||||
resolvedAt: { gte: yearStart, lte: yearEnd },
|
||||
employeeId: { not: null },
|
||||
},
|
||||
}),
|
||||
prisma.riskItem.aggregate({
|
||||
@@ -1567,6 +1568,7 @@ export async function getAnnualValueReport(orgId: string, year: number) {
|
||||
orgId, status: 'RESOLVED', estimatedLoss: { gt: 0 },
|
||||
resolvedBy: { not: null },
|
||||
resolvedAt: { gte: yearStart, lte: yearEnd },
|
||||
employeeId: { not: null },
|
||||
},
|
||||
_sum: { estimatedLoss: true },
|
||||
}),
|
||||
@@ -1624,6 +1626,7 @@ export async function getAnnualValueReport(orgId: string, year: number) {
|
||||
orgId, status: 'RESOLVED',
|
||||
resolvedBy: { not: null },
|
||||
resolvedAt: { gte: yearStart, lte: yearEnd },
|
||||
employeeId: { not: null },
|
||||
},
|
||||
include: {
|
||||
employee: {
|
||||
|
||||
Reference in New Issue
Block a user