zlwu 2 месяцев назад
Родитель
Сommit
69fa5b1fa8
38 измененных файлов с 2230 добавлено и 1544 удалено
  1. 1 1
      backend/app.pid
  2. 70 7
      backend/app/services/pl_contract_plan_qty.py
  3. 50 17
      backend/app/services/pl_plan_stop_service.py
  4. 6 5
      backend/graphify-out/.graphify_labels.json
  5. 1 0
      backend/graphify-out/2026-08-30/.graphify_labels.json
  6. 240 235
      backend/graphify-out/2026-08-30/GRAPH_REPORT.md
  7. 112 112
      backend/graphify-out/2026-08-30/graph.json
  8. 223 222
      backend/graphify-out/GRAPH_REPORT.md
  9. 0 0
      backend/graphify-out/cache/ast/v0.9.4/1510837f634e5181e8f4183f488ad530c631ec1c3c4a3988d569057ee106a1ef.json
  10. 0 0
      backend/graphify-out/cache/ast/v0.9.4/29d724d1e316e149bbea0cc6f963895874def2254ef24e2f752ff794f192397f.json
  11. 0 0
      backend/graphify-out/cache/ast/v0.9.4/618b8ac3471fe12df475dc7a10b6f724ba93e85c6e7ba87a1767b9015b777191.json
  12. 0 0
      backend/graphify-out/cache/ast/v0.9.4/7cc88e1712b0e18e8ff057eb6847d583975557c159b7dc4967e6151dcb5724e8.json
  13. 0 0
      backend/graphify-out/cache/stat-index.json
  14. 112 112
      backend/graphify-out/graph.json
  15. 72 0
      backend/tests/test_pl_contract_plan_qty.py
  16. 85 1
      backend/tests/test_pl_plan_single_contract_rules.py
  17. 3 3
      docs/fresh-mint-green.html
  18. 42 0
      docs/superpowers/plans/2026-08-30-pl-contract-qty-archived-actual.md
  19. 48 0
      docs/superpowers/plans/2026-08-30-pl-plan-delivery-contract-products.md
  20. 48 0
      docs/superpowers/specs/2026-08-30-pl-contract-qty-archived-actual-design.md
  21. 4 1
      docs/superpowers/specs/2026-08-30-pl-plan-contract-qty-check-design.md
  22. 115 0
      docs/superpowers/specs/2026-08-30-pl-plan-delivery-contract-products-design.md
  23. 1 1
      docs/superpowers/specs/2026-08-30-pl-plan-form-available-qty-design.md
  24. 1 1
      docs/superpowers/specs/2026-08-30-pl-plan-single-contract-products-design.md
  25. 3 3
      docs/web-admin-ui-spec-fresh-mint.md
  26. 22 22
      graphify-out/manifest.json
  27. 7 13
      web-admin/graphify-out/.graphify_labels.json
  28. 5 13
      web-admin/graphify-out/2026-08-30/.graphify_labels.json
  29. 219 235
      web-admin/graphify-out/2026-08-30/GRAPH_REPORT.md
  30. 112 112
      web-admin/graphify-out/2026-08-30/graph.json
  31. 227 257
      web-admin/graphify-out/GRAPH_REPORT.md
  32. 112 112
      web-admin/graphify-out/graph.json
  33. 69 12
      web-admin/src/components/business/pl-plan-delivery-section/index.vue
  34. 183 42
      web-admin/src/components/business/pl-plan-form-dialog/index.vue
  35. 2 2
      web-admin/src/components/core/layouts/art-menus/art-sidebar-menu/theme.scss
  36. 10 1
      web-admin/src/utils/pl-contract-qty-reminder.ts
  37. 23 0
      web-admin/src/utils/pl-plan-contract-product.ts
  38. 2 2
      web-admin/src/views/portal/home/index.vue

+ 1 - 1
backend/app.pid

@@ -1 +1 @@
-12414
+4878

+ 70 - 7
backend/app/services/pl_contract_plan_qty.py

