PS6 修复采购提交预算预检阻断
这个提交包含在:
@@ -1612,7 +1612,19 @@ async function purchaseRequestRoutes(fastify) {
|
||||
}
|
||||
|
||||
const warnings = [];
|
||||
const budgetControlMode = authoritativePrecheck?.budgetHint?.controlMode ?? normalizeBudgetControlMode(fastify.config);
|
||||
const budgetPrecheckGate = await evaluateFeatureFlag({
|
||||
prisma: tx,
|
||||
config: fastify.config,
|
||||
flagKey: FEATURE_FLAG_KEYS.budgetPrecheck,
|
||||
departmentId: purchaseRequest.department_id ?? request.employee.department_id ?? null,
|
||||
strictDepartment: false,
|
||||
});
|
||||
const fallbackBudgetControlMode = normalizeBudgetControlMode(fastify.config);
|
||||
const budgetControlMode = budgetPrecheckGate.enabled
|
||||
? authoritativePrecheck.matchedBudgetControlRule?.controlMode
|
||||
?? authoritativePrecheck?.budgetHint?.controlMode
|
||||
?? fallbackBudgetControlMode
|
||||
: fallbackBudgetControlMode;
|
||||
if (!selectedBudgetPoolId) {
|
||||
if (!budgetPrecheckGate.enabled && budgetControlMode === "block") {
|
||||
throw buildValidationError({ budget: "missing_budget_pool" }, 409);
|
||||
|
||||
在新工单中引用
屏蔽一个用户