Commit Graph
41 Commits
Author SHA1 Message Date
lingniu b0caa5afcb feat: polish BI dashboards and bump version
ci/woodpecker/push/woodpecker Pipeline was successful
2026-06-27 21:59:33 +08:00
kkfluous 654573ac4b merge palladium 18t color variant
ci/woodpecker/push/woodpecker Pipeline was successful
2026-06-23 13:32:29 +08:00
kkfluous 43f94ed1b8 fix asset vehicle source grouping
ci/woodpecker/push/woodpecker Pipeline was successful
2026-06-23 13:16:32 +08:00
kkfluous 91202bdf71 fix asset module database migration
ci/woodpecker/manual/woodpecker Pipeline was successful
2026-06-17 11:53:39 +08:00
kkfluousandClaude Opus 4.7 355c45a2e4 fix(assets): 区域车型分解新增「待交车」字段,并合入「其他」车型
ci/woodpecker/push/woodpecker Pipeline was successful
- typeBreakdown 之前只产 4.5T/18T/49T 且仅含 inventory 字段,
  导致区域级 待交车 与车型级 待:N 不一致、操作中合计 != 区域合计
- 后端 getTypeBreakdown 计算 pending(status==='Pending'),
  并把不属 4.5T/18T/49T 的车辆聚合为「其他」类型
- 前端区域 mobile/desktop 视图把「待:」从 inventory 改读 pending
- 点击穿透的 category 也由 'Inventory' 改 'Pending'

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 17:21:37 +08:00
kkfluousandClaude Opus 4.7 cfe79cace2 fix(assets): correct modal filtering for 待交车/库存-其他/本周X
ci/woodpecker/push/woodpecker Pipeline was successful
三个弹窗筛选问题一起修:

1. 待交车 drill-in:Pending 原本错归入 weekly-detail(该接口不支持
   model/batch/location 过滤),改走 /list 并给 /list 的 category 分支
   补上 'Pending' 状态匹配。

2. 库存-其他:'其他' 同时存在于两个体系——资产表的"库存-其他"
   (mapRegion 结果) vs 区域统计的"其他"(mapMacroRegion 结果),
   过滤语义完全不同。引入 source 参数由前端传递,source==='asset'
   时按 v.location 匹配(库存语义),否则按 mapMacroRegion(宏观区域)。
   抽取 filterByLocation 辅助函数供 /list 与 /weekly-detail 共用。

3. 本周交车/还车/替换:/weekly-detail 接口新增 model/batch/location/source
   过滤;前端 fetchWeeklyDetail 签名扩容。实现方式:SQL 结果与缓存
   车辆集(按过滤条件筛)按 truck_id 取交集。

4. BIGINT 精度丢失:DELIVERED_SQL / RETURNED_SQL / REPLACED_SQL 及
   pending/new 子查询原本使用裸 truck.id,mysql2 驱动把 BIGINT 当
   JS Number 返回,大 id (>2^53) 尾部被截,导致 truck_id 交集永远
   为空。全部改为 CAST(truck.id AS CHAR),与 MAIN_SQL 保持一致。

5. fetchVehicleList 类型补上 source,避免前端传的 source 被 URLSearchParams
   构造时静默丢弃。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 11:00:45 +08:00
kkfluousandClaude Opus 4.6 460c9906e1 feat(scheduling): add algorithm pure functions and export mapRegion
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 20:21:50 +08:00
kkfluousandClaude Opus 4.6 820fde5547 feat: 资产总览新增所属公司筛选,支持按归属主体过滤全页数据
ci/woodpecker/push/woodpecker Pipeline failed
- 后端:新增 /api/vehicles/subjects 端点返回公司列表+台数预览;所有聚合端点接受 ?subject= 参数按 tab_truck.org_id 对应的主体公司过滤
- 前端:标题下方新增 Scope Chip 单选下拉,支持搜索+台数预览,选中后全页 KPI/汇总/库存统计按公司联动刷新

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 16:50:25 +08:00
kkfluousandClaude Opus 4.6 8660c0d999 fix: 部门列表隐藏非业务员账号(超级用户/刘思宇/潘舒/黄卓华/许铮杰)
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:48:07 +08:00
kkfluousandClaude Opus 4.6 b4c4929dbb feat: 部门/业务负责人列表补齐无车辆业务员
ci/woodpecker/push/woodpecker Pipeline was successful
/dept-stats 在按车辆聚合后,查询 tab_user 把业务部门内所有在职用户补进 managers 列表,无车辆显示为 0 辆。跳过公务车部门。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 22:44:01 +08:00
kkfluousandClaude Opus 4.6 9c9d7a3805 feat: 全局客户名称脱敏(首尾保留+中间三个*)
ci/woodpecker/push/woodpecker Pipeline was successful
- 2-3字: 首字+*** (徐***)
- 4-6字: 首2字+***+末1字 (嘉兴***司)
- 7字+: 首4字+***+末2字 (嘉兴市乍***公司)
- 覆盖所有接口: monitoring, targets, vehicles, weekly-detail

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 20:23:24 +08:00
kkfluousandClaude Opus 4.6 39f89c30a2 fix: 库存统计(inventory-stats/inventory-analysis)不设数据权限,对所有人开放
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:15:15 +08:00
kkfluousandClaude Opus 4.6 840bf30517 fix: 本周动态也基于权限过滤后的车辆计算
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 16:57:32 +08:00
kkfluousandClaude Opus 4.6 441f574238 fix: /summary 和 /by-type 接口补上权限过滤(之前遗漏)
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 16:54:29 +08:00
kkfluous 143c1a57bb debug: 添加权限过滤日志定位问题
ci/woodpecker/push/woodpecker Pipeline was successful
2026-04-02 16:48:29 +08:00
kkfluousandClaude Opus 4.6 2575778293 feat: 后端用户认证和权限过滤
- 新增 auth 模块:jumpToken 代理交换、用户信息获取、JWT 签发
- 三级权限:full(所有权限/数智中心/BI-Leader)、department(BI-Leader-Dep)、personal
- 添加 managerId 到车辆数据模型,支持个人级别按 userId 精确过滤
- auth 中间件保护所有 /api/* 端点(跳过 /api/health 和 /api/auth/*)
- 所有路由集成 filterByPermission 权限过滤

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 15:35:29 +08:00
kkfluousandClaude Opus 4.6 240478142f fix: 客户饼图省份用车辆表province、区域柱状图用realtime表;加出勤说明
ci/woodpecker/push/woodpecker Pipeline was successful
- 后端region-chart新增source参数:vehicle用车辆表,realtime用实时表
- 客户运营地区占比"按省份"改用source=vehicle
- 区域资产分布概览"按省份"继续用source=realtime
- 部门Tab加说明文字:*说明:当天里程>0即为出勤。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:35:14 +08:00
kkfluousandClaude Opus 4.6 6e8e01196c fix: 省份图表"未知"合入"其他"
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:28:03 +08:00
kkfluousandClaude Opus 4.6 e910deac51 feat: 按城市改为按省份,数据从realtime表province获取,展示前5
ci/woodpecker/push/woodpecker Pipeline was successful
- 后端region-chart支持groupBy=province,从realtime表读取省份
- 区域柱状图和客户饼图"按城市"改为"按省份"
- 省份展示前5,其余合入"其他"
- 前端state类型从'city'改为'province'

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 09:26:54 +08:00
kkfluousandClaude Opus 4.6 16f5ef8741 fix: 区域统计客户筛选生效,后端region-stats支持过滤参数
ci/woodpecker/push/woodpecker Pipeline was successful
- 后端/region-stats新增customer/city/region查询参数
- 前端regionFilters变化时重新请求后端数据
- 移除前端冗余过滤逻辑,由后端统一处理

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 00:42:59 +08:00
kkfluousandClaude Opus 4.6 9d0b305218 feat: 出勤率数据源切换为tab_truck_remote_sync_realtime_info
ci/woodpecker/push/woodpecker Pipeline was successful
- dept-stats和/list的attendance过滤改为查询realtime表的day_mileage
- day_mileage>0为出勤,=0为闲置
- 移除旧的ln_vehicle_day_mileage依赖
- 前端恢复出勤率/出勤/闲置的数据显示和下钻功能

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:48:10 +08:00
kkfluousandClaude Opus 4.6 2626bf2aa7 fix: 库存统计口径统一包含Inventory+Abnormal
ci/woodpecker/push/woodpecker Pipeline was successful
inventory-stats端点只过滤status=Inventory,但/list的category=Inventory
包含Inventory+Abnormal,导致统计数和下钻列表不一致。统一为两者都包含。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 23:11:48 +08:00
kkfluousandClaude Opus 4.6 0eb4485af4 fix: 库存批次改为车型名称、区域待交车数量始终显示
ci/woodpecker/push/woodpecker Pipeline was successful
- 库存统计:移除批次筛选(原显示contractNo),batch字段改为model
- 区域Tab:待交车和库存数量即使为0也显示数字,移除|| ''和if守卫
- 桌面端和移动端的pendingCount/inventory全部始终显示

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 22:49:57 +08:00
kkfluousandClaude Opus 4.6 8472f22f1e fix: 出勤率改为当天计算(当天出勤数/总运营数)
ci/woodpecker/push/woodpecker Pipeline was successful
之前用近30天activeDays/totalDays计算,现改为:
当天里程>0的车辆数 / 部门总运营车辆数 × 100%

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 20:17:09 +08:00
kkfluousandClaude Opus 4.6 8727dc36ab fix: 部门出勤/闲置下钻改为基于当日里程区分
ci/woodpecker/push/woodpecker Pipeline was successful
- 后端/list新增attendance参数(active/idle),查询当日里程表区分
  出勤(mileage>0)和闲置(mileage=0),仅对Operating车辆生效
- 前端部门Tab出勤/闲置点击改用attendance:'active'/'idle'替代
  原来错误的category:'Operating'/'Inventory'
- 修复department='公务车'过滤:匹配departmentName为null的车辆
- 前端API层新增attendance参数传递

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 20:01:58 +08:00
kkfluousandClaude Opus 4.6 cab26a207a fix: 部门统计未分配部门改为显示"公务车",排序放最后
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 19:51:21 +08:00
kkfluousandClaude Opus 4.6 93a6c7df1c fix: 对齐原型UI差异、修复所有下钻维度、统一弹窗详情表格
ci/woodpecker/push/woodpecker Pipeline was successful
- 部门Tab:移除多余section header,标签改为总运营车辆/出勤/闲置,
  表格移除日均里程列,按业务负责人改为按业务员,所有行加点击下钻
- 部门下钻增加department维度,后端/list接口新增department过滤参数
- 区域Tab:总资产下钻移除错误的category:Operating,库存改为Inventory,
  补全source:region和title,图表高度h-72改h-64
- 客户Tab:4.5T/冷链点击增加isColdChain区分,移动端合计badge加下钻,
  所有点击补全title
- 筛选面板:移除区域和客户的"完成筛选"按钮
- 所有manager下钻补全title字段
- 弹窗统一使用14列完整详情表格(月/部门/负责人/品牌/车型/归属/客户/
  车牌/状态/提车时间/到期时间/区域/离到期/签约公司),移除source条件
- 表格加whitespace-nowrap和w-max,移动端水平滚动不换行

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 19:33:44 +08:00
kkfluousandClaude Opus 4.6 f6a4884ad1 fix: category=Inventory包含Abnormal状态,与统计口径一致
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:49:06 +08:00
kkfluousandClaude Opus 4.6 e7ef773bc8 fix: 新增下钻支持、移动端库存区域下钻加category:Inventory
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:46:57 +08:00
kkfluousandClaude Opus 4.6 dd01671d9e fix: 区域运营移动端数据、下钻支持城市/车型、网页标题
ci/woodpecker/push/woodpecker Pipeline was successful
- 移动端区域运营改用regionData真实数据(去掉Math.floor模拟)
- 区域/城市/车型行数字全部支持点击下钻
- 后端/list支持按车型大类过滤(如4.5T含普货+冷链)
- 网页标题改为"羚牛氢能车辆资产"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:28:46 +08:00
kkfluousandClaude Opus 4.6 2ba25427de feat: tab导航、recharts图表、库存统计、出勤率里程、区域城市下钻、数据一致性修复
ci/woodpecker/push/woodpecker Pipeline was successful
- 新增tab导航(总览/按部门/按区域/按客户)+ 移动端底部导航
- 新增recharts柱状图(区域分布)和饼图(客户分布)
- 新增库存统计模块(按区域/按车型,筛选面板)
- 对接ln_vehicle_day_mileage表实现出勤率和日均里程
- 区域运营支持区域→城市→车型三级下钻
- 修复ownership取字段错误(改用truck_rent_status)
- 修复部门统计闲置定义(当日无行驶里程)
- 修复区域图表"其他"重复问题(后端Top N合并)
- 修复城市名空值降级(resolveCity取province)
- 修复下钻数据不一致(统一category/vehicleType参数)
- 扩展/list端点支持大区过滤和未分配匹配
- 所有筛选改为searchable datalist

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:09:18 +08:00
kkfluousandClaude Opus 4.6 629451c13d feat: add inventory statistics section, adapt to latest prototype
- Add GET /api/vehicles/inventory-stats endpoint that groups inventory vehicles by macro-region, city, brand, type, model, and batch
- Add RegionalInventoryStats type and fetchInventoryStats API function
- Add full inventory statistics section with region/model tabs, filters, desktop table, and mobile views
- Add modal filters (plate number, model, brand, location search) to vehicle detail modal
- Update modal header to support title field for contextual naming

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 16:24:39 +08:00
kkfluousandClaude Opus 4.6 d6ac1044fe fix: replace modal with prototype version, extend /list API fields
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 15:28:12 +08:00
kkfluousandClaude Opus 4.6 73d5afde5c feat: add dept/region/customer stats APIs and extend /list filters
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 18:13:44 +08:00
kkfluousandClaude Opus 4.6 9a7382101b feat: 库存弹窗展示车牌号及省市信息
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 15:39:10 +08:00
kkfluousandClaude Opus 4.6 e4ffd027be fix: 库存总数包含异动车辆,总计行改为累加计算
ci/woodpecker/push/woodpecker Pipeline was successful
- getStats 的 inventory 统计包含 Inventory + Abnormal
- 总计行所有列改为从各车型数据累加,不再使用 SUMMARY

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:11:12 +08:00
kkfluousandClaude Opus 4.6 363399faed fix: 修正总库存计算,区分在库/待交车/异动状态
ci/woodpecker/push/woodpecker Pipeline was successful
- 总库存 = 在库 + 异动(不含待交车)
- 待交车独立展示
- 库 = 纯在库数量
- 异 = 异动数量
- 验证: 运营 + 库存 + 待交 = 总资产

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 15:03:44 +08:00
kkfluousandClaude Opus 4.6 0b2e2f23b5 fix: 修复bigint精度丢失导致交还替换数据膨胀
ci/woodpecker/push/woodpecker Pipeline was successful
truck ID 为 MySQL bigint,JavaScript Number 精度不够导致
不同 ID 被截断为相同值造成误匹配。改用 CAST AS CHAR +
字符串 Set 比较。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:50:22 +08:00
kkfluousandClaude Opus 4.6 23fa3e1531 feat: 资产汇总表按品牌型号展示交车/还车/替换/待交车数据
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:47:06 +08:00
kkfluousandClaude Opus 4.6 2d2c684d8a fix: 简化周统计SQL去掉子查询,添加debug接口
ci/woodpecker/push/woodpecker Pipeline was successful
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:42:34 +08:00
kkfluousandClaude Opus 4.6 0cc5024132 feat: 羚牛 BI 报表服务初始版本
ci/woodpecker/manual/woodpecker Pipeline was successful
- Hono + TypeScript 后端,连接 MySQL 数据库
- React + Vite + Tailwind 前端
- 车辆资产实时汇总(按车型/品牌型号分组)
- 本周交车/还车/替换统计(关联业务单据)
- 车牌号详情弹窗
- Dockerfile + Woodpecker CI 流水线

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:02:49 +08:00