@@ -69,15 +69,39 @@ def merge_product_qty_maps(
     return out
 
 
+# plan:计划数量;archive_actual:装货 inbound / 送货 outbound,null 回退 plan_qty
+QTY_MODE_PLAN = "plan"
+QTY_MODE_ARCHIVE_ACTUAL = "archive_actual"
+
+
+def _resolve_stop_product_qty(
+    row: Any,
+    *,
+    stop_kind: str,
+    qty_mode: str,
+) -> float:
+    """按模式解析段产品计入量。"""
+    if qty_mode == QTY_MODE_ARCHIVE_ACTUAL:
+        attr = "inbound_qty" if stop_kind == "load" else "outbound_qty"
+        raw = getattr(row, attr, None)
+        if raw is not None:
+            return _to_float(raw)
+        return _to_float(getattr(row, "plan_qty", None))
+    return _to_float(getattr(row, "plan_qty", None))
+
+
 def accumulate_stop_products(
     target: DefaultDict[str, float],
     products: Iterable[Any],
+    *,
+    stop_kind: str = "load",
+    qty_mode: str = QTY_MODE_PLAN,
 ) -> None:
     for row in products or []:
         pid = str(getattr(row, "product_id", None) or "").strip()
         if not pid:
             continue
-        qty = _to_float(getattr(row, "plan_qty", None))
+        qty = _resolve_stop_product_qty(row, stop_kind=stop_kind, qty_mode=qty_mode)
         if qty:
             target[pid] += qty
 
@@ -146,6 +170,7 @@ def sum_qtys_for_scope(
     all_load_ids: Set[str],
     all_delivery_ids: Set[str],
     scope: Dict[str, Any],
+    qty_mode: str = QTY_MODE_PLAN,
 ) -> Dict[str, float]:
     acc: DefaultDict[str, float] = defaultdict(float)
 
@@ -153,10 +178,20 @@ def sum_qtys_for_scope(
         # 遗留:优先送货段数量;无送货则用装货,避免装+送双计
         if all_delivery_ids:
             for did in all_delivery_ids:
-                accumulate_stop_products(acc, delivery_products_by_delivery.get(did, []))
+                accumulate_stop_products(
+                    acc,
+                    delivery_products_by_delivery.get(did, []),
+                    stop_kind="delivery",
+                    qty_mode=qty_mode,
+                )
         else:
             for lid in all_load_ids:
-                accumulate_stop_products(acc, load_products_by_load.get(lid, []))
+                accumulate_stop_products(
+                    acc,
+                    load_products_by_load.get(lid, []),
+                    stop_kind="load",
+                    qty_mode=qty_mode,
+                )
         return dict(acc)
 
     load_ids = scope.get("load_ids")
@@ -164,17 +199,37 @@ def sum_qtys_for_scope(
 
     if load_ids is None:
         for lid in all_load_ids:
-            accumulate_stop_products(acc, load_products_by_load.get(lid, []))
+            accumulate_stop_products(
+                acc,
+                load_products_by_load.get(lid, []),
+                stop_kind="load",
+                qty_mode=qty_mode,
+            )
     elif load_ids:
         for lid in load_ids:
-            accumulate_stop_products(acc, load_products_by_load.get(lid, []))
+            accumulate_stop_products(
+                acc,
+                load_products_by_load.get(lid, []),
+                stop_kind="load",
+                qty_mode=qty_mode,
+            )
 
     if delivery_ids is None:
         for did in all_delivery_ids:
-            accumulate_stop_products(acc, delivery_products_by_delivery.get(did, []))
+            accumulate_stop_products(
+                acc,
+                delivery_products_by_delivery.get(did, []),
+                stop_kind="delivery",
+                qty_mode=qty_mode,
+            )
     elif delivery_ids:
         for did in delivery_ids:
-            accumulate_stop_products(acc, delivery_products_by_delivery.get(did, []))
+            accumulate_stop_products(
+                acc,
+                delivery_products_by_delivery.get(did, []),
+                stop_kind="delivery",
+                qty_mode=qty_mode,
+            )
 
     return dict(acc)
 
@@ -297,12 +352,16 @@ def aggregate_contract_product_plan_qtys(
         )
         if not bucket:
             continue
+        qty_mode = (
+            QTY_MODE_ARCHIVE_ACTUAL if bucket == "archived" else QTY_MODE_PLAN
+        )
         qtys = sum_qtys_for_scope(
             load_products_by_load=load_products_by_load,
             delivery_products_by_delivery=delivery_products_by_delivery,
             all_load_ids=load_ids_by_plan.get(plan_id, set()),
             all_delivery_ids=delivery_ids_by_plan.get(plan_id, set()),
             scope=scope,
+            qty_mode=qty_mode,
         )
         target = archived if bucket == "archived" else arranged_unarchived
         for pid, qty in qtys.items():
@@ -995,12 +1054,16 @@ def get_contract_product_arrange_qty_detail(
             )
             if not bucket:
                 continue
+            qty_mode = (
+                QTY_MODE_ARCHIVE_ACTUAL if bucket == "archived" else QTY_MODE_PLAN
+            )
             qtys = sum_qtys_for_scope(
                 load_products_by_load=load_products_by_load,
                 delivery_products_by_delivery=delivery_products_by_delivery,
                 all_load_ids=load_ids_by_plan.get(plan_id, set()),
                 all_delivery_ids=delivery_ids_by_plan.get(plan_id, set()),
                 scope=scope,
+                qty_mode=qty_mode,
             )
             pq = _to_float(qtys.get(pid))
             if pq <= 0:

+ 50 - 17
backend/app/services/pl_plan_stop_service.py

@@ -480,17 +480,39 @@ def assert_at_most_one_contract(
     return links
 
 
-def _assert_product_rows_in_contract_allowed(products: Optional[list], allowed: set[str]) -> None:
+def _assert_product_rows_in_contract_allowed(
+    products: Optional[list],
+    allowed: set[str],
+    *,
+    row_label: str = "装货产品",
+) -> None:
     for prod in products or []:
         pid = str(getattr(prod, "product_id", None) or "").strip()
         name = (getattr(prod, "product_name", None) or pid or "未命名").strip()
         if not pid or pid not in allowed:
             raise HTTPException(
                 status_code=422,
-                detail=f"装货产品「{name}」不在所选合同明细中",
+                detail=f"{row_label}「{name}」不在所选合同明细中",
             )
 
 
+def _contract_allowed_product_ids(db: Session, tenant_no: str, contract_id: str) -> set[str]:
+    rows = (
+        db.query(CrmContractProduct)
+        .filter(
+            CrmContractProduct.contract_id == contract_id,
+            CrmContractProduct.tenant_no == tenant_no,
+            CrmContractProduct.del_flag == 0,
+        )
+        .all()
+    )
+    return {
+        str(r.product_id).strip()
+        for r in rows
+        if getattr(r, "product_id", None) and str(r.product_id).strip()
+    }
+
+
 def assert_load_products_in_selected_contract(
     db: Session,
     tenant_no: str,
@@ -505,22 +527,31 @@ def assert_load_products_in_selected_contract(
     contract_id = (links[0].contract_id or "").strip()
     if not contract_id:
         return
-    rows = (
-        db.query(CrmContractProduct)
-        .filter(
-            CrmContractProduct.contract_id == contract_id,
-            CrmContractProduct.tenant_no == tenant_no,
-            CrmContractProduct.del_flag == 0,
-        )
-        .all()
+    allowed = _contract_allowed_product_ids(db, tenant_no, contract_id)
+    _assert_product_rows_in_contract_allowed(load.products, allowed, row_label="装货产品")
+    _assert_product_rows_in_contract_allowed(plan_products, allowed, row_label="装货产品")
+
+
+def assert_delivery_products_in_selected_contract(
+    db: Session,
+    tenant_no: str,
+    delivery: PlanDeliveryBody,
+    seq: int,
+) -> None:
+    if is_internal_customer_name(delivery.customer_name):
+        return
+    links = _normalize_contract_links(delivery.contracts)
+    if not links:
+        return
+    contract_id = (links[0].contract_id or "").strip()
+    if not contract_id:
+        return
+    allowed = _contract_allowed_product_ids(db, tenant_no, contract_id)
+    _assert_product_rows_in_contract_allowed(
+        delivery.products,
+        allowed,
+        row_label=f"送货段#{seq}产品",
     )
-    allowed = {
-        str(r.product_id).strip()
-        for r in rows
-        if getattr(r, "product_id", None) and str(r.product_id).strip()
-    }
-    _assert_product_rows_in_contract_allowed(load.products, allowed)
-    _assert_product_rows_in_contract_allowed(plan_products, allowed)
 
 
 def _resolve_stop_contracts(
@@ -596,6 +627,8 @@ def validate_plan_stops_write(
 
     enrich_stop_addresses_from_library(db, tenant_no, load, resolved_deliveries)
     assert_load_products_in_selected_contract(db, tenant_no, load, plan_products=products)
+    for idx, delivery in enumerate(resolved_deliveries, start=1):
+        assert_delivery_products_in_selected_contract(db, tenant_no, delivery, idx)
     return load, resolved_deliveries
 
 

+ 6 - 5
backend/graphify-out/.graphify_labels.json

@@ -155,11 +155,12 @@
   "153": "web_login_rsa_public_key",
   "154": "redis_client.py",
   "155": "WechatMessageService",
-  "156": "_build_user_info_payload",
-  "157": "config.py",
-  "158": "CrmProduct",
-  "159": "get_client_ip",
-  "160": "context.py",
+  "156": "list_product_options",
+  "157": "datetime_parse.py",
+  "158": "create_from_quote",
+  "159": "web_login_rsa_public_key",
+  "160": "get_client_ip",
+  "161": "context.py",
   "162": ".to_tenant_user_dict",
   "166": "code:block1 (/iflytek/shanxia2.0/backend)",
   "173": "resolve_create_time_bounds",

+ 1 - 0
backend/graphify-out/2026-08-30/.graphify_labels.json

@@ -153,6 +153,7 @@
   "151": "Community 151",
   "152": "register_local_callback",
   "153": "web_login_rsa_public_key",
+  "154": "redis_client.py",
   "155": "WechatMessageService",
   "162": ".to_tenant_user_dict",
   "166": "code:block1 (/iflytek/shanxia2.0/backend)",

+ 240 - 235
backend/graphify-out/2026-08-30/GRAPH_REPORT.md

@@ -1,16 +1,16 @@
 # Graph Report - backend  (2026-08-30)
 
 ## Corpus Check
-- 367 files · ~259,524 words
+- 367 files · ~260,434 words
 - Verdict: corpus is large enough that graph structure adds value.
 
 ## Summary
-- 5302 nodes · 20051 edges · 187 communities (171 shown, 16 thin omitted)
-- Extraction: 95% EXTRACTED · 5% INFERRED · 0% AMBIGUOUS · INFERRED: 1025 edges (avg confidence: 0.52)
+- 5312 nodes · 20085 edges · 188 communities (172 shown, 16 thin omitted)
+- Extraction: 95% EXTRACTED · 5% INFERRED · 0% AMBIGUOUS · INFERRED: 1029 edges (avg confidence: 0.53)
 - Token cost: 0 input · 0 output
 
 ## Graph Freshness
-- Built from commit: `d3269969`
+- Built from commit: `19c5aaa8`
 - Run `git rev-parse HEAD` and compare to check if the graph is stale.
 - Run `graphify update .` after code changes (no API cost).
 
@@ -169,6 +169,7 @@
 - [[_COMMUNITY_Community 151|Community 151]]
 - [[_COMMUNITY_register_local_callback|register_local_callback]]
 - [[_COMMUNITY_web_login_rsa_public_key|web_login_rsa_public_key]]
+- [[_COMMUNITY_redis_client.py|redis_client.py]]
 - [[_COMMUNITY_WechatMessageService|WechatMessageService]]
 - [[_COMMUNITY_.to_tenant_user_dict|.to_tenant_user_dict]]
 - [[_COMMUNITY_codeblock1 (iflytekshanxia2.0backend)|code:block1 (/iflytek/shanxia2.0/backend)]]
@@ -195,8 +196,8 @@
 
 ## God Nodes (most connected - your core abstractions)
 1. `BaseModel` - 533 edges
-2. `get_tenant_no()` - 386 edges
-3. `DbUserContext` - 310 edges
+2. `get_tenant_no()` - 387 edges
+3. `DbUserContext` - 311 edges
 4. `success_response()` - 279 edges
 5. `error_response()` - 274 edges
 6. `generate_uuid()` - 216 edges
@@ -206,8 +207,6 @@
 10. `ExportValidationError` - 108 edges
 
 ## Surprising Connections (you probably didn't know these)
-- `BackfillRule` --uses--> `Settings`  [INFERRED]
-  scripts/migrate_crm_sys_oss.py → app/core/config.py
 - `MigrationStats` --uses--> `Settings`  [INFERRED]
   scripts/migrate_bx_data.py → app/core/config.py
 - `StepStats` --uses--> `Settings`  [INFERRED]
@@ -216,95 +215,97 @@
   scripts/migrate_crm_clue.py → app/core/config.py
 - `StepStats` --uses--> `Settings`  [INFERRED]
   scripts/migrate_crm_clue.py → app/core/config.py
+- `MigrationStats` --uses--> `Settings`  [INFERRED]
+  scripts/migrate_crm_contract.py → app/core/config.py
 
 ## Import Cycles
 - None detected.
 
-## Communities (187 total, 16 thin omitted)
+## Communities (188 total, 16 thin omitted)
 
 ### Community 0 - "Community 0"
-Cohesion: 0.09
-Nodes (67): archive_plan(), archive_plan_draft(), get_plan(), PlPlan, PlPlanProduct, 计划产品明细表 pl_plan_product, PlanArchiveFeedbacksBlock, PlanArchiveFreightBlock (+59 more)
+Cohesion: 0.07
+Nodes (86): archive_plan(), archive_plan_draft(), create_from_contract(), _determine_plan_type(), get_plan(), update_plan_driver_feedback(), update_plan_site_feedback(), PlPlan (+78 more)
 
 ### Community 1 - "Community 1"
 Cohesion: 0.08
-Nodes (33): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, ContractApproverSettingSaveBody, ContractApprovalActionBody, ContractBatchAssignBody, ContractBatchSubmitBody, ContractChangeCreateBody, ContractChangeUpdateBody, ContractCreateBody (+25 more)
+Nodes (38): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, 接口菜单权限守卫。super_admin 直接放行。, require_menu_code(), ContractApproverSettingSaveBody, ContractApprovalActionBody, ContractApprovalPassBody, ContractApprovalRejectBody, ContractApprovalTransferBody (+30 more)
 
 ### Community 2 - "Community 2"
-Cohesion: 0.11
-Nodes (34): ReimburseDetailOut, filter_current_cycle_approvals(), 审批轮次过滤 — 驳回后重新提交时,进度接口仅展示当前轮次。, 审批进度仅展示当前轮次;完整历史由 get_approval_history 返回。, allocate_reimburse_title_seq(), format_reimburse_title(), generate_apply_code(), generate_title() (+26 more)
+Cohesion: 0.18
+Nodes (21): allocate_reimburse_title_seq(), format_reimburse_title(), generate_apply_code(), generate_title(), is_auto_reimburse_title(), parse_optional_date(), parse_reimburse_date(), preview_reimburse_title_seq() (+13 more)
 
 ### Community 3 - "Community 3"
-Cohesion: 0.06
-Nodes (116): attachment_download_url(), attachment_preview_url(), create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite(), create_post() (+108 more)
+Cohesion: 0.07
+Nodes (99): attachment_download_url(), attachment_preview_url(), create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite(), create_post() (+91 more)
 
 ### Community 4 - "Community 4"
-Cohesion: 0.09
-Nodes (76): _apply_list_filters(), assign_opportunities(), batch_update_expect_date(), batch_update_stage(), change_stage(), create_opportunity(), _decimal_value(), _enrich_user_names() (+68 more)
+Cohesion: 0.12
+Nodes (61): _apply_list_filters(), assign_opportunities(), batch_update_expect_date(), batch_update_stage(), change_stage(), create_opportunity(), _decimal_value(), _enrich_user_names() (+53 more)
 
 ### Community 5 - "Community 5"
-Cohesion: 0.18
-Nodes (22): _assert_users_exist(), get_setting(), Any, Session, _row_to_dict(), save_setting(), _assert_users_exist(), get_setting() (+14 more)
+Cohesion: 0.20
+Nodes (21): _assert_users_exist(), get_setting(), Any, Session, _row_to_dict(), save_setting(), _assert_users_exist(), get_setting() (+13 more)
 
 ### Community 6 - "Community 6"
-Cohesion: 0.10
-Nodes (51): customer_create(), customer_update(), follow_by_customer(), follow_detail(), assign_customer(), batch_claim_customers(), check_duplicate_customer(), claim_customer() (+43 more)
+Cohesion: 0.11
+Nodes (50): assign_customer(), batch_claim_customers(), check_duplicate_customer(), claim_customer(), create_customer(), customer_name_exists(), deal_customer(), _enrich_user_names() (+42 more)
 
 ### Community 7 - "Community 7"
-Cohesion: 0.08
-Nodes (53): accumulate_stop_products(), aggregate_contract_product_plan_qtys(), assert_contract_qty_for_arrange(), auto_start_execute_approved_contracts(), _bucket_for_plan(), build_contract_qty_reminder_payload(), collect_plan_contract_qty_checks(), contract_ids_linked_to_plan() (+45 more)
+Cohesion: 0.07
+Nodes (61): accumulate_stop_products(), aggregate_contract_product_plan_qtys(), assert_contract_qty_for_arrange(), auto_start_execute_approved_contracts(), _bucket_for_plan(), build_contract_qty_reminder_payload(), collect_plan_contract_qty_checks(), contract_ids_linked_to_plan() (+53 more)
 
 ### Community 8 - "Community 8"
-Cohesion: 0.11
-Nodes (32): approve_quote(), can_user_approve(), create_approval_records(), delete_pending_approvals(), get_quote_approval(), invalidate_all_approvals(), list_quote_approvals(), Any (+24 more)
+Cohesion: 0.10
+Nodes (34): invalidate_all_approvals(), 作废该合同全部有效审批记录(含已通过/已拒绝),用于再编辑或重新提审。, approve_quote(), can_user_approve(), create_approval_records(), delete_pending_approvals(), get_quote_approval(), invalidate_all_approvals() (+26 more)
 
 ### Community 9 - "Community 9"
 Cohesion: 0.09
 Nodes (53): download_reimburse_import_template(), clue_import_template(), customer_import_template(), product_import_template(), build_annotated_result_bytes(), build_applicant_label(), build_expense_path_labels(), build_import_template_bytes() (+45 more)
 
 ### Community 10 - "Community 10"
-Cohesion: 0.18
-Nodes (28): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), export_settlements(), export_unsettled_plans(), _generate_settlement_no() (+20 more)
+Cohesion: 0.05
+Nodes (105): PageResult, ResponseModel, BaseModel, CarrierAuditReject, CarrierBase, CarrierCreate, CarrierListResponse, CarrierQualificationBase (+97 more)
 
 ### Community 11 - "Community 11"
-Cohesion: 0.10
-Nodes (58): cancel_apply(), create_apply(), create_disburse(), delete_applies(), delete_disburses(), export_urea_applies(), export_urea_disburse_board(), get_apply() (+50 more)
+Cohesion: 0.15
+Nodes (40): PlVehicleUreaApply, PlVehicleUreaDisburse, 车辆尿素申请 pl_vehicle_urea_apply, 车辆尿素发放登记 pl_vehicle_urea_disburse, Decimal, VehicleUreaApplyCreate, VehicleUreaApplyRead, VehicleUreaApplyUpdate (+32 more)
 
 ### Community 12 - "Community 12"
-Cohesion: 0.04
-Nodes (84): PageResult, ResponseModel, BaseModel, AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest, LoginResponse (+76 more)
+Cohesion: 0.06
+Nodes (46): create_leave(), AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest, LoginResponse, Pydantic schemas - 用户认证, ResetPasswordRequest (+38 more)
 
 ### Community 13 - "Community 13"
-Cohesion: 0.17
-Nodes (21): compute_contract_gap_sides(), _delivery_stop_gap_expr(), _demander_gap_expr(), _legacy_demander_gap_expr(), _legacy_supplier_gap_expr(), list_plan_contract_gaps(), _load_stop_gap_expr(), plan_has_contract_gap_exists() (+13 more)
+Cohesion: 0.07
+Nodes (84): clue_check_convert(), clue_check_duplicate(), clue_detail(), clue_export(), clue_follow_detail(), clue_follow_statistics(), clue_import(), clue_list() (+76 more)
 
 ### Community 14 - "Community 14"
-Cohesion: 0.16
-Nodes (36): PlTransportDriverStopFeedback, PlTransportSiteStopFeedback, 运输单-司机按段附件回传 pl_transport_driver_stop_feedback, 运输单-现场按段回传 pl_transport_site_stop_feedback, _direction_label(), _dump_product_feedbacks(), _dump_urls(), _get_driver_feedback_row() (+28 more)
+Cohesion: 0.07
+Nodes (75): PlPlanDelivery, PlPlanDeliveryProduct, PlPlanLoad, PlPlanLoadProduct, PlTransportDriverStopFeedback, PlTransportSiteStopFeedback, 运输计划-装货段 pl_plan_load(plan 1:1), 运输计划-装货段产品明细 pl_plan_load_product (+67 more)
 
 ### Community 15 - "Community 15"
-Cohesion: 0.12
-Nodes (15): BxReimburseApply, BxReimburseApproval, BxReimburseDetail, BxReimburseInvoice, BxReimburseOffset, 报销单勾选的发票附件(同一发票可勾选多个附件,各占一条)。, ReimburseInvoiceBriefOut, ReimburseInvoiceLinkIn (+7 more)
+Cohesion: 0.09
+Nodes (28): BxReimburseApply, BxReimburseApproval, BxReimburseDetail, BxReimburseInvoice, BxReimburseOffset, BxWorkflowNode, 报销(bx)模块数据模型 — 对齐 docs/sql/20260606_bx_tables.sql, 报销单勾选的发票附件(同一发票可勾选多个附件,各占一条)。 (+20 more)
 
 ### Community 16 - "Community 16"
-Cohesion: 0.12
-Nodes (17): ApiRequestLogCRUD, Session, list_ethnics(), Any, Session, 民族码表 CRUD(全局 sys_ethnic), _row_to_dict(), SoftDeleteModel (+9 more)
+Cohesion: 0.36
+Nodes (7): list_ethnics(), Any, Session, 民族码表 CRUD(全局 sys_ethnic), _row_to_dict(), 民族码表 sys_ethnic(国标 GB/T 3304,全局), SysEthnic
 
 ### Community 17 - "Community 17"
-Cohesion: 0.06
-Nodes (84): approve_carrier(), create_carrier(), create_driver(), create_personnel(), create_vehicle(), delete_carrier(), delete_driver(), delete_personnel() (+76 more)
+Cohesion: 0.30
+Nodes (12): PlCarrier, assert_carrier_eligible_for_transport(), carrier_agreement_expired(), carrier_audit_approved(), carrier_eligible_for_transport(), carrier_qualification_complete(), date, 资质附件均为选填,保留函数签名供兼容调用。 (+4 more)
 
 ### Community 18 - "Community 18"
-Cohesion: 0.14
-Nodes (38): bx_health(), 报销(bx)API 路由聚合 — REST 风格,协议对齐 bx 原系统。, P0 健康检查:验证 bx 路由已挂载且响应协议为 code=0。, approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse() (+30 more)
+Cohesion: 0.11
+Nodes (41): approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse(), export_approved_by_me_reimburses(), export_my_reimburses(), export_pending_approval_reimburses() (+33 more)
 
 ### Community 19 - "Community 19"
-Cohesion: 0.14
-Nodes (36): _apply_plan_product_update(), _apply_plan_update(), AutoGenerateMonthlyResult, _base_query(), create_plan(), delete_plan(), export_plans(), _generate_plan_no() (+28 more)
+Cohesion: 0.24
+Nodes (12): get_last_month_range(), month_range(), date, Session, 地磅计划按月自动生成 — 迁移自 simple-dibang-xiaoshou/auto-create-plan/auto_create_monthly_pla, 按月自动生成采购计划。      - 默认仅在每月 1 日执行(force=True 时跳过该限制,供手动触发验收)     - 遍历所有租户,按上月计划模板生, run_auto_generate_monthly_plans(), default_execution_status() (+4 more)
 
 ### Community 20 - "Community 20"
-Cohesion: 0.10
-Nodes (42): dump_export_row(), issue_status_label(), Any, Session, respond_xlsx(), status_label(), advance_issue_stats(), batch_offset() (+34 more)
+Cohesion: 0.16
+Nodes (32): advance_issue_stats(), batch_offset(), export_advance_issues(), export_advance_issues_xlsx(), export_pending_payments(), export_processed_payments(), issue_advance(), list_advance_issues() (+24 more)
 
 ### Community 21 - "Community 21"
 Cohesion: 0.14
@@ -315,8 +316,8 @@ Cohesion: 0.08
 Nodes (28): parse_admin_request_json(), Any, Request, 运营 Web(/web/admin)JSON 请求体解析。  与 ApiCryptoMiddleware 配合:中间件未改写 body 时,在路由内解密 `{, 读取 JSON body;dict 时走 resolve_request_payload(明文 / 密文 / data 包装)。      Returns:, ApiCryptoError, _b64url_decode(), _b64url_encode() (+20 more)
 
 ### Community 23 - "Community 23"
-Cohesion: 0.17
-Nodes (24): PlPlanProductBrandQty, 计划产品归档品牌数量 pl_plan_product_brand_qty      stop_product_id 为空:计划产品级汇总;非空:装货/送货段产品, _is_plan_level_row(), load_brand_qtys_by_plan_product_ids(), load_brand_qtys_by_stop_product_ids(), _parse_unit_price(), persist_plan_product_brand_qtys(), persist_stop_product_brand_qtys() (+16 more)
+Cohesion: 0.29
+Nodes (16): PlPlanProductBrandQty, 计划产品归档品牌数量 pl_plan_product_brand_qty      stop_product_id 为空:计划产品级汇总;非空:装货/送货段产品, _is_plan_level_row(), load_brand_qtys_by_plan_product_ids(), load_brand_qtys_by_stop_product_ids(), _parse_unit_price(), persist_plan_product_brand_qtys(), persist_stop_product_brand_qtys() (+8 more)
 
 ### Community 24 - "Community 24"
 Cohesion: 0.19
@@ -327,136 +328,136 @@ Cohesion: 0.26
 Nodes (12): list_share_logs(), _parse_user_agent(), Any, Session, CRM 报价单分享访问日志 CRUD — 对照 CrmQuoteShareLogServiceImpl.java, Java: statisticsVisits, 简易 User-Agent 解析(替代 Hutool UserAgentUtil), Java: queryLogsByQuoteId (+4 more)
 
 ### Community 26 - "Community 26"
-Cohesion: 0.18
-Nodes (31): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), legacy_parent_id(), load_oss_id_to_url(), load_runtime_settings() (+23 more)
+Cohesion: 0.10
+Nodes (18): customer_create(), customer_delete(), customer_options(), customer_update(), 客户下拉选项(租户内只读,不做 owner 数据权限), CustomerAssignPoolBody, CustomerCheckDuplicateBody, CustomerClaimBody (+10 more)
 
 ### Community 27 - "Community 27"
-Cohesion: 0.18
-Nodes (29): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_oss_id_to_url(), load_runtime_settings(), load_settings_env() (+21 more)
+Cohesion: 0.20
+Nodes (20): create_personnel(), list_personnel(), list_vehicles(), _personnel_to_detail(), _personnel_to_read(), update_personnel(), PlCert, CertRead (+12 more)
 
 ### Community 28 - "Community 28"
-Cohesion: 0.09
-Nodes (63): PlFreightSettlement, PlFreightSettlementApproval, PlFreightSettlementTransport, PlRemittanceVoucher, 运费结算表 pl_freight_settlement, 运费结算审批 pl_freight_settlement_approval, 结算单-运输关联表 pl_freight_settlement_transport, 汇款凭证表 pl_remittance_voucher (+55 more)
+Cohesion: 0.10
+Nodes (59): PlFreightSettlement, PlFreightSettlementApproval, PlFreightSettlementTransport, PlRemittanceVoucher, 运费结算表 pl_freight_settlement, 运费结算审批 pl_freight_settlement_approval, 结算单-运输关联表 pl_freight_settlement_transport, 汇款凭证表 pl_remittance_voucher (+51 more)
 
 ### Community 29 - "Community 29"
-Cohesion: 0.10
-Nodes (50): assert_quote_editable_for_update(), _build_quote_filters(), calculate_quote_amount(), create_new_version(), create_quote(), _decimal_value(), _enrich_contact_fields(), _enrich_supplier_name() (+42 more)
+Cohesion: 0.09
+Nodes (70): register_quote_routes(), create_from_quote(), _quote_products_to_contract_products(), Java: createFromQuote — 返回合同 id, accept_quote(), assert_quote_editable_for_update(), _build_quote_filters(), calculate_quote_amount() (+62 more)
 
 ### Community 30 - "Community 30"
 Cohesion: 0.16
 Nodes (26): clear_target_categories(), compute_level(), count_target_rows(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_runtime_settings() (+18 more)
 
 ### Community 31 - "Community 31"
-Cohesion: 0.16
-Nodes (30): _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), export_weighing(), _get_weighing(), get_weighing_related() (+22 more)
+Cohesion: 0.05
+Nodes (121): _apply_inventory_product_update(), _apply_inventory_update(), _base_query(), create_inventory(), create_link_for_plan(), delete_inventory(), export_inventory(), _generate_batch_no() (+113 more)
 
 ### Community 32 - "Community 32"
-Cohesion: 0.15
-Nodes (27): 验证密码(哈希非 bcrypt 或损坏时返回 False,避免抛错), verify_password(), change_password(), create_user(), get_user(), get_user_with_relations(), _hash_password(), list_post_ids_for_user() (+19 more)
+Cohesion: 0.19
+Nodes (23): change_password(), create_user(), get_user(), get_user_with_relations(), _hash_password(), list_post_ids_for_user(), list_user_ids_bound_to_post(), list_users() (+15 more)
 
 ### Community 33 - "Community 33"
-Cohesion: 0.10
-Nodes (36): contact_add(), contact_birthday(), contact_by_customer(), contact_decision(), contact_delete(), contact_detail(), contact_export(), contact_list() (+28 more)
+Cohesion: 0.15
+Nodes (32): create_contact(), get_contact(), list_contacts_by_customer(), _parse_optional_date(), Any, date, Session, _row_to_dict() (+24 more)
 
 ### Community 34 - "Community 34"
-Cohesion: 0.16
-Nodes (20): create_workflow(), delete_workflow(), get_workflow(), get_workflow_by_biz_type(), list_workflows(), Session, save_workflow_nodes(), update_workflow() (+12 more)
+Cohesion: 0.14
+Nodes (24): create_workflow(), delete_workflow(), get_workflow(), get_workflow_by_biz_type(), list_workflows(), Session, save_workflow_nodes(), update_workflow() (+16 more)
 
 ### Community 35 - "Community 35"
 Cohesion: 0.18
 Nodes (36): clear_portal_workflow(), _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_bx_user_mapping(), load_runtime_settings() (+28 more)
 
 ### Community 36 - "Community 36"
-Cohesion: 0.17
-Nodes (29): _assert_brand_deletable(), barcode_exists(), category_code_exists(), create_category(), create_product(), generate_auto_product_no(), generate_barcode(), generate_product_no() (+21 more)
+Cohesion: 0.08
+Nodes (61): _alias_row_to_dict(), _assert_brand_deletable(), barcode_exists(), _brand_row_to_dict(), _build_category_tree(), category_code_exists(), _category_row_to_dict(), _collect_category_with_ancestors() (+53 more)
 
 ### Community 37 - "Community 37"
-Cohesion: 0.11
+Cohesion: 0.10
 Nodes (44): check_document_expiry(), document_reminder_stats(), DocumentReminderExportBody, export_document_reminders(), export_inventory_ledger(), get_inventory_ledger(), get_summary(), InventoryLedgerExportBody (+36 more)
 
 ### Community 38 - "Community 38"
-Cohesion: 0.31
-Nodes (9): decrypt_login_payload(), ensure_initialized(), extract_login_credentials(), get_public_pem(), Any, 登录凭据 RSA 解密(与前端 JSEncrypt PKCS#1 v1.5 兼容)。, Base64 密文 -> JSON 对象(须含 username、password、ts 毫秒时间戳)。, 从请求体解析用户名、密码。     返回 (username, password, error_message);error_message 非空时表示失败。 (+1 more)
+Cohesion: 0.18
+Nodes (11): Config, decrypt_login_payload(), ensure_initialized(), extract_login_credentials(), get_public_pem(), Any, 登录凭据 RSA 解密(与前端 JSEncrypt PKCS#1 v1.5 兼容)。, Base64 密文 -> JSON 对象(须含 username、password、ts 毫秒时间戳)。 (+3 more)
 
 ### Community 39 - "Community 39"
-Cohesion: 0.09
-Nodes (31): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+23 more)
+Cohesion: 0.11
+Nodes (25): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+17 more)
 
 ### Community 40 - "Community 40"
-Cohesion: 0.05
-Nodes (89): generate_id(), camel_to_snake(), CRUDBase, get_model_attr(), HistoryCRUD, Any, Session, DutyAssignment (+81 more)
+Cohesion: 0.13
+Nodes (27): assert_user_is_duty_staff(), build_dict_value_from_label(), DutyBizError, ensure_dict_data(), grab(), normalize_person_name(), _pad_hhmm(), parse_time_range_input() (+19 more)
 
 ### Community 41 - "Community 41"
 Cohesion: 0.22
 Nodes (27): export_inbound(), _export_orders(), export_outbound(), _get_by_plan(), get_inbound(), get_inbound_by_plan(), _get_order(), get_outbound() (+19 more)
 
 ### Community 42 - "Community 42"
-Cohesion: 0.19
-Nodes (32): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_oss_id_to_url(), load_runtime_settings(), load_settings_env() (+24 more)
+Cohesion: 0.05
+Nodes (103): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_oss_id_to_url(), load_runtime_settings(), load_settings_env() (+95 more)
 
 ### Community 43 - "Community 43"
 Cohesion: 0.09
-Nodes (36): BxExportBodyBase, create_invoice(), delete_invoice(), export_invoice_wallets(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices() (+28 more)
+Nodes (35): create_invoice(), delete_invoice(), export_invoice_wallets(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices(), Request (+27 more)
 
 ### Community 44 - "Community 44"
-Cohesion: 0.19
-Nodes (28): apply_biz_backfill(), BackfillRule, BizRef, build_biz_index(), count_target_rows(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows() (+20 more)
+Cohesion: 0.20
+Nodes (27): apply_biz_backfill(), BizRef, build_biz_index(), count_target_rows(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str() (+19 more)
 
 ### Community 45 - "Community 45"
-Cohesion: 0.26
-Nodes (52): AttachmentDownloadUrlBody, demo_xlsx_export(), DemoXlsxColumnSpec, DemoXlsxExportBody, DeptCreateBody, DeptExportBody, DeptUpdateBody, DictDataCreateBody (+44 more)
+Cohesion: 0.23
+Nodes (53): AttachmentDownloadUrlBody, demo_xlsx_export(), DemoXlsxColumnSpec, DemoXlsxExportBody, DeptCreateBody, DeptExportBody, DeptUpdateBody, DictDataCreateBody (+45 more)
 
 ### Community 46 - "Community 46"
-Cohesion: 0.10
-Nodes (30): PlPlanChange, PlPlanDelivery, PlPlanDeliveryProduct, PlPlanLoad, PlPlanLoadProduct, 计划变更记录表 pl_plan_change, 运输计划-装货段 pl_plan_load(plan 1:1), 运输计划-装货段产品明细 pl_plan_load_product (+22 more)
+Cohesion: 0.46
+Nodes (7): 计划保存后按当前段次/计划日期回写可编辑出入库单日期;跨月则改挂月计划。      不可回写时不抛错,返回 warnings。, sync_linked_dibang_dates_for_plan(), _make_query_router(), 计划保存时同步地磅出入库日期 — 单元测试, test_sync_cross_month_repoints_purchase_plan(), test_sync_same_month_updates_inventory_date_only(), test_sync_skips_when_weighing_exists()
 
 ### Community 47 - "Community 47"
-Cohesion: 0.12
-Nodes (32): cancel_apply(), create_apply(), create_record(), delete_applies(), delete_records(), export_recharge_applies(), export_recharge_disburse_board(), get_apply() (+24 more)
+Cohesion: 0.08
+Nodes (67): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), export_settlements(), export_unsettled_plans(), _generate_settlement_no() (+59 more)
 
 ### Community 48 - "Community 48"
-Cohesion: 0.07
-Nodes (101): register_contract_routes(), _apply_contract_entity_fields(), batch_assign_owner(), batch_submit_contract_approval(), _build_contract_filters(), _build_contract_name_from_parties(), _build_customer_address(), _calc_amount_with_tax() (+93 more)
+Cohesion: 0.08
+Nodes (81): register_contract_routes(), _apply_contract_entity_fields(), batch_assign_owner(), batch_submit_contract_approval(), _build_contract_filters(), _build_contract_name_from_parties(), _build_customer_address(), _calc_amount_with_tax() (+73 more)
 
 ### Community 49 - "Community 49"
-Cohesion: 0.10
-Nodes (28): _attach_history_products(), _build_history_page(), _build_page(), _get_by_token(), _history_status_label(), _models(), _parse_history_date(), date (+20 more)
+Cohesion: 0.12
+Nodes (27): _attach_history_products(), _build_history_page(), _build_page(), _get_by_token(), _history_status_label(), _models(), _parse_history_date(), date (+19 more)
 
 ### Community 50 - "Community 50"
-Cohesion: 0.12
-Nodes (44): apply_stop_dibang_options(), _create_db_inventory(), _create_db_plan(), _delivery_stop_products(), DibangInventoryLinkResult, _direction_to_business_type(), _ensure_monthly_db_plan_for_inventory(), find_monthly_db_plan() (+36 more)
+Cohesion: 0.17
+Nodes (33): apply_stop_dibang_options(), _create_db_inventory(), _create_db_plan(), _delivery_stop_products(), DibangInventoryLinkResult, _direction_to_business_type(), _ensure_monthly_db_plan_for_inventory(), find_monthly_db_plan() (+25 more)
 
 ### Community 51 - "Community 51"
 Cohesion: 0.22
 Nodes (21): _address_to_read(), _build_address_query(), create_transport_address(), delete_transport_address(), export_transport_addresses(), _get_address(), get_transport_address(), list_all_transport_addresses() (+13 more)
 
 ### Community 52 - "Community 52"
-Cohesion: 0.12
-Nodes (32): _build_public_page(), _build_site_product_read(), _format_file_size(), get_public_site(), _get_site_link_by_token(), _parse_feedback_images(), Session, UploadFile (+24 more)
+Cohesion: 0.28
+Nodes (14): _assert_editable(), _build_public_page(), _format_file_size(), _get_inventory_by_token(), get_public_inventory(), _parse_feedback_images(), Session, UploadFile (+6 more)
 
 ### Community 53 - "Community 53"
-Cohesion: 0.09
-Nodes (26): _build_driver_url(), get_plan_arrange_info(), 获取计划已安排运输后的司机链接与地磅出入库关联(供查看弹窗复制简述/二维码)。, TransportSiteLinkRead, plan_has_load_stop(), plan_requires_site_link(), Session, 运输计划:内置山峡/云栋客户判定(合同可免) (+18 more)
+Cohesion: 0.20
+Nodes (7): _FakeQuery, _FakeSession, _plan(), 现场链接生成条件:装货/送货段含山峡或云栋客户, test_external_stops_do_not_require_site_link(), test_internal_delivery_requires_site_link(), test_legacy_plan_customer_fallback()
 
 ### Community 54 - "Community 54"
-Cohesion: 0.14
-Nodes (27): PlTransportDbLink, 运输-地磅出入库关联 pl_transport_db_link, _apply_plan_quantity_delta(), 装货段地磅往来单位取第一个送货客户;送货段取装货客户。, 再次勾选地磅安排前:软删本运输单此前生成的、仍可作废的出入库单及关联。      - 不删除地磅月计划(可能被其他业务复用)     - 若出入库单已完成的/已, 计划保存后按当前段次/计划日期回写可编辑出入库单日期;跨月则改挂月计划。      不可回写时不抛错,返回 warnings。, _resolve_link_contributed_qty(), resolve_stop_dibang_partner() (+19 more)
+Cohesion: 0.15
+Nodes (34): CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), _change_row_to_dict(), create_contract_change(), create_contract_template(), _enrich_change_rows(), execute_change(), export_contract_changes() (+26 more)
 
 ### Community 55 - "Community 55"
-Cohesion: 0.11
-Nodes (18): ApiCryptoMiddleware, ApiRequestLogMiddleware, _db_pool_keepalive_loop(), _error_json(), lifespan(), Exception, Request, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误 (+10 more)
+Cohesion: 0.12
+Nodes (15): _db_pool_keepalive_loop(), _error_json(), lifespan(), Exception, Request, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误, 未捕获异常:统一 JSON 500,确保跨域场景下仍有 Access-Control-Allow-Origin, 定期 ping MySQL,避免远程库/NAT 回收空闲 TCP 后首请求长时间卡住。 (+7 more)
 
 ### Community 56 - "Community 56"
-Cohesion: 0.08
-Nodes (67): _as_date(), _build_driver_url(), _build_history_stop_reads(), _build_public_page(), _build_stop_product_reads(), _format_file_size(), _format_plan_date(), get_public_transport() (+59 more)
+Cohesion: 0.05
+Nodes (92): _build_public_page(), _build_site_product_read(), _format_file_size(), get_public_site(), _get_site_link_by_token(), _parse_feedback_images(), Session, UploadFile (+84 more)
 
 ### Community 57 - "Community 57"
 Cohesion: 0.21
 Nodes (22): clear_target_products(), count_target_rows(), _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_runtime_settings() (+14 more)
 
 ### Community 58 - "Community 58"
-Cohesion: 0.13
-Nodes (20): create_expense_item(), delete_expense_item(), ExpenseItemExportBody, export_expense_items(), _flatten_expense_tree(), get_expense_item(), get_expense_item_tree(), Session (+12 more)
+Cohesion: 0.14
+Nodes (21): create_expense_item(), delete_expense_item(), ExpenseItemExportBody, export_expense_items(), _flatten_expense_tree(), get_expense_item(), get_expense_item_tree(), Session (+13 more)
 
 ### Community 59 - "Community 59"
 Cohesion: 0.20
@@ -467,28 +468,28 @@ Cohesion: 0.19
 Nodes (7): _guess_preview_content_type(), MinIOStorage, Any, 从 MINIO_BASE_URL 解析公网 endpoint;未配置或与内网相同时复用 self.client。, 按对象键后缀推断内联预览 Content-Type(纠正上传时未写入 MIME 的情况)。, MinIO 预签名下载 URL,携带原始文件名。, MinIO 预签名内联预览 URL(图片新标签页 / PDF iframe 等)。          上传时 put_object 未写 content_typ
 
 ### Community 61 - "Community 61"
-Cohesion: 0.12
-Nodes (19): calc_age_from_chinese_id_card(), date, 从 18 位身份证号计算周岁。号码不完整或出生日期无效时返回 None。, 按 18 位身份证号重算 pl_personnel.age,仅更新算出值与库中不一致的记录。返回更新条数。, refresh_personnel_ages_from_id_card(), check_customer_protect_time(), pool_recovery_job(), Session (+11 more)
+Cohesion: 0.10
+Nodes (27): get_current_time(), parse_datetime(), datetime, get_pool_record(), list_pool_records(), Any, Session, _row_to_dict() (+19 more)
 
 ### Community 62 - "Community 62"
-Cohesion: 0.13
-Nodes (22): _alias_row_to_dict(), _brand_row_to_dict(), _build_category_tree(), _category_row_to_dict(), _collect_category_with_ancestors(), get_product_by_no(), list_categories(), list_category_tree() (+14 more)
+Cohesion: 0.12
+Nodes (16): 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方详情 — Java: CrmSupplierInfoController.getInfo, 新增供方 — Java: CrmSupplierInfoController.add, 修改供方 — Java: CrmSupplierInfoController.edit, 删除供方 — Java: CrmSupplierInfoController.remove, supplier_info_add(), supplier_info_delete(), supplier_info_detail() (+8 more)
 
 ### Community 63 - "Community 63"
-Cohesion: 0.09
-Nodes (59): create_plan_full(), 创建运输计划(完整表单:供方/需方 + 产品库产品 + 可选预选车辆,不自动安排运输), update_plan(), PlPlanContract, 运输计划-合同关联(分侧多选) pl_plan_contract, PlanContractLink, PlanDeliveryBody, PlanLoadBody (+51 more)
+Cohesion: 0.19
+Nodes (14): parse_resource_snapshot(), Any, 运输计划 - 安排运输时车辆/人员/证件资源快照 Schema, 从 ORM 文本列或 dict 解析快照。, SnapshotCertRead, SnapshotPersonnelRow, TransportResourceSnapshot, build_personnel_summary() (+6 more)
 
 ### Community 64 - "Community 64"
-Cohesion: 0.15
-Nodes (34): bind_vehicle_driver(), CarrierExportBody, DriverExportBody, paste_recognize_commit(), PersonnelExportBody, VehicleExportBody, generate_uuid(), PlPersonnel (+26 more)
+Cohesion: 0.19
+Nodes (26): bind_vehicle_driver(), CarrierExportBody, DriverExportBody, get_personnel(), paste_recognize_commit(), PersonnelExportBody, VehicleExportBody, PlPersonnel (+18 more)
 
 ### Community 65 - "Community 65"
-Cohesion: 0.09
-Nodes (63): cancel_apply(), create_apply(), create_process(), delete_applies(), delete_processes(), export_applies(), export_process_board(), get_apply() (+55 more)
+Cohesion: 0.15
+Nodes (42): PlVehicleMaintenanceApply, PlVehicleMaintenanceProcess, 车辆维保申请 pl_vehicle_maintenance_apply, 车辆维保处理登记 pl_vehicle_maintenance_process, Decimal, VehicleMaintenanceApplyCreate, VehicleMaintenanceApplyRead, VehicleMaintenanceApplyReminder (+34 more)
 
 ### Community 66 - "Community 66"
-Cohesion: 0.07
-Nodes (39): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), operlog_detail() (+31 more)
+Cohesion: 0.05
+Nodes (53): 地磅 API 路由聚合 — REST 风格,协议对齐原 simple-dibang-xiaoshou。, list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), API 路由包 — 山峡化工生产一体化门户, export_leaves() (+45 more)
 
 ### Community 67 - "Community 67"
 Cohesion: 0.12
@@ -499,8 +500,8 @@ Cohesion: 0.13
 Nodes (29): _actor_ids(), _actor_names(), assert_row_deletable_by_creator(), assert_rows_deletable_by_creator(), can_delete_by_creator(), is_super_admin(), normalize_user_info(), Any (+21 more)
 
 ### Community 69 - "Community 69"
-Cohesion: 0.16
-Nodes (18): PlInboundOrder, PlOutboundOrder, 运输计划-入库单 pl_inbound_order, 运输计划-出库单 pl_outbound_order, PlanArrangeCopyFlags, 运输计划列表:批量计算「复制给司机 / 现场 / 磅单二维码」按钮显示标志。  语义与查看弹窗 / usePlPlanArrangeActions / buil, load_plan_document_attachments_by_plan_ids(), _parse_image_urls() (+10 more)
+Cohesion: 0.15
+Nodes (20): PlInboundOrder, PlOutboundOrder, 运输计划-入库单 pl_inbound_order, 运输计划-出库单 pl_outbound_order, load_plan_arrange_copy_flags(), PlanArrangeCopyFlags, Session, 运输计划列表:批量计算「复制给司机 / 现场 / 磅单二维码」按钮显示标志。  语义与查看弹窗 / usePlPlanArrangeActions / buil (+12 more)
 
 ### Community 70 - "Community 70"
 Cohesion: 0.14
@@ -511,52 +512,52 @@ Cohesion: 0.25
 Nodes (18): batch_generate_sample_codes(), batch_issue_sample_codes(), batch_revoke_sample_codes(), create_sample_code(), get_sample_code(), list_sample_codes(), _parse_issued_time(), Any (+10 more)
 
 ### Community 72 - "Community 72"
-Cohesion: 0.67
-Nodes (3): format_api_error_message(), Exception, 将 HTTP/SQLAlchemy 等异常转为可展示的错误文案(避免 str([]) 空列表)。
+Cohesion: 0.29
+Nodes (15): create_price_letter(), get_price_letter(), list_price_letters(), _parse_date(), Any, date, Session, _row_to_dict() (+7 more)
 
 ### Community 73 - "Community 73"
 Cohesion: 0.20
 Nodes (25): derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_oss_id_to_url(), load_runtime_settings(), load_settings_env(), load_user_mapping() (+17 more)
 
 ### Community 74 - "Community 74"
-Cohesion: 0.26
-Nodes (15): DeliveryPrintCustomerOption, DeliverySlipPrintRead, build_delivery_slip_print(), _customer_key(), _delivery_matches_customer(), get_delivery_slip_print_context(), list_delivery_print_customers(), _merge_stop_products() (+7 more)
+Cohesion: 0.15
+Nodes (14): invoice_info_add(), invoice_info_by_customer(), _invoice_info_by_customer_impl(), invoice_info_delete(), invoice_info_list(), invoice_info_set_default(), invoice_info_update(), 按客户ID查询开票信息(与 by-customer 等价) (+6 more)
 
 ### Community 75 - "apply_crm_create_by_scope"
-Cohesion: 0.19
-Nodes (21): register_quote_routes(), 接口菜单权限守卫。super_admin 直接放行。, require_menu_code(), accept_quote(), generate_pdf(), generate_share(), _get_quote_in_scope(), get_template() (+13 more)
+Cohesion: 0.17
+Nodes (11): price_letter_add(), price_letter_detail(), price_letter_list(), price_letter_update(), price_letter_void(), PriceLetterCreateBody, PriceLetterDetailBody, PriceLetterListBody (+3 more)
 
 ### Community 76 - "opportunity_follow.py"
-Cohesion: 0.14
-Nodes (28): _append_user_scope_conditions(), apply_data_scope(), assert_row_in_data_scope(), _collect_scope_ids(), _get_child_dept_ids(), get_user_dept_id(), Session, 数据权限过滤(V0.3:基于角色 data_scope 的查询级行级过滤)  data_scope 值:   1 = 全部数据   2 = 本部门数据   3 (+20 more)
+Cohesion: 0.21
+Nodes (16): _append_user_scope_conditions(), apply_data_scope(), 根据用户角色的数据权限过滤查询。      适用于业务单据列表/详情(报销单、客户、运单等)。      以下场景 SHALL NOT 调用本函数(仅租户隔离即, 判断单行数据是否在当前用户数据权限范围内。, row_in_data_scope(), _FakeModel, 数据权限 apply_data_scope / row_in_data_scope 单元测试。, test_assert_row_in_data_scope_raises_403() (+8 more)
 
 ### Community 77 - "Community 77"
 Cohesion: 0.11
 Nodes (12): get_wechat_pay_client(), get_wechat_pay_v2(), Any, 微信支付工具模块  支持微信支付 V3 API 文档参考: https://pay.weixin.qq.com/docs/v3/apis/index.html, 统一下单接口 (V3)          Args:             out_trade_no: 商户订单号             total_amo, 申请退款          Args:             out_trade_no: 商户订单号             total_amount: 订单, 小程序调起支付的二次签名参数(与公众号 JSAPI 规则一致), 统一下单 (V2 API)          Args:             out_trade_no: 商户订单号             total_f (+4 more)
 
 ### Community 78 - "Community 78"
-Cohesion: 0.18
-Nodes (21): apply_crm_create_by_scope(), ensure_crm_create_by_row_in_scope(), Session, CRM 数据权限辅助(负责人 owner_user_id + 标准 create_by/create_dept_id)。, _apply_list_filters(), create_supplier_info(), get_supplier_info(), list_all_supplier_info() (+13 more)
+Cohesion: 0.13
+Nodes (33): apply_crm_create_by_scope(), ensure_crm_create_by_row_in_scope(), create_pool_rule(), delete_pool_rules(), execute_pool_rules(), _execute_single_rule(), get_pool_rule(), list_pool_rules() (+25 more)
 
 ### Community 79 - "PlCarrier"
-Cohesion: 0.19
-Nodes (18): create_role(), get_role(), get_role_data_scope(), get_role_menu_ids(), list_roles(), Any, Session, 角色 CRUD(sys_role / sys_role_menu / sys_role_data_scope_detail) (+10 more)
+Cohesion: 0.15
+Nodes (23): generate_uuid(), allocate_next_biz_no(), _format_biz_no(), _prefix_for(), datetime, Session, 业务协议号自动生成:XBCC / JZCC + YYYYMMDD + 6 位序号, 原子分配下一个业务协议号。     须在 create 事务内调用;使用 MySQL LAST_INSERT_ID 保证并发安全。 (+15 more)
 
 ### Community 80 - "resolve_crm_product"
-Cohesion: 0.13
-Nodes (26): PlCert, CertRead, parse_resource_snapshot(), Any, 运输计划 - 安排运输时车辆/人员/证件资源快照 Schema, 从 ORM 文本列或 dict 解析快照。, SnapshotCertRead, SnapshotPersonnelRow (+18 more)
+Cohesion: 0.16
+Nodes (30): approve_carrier(), create_carrier(), create_driver(), delete_carrier(), delete_driver(), delete_personnel(), delete_vehicle(), export_carriers() (+22 more)
 
 ### Community 81 - "customer_follow.py"
 Cohesion: 0.19
-Nodes (30): _apply_inventory_product_update(), _apply_inventory_update(), _base_query(), create_inventory(), create_link_for_plan(), delete_inventory(), export_inventory(), _generate_batch_no() (+22 more)
+Nodes (20): PlTransportDbLink, 运输-地磅出入库关联 pl_transport_db_link, _apply_plan_quantity_delta(), 装货段地磅往来单位取第一个送货客户;送货段取装货客户。, 再次勾选地磅安排前:软删本运输单此前生成的、仍可作废的出入库单及关联。      - 不删除地磅月计划(可能被其他业务复用)     - 若出入库单已完成的/已, _resolve_link_contributed_qty(), resolve_stop_dibang_partner(), revoke_regeneratable_dibang_for_transport() (+12 more)
 
 ### Community 82 - "list_duty_staff_users"
-Cohesion: 0.03
-Nodes (198): category_add(), category_delete(), category_tree(), category_update(), clue_assign(), clue_check_convert(), clue_check_duplicate(), clue_convert() (+190 more)
+Cohesion: 0.04
+Nodes (94): clue_assign(), clue_convert(), clue_create(), clue_delete(), clue_follow_create(), clue_follow_delete(), clue_follow_list(), clue_follow_update() (+86 more)
 
 ### Community 83 - "Community 83"
-Cohesion: 0.09
-Nodes (54): CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), _advance_contract_after_approval(), approve_contract(), approve_contract_by_contract_id(), approve_pass(), approve_reject(), approve_transfer() (+46 more)
+Cohesion: 0.15
+Nodes (30): _advance_contract_after_approval(), approve_contract(), approve_contract_by_contract_id(), approve_pass(), approve_reject(), approve_transfer(), _build_approval_list_filters(), can_user_approve() (+22 more)
 
 ### Community 84 - "Community 84"
 Cohesion: 0.23
@@ -564,15 +565,15 @@ Nodes (23): build_id_maps(), clip_text(), count_rows(), export_mapping(), fetch_
 
 ### Community 85 - "allocate_next_biz_no"
 Cohesion: 0.14
-Nodes (40): clue_follow_detail(), assign_clues(), check_convert(), check_duplicate_clue(), convert_clue(), create_clue(), _enrich_user_names(), _ensure_clue_in_scope() (+32 more)
+Nodes (42): assign_clues(), check_convert(), check_duplicate_clue(), convert_clue(), create_clue(), _enrich_user_names(), _ensure_clue_in_scope(), create_clue_follow() (+34 more)
 
 ### Community 86 - "Community 86"
-Cohesion: 0.18
-Nodes (18): align_contract_no_to_sign_date(), generate_contract_no(), date, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}      流水与撞号检测须含软删:uk_contr, 标准编号替换日期段,保留序号;非标准返回 None。, 将标准合同编号日期段对齐签订日;撞号则序号顺延(含软删查重)。      非标准编号原样返回。无签订日则原样返回。, replace_contract_no_date(), _mock_last_contract() (+10 more)
+Cohesion: 0.17
+Nodes (19): align_contract_no_to_sign_date(), generate_contract_no(), _parse_optional_date(), date, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}      流水与撞号检测须含软删:uk_contr, 标准编号替换日期段,保留序号;非标准返回 None。, 将标准合同编号日期段对齐签订日;撞号则序号顺延(含软删查重)。      非标准编号原样返回。无签订日则原样返回。, replace_contract_no_date() (+11 more)
 
 ### Community 87 - "list_customers"
-Cohesion: 0.33
-Nodes (10): _expand_with_ancestor_menu_ids(), _granted_menu_ids_for_user(), iter_user_menu_perm_codes(), Session, Web 管理端登录:基于 V0.3 sys_user / sys_user_role / sys_role 的角色与菜单权限解析, 角色仅勾选按钮(F)时,补齐祖先 C/M 菜单 id,便于前端匹配 :list 路由。, 用户通过角色关联得到的菜单权限标识(sys_menu.perms,与前端 meta.menuCode 对齐)。, 用户是否在 sys_user_role 中绑定了至少一个有效角色。 (+2 more)
+Cohesion: 0.15
+Nodes (17): 报销模块认证适配:门户 JWT 用户 → bx 业务上下文。, filter_current_cycle_approvals(), 审批轮次过滤 — 驳回后重新提交时,进度接口仅展示当前轮次。, 审批进度仅展示当前轮次;完整历史由 get_approval_history 返回。, BxCrudService, Any, Session, 报销模块 Service 基类 — 租户隔离 + UUID + 软删除。 (+9 more)
 
 ### Community 88 - "CrmProduct"
 Cohesion: 0.23
@@ -583,28 +584,28 @@ Cohesion: 0.19
 Nodes (22): PlOcrUsageMonth, 阿里云 OCR 月度调用计数 pl_ocr_usage_month(按自然月全局统计), assert_quota_available(), _build_ocr_client(), compress_image_bytes(), current_usage_month(), _first_attachment_url(), get_or_create_usage_row() (+14 more)
 
 ### Community 90 - "WechatMessageService"
-Cohesion: 0.30
-Nodes (12): business_type_from_path(), title_from_path(), _apply_oper_log_scope(), get_oper_log(), list_oper_logs(), _oper_log_row_in_scope(), _oper_status(), Any (+4 more)
+Cohesion: 0.18
+Nodes (19): _collect_scope_ids(), _get_child_dept_ids(), get_user_dept_id(), Session, 合并多角色数据范围为 dept_ids / user_ids 并集。, 从 SysUser 读取用户的 dept_id。, 递归获取 dept_id 及其所有子部门 ID(含自身)。, 获取用户所有角色的数据权限配置。      返回: [{"data_scope": str, "details": [SysRoleDataScopeDetai (+11 more)
 
 ### Community 91 - "unsettled_plans_q_filter"
-Cohesion: 0.25
-Nodes (16): PlanArchiveDeliveryBlock, PlanArchiveLoadBlock, PlanArchiveStopProductItem, apply_archive_stop_quantities(), _apply_stop_product_archive(), _brand_rows_from_item(), iter_stop_archive_inventory_lines(), _persist_stop_brand_qtys() (+8 more)
+Cohesion: 0.23
+Nodes (12): get_user_menu_codes(), Session, 读取用户授权的菜单权限标识集合(与前端 meta.menuCode / perms 对齐)。, _expand_with_ancestor_menu_ids(), _granted_menu_ids_for_user(), iter_user_menu_perm_codes(), Session, 角色仅勾选按钮(F)时,补齐祖先 C/M 菜单 id,便于前端匹配 :list 路由。 (+4 more)
 
 ### Community 92 - "Community 92"
-Cohesion: 0.40
-Nodes (9): create_oss(), create_oss(), get_oss_by_id(), get_oss_by_url(), Session, 按主键 id 查询附件(兼容旧 CRM 雪花 oss_id 迁入后的记录), 将 fileUrl 或旧 CRM 数字 ossId 解析为 MinIO 相对路径。      门户新上传把相对路径写入业务字段;迁入合同附件仍存数字 ossId, resolve_storage_path() (+1 more)
+Cohesion: 0.45
+Nodes (11): _customer_base_query(), get_follow_statistics(), get_industry_statistics(), get_level_statistics(), get_overview_statistics(), get_owner_statistics(), get_source_statistics(), get_trend_statistics() (+3 more)
 
 ### Community 93 - "api_request_log_middleware.py"
-Cohesion: 0.20
-Nodes (14): format_datetime(), get_current_time(), parse_datetime(), datetime, _create_by_name(), datetime_end_of_day(), fmt_date(), fmt_datetime() (+6 more)
+Cohesion: 0.18
+Nodes (32): generate_id(), DutyAssignment, DutyDay, DutySlot, 值班排班模型 — docs/superpowers/specs/2026-08-14-duty-schedule-design.md, _assignment_dict(), build_public_url(), _count_active_assignments() (+24 more)
 
 ### Community 94 - "assert_contract_editable_for_update"
 Cohesion: 0.60
 Nodes (3): assert_contract_editable_for_update(), test_assert_allows_editable(), test_assert_rejects_non_editable()
 
 ### Community 95 - "test_pl_public_link_archived.py"
-Cohesion: 0.25
-Nodes (17): _cargo_stats(), get_dashboard_stats(), get_inbound_by_cargo(), get_inbound_by_partner_cargo(), get_outbound_by_cargo(), get_outbound_by_partner_cargo(), _partner_cargo_stats(), Session (+9 more)
+Cohesion: 0.38
+Nodes (14): _cargo_stats(), get_dashboard_stats(), get_inbound_by_cargo(), get_inbound_by_partner_cargo(), get_outbound_by_cargo(), get_outbound_by_partner_cargo(), _partner_cargo_stats(), Session (+6 more)
 
 ### Community 96 - "minio_url.py"
 Cohesion: 0.18
@@ -612,7 +613,7 @@ Nodes (17): get_oper_log_meta(), OperLogMeta, 请求级操作日志元数据(C
 
 ### Community 97 - "contact.py"
 Cohesion: 0.10
-Nodes (45): _advance_list_filters(), advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _export_advance_rows() (+37 more)
+Nodes (41): _advance_list_filters(), advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _export_advance_rows() (+33 more)
 
 ### Community 98 - "LocalStorage"
 Cohesion: 0.35
@@ -623,36 +624,36 @@ Cohesion: 0.29
 Nodes (12): build_name_pinyin_abbr(), normalize_name_pinyin_abbr(), 名称拼音首字母缩写:库内存小写,检索时大小写不敏感。, 保存时解析拼音字段。      - submitted_provided=True:用提交值(空则按 name 生成)     - 否则:已有非空 existi, resolve_name_pinyin_abbr(), test_chinese_and_alnum(), test_empty_and_whitespace(), test_resolve_not_submitted_empty_existing_generates() (+4 more)
 
 ### Community 100 - "price_letter_detail"
-Cohesion: 0.27
-Nodes (15): Settings, BaseSettings, apply_renumber(), build_mapping(), fetch_products(), format_new_product_no(), load_settings_env(), main() (+7 more)
+Cohesion: 0.24
+Nodes (16): Settings, BaseSettings, BackfillRule, apply_renumber(), build_mapping(), fetch_products(), format_new_product_no(), load_settings_env() (+8 more)
 
 ### Community 101 - "tenant.py"
-Cohesion: 0.12
-Nodes (16): 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方详情 — Java: CrmSupplierInfoController.getInfo, 新增供方 — Java: CrmSupplierInfoController.add, 修改供方 — Java: CrmSupplierInfoController.edit, 删除供方 — Java: CrmSupplierInfoController.remove, supplier_info_add(), supplier_info_delete(), supplier_info_detail() (+8 more)
+Cohesion: 0.16
+Nodes (18): calc_age_from_chinese_id_card(), date, 从 18 位身份证号计算周岁。号码不完整或出生日期无效时返回 None。, VehiclePersonnelRow, load_vehicle_personnel_rows(), load_vehicle_personnel_summaries(), Session, 运输计划 - 人员 upsert 与车辆-人员关联保存 (+10 more)
 
 ### Community 102 - "BaseStorage"
-Cohesion: 0.13
-Nodes (27): pool_rule_add(), pool_rule_delete(), pool_rule_detail(), pool_rule_execute(), pool_rule_update(), pool_rule_update_status(), create_pool_rule(), delete_pool_rules() (+19 more)
+Cohesion: 0.14
+Nodes (13): pool_rule_add(), pool_rule_delete(), pool_rule_detail(), pool_rule_execute(), pool_rule_update(), pool_rule_update_status(), PoolRuleAddBody, PoolRuleDeleteBody (+5 more)
 
 ### Community 103 - "pl_internal_customer.py"
-Cohesion: 0.25
-Nodes (13): _claims_from_auth(), _format_body_bytes(), _persist_log(), Any, Request, 统一记录 API 请求/响应出入参的中间件, _redact_obj(), _schedule_persist_log() (+5 more)
+Cohesion: 0.18
+Nodes (18): ApiCryptoMiddleware, ApiRequestLogMiddleware, _claims_from_auth(), _format_body_bytes(), _persist_log(), Any, Request, 统一记录 API 请求/响应出入参的中间件 (+10 more)
 
 ### Community 104 - "apply_crm_create_by_scope"
-Cohesion: 0.25
-Nodes (17): create_price_letter(), get_price_letter(), list_price_letters(), _parse_date(), Any, date, Session, _row_to_dict() (+9 more)
+Cohesion: 0.36
+Nodes (15): create_opportunity_follow(), _ensure_parent_opportunity(), get_opportunity_follow(), list_follows_by_opportunity(), list_opportunity_follows(), _parse_optional_datetime(), Any, datetime (+7 more)
 
 ### Community 105 - "pool_customer_assign"
 Cohesion: 0.33
 Nodes (13): _build_tree(), _cascade_soft_delete(), _collect_with_ancestors(), create_dept(), get_dept(), list_depts(), list_depts_tree(), Any (+5 more)
 
 ### Community 106 - "site.py"
-Cohesion: 0.45
-Nodes (11): _customer_base_query(), get_follow_statistics(), get_industry_statistics(), get_level_statistics(), get_overview_statistics(), get_owner_statistics(), get_source_statistics(), get_trend_statistics() (+3 more)
+Cohesion: 0.16
+Nodes (29): create_instance(), create_process_def(), create_task(), get_all_tasks_for_business(), get_instance(), get_latest_version(), get_nodes_by_version(), get_pending_tasks_by_node() (+21 more)
 
 ### Community 107 - "apply_pl_scope"
-Cohesion: 0.23
-Nodes (15): API 路由包 — 山峡化工生产一体化门户, create_leave(), delete_leave(), export_leaves(), get_leave(), _leave_local_callback(), leave_workflow_callback(), list_leaves() (+7 more)
+Cohesion: 0.33
+Nodes (11): create_leave(), get_leave(), list_leaves(), Any, Session, _row_to_dict(), soft_delete_leave(), update_leave() (+3 more)
 
 ### Community 108 - "statistics.py"
 Cohesion: 0.20
@@ -663,12 +664,12 @@ Cohesion: 0.12
 Nodes (31): _extract_qty(), _fmt_qty(), normalize_stop_dibang_fields(), Any, Decimal, 运输计划多段:内部客户地磅默认值与数量平衡校验, 地磅默认勾选以本段客户是否为内部客户(山峡/云栋)为准。, 归一化段次地磅勾选与方向:勾选但方向缺失/none 时按本段客户补默认方向。 (+23 more)
 
 ### Community 110 - "pool_rule.py"
-Cohesion: 0.50
-Nodes (4): customer_options(), 客户下拉选项(租户内只读,不做 owner 数据权限), CustomerOptionsBody, 客户下拉选项请求体(租户内只读搜索,不做 owner 数据权限)
+Cohesion: 0.14
+Nodes (23): day_detail(), delete_assignment(), duty_user_options(), _enrich_assign_names(), ensure_duty_dict(), month_summary(), Session, 指定用户时补全 personName(用 nick_name)。 (+15 more)
 
 ### Community 111 - "test_pl_public_transport_history.py"
-Cohesion: 0.24
-Nodes (12): get_last_month_range(), month_range(), date, Session, 地磅计划按月自动生成 — 迁移自 simple-dibang-xiaoshou/auto-create-plan/auto_create_monthly_pla, 按月自动生成采购计划。      - 默认仅在每月 1 日执行(force=True 时跳过该限制,供手动触发验收)     - 遍历所有租户,按上月计划模板生, run_auto_generate_monthly_plans(), default_execution_status() (+4 more)
+Cohesion: 0.25
+Nodes (7): camel_to_snake(), CRUDBase, get_model_attr(), HistoryCRUD, Any, Session, ModelType
 
 ### Community 112 - "merge_duplicate_crm_customers.py"
 Cohesion: 0.26
@@ -687,56 +688,56 @@ Cohesion: 0.22
 Nodes (15): get_storage(), download_file_bytes(), file_stream(), get_access_url(), get_download_url(), get_preview_url(), normalize_storage_path(), 报销附件存储适配 — 复用门户 app.core.storage,对外保持 bx 协议。 (+7 more)
 
 ### Community 116 - "Community 116"
-Cohesion: 0.19
-Nodes (26): batch_insert_quote_products(), calculate_subtotal(), _decimal_value(), delete_products_by_quote_id(), _ensure_quote_parent_scope(), _get_field(), get_quote_product(), insert_quote_product() (+18 more)
+Cohesion: 0.14
+Nodes (32): calculate_subtotal(), _decimal_value(), delete_products_by_quote_id(), _ensure_quote_parent_scope(), _get_field(), get_quote_product(), insert_quote_product(), list_products_by_quote_ids() (+24 more)
 
 ### Community 117 - "pl_plan_list_attachments.py"
-Cohesion: 0.13
-Nodes (18): pool_customer_assign(), pool_customer_claim(), pool_customer_list(), pool_record_detail(), pool_record_list(), get_pool_record(), list_pool_records(), Any (+10 more)
+Cohesion: 0.06
+Nodes (30): category_add(), category_delete(), category_tree(), category_update(), _map_product_export_column_keys(), product_add(), product_delete(), product_detail() (+22 more)
 
 ### Community 118 - "Community 118"
-Cohesion: 0.12
-Nodes (35): batch_insert_contract_products(), calculate_subtotal(), _decimal_value(), delete_price_tiers_by_contract_id(), delete_products_by_contract_id(), _get_field(), insert_contract_product(), _letter_oss_ids_to_json() (+27 more)
+Cohesion: 0.20
+Nodes (24): batch_insert_contract_products(), calculate_subtotal(), _decimal_value(), delete_price_tiers_by_contract_id(), delete_products_by_contract_id(), _get_field(), insert_contract_product(), _letter_oss_ids_to_json() (+16 more)
 
 ### Community 119 - "Community 119"
 Cohesion: 0.12
-Nodes (38): CertRow, VehiclePersonnelRow, _cert_row_complete(), collect_required_cert_errors(), _find_cert_for_required(), get_required_personnel_cert_names(), is_huolala_trailer_no(), match_required_cert_name() (+30 more)
+Nodes (37): CertRow, _cert_row_complete(), collect_required_cert_errors(), _find_cert_for_required(), get_required_personnel_cert_names(), is_huolala_trailer_no(), match_required_cert_name(), _missing_field_labels() (+29 more)
 
 ### Community 120 - "list_duty_staff_users"
 Cohesion: 0.22
 Nodes (3): BaseStorage, 带下载文件名的访问 URL;默认实现为普通访问地址。, 浏览器内联预览 URL;默认实现为普通访问地址。
 
 ### Community 121 - "_build_user_info_payload"
-Cohesion: 0.11
-Nodes (41): _avatar_url_field(), _build_user_info_payload(), _jwt_user_payload(), logout(), 公共接口(Web 登录、刷新 Token、登出;用户模型对齐 docs/sql/shanxia2.0.sql 基线), 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。无 Token 或已失效时仍返回成功(幂等)。, 与 web-admin 静态路由 meta.roles(admin/super_admin)对齐的单元素数组。, 与 web-admin `userInfo` 字段约定一致。 (+33 more)
+Cohesion: 0.10
+Nodes (43): _avatar_url_field(), _build_user_info_payload(), _jwt_user_payload(), logout(), 公共接口(Web 登录、刷新 Token、登出;用户模型对齐 docs/sql/shanxia2.0.sql 基线), 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。无 Token 或已失效时仍返回成功(幂等)。, 与 web-admin 静态路由 meta.roles(admin/super_admin)对齐的单元素数组。, 与 web-admin `userInfo` 字段约定一致。 (+35 more)
 
 ### Community 122 - "post.py"
 Cohesion: 0.39
 Nodes (10): create_post(), get_post(), list_posts(), post_code_exists(), Any, Session, _row_to_dict(), soft_delete_post() (+2 more)
 
 ### Community 123 - "customer_options"
-Cohesion: 0.11
-Nodes (32): CRM 报价单 API 路由 — 挂接到 crm.router, QuoteApproverSettingSaveBody, QuoteAcceptBody, QuoteApprovalApproveBody, QuoteApprovalListBody, QuoteApprovalRefreshNamesBody, QuoteApprovalWithdrawBody, QuoteCreateBody (+24 more)
+Cohesion: 0.10
+Nodes (33): CRM 报价单 API 路由 — 挂接到 crm.router, total_pages(), QuoteApproverSettingSaveBody, QuoteAcceptBody, QuoteApprovalApproveBody, QuoteApprovalListBody, QuoteApprovalRefreshNamesBody, QuoteApprovalWithdrawBody (+25 more)
 
 ### Community 124 - "LocalStorage"
-Cohesion: 0.28
-Nodes (14): _assert_editable(), _build_public_page(), _format_file_size(), _get_inventory_by_token(), get_public_inventory(), _parse_feedback_images(), Session, UploadFile (+6 more)
+Cohesion: 0.18
+Nodes (10): contact_add(), contact_delete(), contact_update(), ContactByCustomerBody, ContactCreateBody, ContactDeleteBody, ContactDetailBody, ContactSetPrimaryBody (+2 more)
 
 ### Community 125 - "ethnic.py"
-Cohesion: 0.08
-Nodes (56): _make_handlers(), CrmProductBrand, PlInboundOrderItem, PlInboundOrderItemBrandQty, PlOutboundOrderItem, PlOutboundOrderItemBrandQty, 出库明细品牌数量 pl_outbound_order_item_brand_qty, 运输计划-入库单明细 pl_inbound_order_item (+48 more)
+Cohesion: 0.10
+Nodes (41): _make_handlers(), PlInboundOrderItem, PlInboundOrderItemBrandQty, PlOutboundOrderItem, PlOutboundOrderItemBrandQty, 出库明细品牌数量 pl_outbound_order_item_brand_qty, 运输计划-入库单明细 pl_inbound_order_item, 入库明细品牌数量 pl_inbound_order_item_brand_qty (+33 more)
 
 ### Community 126 - "oper_log.py"
 Cohesion: 0.11
 Nodes (7): convert_heic_to_jpeg(), OSSStorage, process_image_content(), QiniuStorage, 文件存储工具模块  支持多种存储方式: 1. 本地存储 (local) - 默认 2. 七牛云存储 (qiniu) - 推荐生产环境使用 3. 阿里云OSS (, 将 HEIC/HEIF 格式转换为 JPEG 格式, 处理图片内容,如果是 HEIC 格式则转换为 JPEG
 
 ### Community 127 - "Any"
-Cohesion: 0.13
-Nodes (39): PlanDeliveryRead, PlanLoadRead, PlanStopProductRead, _append_legacy_plan_product_rows(), _append_stop_product_rows(), build_plan_archive_export_rows(), _empty_product_fields(), _format_date_value() (+31 more)
+Cohesion: 0.08
+Nodes (60): DeliverySlipPrintRead, PlanDeliveryRead, PlanLoadRead, PlanStopProductRead, _append_legacy_plan_product_rows(), _append_stop_product_rows(), build_plan_archive_export_rows(), _empty_product_fields() (+52 more)
 
 ### Community 128 - "api_crypto.py"
-Cohesion: 0.12
-Nodes (30): clue_detail(), customer_detail(), invoice_info_add(), invoice_info_by_customer(), _invoice_info_by_customer_impl(), invoice_info_delete(), invoice_info_list(), invoice_info_set_default() (+22 more)
+Cohesion: 0.60
+Nodes (9): apply_site_feedback(), _header(), _item(), test_apply_site_feedback_does_not_reset_first_submitted_at(), test_apply_site_feedback_keeps_in_progress_when_requested(), test_apply_site_feedback_rejects_already_voided(), test_apply_site_feedback_rejects_invalid_status(), test_apply_site_feedback_sets_status_completed() (+1 more)
 
 ### Community 129 - "BaseStorage"
 Cohesion: 0.12
@@ -747,88 +748,92 @@ Cohesion: 0.36
 Nodes (13): _build_tree(), _cascade_soft_delete(), create_menu(), get_menu(), list_menus(), list_menus_tree(), menu_name_exists(), Any (+5 more)
 
 ### Community 131 - "resolve_crm_product"
-Cohesion: 0.49
-Nodes (10): clue_statistics_level(), _apply_create_range(), _base_query(), get_clue_level_statistics(), get_clue_overview_statistics(), get_clue_owner_statistics(), get_clue_source_statistics(), get_clue_trend_statistics() (+2 more)
+Cohesion: 0.29
+Nodes (15): clue_statistics_level(), clue_statistics_overview(), clue_statistics_owner(), clue_statistics_source(), clue_statistics_trend(), _apply_create_range(), _base_query(), get_clue_level_statistics() (+7 more)
 
 ### Community 132 - ".to_list_kwargs"
-Cohesion: 0.24
-Nodes (11): extract_minio_object_key(), join_relative_urls(), normalize_oss_storage_url(), MinIO 附件 URL 规范化(数据迁移共用)。  背景 ---- CRM / 地磅 / 报销与 shanxia2.0 共用同一 MinIO(bucket 默, 业务表 OSS ID 串 → 相对 URL 串(用于客户证照、跟进附件等)。, 去掉预签名 query(``?X-Amz-...``)。, 将绝对/相对 URL 规范为 MinIO object key(不含 bucket)。, 迁移 CRM ``sys_oss`` 行:``url`` + ``file_name`` → 门户相对路径。 (+3 more)
+Cohesion: 0.39
+Nodes (8): validate_brand_qty_rows(), test_any_ok(), test_any_sum_must_match(), test_delta_for_plan_type(), test_no_brand_ignores_rows(), test_required_allows_multi_brand_when_sum_matches(), test_required_allows_other_brand_when_sum_matches(), test_required_sum_must_match()
 
 ### Community 133 - "inventory_id.py"
-Cohesion: 0.24
-Nodes (12): DbSequence, 地磅(db)模块数据模型 — 对齐 docs/sql/db_tables.sql, _allocate_inbound_outbound_id(), _ensure_sequence_row(), max_numeric_inbound_outbound_id(), next_inbound_outbound_id(), Session, 出入库单 id 生成 — 租户内纯数字自增,并发安全。 (+4 more)
+Cohesion: 0.28
+Nodes (11): DbSequence, _allocate_inbound_outbound_id(), _ensure_sequence_row(), max_numeric_inbound_outbound_id(), next_inbound_outbound_id(), Session, 出入库单 id 生成 — 租户内纯数字自增,并发安全。, 当前租户下纯数字 id 的最大值(不含 UUID 等非数字主键)。 (+3 more)
 
 ### Community 134 - "list_contacts"
 Cohesion: 0.42
 Nodes (11): apply_archive_inventory_for_plan(), apply_archive_inventory_for_plan_stops(), apply_brand_stock_change(), get_or_create_inventory(), Decimal, Session, qty_delta_for_plan(), 计划归档按产品+品牌写入库存台账与流水。  直销单 (direct) 首期不记账;入库增加、出库扣减(允许负库存,不做不足拦截)。 调整归档时先按 plan_i (+3 more)
 
 ### Community 135 - "context.py"
-Cohesion: 0.41
-Nodes (12): apply_pl_scope(), Session, build_menu_badge_counts(), count_document_reminder_expired_pending(), count_freight_approval_pending(), count_freight_disburse_pending(), _count_pending_applies(), count_plan_archive_pending() (+4 more)
+Cohesion: 0.33
+Nodes (13): apply_pl_scope(), Session, PL 模块数据权限辅助(create_by / create_dept_id,无 owner_field)。, build_menu_badge_counts(), count_document_reminder_expired_pending(), count_freight_approval_pending(), count_freight_disburse_pending(), _count_pending_applies() (+5 more)
 
 ### Community 136 - "get_db_current_user_optional"
 Cohesion: 0.06
-Nodes (88): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), CompletedTaskExportBody, create_process_def(), delete_process_def(), _enrich_task_list(), export_completed_tasks() (+80 more)
+Nodes (69): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), CompletedTaskExportBody, create_process_def(), _enrich_task_list(), export_completed_tasks(), export_my_instances() (+61 more)
 
 ### Community 137 - "iter_user_menu_perm_codes"
-Cohesion: 0.33
-Nodes (11): create_leave(), get_leave(), list_leaves(), Any, Session, _row_to_dict(), soft_delete_leave(), update_leave() (+3 more)
+Cohesion: 0.31
+Nodes (9): change_current_user_password(), get_current_user_profile(), get_web_auth_menu_codes(), public_quote_share(), Request, Session, 获取当前用户信息(与 sys_user 字段对应)。, 获取当前用户菜单权限标识(sys_menu.perms,经角色继承)。 (+1 more)
 
 ### Community 138 - "Community 138"
 Cohesion: 0.33
 Nodes (19): check_python(), create_venv(), ensure_dirs(), ensure_valid_venv(), ensure_venv_and_runtime(), install_dependencies(), is_running(), log_error() (+11 more)
 
 ### Community 139 - "customer_options"
-Cohesion: 0.39
-Nodes (5): _build_workbook(), DictLabelResolver, Any, Session, 导出单元格解析:按列配置做字典翻译或自定义格式化。
+Cohesion: 0.09
+Nodes (40): export_transports(), 导出运输列表(当前筛选全量,或 ids 已选)。, cancel_apply(), create_apply(), create_process(), delete_applies(), delete_processes(), export_applies() (+32 more)
 
 ### Community 140 - "crm_export_columns.py"
-Cohesion: 0.39
-Nodes (11): PlanStopProductBody, 段 address 为空时,按经纬度从运输地址库补全 full_address。, _resolve_plan_product_id(), resolve_stop_address_from_library(), _plan_product_row(), test_resolve_plan_product_id_by_explicit_id(), test_resolve_plan_product_id_falls_back_to_product_no(), test_resolve_plan_product_id_falls_back_when_explicit_id_stale() (+3 more)
+Cohesion: 0.49
+Nodes (9): PlanStopProductBody, _resolve_plan_product_id(), _plan_product_row(), test_resolve_plan_product_id_by_explicit_id(), test_resolve_plan_product_id_falls_back_to_product_no(), test_resolve_plan_product_id_falls_back_when_explicit_id_stale(), test_resolve_plan_product_id_raises_when_unmatched(), test_resolve_stop_address_from_library_looks_up_by_lat() (+1 more)
 
 ### Community 141 - "web_login_rsa_public_key"
-Cohesion: 0.27
-Nodes (10): apply_product_snapshot_to_plan(), ProductSnapshot, Session, 地磅模块 — CRM 产品解析与快照写入。, 校验 CRM 产品并返回名称/规格快照。新建单据 product_id 必填。      require_on_shelf=False 用于运输计划联动地磅等历, resolve_crm_product(), _product(), resolve_crm_product:运输联动场景允许已下架产品。 (+2 more)
+Cohesion: 0.60
+Nodes (5): product_allowed(), test_dual_requires_both(), test_explosive_only_requires_allow_explosive(), test_plain_always_allowed(), test_toxic_only_requires_allow_toxic()
 
 ### Community 142 - "clear_pl_plan_instance_data.py"
 Cohesion: 0.46
 Nodes (7): _count(), _delete(), _engine_from_env(), main(), Engine, 清空运输计划(pl_plan)及关联实例数据,便于测试环境重新走流程。  用法(在 backend 目录、已配置 .env DATABASE_URL):   p, _table_exists()
 
 ### Community 143 - "create_from_quote"
-Cohesion: 0.33
-Nodes (8): allocate_next_biz_no(), _format_biz_no(), _prefix_for(), datetime, Session, 业务协议号自动生成:XBCC / JZCC + YYYYMMDD + 6 位序号, 原子分配下一个业务协议号。     须在 create 事务内调用;使用 MySQL LAST_INSERT_ID 保证并发安全。, BizNoKind
+Cohesion: 0.50
+Nodes (4): ApiRequestLogCRUD, Session, SysApiRequestLog, SysApiRequestLogHis
 
 ### Community 144 - "response.py"
-Cohesion: 0.06
-Nodes (85): cancel_plan(), cancel_plan_wait_notice(), ContractGapExportBody, count_plans_by_contract(), create_from_contract(), create_plan(), delete_plan(), _determine_plan_type() (+77 more)
+Cohesion: 0.04
+Nodes (130): _apply_exclude_follow_status_filter(), _apply_follow_status_filter(), cancel_plan(), cancel_plan_wait_notice(), count_plans_by_contract(), create_plan(), create_plan_full(), delete_plan() (+122 more)
 
 ### Community 145 - "list_products"
-Cohesion: 0.28
-Nodes (8): list_products(), 分页查询产品列表      keyword 默认匹配:名称 / 编号 / 拼音首字母。     选择器场景可关闭编号匹配、开启规格型号匹配(避免短数字误命中产品, 产品/客户列表 keyword:名称/编号/拼音首字母 OR 匹配。, 选择器:名称/拼音/规格型号,不匹配产品编号。, test_list_customer_options_keyword_includes_name_and_pinyin(), test_list_customers_keyword_includes_name_and_pinyin(), test_list_products_keyword_includes_name_and_pinyin(), test_list_products_keyword_selector_mode_excludes_product_no_includes_model()
+Cohesion: 0.32
+Nodes (8): format_time_label(), parse_hhmm(), test_format_time_label_cross_day(), test_format_time_label_empty(), test_format_time_label_same_day(), test_parse_hhmm(), test_parse_hhmm_invalid_raises(), time
 
 ### Community 147 - "Community 147"
 Cohesion: 0.37
 Nodes (17): check_env(), check_python(), create_venv(), init_env(), install_dependencies(), log_error(), log_info(), log_success() (+9 more)
 
 ### Community 148 - "plan_has_incomplete_hazard_cert_exists"
-Cohesion: 0.13
-Nodes (22): _apply_exclude_follow_status_filter(), _apply_follow_status_filter(), export_plans(), list_plans(), _parse_status_csv(), _plan_plate_match(), PlanExportBody, 列表展示用:优先 CRM 标准名(详情仍返回库内 product_name,以便编辑反推别名)。 (+14 more)
+Cohesion: 0.16
+Nodes (19): _delivery_stop_gap_expr(), _demander_gap_expr(), _legacy_demander_gap_expr(), _legacy_supplier_gap_expr(), _load_stop_gap_expr(), plan_has_contract_gap_exists(), 列表筛选:任一段次(或旧计划级)存在合同缺口。, _stop_contract_exists() (+11 more)
 
 ### Community 149 - ".to_tenant_user_dict"
-Cohesion: 0.40
-Nodes (3): Any, 供 get_tenant_no 等门户工具使用。, 与门户 JWT / apply_data_scope 所需的 user_info 字段对齐。
+Cohesion: 0.48
+Nodes (7): _opp_list_kwargs(), opportunity_export(), opportunity_kanban(), opportunity_list(), opportunity_mine_list(), OpportunityKanbanBody, OpportunityListBody
 
 ### Community 150 - "list_product_options"
-Cohesion: 0.67
-Nodes (3): list_product_options(), 产品下拉 options:keyword 按产品名称/拼音首字母模糊匹配,不匹配产品编号。, test_list_product_options_keyword_only_filters_product_name()
+Cohesion: 0.33
+Nodes (6): list_duty_staff_users(), 按固定 id 查找「值班人员」角色;找不到再按角色名兜底。, 本租户启用且绑定「值班人员」角色的用户(公开页 users / 管理端 options)。, resolve_duty_staff_role_id(), test_list_duty_staff_users_empty_when_no_role(), test_resolve_duty_staff_role_id_by_fixed_id()
 
 ### Community 152 - "register_local_callback"
-Cohesion: 0.67
-Nodes (3): 注册本地回调函数。当 callback_url 以 path 开头时直接调用 fn。, register_local_callback(), _LocalCallbackFn
+Cohesion: 0.35
+Nodes (11): create_vehicle(), export_vehicles(), get_vehicle(), 导出车辆列表(当前筛选全量,或 ids 已选)。, update_vehicle(), _vehicle_to_detail(), _vehicle_to_read(), PlVehicle (+3 more)
+
+### Community 153 - "web_login_rsa_public_key"
+Cohesion: 0.50
+Nodes (4): 简易搜索:计划编号 / 客户(供应商) / 车牌 / 承运商名称。, unsettled_plans_q_filter(), 未结算计划简易搜索:q 应覆盖计划编号/客户/车牌/承运商名称。, test_unsettled_plans_q_filter_includes_carrier_and_plate()
 
 ### Community 155 - "WechatMessageService"
-Cohesion: 0.15
-Nodes (9): 微信消息通知服务  支持微信小程序模板消息推送  使用方式:     from app.core.wechat_message import WechatMes, 发送订单状态通知                  Args:             openid: 用户openid             order_n, 发送支付成功通知                  Args:             openid: 用户openid             order_n, 发送配送通知                  Args:             openid: 配送员openid             task_no:, 发送配送时效预警                  Args:             openid: 配送员openid             task_n, 发送退款结果通知                  Args:             openid: 用户openid             order_n, 发送催单通知给配送员                  Args:             deliver_openid: 配送员openid, 发送模板消息                  Args:             openid: 用户openid             template_ (+1 more)
+Cohesion: 0.17
+Nodes (8): 发送订单状态通知                  Args:             openid: 用户openid             order_n, 发送支付成功通知                  Args:             openid: 用户openid             order_n, 发送配送通知                  Args:             openid: 配送员openid             task_no:, 发送配送时效预警                  Args:             openid: 配送员openid             task_n, 发送退款结果通知                  Args:             openid: 用户openid             order_n, 发送催单通知给配送员                  Args:             deliver_openid: 配送员openid, 发送模板消息                  Args:             openid: 用户openid             template_, WechatMessageService
 
 ### Community 162 - ".to_tenant_user_dict"
 Cohesion: 0.42
@@ -836,7 +841,7 @@ Nodes (7): default_settlement_clause(), test_advance_payment_clause(), test_arri
 
 ### Community 173 - "resolve_create_time_bounds"
 Cohesion: 0.06
-Nodes (72): _apply_plan_logistics_from_payload(), _apply_transport_arrange_fields(), arrange_transport(), _assert_vehicle_carrier_eligible(), _build_arrange_result(), _build_driver_url(), create_transport(), _ensure_driver_access_token() (+64 more)
+Nodes (72): _build_driver_url(), ContractGapExportBody, get_plan_arrange_info(), PlanExportBody, 获取计划已安排运输后的司机链接与地磅出入库关联(供查看弹窗复制简述/二维码)。, _apply_plan_logistics_from_payload(), _apply_transport_arrange_fields(), arrange_transport() (+64 more)
 
 ### Community 179 - "test_pl_vehicle_personnel_photo_schema.py"
 Cohesion: 0.27
@@ -851,8 +856,8 @@ Cohesion: 0.18
 Nodes (10): 1. 创建虚拟环境, 2. 安装依赖, 3. 配置环境变量, 4. 启动服务, API 路由分组, shanxia2.0 后端骨架(FastAPI), 开发规范, 快速开始 (+2 more)
 
 ### Community 220 - "api_crypto_middleware.py"
-Cohesion: 0.16
-Nodes (19): _claims_from_auth(), _coerce_post_method_override_to_get(), _get_redis_client(), _is_crypto_api(), _json_error_response(), _mark_nonce_once(), _nonce_key(), Redis (+11 more)
+Cohesion: 0.15
+Nodes (21): _claims_from_auth(), _coerce_post_method_override_to_get(), _get_redis_client(), _is_crypto_api(), _json_error_response(), _mark_nonce_once(), _nonce_key(), Redis (+13 more)
 
 ### Community 237 - "order_status_compat.py"
 Cohesion: 0.36
@@ -874,17 +879,17 @@ Nodes (6): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时
 ## Suggested Questions
 _Questions this graph is uniquely positioned to answer:_
 
-- **Why does `generate_uuid()` connect `Community 64` to `api_crypto.py`, `Community 0`, `_filter_export_rows_by_ids`, `Community 2`, `Community 4`, `Community 5`, `Community 6`, `inventory_id.py`, `Community 8`, `iter_user_menu_perm_codes`, `get_db_current_user_optional`, `list_contacts`, `Community 11`, `Community 14`, `create_from_quote`, `response.py`, `Community 17`, `Community 15`, `Community 19`, `Community 21`, `Community 23`, `Community 24`, `Community 25`, `Community 28`, `Community 29`, `Community 31`, `Community 32`, `Community 33`, `Community 34`, `Community 36`, `Community 37`, `Community 39`, `Community 40`, `Community 43`, `resolve_create_time_bounds`, `Community 46`, `Community 48`, `Community 50`, `Community 51`, `Community 58`, `Community 61`, `Community 63`, `Community 65`, `Community 67`, `Community 68`, `Community 70`, `Community 71`, `Community 78`, `PlCarrier`, `resolve_crm_product`, `Community 83`, `allocate_next_biz_no`, `CrmProduct`, `pl_ocr_service.py`, `Community 92`, `api_request_log_middleware.py`, `contact.py`, `LocalStorage`, `BaseStorage`, `apply_crm_create_by_scope`, `pool_customer_assign`, `test_pl_public_transport_history.py`, `dict_type.py`, `dept.py`, `Community 116`, `pl_plan_list_attachments.py`, `Community 118`, `_build_user_info_payload`, `post.py`, `ethnic.py`?**
-  _High betweenness centrality (0.144) - this node is a cross-community bridge._
-- **Why does `Settings` connect `price_letter_detail` to `Community 35`, `Community 67`, `Community 73`, `Community 42`, `Community 59`, `statistics.py`, `Community 44`, `Community 49`, `Community 57`, `Community 26`, `Community 27`, `Community 30`?**
-  _High betweenness centrality (0.124) - this node is a cross-community bridge._
-- **Why does `BaseModel` connect `Community 12` to `api_crypto.py`, `Community 1`, `Community 2`, `Community 3`, `Community 0`, `Community 6`, `get_db_current_user_optional`, `Community 10`, `Community 11`, `crm_export_columns.py`, `Community 15`, `response.py`, `Community 16`, `Community 18`, `Community 19`, `plan_has_incomplete_hazard_cert_exists`, `Community 20`, `Community 17`, `Community 21`, `Community 28`, `Community 31`, `Community 33`, `Community 34`, `Community 37`, `Community 39`, `Community 40`, `Community 41`, `Community 43`, `Community 45`, `resolve_create_time_bounds`, `Community 47`, `Community 49`, `Community 51`, `Community 52`, `Community 53`, `Community 56`, `Community 58`, `Community 63`, `Community 64`, `Community 65`, `Community 66`, `Community 74`, `resolve_crm_product`, `customer_follow.py`, `list_duty_staff_users`, `Community 83`, `unsettled_plans_q_filter`, `test_pl_public_link_archived.py`, `contact.py`, `tenant.py`, `BaseStorage`, `apply_pl_scope`, `pool_rule.py`, `pl_plan_list_attachments.py`, `Community 119`, `customer_options`, `LocalStorage`, `ethnic.py`?**
-  _High betweenness centrality (0.105) - this node is a cross-community bridge._
+- **Why does `generate_uuid()` connect `PlCarrier` to `Community 0`, `_filter_export_rows_by_ids`, `Community 4`, `Community 5`, `Community 6`, `inventory_id.py`, `Community 8`, `list_contacts`, `Community 11`, `Community 14`, `Community 15`, `response.py`, `Community 19`, `Community 21`, `Community 23`, `register_local_callback`, `Community 25`, `Community 24`, `Community 27`, `Community 28`, `Community 29`, `Community 31`, `Community 32`, `Community 33`, `Community 34`, `Community 36`, `Community 37`, `Community 40`, `Community 43`, `resolve_create_time_bounds`, `Community 48`, `Community 50`, `Community 51`, `Community 54`, `Community 61`, `Community 64`, `Community 65`, `Community 67`, `Community 68`, `Community 70`, `Community 71`, `Community 72`, `Community 78`, `resolve_crm_product`, `Community 83`, `allocate_next_biz_no`, `list_customers`, `CrmProduct`, `pl_ocr_service.py`, `api_request_log_middleware.py`, `contact.py`, `LocalStorage`, `tenant.py`, `apply_crm_create_by_scope`, `pool_customer_assign`, `site.py`, `apply_pl_scope`, `dict_type.py`, `dept.py`, `Community 116`, `Community 118`, `_build_user_info_payload`, `post.py`, `ethnic.py`?**
+  _High betweenness centrality (0.170) - this node is a cross-community bridge._
+- **Why does `Settings` connect `price_letter_detail` to `Community 35`, `Community 67`, `Community 38`, `Community 73`, `Community 42`, `statistics.py`, `Community 44`, `Community 57`, `Community 59`, `Community 30`?**
+  _High betweenness centrality (0.113) - this node is a cross-community bridge._
+- **Why does `BaseModel` connect `Community 10` to `Community 0`, `Community 1`, `resolve_crm_product`, `get_db_current_user_optional`, `customer_options`, `Community 12`, `Community 13`, `Community 14`, `Community 15`, `response.py`, `crm_export_columns.py`, `Community 18`, `Community 11`, `Community 20`, `.to_tenant_user_dict`, `Community 21`, `Community 26`, `Community 28`, `Community 31`, `Community 34`, `Community 37`, `Community 39`, `Community 41`, `Community 43`, `Community 45`, `resolve_create_time_bounds`, `Community 47`, `Community 49`, `Community 51`, `Community 52`, `Community 54`, `Community 56`, `Community 58`, `Community 62`, `Community 63`, `Community 64`, `Community 65`, `Community 66`, `Community 74`, `apply_crm_create_by_scope`, `list_duty_staff_users`, `test_pl_public_link_archived.py`, `contact.py`, `tenant.py`, `BaseStorage`, `pool_rule.py`, `pl_plan_list_attachments.py`, `Community 119`, `customer_options`, `LocalStorage`, `Any`?**
+  _High betweenness centrality (0.102) - this node is a cross-community bridge._
 - **Are the 30 inferred relationships involving `DbUserContext` (e.g. with `InventoryExportBody` and `InventoryRelatedData`) actually correct?**
   _`DbUserContext` has 30 INFERRED edges - model-reasoned connections that need verification._
 - **What connects `API 路由包 — 山峡化工生产一体化门户`, `返回运营端角色下拉选项(label=库中角色名,value=Web 角色码)。`, `返回用户下拉选项(label=昵称,value=用户ID,附带 nickName/userNo)。      供申请人/审批人等选择场景使用,返回本租户全部有效` to the rest of the system?**
-  _668 weakly-connected nodes found - possible documentation gaps or missing edges._
+  _670 weakly-connected nodes found - possible documentation gaps or missing edges._
 - **Should `Community 0` be split into smaller, more focused modules?**
-  _Cohesion score 0.08985507246376812 - nodes in this community are weakly interconnected._
+  _Cohesion score 0.0651685393258427 - nodes in this community are weakly interconnected._
 - **Should `Community 1` be split into smaller, more focused modules?**
-  _Cohesion score 0.08076923076923077 - nodes in this community are weakly interconnected._
+  _Cohesion score 0.07804878048780488 - nodes in this community are weakly interconnected._

Разница между файлами не показана из-за своего большого размера
+ 112 - 112
backend/graphify-out/2026-08-30/graph.json


+ 223 - 222
backend/graphify-out/GRAPH_REPORT.md

@@ -1,16 +1,16 @@
 # Graph Report - backend  (2026-08-30)
 
 ## Corpus Check
-- 367 files · ~260,134 words
+- 367 files · ~260,637 words
 - Verdict: corpus is large enough that graph structure adds value.
 
 ## Summary
-- 5306 nodes · 20069 edges · 193 communities (175 shown, 18 thin omitted)
-- Extraction: 95% EXTRACTED · 5% INFERRED · 0% AMBIGUOUS · INFERRED: 1026 edges (avg confidence: 0.52)
+- 5319 nodes · 20121 edges · 194 communities (175 shown, 19 thin omitted)
+- Extraction: 95% EXTRACTED · 5% INFERRED · 0% AMBIGUOUS · INFERRED: 1029 edges (avg confidence: 0.53)
 - Token cost: 0 input · 0 output
 
 ## Graph Freshness
-- Built from commit: `3011cb9d`
+- Built from commit: `19c5aaa8`
 - Run `git rev-parse HEAD` and compare to check if the graph is stale.
 - Run `graphify update .` after code changes (no API cost).
 
@@ -171,9 +171,10 @@
 - [[_COMMUNITY_web_login_rsa_public_key|web_login_rsa_public_key]]
 - [[_COMMUNITY_redis_client.py|redis_client.py]]
 - [[_COMMUNITY_WechatMessageService|WechatMessageService]]
-- [[_COMMUNITY__build_user_info_payload|_build_user_info_payload]]
-- [[_COMMUNITY_config.py|config.py]]
-- [[_COMMUNITY_CrmProduct|CrmProduct]]
+- [[_COMMUNITY_list_product_options|list_product_options]]
+- [[_COMMUNITY_datetime_parse.py|datetime_parse.py]]
+- [[_COMMUNITY_create_from_quote|create_from_quote]]
+- [[_COMMUNITY_web_login_rsa_public_key|web_login_rsa_public_key]]
 - [[_COMMUNITY_get_client_ip|get_client_ip]]
 - [[_COMMUNITY_context.py|context.py]]
 - [[_COMMUNITY_.to_tenant_user_dict|.to_tenant_user_dict]]
@@ -226,15 +227,15 @@
 ## Import Cycles
 - None detected.
 
-## Communities (193 total, 18 thin omitted)
+## Communities (194 total, 19 thin omitted)
 
 ### Community 0 - "Community 0"
 Cohesion: 0.08
-Nodes (66): archive_plan(), archive_plan_draft(), PlanArchiveBody, PlanArchiveFeedbacksBlock, PlanArchiveFreightBlock, PlanArchiveProductItem, PlanProductCreate, PlanSiteFeedbackUpdateBody (+58 more)
+Nodes (77): archive_plan(), archive_plan_draft(), create_plan_full(), get_plan(), 创建运输计划(完整表单:供方/需方 + 产品库产品 + 可选预选车辆,不自动安排运输), update_plan(), PlPlan, PlPlanProduct (+69 more)
 
 ### Community 1 - "Community 1"
-Cohesion: 0.08
-Nodes (33): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, ContractApproverSettingSaveBody, ContractApprovalActionBody, ContractBatchAssignBody, ContractBatchSubmitBody, ContractChangeCreateBody, ContractChangeUpdateBody, ContractCreateBody (+25 more)
+Cohesion: 0.05
+Nodes (55): RecognizeCertResult, PageResult, ResponseModel, BaseModel, PagedQuery, PagedResponse, InvoiceAttachmentOut, InvoiceOut (+47 more)
 
 ### Community 2 - "Community 2"
 Cohesion: 0.18
@@ -242,55 +243,55 @@ Nodes (21): allocate_reimburse_title_seq(), format_reimburse_title(), generate_a
 
 ### Community 3 - "Community 3"
 Cohesion: 0.06
-Nodes (88): attachment_download_url(), attachment_preview_url(), create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite(), create_post() (+80 more)
+Nodes (84): attachment_download_url(), attachment_preview_url(), create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite(), create_post() (+76 more)
 
 ### Community 4 - "Community 4"
-Cohesion: 0.12
-Nodes (61): _apply_list_filters(), assign_opportunities(), batch_update_expect_date(), batch_update_stage(), change_stage(), create_opportunity(), _decimal_value(), _enrich_user_names() (+53 more)
+Cohesion: 0.09
+Nodes (76): _apply_list_filters(), assign_opportunities(), batch_update_expect_date(), batch_update_stage(), change_stage(), create_opportunity(), _decimal_value(), _enrich_user_names() (+68 more)
 
 ### Community 5 - "Community 5"
 Cohesion: 0.20
 Nodes (21): _assert_users_exist(), get_setting(), Any, Session, _row_to_dict(), save_setting(), _assert_users_exist(), get_setting() (+13 more)
 
 ### Community 6 - "Community 6"
-Cohesion: 0.12
-Nodes (42): customer_check_duplicate(), customer_create(), customer_update(), pool_customer_export(), pool_customer_list(), assign_customer(), batch_claim_customers(), check_duplicate_customer() (+34 more)
+Cohesion: 0.05
+Nodes (81): customer_check_duplicate(), customer_create(), customer_deal(), customer_delete(), customer_detail(), customer_generate_no(), customer_into_pool(), customer_transfer() (+73 more)
 
 ### Community 7 - "Community 7"
 Cohesion: 0.08
-Nodes (52): accumulate_stop_products(), aggregate_contract_product_plan_qtys(), assert_contract_qty_for_arrange(), _bucket_for_plan(), build_contract_qty_reminder_payload(), collect_plan_contract_qty_checks(), contract_ids_linked_to_plan(), contract_product_has_fixed_qty() (+44 more)
+Nodes (56): accumulate_stop_products(), aggregate_contract_product_plan_qtys(), assert_contract_qty_for_arrange(), _bucket_for_plan(), build_contract_qty_reminder_payload(), collect_plan_contract_qty_checks(), contract_product_has_fixed_qty(), effective_arranged_total() (+48 more)
 
 ### Community 8 - "Community 8"
-Cohesion: 0.19
-Nodes (20): approve_quote(), can_user_approve(), create_approval_records(), delete_pending_approvals(), get_quote_approval(), list_quote_approvals(), Any, Session (+12 more)
+Cohesion: 0.17
+Nodes (22): approve_quote(), can_user_approve(), create_approval_records(), delete_pending_approvals(), get_quote_approval(), invalidate_all_approvals(), list_quote_approvals(), Any (+14 more)
 
 ### Community 9 - "Community 9"
-Cohesion: 0.09
-Nodes (54): download_reimburse_import_template(), clue_import_template(), customer_import_template(), product_import_template(), build_annotated_result_bytes(), build_applicant_label(), build_expense_path_labels(), build_import_template_bytes() (+46 more)
+Cohesion: 0.10
+Nodes (48): download_reimburse_import_template(), build_annotated_result_bytes(), build_applicant_label(), build_expense_path_labels(), build_import_template_bytes(), cell_str(), _ids_visible_in_web_tree(), import_reimburse_workbook() (+40 more)
 
 ### Community 10 - "Community 10"
-Cohesion: 0.05
-Nodes (87): _build_driver_url(), get_plan_arrange_info(), 获取计划已安排运输后的司机链接与地磅出入库关联(供查看弹窗复制简述/二维码)。, BaseModel, CustomerAssignPoolBody, CustomerCheckDuplicateBody, CustomerClaimBody, CustomerDealBody (+79 more)
+Cohesion: 0.11
+Nodes (39): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), export_unsettled_plans(), _generate_settlement_no(), get_settlement() (+31 more)
 
 ### Community 11 - "Community 11"
 Cohesion: 0.10
-Nodes (59): cancel_apply(), create_apply(), create_disburse(), delete_applies(), delete_disburses(), export_urea_applies(), export_urea_disburse_board(), get_apply() (+51 more)
+Nodes (57): cancel_apply(), create_apply(), create_disburse(), delete_applies(), delete_disburses(), export_urea_applies(), get_apply(), get_disburse() (+49 more)
 
 ### Community 12 - "Community 12"
 Cohesion: 0.08
 Nodes (40): AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest, LoginResponse, Pydantic schemas - 用户认证, ResetPasswordRequest, UserCreate (+32 more)
 
 ### Community 13 - "Community 13"
-Cohesion: 0.07
-Nodes (46): SoftDeleteModel, BizAttachment, PlFreightSettlementTransport, PlInboundOrder, PlInboundOrderItem, PlInboundOrderItemBrandQty, PlInventoryWarning, PlOcrUsageMonth (+38 more)
+Cohesion: 0.05
+Nodes (147): clue_check_convert(), clue_check_duplicate(), clue_detail(), clue_export(), clue_follow_statistics(), clue_import(), clue_list(), clue_mine() (+139 more)
 
 ### Community 14 - "Community 14"
-Cohesion: 0.14
-Nodes (41): PlPlanDeliveryProduct, PlTransportDriverStopFeedback, PlTransportSiteStopFeedback, 运输计划-送货段产品明细 pl_plan_delivery_product, 运输单-司机按段附件回传 pl_transport_driver_stop_feedback, 运输单-现场按段回传 pl_transport_site_stop_feedback, _direction_label(), _dump_product_feedbacks() (+33 more)
+Cohesion: 0.11
+Nodes (33): PlPlanDelivery, PlPlanDeliveryProduct, PlPlanLoadProduct, 运输计划-装货段产品明细 pl_plan_load_product, 运输计划-送货段 pl_plan_delivery(plan 1:N), 运输计划-送货段产品明细 pl_plan_delivery_product, PlanArchiveDeliveryBlock, PlanArchiveLoadBlock (+25 more)
 
 ### Community 15 - "Community 15"
 Cohesion: 0.12
-Nodes (12): BxReimburseApply, BxReimburseApproval, BxReimburseDetail, ReimburseInvoiceBriefOut, Any, Session, 归一化勾选链接;返回 None 表示未传(不改关联),[] 表示清空。, 是否可选择他人作为报销申请人(超管或具备按钮权限)。 (+4 more)
+Nodes (13): BxReimburseApply, BxReimburseApproval, BxReimburseDetail, 报销单勾选的发票附件(同一发票可勾选多个附件,各占一条)。, ReimburseInvoiceBriefOut, ReimburseInvoiceLinkIn, Any, Session (+5 more)
 
 ### Community 16 - "Community 16"
 Cohesion: 0.36
@@ -298,31 +299,31 @@ Nodes (7): list_ethnics(), Any, Session, 民族码表 CRUD(全局 sys_ethnic
 
 ### Community 17 - "Community 17"
 Cohesion: 0.09
-Nodes (32): approve_carrier(), create_carrier(), get_carrier(), list_carriers(), update_carrier(), carrier_to_read(), CarrierBase, CarrierCreate (+24 more)
+Nodes (42): 返回 (作废, 归档)。现场链接实际走入库/出库单公共页。, _resolve_io_order_link_flags(), _build_public_page(), _build_site_product_read(), _format_file_size(), get_public_site(), _get_site_link_by_token(), _parse_feedback_images() (+34 more)
 
 ### Community 18 - "Community 18"
-Cohesion: 0.12
-Nodes (45): BxApplyListExportBody, bx_health(), 报销(bx)API 路由聚合 — REST 风格,协议对齐 bx 原系统。, P0 健康检查:验证 bx 路由已挂载且响应协议为 code=0。, approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse() (+37 more)
+Cohesion: 0.16
+Nodes (36): BxApplyListExportBody, approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse(), export_approved_by_me_reimburses(), export_my_reimburses() (+28 more)
 
 ### Community 19 - "Community 19"
-Cohesion: 0.10
-Nodes (44): _apply_plan_product_update(), _apply_plan_update(), AutoGenerateMonthlyResult, _base_query(), create_plan(), delete_plan(), export_plans(), _generate_plan_no() (+36 more)
+Cohesion: 0.14
+Nodes (41): PlPlanContract, 运输计划-合同关联(分侧多选) pl_plan_contract, PlanContractLink, PlanDeliveryBody, PlanLoadBody, assert_at_most_one_contract(), assert_delivery_products_in_selected_contract(), assert_load_products_in_selected_contract() (+33 more)
 
 ### Community 20 - "Community 20"
-Cohesion: 0.08
-Nodes (48): dump_export_row(), issue_status_label(), Any, Session, respond_xlsx(), status_label(), advance_issue_stats(), batch_offset() (+40 more)
+Cohesion: 0.09
+Nodes (45): dump_export_row(), issue_status_label(), Any, Session, respond_xlsx(), status_label(), advance_issue_stats(), batch_offset() (+37 more)
 
 ### Community 21 - "Community 21"
-Cohesion: 0.22
-Nodes (26): PlVehicleRechargeApply, 车辆ETC/加油充值申请 pl_vehicle_recharge_apply, 发放登记页:申请单 + 关联发放信息(左连接), VehicleRechargeApplyRead, VehicleRechargeDisburseBoardItem, apply_to_read(), _assert_vehicle_exists(), board_item_to_read() (+18 more)
+Cohesion: 0.18
+Nodes (36): PlVehicleRechargeApply, PlVehicleRechargeRecord, 车辆ETC/加油充值申请 pl_vehicle_recharge_apply, 车辆ETC/加油充值发放登记 pl_vehicle_recharge_record, 发放登记页:申请单 + 关联发放信息(左连接), VehicleRechargeApplyRead, VehicleRechargeDisburseBoardItem, VehicleRechargeRecordRead (+28 more)
 
 ### Community 22 - "Community 22"
 Cohesion: 0.08
 Nodes (28): parse_admin_request_json(), Any, Request, 运营 Web(/web/admin)JSON 请求体解析。  与 ApiCryptoMiddleware 配合:中间件未改写 body 时,在路由内解密 `{, 读取 JSON body;dict 时走 resolve_request_payload(明文 / 密文 / data 包装)。      Returns:, ApiCryptoError, _b64url_decode(), _b64url_encode() (+20 more)
 
 ### Community 23 - "Community 23"
-Cohesion: 0.17
-Nodes (24): PlPlanProductBrandQty, 计划产品归档品牌数量 pl_plan_product_brand_qty      stop_product_id 为空:计划产品级汇总;非空:装货/送货段产品, _is_plan_level_row(), load_brand_qtys_by_plan_product_ids(), load_brand_qtys_by_stop_product_ids(), _parse_unit_price(), persist_plan_product_brand_qtys(), persist_stop_product_brand_qtys() (+16 more)
+Cohesion: 0.12
+Nodes (35): PlPlanProductBrandQty, 计划产品归档品牌数量 pl_plan_product_brand_qty      stop_product_id 为空:计划产品级汇总;非空:装货/送货段产品, _is_plan_level_row(), load_brand_qtys_by_plan_product_ids(), load_brand_qtys_by_stop_product_ids(), _parse_unit_price(), persist_plan_product_brand_qtys(), persist_stop_product_brand_qtys() (+27 more)
 
 ### Community 24 - "Community 24"
 Cohesion: 0.19
@@ -333,36 +334,36 @@ Cohesion: 0.26
 Nodes (12): list_share_logs(), _parse_user_agent(), Any, Session, CRM 报价单分享访问日志 CRUD — 对照 CrmQuoteShareLogServiceImpl.java, Java: statisticsVisits, 简易 User-Agent 解析(替代 Hutool UserAgentUtil), Java: queryLogsByQuoteId (+4 more)
 
 ### Community 26 - "Community 26"
-Cohesion: 0.18
-Nodes (31): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), legacy_parent_id(), load_oss_id_to_url(), load_runtime_settings() (+23 more)
+Cohesion: 0.22
+Nodes (8): CustomerAssignPoolBody, CustomerCheckDuplicateBody, CustomerClaimBody, CustomerDealBody, CustomerDetailBody, CustomerIntoPoolBody, CustomerTransferBody, CRM 客户管理 Pydantic Schemas
 
 ### Community 27 - "Community 27"
-Cohesion: 0.18
-Nodes (29): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_oss_id_to_url(), load_runtime_settings(), load_settings_env() (+21 more)
+Cohesion: 0.15
+Nodes (24): list_vehicles(), _vehicle_to_read(), PlCert, PlDocumentReminder, 证件到期提醒表 pl_document_reminder, CertRead, CertRow, SnapshotCertRead (+16 more)
 
 ### Community 28 - "Community 28"
-Cohesion: 0.06
-Nodes (95): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), export_settlements(), export_unsettled_plans(), _generate_settlement_no() (+87 more)
+Cohesion: 0.12
+Nodes (52): PlFreightSettlement, PlFreightSettlementApproval, 运费结算表 pl_freight_settlement, 运费结算审批 pl_freight_settlement_approval, _advance_after_approval(), _approval_to_dict(), can_user_approve_settlement(), cancel_draft_settlement() (+44 more)
 
 ### Community 29 - "Community 29"
-Cohesion: 0.13
-Nodes (48): register_quote_routes(), accept_quote(), invalidate_all_approvals(), 作废该报价单全部有效审批记录(含已通过/已拒绝),用于再编辑或重新提审。, assert_quote_editable_for_update(), calculate_quote_amount(), create_new_version(), create_quote() (+40 more)
+Cohesion: 0.10
+Nodes (68): register_quote_routes(), accept_quote(), assert_quote_editable_for_update(), _build_quote_filters(), calculate_quote_amount(), create_new_version(), create_quote(), _decimal_value() (+60 more)
 
 ### Community 30 - "Community 30"
 Cohesion: 0.16
 Nodes (26): clear_target_categories(), compute_level(), count_target_rows(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_runtime_settings() (+18 more)
 
 ### Community 31 - "Community 31"
-Cohesion: 0.12
-Nodes (45): _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), export_weighing(), _get_weighing(), get_weighing_related() (+37 more)
+Cohesion: 0.17
+Nodes (28): _apply_inventory_product_update(), _apply_inventory_update(), _base_query(), create_inventory(), create_link_for_plan(), delete_inventory(), export_inventory(), _generate_batch_no() (+20 more)
 
 ### Community 32 - "Community 32"
-Cohesion: 0.15
-Nodes (27): 验证密码(哈希非 bcrypt 或损坏时返回 False,避免抛错), verify_password(), change_password(), create_user(), get_user(), get_user_with_relations(), _hash_password(), list_post_ids_for_user() (+19 more)
+Cohesion: 0.16
+Nodes (25): change_password(), create_user(), get_user(), get_user_with_relations(), _hash_password(), list_post_ids_for_user(), list_user_ids_bound_to_post(), list_users() (+17 more)
 
 ### Community 33 - "Community 33"
-Cohesion: 0.12
-Nodes (29): contact_add(), contact_by_customer(), contact_delete(), contact_detail(), contact_set_primary(), contact_update(), create_contact(), get_contact() (+21 more)
+Cohesion: 0.14
+Nodes (26): contact_add(), contact_by_customer(), contact_delete(), contact_detail(), contact_set_primary(), contact_update(), create_contact(), get_contact() (+18 more)
 
 ### Community 34 - "Community 34"
 Cohesion: 0.14
@@ -374,23 +375,23 @@ Nodes (36): clear_portal_workflow(), _dec(), derive_source_url(), fetch_portal_a
 
 ### Community 36 - "Community 36"
 Cohesion: 0.17
-Nodes (28): _assert_brand_deletable(), barcode_exists(), category_code_exists(), create_category(), create_product(), generate_auto_product_no(), generate_barcode(), generate_product_no() (+20 more)
+Nodes (29): _assert_brand_deletable(), barcode_exists(), category_code_exists(), create_category(), create_product(), generate_auto_product_no(), generate_barcode(), generate_product_no() (+21 more)
 
 ### Community 37 - "Community 37"
-Cohesion: 0.12
-Nodes (38): check_document_expiry(), document_reminder_stats(), DocumentReminderExportBody, export_document_reminders(), export_inventory_ledger(), get_inventory_ledger(), get_summary(), InventoryLedgerExportBody (+30 more)
+Cohesion: 0.10
+Nodes (53): check_document_expiry(), document_reminder_stats(), DocumentReminderExportBody, export_document_reminders(), export_inventory_ledger(), get_inventory_ledger(), get_summary(), InventoryLedgerExportBody (+45 more)
 
 ### Community 38 - "Community 38"
 Cohesion: 0.31
 Nodes (9): decrypt_login_payload(), ensure_initialized(), extract_login_credentials(), get_public_pem(), Any, 登录凭据 RSA 解密(与前端 JSEncrypt PKCS#1 v1.5 兼容)。, Base64 密文 -> JSON 对象(须含 username、password、ts 毫秒时间戳)。, 从请求体解析用户名、密码。     返回 (username, password, error_message);error_message 非空时表示失败。 (+1 more)
 
 ### Community 39 - "Community 39"
-Cohesion: 0.18
-Nodes (17): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+9 more)
+Cohesion: 0.08
+Nodes (43): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+35 more)
 
 ### Community 40 - "Community 40"
-Cohesion: 0.09
-Nodes (38): build_dict_value_from_label(), ensure_dict_data(), format_hhmm(), format_time_label(), grab(), list_duty_staff_users(), normalize_person_name(), _pad_hhmm() (+30 more)
+Cohesion: 0.11
+Nodes (33): assert_user_is_duty_staff(), build_dict_value_from_label(), DutyBizError, ensure_dict_data(), grab(), list_duty_staff_users(), normalize_person_name(), _pad_hhmm() (+25 more)
 
 ### Community 41 - "Community 41"
 Cohesion: 0.22
@@ -401,8 +402,8 @@ Cohesion: 0.19
 Nodes (32): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_oss_id_to_url(), load_runtime_settings(), load_settings_env() (+24 more)
 
 ### Community 43 - "Community 43"
-Cohesion: 0.09
-Nodes (35): create_invoice(), delete_invoice(), export_invoice_wallets(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices(), Request (+27 more)
+Cohesion: 0.10
+Nodes (33): BxExportBodyBase, create_invoice(), delete_invoice(), export_invoice_wallets(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices() (+25 more)
 
 ### Community 44 - "Community 44"
 Cohesion: 0.19
@@ -413,24 +414,24 @@ Cohesion: 0.30
 Nodes (48): AttachmentDownloadUrlBody, DemoXlsxColumnSpec, DemoXlsxExportBody, DeptCreateBody, DeptExportBody, DeptUpdateBody, DictDataCreateBody, DictDataUpdateBody (+40 more)
 
 ### Community 46 - "Community 46"
-Cohesion: 0.11
-Nodes (24): PlPlanDelivery, PlPlanLoad, PlPlanLoadProduct, 运输计划-装货段 pl_plan_load(plan 1:1), 运输计划-装货段产品明细 pl_plan_load_product, 运输计划-送货段 pl_plan_delivery(plan 1:N), main(), _migrate_plan() (+16 more)
+Cohesion: 0.15
+Nodes (39): PlTransportDriverStopFeedback, PlTransportSiteStopFeedback, 运输单-司机按段附件回传 pl_transport_driver_stop_feedback, 运输单-现场按段回传 pl_transport_site_stop_feedback, _direction_label(), _dump_product_feedbacks(), _dump_urls(), _get_driver_feedback_row() (+31 more)
 
 ### Community 47 - "Community 47"
-Cohesion: 0.17
-Nodes (23): cancel_apply(), create_apply(), delete_applies(), delete_records(), export_recharge_applies(), export_recharge_disburse_board(), get_apply(), get_record() (+15 more)
+Cohesion: 0.11
+Nodes (35): Session, recognize_cert(), RecognizeCertBody, cancel_apply(), create_apply(), create_record(), delete_applies(), delete_records() (+27 more)
 
 ### Community 48 - "Community 48"
 Cohesion: 0.08
-Nodes (81): register_contract_routes(), _apply_contract_entity_fields(), batch_assign_owner(), batch_submit_contract_approval(), _build_contract_filters(), _build_contract_name_from_parties(), _build_customer_address(), _calc_amount_with_tax() (+73 more)
+Nodes (62): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, register_contract_routes(), 接口菜单权限守卫。super_admin 直接放行。, require_menu_code(), batch_assign_owner(), batch_submit_contract_approval(), _contract_period_key(), contract_row_to_dict() (+54 more)
 
 ### Community 49 - "Community 49"
-Cohesion: 0.18
-Nodes (17): _build_history_page(), _build_page(), _get_by_token(), _history_status_label(), _models(), _parse_history_date(), date, Session (+9 more)
+Cohesion: 0.22
+Nodes (8): IoOrderItemPatch, IoOrderItemRead, PublicIoOrderFeedback, PublicIoOrderHistoryProductRead, PublicIoOrderItemFeedback, PublicIoOrderStopFeedback, PublicIoOrderStopProductFeedback, 入库单 / 出库单 Pydantic schemas
 
 ### Community 50 - "Community 50"
-Cohesion: 0.10
-Nodes (57): generate_uuid(), PlPlanProduct, PlTransportDbLink, 计划产品明细表 pl_plan_product, 运输-地磅出入库关联 pl_transport_db_link, _apply_plan_quantity_delta(), apply_stop_dibang_options(), _create_db_inventory() (+49 more)
+Cohesion: 0.08
+Nodes (78): ContractGapExportBody, PlanExportBody, DbInboundOutbound, DbPurchasePlan, PlDriver, PlPlanLoad, PlTransportDbLink, 司机表 pl_driver(兼容旧表,迁移后逐步废弃) (+70 more)
 
 ### Community 51 - "Community 51"
 Cohesion: 0.22
@@ -438,31 +439,31 @@ Nodes (21): _address_to_read(), _build_address_query(), create_transport_address
 
 ### Community 52 - "Community 52"
 Cohesion: 0.13
-Nodes (30): _assert_editable(), _build_public_page(), _format_file_size(), _get_inventory_by_token(), get_public_inventory(), _parse_feedback_images(), Session, UploadFile (+22 more)
+Nodes (26): _assert_editable(), _build_public_page(), _format_file_size(), _get_inventory_by_token(), get_public_inventory(), _parse_feedback_images(), Session, UploadFile (+18 more)
 
 ### Community 53 - "Community 53"
-Cohesion: 0.18
-Nodes (10): plan_requires_site_link(), Session, 装货或送货段任一段客户为山峡/云栋时,需要生成现场链接。, _FakeQuery, _FakeSession, _plan(), 现场链接生成条件:装货/送货段含山峡或云栋客户, test_external_stops_do_not_require_site_link() (+2 more)
+Cohesion: 0.20
+Nodes (7): _FakeQuery, _FakeSession, _plan(), 现场链接生成条件:装货/送货段含山峡或云栋客户, test_external_stops_do_not_require_site_link(), test_internal_delivery_requires_site_link(), test_legacy_plan_customer_fallback()
 
 ### Community 54 - "Community 54"
-Cohesion: 0.11
-Nodes (40): CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), _change_row_to_dict(), create_contract_change(), create_contract_template(), _enrich_change_rows(), execute_change(), export_contract_changes() (+32 more)
+Cohesion: 0.19
+Nodes (32): CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), _change_row_to_dict(), create_contract_change(), create_contract_template(), _enrich_change_rows(), execute_change(), export_contract_changes() (+24 more)
 
 ### Community 55 - "Community 55"
-Cohesion: 0.11
-Nodes (18): ApiCryptoMiddleware, ApiRequestLogMiddleware, _db_pool_keepalive_loop(), _error_json(), lifespan(), Exception, Request, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误 (+10 more)
+Cohesion: 0.18
+Nodes (31): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), legacy_parent_id(), load_oss_id_to_url(), load_runtime_settings() (+23 more)
 
 ### Community 56 - "Community 56"
-Cohesion: 0.06
-Nodes (79): _attach_history_products(), _resolve_site_link_flags(), _as_date(), _build_driver_url(), _build_history_stop_reads(), _build_public_page(), _build_stop_product_reads(), _format_file_size() (+71 more)
+Cohesion: 0.07
+Nodes (78): _attach_history_products(), _resolve_unit_label(), _as_date(), _build_driver_url(), _build_history_stop_reads(), _build_public_page(), _build_stop_product_reads(), _format_file_size() (+70 more)
 
 ### Community 57 - "Community 57"
 Cohesion: 0.21
 Nodes (22): clear_target_products(), count_target_rows(), _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_runtime_settings() (+14 more)
 
 ### Community 58 - "Community 58"
-Cohesion: 0.16
-Nodes (18): create_expense_item(), delete_expense_item(), ExpenseItemExportBody, export_expense_items(), _flatten_expense_tree(), get_expense_item(), get_expense_item_tree(), Session (+10 more)
+Cohesion: 0.11
+Nodes (24): create_expense_item(), delete_expense_item(), ExpenseItemExportBody, export_expense_items(), _flatten_expense_tree(), get_expense_item(), get_expense_item_tree(), Session (+16 more)
 
 ### Community 59 - "Community 59"
 Cohesion: 0.20
@@ -473,36 +474,36 @@ Cohesion: 0.24
 Nodes (5): MinIOStorage, Any, 从 MINIO_BASE_URL 解析公网 endpoint;未配置或与内网相同时复用 self.client。, MinIO 预签名下载 URL,携带原始文件名。, MinIO 预签名内联预览 URL(图片新标签页 / PDF iframe 等)。          上传时 put_object 未写 content_typ
 
 ### Community 61 - "Community 61"
-Cohesion: 0.23
-Nodes (10): check_customer_protect_time(), pool_recovery_job(), Session, 每天凌晨1点:检查保护期到期客户,跟进次数不足则退回公海, 每天早上9点:保护期到期提醒(3天内到期且跟进不足), _recycle_to_pool(), remind_customer_recycle(), warn_customer_recycle() (+2 more)
+Cohesion: 0.06
+Nodes (50): pool_record_detail(), pool_record_list(), pool_rule_add(), pool_rule_delete(), pool_rule_detail(), pool_rule_execute(), pool_rule_update(), pool_rule_update_status() (+42 more)
 
 ### Community 62 - "Community 62"
-Cohesion: 0.16
-Nodes (18): _alias_row_to_dict(), _brand_row_to_dict(), _build_category_tree(), _category_row_to_dict(), _collect_category_with_ancestors(), list_categories(), list_category_tree(), list_oss_by_biz() (+10 more)
+Cohesion: 0.08
+Nodes (37): 分页查询供方列表 — Java: CrmSupplierInfoController.list, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方详情 — Java: CrmSupplierInfoController.getInfo, 新增供方 — Java: CrmSupplierInfoController.add, 修改供方 — Java: CrmSupplierInfoController.edit, 删除供方 — Java: CrmSupplierInfoController.remove, 导出供方列表 — Java: CrmSupplierInfoController.export, supplier_info_add() (+29 more)
 
 ### Community 63 - "Community 63"
-Cohesion: 0.08
-Nodes (72): put_plan_side_contracts(), put_plan_stop_contracts(), PlPlanContract, 运输计划-合同关联(分侧多选) pl_plan_contract, PlanContractGapRead, PlanContractLink, PlanDeliveryRead, PlanLoadRead (+64 more)
+Cohesion: 0.24
+Nodes (9): parse_resource_snapshot(), Any, 运输计划 - 安排运输时车辆/人员/证件资源快照 Schema, 从 ORM 文本列或 dict 解析快照。, SnapshotPersonnelRow, TransportResourceSnapshot, build_transport_resource_snapshot(), Session (+1 more)
 
 ### Community 64 - "Community 64"
 Cohesion: 0.18
-Nodes (26): CarrierExportBody, DriverExportBody, export_carriers(), paste_recognize_commit(), PersonnelExportBody, 导出承运商列表(当前筛选全量,或 ids 已选)。, VehicleExportBody, PlPersonnel (+18 more)
+Nodes (29): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_oss_id_to_url(), load_runtime_settings(), load_settings_env() (+21 more)
 
 ### Community 65 - "Community 65"
-Cohesion: 0.09
-Nodes (67): cancel_apply(), create_apply(), create_process(), delete_applies(), delete_processes(), export_applies(), export_process_board(), get_apply() (+59 more)
+Cohesion: 0.15
+Nodes (42): PlVehicleMaintenanceApply, PlVehicleMaintenanceProcess, 车辆维保申请 pl_vehicle_maintenance_apply, 车辆维保处理登记 pl_vehicle_maintenance_process, Decimal, VehicleMaintenanceApplyCreate, VehicleMaintenanceApplyRead, VehicleMaintenanceApplyReminder (+34 more)
 
 ### Community 66 - "Community 66"
-Cohesion: 0.09
-Nodes (24): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), Session, read_customer_stop_pref(), menu_badge_stats() (+16 more)
+Cohesion: 0.05
+Nodes (37): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), Session, read_customer_stop_pref(), menu_badge_stats() (+29 more)
 
 ### Community 67 - "Community 67"
 Cohesion: 0.12
 Nodes (36): get_password_hash(), Namespace, build_merged_users(), bx_role_labels(), check_minio(), check_mysql(), check_redis(), _clip() (+28 more)
 
 ### Community 68 - "Community 68"
-Cohesion: 0.23
-Nodes (17): _actor_ids(), _actor_names(), assert_rows_deletable_by_creator(), can_delete_by_creator(), is_super_admin(), normalize_user_info(), Any, 删除权限:仅创建人可删(super_admin 例外)。 (+9 more)
+Cohesion: 0.22
+Nodes (19): _actor_ids(), _actor_names(), assert_row_deletable_by_creator(), assert_rows_deletable_by_creator(), can_delete_by_creator(), is_super_admin(), normalize_user_info(), Any (+11 more)
 
 ### Community 69 - "Community 69"
 Cohesion: 0.26
@@ -510,55 +511,55 @@ Nodes (12): load_plan_document_attachments_by_plan_ids(), _parse_image_urls(), S
 
 ### Community 70 - "Community 70"
 Cohesion: 0.14
-Nodes (25): PlTransportProductBrandQty, PlTransportProductFeedback, 运输单按产品回传 pl_transport_product_feedback, 运输单产品回传品牌数量 pl_transport_product_brand_qty, _dict_field(), format_brand_qty_summary(), load_transport_driver_product_feedbacks(), persist_io_item_brand_qtys() (+17 more)
+Nodes (24): PlTransportProductBrandQty, PlTransportProductFeedback, 运输单按产品回传 pl_transport_product_feedback, 运输单产品回传品牌数量 pl_transport_product_brand_qty, _dict_field(), format_brand_qty_summary(), load_transport_driver_product_feedbacks(), persist_io_item_brand_qtys() (+16 more)
 
 ### Community 71 - "Community 71"
 Cohesion: 0.25
 Nodes (18): batch_generate_sample_codes(), batch_issue_sample_codes(), batch_revoke_sample_codes(), create_sample_code(), get_sample_code(), list_sample_codes(), _parse_issued_time(), Any (+10 more)
 
 ### Community 72 - "Community 72"
-Cohesion: 0.20
-Nodes (10): public_grab(), public_page(), Session, Config, format_api_error_message(), PageResult, Exception, 将 HTTP/SQLAlchemy 等异常转为可展示的错误文案(避免 str([]) 空列表)。 (+2 more)
+Cohesion: 0.14
+Nodes (30): _apply_contract_entity_fields(), _build_contract_filters(), _build_contract_name_from_parties(), _build_customer_address(), _calc_amount_with_tax(), contract_no_exists(), create_contract(), _decimal_value() (+22 more)
 
 ### Community 73 - "Community 73"
 Cohesion: 0.20
 Nodes (25): derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_oss_id_to_url(), load_runtime_settings(), load_settings_env(), load_user_mapping() (+17 more)
 
 ### Community 74 - "Community 74"
-Cohesion: 0.26
-Nodes (15): DeliveryPrintCustomerOption, DeliverySlipPrintRead, build_delivery_slip_print(), _customer_key(), _delivery_matches_customer(), get_delivery_slip_print_context(), list_delivery_print_customers(), _merge_stop_products() (+7 more)
+Cohesion: 0.14
+Nodes (27): invoice_info_add(), invoice_info_by_customer(), _invoice_info_by_customer_impl(), invoice_info_delete(), invoice_info_list(), invoice_info_set_default(), invoice_info_update(), 按客户ID查询开票信息(与 by-customer 等价) (+19 more)
 
 ### Community 75 - "apply_crm_create_by_scope"
-Cohesion: 0.13
-Nodes (22): _build_quote_filters(), _fill_contract_linked_count(), list_quotes(), _parse_optional_date(), _parse_optional_datetime(), _period_key(), Any, date (+14 more)
+Cohesion: 0.18
+Nodes (25): _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), _get_weighing(), get_weighing_related(), _kg_to_ton() (+17 more)
 
 ### Community 76 - "opportunity_follow.py"
-Cohesion: 0.14
-Nodes (28): _append_user_scope_conditions(), apply_data_scope(), assert_row_in_data_scope(), _collect_scope_ids(), _get_child_dept_ids(), get_user_dept_id(), Session, 数据权限过滤(V0.3:基于角色 data_scope 的查询级行级过滤)  data_scope 值:   1 = 全部数据   2 = 本部门数据   3 (+20 more)
+Cohesion: 0.12
+Nodes (32): _append_user_scope_conditions(), apply_data_scope(), assert_row_in_data_scope(), _collect_scope_ids(), _get_child_dept_ids(), get_user_dept_id(), Session, 数据权限过滤(V0.3:基于角色 data_scope 的查询级行级过滤)  data_scope 值:   1 = 全部数据   2 = 本部门数据   3 (+24 more)
 
 ### Community 77 - "Community 77"
 Cohesion: 0.11
 Nodes (12): get_wechat_pay_client(), get_wechat_pay_v2(), Any, 微信支付工具模块  支持微信支付 V3 API 文档参考: https://pay.weixin.qq.com/docs/v3/apis/index.html, 统一下单接口 (V3)          Args:             out_trade_no: 商户订单号             total_amo, 申请退款          Args:             out_trade_no: 商户订单号             total_amount: 订单, 小程序调起支付的二次签名参数(与公众号 JSAPI 规则一致), 统一下单 (V2 API)          Args:             out_trade_no: 商户订单号             total_f (+4 more)
 
 ### Community 78 - "Community 78"
-Cohesion: 0.08
-Nodes (35): 分页查询供方列表 — Java: CrmSupplierInfoController.list, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 新增供方 — Java: CrmSupplierInfoController.add, 修改供方 — Java: CrmSupplierInfoController.edit, 删除供方 — Java: CrmSupplierInfoController.remove, 导出供方列表 — Java: CrmSupplierInfoController.export, supplier_info_add(), supplier_info_delete() (+27 more)
+Cohesion: 0.15
+Nodes (23): 地磅 API 路由聚合 — REST 风格,协议对齐原 simple-dibang-xiaoshou。, AutoGenerateMonthlyResult, _base_query(), create_plan(), delete_plan(), _generate_plan_no(), get_plan(), _get_plan_by_id_only() (+15 more)
 
 ### Community 79 - "PlCarrier"
 Cohesion: 0.19
 Nodes (18): create_role(), get_role(), get_role_data_scope(), get_role_menu_ids(), list_roles(), Any, Session, 角色 CRUD(sys_role / sys_role_menu / sys_role_data_scope_detail) (+10 more)
 
 ### Community 80 - "resolve_crm_product"
-Cohesion: 0.11
-Nodes (47): bind_vehicle_driver(), create_driver(), create_personnel(), delete_carrier(), delete_driver(), delete_personnel(), delete_vehicle(), export_drivers() (+39 more)
+Cohesion: 0.06
+Nodes (91): approve_carrier(), bind_vehicle_driver(), CarrierExportBody, create_carrier(), create_driver(), create_personnel(), delete_carrier(), delete_driver() (+83 more)
 
 ### Community 81 - "customer_follow.py"
-Cohesion: 0.12
-Nodes (40): _apply_inventory_product_update(), _apply_inventory_update(), _base_query(), create_inventory(), create_link_for_plan(), delete_inventory(), export_inventory(), _generate_batch_no() (+32 more)
+Cohesion: 0.13
+Nodes (23): _build_driver_url(), get_plan_arrange_info(), 获取计划已安排运输后的司机链接与地磅出入库关联(供查看弹窗复制简述/二维码)。, TransportSiteLinkRead, plan_requires_site_link(), Session, 运输计划:内置山峡/云栋客户判定(合同可免), 装货或送货段任一段客户为山峡/云栋时,需要生成现场链接。 (+15 more)
 
 ### Community 82 - "list_duty_staff_users"
-Cohesion: 0.04
-Nodes (163): clue_assign(), clue_check_convert(), clue_check_duplicate(), clue_convert(), clue_create(), clue_delete(), clue_export(), clue_follow_create() (+155 more)
+Cohesion: 0.06
+Nodes (58): category_add(), category_delete(), category_tree(), category_update(), clue_assign(), clue_convert(), clue_create(), clue_delete() (+50 more)
 
 ### Community 83 - "Community 83"
 Cohesion: 0.10
@@ -569,56 +570,56 @@ Cohesion: 0.23
 Nodes (23): build_id_maps(), clip_text(), count_rows(), export_mapping(), fetch_rows(), legacy_id_to_str(), main(), map_id() (+15 more)
 
 ### Community 85 - "allocate_next_biz_no"
-Cohesion: 0.12
-Nodes (44): clue_detail(), clue_follow_detail(), assign_clues(), check_convert(), check_duplicate_clue(), convert_clue(), create_clue(), _enrich_user_names() (+36 more)
+Cohesion: 0.13
+Nodes (42): clue_follow_detail(), assign_clues(), check_convert(), check_duplicate_clue(), convert_clue(), create_clue(), _enrich_user_names(), _ensure_clue_in_scope() (+34 more)
 
 ### Community 86 - "Community 86"
-Cohesion: 0.16
-Nodes (20): align_contract_no_to_sign_date(), contract_no_exists(), generate_contract_no(), date, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}      流水与撞号检测须含软删:uk_contr, 租户内合同编号是否已占用(含软删,保证全局唯一)。, 标准编号替换日期段,保留序号;非标准返回 None。, 将标准合同编号日期段对齐签订日;撞号则序号顺延(含软删查重)。      非标准编号原样返回。无签订日则原样返回。 (+12 more)
+Cohesion: 0.18
+Nodes (18): align_contract_no_to_sign_date(), generate_contract_no(), date, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号}      流水与撞号检测须含软删:uk_contr, 标准编号替换日期段,保留序号;非标准返回 None。, 将标准合同编号日期段对齐签订日;撞号则序号顺延(含软删查重)。      非标准编号原样返回。无签订日则原样返回。, replace_contract_no_date(), _mock_last_contract() (+10 more)
 
 ### Community 87 - "list_customers"
-Cohesion: 0.08
-Nodes (44): get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), 报销模块认证适配:门户 JWT 用户 → bx 业务上下文。, get_user_menu_codes(), Session, 菜单 code 权限守卫(V0.3:通过 sys_user_role → sys_role_menu → sys_menu.perms), 读取用户授权的菜单权限标识集合(与前端 meta.menuCode / perms 对齐)。, BxReimburseInvoice (+36 more)
+Cohesion: 0.13
+Nodes (23): _alias_row_to_dict(), _brand_row_to_dict(), _build_category_tree(), _category_row_to_dict(), _collect_category_with_ancestors(), get_product_by_no(), list_categories(), list_category_tree() (+15 more)
 
 ### Community 88 - "CrmProduct"
 Cohesion: 0.23
 Nodes (17): PlCustomerStopPref, 客户装/送货物流默认记忆 pl_customer_stop_pref, _as_str(), build_stop_pref_upsert_items(), get_customer_stop_pref(), Any, Session, 供 plan 保存调用;异常由调用方用 savepoint 吞掉。 (+9 more)
 
 ### Community 89 - "pl_ocr_service.py"
-Cohesion: 0.21
-Nodes (20): assert_quota_available(), _build_ocr_client(), compress_image_bytes(), current_usage_month(), _first_attachment_url(), get_or_create_usage_row(), increment_usage(), _monthly_limit() (+12 more)
+Cohesion: 0.19
+Nodes (22): PlOcrUsageMonth, 阿里云 OCR 月度调用计数 pl_ocr_usage_month(按自然月全局统计), assert_quota_available(), _build_ocr_client(), compress_image_bytes(), current_usage_month(), _first_attachment_url(), get_or_create_usage_row() (+14 more)
 
 ### Community 90 - "WechatMessageService"
