fix: 库存统计(inventory-stats/inventory-analysis)不设数据权限,对所有人开放
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
kkfluous
2026-04-02 18:15:15 +08:00
parent 8ed2031c45
commit 39f89c30a2

View File

@@ -612,9 +612,9 @@ app.get('/by-batch', async (c) => {
return c.json(result);
});
// GET /api/vehicles/inventory-analysis
// GET /api/vehicles/inventory-analysis — 库存分析,不设数据权限,对所有人开放
app.get('/inventory-analysis', async (c) => {
const vehicles = await getVehiclesForUser(c);
const vehicles = await getVehicles();
const typeFilters = [
{ name: '4.5T普货', filter: (v: Vehicle) => v.type === '4.5T' && !v.model.includes('冷链') },
@@ -952,9 +952,9 @@ app.get('/list', async (c) => {
);
});
// GET /api/vehicles/inventory-stats — grouped inventory stats for the inventory statistics section
// GET /api/vehicles/inventory-stats — 库存统计,不设数据权限,对所有人开放
app.get('/inventory-stats', async (c) => {
const vehicles = await getVehiclesForUser(c);
const vehicles = await getVehicles();
const inventory = vehicles.filter((v) => v.status === 'Inventory' || v.status === 'Abnormal');
const TYPE_NAME_MAP: Record<string, string> = {