OAPERM1 收紧启用前权限冻结
这个提交包含在:
@@ -29,6 +29,7 @@ function buildPerformanceDistribution(rows) {
|
||||
async function buildEmployeeStats(prisma, options = {}) {
|
||||
const timeZone = options.timeZone ?? "Asia/Shanghai";
|
||||
const includeSalarySummary = options.includeSalarySummary ?? true;
|
||||
const includePerformanceSummary = options.includePerformanceSummary ?? true;
|
||||
const todayString = currentDateString(timeZone);
|
||||
const today = parseDateOnlyString(todayString);
|
||||
const last30DateFrom = addDays(today, -29);
|
||||
@@ -114,14 +115,18 @@ async function buildEmployeeStats(prisma, options = {}) {
|
||||
},
|
||||
},
|
||||
}),
|
||||
prisma.performanceReviewCycle.findFirst({
|
||||
where: { status: "active" },
|
||||
orderBy: [{ activated_at: "desc" }, { start_date: "desc" }],
|
||||
}),
|
||||
prisma.performanceReviewCycle.findFirst({
|
||||
where: { status: "completed" },
|
||||
orderBy: [{ completed_at: "desc" }, { end_date: "desc" }],
|
||||
}),
|
||||
includePerformanceSummary
|
||||
? prisma.performanceReviewCycle.findFirst({
|
||||
where: { status: "active" },
|
||||
orderBy: [{ activated_at: "desc" }, { start_date: "desc" }],
|
||||
})
|
||||
: Promise.resolve(null),
|
||||
includePerformanceSummary
|
||||
? prisma.performanceReviewCycle.findFirst({
|
||||
where: { status: "completed" },
|
||||
orderBy: [{ completed_at: "desc" }, { end_date: "desc" }],
|
||||
})
|
||||
: Promise.resolve(null),
|
||||
includeSalarySummary
|
||||
? prisma.payslip.aggregate({
|
||||
where: {
|
||||
@@ -155,7 +160,7 @@ async function buildEmployeeStats(prisma, options = {}) {
|
||||
distribution: [],
|
||||
};
|
||||
|
||||
if (performanceCycle) {
|
||||
if (includePerformanceSummary && performanceCycle) {
|
||||
const [reviewAggregate, reviewDistribution] = await Promise.all([
|
||||
prisma.performanceReview.aggregate({
|
||||
where: { cycle_id: performanceCycle.id },
|
||||
|
||||
在新工单中引用
屏蔽一个用户