-Cohesion: 0.16
-Nodes (23): operlog_detail(), operlog_export(), operlog_list(), OperLogExportBody, Session, 导出操作日志(当前筛选全量,或 ids 已选)。, 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), _user_info() (+15 more)
+Cohesion: 0.12
+Nodes (22): API 路由包 — 山峡化工生产一体化门户, get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), operlog_detail(), operlog_export(), operlog_list(), OperLogExportBody, Session (+14 more)
 
 ### Community 91 - "unsettled_plans_q_filter"
-Cohesion: 0.30
-Nodes (14): PlanArchiveDeliveryBlock, PlanArchiveLoadBlock, PlanArchiveStopProductItem, apply_archive_stop_quantities(), _apply_stop_product_archive(), _brand_rows_from_item(), iter_stop_archive_inventory_lines(), _persist_stop_brand_qtys() (+6 more)
+Cohesion: 0.21
+Nodes (16): get_web_auth_menu_codes(), 获取当前用户菜单权限标识(sys_menu.perms,经角色继承)。, _expand_with_ancestor_menu_ids(), _granted_menu_ids_for_user(), iter_user_menu_perm_codes(), _map_role_name_to_web(), Session, Web 管理端登录:基于 V0.3 sys_user / sys_user_role / sys_role 的角色与菜单权限解析 (+8 more)
 
 ### Community 92 - "Community 92"
