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 },
|
||||
|
||||
@@ -46,7 +46,7 @@ const NAVIGATION_REGISTRY = Object.freeze({
|
||||
workflowTasks: { key: "workflowTasks", label: "审批待办", icon: "fact_check", href: "/workflow/tasks", anyOf: ["expense.approve", "leave.approve", "attendance.approve", "procurement.approve", "travel.approve"] },
|
||||
dashboard: { key: "dashboard", label: "仪表盘", icon: "dashboard", href: "/dashboard", anyOf: ["report.dashboard.view"] },
|
||||
purchaseRequests: { key: "purchaseRequests", label: "采购申请", icon: "shopping_cart", href: "/purchase-requests", anyOf: ["procurement.create", "procurement.view_own", "procurement.view_all", "procurement.manage"] },
|
||||
travelRequests: { key: "travelRequests", label: "差旅申请", icon: "flight", href: "/travel-requests", anyOf: ["travel.view_all", "travel.manage", "travel.payment.manage", "integration.manage"] },
|
||||
travelRequests: { key: "travelRequests", label: "差旅申请", icon: "flight", href: "/travel-requests", anyOf: ["travel.view_all", "travel.manage", "travel.payment.manage"] },
|
||||
budgets: { key: "budgets", label: "预算管理", icon: "account_balance", href: "/budgets", anyOf: ["budget.view", "budget.manage"] },
|
||||
paymentBatches: { key: "paymentBatches", label: "支付批次", icon: "payments", href: "/payment-batches", anyOf: ["payment.batch.manage", "risk.review.manage"], featureFlagKey: FEATURE_FLAG_KEYS.paymentBatch },
|
||||
apOperations: { key: "apOperations", label: "AP 运营", icon: "account_balance_wallet", href: "/ap-operations", anyOf: ["payment.batch.manage", "risk.review.manage"], featureFlagKey: FEATURE_FLAG_KEYS.paymentBatch },
|
||||
|
||||
在新工单中引用
屏蔽一个用户