← 返回
未分类

盘货模型

Build supply chain replenishment models with multi-constraint allocation algorithms. Use when user asks to build, train, or develop a replenishment/inventory model from scratch, or needs to calculate optimal purchase quantities under budget and turnover constraints. Triggers on inventory model, replenishment model, supply chain model, budget allocation, turnover constraint, optimal purchase quantity calculation, and Chinese keywords in references/chinese_triggers.md.
>-
user_e9ec61f3
未分类 community v1.0.3 4 版本 100000 Key: 无需
★ 0
Stars
📥 85
下载
💾 0
安装
4
版本
#latest

概述

Supply Chain Replenishment Model Builder

Build a constraint-based replenishment model from Excel input data. The model calculates optimal purchase quantities per SKU across multiple suppliers under budget limits and turnover constraints, using a two-phase allocation algorithm.

Workflow

Step 1: Understand Requirements

Collect:

  1. Budget per supplier - how much each supplier can receive
  2. Turnover constraints - max days of stock per SKU and per category
  3. Data columns - what columns exist in the Excel
  4. Special rules - expiration, box size, location-based restrictions

Step 2: Design Rules

Implement constraints in this priority order:

PriorityRuleContent
-------------------------
1FilterSkip zero-sales SKUs, location="stop"/"clear"
2Rule 3BGM/CGM/POCT expiration filter
3Rule 4Replenishment <= available stock + in-transit
4Rule 1Post-replenishment turnover <= max turnover
5Rule 5Box size integer multiple
6Rule ASupplier budget cap (two-phase allocation)
7Final checkTotal <= budget (reduce by box if over)

Step 3: Two-Phase Allocation Algorithm

Phase 1 - 70% Target Allocation:

  1. Compute weighted daily average sales
  2. Calculate target stock = category turnover × 70% × daily average
  3. Compute ideal replenishment = target stock - current stock
  4. Apply Rule 4 and Rule 1 caps
  5. Scale all SKUs proportionally to fit within supplier budget
  6. Round down to box size (skip if < 1 box)

Phase 2 - Additional Allocation (spend remaining budget):

  1. Allocate remaining budget to all SKUs (including at-target) per Rule 1 cap
  2. Round up to box size (if < 1 box, round to 1 box)
  3. This phase can exceed the 70% target to use up budget

Phase 3 - Final Validation:

  • Sum total by supplier; if over budget, reduce largest items by 1 box until compliant

Step 4: Weighted Daily Average

weighted_daily = monthly_avg / 30 × 0.7 + current_month_sales / current_days × 0.3

Step 5: Excel Output

Reserve 3 columns for results (V/W/X in current mapping):

  • Col V: Replenishment quantity
  • Col W: Replenishment amount (qty × price)
  • Col X: Post-replenishment turnover days OR skip reason

For non-replenished SKUs, write "-" in V/W and skip reason in X.

Step 6: Implementation

See scripts/build_model.py for the complete reference implementation.

Key Design Decisions

  • 70% ceiling: Reduces turnover gap within categories
  • Weighted average: Ensures Rule 1 calculation matches actual post-replenishment turnover
  • Box constraint: Round down in Phase 1 (conservative), round up in Phase 2 (aggressive)
  • Two-phase vs one-phase: One-phase leaves budget unused; two-phase ensures "money must be spent" priority
  • Gift SKUs: No Rule 1 cap (turnover unlimited)

Resources

版本历史

共 4 个版本

  • v1.0.3 Initial release 当前
    2026-05-22 16:41 安全 安全
  • v1.0.2 Initial release
    2026-05-22 16:28 安全 安全
  • v1.0.1 Initial release
    2026-05-21 19:24 安全 安全
  • v1.0.0 Initial release
    2026-05-08 15:54 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

全网维价

user_e9ec61f3
★ 0 📥 130

电商数据OSS上传

user_e9ec61f3
电商日报自动上传OSS。触发场景:用户说「处理数据并上传OSS」「上传拼多多/抖音/京东/天猫数据」「处理拼多多/抖音/京东/天猫数据」。支持四个平台:拼多多(pdd)、抖音(dy)、京东(jd)、天猫(tm)。
★ 0 📥 115

盘货数据源

user_e9ec61f3
从Excel文件的'整体库存'工作表中提取指定字段,生成精简数据表,适用于供应链库存数据分析
★ 0 📥 72