-Cohesion: 0.40
-Nodes (9): create_oss(), create_oss(), get_oss_by_id(), get_oss_by_url(), Session, 按主键 id 查询附件(兼容旧 CRM 雪花 oss_id 迁入后的记录), 将 fileUrl 或旧 CRM 数字 ossId 解析为 MinIO 相对路径。      门户新上传把相对路径写入业务字段;迁入合同附件仍存数字 ossId, resolve_storage_path() (+1 more)
+Cohesion: 0.45
+Nodes (11): _customer_base_query(), get_follow_statistics(), get_industry_statistics(), get_level_statistics(), get_overview_statistics(), get_owner_statistics(), get_source_statistics(), get_trend_statistics() (+3 more)
 
 ### Community 93 - "api_request_log_middleware.py"
-Cohesion: 0.18
-Nodes (34): DutyAssignment, DutyDay, DutySlot, 值班排班模型 — docs/superpowers/specs/2026-08-14-duty-schedule-design.md, assert_user_is_duty_staff(), _assignment_dict(), build_public_url(), _count_active_assignments() (+26 more)
+Cohesion: 0.19
+Nodes (30): DutyAssignment, DutyDay, DutySlot, 值班排班模型 — docs/superpowers/specs/2026-08-14-duty-schedule-design.md, _assignment_dict(), build_public_url(), _count_active_assignments(), _day_dict() (+22 more)
 
 ### Community 94 - "assert_contract_editable_for_update"
 Cohesion: 0.60
 Nodes (3): assert_contract_editable_for_update(), test_assert_allows_editable(), test_assert_rejects_non_editable()
 
 ### Community 95 - "test_pl_public_link_archived.py"
-Cohesion: 0.25
-Nodes (17): _cargo_stats(), get_dashboard_stats(), get_inbound_by_cargo(), get_inbound_by_partner_cargo(), get_outbound_by_cargo(), get_outbound_by_partner_cargo(), _partner_cargo_stats(), Session (+9 more)
+Cohesion: 0.38
+Nodes (14): _cargo_stats(), get_dashboard_stats(), get_inbound_by_cargo(), get_inbound_by_partner_cargo(), get_outbound_by_cargo(), get_outbound_by_partner_cargo(), _partner_cargo_stats(), Session (+6 more)
 
 ### Community 96 - "minio_url.py"
-Cohesion: 0.18
-Nodes (17): get_oper_log_meta(), OperLogMeta, 请求级操作日志元数据(ContextVar), 供异步落库线程使用,避免 ContextVar 跨线程丢失。, set_oper_log_meta(), snapshot_oper_log_meta(), _format_summary(), oper_log() (+9 more)
+Cohesion: 0.23
+Nodes (21): _apply_plan_update(), get_plan_related(), format_datetime(), _create_by_name(), datetime_end_of_day(), fmt_date(), fmt_datetime(), inventory_date_to_api() (+13 more)
 
 ### Community 97 - "contact.py"
 Cohesion: 0.10
-Nodes (42): _advance_list_filters(), advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _export_advance_rows() (+34 more)
+Nodes (44): _advance_list_filters(), advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _export_advance_rows() (+36 more)
 
 ### Community 98 - "LocalStorage"
 Cohesion: 0.35
@@ -634,31 +635,31 @@ Nodes (15): Settings, BaseSettings, apply_renumber(), build_mapping(), fetch_pro
 
 ### Community 101 - "tenant.py"
 Cohesion: 0.10
-Nodes (27): calc_age_from_chinese_id_card(), date, 从 18 位身份证号计算周岁。号码不完整或出生日期无效时返回 None。, CertRead, SnapshotCertRead, SnapshotPersonnelRow, build_personnel_summary(), load_vehicle_personnel_rows() (+19 more)
+Nodes (35): create_vehicle(), get_vehicle(), update_vehicle(), _vehicle_to_detail(), calc_age_from_chinese_id_card(), date, 从 18 位身份证号计算周岁。号码不完整或出生日期无效时返回 None。, PlVehicle (+27 more)
 
 ### Community 102 - "BaseStorage"
-Cohesion: 0.12
-Nodes (29): pool_rule_add(), pool_rule_delete(), pool_rule_detail(), pool_rule_execute(), pool_rule_list(), pool_rule_update(), pool_rule_update_status(), create_pool_rule() (+21 more)
+Cohesion: 0.18
+Nodes (21): cancel_apply(), create_apply(), create_process(), delete_applies(), delete_processes(), export_applies(), export_process_board(), get_apply() (+13 more)
 
 ### Community 103 - "pl_internal_customer.py"
-Cohesion: 0.16
-Nodes (18): _claims_from_auth(), _format_body_bytes(), _persist_log(), Any, Request, 统一记录 API 请求/响应出入参的中间件, _redact_obj(), _schedule_persist_log() (+10 more)
+Cohesion: 0.05
+Nodes (61): ApiCryptoMiddleware, _claims_from_auth(), _coerce_post_method_override_to_get(), _get_redis_client(), _is_crypto_api(), _json_error_response(), _mark_nonce_once(), _nonce_key() (+53 more)
 
 ### Community 104 - "apply_crm_create_by_scope"
-Cohesion: 0.10
-Nodes (48): follow_detail(), price_letter_detail(), _enrich_follow_dict(), get_follow(), list_follows(), list_follows_by_customer(), Any, Session (+40 more)
+Cohesion: 0.24
+Nodes (18): DeliverySlipPrintRead, PlanDeliveryRead, build_delivery_slip_print(), _customer_key(), _delivery_matches_customer(), get_delivery_slip_print_context(), list_delivery_print_customers(), _merge_stop_products() (+10 more)
 
 ### Community 105 - "pool_customer_assign"
 Cohesion: 0.33
 Nodes (13): _build_tree(), _cascade_soft_delete(), _collect_with_ancestors(), create_dept(), get_dept(), list_depts(), list_depts_tree(), Any (+5 more)
 
 ### Community 106 - "site.py"
-Cohesion: 0.16
-Nodes (29): create_instance(), create_process_def(), create_task(), get_all_tasks_for_business(), get_instance(), get_latest_version(), get_nodes_by_version(), get_pending_tasks_by_node() (+21 more)
+Cohesion: 0.22
+Nodes (16): PlanLoadRead, compute_contract_gap_sides(), compute_plan_gap_sides_from_stops(), 按段次汇总计划是否仍有合同缺口(supplier=装货侧,demander=送货侧)。, stop_contract_gap(), resolve_load_customer_name(), _compile(), test_both_external_no_contracts_gaps_both() (+8 more)
 
 ### Community 107 - "apply_pl_scope"
-Cohesion: 0.10
-Nodes (33): API 路由包 — 山峡化工生产一体化门户, create_leave(), delete_leave(), export_leaves(), get_leave(), _leave_local_callback(), leave_workflow_callback(), LeaveExportBody (+25 more)
+Cohesion: 0.33
+Nodes (11): create_leave(), get_leave(), list_leaves(), Any, Session, _row_to_dict(), soft_delete_leave(), update_leave() (+3 more)
 
 ### Community 108 - "statistics.py"
 Cohesion: 0.20
@@ -669,12 +670,12 @@ Cohesion: 0.12
 Nodes (31): _extract_qty(), _fmt_qty(), normalize_stop_dibang_fields(), Any, Decimal, 运输计划多段:内部客户地磅默认值与数量平衡校验, 地磅默认勾选以本段客户是否为内部客户(山峡/云栋)为准。, 归一化段次地磅勾选与方向:勾选但方向缺失/none 时按本段客户补默认方向。 (+23 more)
 
 ### Community 110 - "pool_rule.py"
-Cohesion: 0.15
-Nodes (22): day_detail(), delete_assignment(), duty_user_options(), _enrich_assign_names(), ensure_duty_dict(), month_summary(), Session, 指定用户时补全 personName(用 nick_name)。 (+14 more)
+Cohesion: 0.12
+Nodes (26): day_detail(), delete_assignment(), duty_user_options(), _enrich_assign_names(), ensure_duty_dict(), month_summary(), Session, 指定用户时补全 personName(用 nick_name)。 (+18 more)
 
 ### Community 111 - "test_pl_public_transport_history.py"
-Cohesion: 0.25
-Nodes (7): camel_to_snake(), CRUDBase, get_model_attr(), HistoryCRUD, Any, Session, ModelType
+Cohesion: 0.24
+Nodes (8): generate_id(), camel_to_snake(), CRUDBase, get_model_attr(), HistoryCRUD, Any, Session, ModelType
 
 ### Community 112 - "merge_duplicate_crm_customers.py"
 Cohesion: 0.26
@@ -697,8 +698,8 @@ Cohesion: 0.17
 Nodes (28): batch_insert_quote_products(), calculate_subtotal(), _decimal_value(), delete_products_by_quote_id(), _ensure_quote_parent_scope(), _get_field(), get_quote_product(), insert_quote_product() (+20 more)
 
 ### Community 117 - "pl_plan_list_attachments.py"
-Cohesion: 0.04
-Nodes (87): category_add(), category_delete(), category_tree(), category_update(), customer_options(), invoice_info_add(), invoice_info_by_customer(), _invoice_info_by_customer_impl() (+79 more)
+Cohesion: 0.26
+Nodes (11): _apply_plan_product_update(), apply_product_snapshot_to_plan(), ProductSnapshot, Session, 地磅模块 — CRM 产品解析与快照写入。, 校验 CRM 产品并返回名称/规格快照。新建单据 product_id 必填。      require_on_shelf=False 用于运输计划联动地磅等历, resolve_crm_product(), _product() (+3 more)
 
 ### Community 118 - "Community 118"
 Cohesion: 0.20
@@ -706,14 +707,14 @@ Nodes (24): batch_insert_contract_products(), calculate_subtotal(), _decimal_val
 
 ### Community 119 - "Community 119"
 Cohesion: 0.11
-Nodes (39): CertRow, VehiclePersonnelRow, _cert_row_complete(), collect_required_cert_errors(), _find_cert_for_required(), get_required_personnel_cert_names(), is_huolala_trailer_no(), match_required_cert_name() (+31 more)
+Nodes (37): VehiclePersonnelRow, _cert_row_complete(), collect_required_cert_errors(), _find_cert_for_required(), get_required_personnel_cert_names(), is_huolala_trailer_no(), match_required_cert_name(), _missing_field_labels() (+29 more)
 
 ### Community 120 - "list_duty_staff_users"
-Cohesion: 0.17
-Nodes (3): BaseStorage, QiniuStorage, 浏览器内联预览 URL;默认实现为普通访问地址。
+Cohesion: 0.15
+Nodes (3): BaseStorage, OSSStorage, 浏览器内联预览 URL;默认实现为普通访问地址。
 
 ### Community 121 - "_build_user_info_payload"
-Cohesion: 0.19
+Cohesion: 0.18
 Nodes (26): _jwt_user_payload(), logout(), 公共接口(Web 登录、刷新 Token、登出;用户模型对齐 docs/sql/shanxia2.0.sql 基线), 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。无 Token 或已失效时仍返回成功(幂等)。, Web 端登录:账号为 sys_user.user_no,密码为 sys_user.password(bcrypt)。, refresh_token(), web_login(), create_access_token() (+18 more)
 
 ### Community 122 - "post.py"
@@ -721,28 +722,28 @@ Cohesion: 0.39
 Nodes (10): create_post(), get_post(), list_posts(), post_code_exists(), Any, Session, _row_to_dict(), soft_delete_post() (+2 more)
 
 ### Community 123 - "customer_options"
-Cohesion: 0.09
-Nodes (36): CRM 报价单 API 路由 — 挂接到 crm.router, 运营端角色守卫:admin / super_admin 可访问。, 接口菜单权限守卫。super_admin 直接放行。, require_admin_or_super_admin(), require_menu_code(), QuoteApproverSettingSaveBody, QuoteAcceptBody, QuoteApprovalApproveBody (+28 more)
+Cohesion: 0.11
+Nodes (32): CRM 报价单 API 路由 — 挂接到 crm.router, QuoteApproverSettingSaveBody, QuoteAcceptBody, QuoteApprovalApproveBody, QuoteApprovalListBody, QuoteApprovalRefreshNamesBody, QuoteApprovalWithdrawBody, QuoteCreateBody (+24 more)
 
 ### Community 124 - "LocalStorage"
-Cohesion: 0.21
-Nodes (15): create_record(), update_record(), PlVehicleRechargeRecord, 车辆ETC/加油充值发放登记 pl_vehicle_recharge_record, Decimal, VehicleRechargeRecordCreate, VehicleRechargeRecordRead, VehicleRechargeRecordUpdate (+7 more)
+Cohesion: 0.27
+Nodes (11): create_dict_data(), get_dict_data(), list_dict_data(), list_dict_data_options(), Any, Session, 字典数据 CRUD(sys_dict_data), 字典下拉选项:租户主数据,忽略数据范围(user_info 保留兼容调用方,不参与过滤)。 (+3 more)
 
 ### Community 125 - "ethnic.py"
-Cohesion: 0.09
-Nodes (48): _make_handlers(), 按运输计划单据类型解析地磅往来单位(不区分 CRM 合同类型)。      - 入库单 inbound:供方 → party_a,其次 supplier_nam, resolve_partner_company(), apply_dibang_prefill_to_order(), apply_io_order_stop_site_feedbacks(), apply_site_feedback(), build_io_order_site_url(), create_io_order_for_transport() (+40 more)
+Cohesion: 0.06
+Nodes (65): _build_history_page(), _build_page(), _get_by_token(), _history_status_label(), _make_handlers(), _models(), _parse_history_date(), date (+57 more)
 
 ### Community 126 - "oper_log.py"
-Cohesion: 0.17
-Nodes (6): convert_heic_to_jpeg(), _guess_preview_content_type(), OSSStorage, 文件存储工具模块  支持多种存储方式: 1. 本地存储 (local) - 默认 2. 七牛云存储 (qiniu) - 推荐生产环境使用 3. 阿里云OSS (, 按对象键后缀推断内联预览 Content-Type(纠正上传时未写入 MIME 的情况)。, 将 HEIC/HEIF 格式转换为 JPEG 格式
+Cohesion: 0.15
+Nodes (5): LocalStorage, process_image_content(), Path, 带下载文件名的访问 URL;默认实现为普通访问地址。, 处理图片内容,如果是 HEIC 格式则转换为 JPEG
 
 ### Community 127 - "Any"
 Cohesion: 0.13
 Nodes (36): PlanStopProductRead, _append_legacy_plan_product_rows(), _append_stop_product_rows(), build_plan_archive_export_rows(), _empty_product_fields(), _format_date_value(), _format_plate_display(), _get_stop_archive_actual_qty() (+28 more)
 
 ### Community 128 - "api_crypto.py"
-Cohesion: 0.35
-Nodes (14): assert_row_deletable_by_creator(), ensure_crm_customer_linked_row_in_scope(), 客户子表(开票信息等):先校验关联客户 owner scope,否则校验 create_by。, _clear_default_for_customer(), create_invoice_info(), get_invoice_info(), list_invoice_info_by_customer(), Any (+6 more)
+Cohesion: 0.60
+Nodes (9): apply_site_feedback(), _header(), _item(), test_apply_site_feedback_does_not_reset_first_submitted_at(), test_apply_site_feedback_keeps_in_progress_when_requested(), test_apply_site_feedback_rejects_already_voided(), test_apply_site_feedback_rejects_invalid_status(), test_apply_site_feedback_sets_status_completed() (+1 more)
 
 ### Community 129 - "BaseStorage"
 Cohesion: 0.12
@@ -761,104 +762,104 @@ Cohesion: 0.24
 Nodes (11): extract_minio_object_key(), join_relative_urls(), normalize_oss_storage_url(), MinIO 附件 URL 规范化(数据迁移共用)。  背景 ---- CRM / 地磅 / 报销与 shanxia2.0 共用同一 MinIO(bucket 默, 业务表 OSS ID 串 → 相对 URL 串(用于客户证照、跟进附件等)。, 去掉预签名 query(``?X-Amz-...``)。, 将绝对/相对 URL 规范为 MinIO object key(不含 bucket)。, 迁移 CRM ``sys_oss`` 行:``url`` + ``file_name`` → 门户相对路径。 (+3 more)
 
 ### Community 133 - "inventory_id.py"
-Cohesion: 0.24
-Nodes (12): DbSequence, 地磅(db)模块数据模型 — 对齐 docs/sql/db_tables.sql, _allocate_inbound_outbound_id(), _ensure_sequence_row(), max_numeric_inbound_outbound_id(), next_inbound_outbound_id(), Session, 出入库单 id 生成 — 租户内纯数字自增,并发安全。 (+4 more)
+Cohesion: 0.18
+Nodes (6): convert_heic_to_jpeg(), _guess_preview_content_type(), QiniuStorage, 文件存储工具模块  支持多种存储方式: 1. 本地存储 (local) - 默认 2. 七牛云存储 (qiniu) - 推荐生产环境使用 3. 阿里云OSS (, 按对象键后缀推断内联预览 Content-Type(纠正上传时未写入 MIME 的情况)。, 将 HEIC/HEIF 格式转换为 JPEG 格式
 
 ### Community 134 - "list_contacts"
-Cohesion: 0.15
-Nodes (25): _generate_notify_message(), _resolve_plan_flags(), PlInventoryTransaction, PlPlan, 库存流水表 pl_inventory_transaction, _plan_type_to_business_type(), apply_archive_inventory_for_plan(), apply_archive_inventory_for_plan_stops() (+17 more)
+Cohesion: 0.40
+Nodes (9): create_oss(), create_oss(), get_oss_by_id(), get_oss_by_url(), Session, 按主键 id 查询附件(兼容旧 CRM 雪花 oss_id 迁入后的记录), 将 fileUrl 或旧 CRM 数字 ossId 解析为 MinIO 相对路径。      门户新上传把相对路径写入业务字段;迁入合同附件仍存数字 ossId, resolve_storage_path() (+1 more)
 
 ### Community 135 - "context.py"
-Cohesion: 0.41
-Nodes (12): apply_pl_scope(), Session, build_menu_badge_counts(), count_document_reminder_expired_pending(), count_freight_approval_pending(), count_freight_disburse_pending(), _count_pending_applies(), count_plan_archive_pending() (+4 more)
+Cohesion: 0.33
+Nodes (8): allocate_next_biz_no(), _format_biz_no(), _prefix_for(), datetime, Session, 业务协议号自动生成:XBCC / JZCC + YYYYMMDD + 6 位序号, 原子分配下一个业务协议号。     须在 create 事务内调用;使用 MySQL LAST_INSERT_ID 保证并发安全。, BizNoKind
 
 ### Community 136 - "get_db_current_user_optional"
-Cohesion: 0.08
-Nodes (62): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), CompletedTaskExportBody, create_process_def(), _enrich_task_list(), export_completed_tasks(), export_my_instances() (+54 more)
+Cohesion: 0.06
+Nodes (92): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), CompletedTaskExportBody, create_process_def(), delete_process_def(), _enrich_task_list(), export_completed_tasks() (+84 more)
 
 ### Community 137 - "iter_user_menu_perm_codes"
-Cohesion: 0.21
-Nodes (14): change_current_user_password(), get_current_user_profile(), get_web_auth_menu_codes(), public_quote_share(), Request, Session, 获取当前用户信息(与 sys_user 字段对应)。, 获取当前用户菜单权限标识(sys_menu.perms,经角色继承)。 (+6 more)
+Cohesion: 0.17
+Nodes (15): change_current_user_password(), get_current_user_profile(), public_quote_share(), Request, Session, 获取当前用户信息(与 sys_user 字段对应)。, 公开分享查看报价单 — Java: GET /share/{shareCode}(无 JWT), get_current_user() (+7 more)
 
 ### Community 138 - "Community 138"
 Cohesion: 0.33
 Nodes (19): check_python(), create_venv(), ensure_dirs(), ensure_valid_venv(), ensure_venv_and_runtime(), install_dependencies(), is_running(), log_error() (+11 more)
 
 ### Community 139 - "customer_options"
-Cohesion: 0.19
-Nodes (14): assert_export_row_count(), _build_workbook(), DictLabelResolver, export_rows_to_xlsx_response(), Any, Session, Excel 导出工具:集中处理字典 code → label(对齐 Java ExcelDictConvert / ExcelDictPreloadConver, CRM 列表导出统一入口:表头 + 行数据 + 字典 label 转换 + 文件流响应。 (+6 more)
+Cohesion: 0.08
+Nodes (42): export_plans(), PlanExportBody, 导出计划列表(当前筛选全量,或 ids 已选)。, export_weighing(), 导出地磅单列表(当前筛选全量,或 ids 已选)。, WeighingExportBody, delete_leave(), export_leaves() (+34 more)
 
 ### Community 140 - "crm_export_columns.py"
-Cohesion: 0.16
-Nodes (22): PlanLoadBody, PlanStopProductBody, assert_load_products_in_selected_contract(), _assert_product_rows_in_contract_allowed(), 段 address 为空时,按经纬度从运输地址库补全 full_address。, _resolve_plan_product_id(), resolve_stop_address_from_library(), _FakeDb (+14 more)
+Cohesion: 0.31
+Nodes (13): PlanStopProductBody, Decimal, 段 address 为空时,按经纬度从运输地址库补全 full_address。, _resolve_plan_product_id(), resolve_stop_address_from_library(), _to_decimal(), _plan_product_row(), test_resolve_plan_product_id_by_explicit_id() (+5 more)
 
 ### Community 141 - "web_login_rsa_public_key"
-Cohesion: 0.26
-Nodes (12): get_product(), assert_products_allowed_for_supplier(), enrich_products_with_hazard_flags(), get_supplier_hazard_flags(), product_allowed(), Any, Session, 批量回填明细行 isToxic/isExplosive(来自产品主数据,供前端切换主体剔除)。 (+4 more)
+Cohesion: 0.24
+Nodes (13): get_product(), soft_delete_product(), assert_products_allowed_for_supplier(), enrich_products_with_hazard_flags(), get_supplier_hazard_flags(), product_allowed(), Any, Session (+5 more)
 
 ### Community 142 - "clear_pl_plan_instance_data.py"
 Cohesion: 0.46
 Nodes (7): _count(), _delete(), _engine_from_env(), main(), Engine, 清空运输计划(pl_plan)及关联实例数据,便于测试环境重新走流程。  用法(在 backend 目录、已配置 .env DATABASE_URL):   p, _table_exists()
 
 ### Community 143 - "create_from_quote"
-Cohesion: 0.19
-Nodes (11): get_current_time(), parse_datetime(), datetime, allocate_next_biz_no(), _format_biz_no(), _prefix_for(), datetime, Session (+3 more)
+Cohesion: 0.28
+Nodes (8): list_products(), 分页查询产品列表      keyword 默认匹配:名称 / 编号 / 拼音首字母。     选择器场景可关闭编号匹配、开启规格型号匹配(避免短数字误命中产品, 产品/客户列表 keyword:名称/编号/拼音首字母 OR 匹配。, 选择器:名称/拼音/规格型号,不匹配产品编号。, test_list_customer_options_keyword_includes_name_and_pinyin(), test_list_customers_keyword_includes_name_and_pinyin(), test_list_products_keyword_includes_name_and_pinyin(), test_list_products_keyword_selector_mode_excludes_product_no_includes_model()
 
 ### Community 144 - "response.py"
-Cohesion: 0.06
-Nodes (80): _apply_exclude_follow_status_filter(), _apply_follow_status_filter(), cancel_plan(), cancel_plan_wait_notice(), count_plans_by_contract(), create_from_contract(), create_plan(), create_plan_full() (+72 more)
+Cohesion: 0.04
+Nodes (104): _apply_exclude_follow_status_filter(), _apply_follow_status_filter(), cancel_plan(), cancel_plan_wait_notice(), count_plans_by_contract(), create_from_contract(), create_plan(), delete_plan() (+96 more)
 
 ### Community 145 - "list_products"
-Cohesion: 0.28
-Nodes (8): list_products(), 分页查询产品列表      keyword 默认匹配:名称 / 编号 / 拼音首字母。     选择器场景可关闭编号匹配、开启规格型号匹配(避免短数字误命中产品, 产品/客户列表 keyword:名称/编号/拼音首字母 OR 匹配。, 选择器:名称/拼音/规格型号,不匹配产品编号。, test_list_customer_options_keyword_includes_name_and_pinyin(), test_list_customers_keyword_includes_name_and_pinyin(), test_list_products_keyword_includes_name_and_pinyin(), test_list_products_keyword_selector_mode_excludes_product_no_includes_model()
+Cohesion: 0.31
+Nodes (9): format_hhmm(), format_time_label(), parse_hhmm(), test_format_time_label_cross_day(), test_format_time_label_empty(), test_format_time_label_same_day(), test_parse_hhmm(), test_parse_hhmm_invalid_raises() (+1 more)
 
 ### Community 146 - "dict_data.py"
-Cohesion: 0.15
-Nodes (5): LocalStorage, process_image_content(), Path, 带下载文件名的访问 URL;默认实现为普通访问地址。, 处理图片内容,如果是 HEIC 格式则转换为 JPEG
+Cohesion: 0.25
+Nodes (7): CustomerFollowByCustomerBody, CustomerFollowCreateBody, CustomerFollowDeleteBody, CustomerFollowDetailBody, CustomerFollowListBody, CustomerFollowUpdateBody, CRM 客户跟进记录 Pydantic Schemas
 
 ### Community 147 - "Community 147"
 Cohesion: 0.37
 Nodes (17): check_env(), check_python(), create_venv(), init_env(), install_dependencies(), log_error(), log_info(), log_success() (+9 more)
 
 ### Community 148 - "plan_has_incomplete_hazard_cert_exists"
-Cohesion: 0.25
-Nodes (10): _cert_url_blank(), plan_has_hazard_product_exists(), plan_has_incomplete_hazard_cert_exists(), 证书 URL 为空(NULL / 空串 / 纯空白)。, 列表筛选:计划下存在 CRM 标识为易制毒/易制爆的产品。, 列表筛选:存在危化产品且至少一张必需证书未上传。, _compile(), 危化品证上传列表筛选:EXISTS 子查询应覆盖 CRM 危化标识与证书缺口。 (+2 more)
+Cohesion: 0.19
+Nodes (26): put_plan_side_contracts(), put_plan_stop_contracts(), PlanContractGapRead, PlanProductRead, is_internal_customer_name(), build_plan_contract_gap_read(), _clear_legacy_side_contracts(), _delivery_stop_gap_expr() (+18 more)
 
 ### Community 149 - ".to_tenant_user_dict"
-Cohesion: 0.27
-Nodes (11): create_dict_data(), get_dict_data(), list_dict_data(), list_dict_data_options(), Any, Session, 字典数据 CRUD(sys_dict_data), 字典下拉选项:租户主数据,忽略数据范围(user_info 保留兼容调用方,不参与过滤)。 (+3 more)
+Cohesion: 0.29
+Nodes (6): create_leave(), Config, LeaveCreate, LeaveResponse, LeaveUpdate, Pydantic schemas - 请假申请
 
 ### Community 150 - "list_product_options"
-Cohesion: 0.67
-Nodes (3): list_product_options(), 产品下拉 options:keyword 按产品名称/拼音首字母模糊匹配,不匹配产品编号。, test_list_product_options_keyword_only_filters_product_name()
-
-### Community 152 - "register_local_callback"
-Cohesion: 0.35
-Nodes (11): create_vehicle(), export_vehicles(), get_vehicle(), 导出车辆列表(当前筛选全量,或 ids 已选)。, update_vehicle(), _vehicle_to_detail(), _vehicle_to_read(), PlVehicle (+3 more)
+Cohesion: 0.40
+Nodes (5): _avatar_url_field(), _build_user_info_payload(), 与 web-admin 静态路由 meta.roles(admin/super_admin)对齐的单元素数组。, 与 web-admin `userInfo` 字段约定一致。, _web_role_list()
 
-### Community 154 - "redis_client.py"
-Cohesion: 0.39
-Nodes (8): get_redis_client(), get_sync_redis_client(), Redis, 共享 Redis 客户端(同步:会话鉴权;异步:API 加密 nonce)。, 同步 Redis(auth 会话等,在线程池中调用)。, 异步 Redis(API 加密 nonce 等中间件)。, _redis_common_kwargs(), redis_enabled()
+### Community 153 - "web_login_rsa_public_key"
+Cohesion: 0.50
+Nodes (4): 简易搜索:计划编号 / 客户(供应商) / 车牌 / 承运商名称。, unsettled_plans_q_filter(), 未结算计划简易搜索:q 应覆盖计划编号/客户/车牌/承运商名称。, test_unsettled_plans_q_filter_includes_carrier_and_plate()
 
 ### Community 155 - "WechatMessageService"
-Cohesion: 0.17
-Nodes (8): 发送订单状态通知                  Args:             openid: 用户openid             order_n, 发送支付成功通知                  Args:             openid: 用户openid             order_n, 发送配送通知                  Args:             openid: 配送员openid             task_no:, 发送配送时效预警                  Args:             openid: 配送员openid             task_n, 发送退款结果通知                  Args:             openid: 用户openid             order_n, 发送催单通知给配送员                  Args:             deliver_openid: 配送员openid, 发送模板消息                  Args:             openid: 用户openid             template_, WechatMessageService
+Cohesion: 0.15
+Nodes (9): 微信消息通知服务  支持微信小程序模板消息推送  使用方式:     from app.core.wechat_message import WechatMes, 发送订单状态通知                  Args:             openid: 用户openid             order_n, 发送支付成功通知                  Args:             openid: 用户openid             order_n, 发送配送通知                  Args:             openid: 配送员openid             task_no:, 发送配送时效预警                  Args:             openid: 配送员openid             task_n, 发送退款结果通知                  Args:             openid: 用户openid             order_n, 发送催单通知给配送员                  Args:             deliver_openid: 配送员openid, 发送模板消息                  Args:             openid: 用户openid             template_ (+1 more)
 
-### Community 156 - "_build_user_info_payload"
-Cohesion: 0.40
-Nodes (5): _avatar_url_field(), _build_user_info_payload(), 与 web-admin 静态路由 meta.roles(admin/super_admin)对齐的单元素数组。, 与 web-admin `userInfo` 字段约定一致。, _web_role_list()
+### Community 156 - "list_product_options"
+Cohesion: 0.67
+Nodes (3): list_product_options(), 产品下拉 options:keyword 按产品名称/拼音首字母模糊匹配,不匹配产品编号。, test_list_product_options_keyword_only_filters_product_name()
 
-### Community 158 - "CrmProduct"
-Cohesion: 0.50
-Nodes (5): get_product_by_no(), _product_row_to_dict(), product_to_dict(), 产品 ORM 对象转 dict(camelCase 键名), CrmProduct
+### Community 157 - "datetime_parse.py"
+Cohesion: 0.67
+Nodes (3): parse_optional_plan_datetime(), datetime, 运输计划相关日期时间解析:前端 date-picker 仅传 YYYY-MM-DD。
+
+### Community 158 - "create_from_quote"
+Cohesion: 0.67
+Nodes (3): create_from_quote(), _quote_products_to_contract_products(), Java: createFromQuote — 返回合同 id
 
 ### Community 162 - ".to_tenant_user_dict"
 Cohesion: 0.42
 Nodes (7): default_settlement_clause(), test_advance_payment_clause(), test_arrive_payment_clause(), test_empty_falls_back_to_arrive(), test_monthly_settlement_clause_uses_label(), test_unknown_falls_back_to_arrive(), test_volume_quarterly_other_labels()
 
 ### Community 173 - "resolve_create_time_bounds"
-Cohesion: 0.10
-Nodes (49): ContractGapExportBody, PlanExportBody, _apply_plan_logistics_from_payload(), _apply_transport_arrange_fields(), arrange_transport(), _assert_vehicle_carrier_eligible(), _build_arrange_result(), _build_driver_url() (+41 more)
+Cohesion: 0.07
+Nodes (68): _apply_plan_logistics_from_payload(), _apply_transport_arrange_fields(), arrange_transport(), _assert_vehicle_carrier_eligible(), _build_arrange_result(), _build_driver_url(), create_transport(), _ensure_driver_access_token() (+60 more)
 
 ### Community 179 - "test_pl_vehicle_personnel_photo_schema.py"
 Cohesion: 0.27
@@ -873,8 +874,8 @@ Cohesion: 0.18
 Nodes (10): 1. 创建虚拟环境, 2. 安装依赖, 3. 配置环境变量, 4. 启动服务, API 路由分组, shanxia2.0 后端骨架(FastAPI), 开发规范, 快速开始 (+2 more)
 
 ### Community 220 - "api_crypto_middleware.py"
-Cohesion: 0.24
-Nodes (13): _claims_from_auth(), _coerce_post_method_override_to_get(), _get_redis_client(), _is_crypto_api(), _json_error_response(), _mark_nonce_once(), _nonce_key(), Redis (+5 more)
+Cohesion: 0.39
+Nodes (8): get_redis_client(), get_sync_redis_client(), Redis, 共享 Redis 客户端(同步:会话鉴权;异步:API 加密 nonce)。, 同步 Redis(auth 会话等,在线程池中调用)。, 异步 Redis(API 加密 nonce 等中间件)。, _redis_common_kwargs(), redis_enabled()
 
 ### Community 237 - "order_status_compat.py"
 Cohesion: 0.36
@@ -891,22 +892,22 @@ Nodes (6): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时
 ## Knowledge Gaps
 - **30 isolated node(s):** `Config`, `Config`, `Config`, `Config`, `Config` (+25 more)
   These have ≤1 connection - possible missing edges or undocumented components.
-- **18 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
+- **19 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
 
 ## Suggested Questions
 _Questions this graph is uniquely positioned to answer:_
 
-- **Why does `generate_uuid()` connect `Community 50` to `api_crypto.py`, `Community 0`, `_filter_export_rows_by_ids`, `Community 4`, `Community 5`, `Community 6`, `inventory_id.py`, `Community 8`, `list_contacts`, `Community 11`, `Community 14`, `create_from_quote`, `response.py`, `Community 17`, `Community 15`, `Community 19`, `.to_tenant_user_dict`, `Community 21`, `Community 23`, `register_local_callback`, `Community 25`, `Community 24`, `Community 28`, `Community 29`, `Community 31`, `Community 32`, `Community 33`, `Community 34`, `Community 36`, `Community 37`, `Community 40`, `Community 43`, `resolve_create_time_bounds`, `Community 46`, `Community 48`, `Community 51`, `Community 54`, `Community 61`, `Community 63`, `Community 64`, `Community 65`, `Community 67`, `Community 70`, `Community 71`, `Community 78`, `PlCarrier`, `resolve_crm_product`, `Community 83`, `allocate_next_biz_no`, `list_customers`, `CrmProduct`, `pl_ocr_service.py`, `Community 92`, `api_request_log_middleware.py`, `contact.py`, `LocalStorage`, `tenant.py`, `BaseStorage`, `apply_crm_create_by_scope`, `pool_customer_assign`, `site.py`, `apply_pl_scope`, `dict_type.py`, `dept.py`, `Community 116`, `pl_plan_list_attachments.py`, `Community 118`, `_build_user_info_payload`, `post.py`, `LocalStorage`, `ethnic.py`?**
-  _High betweenness centrality (0.173) - this node is a cross-community bridge._
-- **Why does `Settings` connect `price_letter_detail` to `Community 35`, `Community 67`, `Community 73`, `Community 42`, `Community 59`, `statistics.py`, `Community 44`, `Community 57`, `Community 26`, `Community 27`, `config.py`, `Community 30`?**
+- **Why does `generate_uuid()` connect `resolve_create_time_bounds` to `Community 0`, `_filter_export_rows_by_ids`, `Community 4`, `Community 5`, `Community 6`, `context.py`, `list_contacts`, `Community 8`, `get_db_current_user_optional`, `Community 11`, `Community 14`, `Community 15`, `response.py`, `Community 17`, `Community 19`, `plan_has_incomplete_hazard_cert_exists`, `Community 21`, `Community 23`, `Community 24`, `Community 25`, `Community 27`, `Community 28`, `Community 29`, `Community 32`, `Community 33`, `Community 34`, `Community 36`, `Community 37`, `Community 39`, `Community 40`, `Community 43`, `Community 46`, `Community 48`, `Community 50`, `Community 51`, `Community 52`, `Community 54`, `Community 61`, `Community 62`, `Community 65`, `Community 67`, `Community 70`, `Community 71`, `Community 72`, `Community 74`, `apply_crm_create_by_scope`, `Community 78`, `PlCarrier`, `resolve_crm_product`, `Community 83`, `allocate_next_biz_no`, `CrmProduct`, `pl_ocr_service.py`, `api_request_log_middleware.py`, `contact.py`, `LocalStorage`, `tenant.py`, `pool_customer_assign`, `apply_pl_scope`, `dict_type.py`, `dept.py`, `Community 116`, `Community 118`, `_build_user_info_payload`, `post.py`, `LocalStorage`, `ethnic.py`?**
+  _High betweenness centrality (0.165) - this node is a cross-community bridge._
+- **Why does `Settings` connect `price_letter_detail` to `Community 64`, `Community 66`, `Community 35`, `Community 67`, `Community 73`, `Community 42`, `statistics.py`, `Community 44`, `Community 55`, `Community 57`, `Community 59`, `Community 30`?**
   _High betweenness centrality (0.114) - this node is a cross-community bridge._
-- **Why does `BaseModel` connect `Community 10` to `Community 0`, `Community 1`, `Community 6`, `get_db_current_user_optional`, `Community 11`, `Community 12`, `Community 13`, `crm_export_columns.py`, `Community 15`, `response.py`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 21`, `Community 28`, `Community 31`, `Community 33`, `Community 34`, `Community 37`, `Community 39`, `Community 41`, `Community 43`, `Community 45`, `resolve_create_time_bounds`, `Community 47`, `Community 49`, `Community 51`, `Community 52`, `Community 54`, `Community 56`, `Community 58`, `Community 63`, `Community 64`, `Community 65`, `Community 66`, `Community 72`, `Community 74`, `Community 78`, `resolve_crm_product`, `customer_follow.py`, `list_duty_staff_users`, `list_customers`, `WechatMessageService`, `unsettled_plans_q_filter`, `test_pl_public_link_archived.py`, `contact.py`, `tenant.py`, `BaseStorage`, `apply_pl_scope`, `pool_rule.py`, `pl_plan_list_attachments.py`, `Community 119`, `customer_options`, `LocalStorage`?**
-  _High betweenness centrality (0.104) - this node is a cross-community bridge._
+- **Why does `BaseModel` connect `Community 1` to `Community 0`, `Community 6`, `get_db_current_user_optional`, `Community 10`, `customer_options`, `Community 11`, `Community 12`, `Community 13`, `Community 15`, `response.py`, `Community 14`, `Community 18`, `dict_data.py`, `Community 20`, `.to_tenant_user_dict`, `plan_has_incomplete_hazard_cert_exists`, `Community 19`, `Community 17`, `Community 21`, `Community 26`, `Community 27`, `Community 31`, `Community 33`, `Community 34`, `Community 37`, `Community 39`, `Community 41`, `Community 43`, `Community 45`, `resolve_create_time_bounds`, `Community 47`, `Community 48`, `Community 49`, `Community 50`, `Community 51`, `Community 52`, `Community 56`, `Community 58`, `Community 61`, `Community 62`, `Community 63`, `crm_export_columns.py`, `Community 66`, `Community 65`, `Community 74`, `apply_crm_create_by_scope`, `Community 78`, `resolve_crm_product`, `customer_follow.py`, `list_duty_staff_users`, `WechatMessageService`, `test_pl_public_link_archived.py`, `contact.py`, `tenant.py`, `BaseStorage`, `apply_crm_create_by_scope`, `pool_rule.py`, `Community 119`, `customer_options`, `ethnic.py`?**
+  _High betweenness centrality (0.109) - this node is a cross-community bridge._
 - **Are the 30 inferred relationships involving `DbUserContext` (e.g. with `InventoryExportBody` and `InventoryRelatedData`) actually correct?**
   _`DbUserContext` has 30 INFERRED edges - model-reasoned connections that need verification._
 - **What connects `API 路由包 — 山峡化工生产一体化门户`, `返回运营端角色下拉选项(label=库中角色名,value=Web 角色码)。`, `返回用户下拉选项(label=昵称,value=用户ID,附带 nickName/userNo)。      供申请人/审批人等选择场景使用,返回本租户全部有效` to the rest of the system?**
   _670 weakly-connected nodes found - possible documentation gaps or missing edges._
 - **Should `Community 0` be split into smaller, more focused modules?**
-  _Cohesion score 0.07502131287297528 - nodes in this community are weakly interconnected._
+  _Cohesion score 0.0810126582278481 - nodes in this community are weakly interconnected._
 - **Should `Community 1` be split into smaller, more focused modules?**
-  _Cohesion score 0.08076923076923077 - nodes in this community are weakly interconnected._
+  _Cohesion score 0.05376972530683811 - nodes in this community are weakly interconnected._

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
backend/graphify-out/cache/ast/v0.9.4/1510837f634e5181e8f4183f488ad530c631ec1c3c4a3988d569057ee106a1ef.json


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
backend/graphify-out/cache/ast/v0.9.4/29d724d1e316e149bbea0cc6f963895874def2254ef24e2f752ff794f192397f.json


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
backend/graphify-out/cache/ast/v0.9.4/618b8ac3471fe12df475dc7a10b6f724ba93e85c6e7ba87a1767b9015b777191.json


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
backend/graphify-out/cache/ast/v0.9.4/7cc88e1712b0e18e8ff057eb6847d583975557c159b7dc4967e6151dcb5724e8.json


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
backend/graphify-out/cache/stat-index.json


Разница между файлами не показана из-за своего большого размера
+ 112 - 112
backend/graphify-out/graph.json


+ 72 - 0
backend/tests/test_pl_contract_plan_qty.py

@@ -122,6 +122,78 @@ def test_accumulate_stop_products():
     assert acc["p1"] == 20.0
 
 
+def test_accumulate_archive_actual_load_uses_inbound_qty():
+    acc = defaultdict(float)
+    accumulate_stop_products(
+        acc,
+        [
+            SimpleNamespace(product_id="p1", plan_qty=100, inbound_qty=88),
+            SimpleNamespace(product_id="p1", plan_qty=50, inbound_qty=None),
+        ],
+        stop_kind="load",
+        qty_mode="archive_actual",
+    )
+    # 88 + 回退 plan_qty 50
+    assert acc["p1"] == 138.0
+
+
+def test_accumulate_archive_actual_delivery_uses_outbound_qty():
+    acc = defaultdict(float)
+    accumulate_stop_products(
+        acc,
+        [SimpleNamespace(product_id="p1", plan_qty=100, outbound_qty=66)],
+        stop_kind="delivery",
+        qty_mode="archive_actual",
+    )
+    assert acc["p1"] == 66.0
+
+
+def test_accumulate_archive_actual_zero_does_not_fallback():
+    acc = defaultdict(float)
+    accumulate_stop_products(
+        acc,
+        [SimpleNamespace(product_id="p1", plan_qty=100, inbound_qty=0)],
+        stop_kind="load",
+        qty_mode="archive_actual",
+    )
+    assert acc["p1"] == 0.0
+
+
+def test_sum_qtys_archive_actual_mode_on_scoped_stops():
+    load_products = {
+        "L1": [SimpleNamespace(product_id="p1", plan_qty=10, inbound_qty=7)],
+    }
+    delivery_products = {
+        "D1": [SimpleNamespace(product_id="p1", plan_qty=40, outbound_qty=33)],
+    }
+    qtys = sum_qtys_for_scope(
+        load_products_by_load=load_products,
+        delivery_products_by_delivery=delivery_products,
+        all_load_ids={"L1"},
+        all_delivery_ids={"D1"},
+        scope={"load_ids": {"L1"}, "delivery_ids": {"D1"}, "use_all_stops": False},
+        qty_mode="archive_actual",
+    )
+    assert qtys == {"p1": 40.0}  # 7 + 33
+
+
+def test_sum_qtys_default_mode_ignores_actual_fields():
+    load_products = {
+        "L1": [SimpleNamespace(product_id="p1", plan_qty=10, inbound_qty=7)],
+    }
+    delivery_products = {
+        "D1": [SimpleNamespace(product_id="p1", plan_qty=40, outbound_qty=33)],
+    }
+    qtys = sum_qtys_for_scope(
+        load_products_by_load=load_products,
+        delivery_products_by_delivery=delivery_products,
+        all_load_ids={"L1"},
+        all_delivery_ids={"D1"},
+        scope={"load_ids": set(), "delivery_ids": {"D1"}, "use_all_stops": False},
+    )
+    assert qtys == {"p1": 40.0}
+
+
 class DecimalLike:
     def __init__(self, v):
         self.v = v

+ 85 - 1
backend/tests/test_pl_plan_single_contract_rules.py

@@ -2,9 +2,15 @@ import pytest
 from fastapi import HTTPException
 from types import SimpleNamespace
 
-from app.schemas.pl.plan import PlanContractLink, PlanLoadBody, PlanStopProductBody
+from app.schemas.pl.plan import (
+    PlanContractLink,
+    PlanDeliveryBody,
+    PlanLoadBody,
+    PlanStopProductBody,
+)
 from app.services.pl_plan_stop_service import (
     assert_at_most_one_contract,
+    assert_delivery_products_in_selected_contract,
     assert_load_products_in_selected_contract,
 )
 
@@ -133,3 +139,81 @@ def test_assert_plan_products_outside_contract_raises():
     assert exc.value.status_code == 422
     assert "计划外产品" in str(exc.value.detail)
     assert "不在所选合同明细中" in str(exc.value.detail)
+
+
+def _delivery_with_products(product_ids, contract_id="c1"):
+    return PlanDeliveryBody(
+        seq=1,
+        customerId="cust-2",
+        customerName="外部客户B",
+        contracts=[PlanContractLink(contractId=contract_id, contractNo="N2")],
+        products=[
+            PlanStopProductBody(
+                productId=pid,
+                productNo=pid,
+                productName=f"产品{pid}",
+                unit="吨",
+                planQty=1,
+            )
+            for pid in product_ids
+        ],
+    )
+
+
+def test_assert_delivery_products_in_contract_passes_when_all_match():
+    db = _FakeDb(["p1", "p2"])
+    delivery = _delivery_with_products(["p1"])
+    assert_delivery_products_in_selected_contract(db, "shanxia2.0", delivery, 1)
+
+
+def test_assert_delivery_products_in_contract_rejects_outside():
+    db = _FakeDb(["p1"])
+    delivery = _delivery_with_products(["p2"])
+    with pytest.raises(HTTPException) as exc:
+        assert_delivery_products_in_selected_contract(db, "shanxia2.0", delivery, 2)
+    assert exc.value.status_code == 422
+    assert "送货段#2产品" in str(exc.value.detail)
+    assert "不在所选合同明细中" in str(exc.value.detail)
+
+
+def test_assert_delivery_products_skips_when_no_contract():
+    db = _FakeDb([])
+    delivery = PlanDeliveryBody(
+        seq=1,
+        customerId="cust-2",
+        customerName="外部客户B",
+        contracts=[],
+        products=[
+            PlanStopProductBody(
+                productId="p1",
+                productNo="p1",
+                productName="产品p1",
+                unit="吨",
+                planQty=1,
+            )
+        ],
+    )
+    assert_delivery_products_in_selected_contract(db, "shanxia2.0", delivery, 1)
+
+
+def test_assert_delivery_products_skips_internal_customer():
+    from app.services.pl_internal_customer import INTERNAL_CUSTOMER_NAMES
+
+    internal = next(iter(INTERNAL_CUSTOMER_NAMES))
+    db = _FakeDb([])
+    delivery = PlanDeliveryBody(
+        seq=1,
+        customerId="cust-2",
+        customerName=internal,
+        contracts=[PlanContractLink(contractId="c1", contractNo="N1")],
+        products=[
+            PlanStopProductBody(
+                productId="p1",
+                productNo="p1",
+                productName="产品p1",
+                unit="吨",
+                planQty=1,
+            )
+        ],
+    )
+    assert_delivery_products_in_selected_contract(db, "shanxia2.0", delivery, 1)

+ 3 - 3
docs/fresh-mint-green.html

@@ -81,7 +81,7 @@
       padding: 8px 12px;
       margin: 0;
       border-radius: var(--radius);
-      font-size: 12px;
+      font-size: 14px;
       font-weight: 700;
       color: var(--text-muted);
       letter-spacing: 0.02em;
@@ -121,11 +121,11 @@
       color: var(--text-muted);
       text-decoration: none;
       font-weight: 500;
-      font-size: 13px;
+      font-size: 15px;
     }
     .nav a:hover { background: var(--row-alt); color: var(--text); }
     .nav a.active { background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }
-    .nav-foot { margin-top: 24px; padding: 16px 12px 0; font-size: 13px; }
+    .nav-foot { margin-top: 24px; padding: 16px 12px 0; font-size: 15px; }
     .nav-foot a { color: var(--text-muted); text-decoration: none; }
     .nav-foot a:hover { color: var(--primary-dark); }
 

+ 42 - 0
docs/superpowers/plans/2026-08-30-pl-contract-qty-archived-actual.md

@@ -0,0 +1,42 @@
+# 合同已安排数量 · 已归档用实际量 Implementation Plan
+
+> **For agentic workers:** Implement task-by-task. Steps use checkbox (`- [ ]`) syntax.
+
+**Goal:** 已归档运输计划计入合同时用段产品实际量(缺则回退 plan_qty);已安排未归档仍用 plan_qty。
+
+**Architecture:** 在 `pl_contract_plan_qty.py` 为累加增加 `qty_mode`(`plan` | `archive_actual`)与装/送 `stop_kind`;`aggregate_contract_product_plan_qtys` 与问号弹窗按 `_bucket_for_plan` 选择 mode;安排校验的「本计划新量」保持 `plan`。
+
+**Tech Stack:** Python 3.9、pytest、现有 `pl_contract_plan_qty` 纯函数
+
+**Spec:** `docs/superpowers/specs/2026-08-30-pl-contract-qty-archived-actual-design.md`
+
+---
+
+## File map
+
+| File | Responsibility |
+|------|----------------|
+| `backend/app/services/pl_contract_plan_qty.py` | 数量解析与汇总 |
+| `backend/tests/test_pl_contract_plan_qty.py` | 单元测试 |
+| `docs/superpowers/specs/2026-08-30-pl-plan-contract-qty-check-design.md` | 同步口径文案 |
+
+---
+
+### Task 1: 失败单测(RED)
+
+- [x] 增加:`archive_actual` 装货用 `inbound_qty`、送货用 `outbound_qty`
+- [x] 增加:实际量为 `null` 回退 `plan_qty`;为 `0` 不回退
+- [x] 增加:默认 / `plan` mode 仍只读 `plan_qty`
+- [x] 跑测确认失败
+
+### Task 2: 实现(GREEN)
+
+- [x] `_resolve_stop_product_qty` + 扩展 `accumulate_stop_products` / `sum_qtys_for_scope`
+- [x] `aggregate_contract_product_plan_qtys` 与 `get_contract_product_arrange_qty_detail` 按 bucket 传 mode
+- [x] 安排校验路径保持默认 `plan`
+- [x] 跑测全绿
+
+### Task 3: 文档与图谱
+
+- [x] 更新 contract-qty-check 设计 §4.1
+- [x] `./scripts/update-graph.sh backend`(或 graphify update)

+ 48 - 0
docs/superpowers/plans/2026-08-30-pl-plan-delivery-contract-products.md

@@ -0,0 +1,48 @@
+# 送货段产品限合同内 + 选择产品 Implementation Plan
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** 送货段产品须属于所选合同;默认同步后过滤合同外产品;提供「选择产品」限合同内选品;前后端校验对称。
+
+**Architecture:** 复用 `pl-plan-contract-product` 过滤工具与装货侧 ProductSelector 模式;后端在 `validate_plan_stops_write` 对每个送货段调用归属断言。
+
+**Tech Stack:** Vue 3 / Element Plus(web-admin);FastAPI / pytest(backend)
+
+---
+
+## File map
+
+| File | Responsibility |
+|------|----------------|
+| `backend/app/services/pl_plan_stop_service.py` | `assert_delivery_products_in_selected_contract` + validate 挂点 |
+| `backend/tests/test_pl_plan_single_contract_rules.py` | 送货归属单测 |
+| `web-admin/src/components/business/pl-plan-delivery-section/index.vue` | 「选择产品」按钮、空态、emit |
+| `web-admin/src/components/business/pl-plan-form-dialog/index.vue` | 合同明细缓存、过滤、选品、保存校验 |
+| `web-admin/src/utils/pl-plan-stop-form.ts` | 可选:sync 后过滤 helper |
+
+---
+
+### Task 1: 后端送货产品归属断言 + 单测
+
+- [ ] 扩展 `_assert_product_rows_in_contract_allowed` 支持 label 前缀
+- [ ] 新增 `assert_delivery_products_in_selected_contract`
+- [ ] 在 `validate_plan_stops_write` 循环后调用
+- [ ] 单测:通过 / 拒绝 / 无合同 skip / 内置 skip
+
+### Task 2: 送货区 UI「选择产品」
+
+- [ ] 标题旁增加按钮;未选合同禁用
+- [ ] emit `add-products` / `select-products` with index
+- [ ] 更新空态文案
+
+### Task 3: 表单联动
+
+- [ ] 按段拉取/缓存送货合同 productIds
+- [ ] 同步后 / 换合同后过滤
+- [ ] ProductSelector 区分装货/送货目标
+- [ ] `validateSingleContractPerStop` 增加送货归属校验
+
+### Task 4: 验证
+
+- [ ] `pytest tests/test_pl_plan_single_contract_rules.py`
+- [ ] 手工对照 spec 验收清单

+ 48 - 0
docs/superpowers/specs/2026-08-30-pl-contract-qty-archived-actual-design.md

@@ -0,0 +1,48 @@
+# 合同已安排数量 · 已归档用实际量
+
+**日期:** 2026-08-30  
+**状态:** 已确认(方案 1)  
+**关联:** `2026-08-30-pl-plan-contract-qty-check-design.md`、`2026-08-30-pl-plan-form-available-qty-design.md`
+
+## 目标
+
+合同产品「已安排合计 / 可安排数量」汇总时:
+
+- **已归档**计划:按段产品**实际数量**计入
+- **已安排未归档**计划:仍按**计划数量**计入
+
+## 已确认决策
+
+| 项 | 决策 |
+|----|------|
+| 实现 | 方案 1:在权威服务 `pl_contract_plan_qty` 按分桶选字段 |
+| 装货实际量 | `inbound_qty` |
+| 送货实际量 | `outbound_qty` |
+| 实际量为 `null` | 回退 `plan_qty`(兼容历史缺实际量) |
+| 实际量为 `0` | 按 `0` 计,不回退 |
+| 分桶规则 | 不变(作废 / 待安排 / 等通知不计入) |
+| 安排中本计划新量 | 仍用 `plan_qty`(当前计划不会按归档实际量参与「本次」) |
+
+## 公式(不变结构)
+
+```text
+arrangedTotalQty = archivedQty + arrangedUnarchivedQty
+availableQty     = contractQty − arrangedTotalQty   # 有固定数量时;编辑时可 exclude 本计划
+```
+
+其中:
+
+- `archivedQty`:挂接段上按实际量(缺则回退计划量)汇总
+- `arrangedUnarchivedQty`:挂接段上按 `plan_qty` 汇总
+
+## 改动面
+
+- `backend/app/services/pl_contract_plan_qty.py`:`accumulate_stop_products` / `sum_qtys_for_scope` / `aggregate_*` / 问号弹窗列表合计路径
+- `backend/tests/test_pl_contract_plan_qty.py`
+- 同步既有设计文中「一律 plan_qty」表述
+
+## 非目标
+
+- 不改归档录入 UI
+- 不改草稿仅保存不校验
+- 前端不重复实现汇总口径

+ 4 - 1
docs/superpowers/specs/2026-08-30-pl-plan-contract-qty-check-design.md

@@ -44,7 +44,10 @@
 - 关联:`pl_plan_contract.contract_id` ∪ 遗留 `pl_plan.contract_id`
 - 排除:`follow_status=cancelled`、`del_flag=1`;待安排 / 等通知不计入
 - 分桶:`archived` / `arranged_unarchived`;`arrangedTotalQty = 二者之和`
-- 按合同挂接的停靠段产品 `plan_qty`、按 `product_id` 汇总
+- 按合同挂接的停靠段产品、按 `product_id` 汇总:
+  - **已归档**:装货用 `inbound_qty`、送货用 `outbound_qty`;为 `null` 时回退 `plan_qty`;为 `0` 按 0(不回退)
+  - **已安排未归档**:用 `plan_qty`
+  - 详见 `2026-08-30-pl-contract-qty-archived-actual-design.md`
 
 ### 4.2 本计划旧量 / 新量
 

+ 115 - 0
docs/superpowers/specs/2026-08-30-pl-plan-delivery-contract-products-design.md

@@ -0,0 +1,115 @@
+# 运输计划:送货段产品限合同内 + 选择产品
+
+**日期:** 2026-08-30  
+**状态:** 已确认设计  
+**范围:** `web-admin` 运输计划新增/编辑弹窗送货区 + `backend` 段次写入校验  
+**前置:** `2026-08-30-pl-plan-single-contract-products-design.md`(装货侧已落地;本文扩展送货侧对称能力)
+
+## 1. 背景与目标
+
+装货侧已支持:合同内选品、换合同过滤、前后端归属校验。送货侧此前仅「从装货同步 + 可删」,且**不校验**产品是否属于送货合同。
+
+业务要求:
+
+1. 默认仍从装货同步产品到送货段。
+2. 送货段已选合同时:同步结果中不在该合同明细内的产品**直接清除**。
+3. 送货段提供「选择产品」:只能选该段合同内产品(内置客户除外)。
+4. 未选合同时先保留同步结果;选好合同后再过滤(与「可先建计划再补合同」一致)。
+5. 保存时前后端校验送货产品归属所选合同。
+
+## 2. 已确认决策
+
+| 项 | 决策 |
+|----|------|
+| 默认同步 | 装货变更 /「从装货同步」仍同步到送货 |
+| 合同过滤时机 | 该送货段已选 1 份合同后过滤;未选则保留 |
+| 换合同 | 仅保留仍属于新合同的行,其余清除 |
+| 选品按钮文案 | 「选择产品」(与装货「添加产品」区分场景) |
+| 选品范围 | 非内置:仅送货合同明细;内置:全量商品库 |
+| 独立选品 vs 装货 | 允许送货产品与装货不完全一致(同步过滤 + 独立选择) |
+| 校验落点 | 前端体验 + 后端 `validate_plan_stops_write` 兜底 |
+| 合同完善页 | 不改产品;仍只补合同(最多 1 份) |
+
+## 3. 非目标
+
+- 不强制送货产品 ⊆ 装货产品
+- 不硬拦装/送数量不平衡
+- 不改 `contracts[]` 模型
+- 合同完善接口不改产品行
+
+## 4. 前端设计
+
+### 4.1 送货区 UI(`PlPlanDeliverySection`)
+
+- 产品标题旁:「从装货同步」+「选择产品」(主色实心建议仅保留一个主行动——「选择产品」用 `type="primary"` / `btn-main`,「从装货同步」保持 ghost,与装货区「添加产品」主色一致)。
+- 非内置且未选合同:「选择产品」禁用;点击提示先选送货合同。
+- 内置:可选全量产品。
+- 空态:提示可「从装货同步」或「选择产品」。
+
+### 4.2 表单联动(`PlPlanFormDialog`)
+
+- 按送货段缓存合同 `productId` 列表(类似 `loadContractProductIds`,可为 `Map`/`Record` by index 或 by contractId)。
+- 打开 `ProductSelector` 时区分来源:`load` | `delivery:{index}`,传入对应 `allowedProductIds`。
+- 装货同步后:对每个已选合同的送货段调用 `filterProductsByAllowedProductIds`。
+- 送货段合同变更:拉取合同明细 → 过滤该段 `products`。
+- 保存校验:非内置且 `contracts.length === 1` 时,该段每个 `productId` ∈ 合同明细;否则拦截,文案:`送货段#N产品须属于所选合同`。合同无明细时提示与装货对称。
+
+### 4.3 工具函数
+
+- 复用 `collectContractProductIds` / `filterProductsByAllowedProductIds`(`pl-plan-contract-product.ts`)。
+- `syncDeliveriesProductsFromLoad` 之后由表单按段过滤;或扩展 sync 接受每段 `allowedProductIds`(实现时择一,保持调用点清晰)。
+
+## 5. 后端设计
+
+在 `assert_load_products_in_selected_contract` 旁增加对称能力:
+
+- `assert_delivery_products_in_selected_contract(db, tenant_no, delivery, seq)`  
+  - 内置客户 / 未选合同 → skip  
+  - 已选合同 → 产品必须 ∈ `CrmContractProduct`  
+  - 422:`送货段#N产品「xxx」不在所选合同明细中`
+
+在 `validate_plan_stops_write` 中对各 `delivery` 调用。
+
+通用化 `_assert_product_rows_in_contract_allowed` 的文案参数(装货/送货共用)为可选改进。
+
+## 6. 数据流
+
+```
+装货添加/变更产品
+  → 默认同步到送货段
+  → 若送货段已选合同:过滤非合同产品
+  → 用户可「选择产品」补合同内产品
+  → 换送货合同:再过滤
+  → 保存:前端 + 后端归属校验
+```
+
+## 7. 边界情况
+
+| 情况 | 处理 |
+|------|------|
+| 未选送货合同 | 同步保留;不做归属校验;禁用「选择产品」 |
+| 选合同后同步结果全被清掉 | 空表;用户用「选择产品」或再同步(若装货有合同内产品) |
+| 合同无明细 | 过滤后为空;选品列表空;保存有产品则拦截 |
+| 多送货段 | 各段独立合同 id / 过滤 / 选品 |
+| 内置客户 | 不同过滤、不校验归属 |
+
+## 8. 测试计划
+
+### 后端
+
+- 送货已选合同 + 合同外产品 → 422
+- 送货已选合同 + 合同内产品 → 通过
+- 送货未选合同 → skip
+- 内置送货客户 → skip
+
+### 前端 / 手工
+
+- [ ] 同步后换送货合同:非合同产品消失
+- [ ] 未选合同可同步保留;选合同后过滤
+- [ ] 「选择产品」限合同内;未选合同禁用
+- [ ] 保存拦截送货合同外产品
+- [ ] 多送货段互不影响
+
+## 9. 实现路径
+
+方案 1(推荐):镜像装货侧能力,最小改动扩展。

+ 1 - 1
docs/superpowers/specs/2026-08-30-pl-plan-form-available-qty-design.md

@@ -17,7 +17,7 @@
 | 展示条件 | 有产品行即显示;无合同 →「—」,问号禁用并提示先选合同 |
 | 问号 | 点击弹窗(非悬停气泡) |
 | 计划编号 | 仅展示,不可点击 |
-| 口径 | 可安排 = 合同数量 − 已安排(编辑时已安排不含本计划旧量) |
+| 口径 | 可安排 = 合同数量 − 已安排(编辑时已安排不含本计划旧量);已归档按实际量、已安排未归档按计划量,见 `2026-08-30-pl-contract-qty-archived-actual-design.md` |
 | 框架无固定量 | 可安排「—」;弹窗说明不限额 |
 | 实现 | 方案 2:专用 API |
 

+ 1 - 1
docs/superpowers/specs/2026-08-30-pl-plan-single-contract-products-design.md

@@ -93,7 +93,7 @@
 - 内置客户:不做产品归属校验
 - **送货段产品**:不做「必须在送货合同内」校验(产品来自装货同步/删减;送货合同只管商务关联)
 
-> 说明:本设计将「每段可多选合同」收紧为最多 1 份,覆盖 `2026-08-20-pl-plan-contract-complete-design.md` 中「每侧可多选」的约定。
+> **更新(2026-08-30):** 送货段产品归属校验与「选择产品」已由 `2026-08-30-pl-plan-delivery-contract-products-design.md` 覆盖;以上「送货不做校验」条款废止。
 
 **合同完善接口**
 

+ 3 - 3
docs/web-admin-ui-spec-fresh-mint.md

@@ -111,7 +111,7 @@
 - 隐藏默认 marker:`.nav-details > summary::-webkit-details-marker { display: none }`
 - **布局**:`display: flex`,`align-items: center`,`justify-content: space-between`
 - **内边距**:`8px 12px`,**圆角**:`var(--radius)`
-- **字号**:`12px`,**字重**:`700`,**字色**:`var(--text-muted)`,`letter-spacing: 0.02em`,`user-select: none`
+- **字号**:`14px`,**字重**:`700`,**字色**:`var(--text-muted)`,`letter-spacing: 0.02em`,`user-select: none`
 - **右侧箭头(`::after`)**:`6×6px` 方块,用 `border-right` + `border-bottom` **2px** `var(--text-muted)` 画 chevron,默认 `rotate(-45deg)`;**`[open]`** 时 `rotate(45deg)`,`margin-top: -2px`;`opacity: 0.7`,`transition: transform 0.2s ease`
 - **hover**:背景 `var(--row-alt)`,字色 `var(--text)`
 
@@ -122,13 +122,13 @@
 **链接 `.nav a`**
 
 - `display: block`,`padding: 8px 12px 8px 14px`,`margin: 2px 0`,`border-radius: var(--radius)`
-- **默认**:`color: var(--text-muted)`,`font-weight: 500`,`font-size: 13px`,无下划线
+- **默认**:`color: var(--text-muted)`,`font-weight: 500`,`font-size: 15px`,无下划线
 - **hover**:背景 `var(--row-alt)`,字色 `var(--text)`
 - **active(`.active`)**:背景 `var(--primary-bg)`,字色 `var(--primary-dark)`,`font-weight: 600`
 
 ### 3.5 侧栏底部 `.nav-foot`
 
-- `margin-top: 24px`,`padding: 16px 12px 0`,`font-size: 13px`
+- `margin-top: 24px`,`padding: 16px 12px 0`,`font-size: 15px`
 - 内链接:`color: var(--text-muted)`,无下划线;**hover**:`color: var(--primary-dark)`
 
 ### 3.6 主列 `.main`

+ 22 - 22
graphify-out/manifest.json

@@ -1340,8 +1340,8 @@
     "semantic_hash": ""
   },
   "src/components/business/pl-contract-product-arrange-qty-dialog/index.vue": {
-    "mtime": 1788084481.6466134,
-    "ast_hash": "7de19030b5211acc9fc368ce05a52ff9",
+    "mtime": 1788084533.961265,
+    "ast_hash": "9a7755d275b24913a6b1311ba1040fe9",
     "semantic_hash": ""
   },
   "src/components/business/pl-delivery-slip-print-dialog/index.vue": {
@@ -1430,8 +1430,8 @@
     "semantic_hash": ""
   },
   "src/components/business/pl-plan-delivery-section/index.vue": {
-    "mtime": 1788081385.5429173,
-    "ast_hash": "486cdbcd74c7916cfe376d831a6bc936",
+    "mtime": 1788093746.73275,
+    "ast_hash": "e6e829e9c252352f28ea39f1e8b30e47",
     "semantic_hash": ""
   },
   "src/components/business/pl-plan-document-attachment-cell/index.vue": {
@@ -1450,8 +1450,8 @@
     "semantic_hash": ""
   },
   "src/components/business/pl-plan-form-dialog/index.vue": {
-    "mtime": 1788083582.5228114,
-    "ast_hash": "35e62e4d8099efa08d8453deed521326",
+    "mtime": 1788093747.6141834,
+    "ast_hash": "e909c284ef4b23a61796b456c5dfb627",
     "semantic_hash": ""
   },
   "src/components/business/pl-plan-hazard-cert-view-table/index.vue": {
@@ -3050,8 +3050,8 @@
     "semantic_hash": ""
   },
   "src/utils/pl-contract-qty-reminder.ts": {
-    "mtime": 1788080509.7439613,
-    "ast_hash": "2efe40034252ed858b585ad9aa8e1dbf",
+    "mtime": 1788092454.033008,
+    "ast_hash": "c3fa28608cf2969e9610d3ebe12380f5",
     "semantic_hash": ""
   },
   "src/utils/pl-delivery-slip-print.ts": {
@@ -3115,8 +3115,8 @@
     "semantic_hash": ""
   },
   "src/utils/pl-plan-contract-product.ts": {
-    "mtime": 1788058616.610267,
-    "ast_hash": "8b47dc61ae2ac344bbbf2485a775f3a0",
+    "mtime": 1788093731.9125082,
+    "ast_hash": "dcc536f6690c2171570ef75f53d9b097",
     "semantic_hash": ""
   },
   "src/utils/pl-plan-list-display-rows.ts": {
@@ -3129,6 +3129,16 @@
     "ast_hash": "3cc9ae29b30941a4d6cb20feb02b590c",
     "semantic_hash": ""
   },
+  "src/utils/pl-plan-stop-product-arrange-required.test.ts": {
+    "mtime": 1788083539.0387833,
+    "ast_hash": "3efbb8aaa8773261ca5909254b2b1a59",
+    "semantic_hash": ""
+  },
+  "src/utils/pl-plan-stop-product-arrange-required.ts": {
+    "mtime": 1788083556.4076781,
+    "ast_hash": "a71c3ff422ac308a6afa683fe712fbba",
+    "semantic_hash": ""
+  },
   "src/utils/pl-pound-qrcode-display.ts": {
     "mtime": 1787794030.5223289,
     "ast_hash": "ff4d2a43f3285f22c1a6cb2855457516",
@@ -4080,8 +4090,8 @@
     "semantic_hash": ""
   },
   "src/views/portal/home/index.vue": {
-    "mtime": 1788067863.9042327,
-    "ast_hash": "ef5d440d5dfbe704543ab4841fbcac50",
+    "mtime": 1788093612.1085253,
+    "ast_hash": "17c89fa4f0dcc85efabded25b2132807",
     "semantic_hash": ""
   },
   "src/views/public/db/inventory/index.vue": {
@@ -5643,15 +5653,5 @@
     "mtime": 1780108931.0,
     "ast_hash": "839d61e0376bb89e1c2bd458ecb2051b",
     "semantic_hash": ""
-  },
-  "src/utils/pl-plan-stop-product-arrange-required.test.ts": {
-    "mtime": 1788083539.0387833,
-    "ast_hash": "3efbb8aaa8773261ca5909254b2b1a59",
-    "semantic_hash": ""
-  },
-  "src/utils/pl-plan-stop-product-arrange-required.ts": {
-    "mtime": 1788083556.4076781,
-    "ast_hash": "a71c3ff422ac308a6afa683fe712fbba",
-    "semantic_hash": ""
   }
 }

+ 7 - 13
web-admin/graphify-out/.graphify_labels.json

@@ -210,14 +210,14 @@
   "208": "index.vue",
   "209": "Community 209",
   "210": "Community 210",
-  "211": "loadUserOptions",
+  "211": "navigation.ts",
   "212": "index.js",
   "213": "Community 213",
   "214": "Community 214",
   "215": "index.vue",
   "216": "VoidDialog.vue",
   "217": "index.js",
-  "218": "index.js",
+  "218": "price-letter.ts",
   "219": "applyBrandSelectChange",
   "220": "detail.vue",
   "221": "index.js",
@@ -243,7 +243,7 @@
   "241": "handleExportPdf",
   "242": "Community 242",
   "243": "Community 243",
-  "244": "v2.4.2.1 - 2025-06-16",
+  "244": "v2.4.2.3 - 2025-06-18",
   "245": "index.js",
   "246": "fetchData",
   "247": "Community 247",
@@ -262,23 +262,19 @@
   "260": "Community 260",
   "261": "Community 261",
   "262": "index.js",
-  "263": "fetchUploadAttachment",
   "264": "syncStatsColumnWidths",
   "265": "Community 265",
   "266": "crypto.ts",
   "267": "fetchData",
-  "268": "fetchData",
   "269": "Community 269",
   "270": "Community 270",
   "271": "SettingDrawer.vue",
-  "272": "menuFavorite.ts",
-  "273": "detail.vue",
-  "274": "crm-owner-candidates.ts",
+  "272": "index.vue",
   "275": "index.js",
   "276": "tabs.ts",
   "277": "handleKeyDown",
   "278": "index.vue",
-  "279": "crm-owner-candidates.ts",
+  "279": "fetchData",
   "280": "Community 280",
   "281": "index.js",
   "282": "fetchData",
@@ -290,13 +286,11 @@
   "288": "loadUserOptions",
   "289": "handleEdit",
   "290": "index.js",
-  "291": "loadUserOptions",
   "292": "Community 292",
   "293": "index.vue",
   "294": "menuFavorite.ts",
   "295": "Community 295",
   "296": "Community 296",
-  "297": "usePersistedListColumnWidths.ts",
   "298": "index.vue",
   "299": "zh_CN.js",
   "300": "form.vue",
@@ -311,8 +305,7 @@
   "309": "Community 309",
   "310": "Community 310",
   "311": "handleExportPdf",
-  "312": "ArtException.vue",
-  "313": "price-letter.ts",
+  "312": "index.vue",
   "314": "assignmentMatchesFilter",
   "315": "Community 315",
   "316": "Community 316",
@@ -343,6 +336,7 @@
   "341": "Community 341",
   "342": "error-handle.ts",
   "344": "ArtException.vue",
+  "345": "loadUserOptions",
   "346": "Community 346",
   "347": "Community 347",
   "349": "Community 349",

+ 5 - 13
web-admin/graphify-out/2026-08-30/.graphify_labels.json

@@ -210,14 +210,12 @@
   "208": "index.vue",
   "209": "Community 209",
   "210": "Community 210",
-  "211": "loadUserOptions",
   "212": "index.js",
   "213": "Community 213",
   "214": "Community 214",
   "215": "index.vue",
   "216": "VoidDialog.vue",
   "217": "index.js",
-  "218": "index.js",
   "219": "applyBrandSelectChange",
   "220": "detail.vue",
   "221": "index.js",
@@ -243,7 +241,6 @@
   "241": "handleExportPdf",
   "242": "Community 242",
   "243": "Community 243",
-  "244": "v2.4.2.1 - 2025-06-16",
   "245": "index.js",
   "246": "fetchData",
   "247": "Community 247",
@@ -262,25 +259,22 @@
   "260": "Community 260",
   "261": "Community 261",
   "262": "index.js",
-  "263": "fetchUploadAttachment",
   "264": "syncStatsColumnWidths",
   "265": "Community 265",
   "266": "crypto.ts",
   "267": "fetchData",
-  "268": "fetchData",
   "269": "Community 269",
   "270": "Community 270",
   "271": "SettingDrawer.vue",
-  "272": "menuFavorite.ts",
-  "273": "detail.vue",
-  "274": "crm-owner-candidates.ts",
+  "272": "index.vue",
   "275": "index.js",
   "276": "tabs.ts",
   "277": "handleKeyDown",
   "278": "index.vue",
-  "279": "crm-owner-candidates.ts",
+  "279": "fetchData",
   "280": "Community 280",
   "281": "index.js",
+  "282": "fetchData",
   "283": "Community 283",
   "284": "Community 284",
   "285": "Community 285",
@@ -289,7 +283,6 @@
   "288": "loadUserOptions",
   "289": "handleEdit",
   "290": "index.js",
-  "291": "loadUserOptions",
   "292": "Community 292",
   "293": "index.vue",
   "294": "menuFavorite.ts",
@@ -309,7 +302,7 @@
   "309": "Community 309",
   "310": "Community 310",
   "311": "handleExportPdf",
-  "313": "price-letter.ts",
+  "312": "index.vue",
   "314": "assignmentMatchesFilter",
   "315": "Community 315",
   "316": "Community 316",
@@ -340,9 +333,9 @@
   "341": "Community 341",
   "342": "error-handle.ts",
   "344": "ArtException.vue",
+  "345": "loadUserOptions",
   "346": "Community 346",
   "347": "Community 347",
-  "348": "handleSearch",
   "349": "Community 349",
   "350": "Community 350",
   "355": "Community 355",
@@ -596,7 +589,6 @@
   "1284": "plugin.min.js",
   "1287": "plugin.js",
   "1288": "plugin.min.js",
-  "1290": "index.js",
   "1292": "index.js",
   "1293": "plugin.js",
   "1294": "plugin.min.js",

Разница между файлами не показана из-за своего большого размера
+ 219 - 235
web-admin/graphify-out/2026-08-30/GRAPH_REPORT.md


Разница между файлами не показана из-за своего большого размера
+ 112 - 112
web-admin/graphify-out/2026-08-30/graph.json


Разница между файлами не показана из-за своего большого размера
+ 227 - 257
web-admin/graphify-out/GRAPH_REPORT.md


Разница между файлами не показана из-за своего большого размера
+ 112 - 112
web-admin/graphify-out/graph.json


+ 69 - 12
web-admin/src/components/business/pl-plan-delivery-section/index.vue

@@ -180,20 +180,33 @@
 
       <div class="pl-plan-stop-products-head">
         <span class="pl-plan-stop-products-head__title">送货产品</span>
-        <el-button
-          v-if="!readonly"
-          class="btn-ghost"
-          size="small"
-          @click="emit('sync-products', index)"
-        >
-          <el-icon><Refresh /></el-icon>从装货同步
-        </el-button>
+        <div v-if="!readonly" class="pl-plan-stop-products-head__actions">
+          <el-button class="btn-ghost" size="small" @click="emit('sync-products', index)">
+            <el-icon><Refresh /></el-icon>从装货同步
+          </el-button>
+          <span class="pl-plan-stop-products-head__add-wrap" @click="handleSelectProductsClick(index)">
+            <el-button
+              class="btn-main"
+              type="primary"
+              size="small"
+              :disabled="selectProductsDisabled(delivery)"
+            >
+              <el-icon><Plus /></el-icon>选择产品
+            </el-button>
+          </span>
+        </div>
       </div>
       <p v-if="showSplitHint" class="pl-plan-delivery-section__split-hint">
         多个送货段,请拆分各段数量
       </p>
+      <p
+        v-if="missingFromLoadHint(delivery)"
+        class="pl-plan-delivery-section__missing-load-hint"
+      >
+        {{ missingFromLoadHint(delivery) }}
+      </p>
       <p v-if="!delivery.products.length" class="pl-plan-delivery-section__empty-hint">
-        请先在装货区添加产品,将自动同步到送货段
+        可从装货同步,或点击「选择产品」从合同中添加
       </p>
       <PlPlanStopProductTable
         :products="delivery.products"
@@ -210,7 +223,7 @@
 </template>
 
 <script setup lang="ts">
-  import { Bottom, Delete, Refresh, Search, Top } from '@element-plus/icons-vue'
+  import { Bottom, Delete, Plus, Refresh, Search, Top } from '@element-plus/icons-vue'
   import { fetchCustomerOptions } from '@/api/crm/customer'
   import { customerStopPrefApi, type CustomerStopPref } from '@/api/pl/index'
   import PlAddressWithLibrary, {
@@ -222,8 +235,10 @@
     createEmptyDeliveryForm,
     resolveStopDibangDefaults,
     sumStopProductsPlanQty,
-    type PlanDeliveryForm
+    type PlanDeliveryForm,
+    type PlanStopProductFormRow
   } from '@/utils/pl-plan-stop-form'
+  import { findDeliveryProductsMissingFromLoad } from '@/utils/pl-plan-contract-product'
   import { isPlInternalCustomerName } from '@/utils/pl-internal-customer'
   import { pickBxData } from '@/utils/http/bx'
 
@@ -237,6 +252,8 @@
       /** 多送货段时提示拆分数量 */
       showSplitHint?: boolean
       excludePlanId?: string
+      /** 装货段产品,用于「送货产品不在装货列表」软提醒 */
+      loadProducts?: PlanStopProductFormRow[]
     }>(),
     {
       tabMode: true,
@@ -244,7 +261,8 @@
       compactProducts: true,
       qtyUnitLabel: '',
       showSplitHint: false,
-      excludePlanId: ''
+      excludePlanId: '',
+      loadProducts: () => []
     }
   )
 
@@ -252,6 +270,7 @@
     'update:modelValue': [value: PlanDeliveryForm[]]
     'open-customer-picker': [index: number]
     'sync-products': [index: number]
+    'select-products': [index: number]
     'add-delivery': []
     'active-index-change': [index: number]
   }>()
@@ -267,6 +286,27 @@
   function deliveryContractId(delivery: PlanDeliveryForm) {
     return String(delivery.contracts?.[0]?.contractId || '').trim()
   }
+
+  function selectProductsDisabled(delivery: PlanDeliveryForm) {
+    if (isPlInternalCustomerName(delivery.customerName)) return false
+    return !deliveryContractId(delivery)
+  }
+
+  function handleSelectProductsClick(index: number) {
+    const delivery = props.modelValue[index]
+    if (!delivery) return
+    if (selectProductsDisabled(delivery)) {
+      ElMessage.warning('请先选择送货合同后再选择产品')
+      return
+    }
+    emit('select-products', index)
+  }
+
+  function missingFromLoadHint(delivery: PlanDeliveryForm) {
+    const names = findDeliveryProductsMissingFromLoad(delivery.products, props.loadProducts)
+    if (!names.length) return ''
+    return `注意:产品「${names.join('、')}」不在装货产品列表中,请核对(不影响保存/安排)`
+  }
   const customerOptionsByIndex = ref<Record<number, CustomerOptionRow[]>>({})
   const customerOptionsLoading = ref<Record<number, boolean>>({})
 
@@ -656,12 +696,29 @@
     color: #64748b;
   }
 
+  .pl-plan-stop-products-head__actions {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+  }
+
+  .pl-plan-stop-products-head__add-wrap {
+    display: inline-flex;
+  }
+
   .pl-plan-delivery-section__split-hint {
     margin: 6px 0 0;
     font-size: 12px;
     color: #d97706;
   }
 
+  .pl-plan-delivery-section__missing-load-hint {
+    margin: 6px 0 0;
+    font-size: 12px;
+    font-weight: 700;
+    color: #dc2626;
+  }
+
   .pl-plan-delivery-section__empty-hint {
     margin: 6px 0 0;
     font-size: 12px;

+ 183 - 42
web-admin/src/components/business/pl-plan-form-dialog/index.vue

@@ -193,7 +193,7 @@
                 compact-products
                 :exclude-plan-id="planId || ''"
                 @open-customer-picker="openCustomerSelector('load')"
-                @add-products="productSelectorVisible = true"
+                @add-products="openProductSelector('load')"
               />
             </template>
             <template #delivery-actions>
@@ -232,9 +232,11 @@
                 :qty-unit-label="planQtyUnitLabel"
                 :show-split-hint="showDeliverySplitHint"
                 :exclude-plan-id="planId || ''"
+                :load-products="loadForm.products"
                 @active-index-change="deliveryActiveIndex = $event"
                 @open-customer-picker="openCustomerSelector('delivery', $event)"
                 @sync-products="syncDeliveryProductsFromLoadManual"
+                @select-products="openProductSelector('delivery', $event)"
               />
             </template>
           </PlPlanStopsSplitShell>
@@ -517,18 +519,71 @@
   const customerOptions = ref<CustomerOptionRow[]>([])
   const customerOptionsLoading = ref(false)
   const productSelectorVisible = ref(false)
+  /** 产品选择器目标:装货 或 某一送货段 */
+  const productSelectorTarget = ref<{ side: 'load' | 'delivery'; deliveryIndex: number }>({
+    side: 'load',
+    deliveryIndex: 0
+  })
   /** 当前装货合同明细中的 CRM productId(非内部客户限制选品) */
   const loadContractProductIds = ref<string[]>([])
   /** 装货合同明细拉取序号,避免快速换合同时旧响应覆盖新结果 */
   let loadContractFetchSeq = 0
+  /** 合同 id → 明细 productId(装/送货共用缓存) */
+  const contractProductIdsCache = ref<Record<string, string[]>>({})
+  /** 送货段合同明细拉取序号(按段) */
+  const deliveryContractFetchSeqByIndex: Record<number, number> = {}
   /**
    * 内部客户:undefined → ProductSelector 全量目录
    * 非内部:始终传 string[](合同无明细时为 [])→ 受限模式,勿与「未传」混淆
    */
   const productSelectorAllowedIds = computed((): string[] | undefined => {
+    if (productSelectorTarget.value.side === 'delivery') {
+      const delivery = deliveryForms.value[productSelectorTarget.value.deliveryIndex]
+      if (!delivery) return []
+      if (isPlInternalCustomerName(delivery.customerName)) return undefined
+      const cid = String(delivery.contracts?.[0]?.contractId || '').trim()
+      return cid ? contractProductIdsCache.value[cid] || [] : []
+    }
     if (isPlInternalCustomerName(loadForm.value.customerName)) return undefined
     return loadContractProductIds.value
   })
+
+  function openProductSelector(side: 'load' | 'delivery', deliveryIndex = 0) {
+    productSelectorTarget.value = { side, deliveryIndex }
+    productSelectorVisible.value = true
+  }
+
+  async function fetchContractProductIds(contractId: string): Promise<string[]> {
+    const id = String(contractId || '').trim()
+    if (!id) return []
+    if (Object.prototype.hasOwnProperty.call(contractProductIdsCache.value, id)) {
+      return contractProductIdsCache.value[id] || []
+    }
+    try {
+      const res = await getContract(id)
+      const detail = pickBxData<{ products?: Array<{ productId?: string | null }> }>(res)
+      const allowedIds = collectContractProductIds(detail?.products || [])
+      contractProductIdsCache.value = { ...contractProductIdsCache.value, [id]: allowedIds }
+      return allowedIds
+    } catch {
+      contractProductIdsCache.value = { ...contractProductIdsCache.value, [id]: [] }
+      return []
+    }
+  }
+
+  function filterDeliveryProductsByContract(delivery: PlanDeliveryForm): PlanDeliveryForm {
+    if (isPlInternalCustomerName(delivery.customerName)) return delivery
+    const cid = String(delivery.contracts?.[0]?.contractId || '').trim()
+    if (!cid) return delivery
+    const allowed = contractProductIdsCache.value[cid]
+    // 明细尚未拉到时先不刷,避免误清空;拉完后 watch 会再滤
+    if (allowed === undefined) return delivery
+    return {
+      ...delivery,
+      products: filterProductsByAllowedProductIds(delivery.products || [], allowed)
+    }
+  }
+
   const vehicleViewVisible = ref(false)
   const vehicleLibraryVisible = ref(false)
   const carrierLibraryVisible = ref(false)
@@ -635,32 +690,42 @@
     )
   }
 
-  function applyLoadProductsToDeliveries(options?: {
+  async function ensureDeliveryContractProductCaches() {
+    const tasks = deliveryForms.value.map(async (row) => {
+      if (isPlInternalCustomerName(row.customerName)) return
+      const cid = String(row.contracts?.[0]?.contractId || '').trim()
+      if (cid) await fetchContractProductIds(cid)
+    })
+    await Promise.all(tasks)
+  }
+
+  async function applyLoadProductsToDeliveries(options?: {
     showHint?: boolean
     forceQtyFromLoad?: boolean
   }) {
+    await ensureDeliveryContractProductCaches()
     const result = syncDeliveriesProductsFromLoad(
       deliveryForms.value,
       loadForm.value.products || [],
       { forceQtyFromLoad: options?.forceQtyFromLoad }
     )
-    deliveryForms.value = result.deliveries
+    deliveryForms.value = result.deliveries.map((row) => filterDeliveryProductsByContract(row))
     if (options?.showHint && result.needSplitHint) {
       ElMessage.info('多个送货段,请拆分各段数量')
     }
   }
 
   /** 装货产品变更后:镜像计划层产品 + 同步送货段(C1) */
-  function syncFromLoadProducts(options?: { showHint?: boolean }) {
+  async function syncFromLoadProducts(options?: { showHint?: boolean }) {
     if (suppressStopProductSync.value || detailLoading.value) return
     mirrorPlanProductsFromLoad()
-    applyLoadProductsToDeliveries(options)
+    await applyLoadProductsToDeliveries(options)
   }
 
   function handleAddDelivery() {
     deliverySectionRef.value?.addDelivery()
     nextTick(() => {
-      applyLoadProductsToDeliveries({ showHint: true })
+      void applyLoadProductsToDeliveries({ showHint: true })
     })
   }
 
@@ -671,7 +736,7 @@
   function handleRemoveDelivery() {
     deliverySectionRef.value?.removeDelivery(deliveryActiveIndex.value)
     nextTick(() => {
-      applyLoadProductsToDeliveries()
+      void applyLoadProductsToDeliveries()
     })
   }
   const hasFreightRef = computed(() => formData.hasFreight)
@@ -993,7 +1058,7 @@
   }
 
   /** 详情加载后:无装货产品时用计划产品回填;再按 C1 同步送货 */
-  function bootstrapStopsFromPlanProducts() {
+  async function bootstrapStopsFromPlanProducts() {
     if (!loadForm.value.products.length && formData.products.length) {
       loadForm.value = {
         ...loadForm.value,
@@ -1003,11 +1068,11 @@
       enrichStopFormsDisplayFromPlanProducts()
     }
     mirrorPlanProductsFromLoad()
-    applyLoadProductsToDeliveries()
+    await applyLoadProductsToDeliveries()
   }
 
-  function syncDeliveryProductsFromLoadManual() {
-    applyLoadProductsToDeliveries({ forceQtyFromLoad: deliveryForms.value.length < 2 })
+  async function syncDeliveryProductsFromLoadManual() {
+    await applyLoadProductsToDeliveries({ forceQtyFromLoad: deliveryForms.value.length < 2 })
     ElMessage.success('已从装货产品同步')
   }
 
@@ -1030,16 +1095,8 @@
         return
       }
       const seq = ++loadContractFetchSeq
-      let allowedIds: string[] = []
-      try {
-        const res = await getContract(id)
-        if (seq !== loadContractFetchSeq) return
-        const detail = pickBxData<{ products?: Array<{ productId?: string | null }> }>(res)
-        allowedIds = collectContractProductIds(detail?.products || [])
-      } catch {
-        if (seq !== loadContractFetchSeq) return
-        allowedIds = []
-      }
+      const allowedIds = await fetchContractProductIds(id)
+      if (seq !== loadContractFetchSeq) return
       loadContractProductIds.value = allowedIds
       // 合同 id 变化时过滤装货产品(详情首次灌入同 id / 加载中不刷)
       if (
@@ -1059,6 +1116,40 @@
     { deep: true }
   )
 
+  watch(
+    () =>
+      deliveryForms.value.map((row) => ({
+        customerName: row.customerName,
+        contractId: String(row.contracts?.[0]?.contractId || '').trim()
+      })),
+    async (curr, prev) => {
+      if (detailLoading.value || suppressStopProductSync.value) return
+      for (let i = 0; i < curr.length; i += 1) {
+        const id = curr[i]?.contractId || ''
+        const prevId = prev?.[i]?.contractId || ''
+        if (!id) continue
+        const seq = (deliveryContractFetchSeqByIndex[i] || 0) + 1
+        deliveryContractFetchSeqByIndex[i] = seq
+        const allowedIds = await fetchContractProductIds(id)
+        if (deliveryContractFetchSeqByIndex[i] !== seq) continue
+        const delivery = deliveryForms.value[i]
+        if (!delivery || isPlInternalCustomerName(delivery.customerName)) continue
+        const contractChanged = !prev || id !== prevId
+        const hasOrphan = (delivery.products || []).some((row) => {
+          const pid = String(row.productId || '').trim()
+          return !!pid && !allowedIds.includes(pid)
+        })
+        // 换合同必滤;同合同仅在有合同外产品时滤(如同步后明细刚拉到)
+        if (!contractChanged && !hasOrphan) continue
+        const nextProducts = filterProductsByAllowedProductIds(delivery.products || [], allowedIds)
+        deliveryForms.value = deliveryForms.value.map((row, idx) =>
+          idx === i ? { ...row, products: nextProducts } : row
+        )
+      }
+    },
+    { deep: true }
+  )
+
   function openCustomerSelector(side: CustomerSide, deliveryIndex = 0) {
     customerSelectorSide.value = side
     customerSelectorDeliveryIndex.value = deliveryIndex
@@ -1170,29 +1261,58 @@
   )
 
   async function handleProductConfirm(products: any[]) {
-    const nextRows = [...(loadForm.value.products || [])]
-    for (const product of products) {
-      const brandMeta = initLineBrandMetaFromProduct(product as Record<string, unknown>)
-      const row: PlanFormProductRow = {
-        productId: String(product.id || ''),
-        productNo: String(product.productNo || product.id || ''),
-        productName: String(product.productName || ''),
-        model: product.model as string | undefined,
-        categoryName: product.categoryName as string | undefined,
-        unit: String(product.unit || '吨'),
-        quantity: 1,
-        actualQty: 0,
-        packageSpec: '',
-        deliveryMethod: '',
-        isToxic: Number(product.isToxic || 0),
-        isExplosive: Number(product.isExplosive || 0),
-        ...brandMeta
+    const target = productSelectorTarget.value
+    const buildRows = async () => {
+      const rows: ReturnType<typeof createStopProductsFromPlanProducts> = []
+      for (const product of products) {
+        const brandMeta = initLineBrandMetaFromProduct(product as Record<string, unknown>)
+        const row: PlanFormProductRow = {
+          productId: String(product.id || ''),
+          productNo: String(product.productNo || product.id || ''),
+          productName: String(product.productName || ''),
+          model: product.model as string | undefined,
+          categoryName: product.categoryName as string | undefined,
+          unit: String(product.unit || '吨'),
+          quantity: 1,
+          actualQty: 0,
+          packageSpec: '',
+          deliveryMethod: '',
+          isToxic: Number(product.isToxic || 0),
+          isExplosive: Number(product.isExplosive || 0),
+          ...brandMeta
+        }
+        const [enriched] = await enrichPlanProductLinesAlias(
+          await enrichPlanProductsHazardFromCrm([row])
+        )
+        rows.push(...createStopProductsFromPlanProducts([enriched]))
+      }
+      return rows
+    }
+
+    if (target.side === 'delivery') {
+      const index = target.deliveryIndex
+      const delivery = deliveryForms.value[index]
+      if (!delivery) return
+      const existingIds = new Set(
+        (delivery.products || []).map((row) => String(row.productId || '').trim()).filter(Boolean)
+      )
+      const added = (await buildRows()).filter((row) => {
+        const pid = String(row.productId || '').trim()
+        if (!pid || existingIds.has(pid)) return false
+        existingIds.add(pid)
+        return true
+      })
+      if (!added.length) {
+        ElMessage.info('所选产品已在送货段中')
+        return
       }
-      const [enriched] = await enrichPlanProductLinesAlias(
-        await enrichPlanProductsHazardFromCrm([row])
+      deliveryForms.value = deliveryForms.value.map((row, idx) =>
+        idx === index ? { ...row, products: [...(row.products || []), ...added] } : row
       )
-      nextRows.push(...createStopProductsFromPlanProducts([enriched]))
+      return
     }
+
+    const nextRows = [...(loadForm.value.products || []), ...(await buildRows())]
     loadForm.value = { ...loadForm.value, products: nextRows }
     freightCalc.resetFreightCalc()
   }
@@ -1738,7 +1858,7 @@
     return (contracts || []).some((item) => !!String(item.contractId || '').trim())
   }
 
-  /** 非内部客户:装/送货段合同至多 1 份;已选 1 份时校验装货产品归属合同 */
+  /** 非内部客户:装/送货段合同至多 1 份;已选 1 份时校验装/送货产品归属合同 */
   function validateSingleContractPerStop(): boolean {
     if (
       !isPlInternalCustomerName(loadForm.value.customerName) &&
@@ -1775,6 +1895,27 @@
         }
       }
     }
+    for (let i = 0; i < deliveryForms.value.length; i += 1) {
+      const row = deliveryForms.value[i]
+      if (isPlInternalCustomerName(row.customerName)) continue
+      if ((row.contracts || []).length !== 1) continue
+      const products = row.products || []
+      if (!products.length) continue
+      const cid = String(row.contracts?.[0]?.contractId || '').trim()
+      const allowedList = cid ? contractProductIdsCache.value[cid] : undefined
+      const allowed = new Set((allowedList || []).map((id) => String(id).trim()).filter(Boolean))
+      if (!allowed.size) {
+        ElMessage.warning(
+          `送货段#${i + 1}所选合同暂无产品明细,或合同明细加载失败,请重选合同后再保存`
+        )
+        return false
+      }
+      const orphan = products.some((p) => !allowed.has(String(p.productId || '').trim()))
+      if (orphan) {
+        ElMessage.warning(`送货段#${i + 1}产品须属于所选合同`)
+        return false
+      }
+    }
     return true
   }
 

+ 2 - 2
web-admin/src/components/core/layouts/art-menus/art-sidebar-menu/theme.scss

@@ -3,7 +3,7 @@
 // 菜单样式变量
 $menu-height: 40px;
 $menu-icon-size: 16px;
-$menu-font-size: 13px;
+$menu-font-size: 15px;
 $hover-bg-color: var(--mint-row-alt, #f8fafc);
 $popup-menu-height: 40px;
 $popup-menu-padding: 8px;
@@ -200,7 +200,7 @@ $popup-menu-radius: 6px;
   }
 
   .el-sub-menu > .el-sub-menu__title {
-    font-size: 12px !important;
+    font-size: 14px !important;
     font-weight: 700;
     color: var(--mint-text-muted, #64748b) !important;
     letter-spacing: 0.02em;

+ 10 - 1
web-admin/src/utils/pl-contract-qty-reminder.ts

@@ -1,5 +1,7 @@
 import { ElMessageBox } from 'element-plus'
 import type { ContractQtyReminder, ContractQtyReminderItem } from '@/api/pl'
+import { useDictStore } from '@/store/modules/dict'
+import { getProductUnitLabel } from '@/utils/crm-product-display'
 
 export const CONTRACT_QTY_VIOLATION_CODE = 'CONTRACT_QTY_OVERFLOW'
 
@@ -40,6 +42,13 @@ function stopKindLabel(kind?: string): string {
   return kind || ''
 }
 
+/** 将单位字典值(如 dun)转为展示文案(如 吨) */
+function resolveUnitLabel(unit?: string): string {
+  if (!unit) return '—'
+  const dictStore = useDictStore()
+  return getProductUnitLabel((type, value) => dictStore.getLabel(type, value), unit)
+}
+
 export function extractContractQtyViolationDetail(error: unknown): {
   message: string
   items: Array<Record<string, unknown>>
@@ -134,7 +143,7 @@ export function buildContractQtyDialogHtml(
       .map((row) => {
         const name = escapeHtml(row.productName || row.productId || '—')
         const model = escapeHtml(row.model || '—')
-        const unit = escapeHtml(row.unit || '—')
+        const unit = escapeHtml(resolveUnitLabel(row.unit))
         const contractQty = row.framework
           ? '按客户需求'
           : escapeHtml(formatQty(row.contractQty))

+ 23 - 0
web-admin/src/utils/pl-plan-contract-product.ts

@@ -24,3 +24,26 @@ export function filterProductsByAllowedProductIds<T extends { productId?: string
   if (!allowed.size) return []
   return (products || []).filter((row) => allowed.has(String(row.productId || '').trim()))
 }
+
+/**
+ * 找出不在装货产品列表中的送货产品(仅提醒,不拦截)。
+ * 返回展示名列表(去重)。
+ */
+export function findDeliveryProductsMissingFromLoad(
+  deliveryProducts: Array<{ productId?: string | null; productName?: string | null }> | null | undefined,
+  loadProducts: Array<{ productId?: string | null }> | null | undefined
+): string[] {
+  const loadIds = new Set(
+    (loadProducts || []).map((row) => String(row?.productId || '').trim()).filter(Boolean)
+  )
+  const names: string[] = []
+  const seen = new Set<string>()
+  for (const row of deliveryProducts || []) {
+    const pid = String(row?.productId || '').trim()
+    if (!pid || loadIds.has(pid) || seen.has(pid)) continue
+    seen.add(pid)
+    const name = String(row?.productName || '').trim() || pid
+    names.push(name)
+  }
+  return names
+}

+ 2 - 2
web-admin/src/views/portal/home/index.vue

@@ -485,7 +485,7 @@
     justify-content: space-between;
     width: 100%;
     padding: 9px 12px;
-    font-size: 13px;
+    font-size: 15px;
     font-weight: 500;
     color: var(--mint-text, #1e293b);
     text-align: left;
@@ -506,7 +506,7 @@
 
     .n {
       flex-shrink: 0;
-      font-size: 11px;
+      font-size: 12px;
       font-weight: 600;
       font-variant-numeric: tabular-nums;
       color: #94a3b8;

Некоторые файлы не были показаны из-за большого количества измененных файлов