Skip to content

v0.5 P2:考评单生成与自动算分 #51

Closed

Description

@marchtian

总览:#49 · 设计 01 FR-702;02 §4.7、§5.7;03 §10 步骤 1–2;05 §4;07 风险 R7、R9 · 依赖 P1

内容

  • 对象 srm_performance_review(字段按 02 §4.7,review_no 自动编号,status 按 02 §5.7 作 stageField + state_machine)与 srm_performance_score(master_detail → 考评单)。
  • srm_performance_generate:schedule 每月 1 日(追赶式,可重复运行不重复建);按供应商所供最高物资类别(class_a/b/c)取 perf_cycle;为本次到期的合格供应商建上期考评单(calculating),按启用指标建评分明细并快照权重。
  • 自动算分:按供应商与 period 汇总交付记录(on_time、inspection_result、defect_quantity / received_quantity,口径同 v0.4 的 srm_delivery_metrics),写 otd_rate、lot_pass_rate、ppm 与对应明细的原始值和得分(得分规则按指标 scoring_rule,用参数或指标字段表达,不写死在 flow 里);本期无交付记录时标记「数据不全」而不是给零分(R7)。之后进入 scoring。
  • 批量性能:供应商多时按法人或品类错峰(R9),先测 200 家样例数据的运行时间并记录。
  • 测试:A / B / C 三种周期、重复运行不重复、无交付记录、口径与导入数据一致。

出口条件

  • A 类供应商月度考评单自动生成,三项自动指标与交付记录一致(门槛 1 第 6 步前半)
  • 跑两遍不重复建单
  • 全部 pnpm 检查全绿;02 / 03 与实现一致

完成于 PR #62(2026-10-24)。实测 200 家供应商 × 30 行交付记录约 8.6 秒(记录在 03 §10、07 R9)。

Activity

  1. marchtian commented on Oct 24, 2026

    @marchtian
    CollaboratorAuthor

    Inputs from #50 (PR #58) that this issue should build on:

    • srm_kpi.dimension has five values: quality / cost / delivery / service / hse (director ruling 2026-10-24). 02 §4.7 now lists hse_score on srm_performance_review beside the other four stored scores. Score flows must tolerate a dimension with no active KPI (cost has only a manual KPI; hse likewise).
    • Auto KPIs carry auto_metric (otd_rate / lot_pass_rate / ppm / ack_on_time_rate, the review's rate field) and linear thresholds full_score_value / zero_score_value: score = clamp(100 × (raw − zero) / (full − zero), 0, 100). Rates are in percentage points (98 = 98%), so multiply a stored fraction by 100 first; PPM is raw PPM (full < zero ⇒ lower is better).
    • Generate only from active == true KPIs, snapshot weight onto the score line, and refuse to generate (notify the director) when active weights do not sum to 100% (03 §10 step 1, updated in feat(core): v0.5 P1 KPI library srm_kpi #58). ACK_ON_TIME ships inactive until ERP.
    • One global scheme in v0.5; material_classes per-class filtering is a documented seam only.

    Generated by Claude Code

  2. added a commit that references this issue on Oct 24, 2026
    d83e2c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions