This commit is contained in:
zlwu committed 2026-08-27 14:23:18 +08:00
1 parent e56d227fe8
commit 4611dbc2b2
237 files changed
+1384060 -24942

No files matched your search

+1 -1
View File
@@ -1 +1 @@
55575
37304
+4
View File
@@ -3,6 +3,7 @@ from fastapi import APIRouter
from app.api.pl import plan, transport, freight, inventory, menu_badges, ocr
from app.api.pl import base_data, vehicle_recharge, vehicle_maintenance, vehicle_urea, transport_address
from app.api.pl import customer_stop_pref
from app.api.pl import io_order
pl_router = APIRouter(prefix="/transport", tags=["运输计划管理"])
@@ -13,6 +14,9 @@ pl_router.include_router(base_data.router)
# 运输通用地址库
pl_router.include_router(transport_address.router)
# 客户装/送货默认记忆
pl_router.include_router(customer_stop_pref.router)
# OCR 自动识别
pl_router.include_router(ocr.router)
+33
View File
@@ -0,0 +1,33 @@
"""客户装/送货物流默认记忆 API"""
from typing import Optional
from fastapi import APIRouter, Depends, HTTPException, Query
from sqlalchemy.orm import Session
from app.core.database import get_db
from app.core.db_auth import DbUserContext, get_db_current_user
from app.core.tenant_context import get_tenant_no
from app.schemas.pl.customer_stop_pref import CustomerStopPrefRead
from app.services.pl_customer_stop_pref_service import (
STOP_DELIVERY,
STOP_LOAD,
get_customer_stop_pref,
)
router = APIRouter(tags=["客户装卸货默认记忆"])
@router.get("/customer-stop-pref", response_model=Optional[CustomerStopPrefRead])
def read_customer_stop_pref(
customer_id: str = Query(..., alias="customerId"),
stop_type: str = Query(..., alias="stopType", description="load | delivery"),
db: Session = Depends(get_db),
user: DbUserContext = Depends(get_db_current_user),
) -> Optional[CustomerStopPrefRead]:
if stop_type not in (STOP_LOAD, STOP_DELIVERY):
raise HTTPException(status_code=400, detail="stopType 须为 load 或 delivery")
tenant_no = get_tenant_no(db, user.to_tenant_user_dict())
row = get_customer_stop_pref(db, tenant_no, customer_id, stop_type)
if not row:
return None
return CustomerStopPrefRead.model_validate(row)
+277 -117
View File
@@ -34,16 +34,17 @@ from app.models.pl_models import (
PlPlanTransport,
PlTransport,
PlTransportDbLink,
PlTransportSiteLink,
PlVehicle,
)
from app.schemas.pl import PlanProductCreate
from app.schemas.pl.plan import (
CreateFromContractRequest,
DeliverySlipPrintRead,
PlanArchiveBody,
PlanArchiveBrandQtyItem,
PlanContractGapListResponse,
PlanContractGapRead,
PlanContractLink,
PlanCreate,
PlanCreateFull,
PlanDriverFeedbackUpdateBody,
@@ -53,6 +54,8 @@ from app.schemas.pl.plan import (
PlanInboundSlipTemplateSave,
PlanDeliverySlipTemplateSave,
PlanSubpackSlipTemplateSave,
PlanDeliveryBody,
PlanLoadBody,
PlanListQuery,
PlanListResponse,
PlanProductCertsUpdate,
@@ -78,11 +81,32 @@ from app.schemas.pl.transport import (
from app.services.pl_dibang_bridge_service import revoke_regeneratable_dibang_for_transport
from app.services.pl_inventory_link_read import build_transport_inventory_link_read
from app.services.pl_io_order_service import get_active_io_order_for_plan, void_io_orders_for_plan
from app.services.pl_site_link_read import build_transport_site_link_read_from_row
from app.services.pl_internal_customer import plan_requires_site_link
from app.services.pl_plan_site_link_service import build_site_records_for_arranged_plan
from app.services.pl_transport_site_service import revoke_site_links_for_transport
from app.services.pl_inventory_service import apply_archive_inventory_for_plan
from app.services.pl_inventory_service import (
apply_archive_inventory_for_plan,
apply_archive_inventory_for_plan_stops,
)
from app.services.pl_plan_archive_stop_service import (
apply_archive_stop_quantities,
sum_delivery_outbound_qty,
sync_plan_products_from_stop_archive,
)
from app.services.pl_plan_list_attachments import load_plan_document_attachments_by_plan_ids
from app.services.pl_plan_print_service import get_delivery_slip_print_context
from app.services.pl_plan_stop_service import (
attach_plan_stops_to_item,
collect_stop_qty_warnings,
load_plan_stops_grouped,
replace_plan_stops,
sync_plan_legacy_from_stops,
uses_multi_stop_payload,
validate_plan_stops_write,
)
from app.services.pl_customer_stop_pref_service import safe_upsert_prefs_from_plan_stops
from app.services.pl_plan_service import (
apply_archive_brand_qtys_only,
apply_archive_freight,
apply_archive_product_quantities,
apply_plan_driver_feedback,
@@ -435,6 +459,7 @@ def list_plans(
tenant_no=tenant_no,
plan_ids=plan_ids,
)
stops_by_plan = load_plan_stops_grouped(db, tenant_no, plan_ids)
result_list: list[PlanWithProducts] = []
for plan in plans:
@@ -484,6 +509,11 @@ def list_plans(
elif plan_item.driver_name:
plan_item.personnel_summary = f"{plan_item.driver_name}(驾)"
plan_item.document_attachments = document_attachments_by_plan.get(plan.id, [])
attach_plan_stops_to_item(
plan_item,
plan,
stops_by_plan.get(plan.id, (None, [])),
)
result_list.append(plan_item)
return PlanListResponse(total=total, list=result_list)
@@ -1039,19 +1069,37 @@ def create_plan_full(
user: DbUserContext = Depends(get_db_current_user),
) -> PlanWithProducts:
"""创建运输计划(完整表单:供方/需方 + 产品库产品 + 可选预选车辆,不自动安排运输)"""
validate_create_full(payload)
tenant_no = get_tenant_no(db, user.to_tenant_user_dict())
supplier_contracts, demander_contracts = validate_plan_party_contracts(
db,
tenant_no,
supplier_id=payload.supplier_id,
supplier_name=payload.supplier_name,
customer_id=payload.customer_id,
customer_name=payload.customer_name,
supplier_contracts=payload.supplier_contracts,
demander_contracts=payload.demander_contracts,
require_products=payload.products,
)
multi_stop = uses_multi_stop_payload(payload.load, payload.deliveries)
qty_warnings: list[str] = []
if multi_stop:
load_body, delivery_bodies = validate_plan_stops_write(
db,
tenant_no,
payload.load,
payload.deliveries,
payload.products,
)
qty_warnings = collect_stop_qty_warnings(payload.products, load_body, delivery_bodies)
supplier_contracts: list[PlanContractLink] = []
demander_contracts: list[PlanContractLink] = []
else:
validate_create_full(payload)
supplier_contracts, demander_contracts = validate_plan_party_contracts(
db,
tenant_no,
supplier_id=payload.supplier_id,
supplier_name=payload.supplier_name,
customer_id=payload.customer_id,
customer_name=payload.customer_name,
supplier_contracts=payload.supplier_contracts,
demander_contracts=payload.demander_contracts,
require_products=payload.products,
)
load_body = None
delivery_bodies = []
plan_no = _generate_plan_no(db)
# 单据类型由前端显式选择;未选则存空,不再自动推断为直销单
@@ -1088,6 +1136,7 @@ def create_plan_full(
delivery_method=payload.delivery_method,
settlement_method=payload.settlement_method,
has_freight=payload.has_freight,
freight_remark=payload.freight_remark,
pickup_address=payload.pickup_address,
pickup_lng=payload.pickup_lng,
pickup_lat=payload.pickup_lat,
@@ -1110,6 +1159,9 @@ def create_plan_full(
db.add(plan)
db.flush()
if multi_stop and load_body is not None:
sync_plan_legacy_from_stops(plan, load_body, delivery_bodies)
plan_products: list[PlPlanProduct] = []
for idx, prod in enumerate(payload.products or []):
is_toxic, is_explosive = resolve_hazard_flags_from_crm(
@@ -1130,15 +1182,35 @@ def create_plan_full(
db.add(pp)
plan_products.append(pp)
replace_plan_contracts(
db,
tenant_no=tenant_no,
plan_id=plan.id,
supplier_contracts=supplier_contracts,
demander_contracts=demander_contracts,
user_id=user.id,
dept_id=user.dept_id,
)
if multi_stop and load_body is not None:
replace_plan_stops(
db,
tenant_no=tenant_no,
plan_id=plan.id,
load=load_body,
deliveries=delivery_bodies,
user_id=user.id,
dept_id=user.dept_id,
plan_products=plan_products,
)
safe_upsert_prefs_from_plan_stops(
db,
tenant_no=tenant_no,
load=load_body,
deliveries=delivery_bodies,
user_id=user.id,
dept_id=user.dept_id,
)
else:
replace_plan_contracts(
db,
tenant_no=tenant_no,
plan_id=plan.id,
supplier_contracts=supplier_contracts,
demander_contracts=demander_contracts,
user_id=user.id,
dept_id=user.dept_id,
)
if has_vehicle and payload.transport:
apply_vehicle_prefill_to_plan(
@@ -1158,6 +1230,9 @@ def create_plan_full(
result.products = plan_products
result.supplier_contracts = supplier_contracts
result.demander_contracts = demander_contracts
result.warnings = qty_warnings
stops = load_plan_stops_grouped(db, tenant_no, [plan.id]).get(plan.id, (None, []))
attach_plan_stops_to_item(result, plan, stops)
return result
@@ -1341,6 +1416,8 @@ def get_plan(
).get(id, ([], []))
result.supplier_contracts = supplier_contracts
result.demander_contracts = demander_contracts
stops = load_plan_stops_grouped(db, tenant_no, [id]).get(id, (None, []))
attach_plan_stops_to_item(result, plan, stops)
return result
@@ -1349,23 +1426,36 @@ def get_plan(
# =============================================================================
@router.put("/{id}", response_model=PlanRead)
@router.put("/{id}", response_model=PlanWithProducts)
def update_plan(
id: str,
payload: PlanUpdate,
db: Session = Depends(get_db),
user: DbUserContext = Depends(get_db_current_user),
) -> PlanRead:
) -> PlanWithProducts:
tenant_no = get_tenant_no(db, user.to_tenant_user_dict())
plan = _get_plan(db, tenant_no, id, user)
if plan.follow_status == "cancelled":
raise HTTPException(status_code=400, detail="已作废的计划不能修改")
multi_stop = uses_multi_stop_payload(payload.load, payload.deliveries)
qty_warnings: list[str] = []
load_body: Optional[PlanLoadBody] = None
delivery_bodies: list[PlanDeliveryBody] = []
# 更新主表字段(跟进状态仅由业务动作接口维护,忽略客户端写入)
update_data = payload.model_dump(
exclude_unset=True,
exclude={"products", "transport", "follow_status", "supplier_contracts", "demander_contracts"},
exclude={
"products",
"transport",
"follow_status",
"supplier_contracts",
"demander_contracts",
"load",
"deliveries",
},
)
for key, value in update_data.items():
setattr(plan, key, value)
@@ -1383,48 +1473,63 @@ def update_plan(
supplier_name = plan.supplier_name
customer_id = plan.customer_id
customer_name = plan.customer_name
supplier_contracts_in = (
payload.supplier_contracts
if "supplier_contracts" in payload.model_fields_set
else load_plan_contracts_grouped(db, tenant_no, [id]).get(id, ([], []))[0]
)
demander_contracts_in = (
payload.demander_contracts
if "demander_contracts" in payload.model_fields_set
else load_plan_contracts_grouped(db, tenant_no, [id]).get(id, ([], []))[1]
)
# 编辑保存若带了产品或任一侧合同字段,按新规则完整校验供方/需方
if (
payload.products is not None
or "supplier_contracts" in payload.model_fields_set
or "demander_contracts" in payload.model_fields_set
or payload.supplier_id is not None
or payload.customer_id is not None
):
supplier_contracts, demander_contracts = validate_plan_party_contracts(
if multi_stop:
load_body, delivery_bodies = validate_plan_stops_write(
db,
tenant_no,
supplier_id=supplier_id,
supplier_name=supplier_name,
customer_id=customer_id,
customer_name=customer_name,
supplier_contracts=supplier_contracts_in,
demander_contracts=demander_contracts_in,
require_products=payload.products if payload.products is not None else None,
)
replace_plan_contracts(
db,
tenant_no=tenant_no,
plan_id=id,
supplier_contracts=supplier_contracts,
demander_contracts=demander_contracts,
user_id=user.id,
dept_id=user.dept_id,
payload.load,
payload.deliveries,
payload.products,
)
products_for_warn = payload.products if payload.products is not None else None
qty_warnings = collect_stop_qty_warnings(products_for_warn, load_body, delivery_bodies)
sync_plan_legacy_from_stops(plan, load_body, delivery_bodies)
supplier_contracts: list[PlanContractLink] = []
demander_contracts: list[PlanContractLink] = []
else:
supplier_contracts, demander_contracts = load_plan_contracts_grouped(db, tenant_no, [id]).get(
id, ([], [])
supplier_contracts_in = (
payload.supplier_contracts
if "supplier_contracts" in payload.model_fields_set
else load_plan_contracts_grouped(db, tenant_no, [id]).get(id, ([], []))[0]
)
demander_contracts_in = (
payload.demander_contracts
if "demander_contracts" in payload.model_fields_set
else load_plan_contracts_grouped(db, tenant_no, [id]).get(id, ([], []))[1]
)
# 编辑保存若带了产品或任一侧合同字段,按新规则完整校验供方/需方
if (
payload.products is not None
or "supplier_contracts" in payload.model_fields_set
or "demander_contracts" in payload.model_fields_set
or payload.supplier_id is not None
or payload.customer_id is not None
):
supplier_contracts, demander_contracts = validate_plan_party_contracts(
db,
tenant_no,
supplier_id=supplier_id,
supplier_name=supplier_name,
customer_id=customer_id,
customer_name=customer_name,
supplier_contracts=supplier_contracts_in,
demander_contracts=demander_contracts_in,
require_products=payload.products if payload.products is not None else None,
)
replace_plan_contracts(
db,
tenant_no=tenant_no,
plan_id=id,
supplier_contracts=supplier_contracts,
demander_contracts=demander_contracts,
user_id=user.id,
dept_id=user.dept_id,
)
else:
supplier_contracts, demander_contracts = load_plan_contracts_grouped(db, tenant_no, [id]).get(
id, ([], [])
)
plan_type = payload.plan_type or plan.plan_type
@@ -1524,12 +1629,36 @@ def update_plan(
user_id=user.id,
)
if multi_stop and load_body is not None:
replace_plan_stops(
db,
tenant_no=tenant_no,
plan_id=id,
load=load_body,
deliveries=delivery_bodies,
user_id=user.id,
dept_id=user.dept_id,
plan_products=plan_products,
)
safe_upsert_prefs_from_plan_stops(
db,
tenant_no=tenant_no,
load=load_body,
deliveries=delivery_bodies,
user_id=user.id,
dept_id=user.dept_id,
)
plan.update_by = user.id
db.commit()
db.refresh(plan)
result = PlanRead.model_validate(plan)
result = PlanWithProducts.model_validate(plan)
result.products = plan_products
result.supplier_contracts = supplier_contracts
result.demander_contracts = demander_contracts
result.warnings = qty_warnings
stops = load_plan_stops_grouped(db, tenant_no, [id]).get(id, (None, []))
attach_plan_stops_to_item(result, plan, stops)
return result
@@ -1648,7 +1777,13 @@ def get_plan_arrange_info(
tenant_no = get_tenant_no(db, user.to_tenant_user_dict())
plan = _get_plan(db, tenant_no, id, user)
empty = PlanArrangeInfoRead(driver_url=None, license_plate=None, site_records=[], inventory_records=[])
empty = PlanArrangeInfoRead(
driver_url=None,
license_plate=None,
site_records=[],
inventory_records=[],
requires_site_link=False,
)
if plan.follow_status == "cancelled" or plan.transport_status != "arranged" or not plan.transport_id:
return empty
@@ -1666,37 +1801,14 @@ def get_plan_arrange_info(
token = (transport.driver_access_token or "").strip()
driver_url = _build_driver_url(token) if token else None
site_rows = (
db.query(PlTransportSiteLink)
.filter(
PlTransportSiteLink.tenant_no == tenant_no,
PlTransportSiteLink.plan_id == id,
PlTransportSiteLink.transport_id == transport.id,
PlTransportSiteLink.del_flag == 0,
)
.order_by(PlTransportSiteLink.create_time.asc())
.all()
requires_site_link = plan_requires_site_link(db, tenant_no=tenant_no, plan=plan)
site_records = build_site_records_for_arranged_plan(
db,
tenant_no=tenant_no,
plan=plan,
transport=transport,
)
product_name_by_id = {
item.id: item.product_name or ""
for item in db.query(PlPlanProduct)
.filter(
PlPlanProduct.plan_id == id,
PlPlanProduct.del_flag == 0,
)
.all()
}
site_records: list[TransportSiteLinkRead] = [
build_transport_site_link_read_from_row(
row,
product_name=product_name_by_id.get(row.plan_product_id, row.product or ""),
)
for row in site_rows
]
links = (
db.query(PlTransportDbLink)
.filter(
@@ -1736,6 +1848,8 @@ def get_plan_arrange_info(
db_inventory_id=link.db_inventory_id,
batch_no=(inventory.batch_no if inventory else "") or "",
plan_no=plan.plan_no or "",
stop_type=link.stop_type,
stop_id=link.stop_id,
)
)
@@ -1754,18 +1868,6 @@ def get_plan_arrange_info(
site_url=build_io_order_site_url(kind, token) if token else None,
status=header.status,
)
if not site_records and token and header.status != "voided":
site_records = [
TransportSiteLinkRead(
plan_product_id="",
product_name=header.order_no,
site_link_id=header.id,
plan_no=plan.plan_no or "",
business_type="入库" if kind == "inbound" else "出库",
site_access_token=token,
site_url=build_io_order_site_url(kind, token),
)
]
return PlanArrangeInfoRead(
driver_url=driver_url,
@@ -1773,6 +1875,7 @@ def get_plan_arrange_info(
site_records=site_records,
inventory_records=inventory_records,
io_order=io_order_brief,
requires_site_link=requires_site_link,
)
@@ -1968,16 +2071,49 @@ def archive_plan(
db.commit()
return get_plan(id, db, user)
apply_archive_product_quantities(
db, tenant_no=tenant_no, plan=plan, items=payload.products, user_id=user.id
)
apply_archive_inventory_for_plan(
db,
tenant_no=tenant_no,
plan=plan,
user_id=user.id,
dept_id=user.dept_id or "",
)
use_stop_archive = payload.load is not None and payload.deliveries is not None
if use_stop_archive:
if not payload.deliveries:
raise HTTPException(status_code=400, detail="请填写全部送货段归档")
apply_archive_stop_quantities(
db,
tenant_no=tenant_no,
plan=plan,
load_block=payload.load,
delivery_blocks=payload.deliveries,
user_id=user.id,
)
sync_plan_products_from_stop_archive(
db, tenant_no=tenant_no, plan_id=plan.id, user_id=user.id
)
if payload.products:
apply_archive_brand_qtys_only(
db,
tenant_no=tenant_no,
plan=plan,
items=payload.products,
user_id=user.id,
)
apply_archive_inventory_for_plan_stops(
db,
tenant_no=tenant_no,
plan=plan,
user_id=user.id,
dept_id=user.dept_id or "",
)
else:
if not payload.products:
raise HTTPException(status_code=400, detail="请提交产品归档明细")
apply_archive_product_quantities(
db, tenant_no=tenant_no, plan=plan, items=payload.products, user_id=user.id
)
apply_archive_inventory_for_plan(
db,
tenant_no=tenant_no,
plan=plan,
user_id=user.id,
dept_id=user.dept_id or "",
)
if payload.freight is not None:
apply_archive_freight(
db, tenant_no=tenant_no, plan=plan, freight=payload.freight, user_id=user.id
@@ -2110,6 +2246,30 @@ def save_inbound_slip_template(
# =============================================================================
@router.get("/{id}/print-delivery-slip", response_model=DeliverySlipPrintRead)
def get_print_delivery_slip(
id: str,
customerId: Optional[str] = Query(default=None, description="送货客户ID(多客户时必填)"),
db: Session = Depends(get_db),
user: DbUserContext = Depends(get_db_current_user),
):
"""按送货客户聚合送(提)货单打印数据;不传 customerId 时仅返回客户选项。"""
tenant_no = get_tenant_no(db, user.to_tenant_user_dict())
plan = _get_plan(db, tenant_no, id, user)
plan_date = plan.plan_date.isoformat() if plan.plan_date else None
try:
return get_delivery_slip_print_context(
db,
tenant_no=tenant_no,
plan_id=plan.id,
plan_no=plan.plan_no or "",
plan_date=plan_date,
customer_id=customerId,
)
except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc)) from exc
@router.get("/{id}/delivery-slip-template")
def get_delivery_slip_template(
id: str,
+58 -11
View File
@@ -30,12 +30,18 @@ from app.schemas.pl.io_order import (
PublicIoOrderHistoryProductRead,
PublicIoOrderHistoryRecordRead,
)
from app.services.pl_dibang_bridge_service import plan_has_load_stop
from app.services.pl_io_order_service import (
apply_io_order_stop_site_feedbacks,
apply_site_feedback,
build_io_order_site_url,
order_header_to_dict,
parse_feedback_images,
)
from app.services.pl_transport_stop_feedback_service import (
build_public_stop_reads_for_segments,
load_io_order_site_stop_segments,
)
from app.services.pl_product_display import (
load_crm_product_alias_maps,
resolve_product_display_names,
@@ -320,6 +326,20 @@ def _build_page(db: Session, kind: str, header, items) -> dict:
data["voided"] = voided
data["archived"] = archived
data["title"] = "入库单" if kind == "inbound" else "出库单"
data["stops"] = []
if plan and plan_has_load_stop(db, header.tenant_no, plan.id):
segments = load_io_order_site_stop_segments(
db,
tenant_no=header.tenant_no,
plan_id=plan.id,
transport_id=header.transport_id,
)
data["stops"] = build_public_stop_reads_for_segments(
db,
tenant_no=header.tenant_no,
plan_id=plan.id,
segments=segments,
)
return data
@@ -367,19 +387,45 @@ def _make_handlers(kind: str):
return error_response(400, "单据已作废,无法提交")
if page["archived"]:
return error_response(400, "运输计划已归档,无法提交")
qty_map = {x.id: Decimal(str(x.actual_qty)) for x in payload.items}
use_multi_stop = bool(payload.stops)
qty_map: dict[str, Decimal] = {}
brand_qty_map: dict[str, list[dict]] | None = None
if any(x.brand_qtys is not None for x in payload.items):
brand_qty_map = {}
for x in payload.items:
if x.brand_qtys is not None:
brand_qty_map[x.id] = [
b.model_dump(by_alias=True) for b in x.brand_qtys
]
images = payload.images
if not images:
images = parse_feedback_images(header.site_feedback_images)
try:
if use_multi_stop:
qty_map, brand_qty_map, merged_images = apply_io_order_stop_site_feedbacks(
db,
kind=kind,
header=header,
items=items,
stops=[stop.model_dump(by_alias=True) for stop in payload.stops],
enforce_brand=(payload.status == "completed"),
)
images = merged_images
if payload.items:
for x in payload.items:
qty_map[x.id] = Decimal(str(x.actual_qty))
if any(x.brand_qtys is not None for x in payload.items):
brand_qty_map = brand_qty_map or {}
for x in payload.items:
if x.brand_qtys is not None:
brand_qty_map[x.id] = [
b.model_dump(by_alias=True) for b in x.brand_qtys
]
else:
qty_map = {x.id: Decimal(str(x.actual_qty)) for x in payload.items}
if any(x.brand_qtys is not None for x in payload.items):
brand_qty_map = {}
for x in payload.items:
if x.brand_qtys is not None:
brand_qty_map[x.id] = [
b.model_dump(by_alias=True) for b in x.brand_qtys
]
if not images:
images = parse_feedback_images(header.site_feedback_images)
apply_site_feedback(
db,
kind=kind,
@@ -390,7 +436,8 @@ def _make_handlers(kind: str):
images=images,
status=payload.status,
item_brand_qtys=brand_qty_map,
enforce_brand=(payload.status == "completed"),
enforce_brand=(payload.status == "completed")
and (not use_multi_stop or bool(payload.items)),
)
except ValueError as exc:
return error_response(400, str(exc))
+320 -1
View File
@@ -4,6 +4,7 @@ from __future__ import annotations
import json
import os
from datetime import date, datetime
from decimal import Decimal
from typing import Optional
from fastapi import APIRouter, Depends, File, Form, HTTPException, Query, UploadFile
@@ -19,6 +20,8 @@ from app.crud import oss as oss_svc
from app.models.crm_models import CrmProductBrand
from app.models.pl_models import (
PlPlan,
PlPlanDelivery,
PlPlanLoad,
PlPlanProduct,
PlPlanTransport,
PlTransport,
@@ -28,15 +31,29 @@ from app.models.pl_models import (
from app.schemas.pl.io_order import BrandOption, BrandQtyItem
from app.schemas.pl.resource_snapshot import parse_resource_snapshot
from app.schemas.pl.transport import (
PublicTransportDriverStopFeedback,
PublicTransportFeedback,
PublicTransportHistoryPageRead,
PublicTransportHistoryProductRead,
PublicTransportHistoryRecordRead,
PublicTransportHistoryStopProductRead,
PublicTransportHistoryStopRead,
PublicTransportPageRead,
PublicTransportPersonnelRead,
PublicTransportPlanProductRead,
PublicTransportStopProductRead,
PublicTransportStopRead,
)
from app.services.pl_dibang_bridge_service import plan_has_load_stop
from app.services.pl_feedback_brand_qty import (
persist_transport_product_feedback,
require_brand_qtys_if_needed,
)
from app.services.pl_transport_stop_feedback_service import (
PublicStopProductRow,
load_driver_stop_segments,
save_driver_stop_feedback,
)
from app.services.pl_feedback_brand_qty import persist_transport_product_feedback
from app.services.pl_product_display import (
load_crm_product_alias_maps,
resolve_product_display_names,
@@ -55,6 +72,58 @@ def _resolve_unit_label(unit_map: dict[str, str], unit_code: Optional[str]) -> s
return unit_map.get(code, code)
def _build_stop_product_reads(
*,
stop_products: list[PublicStopProductRow],
plan_products_by_id: dict[str, PlPlanProduct],
unit_map: dict[str, str],
brand_options_by_product: dict[str, list[BrandOption]],
standard_by_id: dict[str, str],
alias_options_by_id: dict[str, list[str]],
) -> list[PublicTransportStopProductRead]:
reads: list[PublicTransportStopProductRead] = []
for row in stop_products:
plan_prod = plan_products_by_id.get(row.plan_product_id)
product_id = (row.product_id or (plan_prod.product_id if plan_prod else "") or "").strip()
display_name, alias_name = resolve_product_display_names(
saved_product_name=row.product_name,
product_id=product_id,
standard_by_id=standard_by_id,
alias_options_by_id=alias_options_by_id,
)
brand_qtys = None
if row.brand_qtys:
brand_qtys = [
BrandQtyItem(
brand_id=str(item.get("brandId") or item.get("brand_id") or ""),
brand_name=item.get("brandName") or item.get("brand_name"),
qty=item.get("qty") or 0,
)
for item in row.brand_qtys
if isinstance(item, dict)
] or None
reads.append(
PublicTransportStopProductRead(
stop_product_id=row.stop_product_id,
plan_product_id=row.plan_product_id,
product_name=display_name,
alias_name=alias_name,
model=row.model,
package_spec=row.package_spec,
unit=_resolve_unit_label(unit_map, row.unit),
quantity=row.plan_qty,
remark=row.remark,
brand_mode=plan_prod.brand_mode if plan_prod else None,
brand_id=plan_prod.brand_id if plan_prod else None,
brand_name=plan_prod.brand_name if plan_prod else None,
brand_options=brand_options_by_product.get(product_id) or None,
actual_qty=row.actual_qty,
brand_qtys=brand_qtys,
)
)
return reads
def _get_transport_by_token(db: Session, token: str) -> PlTransport:
transport = (
db.query(PlTransport)
@@ -127,6 +196,100 @@ def _history_status_label(plan_voided: bool, plan_archived: bool) -> str:
return "进行中"
def _build_history_stop_reads(
db: Session,
*,
tenant_no: str,
plan: PlPlan,
transport: PlTransport,
) -> list[PublicTransportHistoryStopRead]:
if not plan_has_load_stop(db, tenant_no, plan.id):
return []
plan_products = (
db.query(PlPlanProduct)
.filter(
PlPlanProduct.plan_id == plan.id,
PlPlanProduct.tenant_no == tenant_no,
PlPlanProduct.del_flag == 0,
)
.all()
)
plan_products_by_id = {row.id: row for row in plan_products}
crm_product_ids = {
(row.product_id or "").strip() for row in plan_products if (row.product_id or "").strip()
}
standard_by_id, alias_options_by_id = load_crm_product_alias_maps(
db, tenant_no=tenant_no, product_ids=crm_product_ids
)
unit_map = load_dict_label_maps(db, [CRM_PRODUCT_UNIT], tenant_no=tenant_no).get(
CRM_PRODUCT_UNIT, {}
)
load_row = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.plan_id == plan.id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
delivery_rows = (
db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.plan_id == plan.id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.all()
)
delivery_time_by_id = {row.id: row.delivery_time for row in delivery_rows}
load_time = load_row.load_time if load_row else None
segments = load_driver_stop_segments(
db,
tenant_no=tenant_no,
plan_id=plan.id,
transport_id=transport.id,
)
reads: list[PublicTransportHistoryStopRead] = []
for segment in segments:
stop_time = load_time if segment.stop_type == "load" else delivery_time_by_id.get(segment.stop_id)
stop_products: list[PublicTransportHistoryStopProductRead] = []
for row in segment.products:
plan_prod = plan_products_by_id.get(row.plan_product_id)
product_id = (row.product_id or (plan_prod.product_id if plan_prod else "") or "").strip()
display_name, _alias_name = resolve_product_display_names(
saved_product_name=row.product_name,
product_id=product_id,
standard_by_id=standard_by_id,
alias_options_by_id=alias_options_by_id,
)
stop_products.append(
PublicTransportHistoryStopProductRead(
product_name=display_name or row.product_name or "—",
model=row.model,
package_spec=row.package_spec,
quantity=row.plan_qty,
unit=_resolve_unit_label(unit_map, row.unit),
)
)
reads.append(
PublicTransportHistoryStopRead(
stop_type=segment.stop_type,
seq=segment.seq,
label=segment.label,
customer_name=segment.customer_name,
address=segment.address,
stop_time=stop_time,
products=stop_products,
)
)
return reads
def _build_driver_url(token: str) -> str:
origin = (settings.PUBLIC_WEB_ORIGIN or "").rstrip("/")
return f"{origin}/#/public/pl/transport/{token}"
@@ -296,6 +459,43 @@ def _build_public_page(db: Session, transport: PlTransport) -> PublicTransportPa
other_personnel = _resolve_other_personnel(transport, plan)
plan_voided, plan_archived = _resolve_driver_link_flags(plan, transport)
stop_reads: list[PublicTransportStopRead] = []
if plan and plan_has_load_stop(db, transport.tenant_no, plan.id):
plan_products_by_id = {p.id: p for p in products}
stop_reads = [
PublicTransportStopRead(
stop_type=segment.stop_type,
stop_id=segment.stop_id,
seq=segment.seq,
label=segment.label,
customer_name=segment.customer_name,
address=segment.address,
contact=segment.contact,
notes=segment.notes,
lng=segment.lng,
lat=segment.lat,
business_type=segment.business_type,
plan_qty=segment.plan_qty,
products=_build_stop_product_reads(
stop_products=segment.products,
plan_products_by_id=plan_products_by_id,
unit_map=unit_map,
brand_options_by_product=brand_options_by_product,
standard_by_id=standard_by_id,
alias_options_by_id=alias_options_by_id,
),
attachment_urls=segment.attachment_urls,
remark=segment.remark,
feedback_time=segment.feedback_time,
)
for segment in load_driver_stop_segments(
db,
tenant_no=transport.tenant_no,
plan_id=plan.id,
transport_id=transport.id,
)
]
return PublicTransportPageRead(
plan_no=plan.plan_no if plan else transport.transport_no,
plan_date=_format_plan_date(plan.plan_date if plan else None),
@@ -320,6 +520,7 @@ def _build_public_page(db: Session, transport: PlTransport) -> PublicTransportPa
driver_phone=transport.driver_phone,
other_personnel=other_personnel,
products=product_reads,
stops=stop_reads,
feedback_remark=transport.feedback_remark,
feedback_images=_parse_feedback_images(transport.feedback_images),
feedback_qty=transport.feedback_qty,
@@ -453,6 +654,9 @@ def get_public_transport_history(
pickup_address=plan.pickup_address,
destination_address=plan.destination_address or plan.destination_name,
products=products_by_plan.get(plan.id) or [],
stops=_build_history_stop_reads(
db, tenant_no=transport.tenant_no, plan=plan, transport=tr
),
plan_voided=voided,
plan_archived=archived,
status_label=_history_status_label(voided, archived),
@@ -526,6 +730,121 @@ def save_public_feedback(
return success_response({"success": True, "message": "保存成功"})
@router.post("/{token}/driver-feedback")
def save_public_driver_stop_feedback(
token: str,
payload: PublicTransportDriverStopFeedback,
db: Session = Depends(get_db),
):
transport = _get_transport_by_token(db, token)
page = _build_public_page(db, transport)
if page.plan_voided:
return error_response(400, "运输计划已作废,无法提交回执")
if page.plan_archived:
return error_response(400, "运输计划已归档,无法提交回执")
link = (
db.query(PlPlanTransport)
.filter(
PlPlanTransport.transport_id == transport.id,
PlPlanTransport.del_flag == 0,
)
.order_by(PlPlanTransport.create_time.desc())
.first()
)
if not link or not link.plan_id:
return error_response(400, "未找到关联计划,无法保存段附件")
stop_type = (payload.stop_type or "").strip()
stop_id = (payload.stop_id or "").strip()
if stop_type not in ("load", "delivery") or not stop_id:
return error_response(400, "停靠段参数无效")
allowed = {
(segment.stop_type, segment.stop_id)
for segment in load_driver_stop_segments(
db,
tenant_no=transport.tenant_no,
plan_id=link.plan_id,
transport_id=transport.id,
)
}
if (stop_type, stop_id) not in allowed:
return error_response(400, "停靠段不存在或不可回传")
segment = next(
(
row
for row in load_driver_stop_segments(
db,
tenant_no=transport.tenant_no,
plan_id=link.plan_id,
transport_id=transport.id,
)
if row.stop_type == stop_type and row.stop_id == stop_id
),
None,
)
if not segment:
return error_response(400, "停靠段不存在或不可回传")
products_payload: Optional[list[dict]] = None
if payload.products is not None:
allowed_products = {row.stop_product_id: row for row in segment.products}
plan_products = (
db.query(PlPlanProduct)
.filter(
PlPlanProduct.plan_id == link.plan_id,
PlPlanProduct.tenant_no == transport.tenant_no,
PlPlanProduct.del_flag == 0,
)
.all()
)
plan_products_by_id = {row.id: row for row in plan_products}
products_payload = []
for item in payload.products:
stop_product_id = (item.stop_product_id or "").strip()
stop_row = allowed_products.get(stop_product_id)
if not stop_row:
return error_response(400, "产品不属于当前停靠段")
actual_qty = Decimal(str(item.actual_qty or 0))
brand_qtys = [
b.model_dump(by_alias=True) for b in (item.brand_qtys or [])
]
plan_product = plan_products_by_id.get(stop_row.plan_product_id)
try:
require_brand_qtys_if_needed(
brand_mode=plan_product.brand_mode if plan_product else None,
required_brand_id=plan_product.brand_id if plan_product else None,
actual_qty=actual_qty,
rows=brand_qtys,
enforce=True,
)
except ValueError as exc:
return error_response(400, str(exc))
row_payload: dict = {
"stopProductId": stop_product_id,
"actualQty": float(actual_qty),
}
if brand_qtys:
row_payload["brandQtys"] = brand_qtys
products_payload.append(row_payload)
save_driver_stop_feedback(
db,
tenant_no=transport.tenant_no,
transport_id=transport.id,
plan_id=link.plan_id,
stop_type=stop_type,
stop_id=stop_id,
attachment_urls=payload.attachment_urls or [],
products=products_payload,
remark=payload.remark,
)
db.commit()
return success_response({"success": True, "message": "保存成功"})
def _format_file_size(size_bytes: int) -> str:
if size_bytes < 1024:
return f"{size_bytes} B"
+513
View File
@@ -0,0 +1,513 @@
"""运输计划 · 现场按段免登录公共 API(一车多卸)"""
from __future__ import annotations
import os
from datetime import date, datetime
from decimal import Decimal
from typing import Optional
from fastapi import APIRouter, Depends, File, Form, HTTPException, Query, UploadFile
from sqlalchemy import and_, func, or_
from sqlalchemy.orm import Session
from app.api.pl.public_transport import (
CRM_PRODUCT_UNIT,
_history_status_label,
_normalize_main_plate,
_parse_history_date,
_resolve_driver_link_flags,
_resolve_unit_label,
)
from app.core.attachment_biz import resolve_upload_folder
from app.core.config import settings
from app.core.database import get_db
from app.core.response import error_response, success_response
from app.core.storage import storage
from app.crud import oss as oss_svc
from app.models.pl_models import (
PlPlan,
PlPlanDelivery,
PlPlanLoad,
PlPlanProduct,
PlPlanTransport,
PlTransport,
)
from app.schemas.pl.transport import (
PublicTransportHistoryPageRead,
PublicTransportHistoryProductRead,
PublicTransportHistoryRecordRead,
PublicTransportHistoryStopProductRead,
PublicTransportHistoryStopRead,
PublicTransportMultiStopSitePageRead,
PublicTransportSiteStopFeedback,
)
from app.services.pl_product_display import (
load_crm_product_alias_maps,
resolve_product_display_names,
)
from app.services.pl_transport_stop_feedback_service import (
build_public_stop_reads_for_segments,
load_site_stop_segments,
save_site_stop_feedback,
)
from app.utils.excel_export import load_dict_label_maps
router = APIRouter(prefix="/public/pl/transport-site", tags=["运输计划-现场按段公共"])
def _get_transport_by_site_token(db: Session, token: str) -> PlTransport:
transport = (
db.query(PlTransport)
.filter(
PlTransport.site_access_token == token,
PlTransport.del_flag == 0,
)
.first()
)
if not transport:
raise HTTPException(status_code=404, detail="链接无效或已失效")
return transport
def _format_plan_date(value) -> Optional[str]:
if value is None:
return None
if isinstance(value, datetime):
return value.strftime("%Y-%m-%d")
if isinstance(value, date):
return value.isoformat()
return str(value)
def _resolve_plan_flags(plan: Optional[PlPlan], transport: PlTransport) -> tuple[bool, bool]:
voided = (
(plan is not None and plan.follow_status == "cancelled")
or transport.transport_status == "cancelled"
)
archived = bool(plan is not None and plan.archive_status == "archived")
return voided, archived
def _build_public_page(db: Session, transport: PlTransport) -> PublicTransportMultiStopSitePageRead:
link = (
db.query(PlPlanTransport)
.filter(
PlPlanTransport.transport_id == transport.id,
PlPlanTransport.del_flag == 0,
)
.order_by(PlPlanTransport.create_time.desc())
.first()
)
plan = None
if link:
plan = (
db.query(PlPlan)
.filter(PlPlan.id == link.plan_id, PlPlan.del_flag == 0)
.first()
)
plan_voided, plan_archived = _resolve_plan_flags(plan, transport)
stop_reads: list[dict] = []
if plan:
segments = load_site_stop_segments(
db,
tenant_no=transport.tenant_no,
plan_id=plan.id,
transport_id=transport.id,
)
stop_reads = build_public_stop_reads_for_segments(
db,
tenant_no=transport.tenant_no,
plan_id=plan.id,
segments=segments,
)
return PublicTransportMultiStopSitePageRead(
plan_no=plan.plan_no if plan else transport.transport_no,
plan_date=_format_plan_date(plan.plan_date if plan else None),
license_plate=transport.license_plate,
vehicle_no=transport.license_plate,
plan_voided=plan_voided,
plan_archived=plan_archived,
stops=stop_reads,
)
def _build_site_url(token: str) -> str:
origin = (settings.PUBLIC_WEB_ORIGIN or "").rstrip("/")
return f"{origin}/#/public/pl/transport-site/{token}"
def _build_site_history_stop_reads(
db: Session,
*,
tenant_no: str,
plan: PlPlan,
transport: PlTransport,
) -> list[PublicTransportHistoryStopRead]:
plan_products = (
db.query(PlPlanProduct)
.filter(
PlPlanProduct.plan_id == plan.id,
PlPlanProduct.tenant_no == tenant_no,
PlPlanProduct.del_flag == 0,
)
.all()
)
plan_products_by_id = {row.id: row for row in plan_products}
crm_product_ids = {
(row.product_id or "").strip() for row in plan_products if (row.product_id or "").strip()
}
standard_by_id, alias_options_by_id = load_crm_product_alias_maps(
db, tenant_no=tenant_no, product_ids=crm_product_ids
)
unit_map = load_dict_label_maps(db, [CRM_PRODUCT_UNIT], tenant_no=tenant_no).get(
CRM_PRODUCT_UNIT, {}
)
load_row = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.plan_id == plan.id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
delivery_rows = (
db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.plan_id == plan.id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.all()
)
delivery_time_by_id = {row.id: row.delivery_time for row in delivery_rows}
load_time = load_row.load_time if load_row else None
segments = load_site_stop_segments(
db,
tenant_no=tenant_no,
plan_id=plan.id,
transport_id=transport.id,
)
if not segments:
return []
reads: list[PublicTransportHistoryStopRead] = []
for segment in segments:
stop_time = load_time if segment.stop_type == "load" else delivery_time_by_id.get(segment.stop_id)
stop_products: list[PublicTransportHistoryStopProductRead] = []
for row in segment.products:
plan_prod = plan_products_by_id.get(row.plan_product_id)
product_id = (row.product_id or (plan_prod.product_id if plan_prod else "") or "").strip()
display_name, _alias_name = resolve_product_display_names(
saved_product_name=row.product_name,
product_id=product_id,
standard_by_id=standard_by_id,
alias_options_by_id=alias_options_by_id,
)
stop_products.append(
PublicTransportHistoryStopProductRead(
product_name=display_name or row.product_name or "—",
model=row.model,
package_spec=row.package_spec,
quantity=row.plan_qty,
unit=_resolve_unit_label(unit_map, row.unit),
)
)
reads.append(
PublicTransportHistoryStopRead(
stop_type=segment.stop_type,
seq=segment.seq,
label=segment.label,
customer_name=segment.customer_name,
address=segment.address,
stop_time=stop_time,
products=stop_products,
)
)
return reads
@router.get("/{token}/history")
def get_public_transport_site_history(
token: str,
date: str = Query(..., description="筛选日 YYYY-MM-DD"),
q: Optional[str] = Query(None, description="车牌号/产品名称模糊"),
db: Session = Depends(get_db),
):
transport = _get_transport_by_site_token(db, token)
day = _parse_history_date(date)
if day is None:
return error_response(400, "日期格式无效,请使用 YYYY-MM-DD")
kw = (q or "").strip()
query = (
db.query(PlPlan, PlTransport)
.join(
PlPlanTransport,
and_(
PlPlanTransport.plan_id == PlPlan.id,
PlPlanTransport.del_flag == 0,
),
)
.join(
PlTransport,
and_(
PlTransport.id == PlPlanTransport.transport_id,
PlTransport.del_flag == 0,
),
)
.filter(
PlPlan.tenant_no == transport.tenant_no,
PlPlan.del_flag == 0,
PlPlan.transport_status == "arranged",
PlTransport.tenant_no == transport.tenant_no,
PlTransport.site_access_token.isnot(None),
PlTransport.site_access_token != "",
or_(
PlPlan.plan_date == day,
and_(PlPlan.pickup_time.isnot(None), func.date(PlPlan.pickup_time) == day),
and_(PlPlan.delivery_time.isnot(None), func.date(PlPlan.delivery_time) == day),
),
)
)
if kw:
like = f"%{kw}%"
product_match = (
db.query(PlPlanProduct.id)
.filter(
PlPlanProduct.plan_id == PlPlan.id,
PlPlanProduct.del_flag == 0,
PlPlanProduct.product_name.like(like),
)
.exists()
)
query = query.filter(or_(PlTransport.license_plate.like(like), product_match))
rows = query.order_by(
PlPlan.pickup_time.desc(),
PlPlan.plan_date.desc(),
PlPlan.create_time.desc(),
).all()
seen_plan: set[str] = set()
plan_rows: list[tuple[PlPlan, PlTransport, list[PublicTransportHistoryStopRead]]] = []
for plan, tr in rows:
if plan.id in seen_plan:
continue
site_tok = (tr.site_access_token or "").strip()
if not site_tok:
continue
site_stops = _build_site_history_stop_reads(
db, tenant_no=transport.tenant_no, plan=plan, transport=tr
)
if not site_stops:
continue
seen_plan.add(plan.id)
plan_rows.append((plan, tr, site_stops))
products_by_plan: dict[str, list[PublicTransportHistoryProductRead]] = {}
if plan_rows:
plan_ids = [plan.id for plan, _, _ in plan_rows]
product_rows = (
db.query(PlPlanProduct)
.filter(
PlPlanProduct.plan_id.in_(plan_ids),
PlPlanProduct.del_flag == 0,
)
.order_by(PlPlanProduct.order_num.asc(), PlPlanProduct.create_time.asc())
.all()
)
crm_product_ids = {
(p.product_id or "").strip() for p in product_rows if (p.product_id or "").strip()
}
standard_by_id, alias_options_by_id = load_crm_product_alias_maps(
db, tenant_no=transport.tenant_no, product_ids=crm_product_ids
)
unit_map = load_dict_label_maps(
db, [CRM_PRODUCT_UNIT], tenant_no=transport.tenant_no
).get(CRM_PRODUCT_UNIT, {})
for prod in product_rows:
product_id = (prod.product_id or "").strip()
display_name, _alias_name = resolve_product_display_names(
saved_product_name=prod.product_name,
product_id=product_id,
standard_by_id=standard_by_id,
alias_options_by_id=alias_options_by_id,
)
products_by_plan.setdefault(prod.plan_id, []).append(
PublicTransportHistoryProductRead(
product_name=display_name or prod.product_name or "—",
model=prod.model,
package_spec=prod.package_spec,
quantity=prod.quantity or prod.inbound_estimate_qty or prod.outbound_estimate_qty,
unit=_resolve_unit_label(unit_map, prod.unit),
)
)
records: list[PublicTransportHistoryRecordRead] = []
for plan, tr, site_stops in plan_rows:
voided, archived = _resolve_driver_link_flags(plan, tr)
site_tok = (tr.site_access_token or "").strip()
records.append(
PublicTransportHistoryRecordRead(
plan_id=plan.id,
plan_no=plan.plan_no or "",
transport_id=tr.id,
site_access_token=site_tok or None,
site_url=_build_site_url(site_tok) if site_tok else None,
license_plate=tr.license_plate,
pickup_time=plan.pickup_time,
delivery_time=plan.delivery_time,
pickup_address=plan.pickup_address,
destination_address=plan.destination_address or plan.destination_name,
products=products_by_plan.get(plan.id) or [],
stops=site_stops,
plan_voided=voided,
plan_archived=archived,
status_label=_history_status_label(voided, archived),
)
)
page = PublicTransportHistoryPageRead(
license_plate=_normalize_main_plate(transport.license_plate) or None,
date=day.isoformat(),
keyword=kw or None,
records=records,
)
return success_response(page.model_dump(by_alias=True))
@router.get("/{token}")
def get_public_transport_site(token: str, db: Session = Depends(get_db)):
transport = _get_transport_by_site_token(db, token)
page = _build_public_page(db, transport)
return success_response(page.model_dump(by_alias=True))
@router.post("/{token}/feedback")
def save_public_site_stop_feedback(
token: str,
payload: PublicTransportSiteStopFeedback,
db: Session = Depends(get_db),
):
transport = _get_transport_by_site_token(db, token)
page = _build_public_page(db, transport)
if page.plan_voided:
return error_response(400, "运输计划已作废,无法提交回执")
if page.plan_archived:
return error_response(400, "运输计划已归档,无法提交回执")
link = (
db.query(PlPlanTransport)
.filter(
PlPlanTransport.transport_id == transport.id,
PlPlanTransport.del_flag == 0,
)
.order_by(PlPlanTransport.create_time.desc())
.first()
)
if not link or not link.plan_id:
return error_response(400, "未找到关联计划,无法保存段回传")
stop_type = (payload.stop_type or "").strip()
stop_id = (payload.stop_id or "").strip()
if stop_type not in ("load", "delivery") or not stop_id:
return error_response(400, "停靠段参数无效")
segments = load_site_stop_segments(
db,
tenant_no=transport.tenant_no,
plan_id=link.plan_id,
transport_id=transport.id,
)
segment_map = {(item.stop_type, item.stop_id): item for item in segments}
segment = segment_map.get((stop_type, stop_id))
if not segment:
return error_response(400, "该段不在现场回传范围内")
try:
save_site_stop_feedback(
db,
tenant_no=transport.tenant_no,
transport_id=transport.id,
plan_id=link.plan_id,
stop_type=stop_type,
stop_id=stop_id,
business_type=segment.business_type or "入库",
quantity=payload.quantity,
attachment_urls=payload.attachment_urls,
remark=payload.remark,
)
except ValueError as exc:
return error_response(400, str(exc))
db.commit()
return success_response({"success": True, "message": "保存成功"})
def _format_file_size(size_bytes: int) -> str:
if size_bytes < 1024:
return f"{size_bytes} B"
if size_bytes < 1024 * 1024:
return f"{size_bytes / 1024:.1f} KB"
return f"{size_bytes / (1024 * 1024):.1f} MB"
@router.post("/{token}/attachments")
def upload_public_site_attachment(
token: str,
file: UploadFile = File(...),
folder: Optional[str] = Form(""),
db: Session = Depends(get_db),
):
transport = _get_transport_by_site_token(db, token)
page = _build_public_page(db, transport)
if page.plan_voided:
return error_response(400, "运输计划已作废,无法上传附件")
if page.plan_archived:
return error_response(400, "运输计划已归档,无法上传附件")
if not file or not file.filename:
return error_response(400, "请选择文件")
try:
effective_folder = resolve_upload_folder(
folder=folder or "", biz_type="pl_transport_site_stop_feedback"
)
file_content = file.file.read()
full_url = storage.upload_file(file_content, file.filename, effective_folder)
base_url = settings.MINIO_BASE_URL.rstrip("/") if settings.MINIO_BASE_URL else ""
if base_url and full_url.startswith(base_url + "/"):
file_url = full_url[len(base_url) + 1 :]
else:
file_url = full_url
record = oss_svc.create_oss(
db,
tenant_no=transport.tenant_no,
url=file_url,
original_name=file.filename,
file_suffix=os.path.splitext(file.filename)[1].lstrip(".") if file.filename else "",
file_size=len(file_content),
file_type=file.content_type or "",
biz_type="pl_transport_site_stop_feedback",
user_id=None,
ext1=effective_folder or None,
)
db.commit()
return success_response(
{
"id": record.id,
"fileName": record.original_name,
"fileUrl": record.url,
"fileSize": record.file_size,
"fileSizeDisplay": _format_file_size(record.file_size or 0),
"fileType": record.file_type,
}
)
except Exception as exc:
db.rollback()
return error_response(500, f"上传失败: {str(exc)}")
+289 -62
View File
@@ -34,6 +34,7 @@ from app.models.pl_models import (
PlTransportDbLink,
PlVehicle,
)
from app.schemas.pl.io_order import BrandQtyItem
from app.schemas.pl.transport import (
ApprovalRecordRead,
ApprovalRequest,
@@ -48,18 +49,31 @@ from app.schemas.pl.transport import (
TransportListQuery,
TransportListResponse,
TransportDriverProductFeedbackRead,
TransportDriverStopProductFeedbackRead,
TransportRead,
TransportStopFeedbackRead,
)
from app.services.pl_dibang_bridge_service import (
StopDibangOption,
plan_has_load_stop,
revoke_regeneratable_dibang_for_transport,
sync_dibang_for_plan_stops,
sync_dibang_for_transport,
)
from app.services.pl_transport_stop_feedback_service import (
build_transport_site_url,
ensure_transport_site_token,
load_driver_stop_segments,
load_site_stop_segments,
rotate_transport_site_token,
)
from app.services.pl_inventory_link_read import build_transport_inventory_link_read
from app.services.pl_io_order_service import (
apply_dibang_prefill_to_order,
create_io_order_for_transport,
void_io_orders_for_plan,
)
from app.services.pl_internal_customer import plan_requires_site_link
from app.services.pl_plan_service import (
is_ton_product_unit,
validate_hazard_cert_ready_for_transport,
@@ -81,16 +95,129 @@ def _transport_to_read(db: Session, transport: PlTransport) -> TransportRead:
tenant_no=transport.tenant_no,
transport_id=transport.id,
)
if not feedbacks:
return base
return base.model_copy(
update={
"driver_product_feedbacks": [
TransportDriverProductFeedbackRead.model_validate(item)
for item in feedbacks
]
}
updates: dict = {}
if feedbacks:
updates["driver_product_feedbacks"] = [
TransportDriverProductFeedbackRead.model_validate(item)
for item in feedbacks
]
link = (
db.query(PlPlanTransport)
.filter(
PlPlanTransport.transport_id == transport.id,
PlPlanTransport.del_flag == 0,
)
.order_by(PlPlanTransport.create_time.desc())
.first()
)
if link and link.plan_id and plan_has_load_stop(db, transport.tenant_no, link.plan_id):
updates["driver_stop_feedbacks"] = [
TransportStopFeedbackRead(
stop_type=segment.stop_type,
stop_id=segment.stop_id,
label=segment.label,
customer_name=segment.customer_name,
attachment_urls=segment.attachment_urls,
products=[
TransportDriverStopProductFeedbackRead(
stop_product_id=product.stop_product_id,
plan_product_id=product.plan_product_id,
product_name=product.product_name,
model=product.model,
unit=product.unit,
package_spec=product.package_spec,
quantity=product.plan_qty,
actual_qty=product.actual_qty,
brand_qtys=[
BrandQtyItem(
brand_id=str(item.get("brandId") or item.get("brand_id") or ""),
brand_name=item.get("brandName") or item.get("brand_name"),
qty=item.get("qty") or 0,
)
for item in (product.brand_qtys or [])
if isinstance(item, dict)
]
or None,
)
for product in segment.products
if product.actual_qty is not None
or (product.brand_qtys and len(product.brand_qtys) > 0)
],
remark=segment.remark,
feedback_time=segment.feedback_time,
)
for segment in load_driver_stop_segments(
db,
tenant_no=transport.tenant_no,
plan_id=link.plan_id,
transport_id=transport.id,
)
if segment.attachment_urls
or segment.remark
or segment.feedback_time
or any(
product.actual_qty is not None
or (product.brand_qtys and len(product.brand_qtys) > 0)
for product in segment.products
)
]
updates["site_stop_feedbacks"] = [
TransportStopFeedbackRead(
stop_type=segment.stop_type,
stop_id=segment.stop_id,
label=segment.label,
customer_name=segment.customer_name,
business_type=segment.business_type,
quantity=segment.quantity,
attachment_urls=segment.attachment_urls,
products=[
TransportDriverStopProductFeedbackRead(
stop_product_id=product.stop_product_id,
plan_product_id=product.plan_product_id,
product_name=product.product_name,
model=product.model,
unit=product.unit,
package_spec=product.package_spec,
quantity=product.plan_qty,
actual_qty=product.actual_qty,
brand_qtys=[
BrandQtyItem(
brand_id=str(item.get("brandId") or item.get("brand_id") or ""),
brand_name=item.get("brandName") or item.get("brand_name"),
qty=item.get("qty") or 0,
)
for item in (product.brand_qtys or [])
if isinstance(item, dict)
]
or None,
)
for product in segment.products
if product.actual_qty is not None
or (product.brand_qtys and len(product.brand_qtys) > 0)
],
remark=segment.remark,
feedback_time=segment.feedback_time,
)
for segment in load_site_stop_segments(
db,
tenant_no=transport.tenant_no,
plan_id=link.plan_id,
transport_id=transport.id,
)
if segment.quantity is not None
or segment.attachment_urls
or segment.remark
or any(
product.actual_qty is not None
or (product.brand_qtys and len(product.brand_qtys) > 0)
for product in segment.products
)
]
if not updates:
return base
return base.model_copy(update=updates)
def _generate_transport_no(db: Session) -> str:
@@ -677,8 +804,7 @@ def arrange_transport(
start_point, end_point = _resolve_transport_endpoints(plan, payload)
if (
plan.plan_type in ("inbound", "outbound")
and is_rearrange
is_rearrange
and existing_transport
and _transport_has_db_links(db, tenant_no, existing_transport.id)
):
@@ -759,8 +885,21 @@ def arrange_transport(
plan.freight_amount = freight_amount or 0
plan.update_by = user.id
needs_site_link = plan_requires_site_link(db, tenant_no=tenant_no, plan=plan)
if is_rearrange:
_rotate_driver_access_token(transport)
if needs_site_link and plan_has_load_stop(db, tenant_no, plan.id):
rotate_transport_site_token(transport)
elif not needs_site_link:
transport.site_access_token = None
if plan.plan_type in ("inbound", "outbound"):
void_io_orders_for_plan(
db,
tenant_no=tenant_no,
plan_id=plan.id,
user_id=user.id,
)
else:
_ensure_driver_access_token(transport)
@@ -768,72 +907,160 @@ def arrange_transport(
inventory_records: list[TransportInventoryLinkRead] = []
io_order_brief: Optional[TransportIoOrderBrief] = None
if plan.plan_type in ("inbound", "outbound"):
try:
if is_rearrange:
# 调整运输:先作废旧出入库单(现场链接随之失效),再重建
void_io_orders_for_plan(
if needs_site_link:
use_multi_stop_site = plan_has_load_stop(db, tenant_no, plan.id)
if use_multi_stop_site:
site_token = ensure_transport_site_token(transport)
site_url = build_transport_site_url(site_token)
site_records = [
TransportSiteLinkRead(
plan_product_id="",
product_name=plan.plan_no or transport.transport_no,
site_link_id=transport.id,
plan_no=plan.plan_no or "",
business_type="按段现场",
site_access_token=site_token,
site_url=site_url,
)
]
elif plan.plan_type in ("inbound", "outbound"):
try:
if is_rearrange:
# 调整运输:先作废旧出入库单(现场链接随之失效),再重建
void_io_orders_for_plan(
db,
tenant_no=tenant_no,
plan_id=plan.id,
user_id=user.id,
)
io_result = create_io_order_for_transport(
db,
tenant_no=tenant_no,
plan_id=plan.id,
plan=plan,
products=products,
transport=transport,
user_id=user.id,
dept_id=user.dept_id or "",
after_dibang=False,
)
io_result = create_io_order_for_transport(
db,
tenant_no=tenant_no,
plan=plan,
products=products,
transport=transport,
user_id=user.id,
dept_id=user.dept_id or "",
after_dibang=False,
)
if io_result:
io_order_brief = TransportIoOrderBrief(
kind=io_result.kind,
order_id=io_result.order_id,
order_no=io_result.order_no,
site_access_token=io_result.site_access_token,
site_url=io_result.site_url,
status="in_progress",
)
# 兼容旧前端:合成单条 siteRecords 供复制现场链接
site_records = [
TransportSiteLinkRead(
plan_product_id="",
product_name=io_result.order_no,
site_link_id=io_result.order_id,
plan_no=plan.plan_no or "",
business_type="入库" if io_result.kind == "inbound" else "出库",
if io_result:
io_order_brief = TransportIoOrderBrief(
kind=io_result.kind,
order_id=io_result.order_id,
order_no=io_result.order_no,
site_access_token=io_result.site_access_token,
site_url=io_result.site_url,
status="in_progress",
)
]
except ValueError as exc:
db.rollback()
raise HTTPException(status_code=400, detail=str(exc)) from exc
# 兼容旧前端:合成单条 siteRecords 供复制现场链接
site_records = [
TransportSiteLinkRead(
plan_product_id="",
product_name=io_result.order_no,
site_link_id=io_result.order_id,
plan_no=plan.plan_no or "",
business_type="入库" if io_result.kind == "inbound" else "出库",
site_access_token=io_result.site_access_token,
site_url=io_result.site_url,
)
]
except ValueError as exc:
db.rollback()
raise HTTPException(status_code=400, detail=str(exc)) from exc
if plan.plan_type in ("inbound", "outbound") and payload.generate_dibang_plan:
non_ton_products = [
prod.product_name or prod.product_no or "未知产品"
for prod in products
if not is_ton_product_unit(prod.unit)
use_multi_stop_dibang = plan_has_load_stop(db, tenant_no, plan.id)
stop_dibang_options: list[StopDibangOption] = []
if use_multi_stop_dibang and payload.stop_dibang_options:
stop_dibang_options = [
StopDibangOption(
stop_type=item.stop_type, # type: ignore[arg-type]
stop_id=item.stop_id,
generate_dibang=item.generate_dibang,
)
for item in payload.stop_dibang_options
]
should_sync_legacy_dibang = (
not use_multi_stop_dibang
and plan.plan_type in ("inbound", "outbound")
and payload.generate_dibang_plan
)
should_sync_stop_dibang = use_multi_stop_dibang and any(
item.generate_dibang for item in stop_dibang_options
)
if should_sync_stop_dibang or should_sync_legacy_dibang:
if should_sync_stop_dibang:
from app.models.pl_models import PlPlanDeliveryProduct, PlPlanLoadProduct
selected_stops = {
(item.stop_type, item.stop_id)
for item in stop_dibang_options
if item.generate_dibang
}
non_ton_products: list[str] = []
if any(stop_type == "load" for stop_type, _ in selected_stops):
load_rows = (
db.query(PlPlanLoadProduct)
.filter(
PlPlanLoadProduct.plan_id == plan.id,
PlPlanLoadProduct.tenant_no == tenant_no,
PlPlanLoadProduct.del_flag == 0,
)
.all()
)
non_ton_products.extend(
row.product_name or row.product_no or "未知产品"
for row in load_rows
if ("load", row.load_id) in selected_stops
and not is_ton_product_unit(row.unit)
)
delivery_rows = (
db.query(PlPlanDeliveryProduct)
.filter(
PlPlanDeliveryProduct.plan_id == plan.id,
PlPlanDeliveryProduct.tenant_no == tenant_no,
PlPlanDeliveryProduct.del_flag == 0,
)
.all()
)
non_ton_products.extend(
row.product_name or row.product_no or "未知产品"
for row in delivery_rows
if ("delivery", row.delivery_id) in selected_stops
and not is_ton_product_unit(row.unit)
)
else:
non_ton_products = [
prod.product_name or prod.product_no or "未知产品"
for prod in products
if not is_ton_product_unit(prod.unit)
]
if non_ton_products:
raise HTTPException(
status_code=400,
detail=f"产品【{non_ton_products[0]}】等单位非吨,不支持生成地磅单",
)
try:
link_results = sync_dibang_for_transport(
db,
tenant_no=tenant_no,
plan=plan,
products=products,
transport=transport,
user_id=user.id,
dept_id=user.dept_id,
)
if should_sync_stop_dibang:
link_results = sync_dibang_for_plan_stops(
db,
tenant_no=tenant_no,
plan=plan,
transport=transport,
stop_options=stop_dibang_options,
user_id=user.id,
dept_id=user.dept_id or "",
)
else:
link_results = sync_dibang_for_transport(
db,
tenant_no=tenant_no,
plan=plan,
products=products,
transport=transport,
user_id=user.id,
dept_id=user.dept_id or "",
)
inventory_records = [
build_transport_inventory_link_read(
db,
+1
View File
@@ -174,6 +174,7 @@ class Settings(BaseSettings):
"/api/payments,"
"/api/attachments,"
"/api/public/pl/transport,"
"/api/public/pl/transport-site,"
"/api/public/pl/site,"
"/api/public/pl/inbound,"
"/api/public/pl/outbound,"
+2
View File
@@ -32,6 +32,7 @@ from app.api import (
)
from app.api.pl import pl_router
from app.api.pl.public_transport import router as public_pl_transport_router
from app.api.pl.public_transport_site import router as public_pl_transport_site_router
from app.api.pl.public_site import router as public_pl_site_router
from app.api.pl.public_io_order import (
inbound_public_router as public_pl_inbound_router,
@@ -159,6 +160,7 @@ async def unhandled_exception_handler(request: Request, exc: Exception):
app.include_router(public_router, prefix=settings.API_V1_PREFIX)
app.include_router(public_pl_transport_router, prefix=settings.API_V1_PREFIX)
app.include_router(public_pl_transport_site_router, prefix=settings.API_V1_PREFIX)
app.include_router(public_pl_site_router, prefix=settings.API_V1_PREFIX)
app.include_router(public_pl_inbound_router, prefix=settings.API_V1_PREFIX)
app.include_router(public_pl_outbound_router, prefix=settings.API_V1_PREFIX)
+183 -1
View File
@@ -341,6 +341,7 @@ class PlPlan(Base):
# 金额汇总
total_amount = Column(DECIMAL(15, 2), nullable=False, default=0, comment="计划总金额")
freight_amount = Column(DECIMAL(15, 2), nullable=False, default=0, comment="运费合计")
freight_remark = Column(String(512), nullable=True, comment="运费备注")
# 通知信息
notify_message = Column(Text, nullable=True, comment="通知信息(标准模板)")
@@ -378,7 +379,8 @@ class PlPlanContract(Base):
id = Column(String(64), primary_key=True, comment="主键ID")
plan_id = Column(String(64), nullable=False, comment="运输计划ID")
side = Column(String(20), nullable=False, comment="supplier-供方 demander-需方")
side = Column(String(20), nullable=False, comment="supplier-供方 demander-需方 load-装货 delivery-送货")
stop_id = Column(String(64), nullable=True, comment="停靠段ID(装货段或送货段)")
contract_id = Column(String(64), nullable=False, comment="CRM合同ID")
contract_no = Column(String(50), nullable=True, comment="合同编号快照")
@@ -496,6 +498,125 @@ class PlPlanChange(Base):
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
class PlPlanLoad(Base):
"""运输计划-装货段 pl_plan_load(plan 1:1)"""
__tablename__ = "pl_plan_load"
id = Column(String(64), primary_key=True, comment="主键ID")
plan_id = Column(String(64), nullable=False, comment="计划ID")
customer_id = Column(String(64), nullable=True, comment="装货客户ID")
customer_name = Column(String(200), nullable=True, comment="装货客户名称")
address = Column(String(500), nullable=True, comment="装货地址")
lng = Column(DECIMAL(10, 6), nullable=True, comment="经度")
lat = Column(DECIMAL(10, 6), nullable=True, comment="纬度")
load_time = Column(DateTime, nullable=True, comment="装货时间")
contact = Column(String(200), nullable=True, comment="联系方式")
notes = Column(String(500), nullable=True, comment="注意事项")
generate_dibang = Column(SmallInteger, nullable=False, default=0, comment="是否生成地磅单 0-否 1-是")
dibang_direction = Column(String(20), nullable=True, comment="地磅方向 outbound-出库 inbound-入库 none-无")
tenant_no = Column(String(64), nullable=False, default="shanxia2.0", comment="租户编号")
order_num = Column(Integer, nullable=True, comment="排序号")
remark = Column(String(512), nullable=True, comment="备注")
create_by = Column(String(64), nullable=True, comment="创建人id")
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
update_by = Column(String(64), nullable=True, comment="更新人id")
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
class PlPlanLoadProduct(Base):
"""运输计划-装货段产品明细 pl_plan_load_product"""
__tablename__ = "pl_plan_load_product"
id = Column(String(64), primary_key=True, comment="主键ID")
load_id = Column(String(64), nullable=False, comment="装货段ID")
plan_id = Column(String(64), nullable=False, comment="计划ID")
plan_product_id = Column(String(64), nullable=False, comment="计划产品行ID")
product_id = Column(String(64), nullable=False, comment="产品ID")
product_no = Column(String(50), nullable=False, comment="产品编号")
product_name = Column(String(200), nullable=False, comment="产品名称")
model = Column(String(100), nullable=True, comment="规格型号")
unit = Column(String(20), nullable=False, default="吨", comment="单位")
package_spec = Column(String(200), nullable=True, comment="包装规格")
delivery_method = Column(String(50), nullable=True, comment="送货方式")
plan_qty = Column(DECIMAL(15, 3), nullable=True, comment="本段计划数量")
inbound_qty = Column(DECIMAL(15, 3), nullable=True, comment="入库数量(归档)")
inbound_price = Column(DECIMAL(15, 4), nullable=True, comment="入库单价(归档)")
inbound_amount = Column(DECIMAL(15, 2), nullable=True, comment="入库金额(归档)")
tenant_no = Column(String(64), nullable=False, default="shanxia2.0", comment="租户编号")
order_num = Column(Integer, nullable=True, comment="排序号")
remark = Column(String(512), nullable=True, comment="备注")
create_by = Column(String(64), nullable=True, comment="创建人id")
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
update_by = Column(String(64), nullable=True, comment="更新人id")
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
class PlPlanDelivery(Base):
"""运输计划-送货段 pl_plan_delivery(plan 1:N)"""
__tablename__ = "pl_plan_delivery"
id = Column(String(64), primary_key=True, comment="主键ID")
plan_id = Column(String(64), nullable=False, comment="计划ID")
seq = Column(Integer, nullable=False, default=1, comment="顺序号(打印、链接展示)")
customer_id = Column(String(64), nullable=True, comment="送货客户ID")
customer_name = Column(String(200), nullable=True, comment="送货客户名称")
address = Column(String(500), nullable=True, comment="送货地址")
lng = Column(DECIMAL(10, 6), nullable=True, comment="经度")
lat = Column(DECIMAL(10, 6), nullable=True, comment="纬度")
delivery_time = Column(DateTime, nullable=True, comment="送货时间")
contact = Column(String(200), nullable=True, comment="联系方式")
notes = Column(String(500), nullable=True, comment="注意事项")
generate_dibang = Column(SmallInteger, nullable=False, default=0, comment="是否生成地磅单 0-否 1-是")
dibang_direction = Column(String(20), nullable=True, comment="地磅方向 outbound-出库 inbound-入库 none-无")
tenant_no = Column(String(64), nullable=False, default="shanxia2.0", comment="租户编号")
order_num = Column(Integer, nullable=True, comment="排序号")
remark = Column(String(512), nullable=True, comment="备注")
create_by = Column(String(64), nullable=True, comment="创建人id")
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
update_by = Column(String(64), nullable=True, comment="更新人id")
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
class PlPlanDeliveryProduct(Base):
"""运输计划-送货段产品明细 pl_plan_delivery_product"""
__tablename__ = "pl_plan_delivery_product"
id = Column(String(64), primary_key=True, comment="主键ID")
delivery_id = Column(String(64), nullable=False, comment="送货段ID")
plan_id = Column(String(64), nullable=False, comment="计划ID")
plan_product_id = Column(String(64), nullable=False, comment="计划产品行ID")
product_id = Column(String(64), nullable=False, comment="产品ID")
product_no = Column(String(50), nullable=False, comment="产品编号")
product_name = Column(String(200), nullable=False, comment="产品名称")
model = Column(String(100), nullable=True, comment="规格型号")
unit = Column(String(20), nullable=False, default="吨", comment="单位")
package_spec = Column(String(200), nullable=True, comment="包装规格")
delivery_method = Column(String(50), nullable=True, comment="送货方式")
plan_qty = Column(DECIMAL(15, 3), nullable=True, comment="本段计划数量")
outbound_qty = Column(DECIMAL(15, 3), nullable=True, comment="出库数量(归档)")
outbound_price = Column(DECIMAL(15, 4), nullable=True, comment="出库单价(归档)")
outbound_amount = Column(DECIMAL(15, 2), nullable=True, comment="出库金额(归档)")
tenant_no = Column(String(64), nullable=False, default="shanxia2.0", comment="租户编号")
order_num = Column(Integer, nullable=True, comment="排序号")
remark = Column(String(512), nullable=True, comment="备注")
create_by = Column(String(64), nullable=True, comment="创建人id")
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
update_by = Column(String(64), nullable=True, comment="更新人id")
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
# =============================================================================
# 3. 运输管理:运输表、审批记录
# =============================================================================
@@ -540,6 +661,7 @@ class PlTransport(Base):
qr_code = Column(String(500), nullable=True, comment="二维码内容")
qr_expire_date = Column(Date, nullable=True, comment="二维码有效期")
driver_access_token = Column(String(64), nullable=True, comment="司机免登录访问令牌")
site_access_token = Column(String(64), nullable=True, comment="现场免登录访问令牌")
# 运输状态
transport_status = Column(String(20), nullable=False, default="draft", comment="运输状态 draft-草稿 pending-待执行 executing-执行中 completed-已完成 cancelled-已取消")
@@ -616,6 +738,8 @@ class PlTransportDbLink(Base):
transport_id = Column(String(64), nullable=False, comment="运输单ID")
plan_id = Column(String(64), nullable=False, comment="运输计划ID")
plan_product_id = Column(String(64), nullable=False, comment="计划产品行ID")
stop_type = Column(String(20), nullable=True, comment="停靠段类型 load-装货 delivery-送货")
stop_id = Column(String(64), nullable=True, comment="停靠段ID")
db_purchase_plan_id = Column(String(64), nullable=False, comment="地磅计划ID")
db_inventory_id = Column(String(64), nullable=False, comment="出入库单ID")
contributed_qty = Column(DECIMAL(15, 3), nullable=True, comment="本次联动贡献量(吨)")
@@ -649,6 +773,64 @@ class PlPlanTransport(Base):
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
class PlTransportDriverStopFeedback(Base):
"""运输单-司机按段附件回传 pl_transport_driver_stop_feedback"""
__tablename__ = "pl_transport_driver_stop_feedback"
id = Column(String(64), primary_key=True, comment="主键ID")
transport_id = Column(String(64), nullable=False, comment="运输单ID")
plan_id = Column(String(64), nullable=False, comment="计划ID")
stop_type = Column(String(20), nullable=False, comment="停靠段类型 load-装货 delivery-送货")
stop_id = Column(String(64), nullable=False, comment="停靠段ID")
attachment_urls = Column(Text, nullable=True, comment="附件URLs(JSON数组)")
product_feedbacks = Column(
Text,
nullable=True,
comment="段产品回传 JSON:[{stopProductId,actualQty,brandQtys}]",
)
remark = Column(String(500), nullable=True, comment="备注")
feedback_time = Column(DateTime, nullable=True, comment="回传时间")
tenant_no = Column(String(64), nullable=False, default="shanxia2.0", comment="租户编号")
order_num = Column(Integer, nullable=True, comment="排序号")
create_by = Column(String(64), nullable=True, comment="创建人id")
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
update_by = Column(String(64), nullable=True, comment="更新人id")
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
class PlTransportSiteStopFeedback(Base):
"""运输单-现场按段回传 pl_transport_site_stop_feedback"""
__tablename__ = "pl_transport_site_stop_feedback"
id = Column(String(64), primary_key=True, comment="主键ID")
transport_id = Column(String(64), nullable=False, comment="运输单ID")
plan_id = Column(String(64), nullable=False, comment="计划ID")
stop_type = Column(String(20), nullable=False, comment="停靠段类型 load-装货 delivery-送货")
stop_id = Column(String(64), nullable=False, comment="停靠段ID")
business_type = Column(String(20), nullable=False, comment="业务类型:入库/出库")
quantity = Column(DECIMAL(15, 3), nullable=True, comment="现场回传数量")
attachment_urls = Column(Text, nullable=True, comment="附件URLs(JSON数组)")
product_feedbacks = Column(
Text,
nullable=True,
comment="段产品回传 JSON:[{stopProductId,actualQty,brandQtys}]",
)
remark = Column(String(500), nullable=True, comment="备注")
feedback_time = Column(DateTime, nullable=True, comment="回传时间")
tenant_no = Column(String(64), nullable=False, default="shanxia2.0", comment="租户编号")
order_num = Column(Integer, nullable=True, comment="排序号")
create_by = Column(String(64), nullable=True, comment="创建人id")
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
update_by = Column(String(64), nullable=True, comment="更新人id")
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
class PlTransportSiteLink(Base):
"""运输计划现场链接 pl_transport_site_link(与地磅出入库单解耦)"""
@@ -0,0 +1,17 @@
"""客户装/送货物流默认记忆 Schema"""
from decimal import Decimal
from typing import Optional
from pydantic import BaseModel, Field
class CustomerStopPrefRead(BaseModel):
customer_id: str = Field(alias="customerId")
stop_type: str = Field(alias="stopType")
address: Optional[str] = None
lng: Optional[Decimal] = None
lat: Optional[Decimal] = None
contact: Optional[str] = None
notes: Optional[str] = None
model_config = {"from_attributes": True, "populate_by_name": True}
+2
View File
@@ -95,6 +95,7 @@ class UnsettledPlanItem(BaseModel):
license_plate: Optional[str] = Field(default=None, alias="licensePlate")
transport_company: Optional[str] = Field(default=None, alias="transportCompany")
freight_amount: Decimal = Field(default=Decimal("0"), alias="freightAmount")
freight_remark: Optional[str] = Field(default=None, alias="freightRemark")
archive_time: Optional[datetime] = Field(default=None, alias="archiveTime")
transport_id: str = Field(alias="transportId")
transport_no: Optional[str] = Field(default=None, alias="transportNo")
@@ -116,6 +117,7 @@ class SettlementPlanSummary(BaseModel):
plan_date: Optional[date] = Field(default=None, alias="planDate")
license_plate: Optional[str] = Field(default=None, alias="licensePlate")
freight_amount: Optional[Decimal] = Field(default=None, alias="freightAmount")
freight_remark: Optional[str] = Field(default=None, alias="freightRemark")
model_config = {"populate_by_name": True}
+16
View File
@@ -117,11 +117,27 @@ class PublicIoOrderItemFeedback(BaseModel):
model_config = {"populate_by_name": True}
class PublicIoOrderStopProductFeedback(BaseModel):
stop_product_id: str = Field(alias="stopProductId")
actual_qty: Decimal = Field(alias="actualQty")
brand_qtys: Optional[list[BrandQtyItem]] = Field(default=None, alias="brandQtys")
model_config = {"populate_by_name": True}
class PublicIoOrderStopFeedback(BaseModel):
stop_type: str = Field(alias="stopType")
stop_id: str = Field(alias="stopId")
attachment_urls: list[str] = Field(default_factory=list, alias="attachmentUrls")
products: list[PublicIoOrderStopProductFeedback] = Field(default_factory=list)
model_config = {"populate_by_name": True}
class PublicIoOrderFeedback(BaseModel):
status: str
remark: Optional[str] = None
images: list[str] = Field(default_factory=list)
items: list[PublicIoOrderItemFeedback] = Field(default_factory=list)
stops: list[PublicIoOrderStopFeedback] = Field(default_factory=list)
model_config = {"populate_by_name": True}
+170 -1
View File
@@ -97,6 +97,106 @@ class PlanProductRead(PlanProductBase):
model_config = {"from_attributes": True, "populate_by_name": True}
# =============================================================================
# 装货/送货段 Schema
# =============================================================================
class PlanStopProductBody(BaseModel):
plan_product_id: Optional[str] = Field(
default=None,
alias="planProductId",
description="计划产品行ID(新建时可空,由后端按 productId 匹配)",
)
product_id: str = Field(..., alias="productId", description="产品ID")
product_no: str = Field(..., max_length=50, alias="productNo", description="产品编号")
product_name: str = Field(..., max_length=200, alias="productName", description="产品名称")
model: Optional[str] = Field(default=None, max_length=100, description="规格型号")
unit: str = Field(default="吨", max_length=20, description="单位")
package_spec: Optional[str] = Field(default=None, max_length=200, alias="packageSpec", description="包装规格")
delivery_method: Optional[str] = Field(default=None, max_length=50, alias="deliveryMethod", description="送货方式")
plan_qty: Optional[Decimal] = Field(default=None, alias="planQty", description="本段计划数量")
remark: Optional[str] = Field(default=None, max_length=512, description="备注")
model_config = {"populate_by_name": True}
class PlanStopProductRead(PlanStopProductBody):
id: str
plan_id: str = Field(alias="planId")
inbound_qty: Optional[Decimal] = Field(default=None, alias="inboundQty", description="入库数量(装货段归档)")
inbound_price: Optional[Decimal] = Field(default=None, alias="inboundPrice", description="入库单价(装货段归档)")
inbound_amount: Optional[Decimal] = Field(default=None, alias="inboundAmount", description="入库金额(装货段归档)")
outbound_qty: Optional[Decimal] = Field(default=None, alias="outboundQty", description="出库数量(送货段归档)")
outbound_price: Optional[Decimal] = Field(default=None, alias="outboundPrice", description="出库单价(送货段归档)")
outbound_amount: Optional[Decimal] = Field(default=None, alias="outboundAmount", description="出库金额(送货段归档)")
tenant_no: str = Field(alias="tenantNo")
order_num: Optional[int] = Field(default=None, alias="orderNum")
create_time: datetime = Field(alias="createTime")
update_time: datetime = Field(alias="updateTime")
model_config = {"from_attributes": True, "populate_by_name": True}
class PlanLoadBody(BaseModel):
customer_id: Optional[str] = Field(default=None, alias="customerId", description="装货客户ID")
customer_name: Optional[str] = Field(default=None, max_length=200, alias="customerName", description="装货客户名称")
address: Optional[str] = Field(default=None, max_length=500, description="装货地址")
lng: Optional[Decimal] = Field(default=None, description="经度")
lat: Optional[Decimal] = Field(default=None, description="纬度")
load_time: OptionalPlanDateTime = Field(default=None, alias="loadTime", description="装货时间")
contact: Optional[str] = Field(default=None, max_length=200, description="联系方式")
notes: Optional[str] = Field(default=None, max_length=500, description="注意事项")
generate_dibang: int = Field(default=0, alias="generateDibang", description="是否生成地磅单 0-否 1-是")
dibang_direction: Optional[str] = Field(
default=None, alias="dibangDirection", description="地磅方向 outbound-出库 inbound-入库 none-无"
)
products: list[PlanStopProductBody] = Field(default_factory=list, description="装货段产品明细")
contracts: Optional[list["PlanContractLink"]] = Field(default=None, description="装货段合同列表")
remark: Optional[str] = Field(default=None, max_length=512, description="备注")
model_config = {"populate_by_name": True}
class PlanDeliveryBody(BaseModel):
seq: int = Field(default=1, description="顺序号(打印、链接展示)")
customer_id: Optional[str] = Field(default=None, alias="customerId", description="送货客户ID")
customer_name: Optional[str] = Field(default=None, max_length=200, alias="customerName", description="送货客户名称")
address: Optional[str] = Field(default=None, max_length=500, description="送货地址")
lng: Optional[Decimal] = Field(default=None, description="经度")
lat: Optional[Decimal] = Field(default=None, description="纬度")
delivery_time: OptionalPlanDateTime = Field(default=None, alias="deliveryTime", description="送货时间")
contact: Optional[str] = Field(default=None, max_length=200, description="联系方式")
notes: Optional[str] = Field(default=None, max_length=500, description="注意事项")
generate_dibang: int = Field(default=0, alias="generateDibang", description="是否生成地磅单 0-否 1-是")
dibang_direction: Optional[str] = Field(
default=None, alias="dibangDirection", description="地磅方向 outbound-出库 inbound-入库 none-无"
)
products: list[PlanStopProductBody] = Field(default_factory=list, description="送货段产品明细")
contracts: Optional[list["PlanContractLink"]] = Field(default=None, description="送货段合同列表")
remark: Optional[str] = Field(default=None, max_length=512, description="备注")
model_config = {"populate_by_name": True}
class PlanLoadRead(PlanLoadBody):
id: str
plan_id: str = Field(alias="planId")
products: list[PlanStopProductRead] = Field(default_factory=list, description="装货段产品明细")
tenant_no: str = Field(alias="tenantNo")
order_num: Optional[int] = Field(default=None, alias="orderNum")
create_time: datetime = Field(alias="createTime")
update_time: datetime = Field(alias="updateTime")
model_config = {"from_attributes": True, "populate_by_name": True}
class PlanDeliveryRead(PlanDeliveryBody):
id: str
plan_id: str = Field(alias="planId")
products: list[PlanStopProductRead] = Field(default_factory=list, description="送货段产品明细")
tenant_no: str = Field(alias="tenantNo")
order_num: Optional[int] = Field(default=None, alias="orderNum")
create_time: datetime = Field(alias="createTime")
update_time: datetime = Field(alias="updateTime")
model_config = {"from_attributes": True, "populate_by_name": True}
# =============================================================================
# 计划主表 Schema
# =============================================================================
@@ -134,6 +234,7 @@ class PlanBase(BaseModel):
delivery_method: Optional[str] = Field(default=None, alias="deliveryMethod", description="送货方式")
settlement_method: Optional[str] = Field(default=None, max_length=50, alias="settlementMethod", description="结算方式")
has_freight: int = Field(default=0, alias="hasFreight", description="是否有运输费用")
freight_remark: Optional[str] = Field(default=None, max_length=512, alias="freightRemark", description="运费备注")
pickup_address: Optional[str] = Field(default=None, max_length=500, alias="pickupAddress", description="取货地址")
pickup_lng: Optional[Decimal] = Field(default=None, alias="pickupLng", description="取货经度")
pickup_lat: Optional[Decimal] = Field(default=None, alias="pickupLat", description="取货纬度")
@@ -155,6 +256,7 @@ class PlanBase(BaseModel):
class PlanContractLink(BaseModel):
contract_id: str = Field(..., alias="contractId", description="CRM合同ID")
contract_no: Optional[str] = Field(default=None, max_length=50, alias="contractNo", description="合同编号")
stop_id: Optional[str] = Field(default=None, alias="stopId", description="停靠段ID(装货段或送货段)")
model_config = {"populate_by_name": True}
@@ -170,6 +272,8 @@ class PlanCreate(PlanBase):
demander_contracts: Optional[list[PlanContractLink]] = Field(
default=None, alias="demanderContracts", description="需方合同列表"
)
load: Optional[PlanLoadBody] = Field(default=None, description="装货段")
deliveries: Optional[list[PlanDeliveryBody]] = Field(default=None, description="送货段列表")
model_config = {"populate_by_name": True}
@@ -209,6 +313,7 @@ class PlanUpdate(BaseModel):
delivery_method: Optional[str] = Field(default=None, alias="deliveryMethod")
settlement_method: Optional[str] = Field(default=None, max_length=50, alias="settlementMethod")
has_freight: Optional[int] = Field(default=None, alias="hasFreight")
freight_remark: Optional[str] = Field(default=None, max_length=512, alias="freightRemark")
pickup_address: Optional[str] = Field(default=None, max_length=500, alias="pickupAddress")
pickup_lng: Optional[Decimal] = Field(default=None, alias="pickupLng")
pickup_lat: Optional[Decimal] = Field(default=None, alias="pickupLat")
@@ -233,6 +338,8 @@ class PlanUpdate(BaseModel):
default=None, alias="demanderContracts", description="需方合同列表"
)
transport: Optional[PlanTransportCreateBlock] = Field(default=None, description="运输预选/更新(有车牌时同步车辆与运费)")
load: Optional[PlanLoadBody] = Field(default=None, description="装货段")
deliveries: Optional[list[PlanDeliveryBody]] = Field(default=None, description="送货段列表")
model_config = {"populate_by_name": True}
@@ -289,6 +396,19 @@ class PlanRead(PlanBase, PlanResourceSnapshotMixin):
class PlanWithProducts(PlanRead):
products: list[PlanProductRead] = []
load: Optional[PlanLoadRead] = Field(default=None, description="装货段")
deliveries: list[PlanDeliveryRead] = Field(default_factory=list, description="送货段列表")
load_customer_name: Optional[str] = Field(
default=None,
alias="loadCustomerName",
description="装货客户名称摘要(列表展示)",
)
delivery_customer_summary: Optional[str] = Field(
default=None,
alias="deliveryCustomerSummary",
description="送货客户摘要(列表展示)",
)
warnings: list[str] = Field(default_factory=list, description="保存告警(如数量不平衡)")
can_copy_to_driver: bool = Field(
default=False,
alias="canCopyToDriver",
@@ -311,6 +431,31 @@ class PlanWithProducts(PlanRead):
)
# =============================================================================
# 送(提)货单打印(按送货客户聚合)
# =============================================================================
class DeliveryPrintCustomerOption(BaseModel):
customer_id: str = Field(alias="customerId", description="送货客户ID或名称键")
customer_name: str = Field(alias="customerName", description="送货客户名称")
delivery_count: int = Field(default=1, alias="deliveryCount", description="送货段数量")
model_config = {"populate_by_name": True}
class DeliverySlipPrintRead(BaseModel):
plan_id: str = Field(alias="planId")
plan_no: str = Field(alias="planNo")
plan_date: Optional[str] = Field(default=None, alias="planDate")
customer_id: Optional[str] = Field(default=None, alias="customerId")
receiving_unit: Optional[str] = Field(default=None, alias="receivingUnit")
receive_contact: Optional[str] = Field(default=None, alias="receiveContact")
delivery_address: Optional[str] = Field(default=None, alias="deliveryAddress")
products: list[PlanStopProductRead] = Field(default_factory=list)
customers: list[DeliveryPrintCustomerOption] = Field(default_factory=list)
model_config = {"populate_by_name": True}
class PlanInboundSlipTemplateSave(BaseModel):
slip_template_content: str = Field(..., alias="slipTemplateContent", description="入库单打印模板HTML")
model_config = {"populate_by_name": True}
@@ -406,8 +551,30 @@ class PlanArchiveProductItem(BaseModel):
model_config = {"populate_by_name": True}
class PlanArchiveStopProductItem(BaseModel):
id: str = Field(..., description="段产品行ID(pl_plan_load_product / pl_plan_delivery_product)")
inbound_qty: Optional[Decimal] = Field(default=None, alias="inboundQty", ge=0, description="入库数量(装货段)")
inbound_price: Optional[Decimal] = Field(default=None, alias="inboundPrice", ge=0, description="入库单价(装货段)")
outbound_qty: Optional[Decimal] = Field(default=None, alias="outboundQty", ge=0, description="出库数量(送货段)")
outbound_price: Optional[Decimal] = Field(default=None, alias="outboundPrice", ge=0, description="出库单价(送货段)")
model_config = {"populate_by_name": True}
class PlanArchiveLoadBlock(BaseModel):
stop_id: str = Field(alias="stopId", description="装货段ID")
products: list[PlanArchiveStopProductItem] = Field(default_factory=list)
model_config = {"populate_by_name": True}
class PlanArchiveDeliveryBlock(BaseModel):
stop_id: str = Field(alias="stopId", description="送货段ID")
products: list[PlanArchiveStopProductItem] = Field(default_factory=list)
model_config = {"populate_by_name": True}
class PlanArchiveFreightBlock(BaseModel):
has_freight: int = Field(default=1, alias="hasFreight", description="是否有运输费用 0-否 1-是")
freight_remark: Optional[str] = Field(default=None, max_length=512, alias="freightRemark", description="运费备注")
distance_km: Optional[Decimal] = Field(default=None, alias="distanceKm")
freight_type: str = Field(default="by_weight", alias="freightType")
freight_price: Optional[Decimal] = Field(default=None, alias="freightPrice")
@@ -418,7 +585,9 @@ class PlanArchiveFreightBlock(BaseModel):
class PlanArchiveBody(BaseModel):
products: list[PlanArchiveProductItem] = Field(..., min_length=1)
products: list[PlanArchiveProductItem] = Field(default_factory=list)
load: Optional[PlanArchiveLoadBlock] = None
deliveries: Optional[list[PlanArchiveDeliveryBlock]] = None
freight: Optional[PlanArchiveFreightBlock] = None
model_config = {"populate_by_name": True}
+151 -1
View File
@@ -44,6 +44,13 @@ class TransportCreate(TransportBase):
model_config = {"populate_by_name": True}
class TransportStopDibangOption(BaseModel):
stop_type: str = Field(..., alias="stopType", description="停靠段类型 load-装货 delivery-送货")
stop_id: str = Field(..., alias="stopId", description="停靠段ID")
generate_dibang: bool = Field(..., alias="generateDibang", description="是否生成地磅单")
model_config = {"populate_by_name": True}
class TransportArrange(BaseModel):
vehicle_id: str = Field(..., alias="vehicleId", description="车辆ID")
driver_id: Optional[str] = Field(default=None, alias="driverId", description="司机ID(可选)")
@@ -70,7 +77,12 @@ class TransportArrange(BaseModel):
freight_amount: Optional[Decimal] = Field(default=None, alias="freightAmount", description="运费金额")
has_invoice: Optional[int] = Field(default=None, alias="hasInvoice", description="是否开票(已废弃,由运费结算维护)")
remark: Optional[str] = None
generate_dibang_plan: bool = Field(default=False, alias="generateDibangPlan", description="是否生成地磅单")
generate_dibang_plan: bool = Field(default=False, alias="generateDibangPlan", description="是否生成地磅单(兼容旧计划)")
stop_dibang_options: Optional[list[TransportStopDibangOption]] = Field(
default=None,
alias="stopDibangOptions",
description="按段地磅勾选(一车多卸)",
)
model_config = {"populate_by_name": True}
@@ -81,6 +93,8 @@ class TransportInventoryLinkRead(BaseModel):
db_inventory_id: str = Field(alias="dbInventoryId")
batch_no: str = Field(alias="batchNo")
plan_no: str = Field(alias="planNo")
stop_type: Optional[str] = Field(default=None, alias="stopType")
stop_id: Optional[str] = Field(default=None, alias="stopId")
model_config = {"populate_by_name": True}
@@ -138,6 +152,33 @@ class TransportDriverProductFeedbackRead(BaseModel):
model_config = {"populate_by_name": True}
class TransportStopFeedbackRead(BaseModel):
stop_type: str = Field(alias="stopType")
stop_id: str = Field(alias="stopId")
label: str
customer_name: str = Field(alias="customerName")
business_type: Optional[str] = Field(default=None, alias="businessType")
quantity: Optional[Decimal] = None
attachment_urls: list[str] = Field(default_factory=list, alias="attachmentUrls")
products: list["TransportDriverStopProductFeedbackRead"] = Field(default_factory=list)
remark: Optional[str] = None
feedback_time: Optional[datetime] = Field(default=None, alias="feedbackTime")
model_config = {"populate_by_name": True}
class TransportDriverStopProductFeedbackRead(BaseModel):
stop_product_id: str = Field(alias="stopProductId")
plan_product_id: str = Field(default="", alias="planProductId")
product_name: str = Field(default="", alias="productName")
model: Optional[str] = None
unit: Optional[str] = None
package_spec: Optional[str] = Field(default=None, alias="packageSpec")
quantity: Optional[Decimal] = None
actual_qty: Optional[Decimal] = Field(default=None, alias="actualQty")
brand_qtys: Optional[list[BrandQtyItem]] = Field(default=None, alias="brandQtys")
model_config = {"populate_by_name": True}
class TransportRead(TransportBase, PlanResourceSnapshotMixin):
id: str
transport_no: str = Field(alias="transportNo")
@@ -149,6 +190,12 @@ class TransportRead(TransportBase, PlanResourceSnapshotMixin):
driver_product_feedbacks: list[TransportDriverProductFeedbackRead] = Field(
default_factory=list, alias="driverProductFeedbacks"
)
driver_stop_feedbacks: list[TransportStopFeedbackRead] = Field(
default_factory=list, alias="driverStopFeedbacks"
)
site_stop_feedbacks: list[TransportStopFeedbackRead] = Field(
default_factory=list, alias="siteStopFeedbacks"
)
tenant_no: str = Field(alias="tenantNo")
order_num: Optional[int] = Field(default=None, alias="orderNum")
create_by: Optional[str] = Field(default=None, alias="createBy")
@@ -182,6 +229,7 @@ class TransportArrangeResult(TransportRead):
class PlanArrangeInfoRead(BaseModel):
requires_site_link: bool = Field(default=False, alias="requiresSiteLink")
driver_url: Optional[str] = Field(default=None, alias="driverUrl")
license_plate: Optional[str] = Field(default=None, alias="licensePlate")
site_records: list[TransportSiteLinkRead] = Field(default_factory=list, alias="siteRecords")
@@ -225,6 +273,72 @@ class PublicTransportFeedback(BaseModel):
model_config = {"populate_by_name": True}
class PublicTransportDriverStopProductFeedbackItem(BaseModel):
stop_product_id: str = Field(..., alias="stopProductId")
actual_qty: Decimal = Field(..., alias="actualQty", ge=0)
brand_qtys: Optional[list[BrandQtyItem]] = Field(default=None, alias="brandQtys")
model_config = {"populate_by_name": True}
class PublicTransportDriverStopFeedback(BaseModel):
stop_type: str = Field(..., alias="stopType")
stop_id: str = Field(..., alias="stopId")
attachment_urls: list[str] = Field(default_factory=list, alias="attachmentUrls")
products: Optional[list[PublicTransportDriverStopProductFeedbackItem]] = None
remark: Optional[str] = None
model_config = {"populate_by_name": True}
class PublicTransportStopProductRead(BaseModel):
stop_product_id: str = Field(alias="stopProductId")
plan_product_id: str = Field(default="", alias="planProductId")
product_name: str = Field(alias="productName")
alias_name: Optional[str] = Field(default=None, alias="aliasName")
model: Optional[str] = None
package_spec: Optional[str] = Field(default=None, alias="packageSpec")
unit: Optional[str] = None
quantity: Optional[Decimal] = None
remark: Optional[str] = Field(default=None, alias="remark")
brand_mode: Optional[str] = Field(default=None, alias="brandMode")
brand_id: Optional[str] = Field(default=None, alias="brandId")
brand_name: Optional[str] = Field(default=None, alias="brandName")
brand_options: Optional[list[BrandOption]] = Field(default=None, alias="brandOptions")
actual_qty: Optional[Decimal] = Field(default=None, alias="actualQty")
brand_qtys: Optional[list[BrandQtyItem]] = Field(default=None, alias="brandQtys")
model_config = {"populate_by_name": True}
class PublicTransportSiteStopFeedback(BaseModel):
stop_type: str = Field(..., alias="stopType")
stop_id: str = Field(..., alias="stopId")
quantity: Optional[Decimal] = Field(default=None, ge=0)
attachment_urls: Optional[list[str]] = Field(default=None, alias="attachmentUrls")
remark: Optional[str] = None
model_config = {"populate_by_name": True}
class PublicTransportStopRead(BaseModel):
stop_type: str = Field(alias="stopType")
stop_id: str = Field(alias="stopId")
seq: int = 0
label: str
customer_name: str = Field(alias="customerName")
address: Optional[str] = None
contact: Optional[str] = None
notes: Optional[str] = None
lng: Optional[Decimal] = None
lat: Optional[Decimal] = None
business_type: Optional[str] = Field(default=None, alias="businessType")
plan_qty: Optional[Decimal] = Field(default=None, alias="planQty")
quantity: Optional[Decimal] = None
show_product_qty: bool = Field(default=False, alias="showProductQty")
products: list[PublicTransportStopProductRead] = Field(default_factory=list)
attachment_urls: list[str] = Field(default_factory=list, alias="attachmentUrls")
remark: Optional[str] = None
feedback_time: Optional[datetime] = Field(default=None, alias="feedbackTime")
model_config = {"populate_by_name": True}
class PublicTransportPlanProductRead(BaseModel):
plan_product_id: str = Field(default="", alias="planProductId")
product_name: str = Field(alias="productName")
@@ -274,6 +388,7 @@ class PublicTransportPageRead(BaseModel):
default_factory=list, alias="otherPersonnel"
)
products: list[PublicTransportPlanProductRead] = Field(default_factory=list)
stops: list[PublicTransportStopRead] = Field(default_factory=list)
feedback_remark: Optional[str] = Field(default=None, alias="feedbackRemark")
feedback_images: list[str] = Field(default_factory=list, alias="feedbackImages")
feedback_qty: Optional[Decimal] = Field(default=None, alias="feedbackQty", description="回传数量")
@@ -292,18 +407,41 @@ class PublicTransportHistoryProductRead(BaseModel):
model_config = {"populate_by_name": True}
class PublicTransportHistoryStopProductRead(BaseModel):
product_name: str = Field(alias="productName")
model: Optional[str] = None
package_spec: Optional[str] = Field(default=None, alias="packageSpec")
quantity: Optional[Decimal] = None
unit: Optional[str] = None
model_config = {"populate_by_name": True}
class PublicTransportHistoryStopRead(BaseModel):
stop_type: str = Field(alias="stopType")
seq: int = 0
label: str
customer_name: str = Field(alias="customerName")
address: Optional[str] = None
stop_time: Optional[datetime] = Field(default=None, alias="stopTime")
products: list[PublicTransportHistoryStopProductRead] = Field(default_factory=list)
model_config = {"populate_by_name": True}
class PublicTransportHistoryRecordRead(BaseModel):
plan_id: str = Field(alias="planId")
plan_no: str = Field(alias="planNo")
transport_id: str = Field(alias="transportId")
driver_access_token: Optional[str] = Field(default=None, alias="driverAccessToken")
driver_url: Optional[str] = Field(default=None, alias="driverUrl")
site_access_token: Optional[str] = Field(default=None, alias="siteAccessToken")
site_url: Optional[str] = Field(default=None, alias="siteUrl")
license_plate: Optional[str] = Field(default=None, alias="licensePlate")
pickup_time: Optional[datetime] = Field(default=None, alias="pickupTime")
delivery_time: Optional[datetime] = Field(default=None, alias="deliveryTime")
pickup_address: Optional[str] = Field(default=None, alias="pickupAddress")
destination_address: Optional[str] = Field(default=None, alias="destinationAddress")
products: list[PublicTransportHistoryProductRead] = Field(default_factory=list)
stops: list[PublicTransportHistoryStopRead] = Field(default_factory=list)
plan_voided: bool = Field(default=False, alias="planVoided")
plan_archived: bool = Field(default=False, alias="planArchived")
status_label: str = Field(default="进行中", alias="statusLabel")
@@ -313,10 +451,22 @@ class PublicTransportHistoryRecordRead(BaseModel):
class PublicTransportHistoryPageRead(BaseModel):
license_plate: Optional[str] = Field(default=None, alias="licensePlate")
date: str
keyword: Optional[str] = None
records: list[PublicTransportHistoryRecordRead] = Field(default_factory=list)
model_config = {"populate_by_name": True}
class PublicTransportMultiStopSitePageRead(BaseModel):
plan_no: str = Field(alias="planNo")
plan_date: Optional[str] = Field(default=None, alias="planDate")
license_plate: Optional[str] = Field(default=None, alias="licensePlate")
vehicle_no: Optional[str] = Field(default=None, alias="vehicleNo")
plan_voided: bool = Field(default=False, alias="planVoided")
plan_archived: bool = Field(default=False, alias="planArchived")
stops: list[PublicTransportStopRead] = Field(default_factory=list)
model_config = {"populate_by_name": True}
class PublicTransportSitePageRead(BaseModel):
business_type: str = Field(alias="businessType")
date: Optional[str] = None
@@ -6,13 +6,22 @@ import re
from dataclasses import dataclass
from datetime import date, datetime
from decimal import Decimal
from typing import Optional
from typing import Any, Literal, Optional
from sqlalchemy.orm import Session
from app.core.utils import generate_uuid
from app.models.db_models import DbInboundOutbound, DbPurchasePlan, DbWeighingSlip
from app.models.pl_models import PlPlan, PlPlanProduct, PlTransport, PlTransportDbLink
from app.models.pl_models import (
PlPlan,
PlPlanDelivery,
PlPlanDeliveryProduct,
PlPlanLoad,
PlPlanLoadProduct,
PlPlanProduct,
PlTransport,
PlTransportDbLink,
)
from app.services.db.inventory_id import next_inbound_outbound_id
from app.services.db.mappers import parse_date_str
from app.services.db.plan_helpers import default_execution_status, generate_plan_no
@@ -33,6 +42,23 @@ class DibangInventoryLinkResult:
plan_no: str
@dataclass
class StopDibangOption:
stop_type: Literal["load", "delivery"]
stop_id: str
generate_dibang: bool
@dataclass
class _StopDibangProduct:
plan_product_id: str
product_id: str
product_name: str
model: Optional[str]
unit: str
quantity: float
def resolve_partner_company(plan: PlPlan, plan_type: str) -> str:
"""按运输计划单据类型解析地磅往来单位(不区分 CRM 合同类型)。
@@ -96,6 +122,71 @@ def _plan_type_to_business_type(plan_type: str) -> Optional[str]:
return None
def _direction_to_business_type(direction: Optional[str]) -> Optional[str]:
normalized = (direction or "").strip()
if normalized == "outbound":
return "出库"
if normalized == "inbound":
return "入库"
return None
def _stop_product_quantity(product: Any) -> float:
if getattr(product, "plan_qty", None) is not None:
return float(product.plan_qty)
return 0.0
def plan_has_load_stop(db: Session, tenant_no: str, plan_id: str) -> bool:
return (
db.query(PlPlanLoad.id)
.filter(
PlPlanLoad.plan_id == plan_id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
is not None
)
def apply_stop_dibang_options(
db: Session,
*,
tenant_no: str,
plan_id: str,
stop_options: list[StopDibangOption],
user_id: Optional[str],
) -> None:
for option in stop_options:
if option.stop_type == "load":
stop = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.id == option.stop_id,
PlPlanLoad.plan_id == plan_id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
else:
stop = (
db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.id == option.stop_id,
PlPlanDelivery.plan_id == plan_id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.first()
)
if stop:
stop.generate_dibang = 1 if option.generate_dibang else 0
stop.update_by = user_id
db.flush()
def _product_quantity(product: PlPlanProduct) -> float:
for value in (product.quantity, product.inbound_estimate_qty, product.outbound_estimate_qty):
if value is not None:
@@ -381,6 +472,296 @@ def revoke_regeneratable_dibang_for_transport(
db.flush()
def _sync_stop_inventory_links(
db: Session,
*,
tenant_no: str,
plan: PlPlan,
transport: PlTransport,
stop_type: str,
stop_id: str,
partner: str,
business_type: str,
dibang_date: date,
stop_products: list[_StopDibangProduct],
user_id: Optional[str],
dept_id: str,
) -> list[DibangInventoryLinkResult]:
if not partner:
raise ValueError("无法解析往来单位,请检查段客户信息")
month_start, month_end = _month_range(dibang_date)
license_plate = (transport.license_plate or plan.license_plate or "").strip()
results: list[DibangInventoryLinkResult] = []
for product in stop_products:
if not product.product_id:
raise ValueError(f"产品【{product.product_name}】未关联 CRM 产品,无法生成地磅出入库单")
contributed_qty = product.quantity
if contributed_qty <= 0:
continue
plan_product = PlPlanProduct(
id=product.plan_product_id,
product_id=product.product_id,
product_name=product.product_name,
model=product.model,
unit=product.unit,
quantity=Decimal(str(contributed_qty)),
)
db_plan = find_monthly_db_plan(
db,
tenant_no,
dibang_date,
business_type,
partner,
product.product_id,
product.model,
)
if not db_plan:
db_plan = _create_db_plan(
db,
tenant_no,
plan,
plan_product,
business_type,
partner,
dibang_date,
month_start,
month_end,
user_id,
dept_id,
contributed_qty,
)
else:
_apply_plan_quantity_delta(db_plan, contributed_qty, user_id=user_id)
inventory = _create_db_inventory(
db,
tenant_no,
plan,
plan_product,
db_plan,
business_type,
partner,
license_plate,
dibang_date,
user_id,
dept_id,
)
link = PlTransportDbLink(
id=generate_uuid(),
tenant_no=tenant_no,
transport_id=transport.id,
plan_id=plan.id,
plan_product_id=product.plan_product_id,
stop_type=stop_type,
stop_id=stop_id,
db_purchase_plan_id=db_plan.id if db_plan else "",
db_inventory_id=inventory.id,
contributed_qty=Decimal(str(contributed_qty)),
remark=f"运输计划 {plan.plan_no}",
create_by=user_id,
create_dept_id=dept_id,
)
db.add(link)
results.append(
DibangInventoryLinkResult(
plan_product_id=product.plan_product_id,
product_name=product.product_name or "",
db_purchase_plan_id=db_plan.id if db_plan else "",
db_inventory_id=inventory.id,
batch_no=inventory.batch_no or "",
plan_no=(db_plan.plan_no if db_plan else plan.plan_no) or "",
)
)
return results
def _resolve_stop_dibang_date(
plan: PlPlan,
*,
stop_type: str,
load_time: date | datetime | str | None = None,
delivery_time: date | datetime | str | None = None,
) -> date:
if stop_type == "load":
resolved = _normalize_to_date(load_time)
if resolved is None:
resolved = _normalize_to_date(plan.pickup_time)
else:
resolved = _normalize_to_date(delivery_time)
if resolved is None:
resolved = _normalize_to_date(plan.delivery_time)
return resolved or _normalize_plan_date(plan)
def _load_stop_products(
db: Session,
tenant_no: str,
load_id: str,
) -> list[_StopDibangProduct]:
rows = (
db.query(PlPlanLoadProduct)
.filter(
PlPlanLoadProduct.load_id == load_id,
PlPlanLoadProduct.tenant_no == tenant_no,
PlPlanLoadProduct.del_flag == 0,
)
.order_by(PlPlanLoadProduct.order_num.asc(), PlPlanLoadProduct.create_time.asc())
.all()
)
return [
_StopDibangProduct(
plan_product_id=row.plan_product_id,
product_id=row.product_id,
product_name=row.product_name or "",
model=row.model,
unit=row.unit or "吨",
quantity=_stop_product_quantity(row),
)
for row in rows
]
def _delivery_stop_products(
db: Session,
tenant_no: str,
delivery_id: str,
) -> list[_StopDibangProduct]:
rows = (
db.query(PlPlanDeliveryProduct)
.filter(
PlPlanDeliveryProduct.delivery_id == delivery_id,
PlPlanDeliveryProduct.tenant_no == tenant_no,
PlPlanDeliveryProduct.del_flag == 0,
)
.order_by(PlPlanDeliveryProduct.order_num.asc(), PlPlanDeliveryProduct.create_time.asc())
.all()
)
return [
_StopDibangProduct(
plan_product_id=row.plan_product_id,
product_id=row.product_id,
product_name=row.product_name or "",
model=row.model,
unit=row.unit or "吨",
quantity=_stop_product_quantity(row),
)
for row in rows
]
def sync_dibang_for_plan_stops(
db: Session,
*,
tenant_no: str,
plan: PlPlan,
transport: PlTransport,
stop_options: list[StopDibangOption],
user_id: Optional[str],
dept_id: str,
) -> list[DibangInventoryLinkResult]:
"""按装货/送货段勾选生成地磅计划与出入库单。"""
apply_stop_dibang_options(
db,
tenant_no=tenant_no,
plan_id=plan.id,
stop_options=stop_options,
user_id=user_id,
)
option_map = {(item.stop_type, item.stop_id): item for item in stop_options}
results: list[DibangInventoryLinkResult] = []
load = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.plan_id == plan.id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
if load:
option = option_map.get(("load", load.id))
if option and option.generate_dibang:
business_type = _direction_to_business_type(load.dibang_direction)
if not business_type:
raise ValueError("装货段未配置地磅方向,无法生成地磅单")
stop_products = _load_stop_products(db, tenant_no, load.id)
if not stop_products:
raise ValueError("装货段无产品明细,无法生成地磅单")
results.extend(
_sync_stop_inventory_links(
db,
tenant_no=tenant_no,
plan=plan,
transport=transport,
stop_type="load",
stop_id=load.id,
partner=(load.customer_name or "").strip(),
business_type=business_type,
dibang_date=_resolve_stop_dibang_date(
plan,
stop_type="load",
load_time=load.load_time,
),
stop_products=stop_products,
user_id=user_id,
dept_id=dept_id,
)
)
deliveries = (
db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.plan_id == plan.id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.order_by(PlPlanDelivery.seq.asc(), PlPlanDelivery.create_time.asc())
.all()
)
for delivery in deliveries:
option = option_map.get(("delivery", delivery.id))
if not option or not option.generate_dibang:
continue
business_type = _direction_to_business_type(delivery.dibang_direction)
if not business_type:
raise ValueError(f"送货段【{delivery.customer_name or delivery.seq}】未配置地磅方向,无法生成地磅单")
stop_products = _delivery_stop_products(db, tenant_no, delivery.id)
if not stop_products:
raise ValueError(f"送货段【{delivery.customer_name or delivery.seq}】无产品明细,无法生成地磅单")
results.extend(
_sync_stop_inventory_links(
db,
tenant_no=tenant_no,
plan=plan,
transport=transport,
stop_type="delivery",
stop_id=delivery.id,
partner=(load.customer_name or "").strip(),
business_type=business_type,
dibang_date=_resolve_stop_dibang_date(
plan,
stop_type="delivery",
delivery_time=delivery.delivery_time,
),
stop_products=stop_products,
user_id=user_id,
dept_id=dept_id,
)
)
return results
def _sync_transport_inventory_links(
db: Session,
*,
@@ -459,6 +840,8 @@ def _sync_transport_inventory_links(
transport_id=transport.id,
plan_id=plan.id,
plan_product_id=product.id,
stop_type=None,
stop_id=None,
db_purchase_plan_id=db_plan.id if db_plan else "",
db_inventory_id=inventory.id,
contributed_qty=Decimal(str(contributed_qty)),
@@ -214,6 +214,7 @@ def list_unsettled_plans(
"licensePlate": plan.license_plate or transport.license_plate,
"transportCompany": transport.carrier_name,
"freightAmount": plan.freight_amount or transport.freight_amount,
"freightRemark": plan.freight_remark,
"archiveTime": plan.update_time,
"transportId": transport.id,
"transportNo": transport.transport_no,
@@ -1218,6 +1219,7 @@ def get_settlement_detail(
"planDate": p.plan_date,
"licensePlate": p.license_plate,
"freightAmount": p.freight_amount,
"freightRemark": p.freight_remark,
}
for p in plans
]
@@ -1,6 +1,12 @@
"""运输计划:内置山峡/云栋客户判定(合同可免)"""
from __future__ import annotations
from typing import Optional
from sqlalchemy.orm import Session
from app.models.pl_models import PlPlan, PlPlanDelivery, PlPlanLoad
INTERNAL_CUSTOMER_NAMES = frozenset(
{
"安庆市山峡化工有限公司",
@@ -11,3 +17,36 @@ INTERNAL_CUSTOMER_NAMES = frozenset(
def is_internal_customer_name(name: Optional[str]) -> bool:
return (name or "").strip() in INTERNAL_CUSTOMER_NAMES
def plan_requires_site_link(db: Session, *, tenant_no: str, plan: PlPlan) -> bool:
"""装货或送货段任一段客户为山峡/云栋时,需要生成现场链接。"""
load = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.plan_id == plan.id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
if load:
if is_internal_customer_name(load.customer_name):
return True
elif is_internal_customer_name(plan.supplier_name):
return True
deliveries = (
db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.plan_id == plan.id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.all()
)
if deliveries:
return any(is_internal_customer_name(row.customer_name) for row in deliveries)
return is_internal_customer_name(plan.customer_name) or is_internal_customer_name(
plan.destination_name
)
@@ -13,6 +13,8 @@ def build_transport_inventory_link_read(
db_inventory_id: str,
batch_no: str,
plan_no: str,
stop_type: str | None = None,
stop_id: str | None = None,
) -> TransportInventoryLinkRead:
del db # 现场链接已迁至 pl_transport_site_link
return TransportInventoryLinkRead(
@@ -22,4 +24,6 @@ def build_transport_inventory_link_read(
db_inventory_id=db_inventory_id,
batch_no=batch_no,
plan_no=plan_no,
stop_type=stop_type,
stop_id=stop_id,
)
+59 -7
View File
@@ -87,8 +87,14 @@ def apply_brand_stock_change(
qty: Decimal,
user_id: str,
dept_id: str,
qty_delta_override: Optional[Decimal] = None,
unit_price_override: Optional[Decimal] = None,
) -> None:
delta = qty_delta_for_plan(plan.plan_type, Decimal(str(qty)))
delta = (
qty_delta_override
if qty_delta_override is not None
else qty_delta_for_plan(plan.plan_type, Decimal(str(qty)))
)
if delta == 0:
return
inv = get_or_create_inventory(
@@ -104,12 +110,14 @@ def apply_brand_stock_change(
user_id=user_id,
dept_id=dept_id,
)
unit_price = (
plan_product.inbound_price
or plan_product.outbound_price
or plan_product.tax_price
or Decimal("0")
)
unit_price = unit_price_override
if unit_price is None:
unit_price = (
plan_product.inbound_price
or plan_product.outbound_price
or plan_product.tax_price
or Decimal("0")
)
unit_price = Decimal(str(unit_price))
inv.stock_qty = Decimal(str(inv.stock_qty or 0)) + delta
inv.stock_amount = Decimal(str(inv.stock_qty or 0)) * unit_price
@@ -239,3 +247,47 @@ def apply_archive_inventory_for_plan(
user_id=user_id,
dept_id=dept_id,
)
def apply_archive_inventory_for_plan_stops(
db: Session,
*,
tenant_no: str,
plan: PlPlan,
user_id: str,
dept_id: str = "",
) -> None:
"""一车多卸:内部装货出库、内部送货入库。"""
from app.services.pl_plan_archive_stop_service import iter_stop_archive_inventory_lines
reverse_plan_inventory_postings(
db, tenant_no=tenant_no, plan_id=plan.id, user_id=user_id
)
product_map = {
row.id: row
for row in db.query(PlPlanProduct).filter(
PlPlanProduct.plan_id == plan.id,
PlPlanProduct.tenant_no == tenant_no,
PlPlanProduct.del_flag == 0,
)
}
for plan_product_id, qty, direction, price in iter_stop_archive_inventory_lines(
db, tenant_no=tenant_no, plan_id=plan.id
):
prod = product_map.get(plan_product_id)
if not prod:
continue
delta = -qty if direction == "outbound" else qty
apply_brand_stock_change(
db,
tenant_no=tenant_no,
plan=plan,
plan_product=prod,
brand_id=EMPTY_BRAND_ID,
brand_name=None,
qty=qty,
user_id=user_id,
dept_id=dept_id,
qty_delta_override=delta,
unit_price_override=Decimal(str(price)) if price is not None else None,
)
+144 -6
View File
@@ -316,6 +316,12 @@ def dump_feedback_images(images: list[str]) -> str:
_VALID_SITE_FEEDBACK_STATUSES = frozenset({"in_progress", "completed", "voided"})
PLAN_TYPE_BUSINESS_LABEL = {
"inbound": "入库",
"outbound": "出库",
"direct": "直销",
}
def _io_item_brand_qty_model(kind: str):
if kind == "inbound":
@@ -413,6 +419,144 @@ def update_io_order_items_qty_and_brand(
)
def apply_io_order_stop_site_feedbacks(
db: Session,
*,
kind: str,
header: OrderHeader,
items: list[OrderItem],
stops: list[dict[str, Any]],
enforce_brand: bool = False,
user_id: Optional[str] = None,
) -> tuple[dict[str, Decimal], Optional[dict[str, list[dict]]], list[str]]:
"""保存按段现场回传,并汇总为出入库明细数量。"""
from collections import defaultdict
from app.services.pl_feedback_brand_qty import require_brand_qtys_if_needed
from app.services.pl_internal_customer import is_internal_customer_name
from app.services.pl_transport_stop_feedback_service import (
load_io_order_site_stop_segments,
save_site_stop_feedback,
)
segments = load_io_order_site_stop_segments(
db,
tenant_no=header.tenant_no,
plan_id=header.plan_id,
transport_id=header.transport_id,
)
segment_map = {(seg.stop_type, seg.stop_id): seg for seg in segments}
plan_products = (
db.query(PlPlanProduct)
.filter(
PlPlanProduct.plan_id == header.plan_id,
PlPlanProduct.tenant_no == header.tenant_no,
PlPlanProduct.del_flag == 0,
)
.all()
)
plan_products_by_id = {row.id: row for row in plan_products}
qty_by_plan_product: dict[str, Decimal] = defaultdict(lambda: Decimal("0"))
brand_by_plan_product: dict[str, dict[str, dict[str, Any]]] = defaultdict(dict)
merged_images: list[str] = []
default_business_type = PLAN_TYPE_BUSINESS_LABEL.get(kind, kind)
for stop_payload in stops:
stop_type = (stop_payload.get("stopType") or stop_payload.get("stop_type") or "").strip()
stop_id = (stop_payload.get("stopId") or stop_payload.get("stop_id") or "").strip()
if stop_type not in ("load", "delivery") or not stop_id:
raise ValueError("停靠段参数无效")
segment = segment_map.get((stop_type, stop_id))
if not segment:
raise ValueError("停靠段不存在或不可回传")
needs_product_qty = is_internal_customer_name(segment.customer_name)
allowed_products = {row.stop_product_id: row for row in segment.products}
products_payload: list[dict[str, Any]] | None = [] if needs_product_qty else None
if needs_product_qty:
for item in stop_payload.get("products") or []:
stop_product_id = (
item.get("stopProductId") or item.get("stop_product_id") or ""
).strip()
stop_row = allowed_products.get(stop_product_id)
if not stop_row:
raise ValueError("产品不属于当前停靠段")
actual_qty = Decimal(str(item.get("actualQty", item.get("actual_qty") or 0)))
brand_qtys = item.get("brandQtys") or item.get("brand_qtys") or []
plan_product = plan_products_by_id.get(stop_row.plan_product_id)
require_brand_qtys_if_needed(
brand_mode=plan_product.brand_mode if plan_product else None,
required_brand_id=plan_product.brand_id if plan_product else None,
actual_qty=actual_qty,
rows=brand_qtys if isinstance(brand_qtys, list) else [],
enforce=enforce_brand,
)
row_payload: dict[str, Any] = {
"stopProductId": stop_product_id,
"actualQty": float(actual_qty),
}
if brand_qtys:
row_payload["brandQtys"] = brand_qtys
products_payload.append(row_payload)
pp_id = stop_row.plan_product_id
if actual_qty > 0:
qty_by_plan_product[pp_id] += actual_qty
if brand_qtys:
for brand_row in brand_qtys:
if not isinstance(brand_row, dict):
continue
brand_id = str(brand_row.get("brandId") or brand_row.get("brand_id") or "")
qty = Decimal(str(brand_row.get("qty") or 0))
if qty <= 0:
continue
existing = brand_by_plan_product[pp_id].get(brand_id)
if existing:
existing["qty"] = float(Decimal(str(existing["qty"])) + qty)
else:
brand_by_plan_product[pp_id][brand_id] = {
"brandId": brand_id,
"brandName": brand_row.get("brandName") or brand_row.get("brand_name"),
"qty": float(qty),
}
elif stop_payload.get("products"):
raise ValueError("该停靠段无需填写产品数量")
attachment_urls = stop_payload.get("attachmentUrls") or stop_payload.get("attachment_urls") or []
merged_images.extend(
[str(url).strip() for url in attachment_urls if str(url).strip()]
)
save_site_stop_feedback(
db,
tenant_no=header.tenant_no,
transport_id=header.transport_id,
plan_id=header.plan_id,
stop_type=stop_type,
stop_id=stop_id,
business_type=segment.business_type or default_business_type,
attachment_urls=list(attachment_urls),
products=products_payload,
user_id=user_id,
require_qty_before_attachments=needs_product_qty,
)
item_by_plan_product = {it.plan_product_id: it for it in items if it.plan_product_id}
qty_map: dict[str, Decimal] = {}
brand_qty_map: dict[str, list[dict]] = {}
for plan_product_id, qty in qty_by_plan_product.items():
item = item_by_plan_product.get(plan_product_id)
if item:
qty_map[item.id] = qty
for plan_product_id, brand_rows in brand_by_plan_product.items():
item = item_by_plan_product.get(plan_product_id)
if item and brand_rows:
brand_qty_map[item.id] = list(brand_rows.values())
return qty_map, brand_qty_map or None, merged_images
def apply_site_feedback(
db: Session,
*,
@@ -455,12 +599,6 @@ def apply_site_feedback(
CRM_PRODUCT_UNIT = "crm_product_unit"
PLAN_TYPE_BUSINESS_LABEL = {
"inbound": "入库",
"outbound": "出库",
"direct": "直销",
}
def resolve_unit_label(unit_map: dict[str, str], unit_code: Optional[str]) -> str:
code = (unit_code or "").strip()
@@ -120,11 +120,13 @@ def count_plan_cert_pending(db: Session, tenant_no: str, user) -> int:
def count_plan_archive_pending(db: Session, tenant_no: str, user) -> int:
"""待归档角标:与归档列表一致,仅统计已安排运输且未归档的计划。"""
query = db.query(PlPlan).filter(
PlPlan.tenant_no == tenant_no,
PlPlan.del_flag == 0,
PlPlan.archive_status == "unarchived",
PlPlan.follow_status != "cancelled",
PlPlan.transport_status == "arranged",
)
query = apply_pl_scope(query, PlPlan, user, db, tenant_no)
return query.count()
@@ -0,0 +1,302 @@
"""运输计划按段归档(装货/送货段)"""
from __future__ import annotations
from collections import defaultdict
from decimal import Decimal
from typing import Optional
from fastapi import HTTPException
from sqlalchemy.orm import Session
from app.models.pl_models import (
PlPlan,
PlPlanDelivery,
PlPlanDeliveryProduct,
PlPlanLoad,
PlPlanLoadProduct,
PlPlanProduct,
)
from app.schemas.pl.plan import (
PlanArchiveDeliveryBlock,
PlanArchiveLoadBlock,
PlanArchiveStopProductItem,
)
from app.services.pl_internal_customer import is_internal_customer_name
def _require_qty(value: Optional[Decimal], label: str) -> Decimal:
if value is None:
raise HTTPException(status_code=400, detail=f"{label}不能为空")
qty = Decimal(str(value))
if qty < 0:
raise HTTPException(status_code=400, detail=f"{label}不能为负数")
return qty
def _apply_stop_product_archive(
row: PlPlanLoadProduct | PlPlanDeliveryProduct,
item: PlanArchiveStopProductItem,
*,
mode: str,
label: str,
user_id: str,
) -> None:
if mode == "inbound":
qty = _require_qty(item.inbound_qty, f"{label}入库数量")
row.inbound_qty = qty
if item.inbound_price is not None:
row.inbound_price = Decimal(str(item.inbound_price))
price = row.inbound_price
if price is not None:
row.inbound_amount = qty * Decimal(str(price))
else:
qty = _require_qty(item.outbound_qty, f"{label}出库数量")
row.outbound_qty = qty
if item.outbound_price is not None:
row.outbound_price = Decimal(str(item.outbound_price))
price = row.outbound_price
if price is not None:
row.outbound_amount = qty * Decimal(str(price))
row.update_by = user_id
def apply_archive_stop_quantities(
db: Session,
*,
tenant_no: str,
plan: PlPlan,
load_block: PlanArchiveLoadBlock,
delivery_blocks: list[PlanArchiveDeliveryBlock],
user_id: str,
) -> None:
load = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.id == load_block.stop_id,
PlPlanLoad.plan_id == plan.id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
if not load:
raise HTTPException(status_code=400, detail="装货段不存在")
load_products = {
row.id: row
for row in db.query(PlPlanLoadProduct).filter(
PlPlanLoadProduct.load_id == load.id,
PlPlanLoadProduct.plan_id == plan.id,
PlPlanLoadProduct.tenant_no == tenant_no,
PlPlanLoadProduct.del_flag == 0,
)
}
if not load_products:
raise HTTPException(status_code=400, detail="装货段无产品明细")
if len(load_block.products) != len(load_products):
raise HTTPException(status_code=400, detail="装货段归档产品行不完整")
for item in load_block.products:
row = load_products.get(item.id)
if not row:
raise HTTPException(status_code=400, detail=f"装货段产品不存在: {item.id}")
_apply_stop_product_archive(
row, item, mode="inbound", label="装货段", user_id=user_id
)
deliveries = (
db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.plan_id == plan.id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.order_by(PlPlanDelivery.seq.asc(), PlPlanDelivery.create_time.asc())
.all()
)
delivery_map = {row.id: row for row in deliveries}
if len(delivery_blocks) != len(deliveries):
raise HTTPException(status_code=400, detail="请填写全部送货段归档")
for block in delivery_blocks:
delivery = delivery_map.get(block.stop_id)
if not delivery:
raise HTTPException(status_code=400, detail="送货段不存在")
delivery_products = {
row.id: row
for row in db.query(PlPlanDeliveryProduct).filter(
PlPlanDeliveryProduct.delivery_id == delivery.id,
PlPlanDeliveryProduct.plan_id == plan.id,
PlPlanDeliveryProduct.tenant_no == tenant_no,
PlPlanDeliveryProduct.del_flag == 0,
)
}
if not delivery_products:
raise HTTPException(status_code=400, detail=f"送货段「{delivery.customer_name or ''}」无产品明细")
if len(block.products) != len(delivery_products):
raise HTTPException(status_code=400, detail=f"送货段「{delivery.customer_name or ''}」归档产品行不完整")
label = f"送货段「{delivery.customer_name or delivery.seq}」"
for item in block.products:
row = delivery_products.get(item.id)
if not row:
raise HTTPException(status_code=400, detail=f"{label}产品不存在: {item.id}")
_apply_stop_product_archive(
row, item, mode="outbound", label=label, user_id=user_id
)
def sync_plan_products_from_stop_archive(
db: Session,
*,
tenant_no: str,
plan_id: str,
user_id: str,
) -> None:
"""将段级归档数量汇总回写 pl_plan_product(_row_to_dict 权威来源)。"""
plan_products = {
row.id: row
for row in db.query(PlPlanProduct).filter(
PlPlanProduct.plan_id == plan_id,
PlPlanProduct.tenant_no == tenant_no,
PlPlanProduct.del_flag == 0,
)
}
inbound_by_plan_product: dict[str, Decimal] = defaultdict(lambda: Decimal("0"))
outbound_by_plan_product: dict[str, Decimal] = defaultdict(lambda: Decimal("0"))
inbound_amount_by_plan_product: dict[str, Decimal] = defaultdict(lambda: Decimal("0"))
outbound_amount_by_plan_product: dict[str, Decimal] = defaultdict(lambda: Decimal("0"))
load = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.plan_id == plan_id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
if load:
load_rows = (
db.query(PlPlanLoadProduct)
.filter(
PlPlanLoadProduct.load_id == load.id,
PlPlanLoadProduct.plan_id == plan_id,
PlPlanLoadProduct.tenant_no == tenant_no,
PlPlanLoadProduct.del_flag == 0,
)
.all()
)
for row in load_rows:
if row.plan_product_id not in plan_products:
continue
qty = Decimal(str(row.inbound_qty or 0))
inbound_by_plan_product[row.plan_product_id] += qty
inbound_amount_by_plan_product[row.plan_product_id] += Decimal(str(row.inbound_amount or 0))
delivery_rows = (
db.query(PlPlanDeliveryProduct)
.filter(
PlPlanDeliveryProduct.plan_id == plan_id,
PlPlanDeliveryProduct.tenant_no == tenant_no,
PlPlanDeliveryProduct.del_flag == 0,
)
.all()
)
for row in delivery_rows:
if row.plan_product_id not in plan_products:
continue
qty = Decimal(str(row.outbound_qty or 0))
outbound_by_plan_product[row.plan_product_id] += qty
outbound_amount_by_plan_product[row.plan_product_id] += Decimal(str(row.outbound_amount or 0))
for plan_product_id, prod in plan_products.items():
if plan_product_id in inbound_by_plan_product:
prod.inbound_qty = inbound_by_plan_product[plan_product_id]
if inbound_amount_by_plan_product[plan_product_id] > 0:
prod.inbound_amount = inbound_amount_by_plan_product[plan_product_id]
if plan_product_id in outbound_by_plan_product:
prod.outbound_qty = outbound_by_plan_product[plan_product_id]
if outbound_amount_by_plan_product[plan_product_id] > 0:
prod.outbound_amount = outbound_amount_by_plan_product[plan_product_id]
outbound_qty = outbound_by_plan_product.get(plan_product_id, Decimal("0"))
if outbound_qty > 0:
prod.actual_qty = outbound_qty
prod.update_by = user_id
def sum_delivery_outbound_qty(db: Session, *, tenant_no: str, plan_id: str) -> Decimal:
total = Decimal("0")
rows = (
db.query(PlPlanDeliveryProduct)
.filter(
PlPlanDeliveryProduct.plan_id == plan_id,
PlPlanDeliveryProduct.tenant_no == tenant_no,
PlPlanDeliveryProduct.del_flag == 0,
)
.all()
)
for row in rows:
total += Decimal(str(row.outbound_qty or 0))
return total
def iter_stop_archive_inventory_lines(
db: Session,
*,
tenant_no: str,
plan_id: str,
):
"""产出内部段库存变动:装货出库、送货入库。"""
load = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.plan_id == plan_id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
if load and is_internal_customer_name(load.customer_name):
rows = (
db.query(PlPlanLoadProduct)
.filter(
PlPlanLoadProduct.load_id == load.id,
PlPlanLoadProduct.plan_id == plan_id,
PlPlanLoadProduct.tenant_no == tenant_no,
PlPlanLoadProduct.del_flag == 0,
)
.all()
)
for row in rows:
qty = Decimal(str(row.inbound_qty or 0))
if qty > 0:
yield row.plan_product_id, qty, "outbound", row.inbound_price
deliveries = (
db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.plan_id == plan_id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.all()
)
delivery_ids = [row.id for row in deliveries]
internal_delivery_ids = {
row.id for row in deliveries if is_internal_customer_name(row.customer_name)
}
if not internal_delivery_ids:
return
rows = (
db.query(PlPlanDeliveryProduct)
.filter(
PlPlanDeliveryProduct.delivery_id.in_(list(internal_delivery_ids)),
PlPlanDeliveryProduct.plan_id == plan_id,
PlPlanDeliveryProduct.tenant_no == tenant_no,
PlPlanDeliveryProduct.del_flag == 0,
)
.all()
)
for row in rows:
qty = Decimal(str(row.outbound_qty or 0))
if qty > 0:
yield row.plan_product_id, qty, "inbound", row.outbound_price
@@ -1,8 +1,8 @@
"""运输计划列表:批量计算「复制给司机 / 现场 / 磅单二维码」按钮显示标志。
语义与查看弹窗 / usePlPlanArrangeActions 对齐:
语义与查看弹窗 / usePlPlanArrangeActions / build_site_records_for_arranged_plan 对齐:
- 已安排且未取消,且存在司机链接或现场记录或地磅出入库关联时,显示「复制给司机」
- 有现场链接记录(含出入库单现场令牌回退)时显示「复制给现场」
- 有现场链接记录(含运输单按段 site_access_token、出入库单现场令牌回退)时显示「复制给现场」
- 有勾选生成地磅单的出入库关联(db_purchase_plan_id 非空)时显示「复制磅单二维码」
"""
from __future__ import annotations
@@ -20,6 +20,8 @@ from app.models.pl_models import (
PlTransportDbLink,
PlTransportSiteLink,
)
from app.services.pl_dibang_bridge_service import plan_has_load_stop
from app.services.pl_internal_customer import plan_requires_site_link
@dataclass(frozen=True)
@@ -130,6 +132,20 @@ def load_plan_arrange_copy_flags(
if status != "voided" and (site_access_token or "").strip():
site_plan_ids.add(plan_id)
# 与 build_site_records_for_arranged_plan 一致:无 site_link 行时,装货段 + 运输单 site_access_token
for plan in candidates:
if plan.id in site_plan_ids:
continue
if not plan_requires_site_link(db, tenant_no=tenant_no, plan=plan):
continue
transport = transport_by_id.get(plan.transport_id or "")
if not transport:
continue
if not plan_has_load_stop(db, tenant_no, plan.id):
continue
if (transport.site_access_token or "").strip():
site_plan_ids.add(plan.id)
for plan in candidates:
transport = transport_by_id.get(plan.transport_id or "")
if not transport:
+110 -10
View File
@@ -10,8 +10,11 @@ from app.models.pl_models import (
PlInboundOrder,
PlOutboundOrder,
PlPlan,
PlPlanDelivery,
PlTransport,
PlTransportDriverStopFeedback,
PlTransportSiteLink,
PlTransportSiteStopFeedback,
)
@@ -39,6 +42,34 @@ def _short_label(text: str, max_len: int = 8) -> str:
return f"{value[: max_len - 1]}…"
def _stop_source_label(
stop_type: str,
stop_id: str,
source: str,
delivery_seq_by_id: dict[str, int],
) -> str:
normalized = (stop_type or "").strip()
if normalized == "load":
return f"装货·{source}"
seq = delivery_seq_by_id.get((stop_id or "").strip())
if seq:
return f"送货#{seq}·{source}"
return f"送货·{source}"
def _stop_sort_key(
stop_type: str,
stop_id: str,
source: str,
delivery_seq_by_id: dict[str, int],
) -> tuple[int, int, int, str]:
normalized = (stop_type or "").strip()
stop_rank = 0 if normalized == "load" else 1
seq = delivery_seq_by_id.get((stop_id or "").strip(), 999) if normalized != "load" else 0
source_rank = 0 if source == "司机" else 1
return (stop_rank, seq, source_rank, stop_id or "")
def load_plan_document_attachments_by_plan_ids(
db: Session,
*,
@@ -50,16 +81,41 @@ def load_plan_document_attachments_by_plan_ids(
result: dict[str, list[dict[str, str]]] = {plan_id: [] for plan_id in plan_ids}
seen: dict[str, set[str]] = {plan_id: set() for plan_id in plan_ids}
pending: dict[str, list[tuple[tuple[int, int, int, str], str, list[str]]]] = {
plan_id: [] for plan_id in plan_ids
}
def add(plan_id: str, label: str, urls: list[str]) -> None:
def add(plan_id: str, label: str, urls: list[str], sort_key: tuple[int, int, int, str]) -> None:
if plan_id not in pending:
return
cleaned = [url for url in urls if url]
if not cleaned:
return
pending[plan_id].append((sort_key, label, cleaned))
def flush(plan_id: str) -> None:
bucket = result.get(plan_id)
if bucket is None:
return
for url in urls:
if not url or url in seen[plan_id]:
continue
seen[plan_id].add(url)
bucket.append({"url": url, "label": label})
for _, label, urls in sorted(pending.get(plan_id, []), key=lambda item: item[0]):
for url in urls:
if url in seen[plan_id]:
continue
seen[plan_id].add(url)
bucket.append({"url": url, "label": label})
delivery_seq_by_id: dict[str, int] = {}
delivery_rows = (
db.query(PlPlanDelivery.id, PlPlanDelivery.plan_id, PlPlanDelivery.seq)
.filter(
PlPlanDelivery.plan_id.in_(plan_ids),
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.all()
)
for delivery_id, _plan_id, seq in delivery_rows:
delivery_seq_by_id[str(delivery_id)] = int(seq or 0)
plan_rows = (
db.query(PlPlan.id, PlPlan.transport_id)
@@ -89,7 +145,48 @@ def load_plan_document_attachments_by_plan_ids(
plan_id = plan_by_transport.get(transport.id)
if not plan_id:
continue
add(plan_id, "司机", _parse_image_urls(transport.feedback_images))
add(
plan_id,
"司机",
_parse_image_urls(transport.feedback_images),
(0, 0, 0, "transport"),
)
driver_rows = (
db.query(PlTransportDriverStopFeedback)
.filter(
PlTransportDriverStopFeedback.plan_id.in_(plan_ids),
PlTransportDriverStopFeedback.tenant_no == tenant_no,
PlTransportDriverStopFeedback.del_flag == 0,
)
.all()
)
for row in driver_rows:
label = _stop_source_label(row.stop_type, row.stop_id, "司机", delivery_seq_by_id)
add(
row.plan_id,
label,
_parse_image_urls(row.attachment_urls),
_stop_sort_key(row.stop_type, row.stop_id, "司机", delivery_seq_by_id),
)
site_stop_rows = (
db.query(PlTransportSiteStopFeedback)
.filter(
PlTransportSiteStopFeedback.plan_id.in_(plan_ids),
PlTransportSiteStopFeedback.tenant_no == tenant_no,
PlTransportSiteStopFeedback.del_flag == 0,
)
.all()
)
for row in site_stop_rows:
label = _stop_source_label(row.stop_type, row.stop_id, "现场", delivery_seq_by_id)
add(
row.plan_id,
label,
_parse_image_urls(row.attachment_urls),
_stop_sort_key(row.stop_type, row.stop_id, "现场", delivery_seq_by_id),
)
site_rows = (
db.query(PlTransportSiteLink)
@@ -104,7 +201,7 @@ def load_plan_document_attachments_by_plan_ids(
for row in site_rows:
product = (row.product or "").strip()
label = f"现场·{_short_label(product)}" if product else "现场"
add(row.plan_id, label, _parse_image_urls(row.site_feedback_images))
add(row.plan_id, label, _parse_image_urls(row.site_feedback_images), (2, 0, 1, row.id or ""))
inbound_rows = (
db.query(PlInboundOrder)
@@ -116,7 +213,7 @@ def load_plan_document_attachments_by_plan_ids(
.all()
)
for row in inbound_rows:
add(row.plan_id, "入库现场", _parse_image_urls(row.site_feedback_images))
add(row.plan_id, "入库现场", _parse_image_urls(row.site_feedback_images), (3, 0, 1, row.id or ""))
outbound_rows = (
db.query(PlOutboundOrder)
@@ -128,6 +225,9 @@ def load_plan_document_attachments_by_plan_ids(
.all()
)
for row in outbound_rows:
add(row.plan_id, "出库现场", _parse_image_urls(row.site_feedback_images))
add(row.plan_id, "出库现场", _parse_image_urls(row.site_feedback_images), (3, 0, 2, row.id or ""))
for plan_id in plan_ids:
flush(plan_id)
return result
@@ -0,0 +1,169 @@
"""运输计划打印数据聚合(一车多卸)"""
from __future__ import annotations
from decimal import Decimal
from typing import Optional
from sqlalchemy.orm import Session
from app.schemas.pl.plan import (
DeliveryPrintCustomerOption,
DeliverySlipPrintRead,
PlanDeliveryRead,
PlanStopProductRead,
)
from app.services.pl_plan_stop_service import load_plan_stops_grouped
def _customer_key(customer_id: Optional[str], customer_name: Optional[str]) -> str:
cid = (customer_id or "").strip()
if cid:
return f"id:{cid}"
name = (customer_name or "").strip()
if name:
return f"name:{name}"
return ""
def _resolve_customer_id(customer_id: Optional[str], customer_name: Optional[str]) -> str:
cid = (customer_id or "").strip()
if cid:
return cid
return (customer_name or "").strip()
def list_delivery_print_customers(
deliveries: list[PlanDeliveryRead],
) -> list[DeliveryPrintCustomerOption]:
grouped: dict[str, dict] = {}
for delivery in deliveries:
key = _customer_key(delivery.customer_id, delivery.customer_name)
if not key:
continue
if key not in grouped:
grouped[key] = {
"customer_id": _resolve_customer_id(delivery.customer_id, delivery.customer_name),
"customer_name": (delivery.customer_name or "").strip() or "—",
"delivery_count": 0,
"min_seq": delivery.seq or 9999,
}
grouped[key]["delivery_count"] += 1
grouped[key]["min_seq"] = min(grouped[key]["min_seq"], delivery.seq or 9999)
rows = sorted(grouped.values(), key=lambda item: (item["min_seq"], item["customer_name"]))
return [
DeliveryPrintCustomerOption(
customer_id=item["customer_id"],
customer_name=item["customer_name"],
delivery_count=item["delivery_count"],
)
for item in rows
]
def _delivery_matches_customer(
delivery: PlanDeliveryRead,
customer_id: str,
) -> bool:
target = (customer_id or "").strip()
if not target:
return False
delivery_id = (delivery.customer_id or "").strip()
if delivery_id and delivery_id == target:
return True
delivery_name = (delivery.customer_name or "").strip()
return not delivery_id and delivery_name == target
def _merge_stop_products(products: list[PlanStopProductRead]) -> list[PlanStopProductRead]:
merged: dict[str, PlanStopProductRead] = {}
order: list[str] = []
for product in products:
key = (product.product_id or "").strip() or product.id
if key not in merged:
merged[key] = product.model_copy(deep=True)
order.append(key)
continue
existing = merged[key]
for field in ("plan_qty", "outbound_qty", "inbound_qty"):
left = getattr(existing, field, None)
right = getattr(product, field, None)
if left is None and right is None:
continue
total = (left or Decimal("0")) + (right or Decimal("0"))
setattr(existing, field, total)
if not (existing.remark or "").strip() and (product.remark or "").strip():
existing.remark = product.remark
return [merged[key] for key in order]
def build_delivery_slip_print(
db: Session,
*,
tenant_no: str,
plan_id: str,
plan_no: str,
plan_date: Optional[str],
customer_id: str,
) -> DeliverySlipPrintRead:
stops = load_plan_stops_grouped(db, tenant_no, [plan_id]).get(plan_id)
if not stops:
raise ValueError("计划未配置送货段")
_load, deliveries = stops
if not deliveries:
raise ValueError("计划未配置送货段")
matched = [item for item in deliveries if _delivery_matches_customer(item, customer_id)]
if not matched:
raise ValueError("未找到匹配的送货客户")
matched.sort(key=lambda item: (item.seq or 9999, item.create_time))
primary = matched[0]
products: list[PlanStopProductRead] = []
for delivery in matched:
products.extend(delivery.products or [])
merged_products = _merge_stop_products(products)
return DeliverySlipPrintRead(
plan_id=plan_id,
plan_no=plan_no or "",
plan_date=plan_date,
customer_id=_resolve_customer_id(primary.customer_id, primary.customer_name),
receiving_unit=(primary.customer_name or "").strip(),
receive_contact=(primary.contact or "").strip(),
delivery_address=(primary.address or "").strip() or None,
products=merged_products,
)
def get_delivery_slip_print_context(
db: Session,
*,
tenant_no: str,
plan_id: str,
plan_no: str,
plan_date: Optional[str],
customer_id: Optional[str] = None,
) -> DeliverySlipPrintRead:
stops = load_plan_stops_grouped(db, tenant_no, [plan_id]).get(plan_id)
deliveries = stops[1] if stops else []
customers = list_delivery_print_customers(deliveries)
if not customer_id:
return DeliverySlipPrintRead(
plan_id=plan_id,
plan_no=plan_no or "",
plan_date=plan_date,
customers=customers,
)
detail = build_delivery_slip_print(
db,
tenant_no=tenant_no,
plan_id=plan_id,
plan_no=plan_no,
plan_date=plan_date,
customer_id=customer_id,
)
detail.customers = customers
return detail
+78 -2
View File
@@ -1245,7 +1245,11 @@ def load_plan_contracts_grouped(
}
for row in rows:
bucket = buckets.setdefault(row.plan_id, [[], []])
link = PlanContractLink(contractId=row.contract_id, contractNo=row.contract_no)
link = PlanContractLink(
contractId=row.contract_id,
contractNo=row.contract_no,
stopId=row.stop_id,
)
if row.side == PLAN_CONTRACT_SIDE_SUPPLIER:
bucket[0].append(link)
elif row.side == PLAN_CONTRACT_SIDE_DEMANDER:
@@ -1456,6 +1460,59 @@ def apply_archive_product_quantities(
)
def apply_archive_brand_qtys_only(
db: Session,
*,
tenant_no: str,
plan: PlPlan,
items: list[PlanArchiveProductItem],
user_id: str,
) -> None:
"""一车多卸:段级数量已写入,此处仅处理计划产品品牌分量。"""
product_map = {
row.id: row
for row in db.query(PlPlanProduct).filter(
PlPlanProduct.plan_id == plan.id,
PlPlanProduct.tenant_no == tenant_no,
PlPlanProduct.del_flag == 0,
).all()
}
for item in items:
if not item.brand_qtys:
continue
prod = product_map.get(item.id)
if not prod:
raise HTTPException(status_code=400, detail=f"产品明细不存在: {item.id}")
actual = Decimal(str(prod.actual_qty or 0))
brand_rows = [
{
"brandId": bq.brand_id or "",
"brandName": bq.brand_name,
"qty": bq.qty,
}
for bq in item.brand_qtys
]
try:
validate_brand_qty_rows(
brand_mode=prod.brand_mode,
required_brand_id=prod.brand_id,
actual_qty=actual,
rows=brand_rows,
)
except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc)) from exc
persist_plan_product_brand_qtys(
db,
tenant_no=tenant_no,
plan_id=plan.id,
plan_product_id=prod.id,
brand_mode=prod.brand_mode,
rows=brand_rows,
user_id=user_id,
dept_id=getattr(prod, "create_dept_id", "") or "",
)
def apply_archive_freight(
db: Session,
*,
@@ -1466,6 +1523,8 @@ def apply_archive_freight(
) -> None:
has_freight = int(freight.has_freight if freight.has_freight is not None else plan.has_freight or 0)
plan.has_freight = has_freight
if freight.freight_remark is not None:
plan.freight_remark = freight.freight_remark
plan.update_by = user_id
if has_freight != 1:
@@ -1533,7 +1592,24 @@ def apply_archive_freight(
if freight.transport_qty is not None:
transport.transport_qty = freight.transport_qty
elif freight_type == "by_weight":
transport.transport_qty = sum_plan_product_actual_quantities(plan_products)
from app.services.pl_plan_archive_stop_service import sum_delivery_outbound_qty
from app.models.pl_models import PlPlanLoad
has_load_stop = (
db.query(PlPlanLoad.id)
.filter(
PlPlanLoad.plan_id == plan.id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
if has_load_stop:
transport.transport_qty = sum_delivery_outbound_qty(
db, tenant_no=tenant_no, plan_id=plan.id
)
else:
transport.transport_qty = sum_plan_product_actual_quantities(plan_products)
if freight_type == "by_weight" and (transport.transport_qty or 0) <= 0:
raise HTTPException(status_code=400, detail="运输量必须大于0,请先填写产品实际数量")
if freight.has_invoice is not None:
@@ -0,0 +1,84 @@
"""运输计划 · 现场链接读模型解析(安排运输 / 查看弹窗共用)"""
from __future__ import annotations
from sqlalchemy.orm import Session
from app.models.pl_models import PlPlan, PlPlanProduct, PlTransport, PlTransportSiteLink
from app.schemas.pl.transport import TransportSiteLinkRead
from app.services.pl_dibang_bridge_service import plan_has_load_stop
from app.services.pl_internal_customer import plan_requires_site_link
from app.services.pl_io_order_service import build_io_order_site_url, get_active_io_order_for_plan
from app.services.pl_site_link_read import build_transport_site_link_read_from_row
from app.services.pl_transport_stop_feedback_service import build_transport_site_url
def build_site_records_for_arranged_plan(
db: Session,
*,
tenant_no: str,
plan: PlPlan,
transport: PlTransport,
) -> list[TransportSiteLinkRead]:
"""按当前计划装/送货客户判定,解析可复制的现场链接列表。"""
if not plan_requires_site_link(db, tenant_no=tenant_no, plan=plan):
return []
site_rows = (
db.query(PlTransportSiteLink)
.filter(
PlTransportSiteLink.tenant_no == tenant_no,
PlTransportSiteLink.plan_id == plan.id,
PlTransportSiteLink.transport_id == transport.id,
PlTransportSiteLink.del_flag == 0,
)
.order_by(PlTransportSiteLink.create_time.asc())
.all()
)
if site_rows:
product_name_by_id = {
item.id: item.product_name or ""
for item in db.query(PlPlanProduct)
.filter(PlPlanProduct.plan_id == plan.id, PlPlanProduct.del_flag == 0)
.all()
}
return [
build_transport_site_link_read_from_row(
row,
product_name=product_name_by_id.get(row.plan_product_id, row.product or ""),
)
for row in site_rows
]
if plan_has_load_stop(db, tenant_no, plan.id):
token = (transport.site_access_token or "").strip()
if token:
return [
TransportSiteLinkRead(
plan_product_id="",
product_name=plan.plan_no or transport.transport_no,
site_link_id=transport.id,
plan_no=plan.plan_no or "",
business_type="按段现场",
site_access_token=token,
site_url=build_transport_site_url(token),
)
]
active_io = get_active_io_order_for_plan(db, tenant_no, plan)
if active_io:
kind, header = active_io
token = (header.site_access_token or "").strip()
if token and header.status != "voided":
return [
TransportSiteLinkRead(
plan_product_id="",
product_name=header.order_no,
site_link_id=header.id,
plan_no=plan.plan_no or "",
business_type="入库" if kind == "inbound" else "出库",
site_access_token=token,
site_url=build_io_order_site_url(kind, token),
)
]
return []
@@ -0,0 +1,62 @@
"""运输计划多段:内部客户地磅默认值与数量平衡校验"""
from __future__ import annotations
from decimal import Decimal
from typing import Any, Iterable, Literal, Optional, Tuple
from app.services.pl_internal_customer import is_internal_customer_name
StopType = Literal["load", "delivery"]
def resolve_stop_dibang_defaults(
load_customer_name: Optional[str],
stop_type: StopType,
) -> Tuple[bool, str]:
"""地磅默认勾选以装货客户是否为内部客户为准。"""
if not is_internal_customer_name(load_customer_name):
return False, "none"
if stop_type == "load":
return True, "outbound"
if stop_type == "delivery":
return True, "inbound"
return False, "none"
def _extract_qty(item: Any, *field_names: str) -> Decimal:
for name in field_names:
if isinstance(item, dict):
value = item.get(name)
else:
value = getattr(item, name, None)
if value is not None:
return Decimal(str(value))
return Decimal("0")
def _sum_qty(items: Iterable[Any], *field_names: str) -> Decimal:
total = Decimal("0")
for item in items or []:
total += _extract_qty(item, *field_names)
return total
def _fmt_qty(qty: Decimal) -> str:
if qty == qty.to_integral_value():
return str(int(qty))
return format(qty.normalize(), "f")
def warn_qty_imbalance(
plan_products: Iterable[Any],
load_products: Iterable[Any],
delivery_products: Iterable[Any],
) -> list[str]:
load_total = _sum_qty(load_products, "plan_qty")
delivery_total = _sum_qty(delivery_products, "plan_qty")
if load_total == delivery_total:
return []
return [
f"装货合计({_fmt_qty(load_total)})与送货合计({_fmt_qty(delivery_total)})不一致,请核对"
]
@@ -0,0 +1,792 @@
"""运输计划 · 装货/送货段读取与列表摘要。"""
from __future__ import annotations
from collections import defaultdict
from datetime import datetime
from decimal import Decimal
from typing import Optional
from fastapi import HTTPException
from sqlalchemy.orm import Session
from app.core.utils import generate_uuid
from app.models.pl_models import (
PlPlan,
PlPlanContract,
PlPlanDelivery,
PlPlanDeliveryProduct,
PlPlanLoad,
PlPlanLoadProduct,
PlTransportAddress,
)
from app.schemas.pl.plan import (
PlanContractLink,
PlanDeliveryBody,
PlanDeliveryRead,
PlanLoadBody,
PlanLoadRead,
PlanStopProductBody,
PlanStopProductRead,
)
from app.services.pl_internal_customer import is_internal_customer_name
from app.services.pl_plan_stop_rules import resolve_stop_dibang_defaults, warn_qty_imbalance
from app.services.pl_plan_service import (
PLAN_CONTRACT_SIDE_DEMANDER,
PLAN_CONTRACT_SIDE_SUPPLIER,
assert_contract_selectable_for_plan,
)
PLAN_CONTRACT_SIDE_LOAD = "load"
PLAN_CONTRACT_SIDE_DELIVERY = "delivery"
def _contract_link(row: PlPlanContract) -> PlanContractLink:
return PlanContractLink(
contractId=row.contract_id,
contractNo=row.contract_no,
stopId=row.stop_id,
)
def _load_stop_product(row: PlPlanLoadProduct) -> PlanStopProductRead:
return PlanStopProductRead.model_validate(row)
def _delivery_stop_product(row: PlPlanDeliveryProduct) -> PlanStopProductRead:
return PlanStopProductRead.model_validate(row)
def load_stop_contract_rows_grouped(
db: Session,
tenant_no: str,
plan_ids: list[str],
) -> dict[str, list[PlPlanContract]]:
if not plan_ids:
return {}
rows = (
db.query(PlPlanContract)
.filter(
PlPlanContract.tenant_no == tenant_no,
PlPlanContract.plan_id.in_(plan_ids),
PlPlanContract.del_flag == 0,
)
.order_by(PlPlanContract.order_num.asc(), PlPlanContract.create_time.asc())
.all()
)
grouped: dict[str, list[PlPlanContract]] = defaultdict(list)
for row in rows:
grouped[row.plan_id].append(row)
return grouped
def _contracts_for_stop(
contract_rows: list[PlPlanContract],
stop_id: str,
legacy_sides: tuple[str, ...],
) -> list[PlanContractLink]:
by_stop = [_contract_link(r) for r in contract_rows if (r.stop_id or "") == stop_id]
if by_stop:
return by_stop
return [
_contract_link(r)
for r in contract_rows
if not (r.stop_id or "").strip() and r.side in legacy_sides
]
def _to_decimal(value) -> Optional[Decimal]:
if value is None or value == "":
return None
try:
return Decimal(str(value))
except Exception:
return None
def resolve_stop_address_from_library(
db: Session,
tenant_no: str,
address: Optional[str],
lng,
lat,
) -> Optional[str]:
"""段 address 为空时,按经纬度从运输地址库补全 full_address。"""
text = (address or "").strip()
if text:
return text
lat_d = _to_decimal(lat)
lng_d = _to_decimal(lng)
if lat_d is None and lng_d is None:
return text or None
query = db.query(PlTransportAddress).filter(
PlTransportAddress.tenant_no == tenant_no,
PlTransportAddress.del_flag == 0,
PlTransportAddress.status == "1",
)
if lat_d is not None:
query = query.filter(PlTransportAddress.lat == lat_d)
if lng_d is not None:
query = query.filter(PlTransportAddress.lng == lng_d)
rows = query.order_by(PlTransportAddress.create_time.desc()).all()
if not rows:
return text or None
if len(rows) == 1:
full = (rows[0].full_address or "").strip()
return full or None
if lng_d is not None:
for row in rows:
if row.lng == lng_d:
full = (row.full_address or "").strip()
if full:
return full
full = (rows[0].full_address or "").strip()
return full or None
def enrich_stop_addresses_from_library(
db: Session,
tenant_no: str,
load: PlanLoadBody,
deliveries: list[PlanDeliveryBody],
) -> None:
resolved_load = resolve_stop_address_from_library(
db, tenant_no, load.address, load.lng, load.lat
)
if resolved_load:
load.address = resolved_load
for delivery in deliveries:
resolved = resolve_stop_address_from_library(
db, tenant_no, delivery.address, delivery.lng, delivery.lat
)
if resolved:
delivery.address = resolved
def load_plan_stops_grouped(
db: Session,
tenant_no: str,
plan_ids: list[str],
) -> dict[str, tuple[Optional[PlanLoadRead], list[PlanDeliveryRead]]]:
"""批量读取装货段与送货段(列表/详情共用)。"""
if not plan_ids:
return {}
loads = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.plan_id.in_(plan_ids),
PlPlanLoad.del_flag == 0,
)
.all()
)
load_by_plan = {row.plan_id: row for row in loads}
load_ids = [row.id for row in loads]
load_products: dict[str, list[PlPlanLoadProduct]] = defaultdict(list)
if load_ids:
for row in (
db.query(PlPlanLoadProduct)
.filter(
PlPlanLoadProduct.tenant_no == tenant_no,
PlPlanLoadProduct.load_id.in_(load_ids),
PlPlanLoadProduct.del_flag == 0,
)
.order_by(PlPlanLoadProduct.order_num.asc(), PlPlanLoadProduct.create_time.asc())
.all()
):
load_products[row.load_id].append(row)
deliveries = (
db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.plan_id.in_(plan_ids),
PlPlanDelivery.del_flag == 0,
)
.order_by(PlPlanDelivery.seq.asc(), PlPlanDelivery.create_time.asc())
.all()
)
deliveries_by_plan: dict[str, list[PlPlanDelivery]] = defaultdict(list)
delivery_ids: list[str] = []
for row in deliveries:
deliveries_by_plan[row.plan_id].append(row)
delivery_ids.append(row.id)
delivery_products: dict[str, list[PlPlanDeliveryProduct]] = defaultdict(list)
if delivery_ids:
for row in (
db.query(PlPlanDeliveryProduct)
.filter(
PlPlanDeliveryProduct.tenant_no == tenant_no,
PlPlanDeliveryProduct.delivery_id.in_(delivery_ids),
PlPlanDeliveryProduct.del_flag == 0,
)
.order_by(PlPlanDeliveryProduct.order_num.asc(), PlPlanDeliveryProduct.create_time.asc())
.all()
):
delivery_products[row.delivery_id].append(row)
contracts_by_plan = load_stop_contract_rows_grouped(db, tenant_no, plan_ids)
result: dict[str, tuple[Optional[PlanLoadRead], list[PlanDeliveryRead]]] = {}
for plan_id in plan_ids:
contract_rows = contracts_by_plan.get(plan_id, [])
load_row = load_by_plan.get(plan_id)
load_read: Optional[PlanLoadRead] = None
if load_row:
load_read = PlanLoadRead.model_validate(load_row)
resolved_load_address = resolve_stop_address_from_library(
db,
tenant_no,
load_read.address,
load_read.lng,
load_read.lat,
)
if resolved_load_address:
load_read.address = resolved_load_address
load_read.products = [_load_stop_product(p) for p in load_products.get(load_row.id, [])]
load_read.contracts = _contracts_for_stop(
contract_rows,
load_row.id,
(PLAN_CONTRACT_SIDE_LOAD, PLAN_CONTRACT_SIDE_SUPPLIER),
)
delivery_reads: list[PlanDeliveryRead] = []
plan_deliveries = deliveries_by_plan.get(plan_id, [])
for idx, delivery_row in enumerate(plan_deliveries):
delivery_read = PlanDeliveryRead.model_validate(delivery_row)
resolved_delivery_address = resolve_stop_address_from_library(
db,
tenant_no,
delivery_read.address,
delivery_read.lng,
delivery_read.lat,
)
if resolved_delivery_address:
delivery_read.address = resolved_delivery_address
delivery_read.products = [
_delivery_stop_product(p) for p in delivery_products.get(delivery_row.id, [])
]
legacy_sides = (PLAN_CONTRACT_SIDE_DELIVERY, PLAN_CONTRACT_SIDE_DEMANDER)
# 未迁移合同仅挂到第一个送货段
if idx == 0:
delivery_read.contracts = _contracts_for_stop(
contract_rows,
delivery_row.id,
legacy_sides,
)
else:
delivery_read.contracts = _contracts_for_stop(
contract_rows,
delivery_row.id,
(PLAN_CONTRACT_SIDE_DELIVERY,),
)
delivery_reads.append(delivery_read)
result[plan_id] = (load_read, delivery_reads)
return result
def resolve_load_customer_name(
plan: PlPlan,
load: Optional[PlanLoadRead],
) -> Optional[str]:
if load and (load.customer_name or "").strip():
return load.customer_name.strip()
legacy = (plan.supplier_name or "").strip()
return legacy or None
def resolve_delivery_customer_summary(
plan: PlPlan,
deliveries: list[PlanDeliveryRead],
) -> Optional[str]:
names: list[str] = []
seen: set[str] = set()
for delivery in deliveries:
name = (delivery.customer_name or "").strip()
if name and name not in seen:
seen.add(name)
names.append(name)
if names:
if len(names) <= 2:
return "、".join(names)
return f"{names[0]}、{names[1]}等{len(names)}家"
legacy = (plan.customer_name or plan.destination_name or "").strip()
return legacy or None
def attach_plan_stops_to_item(
plan_item,
plan: PlPlan,
stops: tuple[Optional[PlanLoadRead], list[PlanDeliveryRead]],
) -> None:
load_read, delivery_reads = stops
plan_item.load = load_read
plan_item.deliveries = delivery_reads
plan_item.load_customer_name = resolve_load_customer_name(plan, load_read)
plan_item.delivery_customer_summary = resolve_delivery_customer_summary(plan, delivery_reads)
if load_read and (load_read.address or "").strip():
plan_item.pickup_address = load_read.address
if delivery_reads and (delivery_reads[0].address or "").strip():
plan_item.destination_address = delivery_reads[0].address
def uses_multi_stop_payload(load: Optional[PlanLoadBody], deliveries: Optional[list[PlanDeliveryBody]]) -> bool:
return load is not None or deliveries is not None
def _normalize_contract_links(links: Optional[list[PlanContractLink]]) -> list[PlanContractLink]:
if not links:
return []
seen: set[str] = set()
out: list[PlanContractLink] = []
for link in links:
cid = (link.contract_id or "").strip()
if not cid or cid in seen:
continue
seen.add(cid)
out.append(link)
return out
def _resolve_stop_contracts(
db: Session,
tenant_no: str,
customer_id: Optional[str],
customer_name: Optional[str],
contracts: Optional[list[PlanContractLink]],
side_label: str,
) -> list[PlanContractLink]:
if is_internal_customer_name(customer_name):
return []
links = _normalize_contract_links(contracts)
if not links:
return []
resolved: list[PlanContractLink] = []
for link in links:
contract = assert_contract_selectable_for_plan(
db,
link.contract_id,
tenant_no,
expected_customer_id=customer_id,
side_label=side_label,
)
resolved.append(
PlanContractLink(
contractId=contract.id,
contractNo=contract.contract_no or link.contract_no,
)
)
return resolved
def validate_plan_stops_write(
db: Session,
tenant_no: str,
load: Optional[PlanLoadBody],
deliveries: Optional[list[PlanDeliveryBody]],
products: Optional[list],
) -> tuple[PlanLoadBody, list[PlanDeliveryBody]]:
if load is None:
raise HTTPException(status_code=422, detail="请填写装货信息")
if not (load.customer_id or "").strip() or not (load.customer_name or "").strip():
raise HTTPException(status_code=422, detail="请选择装货客户")
if not deliveries:
raise HTTPException(status_code=422, detail="请至少添加一段送货信息")
if products is not None and not products:
raise HTTPException(status_code=422, detail="请至少保留一条产品明细")
load.contracts = _resolve_stop_contracts(
db,
tenant_no,
load.customer_id,
load.customer_name,
load.contracts,
"装货合同",
)
resolved_deliveries: list[PlanDeliveryBody] = []
for idx, delivery in enumerate(deliveries, start=1):
if not (delivery.customer_id or "").strip() or not (delivery.customer_name or "").strip():
raise HTTPException(status_code=422, detail=f"送货段#{idx}请选择客户")
delivery.contracts = _resolve_stop_contracts(
db,
tenant_no,
delivery.customer_id,
delivery.customer_name,
delivery.contracts,
f"送货段#{idx}合同",
)
resolved_deliveries.append(delivery)
enrich_stop_addresses_from_library(db, tenant_no, load, resolved_deliveries)
return load, resolved_deliveries
def collect_stop_qty_warnings(
products: Optional[list],
load: PlanLoadBody,
deliveries: list[PlanDeliveryBody],
) -> list[str]:
plan_rows = products or []
load_rows = load.products or []
delivery_rows: list[PlanStopProductBody] = []
for delivery in deliveries:
delivery_rows.extend(delivery.products or [])
return warn_qty_imbalance(plan_rows, load_rows, delivery_rows)
def sync_plan_legacy_from_stops(
plan: PlPlan,
load: PlanLoadBody,
deliveries: list[PlanDeliveryBody],
) -> None:
plan.supplier_id = load.customer_id
plan.supplier_name = load.customer_name
plan.pickup_address = load.address
plan.pickup_lng = load.lng
plan.pickup_lat = load.lat
plan.pickup_time = load.load_time
plan.pickup_contact = load.contact
plan.pickup_notes = load.notes
first = deliveries[0]
plan.customer_id = first.customer_id
plan.customer_name = first.customer_name
plan.destination_id = first.customer_id
plan.destination_name = first.customer_name
plan.destination_address = first.address
plan.destination_lng = first.lng
plan.destination_lat = first.lat
plan.delivery_time = first.delivery_time
plan.delivery_contact = first.contact
plan.destination_notes = first.notes
def _soft_delete_plan_stops(
db: Session,
tenant_no: str,
plan_id: str,
user_id: Optional[str],
) -> None:
now = datetime.now()
load_ids = [
row.id
for row in db.query(PlPlanLoad)
.filter(
PlPlanLoad.plan_id == plan_id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.all()
]
if load_ids:
db.query(PlPlanLoadProduct).filter(
PlPlanLoadProduct.load_id.in_(load_ids),
PlPlanLoadProduct.del_flag == 0,
).update({"del_flag": 1, "update_by": user_id, "update_time": now}, synchronize_session=False)
delivery_ids = [
row.id
for row in db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.plan_id == plan_id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.all()
]
if delivery_ids:
db.query(PlPlanDeliveryProduct).filter(
PlPlanDeliveryProduct.delivery_id.in_(delivery_ids),
PlPlanDeliveryProduct.del_flag == 0,
).update({"del_flag": 1, "update_by": user_id, "update_time": now}, synchronize_session=False)
db.query(PlPlanDelivery).filter(
PlPlanDelivery.plan_id == plan_id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
).update({"del_flag": 1, "update_by": user_id, "update_time": now}, synchronize_session=False)
db.query(PlPlanContract).filter(
PlPlanContract.plan_id == plan_id,
PlPlanContract.tenant_no == tenant_no,
PlPlanContract.del_flag == 0,
PlPlanContract.side.in_(
[PLAN_CONTRACT_SIDE_LOAD, PLAN_CONTRACT_SIDE_DELIVERY]
),
).update({"del_flag": 1, "update_by": user_id, "update_time": now}, synchronize_session=False)
def _write_stop_contracts(
db: Session,
tenant_no: str,
plan_id: str,
stop_id: str,
side: str,
contracts: list[PlanContractLink],
user_id: Optional[str],
dept_id: Optional[str],
order_num_start: int,
) -> int:
now = datetime.now()
order_num = order_num_start
for link in contracts:
order_num += 1
db.add(
PlPlanContract(
id=generate_uuid(),
plan_id=plan_id,
side=side,
stop_id=stop_id,
contract_id=link.contract_id,
contract_no=link.contract_no,
tenant_no=tenant_no,
order_num=order_num,
create_by=user_id,
create_dept_id=dept_id or "",
create_time=now,
update_by=user_id,
update_time=now,
del_flag=0,
)
)
return order_num
def _resolve_plan_product_id(
prod: PlanStopProductBody,
plan_products: list,
) -> str:
explicit = (prod.plan_product_id or "").strip()
if explicit:
for row in plan_products:
if row.id == explicit:
return explicit
product_id = (prod.product_id or "").strip()
if product_id:
for row in plan_products:
if (row.product_id or "").strip() == product_id:
return row.id
product_no = (prod.product_no or "").strip()
if product_no:
for row in plan_products:
if (row.product_no or "").strip() == product_no:
return row.id
raise HTTPException(
status_code=422,
detail=f"无法匹配计划产品行:{prod.product_name or explicit or product_id}",
)
def _resolve_or_create_plan_load(
db: Session,
tenant_no: str,
plan_id: str,
load: PlanLoadBody,
user_id: Optional[str],
dept_id: Optional[str],
now: datetime,
) -> str:
"""装货段与 plan 1:1;uk_pl_plan_load_plan 仅按 plan_id 唯一,软删后不可再 INSERT,须原地更新。"""
default_gen, default_dir = resolve_stop_dibang_defaults(load.customer_name, "load")
generate_dibang = load.generate_dibang if load.generate_dibang else (1 if default_gen else 0)
dibang_direction = (load.dibang_direction or default_dir or "none").strip() or "none"
existing = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.plan_id == plan_id,
PlPlanLoad.tenant_no == tenant_no,
)
.order_by(PlPlanLoad.del_flag.asc(), PlPlanLoad.update_time.desc())
.first()
)
if existing:
existing.customer_id = load.customer_id
existing.customer_name = load.customer_name
existing.address = load.address
existing.lng = load.lng
existing.lat = load.lat
existing.load_time = load.load_time
existing.contact = load.contact
existing.notes = load.notes
existing.generate_dibang = generate_dibang
existing.dibang_direction = dibang_direction
existing.remark = load.remark
existing.del_flag = 0
existing.update_by = user_id
existing.update_time = now
return existing.id
load_id = generate_uuid()
db.add(
PlPlanLoad(
id=load_id,
plan_id=plan_id,
customer_id=load.customer_id,
customer_name=load.customer_name,
address=load.address,
lng=load.lng,
lat=load.lat,
load_time=load.load_time,
contact=load.contact,
notes=load.notes,
generate_dibang=generate_dibang,
dibang_direction=dibang_direction,
tenant_no=tenant_no,
remark=load.remark,
create_by=user_id,
create_dept_id=dept_id or "",
create_time=now,
update_by=user_id,
update_time=now,
del_flag=0,
)
)
return load_id
def replace_plan_stops(
db: Session,
tenant_no: str,
plan_id: str,
load: PlanLoadBody,
deliveries: list[PlanDeliveryBody],
user_id: Optional[str],
dept_id: Optional[str],
plan_products: Optional[list] = None,
) -> None:
_soft_delete_plan_stops(db, tenant_no, plan_id, user_id)
now = datetime.now()
load_id = _resolve_or_create_plan_load(
db,
tenant_no,
plan_id,
load,
user_id,
dept_id,
now,
)
plan_product_rows = plan_products or []
for idx, prod in enumerate(load.products or []):
plan_product_id = _resolve_plan_product_id(prod, plan_product_rows)
db.add(
PlPlanLoadProduct(
id=generate_uuid(),
load_id=load_id,
plan_id=plan_id,
plan_product_id=plan_product_id,
product_id=prod.product_id,
product_no=prod.product_no,
product_name=prod.product_name,
model=prod.model,
unit=prod.unit or "吨",
package_spec=prod.package_spec,
delivery_method=prod.delivery_method,
plan_qty=prod.plan_qty,
tenant_no=tenant_no,
order_num=idx,
remark=prod.remark,
create_by=user_id,
create_dept_id=dept_id or "",
create_time=now,
update_by=user_id,
update_time=now,
del_flag=0,
)
)
contract_order = 0
contract_order = _write_stop_contracts(
db,
tenant_no,
plan_id,
load_id,
PLAN_CONTRACT_SIDE_LOAD,
load.contracts or [],
user_id,
dept_id,
contract_order,
)
for delivery in deliveries:
default_gen, default_dir = resolve_stop_dibang_defaults(load.customer_name, "delivery")
generate_dibang = delivery.generate_dibang if delivery.generate_dibang else (1 if default_gen else 0)
dibang_direction = (delivery.dibang_direction or default_dir or "none").strip() or "none"
delivery_id = generate_uuid()
db.add(
PlPlanDelivery(
id=delivery_id,
plan_id=plan_id,
seq=delivery.seq or 1,
customer_id=delivery.customer_id,
customer_name=delivery.customer_name,
address=delivery.address,
lng=delivery.lng,
lat=delivery.lat,
delivery_time=delivery.delivery_time,
contact=delivery.contact,
notes=delivery.notes,
generate_dibang=generate_dibang,
dibang_direction=dibang_direction,
tenant_no=tenant_no,
remark=delivery.remark,
create_by=user_id,
create_dept_id=dept_id or "",
create_time=now,
update_by=user_id,
update_time=now,
del_flag=0,
)
)
for idx, prod in enumerate(delivery.products or []):
plan_product_id = _resolve_plan_product_id(prod, plan_product_rows)
db.add(
PlPlanDeliveryProduct(
id=generate_uuid(),
delivery_id=delivery_id,
plan_id=plan_id,
plan_product_id=plan_product_id,
product_id=prod.product_id,
product_no=prod.product_no,
product_name=prod.product_name,
model=prod.model,
unit=prod.unit or "吨",
package_spec=prod.package_spec,
delivery_method=prod.delivery_method,
plan_qty=prod.plan_qty,
tenant_no=tenant_no,
order_num=idx,
remark=prod.remark,
create_by=user_id,
create_dept_id=dept_id or "",
create_time=now,
update_by=user_id,
update_time=now,
del_flag=0,
)
)
contract_order = _write_stop_contracts(
db,
tenant_no,
plan_id,
delivery_id,
PLAN_CONTRACT_SIDE_DELIVERY,
delivery.contracts or [],
user_id,
dept_id,
contract_order,
)
@@ -0,0 +1,883 @@
"""运输计划 · 司机/现场按段回传"""
from __future__ import annotations
import json
from dataclasses import dataclass, field
from datetime import datetime
from decimal import Decimal
from typing import Any, Literal, Optional
from sqlalchemy.orm import Session
from app.core.config import settings
from app.core.utils import generate_uuid
from app.models.pl_models import (
PlPlanDelivery,
PlPlanDeliveryProduct,
PlPlanLoad,
PlPlanLoadProduct,
PlTransport,
PlTransportDriverStopFeedback,
PlTransportSiteStopFeedback,
)
from app.services.pl_internal_customer import is_internal_customer_name
StopType = Literal["load", "delivery"]
@dataclass
class PublicStopProductRow:
stop_product_id: str
plan_product_id: str
product_id: str
product_name: str
model: Optional[str]
unit: str
package_spec: Optional[str]
delivery_method: Optional[str]
plan_qty: Optional[Decimal]
remark: Optional[str]
actual_qty: Optional[Decimal] = None
brand_qtys: Optional[list[dict[str, Any]]] = None
@dataclass
class PublicStopSegment:
stop_type: StopType
stop_id: str
seq: int
label: str
customer_name: str
address: Optional[str]
contact: Optional[str]
notes: Optional[str]
business_type: Optional[str]
plan_qty: Optional[Decimal]
attachment_urls: list[str]
remark: Optional[str]
feedback_time: Optional[datetime]
lng: Optional[Decimal] = None
lat: Optional[Decimal] = None
quantity: Optional[Decimal] = None
products: list[PublicStopProductRow] = field(default_factory=list)
def build_transport_site_url(token: str) -> str:
origin = (settings.PUBLIC_WEB_ORIGIN or "").rstrip("/")
return f"{origin}/#/public/pl/transport-site/{token}"
def ensure_transport_site_token(transport: PlTransport) -> str:
token = (transport.site_access_token or "").strip()
if not token:
token = generate_uuid().replace("-", "")[:32]
transport.site_access_token = token
return token
def rotate_transport_site_token(transport: PlTransport) -> str:
token = generate_uuid().replace("-", "")[:32]
transport.site_access_token = token
return token
def _parse_urls(raw: Optional[str]) -> list[str]:
if not raw:
return []
try:
parsed = json.loads(raw)
if isinstance(parsed, list):
return [str(item).strip() for item in parsed if str(item).strip()]
except (TypeError, json.JSONDecodeError):
pass
return [part.strip() for part in raw.split(",") if part.strip()]
def _dump_urls(urls: Optional[list[str]]) -> Optional[str]:
if urls is None:
return None
cleaned = [str(item).strip() for item in urls if str(item).strip()]
return json.dumps(cleaned, ensure_ascii=False)
def _direction_label(direction: Optional[str]) -> Optional[str]:
normalized = (direction or "").strip()
if normalized == "outbound":
return "出库"
if normalized == "inbound":
return "入库"
return None
def _sum_stop_qty(products: list[Any]) -> Optional[Decimal]:
total = Decimal("0")
has_qty = False
for row in products:
qty = getattr(row, "plan_qty", None)
if qty is not None:
total += Decimal(str(qty))
has_qty = True
return total if has_qty else None
def _stop_product_row_from_load(row: PlPlanLoadProduct) -> PublicStopProductRow:
return PublicStopProductRow(
stop_product_id=row.id,
plan_product_id=row.plan_product_id,
product_id=row.product_id,
product_name=row.product_name or "",
model=row.model,
unit=(row.unit or "吨").strip() or "吨",
package_spec=row.package_spec,
delivery_method=row.delivery_method,
plan_qty=row.plan_qty,
remark=(row.remark or "").strip() or None,
)
def _stop_product_row_from_delivery(row: PlPlanDeliveryProduct) -> PublicStopProductRow:
return PublicStopProductRow(
stop_product_id=row.id,
plan_product_id=row.plan_product_id,
product_id=row.product_id,
product_name=row.product_name or "",
model=row.model,
unit=(row.unit or "吨").strip() or "吨",
package_spec=row.package_spec,
delivery_method=row.delivery_method,
plan_qty=row.plan_qty,
remark=(row.remark or "").strip() or None,
)
def _parse_product_feedbacks(raw: Optional[str]) -> dict[str, dict[str, Any]]:
if not raw:
return {}
try:
parsed = json.loads(raw)
except (TypeError, json.JSONDecodeError):
return {}
if not isinstance(parsed, list):
return {}
result: dict[str, dict[str, Any]] = {}
for item in parsed:
if not isinstance(item, dict):
continue
stop_product_id = str(
item.get("stopProductId") or item.get("stop_product_id") or ""
).strip()
if not stop_product_id:
continue
result[stop_product_id] = item
return result
def _dump_product_feedbacks(products: Optional[list[dict[str, Any]]]) -> Optional[str]:
if products is None:
return None
cleaned: list[dict[str, Any]] = []
for item in products:
stop_product_id = str(
item.get("stopProductId") or item.get("stop_product_id") or ""
).strip()
if not stop_product_id:
continue
actual_qty = item.get("actualQty", item.get("actual_qty"))
row: dict[str, Any] = {
"stopProductId": stop_product_id,
"actualQty": float(Decimal(str(actual_qty or 0))),
}
brand_qtys = item.get("brandQtys") or item.get("brand_qtys")
if brand_qtys:
row["brandQtys"] = brand_qtys
cleaned.append(row)
return json.dumps(cleaned, ensure_ascii=False)
def _merge_product_feedbacks_into_segment(
segment: PublicStopSegment,
feedback_map: dict[str, dict[str, Any]],
) -> None:
if not feedback_map or not segment.products:
return
for product in segment.products:
item = feedback_map.get(product.stop_product_id)
if not item:
continue
actual = item.get("actualQty", item.get("actual_qty"))
if actual is not None:
product.actual_qty = Decimal(str(actual))
brand_qtys = item.get("brandQtys") or item.get("brand_qtys")
if brand_qtys:
product.brand_qtys = brand_qtys if isinstance(brand_qtys, list) else None
def _is_site_visible_stop(customer_name: Optional[str], generate_dibang: int) -> bool:
return is_internal_customer_name(customer_name) and int(generate_dibang or 0) == 1
def list_plan_stop_segments(
db: Session,
*,
tenant_no: str,
plan_id: str,
include_all_for_driver: bool = True,
site_internal_only: bool = False,
) -> list[PublicStopSegment]:
segments: list[PublicStopSegment] = []
load = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.plan_id == plan_id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
if load:
products = (
db.query(PlPlanLoadProduct)
.filter(
PlPlanLoadProduct.load_id == load.id,
PlPlanLoadProduct.tenant_no == tenant_no,
PlPlanLoadProduct.del_flag == 0,
)
.all()
)
if include_all_for_driver or (
site_internal_only and _is_site_visible_stop(load.customer_name, load.generate_dibang)
):
stop_products = [
_stop_product_row_from_load(row)
for row in sorted(
products,
key=lambda item: (item.order_num or 0, item.create_time or datetime.min),
)
]
segments.append(
PublicStopSegment(
stop_type="load",
stop_id=load.id,
seq=0,
label="装货",
customer_name=(load.customer_name or "").strip(),
address=load.address,
contact=load.contact,
notes=load.notes,
lng=load.lng,
lat=load.lat,
business_type=_direction_label(load.dibang_direction),
plan_qty=_sum_stop_qty(products),
attachment_urls=[],
remark=None,
feedback_time=None,
products=stop_products,
)
)
deliveries = (
db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.plan_id == plan_id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.order_by(PlPlanDelivery.seq.asc(), PlPlanDelivery.create_time.asc())
.all()
)
for delivery in deliveries:
products = (
db.query(PlPlanDeliveryProduct)
.filter(
PlPlanDeliveryProduct.delivery_id == delivery.id,
PlPlanDeliveryProduct.tenant_no == tenant_no,
PlPlanDeliveryProduct.del_flag == 0,
)
.all()
)
if include_all_for_driver or (
site_internal_only
and _is_site_visible_stop(delivery.customer_name, delivery.generate_dibang)
):
stop_products = [
_stop_product_row_from_delivery(row)
for row in sorted(
products,
key=lambda item: (item.order_num or 0, item.create_time or datetime.min),
)
]
segments.append(
PublicStopSegment(
stop_type="delivery",
stop_id=delivery.id,
seq=int(delivery.seq or 0),
label=f"送货 #{delivery.seq or len(segments)}",
customer_name=(delivery.customer_name or "").strip(),
address=delivery.address,
contact=delivery.contact,
notes=delivery.notes,
lng=delivery.lng,
lat=delivery.lat,
business_type=_direction_label(delivery.dibang_direction),
plan_qty=_sum_stop_qty(products),
attachment_urls=[],
remark=None,
feedback_time=None,
products=stop_products,
)
)
return segments
def _merge_driver_feedback(
segments: list[PublicStopSegment],
feedback_rows: list[PlTransportDriverStopFeedback],
) -> None:
feedback_map = {(row.stop_type, row.stop_id): row for row in feedback_rows}
for segment in segments:
row = feedback_map.get((segment.stop_type, segment.stop_id))
if not row:
continue
segment.attachment_urls = _parse_urls(row.attachment_urls)
segment.remark = row.remark
segment.feedback_time = row.feedback_time
_merge_product_feedbacks_into_segment(
segment,
_parse_product_feedbacks(row.product_feedbacks),
)
def _merge_site_feedback(
segments: list[PublicStopSegment],
feedback_rows: list[PlTransportSiteStopFeedback],
) -> None:
feedback_map = {(row.stop_type, row.stop_id): row for row in feedback_rows}
for segment in segments:
row = feedback_map.get((segment.stop_type, segment.stop_id))
if not row:
continue
segment.quantity = row.quantity
segment.attachment_urls = _parse_urls(row.attachment_urls)
segment.remark = row.remark
segment.feedback_time = row.feedback_time
if row.business_type:
segment.business_type = row.business_type
_merge_product_feedbacks_into_segment(
segment,
_parse_product_feedbacks(row.product_feedbacks),
)
def load_driver_stop_segments(
db: Session,
*,
tenant_no: str,
plan_id: str,
transport_id: str,
) -> list[PublicStopSegment]:
segments = list_plan_stop_segments(
db,
tenant_no=tenant_no,
plan_id=plan_id,
include_all_for_driver=True,
site_internal_only=False,
)
rows = (
db.query(PlTransportDriverStopFeedback)
.filter(
PlTransportDriverStopFeedback.transport_id == transport_id,
PlTransportDriverStopFeedback.tenant_no == tenant_no,
PlTransportDriverStopFeedback.del_flag == 0,
)
.all()
)
_merge_driver_feedback(segments, rows)
return segments
def _load_site_stop_feedback_rows(
db: Session,
*,
tenant_no: str,
transport_id: str,
) -> list[PlTransportSiteStopFeedback]:
return (
db.query(PlTransportSiteStopFeedback)
.filter(
PlTransportSiteStopFeedback.transport_id == transport_id,
PlTransportSiteStopFeedback.tenant_no == tenant_no,
PlTransportSiteStopFeedback.del_flag == 0,
)
.all()
)
def load_site_stop_segments(
db: Session,
*,
tenant_no: str,
plan_id: str,
transport_id: str,
) -> list[PublicStopSegment]:
segments = list_plan_stop_segments(
db,
tenant_no=tenant_no,
plan_id=plan_id,
include_all_for_driver=False,
site_internal_only=True,
)
_merge_site_feedback(segments, _load_site_stop_feedback_rows(db, tenant_no=tenant_no, transport_id=transport_id))
return segments
def load_io_order_site_stop_segments(
db: Session,
*,
tenant_no: str,
plan_id: str,
transport_id: str,
) -> list[PublicStopSegment]:
"""入库/出库单现场页:展示全部装货/送货段及段内产品。"""
segments = list_plan_stop_segments(
db,
tenant_no=tenant_no,
plan_id=plan_id,
include_all_for_driver=True,
site_internal_only=False,
)
_merge_site_feedback(segments, _load_site_stop_feedback_rows(db, tenant_no=tenant_no, transport_id=transport_id))
return segments
def _get_driver_feedback_row(
db: Session,
*,
tenant_no: str,
transport_id: str,
stop_type: str,
stop_id: str,
) -> Optional[PlTransportDriverStopFeedback]:
return (
db.query(PlTransportDriverStopFeedback)
.filter(
PlTransportDriverStopFeedback.transport_id == transport_id,
PlTransportDriverStopFeedback.tenant_no == tenant_no,
PlTransportDriverStopFeedback.stop_type == stop_type,
PlTransportDriverStopFeedback.stop_id == stop_id,
PlTransportDriverStopFeedback.del_flag == 0,
)
.first()
)
def save_driver_stop_feedback(
db: Session,
*,
tenant_no: str,
transport_id: str,
plan_id: str,
stop_type: str,
stop_id: str,
attachment_urls: list[str],
products: Optional[list[dict[str, Any]]] = None,
remark: Optional[str] = None,
user_id: Optional[str] = None,
dept_id: str = "",
) -> PlTransportDriverStopFeedback:
row = _get_driver_feedback_row(
db,
tenant_no=tenant_no,
transport_id=transport_id,
stop_type=stop_type,
stop_id=stop_id,
)
now = datetime.now()
product_feedbacks_dump = _dump_product_feedbacks(products)
if row:
row.attachment_urls = _dump_urls(attachment_urls)
if product_feedbacks_dump is not None:
row.product_feedbacks = product_feedbacks_dump
if remark is not None:
row.remark = remark
row.feedback_time = now
row.update_by = user_id
else:
row = PlTransportDriverStopFeedback(
id=generate_uuid(),
tenant_no=tenant_no,
transport_id=transport_id,
plan_id=plan_id,
stop_type=stop_type,
stop_id=stop_id,
attachment_urls=_dump_urls(attachment_urls),
product_feedbacks=product_feedbacks_dump,
remark=remark,
feedback_time=now,
create_by=user_id,
create_dept_id=dept_id,
)
db.add(row)
db.flush()
return row
def _get_site_feedback_row(
db: Session,
*,
tenant_no: str,
transport_id: str,
stop_type: str,
stop_id: str,
) -> Optional[PlTransportSiteStopFeedback]:
return (
db.query(PlTransportSiteStopFeedback)
.filter(
PlTransportSiteStopFeedback.transport_id == transport_id,
PlTransportSiteStopFeedback.tenant_no == tenant_no,
PlTransportSiteStopFeedback.stop_type == stop_type,
PlTransportSiteStopFeedback.stop_id == stop_id,
PlTransportSiteStopFeedback.del_flag == 0,
)
.first()
)
def _sum_product_actual_qty(products: Optional[list[dict[str, Any]]]) -> Optional[Decimal]:
if not products:
return None
total = Decimal("0")
has_qty = False
for item in products:
actual = item.get("actualQty", item.get("actual_qty"))
if actual is None:
continue
qty = Decimal(str(actual))
if qty > 0:
total += qty
has_qty = True
return total if has_qty else None
def _has_positive_feedback_qty(
quantity: Optional[Decimal],
products: Optional[list[dict[str, Any]]],
) -> bool:
product_total = _sum_product_actual_qty(products)
if product_total is not None:
return product_total > 0
return quantity is not None and quantity > 0
def save_site_stop_feedback(
db: Session,
*,
tenant_no: str,
transport_id: str,
plan_id: str,
stop_type: str,
stop_id: str,
business_type: str,
quantity: Optional[Decimal] = None,
attachment_urls: Optional[list[str]] = None,
products: Optional[list[dict[str, Any]]] = None,
remark: Optional[str] = None,
user_id: Optional[str] = None,
dept_id: str = "",
require_qty_before_attachments: bool = True,
) -> PlTransportSiteStopFeedback:
product_feedbacks_dump = _dump_product_feedbacks(products)
effective_qty = quantity
if products is not None:
effective_qty = _sum_product_actual_qty(products)
if require_qty_before_attachments and attachment_urls and not _has_positive_feedback_qty(
effective_qty, products
):
raise ValueError("请先填写数量,再上传附件")
row = _get_site_feedback_row(
db,
tenant_no=tenant_no,
transport_id=transport_id,
stop_type=stop_type,
stop_id=stop_id,
)
now = datetime.now()
if row:
if effective_qty is not None:
row.quantity = effective_qty
if attachment_urls is not None:
row.attachment_urls = _dump_urls(attachment_urls)
if product_feedbacks_dump is not None:
row.product_feedbacks = product_feedbacks_dump
if remark is not None:
row.remark = remark
row.feedback_time = now
row.update_by = user_id
else:
row = PlTransportSiteStopFeedback(
id=generate_uuid(),
tenant_no=tenant_no,
transport_id=transport_id,
plan_id=plan_id,
stop_type=stop_type,
stop_id=stop_id,
business_type=business_type,
quantity=effective_qty,
attachment_urls=_dump_urls(attachment_urls or []),
product_feedbacks=product_feedbacks_dump,
remark=remark,
feedback_time=now,
create_by=user_id,
create_dept_id=dept_id,
)
db.add(row)
db.flush()
return row
def list_driver_stop_feedback_reads(
db: Session,
*,
tenant_no: str,
transport_id: str,
plan_id: str,
) -> list[dict[str, Any]]:
segments = load_driver_stop_segments(
db,
tenant_no=tenant_no,
plan_id=plan_id,
transport_id=transport_id,
)
return [
{
"stopType": segment.stop_type,
"stopId": segment.stop_id,
"label": segment.label,
"customerName": segment.customer_name,
"attachmentUrls": segment.attachment_urls,
"products": [
{
"stopProductId": product.stop_product_id,
"planProductId": product.plan_product_id,
"productName": product.product_name,
"model": product.model,
"unit": product.unit,
"packageSpec": product.package_spec,
"quantity": float(product.plan_qty) if product.plan_qty is not None else None,
"actualQty": float(product.actual_qty)
if product.actual_qty is not None
else None,
"brandQtys": product.brand_qtys,
}
for product in segment.products
if product.actual_qty is not None
or (product.brand_qtys and len(product.brand_qtys) > 0)
],
"remark": segment.remark,
"feedbackTime": segment.feedback_time,
}
for segment in segments
if segment.attachment_urls
or segment.remark
or segment.feedback_time
or any(
product.actual_qty is not None
or (product.brand_qtys and len(product.brand_qtys) > 0)
for product in segment.products
)
]
def list_site_stop_feedback_reads(
db: Session,
*,
tenant_no: str,
transport_id: str,
plan_id: str,
) -> list[dict[str, Any]]:
segments = load_site_stop_segments(
db,
tenant_no=tenant_no,
plan_id=plan_id,
transport_id=transport_id,
)
return [
{
"stopType": segment.stop_type,
"stopId": segment.stop_id,
"label": segment.label,
"customerName": segment.customer_name,
"businessType": segment.business_type,
"quantity": float(segment.quantity) if segment.quantity is not None else None,
"attachmentUrls": segment.attachment_urls,
"products": [
{
"stopProductId": product.stop_product_id,
"planProductId": product.plan_product_id,
"productName": product.product_name,
"model": product.model,
"unit": product.unit,
"packageSpec": product.package_spec,
"quantity": float(product.plan_qty) if product.plan_qty is not None else None,
"actualQty": float(product.actual_qty)
if product.actual_qty is not None
else None,
"brandQtys": product.brand_qtys,
}
for product in segment.products
if product.actual_qty is not None
or (product.brand_qtys and len(product.brand_qtys) > 0)
],
"remark": segment.remark,
"feedbackTime": segment.feedback_time,
}
for segment in segments
if segment.quantity is not None
or segment.attachment_urls
or segment.remark
or any(
product.actual_qty is not None
or (product.brand_qtys and len(product.brand_qtys) > 0)
for product in segment.products
)
]
CRM_PRODUCT_UNIT = "crm_product_unit"
def _resolve_unit_label(unit_map: dict[str, str], unit_code: Optional[str]) -> str:
code = (unit_code or "").strip()
if not code:
return "吨"
return unit_map.get(code, code)
def build_public_stop_reads_for_segments(
db: Session,
*,
tenant_no: str,
plan_id: str,
segments: list[PublicStopSegment],
) -> list[dict[str, Any]]:
"""为公共页组装装货/送货段及段内产品(含别名、品牌选项)。"""
from app.models.crm_models import CrmProductBrand
from app.models.pl_models import PlPlanProduct
from app.schemas.pl.transport import BrandOption, PublicTransportStopProductRead, PublicTransportStopRead
from app.services.pl_product_display import load_crm_product_alias_maps, resolve_product_display_names
from app.utils.excel_export import load_dict_label_maps
plan_products = (
db.query(PlPlanProduct)
.filter(
PlPlanProduct.plan_id == plan_id,
PlPlanProduct.tenant_no == tenant_no,
PlPlanProduct.del_flag == 0,
)
.order_by(PlPlanProduct.order_num.asc(), PlPlanProduct.create_time.asc())
.all()
)
plan_products_by_id = {row.id: row for row in plan_products}
crm_product_ids = {
(row.product_id or "").strip() for row in plan_products if (row.product_id or "").strip()
}
brand_options_by_product: dict[str, list[BrandOption]] = {}
if crm_product_ids:
brand_rows = (
db.query(CrmProductBrand)
.filter(
CrmProductBrand.product_id.in_(list(crm_product_ids)),
CrmProductBrand.tenant_no == tenant_no,
CrmProductBrand.status == "on",
CrmProductBrand.del_flag == 0,
)
.order_by(CrmProductBrand.order_num.asc(), CrmProductBrand.create_time.asc())
.all()
)
for row in brand_rows:
brand_options_by_product.setdefault(row.product_id, []).append(
BrandOption(brand_id=row.id, brand_name=row.brand_name or "")
)
standard_by_id, alias_options_by_id = load_crm_product_alias_maps(
db, tenant_no=tenant_no, product_ids=crm_product_ids
)
unit_map = load_dict_label_maps(db, [CRM_PRODUCT_UNIT], tenant_no=tenant_no).get(
CRM_PRODUCT_UNIT, {}
)
reads: list[PublicTransportStopRead] = []
for segment in segments:
show_product_qty = is_internal_customer_name(segment.customer_name)
product_reads: list[PublicTransportStopProductRead] = []
if show_product_qty:
for row in segment.products:
plan_prod = plan_products_by_id.get(row.plan_product_id)
product_id = (
row.product_id or (plan_prod.product_id if plan_prod else "") or ""
).strip()
display_name, alias_name = resolve_product_display_names(
saved_product_name=row.product_name,
product_id=product_id,
standard_by_id=standard_by_id,
alias_options_by_id=alias_options_by_id,
)
brand_qtys = None
if row.brand_qtys:
from app.schemas.pl.transport import BrandQtyItem
brand_qtys = [
BrandQtyItem(
brand_id=str(item.get("brandId") or item.get("brand_id") or ""),
brand_name=item.get("brandName") or item.get("brand_name"),
qty=item.get("qty") or 0,
)
for item in row.brand_qtys
if isinstance(item, dict)
] or None
product_reads.append(
PublicTransportStopProductRead(
stop_product_id=row.stop_product_id,
plan_product_id=row.plan_product_id,
product_name=display_name,
alias_name=alias_name,
model=row.model,
package_spec=row.package_spec,
unit=_resolve_unit_label(unit_map, row.unit),
quantity=row.plan_qty,
remark=row.remark,
brand_mode=plan_prod.brand_mode if plan_prod else None,
brand_id=plan_prod.brand_id if plan_prod else None,
brand_name=plan_prod.brand_name if plan_prod else None,
brand_options=brand_options_by_product.get(product_id) or None,
actual_qty=row.actual_qty,
brand_qtys=brand_qtys,
)
)
reads.append(
PublicTransportStopRead(
stop_type=segment.stop_type,
stop_id=segment.stop_id,
seq=segment.seq,
label=segment.label,
customer_name=segment.customer_name,
address=segment.address,
contact=segment.contact,
notes=segment.notes,
lng=segment.lng,
lat=segment.lat,
business_type=segment.business_type,
plan_qty=segment.plan_qty,
quantity=segment.quantity,
show_product_qty=show_product_qty,
products=product_reads,
attachment_urls=segment.attachment_urls,
remark=segment.remark,
feedback_time=segment.feedback_time,
)
)
return [row.model_dump(by_alias=True) for row in reads]
+35 -31
View File
@@ -81,7 +81,7 @@
"79": "PlCarrier",
"80": "resolve_crm_product",
"81": "customer_follow.py",
"82": "storage.py",
"82": "list_duty_staff_users",
"83": "Community 83",
"84": "Community 84",
"85": "allocate_next_biz_no",
@@ -90,7 +90,7 @@
"88": "CrmProduct",
"89": "pl_ocr_service.py",
"90": "WechatMessageService",
"91": "opportunity_product.py",
"91": "unsettled_plans_q_filter",
"92": "Community 92",
"93": "api_request_log_middleware.py",
"94": "assert_contract_editable_for_update",
@@ -108,53 +108,57 @@
"106": "site.py",
"107": "apply_pl_scope",
"108": "statistics.py",
"109": "duty.py",
"110": "list_duty_staff_users",
"111": "dict_data.py",
"109": "test_pl_plan_stop_rules.py",
"110": "monitor.py",
"111": "run_auto_generate_monthly_plans",
"112": "merge_duplicate_crm_customers.py",
"113": "dict_type.py",
"114": "mappers.py",
"114": "dept.py",
"115": "site.py",
"116": "Community 116",
"117": "price_letter_detail",
"117": "pl_plan_list_attachments.py",
"118": "Community 118",
"119": "Community 119",
"120": "oper_log_decorator.py",
"121": "post.py",
"122": "site.py",
"121": "customer_follow.py",
"122": "post.py",
"123": "customer_options",
"124": "vehicle_recharge.py",
"125": "resolve_crm_product",
"126": "customer_pool.py",
"127": "get_current_user_by_token",
"128": "product_allowed",
"124": "LocalStorage",
"125": "ethnic.py",
"126": "oper_log.py",
"127": "Any",
"128": "api_crypto.py",
"129": "BaseStorage",
"130": "invoice_info.py",
"131": "customer_follow.py",
"132": "context.py",
"130": "_filter_export_rows_by_ids",
"131": "resolve_crm_product",
"132": "list_products",
"133": "inventory_id.py",
"134": "price_letter_detail",
"135": "storage.py",
"136": "Community 136",
"137": "plan_has_incomplete_hazard_cert_exists",
"134": "list_contacts",
"135": "customer.py",
"136": "get_db_current_user_optional",
"137": "iter_user_menu_perm_codes",
"138": "Community 138",
"139": "get_current_user_by_token",
"140": "UserRole",
"141": "redis_client.py",
"142": "opportunity_export",
"143": "_build_user_info_payload",
"144": "config.py",
"145": "resolve_crm_product",
"146": "list_public_vehicle_plates",
"141": "customer_follow.py",
"142": "clear_pl_plan_instance_data.py",
"143": "calc_age_from_chinese_id_card",
"144": "response.py",
"145": "duty_schedule.py",
"146": "duty.py",
"147": "Community 147",
"148": "_UserCRUDCompat",
"149": "datetime_parse.py",
"148": "unsettled_plans_q_filter",
"149": "list_product_options",
"150": "get_db_current_user_optional",
"151": "Community 151",
"159": "customer_update",
"152": "customer_options",
"153": "pl_feedback_brand_qty.py",
"154": "LocalStorage",
"155": "WechatMessageService",
"156": "_map_role_name_to_web",
"162": ".to_tenant_user_dict",
"164": "get_client_ip",
"166": "code:block1 (/iflytek/shanxia2.0/backend)",
"170": "test_quote_approver_setting.py",
"173": "resolve_create_time_bounds",
"179": "test_pl_vehicle_personnel_photo_schema.py",
"206": "crm_quote_pdf.py",
@@ -0,0 +1,175 @@
{
"0": "Community 0",
"1": "Community 1",
"2": "Community 2",
"3": "Community 3",
"4": "Community 4",
"5": "Community 5",
"6": "Community 6",
"7": "Community 7",
"8": "Community 8",
"9": "Community 9",
"10": "Community 10",
"11": "Community 11",
"12": "Community 12",
"13": "Community 13",
"14": "Community 14",
"15": "Community 15",
"16": "Community 16",
"17": "Community 17",
"18": "Community 18",
"19": "Community 19",
"20": "Community 20",
"21": "Community 21",
"22": "Community 22",
"23": "Community 23",
"24": "Community 24",
"25": "Community 25",
"26": "Community 26",
"27": "Community 27",
"28": "Community 28",
"29": "Community 29",
"30": "Community 30",
"31": "Community 31",
"32": "Community 32",
"33": "Community 33",
"34": "Community 34",
"35": "Community 35",
"36": "Community 36",
"37": "Community 37",
"38": "Community 38",
"39": "Community 39",
"40": "Community 40",
"41": "Community 41",
"42": "Community 42",
"43": "Community 43",
"44": "Community 44",
"45": "Community 45",
"46": "Community 46",
"47": "Community 47",
"48": "Community 48",
"49": "Community 49",
"50": "Community 50",
"51": "Community 51",
"52": "Community 52",
"53": "Community 53",
"54": "Community 54",
"55": "Community 55",
"56": "Community 56",
"57": "Community 57",
"58": "Community 58",
"59": "Community 59",
"60": "Community 60",
"61": "Community 61",
"62": "Community 62",
"63": "Community 63",
"64": "Community 64",
"65": "Community 65",
"66": "Community 66",
"67": "Community 67",
"68": "Community 68",
"69": "Community 69",
"70": "Community 70",
"71": "Community 71",
"72": "Community 72",
"73": "Community 73",
"74": "Community 74",
"75": "apply_crm_create_by_scope",
"76": "opportunity_follow.py",
"77": "Community 77",
"78": "Community 78",
"79": "PlCarrier",
"80": "resolve_crm_product",
"81": "customer_follow.py",
"83": "Community 83",
"84": "Community 84",
"85": "allocate_next_biz_no",
"86": "Community 86",
"87": "Community 87",
"88": "CrmProduct",
"89": "pl_ocr_service.py",
"90": "WechatMessageService",
"92": "Community 92",
"93": "api_request_log_middleware.py",
"94": "assert_contract_editable_for_update",
"95": "test_pl_public_link_archived.py",
"96": "minio_url.py",
"97": "contact.py",
"98": "LocalStorage",
"99": "redis_client.py",
"100": "price_letter_detail",
"101": "tenant.py",
"102": "BaseStorage",
"103": "pl_internal_customer.py",
"104": "apply_crm_create_by_scope",
"105": "pool_customer_assign",
"106": "site.py",
"107": "apply_pl_scope",
"108": "statistics.py",
"109": "test_pl_plan_stop_rules.py",
"110": "list_duty_staff_users",
"112": "merge_duplicate_crm_customers.py",
"113": "dict_type.py",
"114": "crm_models.py",
"115": "site.py",
"116": "Community 116",
"117": "parse_hhmm",
"118": "Community 118",
"119": "Community 119",
"120": "oper_log_decorator.py",
"121": "post.py",
"122": "site.py",
"123": "customer_options",
"124": "LocalStorage",
"125": "ethnic.py",
"128": "product_allowed",
"129": "BaseStorage",
"130": "_filter_export_rows_by_ids",
"131": "resolve_crm_product",
"132": "context.py",
"133": "inventory_id.py",
"134": "list_contacts",
"136": "Community 136",
"137": "get_db_current_user_optional",
"138": "Community 138",
"139": "get_current_user_by_token",
"140": "UserRole",
"144": "admin_request_json.py",
"146": ".to_list_kwargs",
"147": "Community 147",
"151": "Community 151",
"152": "customer_options",
"162": ".to_tenant_user_dict",
"164": "get_client_ip",
"166": "code:block1 (/iflytek/shanxia2.0/backend)",
"173": "resolve_create_time_bounds",
"179": "test_pl_vehicle_personnel_photo_schema.py",
"206": "crm_quote_pdf.py",
"207": "shanxia2.0 后端骨架(FastAPI)",
"220": "api_crypto_middleware.py",
"237": "order_status_compat.py",
"239": "shanxia2.0 Backend 生产部署说明",
"246": "db_collation.py",
"254": "Activate.ps1",
"263": "__init__.py",
"264": "__init__.py",
"304": "__init__.py",
"305": "__init__.py",
"306": "__init__.py",
"307": "__init__.py",
"308": "__init__.py",
"309": "__init__.py",
"310": "__init__.py",
"311": "__init__.py",
"312": "__init__.py",
"495": "code:bash (cd /path/to/shanxia2.0)",
"496": "code:bash (./start-prod.sh status # 查看状态)",
"497": "code:bash (curl -s http://127.0.0.1:9111/health)",
"498": "code:bash (cd /iflytek/shanxia2.0/backend)",
"499": "code:bash (python -m venv venv)",
"500": "code:bash (pip install -r requirements.txt)",
"501": "code:env (# 数据库配置)",
"502": "code:bash (uvicorn app.main:app --reload --port 8000)",
"503": "BaseModel",
"504": "PlanResourceSnapshotMixin"
}
@@ -0,0 +1,820 @@
# Graph Report - backend (2026-08-26)
## Corpus Check
- 354 files · ~248,721 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 5068 nodes · 19179 edges · 173 communities (157 shown, 16 thin omitted)
- Extraction: 95% EXTRACTED · 5% INFERRED · 0% AMBIGUOUS · INFERRED: 1002 edges (avg confidence: 0.52)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `e56d227f`
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
- Run `graphify update .` after code changes (no API cost).
## Community Hubs (Navigation)
- [[_COMMUNITY_Community 0|Community 0]]
- [[_COMMUNITY_Community 1|Community 1]]
- [[_COMMUNITY_Community 2|Community 2]]
- [[_COMMUNITY_Community 3|Community 3]]
- [[_COMMUNITY_Community 4|Community 4]]
- [[_COMMUNITY_Community 5|Community 5]]
- [[_COMMUNITY_Community 6|Community 6]]
- [[_COMMUNITY_Community 7|Community 7]]
- [[_COMMUNITY_Community 8|Community 8]]
- [[_COMMUNITY_Community 9|Community 9]]
- [[_COMMUNITY_Community 10|Community 10]]
- [[_COMMUNITY_Community 11|Community 11]]
- [[_COMMUNITY_Community 12|Community 12]]
- [[_COMMUNITY_Community 13|Community 13]]
- [[_COMMUNITY_Community 14|Community 14]]
- [[_COMMUNITY_Community 15|Community 15]]
- [[_COMMUNITY_Community 16|Community 16]]
- [[_COMMUNITY_Community 17|Community 17]]
- [[_COMMUNITY_Community 18|Community 18]]
- [[_COMMUNITY_Community 19|Community 19]]
- [[_COMMUNITY_Community 20|Community 20]]
- [[_COMMUNITY_Community 21|Community 21]]
- [[_COMMUNITY_Community 22|Community 22]]
- [[_COMMUNITY_Community 23|Community 23]]
- [[_COMMUNITY_Community 24|Community 24]]
- [[_COMMUNITY_Community 25|Community 25]]
- [[_COMMUNITY_Community 26|Community 26]]
- [[_COMMUNITY_Community 27|Community 27]]
- [[_COMMUNITY_Community 28|Community 28]]
- [[_COMMUNITY_Community 29|Community 29]]
- [[_COMMUNITY_Community 30|Community 30]]
- [[_COMMUNITY_Community 31|Community 31]]
- [[_COMMUNITY_Community 32|Community 32]]
- [[_COMMUNITY_Community 33|Community 33]]
- [[_COMMUNITY_Community 34|Community 34]]
- [[_COMMUNITY_Community 35|Community 35]]
- [[_COMMUNITY_Community 36|Community 36]]
- [[_COMMUNITY_Community 37|Community 37]]
- [[_COMMUNITY_Community 38|Community 38]]
- [[_COMMUNITY_Community 39|Community 39]]
- [[_COMMUNITY_Community 40|Community 40]]
- [[_COMMUNITY_Community 41|Community 41]]
- [[_COMMUNITY_Community 42|Community 42]]
- [[_COMMUNITY_Community 43|Community 43]]
- [[_COMMUNITY_Community 44|Community 44]]
- [[_COMMUNITY_Community 45|Community 45]]
- [[_COMMUNITY_Community 46|Community 46]]
- [[_COMMUNITY_Community 47|Community 47]]
- [[_COMMUNITY_Community 48|Community 48]]
- [[_COMMUNITY_Community 49|Community 49]]
- [[_COMMUNITY_Community 50|Community 50]]
- [[_COMMUNITY_Community 51|Community 51]]
- [[_COMMUNITY_Community 52|Community 52]]
- [[_COMMUNITY_Community 53|Community 53]]
- [[_COMMUNITY_Community 54|Community 54]]
- [[_COMMUNITY_Community 55|Community 55]]
- [[_COMMUNITY_Community 56|Community 56]]
- [[_COMMUNITY_Community 57|Community 57]]
- [[_COMMUNITY_Community 58|Community 58]]
- [[_COMMUNITY_Community 59|Community 59]]
- [[_COMMUNITY_Community 60|Community 60]]
- [[_COMMUNITY_Community 61|Community 61]]
- [[_COMMUNITY_Community 62|Community 62]]
- [[_COMMUNITY_Community 63|Community 63]]
- [[_COMMUNITY_Community 64|Community 64]]
- [[_COMMUNITY_Community 65|Community 65]]
- [[_COMMUNITY_Community 66|Community 66]]
- [[_COMMUNITY_Community 67|Community 67]]
- [[_COMMUNITY_Community 68|Community 68]]
- [[_COMMUNITY_Community 69|Community 69]]
- [[_COMMUNITY_Community 70|Community 70]]
- [[_COMMUNITY_Community 71|Community 71]]
- [[_COMMUNITY_Community 72|Community 72]]
- [[_COMMUNITY_Community 73|Community 73]]
- [[_COMMUNITY_Community 74|Community 74]]
- [[_COMMUNITY_apply_crm_create_by_scope|apply_crm_create_by_scope]]
- [[_COMMUNITY_opportunity_follow.py|opportunity_follow.py]]
- [[_COMMUNITY_Community 77|Community 77]]
- [[_COMMUNITY_Community 78|Community 78]]
- [[_COMMUNITY_PlCarrier|PlCarrier]]
- [[_COMMUNITY_resolve_crm_product|resolve_crm_product]]
- [[_COMMUNITY_customer_follow.py|customer_follow.py]]
- [[_COMMUNITY_Community 83|Community 83]]
- [[_COMMUNITY_Community 84|Community 84]]
- [[_COMMUNITY_allocate_next_biz_no|allocate_next_biz_no]]
- [[_COMMUNITY_Community 86|Community 86]]
- [[_COMMUNITY_Community 87|Community 87]]
- [[_COMMUNITY_CrmProduct|CrmProduct]]
- [[_COMMUNITY_pl_ocr_service.py|pl_ocr_service.py]]
- [[_COMMUNITY_WechatMessageService|WechatMessageService]]
- [[_COMMUNITY_Community 92|Community 92]]
- [[_COMMUNITY_api_request_log_middleware.py|api_request_log_middleware.py]]
- [[_COMMUNITY_assert_contract_editable_for_update|assert_contract_editable_for_update]]
- [[_COMMUNITY_test_pl_public_link_archived.py|test_pl_public_link_archived.py]]
- [[_COMMUNITY_minio_url.py|minio_url.py]]
- [[_COMMUNITY_contact.py|contact.py]]
- [[_COMMUNITY_LocalStorage|LocalStorage]]
- [[_COMMUNITY_redis_client.py|redis_client.py]]
- [[_COMMUNITY_price_letter_detail|price_letter_detail]]
- [[_COMMUNITY_tenant.py|tenant.py]]
- [[_COMMUNITY_BaseStorage|BaseStorage]]
- [[_COMMUNITY_pl_internal_customer.py|pl_internal_customer.py]]
- [[_COMMUNITY_apply_crm_create_by_scope|apply_crm_create_by_scope]]
- [[_COMMUNITY_pool_customer_assign|pool_customer_assign]]
- [[_COMMUNITY_site.py|site.py]]
- [[_COMMUNITY_apply_pl_scope|apply_pl_scope]]
- [[_COMMUNITY_statistics.py|statistics.py]]
- [[_COMMUNITY_test_pl_plan_stop_rules.py|test_pl_plan_stop_rules.py]]
- [[_COMMUNITY_list_duty_staff_users|list_duty_staff_users]]
- [[_COMMUNITY_merge_duplicate_crm_customers.py|merge_duplicate_crm_customers.py]]
- [[_COMMUNITY_dict_type.py|dict_type.py]]
- [[_COMMUNITY_crm_models.py|crm_models.py]]
- [[_COMMUNITY_site.py|site.py]]
- [[_COMMUNITY_Community 116|Community 116]]
- [[_COMMUNITY_parse_hhmm|parse_hhmm]]
- [[_COMMUNITY_Community 118|Community 118]]
- [[_COMMUNITY_Community 119|Community 119]]
- [[_COMMUNITY_oper_log_decorator.py|oper_log_decorator.py]]
- [[_COMMUNITY_post.py|post.py]]
- [[_COMMUNITY_site.py|site.py]]
- [[_COMMUNITY_customer_options|customer_options]]
- [[_COMMUNITY_LocalStorage|LocalStorage]]
- [[_COMMUNITY_ethnic.py|ethnic.py]]
- [[_COMMUNITY_product_allowed|product_allowed]]
- [[_COMMUNITY_BaseStorage|BaseStorage]]
- [[_COMMUNITY__filter_export_rows_by_ids|_filter_export_rows_by_ids]]
- [[_COMMUNITY_resolve_crm_product|resolve_crm_product]]
- [[_COMMUNITY_context.py|context.py]]
- [[_COMMUNITY_inventory_id.py|inventory_id.py]]
- [[_COMMUNITY_list_contacts|list_contacts]]
- [[_COMMUNITY_Community 136|Community 136]]
- [[_COMMUNITY_get_db_current_user_optional|get_db_current_user_optional]]
- [[_COMMUNITY_Community 138|Community 138]]
- [[_COMMUNITY_get_current_user_by_token|get_current_user_by_token]]
- [[_COMMUNITY_UserRole|UserRole]]
- [[_COMMUNITY_admin_request_json.py|admin_request_json.py]]
- [[_COMMUNITY_.to_list_kwargs|.to_list_kwargs]]
- [[_COMMUNITY_Community 147|Community 147]]
- [[_COMMUNITY_Community 151|Community 151]]
- [[_COMMUNITY_customer_options|customer_options]]
- [[_COMMUNITY_.to_tenant_user_dict|.to_tenant_user_dict]]
- [[_COMMUNITY_get_client_ip|get_client_ip]]
- [[_COMMUNITY_codeblock1 (iflytekshanxia2.0backend)|code:block1 (/iflytek/shanxia2.0/backend)]]
- [[_COMMUNITY_resolve_create_time_bounds|resolve_create_time_bounds]]
- [[_COMMUNITY_test_pl_vehicle_personnel_photo_schema.py|test_pl_vehicle_personnel_photo_schema.py]]
- [[_COMMUNITY_crm_quote_pdf.py|crm_quote_pdf.py]]
- [[_COMMUNITY_shanxia2.0 后端骨架(FastAPI)|shanxia2.0 后端骨架(FastAPI)]]
- [[_COMMUNITY_api_crypto_middleware.py|api_crypto_middleware.py]]
- [[_COMMUNITY_order_status_compat.py|order_status_compat.py]]
- [[_COMMUNITY_shanxia2.0 Backend 生产部署说明|shanxia2.0 Backend 生产部署说明]]
- [[_COMMUNITY_db_collation.py|db_collation.py]]
- [[_COMMUNITY___init__.py|__init__.py]]
- [[_COMMUNITY___init__.py|__init__.py]]
- [[_COMMUNITY_codebash (cd pathtoshanxia2.0)|code:bash (cd /path/to/shanxia2.0)]]
- [[_COMMUNITY_codebash (.start-prod.sh status 查看状态)|code:bash (./start-prod.sh status # 查看状态)]]
- [[_COMMUNITY_codebash (curl -s http127.0.0.19111health)|code:bash (curl -s http://127.0.0.1:9111/health)]]
- [[_COMMUNITY_codebash (cd iflytekshanxia2.0backend)|code:bash (cd /iflytek/shanxia2.0/backend)]]
- [[_COMMUNITY_codebash (python -m venv venv)|code:bash (python -m venv venv)]]
- [[_COMMUNITY_codebash (pip install -r requirements.txt)|code:bash (pip install -r requirements.txt)]]
- [[_COMMUNITY_codeenv ( 数据库配置)|code:env (# 数据库配置)]]
- [[_COMMUNITY_codebash (uvicorn app.mainapp --reload --port 8000)|code:bash (uvicorn app.main:app --reload --port 8000)]]
- [[_COMMUNITY_BaseModel|BaseModel]]
- [[_COMMUNITY_PlanResourceSnapshotMixin|PlanResourceSnapshotMixin]]
## God Nodes (most connected - your core abstractions)
1. `BaseModel` - 526 edges
2. `get_tenant_no()` - 384 edges
3. `DbUserContext` - 308 edges
4. `success_response()` - 278 edges
5. `error_response()` - 273 edges
6. `generate_uuid()` - 211 edges
7. `BxUserContext` - 204 edges
8. `crm_user_info()` - 138 edges
9. `ExportValidationError` - 108 edges
10. `ExportColumn` - 106 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]
scripts/migrate_bx_data.py → app/core/config.py
- `MigrationStats` --uses--> `Settings` [INFERRED]
scripts/migrate_crm_clue.py → app/core/config.py
- `StepStats` --uses--> `Settings` [INFERRED]
scripts/migrate_crm_clue.py → app/core/config.py
## Import Cycles
- None detected.
## Communities (173 total, 16 thin omitted)
### Community 0 - "Community 0"
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)
### Community 1 - "Community 1"
Cohesion: 0.07
Nodes (35): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, ContractApproverSettingSaveBody, ContractApprovalActionBody, ContractApprovalPassBody, ContractApprovalRejectBody, ContractApprovalTransferBody, ContractBatchAssignBody, ContractBatchSubmitBody (+27 more)
### Community 2 - "Community 2"
Cohesion: 0.14
Nodes (39): dump_export_row(), issue_status_label(), Any, Session, respond_xlsx(), status_label(), advance_issue_stats(), batch_offset() (+31 more)
### 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)
### Community 4 - "Community 4"
Cohesion: 0.11
Nodes (62): _apply_list_filters(), assign_opportunities(), batch_update_expect_date(), batch_update_stage(), change_stage(), create_opportunity(), _decimal_value(), _enrich_user_names() (+54 more)
### Community 5 - "Community 5"
Cohesion: 0.04
Nodes (141): archive_plan(), _build_plan_archive_export_rows(), cancel_plan_wait_notice(), count_plans_by_contract(), create_from_contract(), create_plan(), create_plan_full(), _determine_plan_type() (+133 more)
### Community 6 - "Community 6"
Cohesion: 0.15
Nodes (41): convert_clue(), assign_customer(), batch_claim_customers(), check_duplicate_customer(), claim_customer(), create_customer(), customer_name_exists(), deal_customer() (+33 more)
### Community 7 - "Community 7"
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 8 - "Community 8"
Cohesion: 0.09
Nodes (36): can_user_approve(), invalidate_all_approvals(), 作废该合同全部有效审批记录(含已通过/已拒绝),用于再编辑或重新提审。, 顺序审批:当前步骤 pending 且 is_current=1。 同一审批人若同时存在历史已处理记录与当前轮 pending,优先取 pending, approve_quote(), can_user_approve(), create_approval_records(), delete_pending_approvals() (+28 more)
### Community 9 - "Community 9"
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.06
Nodes (62): export_depts(), export_menus(), export_role_management(), export_tenants(), list_tenants(), 导出角色列表(当前筛选全量,或 ids 已选)。, 导出租户列表(当前筛选全量,或 ids 已选)。, export_inventory_ledger() (+54 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)
### Community 12 - "Community 12"
Cohesion: 0.07
Nodes (44): AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest, LoginResponse, Pydantic schemas - 用户认证, ResetPasswordRequest, UserCreate (+36 more)
### Community 13 - "Community 13"
Cohesion: 0.08
Nodes (52): bx_health(), 报销(bx)API 路由聚合 — REST 风格,协议对齐 bx 原系统。, P0 健康检查:验证 bx 路由已挂载且响应协议为 code=0。, approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse() (+44 more)
### Community 14 - "Community 14"
Cohesion: 0.09
Nodes (60): register_contract_routes(), batch_assign_owner(), batch_submit_contract_approval(), _build_contract_name_from_parties(), _contract_period_key(), contract_row_to_dict(), create_from_opportunity(), download_contract_pdf() (+52 more)
### Community 15 - "Community 15"
Cohesion: 0.11
Nodes (16): BxReimburseApply, BxReimburseApproval, BxReimburseDetail, BxReimburseInvoice, BxReimburseOffset, 报销单勾选的发票附件(同一发票可勾选多个附件,各占一条)。, ReimburseInvoiceBriefOut, ReimburseInvoiceLinkIn (+8 more)
### Community 16 - "Community 16"
Cohesion: 0.07
Nodes (82): clue_check_convert(), clue_check_duplicate(), clue_detail(), clue_export(), clue_follow_detail(), clue_follow_statistics(), clue_list(), clue_mine() (+74 more)
### Community 17 - "Community 17"
Cohesion: 0.08
Nodes (40): approve_carrier(), create_carrier(), get_carrier(), list_carriers(), reject_carrier(), update_carrier(), PlCarrier, carrier_to_read() (+32 more)
### Community 18 - "Community 18"
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)
### Community 19 - "Community 19"
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)
### Community 20 - "Community 20"
Cohesion: 0.17
Nodes (25): create_vehicle(), get_vehicle(), list_personnel(), list_vehicles(), _personnel_to_read(), update_vehicle(), _vehicle_to_detail(), _vehicle_to_read() (+17 more)
### Community 21 - "Community 21"
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.07
Nodes (55): _as_date(), _build_driver_url(), _build_public_page(), _build_stop_product_reads(), _format_file_size(), _format_plan_date(), get_public_transport(), get_public_transport_history() (+47 more)
### Community 24 - "Community 24"
Cohesion: 0.12
Nodes (29): _build_tree(), _cascade_soft_delete(), create_menu(), get_menu(), list_menus(), list_menus_tree(), menu_name_exists(), Any (+21 more)
### Community 25 - "Community 25"
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.13
Nodes (28): cancel_apply(), create_apply(), create_record(), delete_applies(), delete_records(), export_recharge_applies(), export_recharge_disburse_board(), get_apply() (+20 more)
### Community 27 - "Community 27"
Cohesion: 0.10
Nodes (33): CRM 报价单 API 路由 — 挂接到 crm.router, total_pages(), QuoteApproverSettingSaveBody, QuoteAcceptBody, QuoteApprovalApproveBody, QuoteApprovalListBody, QuoteApprovalRefreshNamesBody, QuoteApprovalWithdrawBody (+25 more)
### Community 28 - "Community 28"
Cohesion: 0.05
Nodes (109): check_document_expiry(), document_reminder_stats(), DocumentReminderExportBody, export_document_reminders(), get_inventory_ledger(), get_summary(), list_document_reminders(), list_transactions() (+101 more)
### Community 29 - "Community 29"
Cohesion: 0.10
Nodes (29): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+21 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.11
Nodes (7): convert_heic_to_jpeg(), OSSStorage, process_image_content(), QiniuStorage, 文件存储工具模块 支持多种存储方式: 1. 本地存储 (local) - 默认 2. 七牛云存储 (qiniu) - 推荐生产环境使用 3. 阿里云OSS (, 将 HEIC/HEIF 格式转换为 JPEG 格式, 处理图片内容,如果是 HEIC 格式则转换为 JPEG
### 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)
### Community 33 - "Community 33"
Cohesion: 0.16
Nodes (30): _apply_plan_product_update(), _apply_plan_update(), AutoGenerateMonthlyResult, _base_query(), create_plan(), delete_plan(), export_plans(), _generate_plan_no() (+22 more)
### Community 34 - "Community 34"
Cohesion: 0.18
Nodes (18): create_workflow(), delete_workflow(), get_workflow(), get_workflow_by_biz_type(), list_workflows(), Session, save_workflow_nodes(), update_workflow() (+10 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.08
Nodes (58): _alias_row_to_dict(), _assert_brand_deletable(), barcode_exists(), _brand_row_to_dict(), _build_category_tree(), category_code_exists(), _collect_category_with_ancestors(), create_category() (+50 more)
### Community 37 - "Community 37"
Cohesion: 0.11
Nodes (33): PlPlanDelivery, PlPlanDeliveryProduct, PlPlanLoad, PlPlanLoadProduct, 运输计划-装货段 pl_plan_load(plan 1:1), 运输计划-装货段产品明细 pl_plan_load_product, 运输计划-送货段 pl_plan_delivery(plan 1:N), 运输计划-送货段产品明细 pl_plan_delivery_product (+25 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.13
Nodes (28): PlInventoryTransaction, 库存流水表 pl_inventory_transaction, load_brand_qtys_by_plan_product_ids(), persist_plan_product_brand_qtys(), Any, Decimal, Session, 按计划产品明细 ID 批量加载归档品牌数量(brandId/brandName/qty)。 (+20 more)
### Community 40 - "Community 40"
Cohesion: 0.10
Nodes (32): build_dict_value_from_label(), ensure_dict_data(), grab(), join_work_plans(), list_duty_staff_users(), normalize_person_name(), _pad_hhmm(), parse_time_range_input() (+24 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.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 (37): BxExportBodyBase, create_invoice(), delete_invoice(), export_invoice_wallets(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices() (+29 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)
### Community 45 - "Community 45"
Cohesion: 0.27
Nodes (53): AttachmentDownloadUrlBody, demo_xlsx_export(), DemoXlsxColumnSpec, DemoXlsxExportBody, DeptCreateBody, DeptExportBody, DeptUpdateBody, DictDataCreateBody (+45 more)
### Community 46 - "Community 46"
Cohesion: 0.15
Nodes (33): _apply_contract_entity_fields(), _build_contract_filters(), _build_customer_address(), _calc_amount_with_tax(), _change_row_to_dict(), contract_no_exists(), create_contract(), create_contract_change() (+25 more)
### Community 47 - "Community 47"
Cohesion: 0.16
Nodes (32): _apply_inventory_product_update(), _apply_inventory_update(), _base_query(), create_inventory(), create_link_for_plan(), delete_inventory(), export_inventory(), _generate_batch_no() (+24 more)
### Community 48 - "Community 48"
Cohesion: 0.17
Nodes (24): CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), execute_change(), export_contract_changes(), export_contract_templates(), _get_change_row(), list_contract_changes(), list_contract_templates() (+16 more)
### Community 49 - "Community 49"
Cohesion: 0.18
Nodes (16): create_expense_item(), delete_expense_item(), ExpenseItemExportBody, export_expense_items(), _flatten_expense_tree(), get_expense_item(), get_expense_item_tree(), Session (+8 more)
### Community 50 - "Community 50"
Cohesion: 0.11
Nodes (44): PlPlanContract, 运输计划-合同关联(分侧多选) pl_plan_contract, DeliverySlipPrintRead, PlanContractLink, PlanDeliveryBody, PlanDeliveryRead, PlanLoadBody, PlanLoadRead (+36 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.16
Nodes (25): put_plan_side_contracts(), PlanContractGapRead, is_internal_customer_name(), 运输计划:内置山峡/云栋客户判定(合同可免), build_plan_contract_gap_read(), compute_contract_gap_sides(), _demander_gap_expr(), list_plan_contract_gaps() (+17 more)
### Community 53 - "Community 53"
Cohesion: 0.20
Nodes (31): 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() (+23 more)
### Community 54 - "Community 54"
Cohesion: 0.16
Nodes (29): _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), export_weighing(), _get_weighing(), get_weighing_related() (+21 more)
### Community 55 - "Community 55"
Cohesion: 0.06
Nodes (37): category_add(), category_delete(), category_tree(), category_update(), clue_import(), _map_product_export_column_keys(), product_add(), product_delete() (+29 more)
### Community 56 - "Community 56"
Cohesion: 0.11
Nodes (31): 返回 (作废, 归档)。现场链接实际走入库/出库单公共页。, _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() (+23 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.11
Nodes (32): ReimburseDetailOut, filter_current_cycle_approvals(), 审批轮次过滤 — 驳回后重新提交时,进度接口仅展示当前轮次。, 审批进度仅展示当前轮次;完整历史由 get_approval_history 返回。, allocate_reimburse_title_seq(), format_reimburse_title(), generate_apply_code(), generate_title() (+24 more)
### Community 59 - "Community 59"
Cohesion: 0.20
Nodes (28): _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() (+20 more)
### Community 60 - "Community 60"
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.08
Nodes (62): cancel_plan(), 作废运输计划:取消跟进状态、作废关联地磅出入库单、取消运输单。, PlTransportDbLink, PlTransportSiteLink, 运输-地磅出入库关联 pl_transport_db_link, 运输计划现场链接 pl_transport_site_link(与地磅出入库单解耦), _apply_plan_quantity_delta(), apply_stop_dibang_options() (+54 more)
### Community 62 - "Community 62"
Cohesion: 0.10
Nodes (51): assert_quote_editable_for_update(), _build_quote_filters(), calculate_quote_amount(), create_new_version(), create_quote(), _decimal_value(), _enrich_contact_fields(), _enrich_supplier_name() (+43 more)
### Community 63 - "Community 63"
Cohesion: 0.10
Nodes (59): bind_vehicle_driver(), CarrierExportBody, create_driver(), create_personnel(), delete_carrier(), delete_driver(), delete_personnel(), delete_vehicle() (+51 more)
### Community 64 - "Community 64"
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 65 - "Community 65"
Cohesion: 0.11
Nodes (53): cancel_apply(), create_apply(), create_process(), delete_applies(), delete_processes(), get_apply(), get_process(), list_reminders() (+45 more)
### Community 66 - "Community 66"
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 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.24
Nodes (18): _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 (+10 more)
### Community 69 - "Community 69"
Cohesion: 0.17
Nodes (27): 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() (+19 more)
### Community 70 - "Community 70"
Cohesion: 0.24
Nodes (20): register_quote_routes(), accept_quote(), _ensure_quote_in_scope(), generate_pdf(), generate_share(), get_quote(), get_quote_detail(), _get_quote_in_scope() (+12 more)
### Community 71 - "Community 71"
Cohesion: 0.08
Nodes (25): clue_assign(), clue_convert(), clue_create(), clue_delete(), clue_follow_create(), clue_follow_delete(), clue_follow_list(), clue_follow_update() (+17 more)
### Community 72 - "Community 72"
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 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.27
Nodes (18): get_plan_related(), format_datetime(), _create_by_name(), datetime_end_of_day(), fmt_date(), fmt_datetime(), inventory_date_to_api(), inventory_to_read() (+10 more)
### Community 75 - "apply_crm_create_by_scope"
Cohesion: 0.13
Nodes (32): 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() (+24 more)
### Community 76 - "opportunity_follow.py"
Cohesion: 0.08
Nodes (50): operlog_detail(), operlog_export(), operlog_list(), OperLogExportBody, Session, 导出操作日志(当前筛选全量,或 ids 已选)。, 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), _user_info() (+42 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.24
Nodes (7): camel_to_snake(), CRUDBase, get_model_attr(), HistoryCRUD, Any, Session, ModelType
### Community 79 - "PlCarrier"
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 80 - "resolve_crm_product"
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 81 - "customer_follow.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)
### Community 83 - "Community 83"
Cohesion: 0.17
Nodes (28): _advance_contract_after_approval(), approve_contract(), approve_contract_by_contract_id(), approve_pass(), approve_reject(), approve_transfer(), _build_approval_list_filters(), create_approval_records() (+20 more)
### Community 84 - "Community 84"
Cohesion: 0.10
Nodes (32): 微信消息通知服务 支持微信小程序模板消息推送 使用方式: 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_ (+24 more)
### Community 85 - "allocate_next_biz_no"
Cohesion: 0.14
Nodes (41): assign_clues(), check_convert(), check_duplicate_clue(), create_clue(), _enrich_user_names(), _ensure_clue_in_scope(), create_clue_follow(), delete_clue_follow() (+33 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)
### Community 87 - "Community 87"
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 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.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.37
Nodes (14): create_opportunity_follow(), get_opportunity_follow(), list_follows_by_opportunity(), list_opportunity_follows(), _parse_optional_datetime(), Any, datetime, Session (+6 more)
### Community 92 - "Community 92"
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 93 - "api_request_log_middleware.py"
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 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.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.16
Nodes (19): ApiRequestLogMiddleware, _claims_from_auth(), _format_body_bytes(), _persist_log(), Any, Request, 统一记录 API 请求/响应出入参的中间件, _redact_obj() (+11 more)
### Community 97 - "contact.py"
Cohesion: 0.07
Nodes (38): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), Session (+30 more)
### Community 98 - "LocalStorage"
Cohesion: 0.35
Nodes (11): create_tenant(), get_tenant(), list_tenants(), Any, Session, _row_to_dict(), soft_delete_tenant(), tenant_no_exists() (+3 more)
### Community 99 - "redis_client.py"
Cohesion: 0.14
Nodes (20): calc_age_from_chinese_id_card(), date, 从 18 位身份证号计算周岁。号码不完整或出生日期无效时返回 None。, VehiclePersonnelRow, build_personnel_summary(), load_vehicle_personnel_rows(), load_vehicle_personnel_summaries(), Session (+12 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)
### Community 101 - "tenant.py"
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 102 - "BaseStorage"
Cohesion: 0.05
Nodes (72): clue_import_template(), contact_add(), contact_delete(), contact_update(), customer_create(), customer_import_template(), opportunity_add(), opportunity_assign() (+64 more)
### Community 103 - "pl_internal_customer.py"
Cohesion: 0.27
Nodes (10): apply_product_snapshot_to_inventory(), ProductSnapshot, Session, 地磅模块 — CRM 产品解析与快照写入。, 校验 CRM 产品并返回名称/规格快照。新建单据 product_id 必填。 require_on_shelf=False 用于运输计划联动地磅等历, resolve_crm_product(), _product(), resolve_crm_product:运输联动场景允许已下架产品。 (+2 more)
### Community 104 - "apply_crm_create_by_scope"
Cohesion: 0.16
Nodes (23): get_pool_record(), list_pool_records(), Any, Session, _row_to_dict(), total_pages(), create_price_letter(), get_price_letter() (+15 more)
### Community 105 - "pool_customer_assign"
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 106 - "site.py"
Cohesion: 0.11
Nodes (51): _build_public_page(), _format_file_size(), _format_plan_date(), get_public_transport_site(), _get_transport_by_site_token(), Session, UploadFile, 运输计划 · 现场按段免登录公共 API(一车多卸) (+43 more)
### Community 107 - "apply_pl_scope"
Cohesion: 0.09
Nodes (37): CompletedTaskExportBody, MyInstanceExportBody, PendingTaskExportBody, ProcessDefCreateBody, ProcessDefExportBody, ProcessDefUpdateBody, PublishVersionBody, 审批意见:前端传 commentText,兼容 comment。 (+29 more)
### Community 108 - "statistics.py"
Cohesion: 0.20
Nodes (24): count_source_rows(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_runtime_settings(), load_settings_env(), load_user_mapping() (+16 more)
### Community 109 - "test_pl_plan_stop_rules.py"
Cohesion: 0.15
Nodes (23): _extract_qty(), _fmt_qty(), Any, Decimal, 运输计划多段:内部客户地磅默认值与数量平衡校验, resolve_stop_dibang_defaults(), _sum_qty(), warn_qty_imbalance() (+15 more)
### Community 110 - "list_duty_staff_users"
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 112 - "merge_duplicate_crm_customers.py"
Cohesion: 0.26
Nodes (22): Connection, backup_tables(), _contact_key(), discover_merge_pairs(), fetch_customer(), _invoice_key(), load_database_url(), main() (+14 more)
### Community 113 - "dict_type.py"
Cohesion: 0.35
Nodes (11): create_dict_type(), dict_type_code_exists(), get_dict_type(), list_dict_types(), Any, Session, 字典类型 CRUD(sys_dict_type), _row_to_dict() (+3 more)
### Community 114 - "crm_models.py"
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 115 - "site.py"
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 116 - "Community 116"
Cohesion: 0.13
Nodes (33): create_from_quote(), _quote_products_to_contract_products(), Java: createFromQuote — 返回合同 id, calculate_subtotal(), _decimal_value(), _ensure_quote_parent_scope(), _get_field(), get_quote_product() (+25 more)
### Community 117 - "parse_hhmm"
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 118 - "Community 118"
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 (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 - "oper_log_decorator.py"
Cohesion: 0.05
Nodes (87): _attach_history_products(), _build_history_page(), _build_page(), _get_by_token(), _history_status_label(), _make_handlers(), _models(), _parse_history_date() (+79 more)
### Community 121 - "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 122 - "site.py"
Cohesion: 0.39
Nodes (10): create_site(), get_site(), list_sites(), Any, Session, _row_to_dict(), site_code_exists(), soft_delete_site() (+2 more)
### Community 123 - "customer_options"
Cohesion: 0.04
Nodes (104): RecognizeCertResult, force_plan_follow_status(), 强制修改跟进状态(仅改字段,不作废联动、不补运输安排)。需权限 pl:plan:force-follow-status。, PageResult, ResponseModel, BaseModel, ContactByCustomerBody, ContactDetailBody (+96 more)
### Community 125 - "ethnic.py"
Cohesion: 0.36
Nodes (7): list_ethnics(), Any, Session, 民族码表 CRUD(全局 sys_ethnic), _row_to_dict(), 民族码表 sys_ethnic(国标 GB/T 3304,全局), SysEthnic
### Community 128 - "product_allowed"
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 129 - "BaseStorage"
Cohesion: 0.12
Nodes (24): _auto_contract_name_body(), generate_contract_name(), 按面板单位全称精确匹配交易主体/客户主数据,取 shortName;对不上则用全称。, 前端预览误用单位全称时,名称片段会等于面板/客户/开票全称。, 按面板供方(partyA)-需方(partyB)生成:{供方简称}-{需方简称}({合同编号})。 - 名称为空:按主数据简称自动生成 - 名, resolve_party_short_name(), _strip_contract_name_no_suffix(), _user_contract_name_uses_party_full_name() (+16 more)
### Community 130 - "_filter_export_rows_by_ids"
Cohesion: 0.18
Nodes (17): get_user_menu_codes(), Session, 读取用户授权的菜单权限标识集合(与前端 meta.menuCode / perms 对齐)。, _expand_with_ancestor_menu_ids(), _granted_menu_ids_for_user(), iter_user_menu_perm_codes(), _map_role_name_to_web(), Session (+9 more)
### Community 131 - "resolve_crm_product"
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 - "context.py"
Cohesion: 0.14
Nodes (21): generate_uuid(), get_current_time(), parse_datetime(), datetime, allocate_next_biz_no(), _format_biz_no(), _prefix_for(), datetime (+13 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)
### Community 134 - "list_contacts"
Cohesion: 0.22
Nodes (3): BaseStorage, 带下载文件名的访问 URL;默认实现为普通访问地址。, 浏览器内联预览 URL;默认实现为普通访问地址。
### Community 137 - "get_db_current_user_optional"
Cohesion: 0.29
Nodes (8): get_current_user(), get_current_user_by_token(), Session, 根据 token 获取当前用户(包含 Redis 会话校验;会话滑动续期), 获取当前用户(sync 依赖,配合 sync 路由在线程池执行,避免阻塞事件循环)。, get_db_current_user_optional(), Session, 有 Bearer 且为 admin/super_admin 时返回上下文,否则 None(供三方 H5 无登录调用)。
### 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 - "get_current_user_by_token"
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 140 - "UserRole"
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)
### Community 144 - "admin_request_json.py"
Cohesion: 0.10
Nodes (45): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), export_settlements(), export_unsettled_plans(), _generate_settlement_no() (+37 more)
### Community 146 - ".to_list_kwargs"
Cohesion: 0.12
Nodes (29): API 路由包 — 山峡化工生产一体化门户, create_leave(), delete_leave(), export_leaves(), get_leave(), _leave_local_callback(), leave_workflow_callback(), LeaveExportBody (+21 more)
### 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 152 - "customer_options"
Cohesion: 0.12
Nodes (22): customer_dealed(), customer_key(), customer_list(), customer_long_time_no_follow(), customer_mine(), customer_options(), customer_to_follow(), customer_week_new() (+14 more)
### 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 164 - "get_client_ip"
Cohesion: 0.11
Nodes (36): _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` 字段约定一致。 (+28 more)
### Community 173 - "resolve_create_time_bounds"
Cohesion: 0.07
Nodes (68): _build_driver_url(), ContractGapExportBody, get_plan_arrange_info(), PlanExportBody, 获取计划已安排运输后的司机链接与地磅出入库关联(供查看弹窗复制简述/二维码)。, _apply_plan_logistics_from_payload(), _apply_transport_arrange_fields(), arrange_transport() (+60 more)
### Community 179 - "test_pl_vehicle_personnel_photo_schema.py"
Cohesion: 0.27
Nodes (16): add_favorite(), count_active(), find_active(), find_soft_deleted(), list_favorites(), _next_order_num(), normalize_menu_path(), Any (+8 more)
### Community 206 - "crm_quote_pdf.py"
Cohesion: 0.36
Nodes (10): build_quote_html(), _default_value(), _format_date(), _format_discount(), _format_money(), generate_quote_pdf(), _get_pdf_styles(), Any (+2 more)
### Community 207 - "shanxia2.0 后端骨架(FastAPI)"
Cohesion: 0.18
Nodes (10): 1. 创建虚拟环境, 2. 安装依赖, 3. 配置环境变量, 4. 启动服务, API 路由分组, shanxia2.0 后端骨架(FastAPI), 开发规范, 快速开始 (+2 more)
### Community 220 - "api_crypto_middleware.py"
Cohesion: 0.13
Nodes (22): ApiCryptoMiddleware, _claims_from_auth(), _coerce_post_method_override_to_get(), _get_redis_client(), _is_crypto_api(), _json_error_response(), _mark_nonce_once(), _nonce_key() (+14 more)
### Community 237 - "order_status_compat.py"
Cohesion: 0.36
Nodes (7): derive_legacy_status_from_three(), derive_three_status_from_legacy(), Decimal, 阶段A兼容:从旧 status 推导三字段。 约束:旧 status 本身混合了支付/配送/订单生命周期,因此只能尽力推断; 若业务侧已有更精确, 阶段A兼容:从三字段反推旧 status(用于旧前端/旧筛选参数兼容)。, ThreeStatus, _to_decimal()
### Community 239 - "shanxia2.0 Backend 生产部署说明"
Cohesion: 0.25
Nodes (7): 1. 上传到服务器, 2. 服务器首次启动, 3. 日常运维, 4. 配置文件, 5. 与 Nginx 配合, 6. 常见问题, shanxia2.0 Backend 生产部署说明
### Community 246 - "db_collation.py"
Cohesion: 0.38
Nodes (6): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时统一排序规则,避免 Illegal mix of collations。, 跨表字符串等值比较(JOIN / WHERE)时统一为 utf8mb4_unicode_ci。, 将列显式设为 utf8mb4_unicode_ci。, unicode_ci()
## Knowledge Gaps
- **30 isolated node(s):** `Config`, `Config`, `Config`, `Config`, `Config` (+25 more)
These have ≤1 connection - possible missing edges or undocumented components.
- **16 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 `context.py` to `product_allowed`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `inventory_id.py`, `Community 11`, `Community 14`, `Community 15`, `Community 17`, `.to_list_kwargs`, `Community 18`, `Community 20`, `Community 21`, `Community 19`, `Community 23`, `Community 24`, `Community 25`, `Community 28`, `Community 29`, `Community 32`, `Community 33`, `Community 34`, `get_client_ip`, `Community 36`, `Community 37`, `Community 39`, `Community 40`, `Community 43`, `resolve_create_time_bounds`, `Community 46`, `Community 50`, `Community 51`, `Community 53`, `Community 54`, `Community 58`, `Community 61`, `Community 62`, `Community 63`, `Community 65`, `Community 66`, `Community 67`, `Community 69`, `Community 72`, `apply_crm_create_by_scope`, `Community 83`, `allocate_next_biz_no`, `CrmProduct`, `pl_ocr_service.py`, `WechatMessageService`, `Community 92`, `api_request_log_middleware.py`, `LocalStorage`, `redis_client.py`, `apply_crm_create_by_scope`, `site.py`, `list_duty_staff_users`, `dict_type.py`, `Community 116`, `Community 118`, `oper_log_decorator.py`, `post.py`, `site.py`?**
_High betweenness centrality (0.159) - this node is a cross-community bridge._
- **Why does `BaseModel` connect `customer_options` to `Community 0`, `Community 1`, `Community 2`, `resolve_crm_product`, `Community 3`, `Community 5`, `Community 10`, `Community 11`, `Community 12`, `Community 13`, `Community 15`, `admin_request_json.py`, `Community 16`, `.to_list_kwargs`, `Community 18`, `Community 17`, `Community 20`, `Community 21`, `Community 23`, `customer_options`, `Community 26`, `Community 27`, `Community 28`, `Community 29`, `Community 33`, `Community 34`, `Community 37`, `Community 41`, `Community 43`, `Community 45`, `resolve_create_time_bounds`, `Community 47`, `Community 48`, `Community 49`, `Community 50`, `Community 51`, `Community 52`, `Community 54`, `Community 55`, `Community 58`, `Community 63`, `Community 65`, `Community 71`, `opportunity_follow.py`, `PlCarrier`, `resolve_crm_product`, `Community 87`, `test_pl_public_link_archived.py`, `contact.py`, `redis_client.py`, `BaseStorage`, `pool_customer_assign`, `site.py`, `apply_pl_scope`, `crm_models.py`, `Community 119`, `oper_log_decorator.py`?**
_High betweenness centrality (0.111) - this node is a cross-community bridge._
- **Why does `Settings` connect `price_letter_detail` to `Community 35`, `Community 67`, `Community 73`, `Community 42`, `statistics.py`, `Community 44`, `Community 57`, `Community 59`, `api_crypto_middleware.py`, `Community 30`?**
_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?**
_636 weakly-connected nodes found - possible documentation gaps or missing edges._
- **Should `Community 1` be split into smaller, more focused modules?**
_Cohesion score 0.0743321718931475 - nodes in this community are weakly interconnected._
- **Should `Community 2` be split into smaller, more focused modules?**
_Cohesion score 0.13510520487264674 - nodes in this community are weakly interconnected._
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,177 @@
{
"0": "Community 0",
"1": "Community 1",
"2": "Community 2",
"3": "Community 3",
"4": "Community 4",
"5": "Community 5",
"6": "Community 6",
"7": "Community 7",
"8": "Community 8",
"9": "Community 9",
"10": "Community 10",
"11": "Community 11",
"12": "Community 12",
"13": "Community 13",
"14": "Community 14",
"15": "Community 15",
"16": "Community 16",
"17": "Community 17",
"18": "Community 18",
"19": "Community 19",
"20": "Community 20",
"21": "Community 21",
"22": "Community 22",
"23": "Community 23",
"24": "Community 24",
"25": "Community 25",
"26": "Community 26",
"27": "Community 27",
"28": "Community 28",
"29": "Community 29",
"30": "Community 30",
"31": "Community 31",
"32": "Community 32",
"33": "Community 33",
"34": "Community 34",
"35": "Community 35",
"36": "Community 36",
"37": "Community 37",
"38": "Community 38",
"39": "Community 39",
"40": "Community 40",
"41": "Community 41",
"42": "Community 42",
"43": "Community 43",
"44": "Community 44",
"45": "Community 45",
"46": "Community 46",
"47": "Community 47",
"48": "Community 48",
"49": "Community 49",
"50": "Community 50",
"51": "Community 51",
"52": "Community 52",
"53": "Community 53",
"54": "Community 54",
"55": "Community 55",
"56": "Community 56",
"57": "Community 57",
"58": "Community 58",
"59": "Community 59",
"60": "Community 60",
"61": "Community 61",
"62": "Community 62",
"63": "Community 63",
"64": "Community 64",
"65": "Community 65",
"66": "Community 66",
"67": "Community 67",
"68": "Community 68",
"69": "Community 69",
"70": "Community 70",
"71": "Community 71",
"72": "Community 72",
"73": "Community 73",
"74": "Community 74",
"75": "apply_crm_create_by_scope",
"76": "opportunity_follow.py",
"77": "Community 77",
"78": "Community 78",
"79": "PlCarrier",
"80": "resolve_crm_product",
"81": "customer_follow.py",
"82": "list_duty_staff_users",
"83": "Community 83",
"84": "Community 84",
"85": "allocate_next_biz_no",
"86": "Community 86",
"87": "Community 87",
"88": "CrmProduct",
"89": "pl_ocr_service.py",
"90": "WechatMessageService",
"91": "unsettled_plans_q_filter",
"92": "Community 92",
"93": "api_request_log_middleware.py",
"94": "assert_contract_editable_for_update",
"95": "test_pl_public_link_archived.py",
"96": "minio_url.py",
"97": "contact.py",
"98": "LocalStorage",
"99": "redis_client.py",
"100": "price_letter_detail",
"101": "tenant.py",
"102": "BaseStorage",
"103": "pl_internal_customer.py",
"104": "apply_crm_create_by_scope",
"105": "pool_customer_assign",
"106": "site.py",
"107": "apply_pl_scope",
"108": "statistics.py",
"109": "test_pl_plan_stop_rules.py",
"111": "run_auto_generate_monthly_plans",
"112": "merge_duplicate_crm_customers.py",
"113": "dict_type.py",
"114": "dept.py",
"115": "site.py",
"116": "Community 116",
"118": "Community 118",
"119": "Community 119",
"120": "oper_log_decorator.py",
"121": "customer_follow.py",
"122": "post.py",
"123": "customer_options",
"124": "LocalStorage",
"125": "ethnic.py",
"129": "BaseStorage",
"130": "_filter_export_rows_by_ids",
"131": "resolve_crm_product",
"133": "inventory_id.py",
"134": "list_contacts",
"136": "get_db_current_user_optional",
"138": "Community 138",
"139": "get_current_user_by_token",
"140": "UserRole",
"142": "clear_pl_plan_instance_data.py",
"145": "duty_schedule.py",
"146": "duty.py",
"147": "Community 147",
"151": "Community 151",
"152": "customer_options",
"153": "pl_feedback_brand_qty.py",
"154": "LocalStorage",
"155": "WechatMessageService",
"162": ".to_tenant_user_dict",
"164": "get_client_ip",
"166": "code:block1 (/iflytek/shanxia2.0/backend)",
"173": "resolve_create_time_bounds",
"179": "test_pl_vehicle_personnel_photo_schema.py",
"206": "crm_quote_pdf.py",
"207": "shanxia2.0 后端骨架(FastAPI)",
"220": "api_crypto_middleware.py",
"237": "order_status_compat.py",
"239": "shanxia2.0 Backend 生产部署说明",
"246": "db_collation.py",
"254": "Activate.ps1",
"263": "__init__.py",
"264": "__init__.py",
"304": "__init__.py",
"305": "__init__.py",
"306": "__init__.py",
"307": "__init__.py",
"308": "__init__.py",
"309": "__init__.py",
"310": "__init__.py",
"311": "__init__.py",
"312": "__init__.py",
"495": "code:bash (cd /path/to/shanxia2.0)",
"496": "code:bash (./start-prod.sh status # 查看状态)",
"497": "code:bash (curl -s http://127.0.0.1:9111/health)",
"498": "code:bash (cd /iflytek/shanxia2.0/backend)",
"499": "code:bash (python -m venv venv)",
"500": "code:bash (pip install -r requirements.txt)",
"501": "code:env (# 数据库配置)",
"502": "code:bash (uvicorn app.main:app --reload --port 8000)",
"503": "BaseModel",
"504": "PlanResourceSnapshotMixin"
}
@@ -0,0 +1,834 @@
# Graph Report - backend (2026-08-27)
## Corpus Check
- 358 files · ~251,642 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 5124 nodes · 19395 edges · 175 communities (160 shown, 15 thin omitted)
- Extraction: 95% EXTRACTED · 5% INFERRED · 0% AMBIGUOUS · INFERRED: 1003 edges (avg confidence: 0.52)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `e56d227f`
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
- Run `graphify update .` after code changes (no API cost).
## Community Hubs (Navigation)
- [[_COMMUNITY_Community 0|Community 0]]
- [[_COMMUNITY_Community 1|Community 1]]
- [[_COMMUNITY_Community 2|Community 2]]
- [[_COMMUNITY_Community 3|Community 3]]
- [[_COMMUNITY_Community 4|Community 4]]
- [[_COMMUNITY_Community 5|Community 5]]
- [[_COMMUNITY_Community 6|Community 6]]
- [[_COMMUNITY_Community 7|Community 7]]
- [[_COMMUNITY_Community 8|Community 8]]
- [[_COMMUNITY_Community 9|Community 9]]
- [[_COMMUNITY_Community 10|Community 10]]
- [[_COMMUNITY_Community 11|Community 11]]
- [[_COMMUNITY_Community 12|Community 12]]
- [[_COMMUNITY_Community 13|Community 13]]
- [[_COMMUNITY_Community 14|Community 14]]
- [[_COMMUNITY_Community 15|Community 15]]
- [[_COMMUNITY_Community 16|Community 16]]
- [[_COMMUNITY_Community 17|Community 17]]
- [[_COMMUNITY_Community 18|Community 18]]
- [[_COMMUNITY_Community 19|Community 19]]
- [[_COMMUNITY_Community 20|Community 20]]
- [[_COMMUNITY_Community 21|Community 21]]
- [[_COMMUNITY_Community 22|Community 22]]
- [[_COMMUNITY_Community 23|Community 23]]
- [[_COMMUNITY_Community 24|Community 24]]
- [[_COMMUNITY_Community 25|Community 25]]
- [[_COMMUNITY_Community 26|Community 26]]
- [[_COMMUNITY_Community 27|Community 27]]
- [[_COMMUNITY_Community 28|Community 28]]
- [[_COMMUNITY_Community 29|Community 29]]
- [[_COMMUNITY_Community 30|Community 30]]
- [[_COMMUNITY_Community 31|Community 31]]
- [[_COMMUNITY_Community 32|Community 32]]
- [[_COMMUNITY_Community 33|Community 33]]
- [[_COMMUNITY_Community 34|Community 34]]
- [[_COMMUNITY_Community 35|Community 35]]
- [[_COMMUNITY_Community 36|Community 36]]
- [[_COMMUNITY_Community 37|Community 37]]
- [[_COMMUNITY_Community 38|Community 38]]
- [[_COMMUNITY_Community 39|Community 39]]
- [[_COMMUNITY_Community 40|Community 40]]
- [[_COMMUNITY_Community 41|Community 41]]
- [[_COMMUNITY_Community 42|Community 42]]
- [[_COMMUNITY_Community 43|Community 43]]
- [[_COMMUNITY_Community 44|Community 44]]
- [[_COMMUNITY_Community 45|Community 45]]
- [[_COMMUNITY_Community 46|Community 46]]
- [[_COMMUNITY_Community 47|Community 47]]
- [[_COMMUNITY_Community 48|Community 48]]
- [[_COMMUNITY_Community 49|Community 49]]
- [[_COMMUNITY_Community 50|Community 50]]
- [[_COMMUNITY_Community 51|Community 51]]
- [[_COMMUNITY_Community 52|Community 52]]
- [[_COMMUNITY_Community 53|Community 53]]
- [[_COMMUNITY_Community 54|Community 54]]
- [[_COMMUNITY_Community 55|Community 55]]
- [[_COMMUNITY_Community 56|Community 56]]
- [[_COMMUNITY_Community 57|Community 57]]
- [[_COMMUNITY_Community 58|Community 58]]
- [[_COMMUNITY_Community 59|Community 59]]
- [[_COMMUNITY_Community 60|Community 60]]
- [[_COMMUNITY_Community 61|Community 61]]
- [[_COMMUNITY_Community 62|Community 62]]
- [[_COMMUNITY_Community 63|Community 63]]
- [[_COMMUNITY_Community 64|Community 64]]
- [[_COMMUNITY_Community 65|Community 65]]
- [[_COMMUNITY_Community 66|Community 66]]
- [[_COMMUNITY_Community 67|Community 67]]
- [[_COMMUNITY_Community 68|Community 68]]
- [[_COMMUNITY_Community 69|Community 69]]
- [[_COMMUNITY_Community 70|Community 70]]
- [[_COMMUNITY_Community 71|Community 71]]
- [[_COMMUNITY_Community 72|Community 72]]
- [[_COMMUNITY_Community 73|Community 73]]
- [[_COMMUNITY_Community 74|Community 74]]
- [[_COMMUNITY_apply_crm_create_by_scope|apply_crm_create_by_scope]]
- [[_COMMUNITY_opportunity_follow.py|opportunity_follow.py]]
- [[_COMMUNITY_Community 77|Community 77]]
- [[_COMMUNITY_Community 78|Community 78]]
- [[_COMMUNITY_PlCarrier|PlCarrier]]
- [[_COMMUNITY_resolve_crm_product|resolve_crm_product]]
- [[_COMMUNITY_customer_follow.py|customer_follow.py]]
- [[_COMMUNITY_list_duty_staff_users|list_duty_staff_users]]
- [[_COMMUNITY_Community 83|Community 83]]
- [[_COMMUNITY_Community 84|Community 84]]
- [[_COMMUNITY_allocate_next_biz_no|allocate_next_biz_no]]
- [[_COMMUNITY_Community 86|Community 86]]
- [[_COMMUNITY_Community 87|Community 87]]
- [[_COMMUNITY_CrmProduct|CrmProduct]]
- [[_COMMUNITY_pl_ocr_service.py|pl_ocr_service.py]]
- [[_COMMUNITY_WechatMessageService|WechatMessageService]]
- [[_COMMUNITY_unsettled_plans_q_filter|unsettled_plans_q_filter]]
- [[_COMMUNITY_Community 92|Community 92]]
- [[_COMMUNITY_api_request_log_middleware.py|api_request_log_middleware.py]]
- [[_COMMUNITY_assert_contract_editable_for_update|assert_contract_editable_for_update]]
- [[_COMMUNITY_test_pl_public_link_archived.py|test_pl_public_link_archived.py]]
- [[_COMMUNITY_minio_url.py|minio_url.py]]
- [[_COMMUNITY_contact.py|contact.py]]
- [[_COMMUNITY_LocalStorage|LocalStorage]]
- [[_COMMUNITY_redis_client.py|redis_client.py]]
- [[_COMMUNITY_price_letter_detail|price_letter_detail]]
- [[_COMMUNITY_tenant.py|tenant.py]]
- [[_COMMUNITY_BaseStorage|BaseStorage]]
- [[_COMMUNITY_pl_internal_customer.py|pl_internal_customer.py]]
- [[_COMMUNITY_apply_crm_create_by_scope|apply_crm_create_by_scope]]
- [[_COMMUNITY_pool_customer_assign|pool_customer_assign]]
- [[_COMMUNITY_site.py|site.py]]
- [[_COMMUNITY_apply_pl_scope|apply_pl_scope]]
- [[_COMMUNITY_statistics.py|statistics.py]]
- [[_COMMUNITY_test_pl_plan_stop_rules.py|test_pl_plan_stop_rules.py]]
- [[_COMMUNITY_run_auto_generate_monthly_plans|run_auto_generate_monthly_plans]]
- [[_COMMUNITY_merge_duplicate_crm_customers.py|merge_duplicate_crm_customers.py]]
- [[_COMMUNITY_dict_type.py|dict_type.py]]
- [[_COMMUNITY_dept.py|dept.py]]
- [[_COMMUNITY_site.py|site.py]]
- [[_COMMUNITY_Community 116|Community 116]]
- [[_COMMUNITY_Community 118|Community 118]]
- [[_COMMUNITY_Community 119|Community 119]]
- [[_COMMUNITY_oper_log_decorator.py|oper_log_decorator.py]]
- [[_COMMUNITY_customer_follow.py|customer_follow.py]]
- [[_COMMUNITY_post.py|post.py]]
- [[_COMMUNITY_customer_options|customer_options]]
- [[_COMMUNITY_LocalStorage|LocalStorage]]
- [[_COMMUNITY_ethnic.py|ethnic.py]]
- [[_COMMUNITY_BaseStorage|BaseStorage]]
- [[_COMMUNITY__filter_export_rows_by_ids|_filter_export_rows_by_ids]]
- [[_COMMUNITY_resolve_crm_product|resolve_crm_product]]
- [[_COMMUNITY_inventory_id.py|inventory_id.py]]
- [[_COMMUNITY_list_contacts|list_contacts]]
- [[_COMMUNITY_get_db_current_user_optional|get_db_current_user_optional]]
- [[_COMMUNITY_Community 138|Community 138]]
- [[_COMMUNITY_get_current_user_by_token|get_current_user_by_token]]
- [[_COMMUNITY_UserRole|UserRole]]
- [[_COMMUNITY_clear_pl_plan_instance_data.py|clear_pl_plan_instance_data.py]]
- [[_COMMUNITY_duty_schedule.py|duty_schedule.py]]
- [[_COMMUNITY_duty.py|duty.py]]
- [[_COMMUNITY_Community 147|Community 147]]
- [[_COMMUNITY_Community 151|Community 151]]
- [[_COMMUNITY_customer_options|customer_options]]
- [[_COMMUNITY_pl_feedback_brand_qty.py|pl_feedback_brand_qty.py]]
- [[_COMMUNITY_LocalStorage|LocalStorage]]
- [[_COMMUNITY_WechatMessageService|WechatMessageService]]
- [[_COMMUNITY_.to_tenant_user_dict|.to_tenant_user_dict]]
- [[_COMMUNITY_get_client_ip|get_client_ip]]
- [[_COMMUNITY_codeblock1 (iflytekshanxia2.0backend)|code:block1 (/iflytek/shanxia2.0/backend)]]
- [[_COMMUNITY_resolve_create_time_bounds|resolve_create_time_bounds]]
- [[_COMMUNITY_test_pl_vehicle_personnel_photo_schema.py|test_pl_vehicle_personnel_photo_schema.py]]
- [[_COMMUNITY_crm_quote_pdf.py|crm_quote_pdf.py]]
- [[_COMMUNITY_shanxia2.0 后端骨架(FastAPI)|shanxia2.0 后端骨架(FastAPI)]]
- [[_COMMUNITY_api_crypto_middleware.py|api_crypto_middleware.py]]
- [[_COMMUNITY_order_status_compat.py|order_status_compat.py]]
- [[_COMMUNITY_shanxia2.0 Backend 生产部署说明|shanxia2.0 Backend 生产部署说明]]
- [[_COMMUNITY_db_collation.py|db_collation.py]]
- [[_COMMUNITY___init__.py|__init__.py]]
- [[_COMMUNITY___init__.py|__init__.py]]
- [[_COMMUNITY_codebash (cd pathtoshanxia2.0)|code:bash (cd /path/to/shanxia2.0)]]
- [[_COMMUNITY_codebash (.start-prod.sh status 查看状态)|code:bash (./start-prod.sh status # 查看状态)]]
- [[_COMMUNITY_codebash (curl -s http127.0.0.19111health)|code:bash (curl -s http://127.0.0.1:9111/health)]]
- [[_COMMUNITY_codebash (cd iflytekshanxia2.0backend)|code:bash (cd /iflytek/shanxia2.0/backend)]]
- [[_COMMUNITY_codebash (python -m venv venv)|code:bash (python -m venv venv)]]
- [[_COMMUNITY_codebash (pip install -r requirements.txt)|code:bash (pip install -r requirements.txt)]]
- [[_COMMUNITY_codeenv ( 数据库配置)|code:env (# 数据库配置)]]
- [[_COMMUNITY_codebash (uvicorn app.mainapp --reload --port 8000)|code:bash (uvicorn app.main:app --reload --port 8000)]]
- [[_COMMUNITY_BaseModel|BaseModel]]
- [[_COMMUNITY_PlanResourceSnapshotMixin|PlanResourceSnapshotMixin]]
## God Nodes (most connected - your core abstractions)
1. `BaseModel` - 528 edges
2. `get_tenant_no()` - 384 edges
3. `DbUserContext` - 308 edges
4. `success_response()` - 279 edges
5. `error_response()` - 274 edges
6. `generate_uuid()` - 212 edges
7. `BxUserContext` - 204 edges
8. `crm_user_info()` - 138 edges
9. `ExportValidationError` - 108 edges
10. `PlPlan` - 106 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]
scripts/migrate_bx_data.py → app/core/config.py
- `MigrationStats` --uses--> `Settings` [INFERRED]
scripts/migrate_crm_clue.py → app/core/config.py
- `StepStats` --uses--> `Settings` [INFERRED]
scripts/migrate_crm_clue.py → app/core/config.py
## Import Cycles
- None detected.
## Communities (175 total, 15 thin omitted)
### Community 0 - "Community 0"
Cohesion: 0.05
Nodes (101): archive_plan(), _build_plan_archive_export_rows(), cancel_plan(), cancel_plan_wait_notice(), count_plans_by_contract(), create_from_contract(), create_plan(), _determine_plan_type() (+93 more)
### Community 1 - "Community 1"
Cohesion: 0.07
Nodes (39): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, 接口菜单权限守卫。super_admin 直接放行。, require_menu_code(), ContractApproverSettingSaveBody, ContractApprovalActionBody, ContractApprovalPassBody, ContractApprovalRejectBody, ContractApprovalTransferBody (+31 more)
### Community 2 - "Community 2"
Cohesion: 0.20
Nodes (19): allocate_reimburse_title_seq(), format_reimburse_title(), generate_title(), is_auto_reimburse_title(), parse_optional_date(), parse_reimburse_date(), preview_reimburse_title_seq(), date (+11 more)
### Community 3 - "Community 3"
Cohesion: 0.06
Nodes (98): attachment_download_url(), attachment_preview_url(), create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite(), create_post() (+90 more)
### Community 4 - "Community 4"
Cohesion: 0.09
Nodes (75): _apply_list_filters(), assign_opportunities(), batch_update_expect_date(), batch_update_stage(), change_stage(), create_opportunity(), _decimal_value(), _enrich_user_names() (+67 more)
### Community 5 - "Community 5"
Cohesion: 0.08
Nodes (73): create_plan_full(), _generate_notify_message(), 创建运输计划(完整表单:供方/需方 + 产品库产品 + 可选预选车辆,不自动安排运输), update_plan(), PlPlan, PlPlanProduct, 计划产品明细表 pl_plan_product, PlanArchiveFreightBlock (+65 more)
### Community 6 - "Community 6"
Cohesion: 0.08
Nodes (59): customer_create(), customer_update(), follow_by_customer(), follow_detail(), convert_clue(), assign_customer(), batch_claim_customers(), check_duplicate_customer() (+51 more)
### Community 7 - "Community 7"
Cohesion: 0.11
Nodes (43): Session, respond_xlsx(), approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse(), export_approved_by_me_reimburses() (+35 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)
### Community 9 - "Community 9"
Cohesion: 0.09
Nodes (51): 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() (+43 more)
### Community 10 - "Community 10"
Cohesion: 0.09
Nodes (35): export_depts(), export_menus(), export_posts(), export_tenants(), export_users(), list_tenants(), 导出职位列表(当前筛选全量,或 ids 已选)。, 导出租户列表(当前筛选全量,或 ids 已选)。 (+27 more)
### Community 11 - "Community 11"
Cohesion: 0.15
Nodes (39): PlVehicleUreaApply, PlVehicleUreaDisburse, 车辆尿素申请 pl_vehicle_urea_apply, 车辆尿素发放登记 pl_vehicle_urea_disburse, Decimal, VehicleUreaApplyCreate, VehicleUreaApplyRead, VehicleUreaApplyUpdate (+31 more)
### Community 12 - "Community 12"
Cohesion: 0.07
Nodes (45): AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest, LoginResponse, Pydantic schemas - 用户认证, ResetPasswordRequest, UserCreate (+37 more)
### Community 13 - "Community 13"
Cohesion: 0.11
Nodes (43): parse_date_str(), apply_stop_dibang_options(), _create_db_inventory(), _create_db_plan(), _delivery_stop_products(), DibangInventoryLinkResult, _direction_to_business_type(), find_monthly_db_plan() (+35 more)
### Community 14 - "Community 14"
Cohesion: 0.09
Nodes (36): approve_carrier(), create_carrier(), get_carrier(), update_carrier(), PlCarrier, carrier_to_read(), CarrierBase, CarrierCreate (+28 more)
### Community 15 - "Community 15"
Cohesion: 0.11
Nodes (15): BxReimburseApply, BxReimburseApproval, BxReimburseDetail, 报销单勾选的发票附件(同一发票可勾选多个附件,各占一条)。, ReimburseApplyOut, ReimburseInvoiceBriefOut, ReimburseInvoiceLinkIn, Any (+7 more)
### Community 16 - "Community 16"
Cohesion: 0.04
Nodes (127): clue_export(), clue_import(), clue_list(), clue_mine(), clue_to_follow(), clue_today_new(), contact_birthday(), contact_decision() (+119 more)
### Community 17 - "Community 17"
Cohesion: 0.12
Nodes (46): bind_vehicle_driver(), CarrierExportBody, create_driver(), create_personnel(), delete_driver(), delete_personnel(), DriverExportBody, export_carriers() (+38 more)
### Community 18 - "Community 18"
Cohesion: 0.12
Nodes (40): _advance_list_filters(), advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _export_advance_rows() (+32 more)
### Community 19 - "Community 19"
Cohesion: 0.10
Nodes (29): create_vehicle(), export_vehicles(), get_vehicle(), list_vehicles(), 导出车辆列表(当前筛选全量,或 ids 已选)。, update_vehicle(), _vehicle_to_detail(), _vehicle_to_read() (+21 more)
### Community 20 - "Community 20"
Cohesion: 0.16
Nodes (33): dump_export_row(), issue_status_label(), Any, status_label(), advance_issue_stats(), batch_offset(), export_advance_issues(), export_advance_issues_xlsx() (+25 more)
### Community 21 - "Community 21"
Cohesion: 0.13
Nodes (44): create_apply(), create_record(), update_apply(), PlVehicleRechargeApply, PlVehicleRechargeRecord, 车辆ETC/加油充值申请 pl_vehicle_recharge_apply, 车辆ETC/加油充值发放登记 pl_vehicle_recharge_record, Decimal (+36 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.14
Nodes (26): load_brand_qtys_by_plan_product_ids(), persist_plan_product_brand_qtys(), Any, Decimal, Session, 按计划产品明细 ID 批量加载归档品牌数量(brandId/brandName/qty)。, 软删旧品牌量行后按归档结果插入;无品牌约定则只软删不插入。, validate_brand_qty_rows() (+18 more)
### Community 24 - "Community 24"
Cohesion: 0.19
Nodes (16): DictEnsureError, ensure_dict_data(), ensure_remove_dict_data(), Session, 业务页字典 ensure:白名单内按 label 复用或插入 sys_dict_data。, label miss, but preferred value already exists → reuse, no insert, test_ensure_honors_explicit_preferred_value_on_insert(), test_ensure_inserts_new_with_value_equals_label() (+8 more)
### Community 25 - "Community 25"
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)
### 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)
### Community 28 - "Community 28"
Cohesion: 0.05
Nodes (96): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), _generate_settlement_no(), get_settlement(), get_settlement_approval_flow() (+88 more)
### Community 29 - "Community 29"
Cohesion: 0.07
Nodes (70): CrmProductBrand, PlPlanDelivery, PlPlanDeliveryProduct, PlPlanLoad, PlPlanLoadProduct, PlTransportDriverStopFeedback, PlTransportSiteStopFeedback, 运输计划-装货段 pl_plan_load(plan 1:1) (+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.17
Nodes (24): PlanContractGapRead, build_plan_contract_gap_read(), compute_contract_gap_sides(), _demander_gap_expr(), list_plan_contract_gaps(), _load_products_by_plan_ids(), plan_has_contract_gap_exists(), date (+16 more)
### Community 32 - "Community 32"
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.14
Nodes (11): BxAdvanceApply, BxAdvanceApproval, AdvanceService, Any, Session, 同一节点多次审批时,取 approval_time 最新的一条作为当前节点状态。, 返回全部审批动作,按时间正序排列,用于展示完整审批历史。, Any (+3 more)
### Community 34 - "Community 34"
Cohesion: 0.19
Nodes (17): create_workflow(), delete_workflow(), get_workflow(), get_workflow_by_biz_type(), list_workflows(), Session, save_workflow_nodes(), update_workflow() (+9 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.09
Nodes (56): _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() (+48 more)
### Community 37 - "Community 37"
Cohesion: 0.16
Nodes (32): check_document_expiry(), document_reminder_stats(), get_inventory_ledger(), get_summary(), list_document_reminders(), list_transactions(), list_warnings(), date (+24 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.20
Nodes (15): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+7 more)
### Community 40 - "Community 40"
Cohesion: 0.09
Nodes (37): build_dict_value_from_label(), ensure_dict_data(), format_hhmm(), format_time_label(), grab(), list_duty_staff_users(), normalize_person_name(), _pad_hhmm() (+29 more)
### Community 41 - "Community 41"
Cohesion: 0.15
Nodes (39): export_inbound(), _export_orders(), export_outbound(), _get_by_plan(), get_inbound(), get_inbound_by_plan(), _get_order(), get_outbound() (+31 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)
### Community 43 - "Community 43"
Cohesion: 0.14
Nodes (24): create_invoice(), delete_invoice(), export_invoice_wallets(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices(), Request (+16 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)
### Community 45 - "Community 45"
Cohesion: 0.25
Nodes (55): AttachmentDownloadUrlBody, demo_xlsx_export(), DemoXlsxColumnSpec, DemoXlsxExportBody, DeptCreateBody, DeptExportBody, DeptUpdateBody, DictDataCreateBody (+47 more)
### Community 46 - "Community 46"
Cohesion: 0.35
Nodes (12): ConflictAction, PastePersonnelIn, PasteVehicleIn, 运输计划 - 三方粘贴识别提交 Schema, commit_paste_recognize(), _conflict_map(), _find_personnel_by_id_card(), _find_vehicle_by_plate() (+4 more)
### Community 47 - "Community 47"
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 48 - "Community 48"
Cohesion: 0.08
Nodes (86): 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() (+78 more)
### Community 49 - "Community 49"
Cohesion: 0.14
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)
### Community 50 - "Community 50"
Cohesion: 0.15
Nodes (17): get_pool_record(), list_pool_records(), Any, Session, _row_to_dict(), total_pages(), CrmCustomerPool, check_customer_protect_time() (+9 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.13
Nodes (25): 报销模块认证适配:门户 JWT 用户 → bx 业务上下文。, BxReimburseInvoice, BxReimburseOffset, BxWorkflowNode, 报销(bx)模块数据模型 — 对齐 docs/sql/20260606_bx_tables.sql, filter_current_cycle_approvals(), 审批轮次过滤 — 驳回后重新提交时,进度接口仅展示当前轮次。, 审批进度仅展示当前轮次;完整历史由 get_approval_history 返回。 (+17 more)
### Community 53 - "Community 53"
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.13
Nodes (44): get_plan_related(), PlanRelatedData, _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), export_weighing() (+36 more)
### Community 55 - "Community 55"
Cohesion: 0.07
Nodes (39): API 路由包 — 山峡化工生产一体化门户, export_leaves(), _leave_local_callback(), LeaveExportBody, list_leaves(), 导出请假列表(当前筛选全量,或 ids 已选)。, get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单) (+31 more)
### Community 56 - "Community 56"
Cohesion: 0.07
Nodes (78): _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() (+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 (33): CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), _change_row_to_dict(), create_contract_change(), _enrich_change_rows(), execute_change(), export_contract_changes(), export_contract_templates() (+25 more)
### Community 59 - "Community 59"
Cohesion: 0.20
Nodes (28): _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() (+20 more)
### Community 60 - "Community 60"
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.09
Nodes (59): PlPlanContract, 运输计划-合同关联(分侧多选) pl_plan_contract, DeliveryPrintCustomerOption, PlanContractLink, PlanDeliveryBody, PlanDeliveryRead, PlanLoadBody, PlanLoadRead (+51 more)
### Community 62 - "Community 62"
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 63 - "Community 63"
Cohesion: 0.17
Nodes (27): 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() (+19 more)
### Community 64 - "Community 64"
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 65 - "Community 65"
Cohesion: 0.18
Nodes (36): PlVehicleMaintenanceApply, PlVehicleMaintenanceProcess, 车辆维保申请 pl_vehicle_maintenance_apply, 车辆维保处理登记 pl_vehicle_maintenance_process, VehicleMaintenanceApplyCreate, VehicleMaintenanceApplyRead, VehicleMaintenanceApplyUpdate, VehicleMaintenanceProcessBoardItem (+28 more)
### Community 66 - "Community 66"
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 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.18
Nodes (24): delete_plan(), delete_carrier(), delete_vehicle(), unbind_vehicle_driver(), delete_plan(), _actor_ids(), _actor_names(), assert_row_deletable_by_creator() (+16 more)
### Community 69 - "Community 69"
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 70 - "Community 70"
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 71 - "Community 71"
Cohesion: 0.16
Nodes (24): cancel_apply(), create_apply(), create_process(), delete_applies(), delete_processes(), export_process_board(), get_apply(), get_process() (+16 more)
### Community 72 - "Community 72"
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 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.13
Nodes (28): 地磅 API 路由聚合 — REST 风格,协议对齐原 simple-dibang-xiaoshou。, _apply_plan_update(), AutoGenerateMonthlyResult, _base_query(), create_plan(), export_plans(), get_plan(), _get_plan_by_id_only() (+20 more)
### Community 75 - "apply_crm_create_by_scope"
Cohesion: 0.24
Nodes (13): BxInvoiceLedger, BxInvoiceWalletSummary, InvoiceLedgerService, Any, Decimal, Session, should_skip_release(), summarize_entries() (+5 more)
### Community 76 - "opportunity_follow.py"
Cohesion: 0.08
Nodes (50): operlog_detail(), operlog_export(), operlog_list(), OperLogExportBody, Session, 导出操作日志(当前筛选全量,或 ids 已选)。, 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), _user_info() (+42 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.04
Nodes (102): category_add(), category_delete(), category_tree(), category_update(), clue_import_template(), contact_add(), contact_by_customer(), contact_delete() (+94 more)
### Community 79 - "PlCarrier"
Cohesion: 0.31
Nodes (14): create_pool_rule(), delete_pool_rules(), execute_pool_rules(), _execute_single_rule(), get_pool_rule(), list_pool_rules(), Any, Session (+6 more)
### Community 81 - "customer_follow.py"
Cohesion: 0.19
Nodes (20): statistics_follow(), statistics_industry(), statistics_level(), statistics_overview(), statistics_owner(), statistics_source(), statistics_trend(), _customer_base_query() (+12 more)
### Community 82 - "list_duty_staff_users"
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 83 - "Community 83"
Cohesion: 0.14
Nodes (32): _advance_contract_after_approval(), approve_contract(), approve_contract_by_contract_id(), approve_pass(), approve_reject(), approve_transfer(), _build_approval_list_filters(), can_user_approve() (+24 more)
### Community 84 - "Community 84"
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.06
Nodes (69): clue_assign(), clue_check_convert(), clue_check_duplicate(), clue_convert(), clue_create(), clue_delete(), clue_detail(), clue_follow_create() (+61 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)
### Community 87 - "Community 87"
Cohesion: 0.29
Nodes (16): ensure_crm_customer_linked_row_in_scope(), ensure_crm_owner_row_in_scope(), Session, CRM 数据权限辅助(负责人 owner_user_id + 标准 create_by/create_dept_id)。, 客户子表(开票信息等):先校验关联客户 owner scope,否则校验 create_by。, _clear_default_for_customer(), create_invoice_info(), get_invoice_info() (+8 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.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.21
Nodes (17): apply_crm_create_by_scope(), _apply_list_filters(), create_supplier_info(), list_all_supplier_info(), list_supplier_info(), Any, Session, CRM 供方信息 CRUD — 对照 CrmSupplierInfoServiceImpl.java (+9 more)
### Community 91 - "unsettled_plans_q_filter"
Cohesion: 0.33
Nodes (11): create_leave(), get_leave(), list_leaves(), Any, Session, _row_to_dict(), soft_delete_leave(), update_leave() (+3 more)
### Community 92 - "Community 92"
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 93 - "api_request_log_middleware.py"
Cohesion: 0.07
Nodes (45): DocumentReminderExportBody, InventoryLedgerExportBody, ApiRequestLogCRUD, Session, list_ethnics(), Any, Session, 民族码表 CRUD(全局 sys_ethnic) (+37 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.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.23
Nodes (14): _claims_from_auth(), _format_body_bytes(), _persist_log(), Any, Request, 统一记录 API 请求/响应出入参的中间件, _redact_obj(), _schedule_persist_log() (+6 more)
### Community 97 - "contact.py"
Cohesion: 0.24
Nodes (7): camel_to_snake(), CRUDBase, get_model_attr(), HistoryCRUD, Any, Session, ModelType
### Community 98 - "LocalStorage"
Cohesion: 0.35
Nodes (11): create_tenant(), get_tenant(), list_tenants(), Any, Session, _row_to_dict(), soft_delete_tenant(), tenant_no_exists() (+3 more)
### Community 99 - "redis_client.py"
Cohesion: 0.16
Nodes (21): PlCert, PlDocumentReminder, 证件到期提醒表 pl_document_reminder, CertRead, SnapshotCertRead, certs_to_read(), list_owner_certs(), list_owner_certs_batch() (+13 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)
### Community 101 - "tenant.py"
Cohesion: 0.28
Nodes (11): assert_products_allowed_for_supplier(), enrich_products_with_hazard_flags(), get_supplier_hazard_flags(), product_allowed(), Any, Session, 批量回填明细行 isToxic/isExplosive(来自产品主数据,供前端切换主体剔除)。, test_dual_requires_both() (+3 more)
### Community 102 - "BaseStorage"
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 103 - "pl_internal_customer.py"
Cohesion: 0.24
Nodes (12): _apply_plan_product_update(), apply_product_snapshot_to_plan(), apply_product_snapshot_to_weighing(), ProductSnapshot, Session, 地磅模块 — CRM 产品解析与快照写入。, 校验 CRM 产品并返回名称/规格快照。新建单据 product_id 必填。 require_on_shelf=False 用于运输计划联动地磅等历, resolve_crm_product() (+4 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)
### Community 105 - "pool_customer_assign"
Cohesion: 0.67
Nodes (3): parse_optional_plan_datetime(), datetime, 运输计划相关日期时间解析:前端 date-picker 仅传 YYYY-MM-DD。
### Community 106 - "site.py"
Cohesion: 0.38
Nodes (10): generate_uuid(), create_oss(), create_oss(), get_oss_by_id(), get_oss_by_url(), Session, 按主键 id 查询附件(兼容旧 CRM 雪花 oss_id 迁入后的记录), 将 fileUrl 或旧 CRM 数字 ossId 解析为 MinIO 相对路径。 门户新上传把相对路径写入业务字段;迁入合同附件仍存数字 ossId (+2 more)
### Community 107 - "apply_pl_scope"
Cohesion: 0.08
Nodes (58): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), CompletedTaskExportBody, create_process_def(), _enrich_task_list(), export_completed_tasks(), export_my_instances() (+50 more)
### Community 108 - "statistics.py"
Cohesion: 0.20
Nodes (24): count_source_rows(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_runtime_settings(), load_settings_env(), load_user_mapping() (+16 more)
### Community 109 - "test_pl_plan_stop_rules.py"
Cohesion: 0.14
Nodes (25): _extract_qty(), _fmt_qty(), Any, Decimal, 运输计划多段:内部客户地磅默认值与数量平衡校验, resolve_stop_dibang_defaults(), _sum_qty(), warn_qty_imbalance() (+17 more)
### Community 111 - "run_auto_generate_monthly_plans"
Cohesion: 0.27
Nodes (11): _generate_plan_no(), 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() (+3 more)
### Community 112 - "merge_duplicate_crm_customers.py"
Cohesion: 0.26
Nodes (22): Connection, backup_tables(), _contact_key(), discover_merge_pairs(), fetch_customer(), _invoice_key(), load_database_url(), main() (+14 more)
### Community 113 - "dict_type.py"
Cohesion: 0.35
Nodes (11): create_dict_type(), dict_type_code_exists(), get_dict_type(), list_dict_types(), Any, Session, 字典类型 CRUD(sys_dict_type), _row_to_dict() (+3 more)
### Community 114 - "dept.py"
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 115 - "site.py"
Cohesion: 0.11
Nodes (18): ApiCryptoMiddleware, ApiRequestLogMiddleware, _db_pool_keepalive_loop(), _error_json(), lifespan(), Exception, Request, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误 (+10 more)
### Community 116 - "Community 116"
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 118 - "Community 118"
Cohesion: 0.18
Nodes (25): 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() (+17 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)
### Community 120 - "oper_log_decorator.py"
Cohesion: 0.16
Nodes (25): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), DbInboundOutbound, DbPurchasePlan, 地磅(db)模块数据模型 — 对齐 docs/sql/db_tables.sql (+17 more)
### Community 121 - "customer_follow.py"
Cohesion: 0.07
Nodes (49): _assert_editable(), _build_public_page(), _format_file_size(), _get_inventory_by_token(), get_public_inventory(), _parse_feedback_images(), Session, UploadFile (+41 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.06
Nodes (61): CRM 报价单 API 路由 — 挂接到 crm.router, RecognizeCertResult, PageResult, ResponseModel, BaseModel, PagedQuery, PagedResponse, InvoiceAttachmentOut (+53 more)
### Community 124 - "LocalStorage"
Cohesion: 0.39
Nodes (10): create_site(), get_site(), list_sites(), Any, Session, _row_to_dict(), site_code_exists(), soft_delete_site() (+2 more)
### Community 125 - "ethnic.py"
Cohesion: 0.04
Nodes (99): _build_driver_url(), get_plan_arrange_info(), 获取计划已安排运输后的司机链接与地磅出入库关联(供查看弹窗复制简述/二维码)。, _attach_history_products(), _build_history_page(), _build_page(), _get_by_token(), _history_status_label() (+91 more)
### Community 129 - "BaseStorage"
Cohesion: 0.12
Nodes (24): _auto_contract_name_body(), generate_contract_name(), 按面板单位全称精确匹配交易主体/客户主数据,取 shortName;对不上则用全称。, 前端预览误用单位全称时,名称片段会等于面板/客户/开票全称。, 按面板供方(partyA)-需方(partyB)生成:{供方简称}-{需方简称}({合同编号})。 - 名称为空:按主数据简称自动生成 - 名, resolve_party_short_name(), _strip_contract_name_no_suffix(), _user_contract_name_uses_party_full_name() (+16 more)
### Community 130 - "_filter_export_rows_by_ids"
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.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 133 - "inventory_id.py"
Cohesion: 0.18
Nodes (14): get_current_time(), parse_datetime(), datetime, DbSequence, _allocate_inbound_outbound_id(), _ensure_sequence_row(), max_numeric_inbound_outbound_id(), next_inbound_outbound_id() (+6 more)
### Community 134 - "list_contacts"
Cohesion: 0.22
Nodes (3): BaseStorage, 带下载文件名的访问 URL;默认实现为普通访问地址。, 浏览器内联预览 URL;默认实现为普通访问地址。
### Community 136 - "get_db_current_user_optional"
Cohesion: 0.09
Nodes (43): Session, recognize_cert(), RecognizeCertBody, cancel_apply(), delete_applies(), delete_records(), get_apply(), get_record() (+35 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 - "get_current_user_by_token"
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 140 - "UserRole"
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)
### 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 145 - "duty_schedule.py"
Cohesion: 0.17
Nodes (33): 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() (+25 more)
### Community 146 - "duty.py"
Cohesion: 0.19
Nodes (16): _enrich_assign_names(), 指定用户时补全 personName(用 nick_name)。, save_day(), DutyAssignmentIn, DutyDaySaveBody, DutyDictEnsureBody, DutyLinkBody, DutySlotSaveIn (+8 more)
### 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 152 - "customer_options"
Cohesion: 0.50
Nodes (4): customer_options(), 客户下拉选项(租户内只读,不做 owner 数据权限), CustomerOptionsBody, 客户下拉选项请求体(租户内只读搜索,不做 owner 数据权限)
### Community 153 - "pl_feedback_brand_qty.py"
Cohesion: 0.14
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 154 - "LocalStorage"
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 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)
### 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 164 - "get_client_ip"
Cohesion: 0.07
Nodes (64): _avatar_url_field(), _build_user_info_payload(), change_current_user_password(), get_current_user_profile(), get_web_auth_menu_codes(), _jwt_user_payload(), logout(), public_quote_share() (+56 more)
### Community 173 - "resolve_create_time_bounds"
Cohesion: 0.06
Nodes (72): ContractGapExportBody, PlanExportBody, _apply_plan_logistics_from_payload(), _apply_transport_arrange_fields(), arrange_transport(), _assert_vehicle_carrier_eligible(), _build_arrange_result(), _build_driver_url() (+64 more)
### Community 179 - "test_pl_vehicle_personnel_photo_schema.py"
Cohesion: 0.27
Nodes (16): add_favorite(), count_active(), find_active(), find_soft_deleted(), list_favorites(), _next_order_num(), normalize_menu_path(), Any (+8 more)
### Community 206 - "crm_quote_pdf.py"
Cohesion: 0.36
Nodes (10): build_quote_html(), _default_value(), _format_date(), _format_discount(), _format_money(), generate_quote_pdf(), _get_pdf_styles(), Any (+2 more)
### Community 207 - "shanxia2.0 后端骨架(FastAPI)"
Cohesion: 0.18
Nodes (10): 1. 创建虚拟环境, 2. 安装依赖, 3. 配置环境变量, 4. 启动服务, API 路由分组, shanxia2.0 后端骨架(FastAPI), 开发规范, 快速开始 (+2 more)
### Community 220 - "api_crypto_middleware.py"
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
Nodes (7): derive_legacy_status_from_three(), derive_three_status_from_legacy(), Decimal, 阶段A兼容:从旧 status 推导三字段。 约束:旧 status 本身混合了支付/配送/订单生命周期,因此只能尽力推断; 若业务侧已有更精确, 阶段A兼容:从三字段反推旧 status(用于旧前端/旧筛选参数兼容)。, ThreeStatus, _to_decimal()
### Community 239 - "shanxia2.0 Backend 生产部署说明"
Cohesion: 0.25
Nodes (7): 1. 上传到服务器, 2. 服务器首次启动, 3. 日常运维, 4. 配置文件, 5. 与 Nginx 配合, 6. 常见问题, shanxia2.0 Backend 生产部署说明
### Community 246 - "db_collation.py"
Cohesion: 0.38
Nodes (6): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时统一排序规则,避免 Illegal mix of collations。, 跨表字符串等值比较(JOIN / WHERE)时统一为 utf8mb4_unicode_ci。, 将列显式设为 utf8mb4_unicode_ci。, unicode_ci()
## Knowledge Gaps
- **30 isolated node(s):** `Config`, `Config`, `Config`, `Config`, `Config` (+25 more)
These have ≤1 connection - possible missing edges or undocumented components.
- **15 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 `site.py` to `Community 0`, `_filter_export_rows_by_ids`, `Community 4`, `Community 5`, `inventory_id.py`, `Community 6`, `Community 8`, `Community 11`, `Community 13`, `Community 14`, `Community 15`, `Community 17`, `duty_schedule.py`, `Community 19`, `Community 21`, `Community 23`, `Community 24`, `Community 25`, `pl_feedback_brand_qty.py`, `Community 28`, `Community 29`, `Community 32`, `Community 33`, `Community 34`, `get_client_ip`, `Community 37`, `Community 36`, `Community 40`, `resolve_create_time_bounds`, `Community 46`, `Community 48`, `Community 50`, `Community 51`, `Community 52`, `Community 54`, `Community 58`, `Community 61`, `Community 62`, `Community 63`, `Community 65`, `Community 66`, `Community 67`, `Community 69`, `Community 72`, `Community 74`, `apply_crm_create_by_scope`, `Community 78`, `PlCarrier`, `Community 83`, `allocate_next_biz_no`, `Community 87`, `CrmProduct`, `pl_ocr_service.py`, `WechatMessageService`, `unsettled_plans_q_filter`, `Community 92`, `api_request_log_middleware.py`, `LocalStorage`, `redis_client.py`, `apply_crm_create_by_scope`, `run_auto_generate_monthly_plans`, `dict_type.py`, `dept.py`, `Community 116`, `Community 118`, `post.py`, `LocalStorage`, `ethnic.py`?**
_High betweenness centrality (0.151) - this node is a cross-community bridge._
- **Why does `BaseModel` connect `customer_options` to `Community 0`, `Community 1`, `resolve_crm_product`, `Community 3`, `Community 5`, `Community 6`, `Community 7`, `get_db_current_user_optional`, `Community 10`, `Community 11`, `Community 12`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 18`, `duty.py`, `Community 20`, `Community 19`, `Community 21`, `customer_options`, `Community 28`, `Community 29`, `Community 31`, `Community 34`, `Community 37`, `Community 39`, `Community 41`, `Community 45`, `resolve_create_time_bounds`, `Community 47`, `Community 46`, `Community 49`, `Community 51`, `Community 54`, `Community 55`, `Community 56`, `Community 58`, `Community 61`, `Community 65`, `Community 71`, `Community 74`, `opportunity_follow.py`, `Community 78`, `customer_follow.py`, `allocate_next_biz_no`, `api_request_log_middleware.py`, `test_pl_public_link_archived.py`, `redis_client.py`, `BaseStorage`, `apply_pl_scope`, `Community 119`, `customer_follow.py`, `ethnic.py`?**
_High betweenness centrality (0.119) - 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`, `customer_follow.py`, `Community 26`, `Community 27`, `Community 30`, `Community 57`?**
_High betweenness centrality (0.119) - 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?**
_644 weakly-connected nodes found - possible documentation gaps or missing edges._
- **Should `Community 0` be split into smaller, more focused modules?**
_Cohesion score 0.04779874213836478 - nodes in this community are weakly interconnected._
- **Should `Community 1` be split into smaller, more focused modules?**
_Cohesion score 0.06666666666666667 - nodes in this community are weakly interconnected._
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_py", "label": "test_pl_plan_archive_stop_service.py", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakerow", "label": "_FakeRow", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L14"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakerow_init", "label": ".__init__()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L15"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakequery", "label": "_FakeQuery", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L20"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakequery_init", "label": ".__init__()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L21"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakequery_filter", "label": ".filter()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L24"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakequery_first", "label": ".first()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L27"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakequery_all", "label": ".all()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L30"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakequery_order_by", "label": ".order_by()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L33"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakedb", "label": "_FakeDb", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L37"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakedb_init", "label": ".__init__()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L38"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_fakedb_query", "label": ".query()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L41"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_test_sum_delivery_outbound_qty", "label": "test_sum_delivery_outbound_qty()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L45"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_test_iter_stop_archive_inventory_lines_internal_load_outbound_and_delivery_inbound", "label": "test_iter_stop_archive_inventory_lines_internal_load_outbound_and_delivery_inbound()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L61"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_test_archive_stop_product_item_schema_aliases", "label": "test_archive_stop_product_item_schema_aliases()", "file_type": "code", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L106"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L1", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_py", "target": "app_schemas_pl_plan", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L3", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_py", "target": "app_services_pl_plan_archive_stop_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_archive_stop_service.py", "source_location": "L8", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_archive_stop_service_py", "target": "users_wuzilong_work_00code_shanxia2Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_py", "label": "public_transport.py", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_resolve_unit_label", "label": "_resolve_unit_label()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L68"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_build_stop_product_reads", "label": "_build_stop_product_reads()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L75"}, {"id": "publicstopproductrow", "label": "PublicStopProductRow", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "brandoption", "label": "BrandOption", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "publictransportstopproductread", "label": "PublicTransportStopProductRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_get_transport_by_token", "label": "_get_transport_by_token()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L127"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_parse_feedback_images", "label": "_parse_feedback_images()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L141"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_format_plan_date", "label": "_format_plan_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L153"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_normalize_main_plate", "label": "_normalize_main_plate()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L163"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_parse_history_date", "label": "_parse_history_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L167"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_as_date", "label": "_as_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L177"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_history_matches_date", "label": "_history_matches_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L187"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_history_status_label", "label": "_history_status_label()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L191"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_build_history_stop_reads", "label": "_build_history_stop_reads()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L199"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "publictransporthistorystopread", "label": "PublicTransportHistoryStopRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_build_driver_url", "label": "_build_driver_url()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L293"}, {"id": "users_wLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_py", "label": "pl_plan_arrange_copy_flags.py", "file_type": "code", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_planarrangecopyflags", "label": "PlanArrangeCopyFlags", "file_type": "code", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L28"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_load_plan_arrange_copy_flags", "label": "load_plan_arrange_copy_flags()", "file_type": "code", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L34"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_arrange_copy_flags.py"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_arrange_copy_flags.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212\u5217\u8868\uff1a\u6279\u91cf\u8ba1\u7b97\u300c\u590d\u5236\u7ed9\u53f8\u673a / \u73b0\u573a / \u78c5\u5355\u4e8c\u7ef4\u7801\u300d\u6309\u94ae\u663e\u793a\u6807\u5fd7\u3002 \u8bed\u4e49\u4e0e\u67e5\u770b\u5f39\u7a97 / usePlPlanArrangeActions / buil", "file_type": "rationale", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_py", "target": "dataclasses", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L10", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L11", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_py", "target": "sqlalchemy_orm", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L13", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_py", "target": "app_models_pl_models", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L15", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_py", "target": "app_services_pl_dibang_bridge_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L23", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_py", "target": "app_services_pl_internal_customer", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L24", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_planarrangecopyflags", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L28", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_load_plan_arrange_copy_flags", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L34", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_load_plan_arrange_copy_flags", "target": "session", "relation": "references", "context": "parameter_type", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_arrange_copy_flags.py", "source_location": "L34", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_arrange_copy_flags_load_plan_arrange_copy_flags", "target": "plplan", "relation": "references", "context": "generic_arg", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_arrangLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_py", "label": "pl_models.py", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcarrier", "label": "PlCarrier", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L28"}, {"id": "base", "label": "Base", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehicle", "label": "PlVehicle", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L57"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plpersonnel", "label": "PlPersonnel", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L84"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportaddress", "label": "PlTransportAddress", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L119"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcustomerstoppref", "label": "PlCustomerStopPref", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L143"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcert", "label": "PlCert", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L168"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pldriver", "label": "PlDriver", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L194"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehiclepersonnel", "label": "PlVehiclePersonnel", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L220"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehicledriver", "label": "PlVehicleDriver", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L241"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplan", "label": "PlPlan", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L266"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplancontract", "label": "PlPlanContract", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L375"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L398"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanproductbrandqty", "label": "PlPlanProductBrandQty", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L457"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanchange", "label": "PlPlanChange", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L479"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanload", "label": "PlPlanLoad", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L501"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L529"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplandelivery", "label": "PlPlanDelivery", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L560"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L589"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransport", "label": "PlTransport", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L625"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportproductfeedback", "label": "PlTransportProductFeedback", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L688"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportproductbrandqty", "label": "PlTransportProductBrandQty", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L709"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportdblink", "label": "PlTransportDbLink", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L732"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_appLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_py", "label": "pl_plan_service.py", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_determine_plan_type", "label": "determine_plan_type()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L48"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_is_ton_product_unit", "label": "is_ton_product_unit()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L56"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_product_quantity", "label": "_product_quantity()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L63"}, {"id": "planproductcreate", "label": "PlanProductCreate", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_product_create_actual_qty", "label": "_product_create_actual_qty()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L73"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_plan_product_actual_qty", "label": "_plan_product_actual_qty()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L79"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_sum_product_actual_quantities", "label": "sum_product_actual_quantities()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L85"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_sum_plan_product_actual_quantities", "label": "sum_plan_product_actual_quantities()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L89"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_estimate_qty_fields", "label": "_estimate_qty_fields()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L93"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_build_plan_product", "label": "build_plan_product()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L104"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_apply_vehicle_snapshot_to_plan_transport", "label": "_apply_vehicle_snapshot_to_plan_transport()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L154"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "plvehicle", "label": "PlVehicle", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_resolve_driver", "label": "_resolve_driver()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L172"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_calc_freight_amount", "label": "_calc_freight_amount()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L218"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_fetch_hazard_flags_map", "label": "fetch_hazard_flags_map()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L239"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_resolve_hazard_flags_from_crm", "label": "resolve_hazard_flagLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_py", "label": "customer_stop_pref.py", "file_type": "code", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_read_customer_stop_pref", "label": "read_customer_stop_pref()", "file_type": "code", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L21"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/customer_stop_pref.py"}, {"id": "dbusercontext", "label": "DbUserContext", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/customer_stop_pref.py"}, {"id": "customerstopprefread", "label": "CustomerStopPrefRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/customer_stop_pref.py"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_py", "target": "fastapi", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_py", "target": "sqlalchemy_orm", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_py", "target": "app_core_database", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L7", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_py", "target": "app_core_db_auth", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L8", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_py", "target": "app_core_tenant_context", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L9", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_py", "target": "app_schemas_pl_customer_stop_pref", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L10", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_py", "target": "app_services_pl_customer_stop_pref_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L11", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_read_customer_stop_pref", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L21", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_read_customer_stop_pref", "target": "session", "relation": "references", "context": "parameter_type", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L21", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_read_customer_stop_pref", "target": "dbusercontext", "relation": "references", "context": "parameter_type", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L21", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_read_customer_stop_pref", "target": "customerstopprefread", "relation": "references", "context": "generic_arg", "confidence": "EXTRACTED", "source_file": "app/api/pl/customer_stop_pref.py", "source_location": "L21", "weight": 1.0}], "raw_calls": [{"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_customer_stop_pref_read_customer_stop_pref", "callee": "STOP_LOAD", "is_member_call": false, "indirect": true, "context": "collLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_py", "label": "plan.py", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_resolve_list_product_name", "label": "_resolve_list_product_name()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L145"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_resolve_create_date", "label": "_resolve_create_date()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L161"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_generate_plan_no", "label": "_generate_plan_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L165"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_format_subpack_slip_no", "label": "_format_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L197"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_normalize_subpack_slip_no", "label": "_normalize_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L201"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_subpack_slip_no_seq", "label": "_subpack_slip_no_seq()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L226"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_ensure_subpack_slip_no", "label": "_ensure_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L234"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_determine_plan_type", "label": "_determine_plan_type()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L266"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_get_plan_type_label", "label": "_get_plan_type_label()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L271"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_generate_notify_message", "label": "_generate_notify_message()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L280"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_plan_product_name_exists", "label": "_plan_product_name_exists()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L300"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_plan_plate_match", "label": "_plan_plate_match()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L314"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_list_plans", "label": "list_plans()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L324"}, {"id": "dbusercontext", "label": "DbUserContext", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "planlistresponse", "label": "PlanListResponse", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_format_plan_delivery_date_for_export", "label": "_format_plan_delivery_date_for_export()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L567"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_load_transports_by_id", "label": "_load_transports_by_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L573"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_load_products_by_plan_id", "label": "_load_products_by_plan_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_locatiLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_py", "label": "pl_transport_stop_feedback_service.py", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_publicstopproductrow", "label": "PublicStopProductRow", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L29"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_publicstopsegment", "label": "PublicStopSegment", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L45"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_build_transport_site_url", "label": "build_transport_site_url()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L65"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_ensure_transport_site_token", "label": "ensure_transport_site_token()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L70"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_transport_stop_feedback_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_rotate_transport_site_token", "label": "rotate_transport_site_token()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L78"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_parse_urls", "label": "_parse_urls()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L84"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_dump_urls", "label": "_dump_urls()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L96"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_direction_label", "label": "_direction_label()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L103"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_sum_stop_qty", "label": "_sum_stop_qty()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L112"}, {"id": "any", "label": "Any", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_transport_stop_feedback_service.py"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_transport_stop_feedback_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_stop_product_row_from_load", "label": "_stop_product_row_from_load()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L123"}, {"id": "plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_transport_stop_feedback_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_stop_product_row_from_delivery", "label": "_stop_product_row_from_delivery()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L138"}, {"id": "plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_transport_stop_feedback_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_parse_product_feedbacks", "label": "_parse_product_feedbacks()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L153"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_dump_product_feedbacks", "label": "_dump_product_feedbacks()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_serLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_py", "label": "pl_freight_settlement_service.py", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_resolve_user_display_name", "label": "_resolve_user_display_name()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L44"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_freight_settlement_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_occupied_transport_ids_subquery", "label": "_occupied_transport_ids_subquery()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L54"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_get_settlement_row", "label": "get_settlement_row()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L71"}, {"id": "plfreightsettlement", "label": "PlFreightSettlement", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_freight_settlement_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_get_settlement_by_transport_id", "label": "get_settlement_by_transport_id()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L95"}, {"id": "any", "label": "Any", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_freight_settlement_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_unsettled_plans_q_filter", "label": "unsettled_plans_q_filter()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L135"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_list_unsettled_plans", "label": "list_unsettled_plans()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L147"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_resolve_transports_for_create", "label": "_resolve_transports_for_create()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L230"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_freight_settlement_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_create_settlement", "label": "create_settlement()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L280"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_recalc_settlement_total_freight_from_links", "label": "_recalc_settlement_total_freight_from_links()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L324"}, {"id": "datetime", "label": "datetime", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_freight_settlement_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_sync_draft_settlement_freight_for_transport", "label": "sync_draft_settlement_freight_for_transport()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L357"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_freight_settlement_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_refresh_draft_settlement_freight", "label": "refresh_draft_settlement_freight()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L404"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_freight_settlement_service_delete_draft_settlement", "label": "delete_draft_settlement()", "file_type": "code", "source_file": "app/services/pl_freight_settlement_service.py", "source_location": "L455"}, {"id": "users_wuzilongLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_py", "label": "plan.py", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_resolve_list_product_name", "label": "_resolve_list_product_name()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L134"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_resolve_create_date", "label": "_resolve_create_date()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L150"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_generate_plan_no", "label": "_generate_plan_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L154"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_format_subpack_slip_no", "label": "_format_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L186"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_normalize_subpack_slip_no", "label": "_normalize_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L190"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_subpack_slip_no_seq", "label": "_subpack_slip_no_seq()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L215"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_ensure_subpack_slip_no", "label": "_ensure_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L223"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_determine_plan_type", "label": "_determine_plan_type()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L255"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_get_plan_type_label", "label": "_get_plan_type_label()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L260"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_generate_notify_message", "label": "_generate_notify_message()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L269"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_plan_product_name_exists", "label": "_plan_product_name_exists()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L289"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_plan_plate_match", "label": "_plan_plate_match()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L303"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_list_plans", "label": "list_plans()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L313"}, {"id": "dbusercontext", "label": "DbUserContext", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "planlistresponse", "label": "PlanListResponse", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_format_plan_delivery_date_for_export", "label": "_format_plan_delivery_date_for_export()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L556"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_load_transports_by_id", "label": "_load_transports_by_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L562"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_load_products_by_plan_id", "label": "_load_products_by_plan_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_locatiLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_py", "label": "pl_inventory_service.py", "file_type": "code", "source_file": "app/services/pl_inventory_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_qty_delta_for_plan", "label": "qty_delta_for_plan()", "file_type": "code", "source_file": "app/services/pl_inventory_service.py", "source_location": "L23"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_inventory_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_get_or_create_inventory", "label": "get_or_create_inventory()", "file_type": "code", "source_file": "app/services/pl_inventory_service.py", "source_location": "L31"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_inventory_service.py"}, {"id": "plinventory", "label": "PlInventory", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_inventory_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_apply_brand_stock_change", "label": "apply_brand_stock_change()", "file_type": "code", "source_file": "app/services/pl_inventory_service.py", "source_location": "L79"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_inventory_service.py"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_inventory_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_reverse_plan_inventory_postings", "label": "reverse_plan_inventory_postings()", "file_type": "code", "source_file": "app/services/pl_inventory_service.py", "source_location": "L147"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_apply_archive_inventory_for_plan", "label": "apply_archive_inventory_for_plan()", "file_type": "code", "source_file": "app/services/pl_inventory_service.py", "source_location": "L186"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_apply_archive_inventory_for_plan_stops", "label": "apply_archive_inventory_for_plan_stops()", "file_type": "code", "source_file": "app/services/pl_inventory_service.py", "source_location": "L252"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_rationale_1", "label": "\u8ba1\u5212\u5f52\u6863\u6309\u4ea7\u54c1+\u54c1\u724c\u5199\u5165\u5e93\u5b58\u53f0\u8d26\u4e0e\u6d41\u6c34\u3002 \u76f4\u9500\u5355 (direct) \u9996\u671f\u4e0d\u8bb0\u8d26\uff1b\u5165\u5e93\u589e\u52a0\u3001\u51fa\u5e93\u6263\u51cf\uff08\u5141\u8bb8\u8d1f\u5e93\u5b58\uff0c\u4e0d\u505a\u4e0d\u8db3\u62e6\u622a\uff09\u3002 \u8c03\u6574\u5f52\u6863\u65f6\u5148\u6309 plan_i", "file_type": "rationale", "source_file": "app/services/pl_inventory_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_rationale_154", "label": "\u51b2\u9500\u8be5\u8ba1\u5212\u5df2\u4ea7\u751f\u7684\u5e93\u5b58\u6d41\u6c34\uff08\u8c03\u6574\u5f52\u6863\u524d\u8c03\u7528\uff09\u3002", "file_type": "rationale", "source_file": "app/services/pl_inventory_service.py", "source_location": "L154"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_rationale_194", "label": "\u5f52\u6863\u540e\u6309\u54c1\u724c\u91cf\uff08\u6216\u65e0\u54c1\u724c actual_qty\uff09\u843d\u8d26\uff1b\u5148\u51b2\u9500\u65e7\u6d41\u6c34\u518d\u91cd\u8bb0\u3002", "file_type": "rationale", "source_file": "app/services/pl_inventory_service.py", "source_location": "L194"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_inventory_service.py", "source_location": "L6", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_inventory_service.py", "source_location": "L7", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_inventory_service_py", "target": "sqlalchemy_orm", "relation": "imports_from", "context": "import", "confidence"Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_py", "label": "pl_transport_stop_feedback_service.py", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_publicstopproductrow", "label": "PublicStopProductRow", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L29"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_publicstopsegment", "label": "PublicStopSegment", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L45"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_build_transport_site_url", "label": "build_transport_site_url()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L65"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_ensure_transport_site_token", "label": "ensure_transport_site_token()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L70"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_transport_stop_feedback_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_rotate_transport_site_token", "label": "rotate_transport_site_token()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L78"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_parse_urls", "label": "_parse_urls()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L84"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_dump_urls", "label": "_dump_urls()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L96"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_direction_label", "label": "_direction_label()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L103"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_sum_stop_qty", "label": "_sum_stop_qty()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L112"}, {"id": "any", "label": "Any", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_transport_stop_feedback_service.py"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_transport_stop_feedback_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_stop_product_row_from_load", "label": "_stop_product_row_from_load()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L123"}, {"id": "plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_transport_stop_feedback_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_stop_product_row_from_delivery", "label": "_stop_product_row_from_delivery()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L138"}, {"id": "plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_transport_stop_feedback_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_parse_product_feedbacks", "label": "_parse_product_feedbacks()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_service.py", "source_location": "L153"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_transport_stop_feedback_service_dump_product_feedbacks", "label": "_dump_product_feedbacks()", "file_type": "code", "source_file": "app/services/pl_transport_stop_feedback_serLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_py", "label": "transport.py", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportbase", "label": "TransportBase", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L18"}, {"id": "basemodel", "label": "BaseModel", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportcreate", "label": "TransportCreate", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L42"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportstopdibangoption", "label": "TransportStopDibangOption", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L47"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportarrange", "label": "TransportArrange", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L54"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportinventorylinkread", "label": "TransportInventoryLinkRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L89"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportsitelinkread", "label": "TransportSiteLinkRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L101"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportupdate", "label": "TransportUpdate", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L115"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportdriverproductfeedbackread", "label": "TransportDriverProductFeedbackRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L139"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportstopfeedbackread", "label": "TransportStopFeedbackRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L155"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportdriverstopproductfeedbackread", "label": "TransportDriverStopProductFeedbackRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L169"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportread", "label": "TransportRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L182"}, {"id": "planresourcesnapshotmixin", "label": "PlanResourceSnapshotMixin", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportioorderbrief", "label": "TransportIoOrderBrief", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L210"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportarrangeresult", "label": "TransportArrangeResult", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L220"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_planarrangeinforead", "label": "PlanArrangeInfoRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L231"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportwithplans", "label": "TransportWithPlans", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L243"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportfeedback", "label": "TransportFeedback", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L252"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportproductfeedbackitem", "label": "PublicTransportProductFeedbackItem", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L261"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportfeedback", "label": "PublicTransportFeedback", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L268"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportdriverstopproductfeedbackitem", "label": "PublicTransportDriverStopProductFeedbackItem", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L276"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_sLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "label": "test_pl_transport_stop_feedback.py", "file_type": "code", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_parse_and_dump_driver_stop_product_feedbacks", "label": "test_parse_and_dump_driver_stop_product_feedbacks()", "file_type": "code", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L11"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "label": "test_save_site_stop_feedback_requires_quantity_before_attachments()", "file_type": "code", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L27"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_product_qty_before_attachments", "label": "test_save_site_stop_feedback_requires_product_qty_before_attachments()", "file_type": "code", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L42"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "pytest", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "app_services_pl_transport_stop_feedback_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_parse_and_dump_driver_stop_product_feedbacks", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L11", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L27", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_product_qty_before_attachments", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L42", "weight": 1.0}], "raw_calls": [{"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_parse_and_dump_driver_stop_product_feedbacks", "callee": "_dump_product_feedbacks", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L12", "receiver": null}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_parse_and_dump_driver_stop_product_feedbacks", "callee": "_parse_product_feedbacks", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L21", "receiver": null}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "callee": "raises", "is_member_call": true, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L28", "receiver": "pytest"}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "callee": "ValueError", "is_member_call": false, "indirect": true, "context": "argument", "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L28"}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "callee": "save_site_stop_feedback", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "sourceLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_py", "label": "test_pl_customer_stop_pref_service.py", "file_type": "code", "source_file": "tests/test_pl_customer_stop_pref_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_skips_empty_customer", "label": "test_build_items_skips_empty_customer()", "file_type": "code", "source_file": "tests/test_pl_customer_stop_pref_service.py", "source_location": "L5"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_load_and_delivery_independent", "label": "test_build_items_load_and_delivery_independent()", "file_type": "code", "source_file": "tests/test_pl_customer_stop_pref_service.py", "source_location": "L15"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_same_delivery_customer_last_wins", "label": "test_build_items_same_delivery_customer_last_wins()", "file_type": "code", "source_file": "tests/test_pl_customer_stop_pref_service.py", "source_location": "L42"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_py", "target": "app_services_pl_customer_stop_pref_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_customer_stop_pref_service.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_skips_empty_customer", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_customer_stop_pref_service.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_load_and_delivery_independent", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_customer_stop_pref_service.py", "source_location": "L15", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_same_delivery_customer_last_wins", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_customer_stop_pref_service.py", "source_location": "L42", "weight": 1.0}], "raw_calls": [{"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_skips_empty_customer", "callee": "build_stop_pref_upsert_items", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_customer_stop_pref_service.py", "source_location": "L6", "receiver": null}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_load_and_delivery_independent", "callee": "build_stop_pref_upsert_items", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_customer_stop_pref_service.py", "source_location": "L16", "receiver": null}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_same_delivery_customer_last_wins", "callee": "build_stop_pref_upsert_items", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_customer_stop_pref_service.py", "source_location": "L43", "receiver": null}], "callable_nids": ["users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_load_and_delivery_independent", "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_same_delivery_customer_last_wins", "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_customer_stop_pref_service_test_build_items_skips_empty_customer"]}
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_py", "label": "transport.py", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportbase", "label": "TransportBase", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L18"}, {"id": "basemodel", "label": "BaseModel", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportcreate", "label": "TransportCreate", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L42"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportstopdibangoption", "label": "TransportStopDibangOption", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L47"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportarrange", "label": "TransportArrange", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L54"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportinventorylinkread", "label": "TransportInventoryLinkRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L89"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportsitelinkread", "label": "TransportSiteLinkRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L101"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportupdate", "label": "TransportUpdate", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L115"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportdriverproductfeedbackread", "label": "TransportDriverProductFeedbackRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L139"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportstopfeedbackread", "label": "TransportStopFeedbackRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L155"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportdriverstopproductfeedbackread", "label": "TransportDriverStopProductFeedbackRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L169"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportread", "label": "TransportRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L182"}, {"id": "planresourcesnapshotmixin", "label": "PlanResourceSnapshotMixin", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportioorderbrief", "label": "TransportIoOrderBrief", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L210"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportarrangeresult", "label": "TransportArrangeResult", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L220"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_planarrangeinforead", "label": "PlanArrangeInfoRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L231"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportwithplans", "label": "TransportWithPlans", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L243"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportfeedback", "label": "TransportFeedback", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L252"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportproductfeedbackitem", "label": "PublicTransportProductFeedbackItem", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L261"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportfeedback", "label": "PublicTransportFeedback", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L268"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportdriverstopproductfeedbackitem", "label": "PublicTransportDriverStopProductFeedbackItem", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L276"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_sLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_py", "label": "pl_plan_stop_service.py", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_contract_link", "label": "_contract_link()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L43"}, {"id": "plplancontract", "label": "PlPlanContract", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plancontractlink", "label": "PlanContractLink", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_stop_product", "label": "_load_stop_product()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L51"}, {"id": "plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "planstopproductread", "label": "PlanStopProductRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_delivery_stop_product", "label": "_delivery_stop_product()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L55"}, {"id": "plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_stop_contract_rows_grouped", "label": "load_stop_contract_rows_grouped()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L59"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_contracts_for_stop", "label": "_contracts_for_stop()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L82"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_to_decimal", "label": "_to_decimal()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L97"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_resolve_stop_address_from_library", "label": "resolve_stop_address_from_library()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L106"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_enrich_stop_addresses_from_library", "label": "enrich_stop_addresses_from_library()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L147"}, {"id": "planloadbody", "label": "PlanLoadBody", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plandeliverybody", "label": "PlanDeliveryBody", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_plan_stops_grouped", "label": "load_plan_stops_grouped()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L166"}, {"id": "planloadread", "label": "PlanLoadRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plandeliveryread", "label": "PlanDeliveryRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_servicLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "label": "test_pl_transport_stop_feedback.py", "file_type": "code", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_parse_and_dump_driver_stop_product_feedbacks", "label": "test_parse_and_dump_driver_stop_product_feedbacks()", "file_type": "code", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L11"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "label": "test_save_site_stop_feedback_requires_quantity_before_attachments()", "file_type": "code", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L27"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "pytest", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "app_services_pl_transport_stop_feedback_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_parse_and_dump_driver_stop_product_feedbacks", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L11", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L27", "weight": 1.0}], "raw_calls": [{"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_parse_and_dump_driver_stop_product_feedbacks", "callee": "_dump_product_feedbacks", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L12", "receiver": null}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_parse_and_dump_driver_stop_product_feedbacks", "callee": "_parse_product_feedbacks", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L21", "receiver": null}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "callee": "raises", "is_member_call": true, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L28", "receiver": "pytest"}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "callee": "ValueError", "is_member_call": false, "indirect": true, "context": "argument", "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L28"}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "callee": "save_site_stop_feedback", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L29", "receiver": null}], "callable_nids": ["users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_parse_and_dump_driver_stop_product_feedbacks", "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments"]}
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_py", "label": "public_transport.py", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_resolve_unit_label", "label": "_resolve_unit_label()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L58"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_get_transport_by_token", "label": "_get_transport_by_token()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L65"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_parse_feedback_images", "label": "_parse_feedback_images()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L79"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_format_plan_date", "label": "_format_plan_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L91"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_normalize_main_plate", "label": "_normalize_main_plate()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L101"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_parse_history_date", "label": "_parse_history_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L105"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_as_date", "label": "_as_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L115"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_history_matches_date", "label": "_history_matches_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L125"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_history_status_label", "label": "_history_status_label()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L129"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_build_driver_url", "label": "_build_driver_url()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L137"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_resolve_driver_link_flags", "label": "_resolve_driver_link_flags()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L142"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_resolve_other_personnel", "label": "_resolve_other_personnel()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L154"}, {"id": "publictransportpersonnelread", "label": "PublicTransportPersonnelRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_build_public_page", "label": "_build_public_page()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L183"}, {"id": "publictransportpageread", "label": "PublicTransportPageRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_get_public_transport", "label": "get_public_transport()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L369"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_get_public_transport_history", "label": "get_public_transport_history()", "file_type": "code", "source_file": "app/api/pl/Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_py", "label": "transport.py", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_transport_to_read", "label": "_transport_to_read()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L91"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "transportread", "label": "TransportRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_generate_transport_no", "label": "_generate_transport_no()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L223"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_resolve_driver_info", "label": "_resolve_driver_info()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L247"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_get_vehicle_info", "label": "_get_vehicle_info()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L285"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_assert_vehicle_carrier_eligible", "label": "_assert_vehicle_carrier_eligible()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L335"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_ensure_driver_access_token", "label": "_ensure_driver_access_token()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L370"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_rotate_driver_access_token", "label": "_rotate_driver_access_token()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L378"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_is_rearrange", "label": "_is_rearrange()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L384"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_transport_has_db_links", "label": "_transport_has_db_links()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L395"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_apply_plan_logistics_from_payload", "label": "_apply_plan_logistics_from_payload()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L408"}, {"id": "transportarrange", "label": "TransportArrange", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_resolve_transport_endpoints", "label": "_resolve_transport_endpoints()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L437"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_apply_transport_arrange_fields", "label": "_apply_transport_arrange_fields()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L452"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_build_driver_url", "label": "_build_driver_url()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L486"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_build_arrange_result", "label": "_build_arrange_result()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L491"}, {"id": "transportsitelinkread", "label": "TransportSiteLinkRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "transportinventorylinkread", "label": "TransportInventoryLinkRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "transportioorderbrief", "label": "TransportIoOrderBrief", "file_type": "code", "source_file": "", "source_location": "", "origLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_py", "label": "test_pl_plan_requires_site_link.py", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_fakequery", "label": "_FakeQuery", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L10"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_fakequery_init", "label": ".__init__()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L11"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_fakequery_filter", "label": ".filter()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L14"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_fakequery_first", "label": ".first()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L17"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_fakequery_all", "label": ".all()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L22"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_fakesession", "label": "_FakeSession", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L28"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_fakesession_init", "label": ".__init__()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L29"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_fakesession_query", "label": ".query()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L33"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_plan", "label": "_plan()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L42"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_test_internal_delivery_requires_site_link", "label": "test_internal_delivery_requires_site_link()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L53"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_test_external_stops_do_not_require_site_link", "label": "test_external_stops_do_not_require_site_link()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L62"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_test_legacy_plan_customer_fallback", "label": "test_legacy_plan_customer_fallback()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L71"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_test_internal_customer_names_constant", "label": "test_internal_customer_names_constant()", "file_type": "code", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L77"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_rationale_1", "label": "\u73b0\u573a\u94fe\u63a5\u751f\u6210\u6761\u4ef6\uff1a\u88c5\u8d27/\u9001\u8d27\u6bb5\u542b\u5c71\u5ce1\u6216\u4e91\u680b\u5ba2\u6237", "file_type": "rationale", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_py", "target": "types", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_py", "target": "app_services_pl_internal_customer", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_requires_site_link_fakequery", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_requires_site_link.py", "source_location": "L10", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_py", "label": "plan.py", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_resolve_list_product_name", "label": "_resolve_list_product_name()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L144"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_resolve_create_date", "label": "_resolve_create_date()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L160"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_generate_plan_no", "label": "_generate_plan_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L164"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_format_subpack_slip_no", "label": "_format_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L196"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_normalize_subpack_slip_no", "label": "_normalize_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L200"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_subpack_slip_no_seq", "label": "_subpack_slip_no_seq()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L225"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_ensure_subpack_slip_no", "label": "_ensure_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L233"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_determine_plan_type", "label": "_determine_plan_type()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L265"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_get_plan_type_label", "label": "_get_plan_type_label()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L270"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_generate_notify_message", "label": "_generate_notify_message()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L279"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_plan_product_name_exists", "label": "_plan_product_name_exists()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L299"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_plan_plate_match", "label": "_plan_plate_match()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L313"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_list_plans", "label": "list_plans()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L323"}, {"id": "dbusercontext", "label": "DbUserContext", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "planlistresponse", "label": "PlanListResponse", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_format_plan_delivery_date_for_export", "label": "_format_plan_delivery_date_for_export()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L566"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_load_transports_by_id", "label": "_load_transports_by_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L572"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_load_products_by_plan_id", "label": "_load_products_by_plan_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_locatiLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_py", "label": "pl_models.py", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcarrier", "label": "PlCarrier", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L28"}, {"id": "base", "label": "Base", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehicle", "label": "PlVehicle", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L57"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plpersonnel", "label": "PlPersonnel", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L84"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportaddress", "label": "PlTransportAddress", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L119"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcustomerstoppref", "label": "PlCustomerStopPref", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L143"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcert", "label": "PlCert", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L168"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pldriver", "label": "PlDriver", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L194"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehiclepersonnel", "label": "PlVehiclePersonnel", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L220"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehicledriver", "label": "PlVehicleDriver", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L241"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplan", "label": "PlPlan", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L266"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplancontract", "label": "PlPlanContract", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L375"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L398"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanproductbrandqty", "label": "PlPlanProductBrandQty", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L457"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanchange", "label": "PlPlanChange", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L479"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanload", "label": "PlPlanLoad", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L501"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L529"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplandelivery", "label": "PlPlanDelivery", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L560"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L589"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransport", "label": "PlTransport", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L625"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportproductfeedback", "label": "PlTransportProductFeedback", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L688"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportproductbrandqty", "label": "PlTransportProductBrandQty", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L709"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportdblink", "label": "PlTransportDbLink", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L732"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_appLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_py", "label": "public_transport_site.py", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_get_transport_by_site_token", "label": "_get_transport_by_site_token()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L32"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_format_plan_date", "label": "_format_plan_date()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_resolve_plan_flags", "label": "_resolve_plan_flags()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L56"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_build_public_page", "label": "_build_public_page()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L65"}, {"id": "publictransportmultistopsitepageread", "label": "PublicTransportMultiStopSitePageRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_get_public_transport_site", "label": "get_public_transport_site()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L111"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_save_public_site_stop_feedback", "label": "save_public_site_stop_feedback()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L118"}, {"id": "publictransportsitestopfeedback", "label": "PublicTransportSiteStopFeedback", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_format_file_size", "label": "_format_file_size()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L178"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_upload_public_site_attachment", "label": "upload_public_site_attachment()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L187"}, {"id": "uploadfile", "label": "UploadFile", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212 \u00b7 \u73b0\u573a\u6309\u6bb5\u514d\u767b\u5f55\u516c\u5171 API\uff08\u4e00\u8f66\u591a\u5378\uff09", "file_type": "rationale", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_py", "target": "os", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_py", "target": "datetime", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L6", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTEDLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_py", "label": "transport.py", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_transport_to_read", "label": "_transport_to_read()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L90"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "transportread", "label": "TransportRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_generate_transport_no", "label": "_generate_transport_no()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L222"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_resolve_driver_info", "label": "_resolve_driver_info()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L246"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_get_vehicle_info", "label": "_get_vehicle_info()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L284"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_assert_vehicle_carrier_eligible", "label": "_assert_vehicle_carrier_eligible()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L334"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_ensure_driver_access_token", "label": "_ensure_driver_access_token()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L369"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_rotate_driver_access_token", "label": "_rotate_driver_access_token()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L377"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_is_rearrange", "label": "_is_rearrange()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L383"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_transport_has_db_links", "label": "_transport_has_db_links()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L394"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_apply_plan_logistics_from_payload", "label": "_apply_plan_logistics_from_payload()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L407"}, {"id": "transportarrange", "label": "TransportArrange", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_resolve_transport_endpoints", "label": "_resolve_transport_endpoints()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L436"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_apply_transport_arrange_fields", "label": "_apply_transport_arrange_fields()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L451"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_build_driver_url", "label": "_build_driver_url()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L485"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_build_arrange_result", "label": "_build_arrange_result()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L490"}, {"id": "transportsitelinkread", "label": "TransportSiteLinkRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "transportinventorylinkread", "label": "TransportInventoryLinkRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "transportioorderbrief", "label": "TransportIoOrderBrief", "file_type": "code", "source_file": "", "source_location": "", "origLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_py", "label": "pl_plan_service.py", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_determine_plan_type", "label": "determine_plan_type()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L48"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_is_ton_product_unit", "label": "is_ton_product_unit()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L56"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_product_quantity", "label": "_product_quantity()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L63"}, {"id": "planproductcreate", "label": "PlanProductCreate", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_product_create_actual_qty", "label": "_product_create_actual_qty()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L73"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_plan_product_actual_qty", "label": "_plan_product_actual_qty()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L79"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_sum_product_actual_quantities", "label": "sum_product_actual_quantities()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L85"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_sum_plan_product_actual_quantities", "label": "sum_plan_product_actual_quantities()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L89"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_estimate_qty_fields", "label": "_estimate_qty_fields()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L93"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_build_plan_product", "label": "build_plan_product()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L104"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_apply_vehicle_snapshot_to_plan_transport", "label": "_apply_vehicle_snapshot_to_plan_transport()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L154"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "plvehicle", "label": "PlVehicle", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_resolve_driver", "label": "_resolve_driver()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L172"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_calc_freight_amount", "label": "_calc_freight_amount()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L218"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_fetch_hazard_flags_map", "label": "fetch_hazard_flags_map()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L239"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_resolve_hazard_flags_from_crm", "label": "resolve_hazard_flagLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_py", "label": "pl_models.py", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcarrier", "label": "PlCarrier", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L28"}, {"id": "base", "label": "Base", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehicle", "label": "PlVehicle", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L57"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plpersonnel", "label": "PlPersonnel", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L84"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportaddress", "label": "PlTransportAddress", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L119"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcert", "label": "PlCert", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L143"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pldriver", "label": "PlDriver", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L169"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehiclepersonnel", "label": "PlVehiclePersonnel", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L195"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehicledriver", "label": "PlVehicleDriver", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L216"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplan", "label": "PlPlan", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L241"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplancontract", "label": "PlPlanContract", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L350"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L373"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanproductbrandqty", "label": "PlPlanProductBrandQty", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L432"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanchange", "label": "PlPlanChange", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L454"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanload", "label": "PlPlanLoad", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L476"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L504"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplandelivery", "label": "PlPlanDelivery", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L535"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L564"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransport", "label": "PlTransport", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L600"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportproductfeedback", "label": "PlTransportProductFeedback", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L662"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportproductbrandqty", "label": "PlTransportProductBrandQty", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L683"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportdblink", "label": "PlTransportDbLink", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L706"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplantransport", "label": "PlPlanTransport", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L731"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_modelLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "label": "pl_plan_stop_rules.py", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_resolve_stop_dibang_defaults", "label": "resolve_stop_dibang_defaults()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L12"}, {"id": "stoptype", "label": "StopType", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_rules.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_extract_qty", "label": "_extract_qty()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L25"}, {"id": "any", "label": "Any", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_rules.py"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_rules.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_sum_qty", "label": "_sum_qty()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L36"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_fmt_qty", "label": "_fmt_qty()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L43"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_warn_qty_imbalance", "label": "warn_qty_imbalance()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L49"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212\u591a\u6bb5\uff1a\u5185\u90e8\u5ba2\u6237\u5730\u78c5\u9ed8\u8ba4\u503c\u4e0e\u6570\u91cf\u5e73\u8861\u6821\u9a8c", "file_type": "rationale", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "app_services_pl_internal_customer", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L7", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_resolve_stop_dibang_defaults", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L12", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_resolve_stop_dibang_defaults", "target": "stoptype", "relation": "references", "context": "parameter_type", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L12", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_extract_qty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L25", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_extract_qty", "target": "any", "relation": "references", "context": "parameter_type", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L25", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_extract_qty", "target": "decimal", "relation": "references", "context": "return_type", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L25", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "users_wuzilong_Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_py", "label": "transport.py", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportbase", "label": "TransportBase", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L18"}, {"id": "basemodel", "label": "BaseModel", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportcreate", "label": "TransportCreate", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L42"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportstopdibangoption", "label": "TransportStopDibangOption", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L47"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportarrange", "label": "TransportArrange", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L54"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportinventorylinkread", "label": "TransportInventoryLinkRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L89"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportsitelinkread", "label": "TransportSiteLinkRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L99"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportupdate", "label": "TransportUpdate", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L113"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportdriverproductfeedbackread", "label": "TransportDriverProductFeedbackRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L137"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportstopfeedbackread", "label": "TransportStopFeedbackRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L153"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportread", "label": "TransportRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L166"}, {"id": "planresourcesnapshotmixin", "label": "PlanResourceSnapshotMixin", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportioorderbrief", "label": "TransportIoOrderBrief", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L194"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportarrangeresult", "label": "TransportArrangeResult", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L204"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_planarrangeinforead", "label": "PlanArrangeInfoRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L215"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportwithplans", "label": "TransportWithPlans", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L226"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportfeedback", "label": "TransportFeedback", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L235"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportproductfeedbackitem", "label": "PublicTransportProductFeedbackItem", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L244"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportfeedback", "label": "PublicTransportFeedback", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L251"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportdriverstopfeedback", "label": "PublicTransportDriverStopFeedback", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L259"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportsitestopfeedback", "label": "PublicTransportSiteStopFeedback", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L267"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportstLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_py", "label": "pl_plan_stop_service.py", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_contract_link", "label": "_contract_link()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L41"}, {"id": "plplancontract", "label": "PlPlanContract", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plancontractlink", "label": "PlanContractLink", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_stop_product", "label": "_load_stop_product()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L49"}, {"id": "plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "planstopproductread", "label": "PlanStopProductRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_delivery_stop_product", "label": "_delivery_stop_product()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L53"}, {"id": "plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_stop_contract_rows_grouped", "label": "load_stop_contract_rows_grouped()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L57"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_contracts_for_stop", "label": "_contracts_for_stop()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L80"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_plan_stops_grouped", "label": "load_plan_stops_grouped()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L95"}, {"id": "planloadread", "label": "PlanLoadRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plandeliveryread", "label": "PlanDeliveryRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_resolve_load_customer_name", "label": "resolve_load_customer_name()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L204"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_resolve_delivery_customer_summary", "label": "resolve_delivery_customer_summary()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L214"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_attach_plan_stops_to_item", "label": "attach_plan_stops_to_item()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L235"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_uses_multi_stop_payload", "label": "uses_multi_stop_payload()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L247"}, {"id": "planloadbody", "label": "PlanLoadBody", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plandeliverLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_py", "label": "pl_models.py", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcarrier", "label": "PlCarrier", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L28"}, {"id": "base", "label": "Base", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehicle", "label": "PlVehicle", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L57"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plpersonnel", "label": "PlPersonnel", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L84"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportaddress", "label": "PlTransportAddress", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L119"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcustomerstoppref", "label": "PlCustomerStopPref", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L143"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcert", "label": "PlCert", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L168"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pldriver", "label": "PlDriver", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L194"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehiclepersonnel", "label": "PlVehiclePersonnel", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L220"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehicledriver", "label": "PlVehicleDriver", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L241"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplan", "label": "PlPlan", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L266"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplancontract", "label": "PlPlanContract", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L375"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L398"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanproductbrandqty", "label": "PlPlanProductBrandQty", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L457"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanchange", "label": "PlPlanChange", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L479"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanload", "label": "PlPlanLoad", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L501"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L529"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplandelivery", "label": "PlPlanDelivery", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L560"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L589"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransport", "label": "PlTransport", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L625"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportproductfeedback", "label": "PlTransportProductFeedback", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L688"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportproductbrandqty", "label": "PlTransportProductBrandQty", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L709"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportdblink", "label": "PlTransportDbLink", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L732"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_appLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "label": "test_pl_plan_stop_rules.py", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_shanxia_load_outbound", "label": "test_internal_shanxia_load_outbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L8"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_shanxia_delivery_inbound", "label": "test_internal_shanxia_delivery_inbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L14"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_yundong_load_outbound", "label": "test_internal_yundong_load_outbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L19"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_yundong_delivery_inbound", "label": "test_internal_yundong_delivery_inbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L24"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_external_customer_no_dibang", "label": "test_external_customer_no_dibang()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L29"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_external_empty_name_no_dibang", "label": "test_external_empty_name_no_dibang()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L34"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_balanced_returns_empty", "label": "test_warn_qty_balanced_returns_empty()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L39"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_uses_plan_qty_on_plan_products", "label": "test_warn_qty_uses_plan_qty_on_plan_products()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_load_vs_delivery_imbalance", "label": "test_warn_qty_load_vs_delivery_imbalance()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L53"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_delivery_vs_load_imbalance", "label": "test_warn_qty_delivery_vs_load_imbalance()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L63"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_load_delivery_decimal_imbalance", "label": "test_warn_qty_load_delivery_decimal_imbalance()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L73"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_multi_stop_30_equals_10_15_5_balanced", "label": "test_warn_qty_multi_stop_30_equals_10_15_5_balanced()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L83"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_sums_multiple_rows_balanced_across_stops", "label": "test_warn_qty_sums_multiple_rows_balanced_across_stops()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L95"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_sums_multiple_rows_imbalanced_across_stops", "label": "test_warn_qty_sums_multiple_rows_imbalanced_across_stops()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L102"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212\u591a\u6bb5\uff1a\u5185\u90e8\u5ba2\u6237\u5730\u78c5\u9ed8\u8ba4\u503c\u4e0e\u6570\u91cf\u5e73\u8861\u6821\u9a8c", "file_type": "rationale", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_rationale_84", "label": "\u9a8c\u6536\u573a\u666f\uff1a\u8ba1\u5212 30 = \u9001\u8d27 10+15+5\uff0c\u88c5\u8d27 30\u3002", "file_type": "rationale", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L84"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "target": "decimal", "relLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_py", "label": "pl_plan_archive_stop_service.py", "file_type": "code", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_require_qty", "label": "_require_qty()", "file_type": "code", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L27"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_apply_stop_product_archive", "label": "_apply_stop_product_archive()", "file_type": "code", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L36"}, {"id": "plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_stop_service.py"}, {"id": "plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_stop_service.py"}, {"id": "planarchivestopproductitem", "label": "PlanArchiveStopProductItem", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_apply_archive_stop_quantities", "label": "apply_archive_stop_quantities()", "file_type": "code", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L63"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_stop_service.py"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_stop_service.py"}, {"id": "planarchiveloadblock", "label": "PlanArchiveLoadBlock", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_stop_service.py"}, {"id": "planarchivedeliveryblock", "label": "PlanArchiveDeliveryBlock", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_sync_plan_products_from_stop_archive", "label": "sync_plan_products_from_stop_archive()", "file_type": "code", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L147"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_sum_delivery_outbound_qty", "label": "sum_delivery_outbound_qty()", "file_type": "code", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L226"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_iter_stop_archive_inventory_lines", "label": "iter_stop_archive_inventory_lines()", "file_type": "code", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L242"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_rationale_154", "label": "\u5c06\u6bb5\u7ea7\u5f52\u6863\u6570\u91cf\u6c47\u603b\u56de\u5199 pl_plan_product\uff08_row_to_dict \u6743\u5a01\u6765\u6e90\uff09\u3002", "file_type": "rationale", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L154"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_py", "target": "collections", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_filLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_py", "label": "public_io_order.py", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_resolve_unit_label", "label": "_resolve_unit_label()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L57"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_models", "label": "_models()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L64"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_get_by_token", "label": "_get_by_token()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L70"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_io_order.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_resolve_io_order_link_flags", "label": "_resolve_io_order_link_flags()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L88"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_io_order.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_parse_history_date", "label": "_parse_history_date()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L95"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_io_order.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_history_status_label", "label": "_history_status_label()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L105"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_query_kind_history", "label": "_query_kind_history()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L115"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_build_history_page", "label": "_build_history_page()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L192"}, {"id": "publicioorderhistorypageread", "label": "PublicIoOrderHistoryPageRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_io_order.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_attach_history_products", "label": "_attach_history_products()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L230"}, {"id": "publicioorderhistoryrecordread", "label": "PublicIoOrderHistoryRecordRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_io_order.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_build_page", "label": "_build_page()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L320"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_format_file_size", "label": "_format_file_size()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L346"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_make_handlers", "label": "_make_handlers()", "file_type": "code", "source_file": "app/api/pl/public_io_order.py", "source_location": "L354"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212 \u00b7 \u5165\u5e93/\u51fa\u5e93\u5355\u73b0\u573a\u514d\u767b\u5f55\u516c\u5171 API", "file_type": "rationale", "source_file": "app/api/pl/public_io_order.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_rationale_89", "label": "\u8fd4\u56de (\u4f5c\u5e9f, \u5f52\u6863)\u3002\u73b0\u573a\u94fe\u63a5\u5b9e\u9645\u8d70\u5165\u5e93/\u51fa\u5e93\u5355\u516c\u5171\u9875\u3002", "file_type": "rationale", "source_file": "app/api/pl/public_io_order.py", "source_location": "L89"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_io_order_rationale_123", "label": "\u8fd4\u56de [(create_time, PublicIoOrderHistoryRecordRead), ...]\u3002", "file_type": "rationale", "source_file": "app/api/pl/public_io_order.py", "source_location": "L123"}],Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_py", "label": "pl_plan_site_link_service.py", "file_type": "code", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_build_site_records_for_arranged_plan", "label": "build_site_records_for_arranged_plan()", "file_type": "code", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L15"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_site_link_service.py"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_site_link_service.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_site_link_service.py"}, {"id": "transportsitelinkread", "label": "TransportSiteLinkRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_site_link_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212 \u00b7 \u73b0\u573a\u94fe\u63a5\u8bfb\u6a21\u578b\u89e3\u6790\uff08\u5b89\u6392\u8fd0\u8f93 / \u67e5\u770b\u5f39\u7a97\u5171\u7528\uff09", "file_type": "rationale", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_rationale_22", "label": "\u6309\u5f53\u524d\u8ba1\u5212\u88c5/\u9001\u8d27\u5ba2\u6237\u5224\u5b9a\uff0c\u89e3\u6790\u53ef\u590d\u5236\u7684\u73b0\u573a\u94fe\u63a5\u5217\u8868\u3002", "file_type": "rationale", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L22"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_py", "target": "sqlalchemy_orm", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_py", "target": "app_models_pl_models", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L6", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_py", "target": "app_schemas_pl_transport", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L7", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_py", "target": "app_services_pl_dibang_bridge_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L8", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_py", "target": "app_services_pl_internal_customer", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L9", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_py", "target": "app_services_pl_io_order_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L10", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_py", "target": "app_services_pl_site_link_read", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L11", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_py", "target": "app_services_pl_transport_stop_feedback_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_site_link_service.py", "source_location": "L12", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_site_link_service_builLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_py", "label": "pl_dibang_bridge_service.py", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_dibanginventorylinkresult", "label": "DibangInventoryLinkResult", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L36"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_stopdibangoption", "label": "StopDibangOption", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_stopdibangproduct", "label": "_StopDibangProduct", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L53"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_resolve_partner_company", "label": "resolve_partner_company()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L62"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_dibang_bridge_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_normalize_to_date", "label": "_normalize_to_date()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L75"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_dibang_bridge_service.py"}, {"id": "datetime", "label": "datetime", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_dibang_bridge_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_normalize_plan_date", "label": "_normalize_plan_date()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L87"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_resolve_dibang_date", "label": "_resolve_dibang_date()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L99"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_month_range", "label": "_month_range()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L110"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_plan_type_to_business_type", "label": "_plan_type_to_business_type()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L117"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_direction_to_business_type", "label": "_direction_to_business_type()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L125"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_stop_product_quantity", "label": "_stop_product_quantity()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L134"}, {"id": "any", "label": "Any", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_dibang_bridge_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_plan_has_load_stop", "label": "plan_has_load_stop()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L140"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_dibang_bridge_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_apply_stop_dibang_options", "label": "apply_stop_dibang_options()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L153"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_product_quantity", "label": "_product_quantity()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L190"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_customer_stop_pref_py", "label": "customer_stop_pref.py", "file_type": "code", "source_file": "app/schemas/pl/customer_stop_pref.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_customer_stop_pref_customerstopprefread", "label": "CustomerStopPrefRead", "file_type": "code", "source_file": "app/schemas/pl/customer_stop_pref.py", "source_location": "L8"}, {"id": "basemodel", "label": "BaseModel", "file_type": "code", "source_file": "", "source_location": ""}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_customer_stop_pref_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/customer_stop_pref.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_customer_stop_pref_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/customer_stop_pref.py", "source_location": "L3", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_customer_stop_pref_py", "target": "pydantic", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/customer_stop_pref.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_customer_stop_pref_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_customer_stop_pref_customerstopprefread", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/customer_stop_pref.py", "source_location": "L8", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_customer_stop_pref_customerstopprefread", "target": "basemodel", "relation": "inherits", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/customer_stop_pref.py", "source_location": "L8", "weight": 1.0}], "raw_calls": [], "callable_nids": ["users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_customer_stop_pref_customerstopprefread"]}
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_py", "label": "pl_plan_list_attachments.py", "file_type": "code", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_parse_image_urls", "label": "_parse_image_urls()", "file_type": "code", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L21"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_short_label", "label": "_short_label()", "file_type": "code", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L36"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_stop_source_label", "label": "_stop_source_label()", "file_type": "code", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L45"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_stop_sort_key", "label": "_stop_sort_key()", "file_type": "code", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L60"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_load_plan_document_attachments_by_plan_ids", "label": "load_plan_document_attachments_by_plan_ids()", "file_type": "code", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L73"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_list_attachments.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212\u5217\u8868\uff1a\u805a\u5408\u53f8\u673a/\u73b0\u573a/\u51fa\u5165\u5e93\u73b0\u573a\u7b49\u5355\u636e\u9644\u4ef6\u3002", "file_type": "rationale", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_py", "target": "json", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_py", "target": "sqlalchemy_orm", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L7", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_py", "target": "app_models_pl_models", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L9", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_parse_image_urls", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L21", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_short_label", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L36", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_stop_source_label", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L45", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_stop_sort_key", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_list_attachments.py", "source_location": "L60", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_list_attachments_loaLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "label": "test_pl_transport_stop_feedback.py", "file_type": "code", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "label": "test_save_site_stop_feedback_requires_quantity_before_attachments()", "file_type": "code", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L7"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "pytest", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "app_services_pl_transport_stop_feedback_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_transport_stop_feedback.py", "source_location": "L7", "weight": 1.0}], "raw_calls": [{"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "callee": "raises", "is_member_call": true, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L8", "receiver": "pytest"}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "callee": "ValueError", "is_member_call": false, "indirect": true, "context": "argument", "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L8"}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments", "callee": "save_site_stop_feedback", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_transport_stop_feedback.py", "source_location": "L9", "receiver": null}], "callable_nids": ["users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_transport_stop_feedback_test_save_site_stop_feedback_requires_quantity_before_attachments"]}
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_py", "label": "migrate_pl_plan_to_multi_stop.py", "file_type": "code", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_migrationstats", "label": "MigrationStats", "file_type": "code", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L53"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_plan_qty", "label": "_plan_qty()", "file_type": "code", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L65"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scripts/migrate_pl_plan_to_multi_stop.py"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scripts/migrate_pl_plan_to_multi_stop.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_migrate_plan", "label": "_migrate_plan()", "file_type": "code", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L71"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scripts/migrate_pl_plan_to_multi_stop.py"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scripts/migrate_pl_plan_to_multi_stop.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_run_migration", "label": "run_migration()", "file_type": "code", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L258"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_print_stats", "label": "print_stats()", "file_type": "code", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L283"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_main", "label": "main()", "file_type": "code", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L300"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_py", "target": "argparse", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L21", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_py", "target": "os", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L22", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_py", "target": "sys", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L23", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_py", "target": "dataclasses", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L24", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_py", "target": "datetime", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L25", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L26", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_py", "target": "pathlib", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L27", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_multi_stop_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_pl_plan_to_multi_stop.py", "source_location": "L28", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_pl_plan_to_Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_py", "label": "plan.py", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductbase", "label": "PlanProductBase", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L16"}, {"id": "basemodel", "label": "BaseModel", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductcreate", "label": "PlanProductCreate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L55"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductupdate", "label": "PlanProductUpdate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L59"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planarchivebrandqtyitem", "label": "PlanArchiveBrandQtyItem", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L81"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductread", "label": "PlanProductRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L88"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planstopproductbody", "label": "PlanStopProductBody", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L105"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planstopproductread", "label": "PlanStopProductRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L119"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planloadbody", "label": "PlanLoadBody", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L135"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plandeliverybody", "label": "PlanDeliveryBody", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L154"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planloadread", "label": "PlanLoadRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L174"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plandeliveryread", "label": "PlanDeliveryRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L185"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planbase", "label": "PlanBase", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L201"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plancontractlink", "label": "PlanContractLink", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L252"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plancreate", "label": "PlanCreate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L259"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plantransportcreateblock", "label": "PlanTransportCreateBlock", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L276"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planupdate", "label": "PlanUpdate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L290"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_hazardcertreadybody", "label": "HazardCertReadyBody", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L342"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_erpenteredbody", "label": "ErpEnteredBody", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L347"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plandocumentattachmentitem", "label": "PlanDocumentAttachmentItem", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L352"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planread", "label": "PlanRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L358"}, {"id": "planresourcesnapshotmixin", "label": "PlanResourceSnapshotMixin", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planwithproducts", "label": "PlanWithProducts", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L393"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planinboundsliptemplatesave", "label": "PlanLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_py", "label": "io_order.py", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_brandoption", "label": "BrandOption", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L11"}, {"id": "basemodel", "label": "BaseModel", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_brandqtyitem", "label": "BrandQtyItem", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L17"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_ioorderitemread", "label": "IoOrderItemRead", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L24"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_ioorderitempatch", "label": "IoOrderItemPatch", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L51"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_ioorderpatch", "label": "IoOrderPatch", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L58"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_ioorderread", "label": "IoOrderRead", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L67"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_ioorderlistresponse", "label": "IoOrderListResponse", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L108"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_publicioorderitemfeedback", "label": "PublicIoOrderItemFeedback", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L113"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_publicioorderstopproductfeedback", "label": "PublicIoOrderStopProductFeedback", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L120"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_publicioorderstopfeedback", "label": "PublicIoOrderStopFeedback", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L127"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_publicioorderfeedback", "label": "PublicIoOrderFeedback", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L135"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_publicioorderhistoryproductread", "label": "PublicIoOrderHistoryProductRead", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L144"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_publicioorderhistoryrecordread", "label": "PublicIoOrderHistoryRecordRead", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L153"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_publicioorderhistorypageread", "label": "PublicIoOrderHistoryPageRead", "file_type": "code", "source_file": "app/schemas/pl/io_order.py", "source_location": "L178"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_rationale_1", "label": "\u5165\u5e93\u5355 / \u51fa\u5e93\u5355 Pydantic schemas", "file_type": "rationale", "source_file": "app/schemas/pl/io_order.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_py", "target": "datetime", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/io_order.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/io_order.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/io_order.py", "source_location": "L6", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_py", "target": "pydantic", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/io_order.py", "source_location": "L8", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_io_order_py", "target": "users_wuzilong_work_00code_shanxiLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_py", "label": "public_transport_site.py", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_get_transport_by_site_token", "label": "_get_transport_by_site_token()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L32"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_format_plan_date", "label": "_format_plan_date()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_resolve_plan_flags", "label": "_resolve_plan_flags()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L56"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_build_public_page", "label": "_build_public_page()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L65"}, {"id": "publictransportmultistopsitepageread", "label": "PublicTransportMultiStopSitePageRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_get_public_transport_site", "label": "get_public_transport_site()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L125"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_save_public_site_stop_feedback", "label": "save_public_site_stop_feedback()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L132"}, {"id": "publictransportsitestopfeedback", "label": "PublicTransportSiteStopFeedback", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_format_file_size", "label": "_format_file_size()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L192"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_upload_public_site_attachment", "label": "upload_public_site_attachment()", "file_type": "code", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L201"}, {"id": "uploadfile", "label": "UploadFile", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport_site.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212 \u00b7 \u73b0\u573a\u6309\u6bb5\u514d\u767b\u5f55\u516c\u5171 API\uff08\u4e00\u8f66\u591a\u5378\uff09", "file_type": "rationale", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_py", "target": "os", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_py", "target": "datetime", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/pl/public_transport_site.py", "source_location": "L6", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_site_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTEDLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_py", "label": "pl_plan_stop_service.py", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_contract_link", "label": "_contract_link()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L43"}, {"id": "plplancontract", "label": "PlPlanContract", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plancontractlink", "label": "PlanContractLink", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_stop_product", "label": "_load_stop_product()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L51"}, {"id": "plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "planstopproductread", "label": "PlanStopProductRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_delivery_stop_product", "label": "_delivery_stop_product()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L55"}, {"id": "plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_stop_contract_rows_grouped", "label": "load_stop_contract_rows_grouped()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L59"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_contracts_for_stop", "label": "_contracts_for_stop()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L82"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_to_decimal", "label": "_to_decimal()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L97"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_resolve_stop_address_from_library", "label": "resolve_stop_address_from_library()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L106"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_enrich_stop_addresses_from_library", "label": "enrich_stop_addresses_from_library()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L147"}, {"id": "planloadbody", "label": "PlanLoadBody", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plandeliverybody", "label": "PlanDeliveryBody", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_plan_stops_grouped", "label": "load_plan_stops_grouped()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L166"}, {"id": "planloadread", "label": "PlanLoadRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plandeliveryread", "label": "PlanDeliveryRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_servicLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "label": "test_pl_plan_stop_rules.py", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_shanxia_load_outbound", "label": "test_internal_shanxia_load_outbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L8"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_shanxia_delivery_inbound", "label": "test_internal_shanxia_delivery_inbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L14"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_yundong_load_outbound", "label": "test_internal_yundong_load_outbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L19"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_yundong_delivery_inbound", "label": "test_internal_yundong_delivery_inbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L24"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_external_customer_no_dibang", "label": "test_external_customer_no_dibang()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L29"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_delivery_defaults_follow_load_customer_not_delivery_customer", "label": "test_delivery_defaults_follow_load_customer_not_delivery_customer()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L34"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_external_empty_name_no_dibang", "label": "test_external_empty_name_no_dibang()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L41"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_balanced_returns_empty", "label": "test_warn_qty_balanced_returns_empty()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_uses_plan_qty_on_plan_products", "label": "test_warn_qty_uses_plan_qty_on_plan_products()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L53"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_load_vs_delivery_imbalance", "label": "test_warn_qty_load_vs_delivery_imbalance()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L60"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_delivery_vs_load_imbalance", "label": "test_warn_qty_delivery_vs_load_imbalance()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L70"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_load_delivery_decimal_imbalance", "label": "test_warn_qty_load_delivery_decimal_imbalance()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L80"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_multi_stop_30_equals_10_15_5_balanced", "label": "test_warn_qty_multi_stop_30_equals_10_15_5_balanced()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L90"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_sums_multiple_rows_balanced_across_stops", "label": "test_warn_qty_sums_multiple_rows_balanced_across_stops()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L102"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_sums_multiple_rows_imbalanced_across_stops", "label": "test_warn_qty_sums_multiple_rows_imbalanced_across_stops()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L109"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212\u591a\u6bb5\uff1a\u5185\u90e8\u5ba2\u6237\u5730\u78c5\u9ed8\u8ba4\u503c\u4e0e\u6570\u91cf\u5e73\u8861\u6821\u9a8c", "file_type": "rationale", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_rationale_35", "label": Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_py", "label": "test_pl_plan_print_service.py", "file_type": "code", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_stop_product", "label": "_stop_product()", "file_type": "code", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L12"}, {"id": "planstopproductread", "label": "PlanStopProductRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_plan_print_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_delivery", "label": "_delivery()", "file_type": "code", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L29"}, {"id": "plandeliveryread", "label": "PlanDeliveryRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/tests/test_pl_plan_print_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_test_list_delivery_print_customers_dedupes_by_customer_id", "label": "test_list_delivery_print_customers_dedupes_by_customer_id()", "file_type": "code", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_test_build_delivery_slip_print_merges_same_customer_and_uses_min_seq_contact", "label": "test_build_delivery_slip_print_merges_same_customer_and_uses_min_seq_contact()", "file_type": "code", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L59"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_py", "target": "datetime", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L3", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_py", "target": "app_schemas_pl_plan", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_py", "target": "app_services_pl_plan_print_service", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L6", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_stop_product", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L12", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_stop_product", "target": "planstopproductread", "relation": "references", "context": "return_type", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L12", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_delivery", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L29", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_delivery", "target": "plandeliveryread", "relation": "references", "context": "return_type", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L29", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_test_list_delivery_print_customers_dedupes_by_customer_id", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_print_service.py", "source_location": "L46", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_print_service_test_build_delivery_slip_print_merges_same_customer_and_uses_min_seq_contaLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_py", "label": "public_transport.py", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_resolve_unit_label", "label": "_resolve_unit_label()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L64"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_build_stop_product_reads", "label": "_build_stop_product_reads()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L71"}, {"id": "publicstopproductrow", "label": "PublicStopProductRow", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "brandoption", "label": "BrandOption", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "publictransportstopproductread", "label": "PublicTransportStopProductRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_get_transport_by_token", "label": "_get_transport_by_token()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L123"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_parse_feedback_images", "label": "_parse_feedback_images()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L137"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_format_plan_date", "label": "_format_plan_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L149"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_normalize_main_plate", "label": "_normalize_main_plate()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L159"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_parse_history_date", "label": "_parse_history_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L163"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_as_date", "label": "_as_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L173"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_history_matches_date", "label": "_history_matches_date()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L183"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_history_status_label", "label": "_history_status_label()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L187"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_build_driver_url", "label": "_build_driver_url()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L195"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_resolve_driver_link_flags", "label": "_resolve_driver_link_flags()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L200"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/public_transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_public_transport_resolve_other_personnel", "label": "_resolve_other_personnel()", "file_type": "code", "source_file": "app/api/pl/public_transport.py", "source_location": "L212"}, {"id": "publLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_py", "label": "plan.py", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductbase", "label": "PlanProductBase", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L16"}, {"id": "basemodel", "label": "BaseModel", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductcreate", "label": "PlanProductCreate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L55"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductupdate", "label": "PlanProductUpdate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L59"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planarchivebrandqtyitem", "label": "PlanArchiveBrandQtyItem", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L81"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductread", "label": "PlanProductRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L88"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planstopproductbody", "label": "PlanStopProductBody", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L105"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planstopproductread", "label": "PlanStopProductRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L119"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planloadbody", "label": "PlanLoadBody", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L135"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plandeliverybody", "label": "PlanDeliveryBody", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L154"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planloadread", "label": "PlanLoadRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L174"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plandeliveryread", "label": "PlanDeliveryRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L185"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planbase", "label": "PlanBase", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L201"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plancontractlink", "label": "PlanContractLink", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L252"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plancreate", "label": "PlanCreate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L259"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plantransportcreateblock", "label": "PlanTransportCreateBlock", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L276"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planupdate", "label": "PlanUpdate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L290"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_hazardcertreadybody", "label": "HazardCertReadyBody", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L342"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_erpenteredbody", "label": "ErpEnteredBody", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L347"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plandocumentattachmentitem", "label": "PlanDocumentAttachmentItem", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L352"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planread", "label": "PlanRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L358"}, {"id": "planresourcesnapshotmixin", "label": "PlanResourceSnapshotMixin", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planwithproducts", "label": "PlanWithProducts", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L393"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planinboundsliptemplatesave", "label": "PlanLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_py", "label": "plan.py", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_resolve_list_product_name", "label": "_resolve_list_product_name()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L144"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_resolve_create_date", "label": "_resolve_create_date()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L160"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_generate_plan_no", "label": "_generate_plan_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L164"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_format_subpack_slip_no", "label": "_format_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L196"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_normalize_subpack_slip_no", "label": "_normalize_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L200"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_subpack_slip_no_seq", "label": "_subpack_slip_no_seq()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L225"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_ensure_subpack_slip_no", "label": "_ensure_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L233"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_determine_plan_type", "label": "_determine_plan_type()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L265"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_get_plan_type_label", "label": "_get_plan_type_label()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L270"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_generate_notify_message", "label": "_generate_notify_message()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L279"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_plan_product_name_exists", "label": "_plan_product_name_exists()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L299"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_plan_plate_match", "label": "_plan_plate_match()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L313"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_list_plans", "label": "list_plans()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L323"}, {"id": "dbusercontext", "label": "DbUserContext", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "planlistresponse", "label": "PlanListResponse", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_format_plan_delivery_date_for_export", "label": "_format_plan_delivery_date_for_export()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L566"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_load_transports_by_id", "label": "_load_transports_by_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L572"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_load_products_by_plan_id", "label": "_load_products_by_plan_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_locatiLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "label": "test_pl_plan_stop_rules.py", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_shanxia_load_outbound", "label": "test_internal_shanxia_load_outbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L8"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_shanxia_delivery_inbound", "label": "test_internal_shanxia_delivery_inbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L14"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_yundong_load_outbound", "label": "test_internal_yundong_load_outbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L19"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_yundong_delivery_inbound", "label": "test_internal_yundong_delivery_inbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L24"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_external_customer_no_dibang", "label": "test_external_customer_no_dibang()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L29"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_external_empty_name_no_dibang", "label": "test_external_empty_name_no_dibang()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L34"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_balanced_returns_empty", "label": "test_warn_qty_balanced_returns_empty()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L39"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_uses_plan_qty_on_plan_products", "label": "test_warn_qty_uses_plan_qty_on_plan_products()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_load_vs_plan_imbalance", "label": "test_warn_qty_load_vs_plan_imbalance()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L53"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_delivery_vs_plan_imbalance", "label": "test_warn_qty_delivery_vs_plan_imbalance()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L63"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_load_matches_plan_delivery_imbalance_no_redundant", "label": "test_warn_qty_load_matches_plan_delivery_imbalance_no_redundant()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L73"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_multi_stop_30_equals_10_15_5_balanced", "label": "test_warn_qty_multi_stop_30_equals_10_15_5_balanced()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L84"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_sums_multiple_rows", "label": "test_warn_qty_sums_multiple_rows()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L96"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212\u591a\u6bb5\uff1a\u5185\u90e8\u5ba2\u6237\u5730\u78c5\u9ed8\u8ba4\u503c\u4e0e\u6570\u91cf\u5e73\u8861\u6821\u9a8c", "file_type": "rationale", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_rationale_74", "label": "\u88c5\u8d27\u5df2\u4e0e\u8ba1\u5212\u4e00\u81f4\u65f6\uff0c\u4e0d\u518d\u91cd\u590d\u63d0\u793a\u88c5\u8d27 vs \u9001\u8d27\u3002", "file_type": "rationale", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L74"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_rationale_85", "label": "\u9a8c\u6536\u573a\u666f\uff1a\u8ba1\u5212 30 = \u9001\u8d27 10+15+5\uff0c\u88c5\u8d27 30\u3002", "file_type": "rationale", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L85"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "target":Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_py", "label": "transport.py", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportbase", "label": "TransportBase", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L18"}, {"id": "basemodel", "label": "BaseModel", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportcreate", "label": "TransportCreate", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L42"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportstopdibangoption", "label": "TransportStopDibangOption", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L47"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportarrange", "label": "TransportArrange", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L54"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportinventorylinkread", "label": "TransportInventoryLinkRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L89"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportsitelinkread", "label": "TransportSiteLinkRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L99"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportupdate", "label": "TransportUpdate", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L113"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportdriverproductfeedbackread", "label": "TransportDriverProductFeedbackRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L137"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportread", "label": "TransportRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L153"}, {"id": "planresourcesnapshotmixin", "label": "PlanResourceSnapshotMixin", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportioorderbrief", "label": "TransportIoOrderBrief", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L175"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportarrangeresult", "label": "TransportArrangeResult", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L185"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_planarrangeinforead", "label": "PlanArrangeInfoRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L196"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportwithplans", "label": "TransportWithPlans", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L207"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_transportfeedback", "label": "TransportFeedback", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L216"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportproductfeedbackitem", "label": "PublicTransportProductFeedbackItem", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L225"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportfeedback", "label": "PublicTransportFeedback", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L232"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportplanproductread", "label": "PublicTransportPlanProductRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L240"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportpersonnelread", "label": "PublicTransportPersonnelRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L258"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransportpageread", "label": "PublicTransportPageRead", "file_type": "code", "source_file": "app/schemas/pl/transport.py", "source_location": "L265"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_transport_publictransporthistoryproductreadLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_py", "label": "plan.py", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_resolve_list_product_name", "label": "_resolve_list_product_name()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L143"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_resolve_create_date", "label": "_resolve_create_date()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L159"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_generate_plan_no", "label": "_generate_plan_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L163"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_format_subpack_slip_no", "label": "_format_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L195"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_normalize_subpack_slip_no", "label": "_normalize_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L199"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_subpack_slip_no_seq", "label": "_subpack_slip_no_seq()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L224"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_ensure_subpack_slip_no", "label": "_ensure_subpack_slip_no()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L232"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_determine_plan_type", "label": "_determine_plan_type()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L264"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_get_plan_type_label", "label": "_get_plan_type_label()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L269"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_generate_notify_message", "label": "_generate_notify_message()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L278"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_plan_product_name_exists", "label": "_plan_product_name_exists()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L298"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_plan_plate_match", "label": "_plan_plate_match()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L312"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_list_plans", "label": "list_plans()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L322"}, {"id": "dbusercontext", "label": "DbUserContext", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "planlistresponse", "label": "PlanListResponse", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_format_plan_delivery_date_for_export", "label": "_format_plan_delivery_date_for_export()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L565"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_load_transports_by_id", "label": "_load_transports_by_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L571"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_load_products_by_plan_id", "label": "_load_products_by_plan_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_locatiLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_py", "label": "pl_customer_stop_pref_service.py", "file_type": "code", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_as_str", "label": "_as_str()", "file_type": "code", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L19"}, {"id": "any", "label": "Any", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_customer_stop_pref_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_row_to_item", "label": "_row_to_item()", "file_type": "code", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L23"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_build_stop_pref_upsert_items", "label": "build_stop_pref_upsert_items()", "file_type": "code", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L41"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_get_customer_stop_pref", "label": "get_customer_stop_pref()", "file_type": "code", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L59"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_customer_stop_pref_service.py"}, {"id": "plcustomerstoppref", "label": "PlCustomerStopPref", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_customer_stop_pref_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_upsert_customer_stop_pref", "label": "upsert_customer_stop_pref()", "file_type": "code", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L81"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_upsert_prefs_from_plan_stops", "label": "upsert_prefs_from_plan_stops()", "file_type": "code", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L116"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_safe_upsert_prefs_from_plan_stops", "label": "safe_upsert_prefs_from_plan_stops()", "file_type": "code", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L136"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_rationale_46", "label": "\u62bd\u51fa\u5f85 upsert \u6761\u76ee\uff1b\u540c\u5ba2\u6237\u540c stop_type \u540e\u8005\u8986\u76d6\uff08\u4fdd\u6301\u5217\u8868\u4e2d\u6bcf\u79cd\u952e\u4e00\u6761\uff09\u3002", "file_type": "rationale", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_rationale_125", "label": "\u4f9b plan \u4fdd\u5b58\u8c03\u7528\uff1b\u5f02\u5e38\u7531\u8c03\u7528\u65b9\u7528 savepoint \u541e\u6389\u3002", "file_type": "rationale", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L125"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_rationale_145", "label": "savepoint \u5305\u88f9\uff1b\u5931\u8d25\u53ea\u8bb0\u65e5\u5fd7\uff0c\u4e0d\u629b\u7ed9\u8ba1\u5212\u4e3b\u6d41\u7a0b\u3002", "file_type": "rationale", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L145"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_py", "target": "logging", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_customer_stop_pref_service.py", "source_location": "L6", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_customer_stop_pref_service_Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_py", "label": "pl_plan_stop_service.py", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_contract_link", "label": "_contract_link()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L41"}, {"id": "plplancontract", "label": "PlPlanContract", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plancontractlink", "label": "PlanContractLink", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_stop_product", "label": "_load_stop_product()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L49"}, {"id": "plplanloadproduct", "label": "PlPlanLoadProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "planstopproductread", "label": "PlanStopProductRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_delivery_stop_product", "label": "_delivery_stop_product()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L53"}, {"id": "plplandeliveryproduct", "label": "PlPlanDeliveryProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_stop_contract_rows_grouped", "label": "load_stop_contract_rows_grouped()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L57"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_contracts_for_stop", "label": "_contracts_for_stop()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L80"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_load_plan_stops_grouped", "label": "load_plan_stops_grouped()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L95"}, {"id": "planloadread", "label": "PlanLoadRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plandeliveryread", "label": "PlanDeliveryRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_resolve_load_customer_name", "label": "resolve_load_customer_name()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L204"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_resolve_delivery_customer_summary", "label": "resolve_delivery_customer_summary()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L214"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_attach_plan_stops_to_item", "label": "attach_plan_stops_to_item()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L235"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_uses_multi_stop_payload", "label": "uses_multi_stop_payload()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L247"}, {"id": "planloadbody", "label": "PlanLoadBody", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_service.py"}, {"id": "plandeliverLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_py", "label": "transport.py", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_transport_to_read", "label": "_transport_to_read()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L88"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "pltransport", "label": "PlTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "transportread", "label": "TransportRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_generate_transport_no", "label": "_generate_transport_no()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L156"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_resolve_driver_info", "label": "_resolve_driver_info()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L180"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_get_vehicle_info", "label": "_get_vehicle_info()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L218"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_assert_vehicle_carrier_eligible", "label": "_assert_vehicle_carrier_eligible()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L268"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_ensure_driver_access_token", "label": "_ensure_driver_access_token()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L303"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_rotate_driver_access_token", "label": "_rotate_driver_access_token()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L311"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_is_rearrange", "label": "_is_rearrange()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L317"}, {"id": "plplan", "label": "PlPlan", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_transport_has_db_links", "label": "_transport_has_db_links()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L328"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_apply_plan_logistics_from_payload", "label": "_apply_plan_logistics_from_payload()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L341"}, {"id": "transportarrange", "label": "TransportArrange", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_resolve_transport_endpoints", "label": "_resolve_transport_endpoints()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L370"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_apply_transport_arrange_fields", "label": "_apply_transport_arrange_fields()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L385"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_build_driver_url", "label": "_build_driver_url()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L419"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_transport_build_arrange_result", "label": "_build_arrange_result()", "file_type": "code", "source_file": "app/api/pl/transport.py", "source_location": "L424"}, {"id": "transportsitelinkread", "label": "TransportSiteLinkRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "transportinventorylinkread", "label": "TransportInventoryLinkRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/transport.py"}, {"id": "transportioorderbrief", "label": "TransportIoOrderBrief", "file_type": "code", "source_file": "", "source_location": "", "origLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "label": "pl_plan_stop_rules.py", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_resolve_stop_dibang_defaults", "label": "resolve_stop_dibang_defaults()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L12"}, {"id": "stoptype", "label": "StopType", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_rules.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_extract_qty", "label": "_extract_qty()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L25"}, {"id": "any", "label": "Any", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_rules.py"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_stop_rules.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_sum_qty", "label": "_sum_qty()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L36"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_fmt_qty", "label": "_fmt_qty()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L43"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_warn_qty_imbalance", "label": "warn_qty_imbalance()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L49"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212\u591a\u6bb5\uff1a\u5185\u90e8\u5ba2\u6237\u5730\u78c5\u9ed8\u8ba4\u503c\u4e0e\u6570\u91cf\u5e73\u8861\u6821\u9a8c", "file_type": "rationale", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "app_services_pl_internal_customer", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L7", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_resolve_stop_dibang_defaults", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L12", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_resolve_stop_dibang_defaults", "target": "stoptype", "relation": "references", "context": "parameter_type", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L12", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_extract_qty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L25", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_extract_qty", "target": "any", "relation": "references", "context": "parameter_type", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L25", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_extract_qty", "target": "decimal", "relation": "references", "context": "return_type", "confidence": "EXTRACTED", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L25", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_py", "target": "users_wuzilong_Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "label": "test_pl_plan_stop_rules.py", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_shanxia_load_outbound", "label": "test_internal_shanxia_load_outbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L8"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_shanxia_delivery_inbound", "label": "test_internal_shanxia_delivery_inbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L14"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_yundong_load_outbound", "label": "test_internal_yundong_load_outbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L19"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_yundong_delivery_inbound", "label": "test_internal_yundong_delivery_inbound()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L24"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_external_customer_no_dibang", "label": "test_external_customer_no_dibang()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L29"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_external_empty_name_no_dibang", "label": "test_external_empty_name_no_dibang()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L34"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_balanced_returns_empty", "label": "test_warn_qty_balanced_returns_empty()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L39"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_uses_plan_qty_on_plan_products", "label": "test_warn_qty_uses_plan_qty_on_plan_products()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_load_vs_plan_imbalance", "label": "test_warn_qty_load_vs_plan_imbalance()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L53"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_delivery_vs_plan_imbalance", "label": "test_warn_qty_delivery_vs_plan_imbalance()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L64"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_warn_qty_sums_multiple_rows", "label": "test_warn_qty_sums_multiple_rows()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L75"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212\u591a\u6bb5\uff1a\u5185\u90e8\u5ba2\u6237\u5730\u78c5\u9ed8\u8ba4\u503c\u4e0e\u6570\u91cf\u5e73\u8861\u6821\u9a8c", "file_type": "rationale", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "target": "app_services_pl_internal_customer", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "target": "app_services_pl_plan_stop_rules", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_internal_shanxia_load_outbound", "relation": "contains", "confidence": "EXTRACTED", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L8", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_py", "target": "users_wuzilong_work_00code_sLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_py", "label": "merge_duplicate_crm_customers.py", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_norm", "label": "_norm()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L79"}, {"id": "any", "label": "Any", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scripts/merge_duplicate_crm_customers.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_contact_key", "label": "_contact_key()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L85"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_invoice_key", "label": "_invoice_key()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L92"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_row_to_dict", "label": "_row_to_dict()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L96"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_load_database_url", "label": "load_database_url()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L100"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_discover_merge_pairs", "label": "discover_merge_pairs()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L114"}, {"id": "connection", "label": "Connection", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scripts/merge_duplicate_crm_customers.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_backup_tables", "label": "backup_tables()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L147"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_fetch_customer", "label": "fetch_customer()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L157"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_merge_contacts", "label": "merge_contacts()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L165"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_normalize_invoice_defaults", "label": "normalize_invoice_defaults()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L257"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_merge_invoices", "label": "merge_invoices()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L326"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_migrate_customer_refs", "label": "migrate_customer_refs()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L402"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_merge_customer_master", "label": "merge_customer_master()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L463"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_recalc_customer_stats", "label": "recalc_customer_stats()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L515"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_soft_delete_source_customer", "label": "soft_delete_source_customer()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L582"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_verify", "label": "verify()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L605"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_merge_duplicate_crm_customers_run", "label": "run()", "file_type": "code", "source_file": "scripts/merge_duplicate_crm_customers.py", "source_location": "L669"}, {"id": "engine", "label": "Engine", "file_type": "code", "source_file": "", "source_location": "", "origin_file"Line truncated
Loaded 100 of 237 files, more files were not shown because too many files have changed in this diff. Show more