This commit is contained in:
zlwu committed 2026-08-30 09:30:02 +08:00
1 parent 16986f443e
commit 63a1209620
83 files changed
+1083112 -11357

No files matched your search

+1
View File
@@ -0,0 +1 @@
sk-X5cq645pLZgOoePIU8BCIvbYxVYlK0fu6eNTvcffkZAFZSOl
+1 -1
View File
@@ -1 +1 @@
48523
94806
+129 -5
View File
@@ -115,6 +115,7 @@ from app.services.pl_plan_service import (
apply_archive_brand_qtys_only,
apply_archive_freight,
apply_archive_product_quantities,
apply_archive_stop_feedback_attachments,
apply_plan_driver_feedback,
apply_plan_site_feedback,
apply_vehicle_prefill_to_plan,
@@ -325,6 +326,30 @@ def _plan_plate_match(keyword: str):
)
def _parse_status_csv(value: Optional[str]) -> List[str]:
if not value:
return []
return [item.strip() for item in value.split(",") if item.strip()]
def _apply_follow_status_filter(query, follow_status: Optional[str]):
statuses = _parse_status_csv(follow_status)
if len(statuses) == 1:
return query.filter(PlPlan.follow_status == statuses[0])
if len(statuses) > 1:
return query.filter(PlPlan.follow_status.in_(statuses))
return query
def _apply_exclude_follow_status_filter(query, exclude_follow_status: Optional[str]):
statuses = _parse_status_csv(exclude_follow_status)
if len(statuses) == 1:
return query.filter(PlPlan.follow_status != statuses[0])
if len(statuses) > 1:
return query.filter(~PlPlan.follow_status.in_(statuses))
return query
@router.get("/", response_model=PlanListResponse)
def list_plans(
q: Optional[str] = Query(
@@ -333,7 +358,16 @@ def list_plans(
),
plan_no: Optional[str] = Query(default=None, description="计划编号"),
plan_type: Optional[str] = Query(default=None, alias="planType", description="单据类型"),
follow_status: Optional[str] = Query(default=None, alias="followStatus", description="跟进状态"),
follow_status: Optional[str] = Query(
default=None,
alias="followStatus",
description="跟进状态,多个以英文逗号分隔",
),
exclude_follow_status: Optional[str] = Query(
default=None,
alias="excludeFollowStatus",
description="排除的跟进状态,多个以英文逗号分隔",
),
transport_status: Optional[str] = Query(default=None, alias="transportStatus", description="运输状态"),
archive_status: Optional[str] = Query(default=None, alias="archiveStatus", description="归档状态"),
customer_name: Optional[str] = Query(default=None, alias="customerName", description="客户名称"),
@@ -388,8 +422,8 @@ def list_plans(
if plan_type:
query = query.filter(PlPlan.plan_type == plan_type)
if follow_status:
query = query.filter(PlPlan.follow_status == follow_status)
query = _apply_follow_status_filter(query, follow_status)
query = _apply_exclude_follow_status_filter(query, exclude_follow_status)
if transport_status:
query = query.filter(PlPlan.transport_status == transport_status)
@@ -599,6 +633,7 @@ class PlanExportBody(BaseModel):
plan_no: Optional[str] = Field(default=None, alias="planNo")
plan_type: Optional[str] = Field(default=None, alias="planType")
follow_status: Optional[str] = Field(default=None, alias="followStatus")
exclude_follow_status: Optional[str] = Field(default=None, alias="excludeFollowStatus")
transport_status: Optional[str] = Field(default=None, alias="transportStatus")
archive_status: Optional[str] = Field(default=None, alias="archiveStatus")
customer_name: Optional[str] = Field(default=None, alias="customerName")
@@ -647,8 +682,8 @@ def export_plans(
query = query.filter(PlPlan.plan_no.contains(body.plan_no))
if body.plan_type:
query = query.filter(PlPlan.plan_type == body.plan_type)
if body.follow_status:
query = query.filter(PlPlan.follow_status == body.follow_status)
query = _apply_follow_status_filter(query, body.follow_status)
query = _apply_exclude_follow_status_filter(query, body.exclude_follow_status)
if body.transport_status:
query = query.filter(PlPlan.transport_status == body.transport_status)
if body.archive_status:
@@ -1986,6 +2021,85 @@ def cancel_plan(
# =============================================================================
@router.post("/{id}/archive-draft", response_model=PlanWithProducts)
def archive_plan_draft(
id: str,
payload: PlanArchiveBody = Body(...),
db: Session = Depends(get_db),
user: DbUserContext = Depends(get_db_current_user),
) -> 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="已作废的计划不能暂存归档")
if plan.archive_status == "archived":
raise HTTPException(status_code=400, detail="已归档的计划请使用调整保存,不能暂存")
use_stop_archive = payload.load is not None and payload.deliveries is not None
if use_stop_archive:
apply_archive_stop_quantities(
db,
tenant_no=tenant_no,
plan=plan,
load_block=payload.load,
delivery_blocks=payload.deliveries or [],
user_id=user.id,
strict=False,
)
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,
)
elif payload.products:
apply_archive_product_quantities(
db, tenant_no=tenant_no, plan=plan, items=payload.products, user_id=user.id
)
if payload.freight is not None:
apply_archive_freight(
db,
tenant_no=tenant_no,
plan=plan,
freight=payload.freight,
user_id=user.id,
strict=False,
)
if payload.feedbacks is not None and plan.transport_id:
apply_archive_stop_feedback_attachments(
db,
tenant_no=tenant_no,
plan=plan,
feedbacks=payload.feedbacks,
user_id=user.id,
dept_id=user.dept_id or "",
)
plan.archive_status = "draft"
plan.update_by = user.id
record_plan_change(
db,
tenant_no=tenant_no,
plan_id=plan.id,
change_type="archive_draft",
change_content="暂存归档内容",
user_id=user.id,
user_name=user.name or None,
dept_id=user.dept_id,
)
db.commit()
return get_plan(id, db, user)
@router.post("/{id}/archive", response_model=PlanWithProducts)
def archive_plan(
id: str,
@@ -2075,6 +2189,16 @@ def archive_plan(
if not plan.transport_id:
raise HTTPException(status_code=400, detail="计划有运输费用但未安排运输,请先安排运输")
if payload.feedbacks is not None and plan.transport_id:
apply_archive_stop_feedback_attachments(
db,
tenant_no=tenant_no,
plan=plan,
feedbacks=payload.feedbacks,
user_id=user.id,
dept_id=user.dept_id or "",
)
if not already_archived:
plan.archive_status = "archived"
plan.complete_status = "yes"
-52
View File
@@ -75,7 +75,6 @@ from app.services.pl_io_order_service import (
)
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,
)
from app.services.pl_transport_resource_snapshot_service import (
@@ -989,57 +988,6 @@ def arrange_transport(
)
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:
if should_sync_stop_dibang:
link_results = sync_dibang_for_plan_stops(
+1 -1
View File
@@ -285,7 +285,7 @@ class PlPlan(Base):
comment="跟进状态 wait_notice-等通知 pending_arrange-待安排 arranged-已安排 completed-已完成 cancelled-已取消",
)
transport_status = Column(String(20), nullable=False, default="pending", comment="运输安排状态 pending-待安排 arranged-已安排")
archive_status = Column(String(20), nullable=False, default="unarchived", comment="归档状态 unarchived-未归档 archived-已归档")
archive_status = Column(String(20), nullable=False, default="unarchived", comment="归档状态 unarchived-未归档 draft-已暂存 archived-已归档")
complete_status = Column(String(10), nullable=False, default="no", comment="完成状态 yes-是 no-否")
# 合同关联
+19 -1
View File
@@ -219,7 +219,7 @@ class PlanBase(BaseModel):
description="跟进状态 wait_notice/pending_arrange/arranged/completed/cancelled",
)
transport_status: str = Field(default="pending", alias="transportStatus", description="运输安排状态")
archive_status: str = Field(default="unarchived", alias="archiveStatus", description="归档状态")
archive_status: str = Field(default="unarchived", alias="archiveStatus", description="归档状态 unarchived/draft/archived")
complete_status: str = Field(default="no", alias="completeStatus", description="完成状态")
contract_id: Optional[str] = Field(default=None, alias="contractId", description="CRM合同ID")
contract_no: Optional[str] = Field(default=None, max_length=50, alias="contractNo", description="合同编号")
@@ -591,11 +591,29 @@ class PlanArchiveFreightBlock(BaseModel):
model_config = {"populate_by_name": True}
class PlanArchiveStopFeedbackAttachmentItem(BaseModel):
stop_type: str = Field(alias="stopType", description="停靠段类型 load/delivery")
stop_id: str = Field(alias="stopId", description="停靠段ID")
attachment_urls: list[str] = Field(default_factory=list, alias="attachmentUrls", description="附件URLs")
model_config = {"populate_by_name": True}
class PlanArchiveFeedbacksBlock(BaseModel):
driver_stops: list[PlanArchiveStopFeedbackAttachmentItem] = Field(
default_factory=list, alias="driverStops", description="司机按段回传附件"
)
site_stops: list[PlanArchiveStopFeedbackAttachmentItem] = Field(
default_factory=list, alias="siteStops", description="现场按段回传附件"
)
model_config = {"populate_by_name": True}
class PlanArchiveBody(BaseModel):
products: list[PlanArchiveProductItem] = Field(default_factory=list)
load: Optional[PlanArchiveLoadBlock] = None
deliveries: Optional[list[PlanArchiveDeliveryBlock]] = None
freight: Optional[PlanArchiveFreightBlock] = None
feedbacks: Optional[PlanArchiveFeedbacksBlock] = None
model_config = {"populate_by_name": True}
@@ -30,6 +30,7 @@ from app.services.db.product_helpers import (
apply_product_snapshot_to_plan,
resolve_crm_product,
)
from app.services.pl_plan_stop_rules import normalize_stop_dibang_fields
@dataclass
@@ -131,6 +132,32 @@ def _direction_to_business_type(direction: Optional[str]) -> Optional[str]:
return None
def _resolve_stop_business_type(
stop: PlPlanLoad | PlPlanDelivery,
stop_type: Literal["load", "delivery"],
) -> Optional[str]:
_, direction = normalize_stop_dibang_fields(
stop.customer_name,
stop_type,
stop.generate_dibang,
stop.dibang_direction,
)
return _direction_to_business_type(direction)
def resolve_stop_dibang_partner(
stop_type: Literal["load", "delivery"],
load: Optional[PlPlanLoad],
deliveries: list[PlPlanDelivery],
) -> str:
"""装货段地磅往来单位取第一个送货客户;送货段取装货客户。"""
if stop_type == "load":
if deliveries:
return (deliveries[0].customer_name or "").strip()
return (load.customer_name or "").strip() if load else ""
return (load.customer_name or "").strip() if load else ""
def _stop_product_quantity(product: Any) -> float:
if getattr(product, "plan_qty", None) is not None:
return float(product.plan_qty)
@@ -182,7 +209,14 @@ def apply_stop_dibang_options(
.first()
)
if stop:
stop.generate_dibang = 1 if option.generate_dibang else 0
gen, direction = normalize_stop_dibang_fields(
stop.customer_name,
"load" if option.stop_type == "load" else "delivery",
1 if option.generate_dibang else 0,
stop.dibang_direction,
)
stop.generate_dibang = gen
stop.dibang_direction = direction
stop.update_by = user_id
db.flush()
@@ -679,6 +713,17 @@ def sync_dibang_for_plan_stops(
option_map = {(item.stop_type, item.stop_id): item for item in stop_options}
results: list[DibangInventoryLinkResult] = []
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()
)
load = (
db.query(PlPlanLoad)
.filter(
@@ -691,12 +736,15 @@ def sync_dibang_for_plan_stops(
if load:
option = option_map.get(("load", load.id))
if option and option.generate_dibang:
business_type = _direction_to_business_type(load.dibang_direction)
business_type = _resolve_stop_business_type(load, "load")
if not business_type:
raise ValueError("装货段未配置地磅方向,无法生成地磅单")
stop_products = _load_stop_products(db, tenant_no, load.id)
if not stop_products:
raise ValueError("装货段无产品明细,无法生成地磅单")
partner = resolve_stop_dibang_partner("load", load, deliveries)
if not partner:
raise ValueError("无法解析装货段地磅往来单位,请先配置送货客户")
results.extend(
_sync_stop_inventory_links(
db,
@@ -705,7 +753,7 @@ def sync_dibang_for_plan_stops(
transport=transport,
stop_type="load",
stop_id=load.id,
partner=(load.customer_name or "").strip(),
partner=partner,
business_type=business_type,
dibang_date=_resolve_stop_dibang_date(
plan,
@@ -718,26 +766,19 @@ def sync_dibang_for_plan_stops(
)
)
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)
business_type = _resolve_stop_business_type(delivery, "delivery")
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}】无产品明细,无法生成地磅单")
partner = resolve_stop_dibang_partner("delivery", load, deliveries)
if not partner:
raise ValueError("无法解析送货段地磅往来单位,请先配置装货客户")
results.extend(
_sync_stop_inventory_links(
db,
@@ -746,7 +787,7 @@ def sync_dibang_for_plan_stops(
transport=transport,
stop_type="delivery",
stop_id=delivery.id,
partner=(load.customer_name or "").strip(),
partner=partner,
business_type=business_type,
dibang_date=_resolve_stop_dibang_date(
plan,
@@ -23,6 +23,7 @@ PLAN_TYPE_LABELS = {
ARCHIVE_STATUS_LABELS = {
"archived": "已归档",
"unarchived": "未归档",
"draft": "已暂存",
}
FOLLOW_STATUS_LABELS = {
@@ -41,23 +41,38 @@ def _apply_stop_product_archive(
mode: str,
label: str,
user_id: str,
strict: bool = True,
) -> None:
if mode == "inbound":
if item.inbound_qty is None:
if strict:
raise HTTPException(status_code=400, detail=f"{label}入库数量不能为空")
row.inbound_qty = None
row.inbound_amount = None
if item.inbound_price is not None:
row.inbound_price = Decimal(str(item.inbound_price))
else:
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))
row.inbound_amount = (qty * Decimal(str(price))) if price is not None else None
else:
if item.outbound_qty is None:
if strict:
raise HTTPException(status_code=400, detail=f"{label}出库数量不能为空")
row.outbound_qty = None
row.outbound_amount = None
if item.outbound_price is not None:
row.outbound_price = Decimal(str(item.outbound_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.outbound_amount = (qty * Decimal(str(price))) if price is not None else None
row.update_by = user_id
@@ -119,6 +134,7 @@ def apply_archive_stop_quantities(
load_block: PlanArchiveLoadBlock,
delivery_blocks: list[PlanArchiveDeliveryBlock],
user_id: str,
strict: bool = True,
) -> None:
load = (
db.query(PlPlanLoad)
@@ -144,15 +160,16 @@ def apply_archive_stop_quantities(
}
if not load_products:
raise HTTPException(status_code=400, detail="装货段无产品明细")
if len(load_block.products) != len(load_products):
if strict and 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
row, item, mode="inbound", label="装货段", user_id=user_id, strict=strict
)
if item.brand_qtys is not None or strict:
_persist_stop_brand_qtys(
db,
tenant_no=tenant_no,
@@ -174,7 +191,7 @@ def apply_archive_stop_quantities(
.all()
)
delivery_map = {row.id: row for row in deliveries}
if len(delivery_blocks) != len(deliveries):
if strict and len(delivery_blocks) != len(deliveries):
raise HTTPException(status_code=400, detail="请填写全部送货段归档")
for block in delivery_blocks:
@@ -192,7 +209,7 @@ def apply_archive_stop_quantities(
}
if not delivery_products:
raise HTTPException(status_code=400, detail=f"送货段「{delivery.customer_name or ''}」无产品明细")
if len(block.products) != len(delivery_products):
if strict and 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:
@@ -200,8 +217,9 @@ def apply_archive_stop_quantities(
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
row, item, mode="outbound", label=label, user_id=user_id, strict=strict
)
if item.brand_qtys is not None or strict:
_persist_stop_brand_qtys(
db,
tenant_no=tenant_no,
+134
View File
@@ -26,6 +26,7 @@ from app.models.pl_models import (
PlVehiclePersonnel,
)
from app.schemas.pl.plan import (
PlanArchiveFeedbacksBlock,
PlanArchiveFreightBlock,
PlanArchiveProductItem,
PlanContractLink,
@@ -1522,6 +1523,7 @@ def apply_archive_freight(
plan: PlPlan,
freight: PlanArchiveFreightBlock,
user_id: str,
strict: bool = True,
) -> 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
@@ -1560,7 +1562,9 @@ def apply_archive_freight(
return
if not plan.transport_id:
if strict:
raise HTTPException(status_code=400, detail="计划有运输费用但未安排运输,请先安排运输")
return
if transport_has_locked_freight_settlement(db, tenant_no, plan.transport_id):
raise HTTPException(status_code=400, detail="运输单已纳入运费结算,无法修改运费")
@@ -1613,7 +1617,9 @@ def apply_archive_freight(
else:
transport.transport_qty = sum_plan_product_actual_quantities(plan_products)
if freight_type == "by_weight" and (transport.transport_qty or 0) <= 0:
if strict:
raise HTTPException(status_code=400, detail="运输量必须大于0,请先填写产品实际数量")
# 草稿:允许运输量暂缺
if freight.has_invoice is not None:
transport.has_invoice = freight.has_invoice
transport.update_by = user_id
@@ -1746,3 +1752,131 @@ def apply_plan_site_feedback(
link.site_feedback_time = payload.site_feedback_time or datetime.now()
link.update_by = user_id
return link
def _resolve_stop_business_type_for_archive(
db: Session,
*,
tenant_no: str,
plan_id: str,
stop_type: str,
stop_id: str,
) -> str:
from app.models.pl_models import PlPlanDelivery, PlPlanLoad
direction: Optional[str] = None
if stop_type == "load":
row = (
db.query(PlPlanLoad)
.filter(
PlPlanLoad.id == stop_id,
PlPlanLoad.plan_id == plan_id,
PlPlanLoad.tenant_no == tenant_no,
PlPlanLoad.del_flag == 0,
)
.first()
)
direction = (row.dibang_direction or "").strip() if row else None
else:
row = (
db.query(PlPlanDelivery)
.filter(
PlPlanDelivery.id == stop_id,
PlPlanDelivery.plan_id == plan_id,
PlPlanDelivery.tenant_no == tenant_no,
PlPlanDelivery.del_flag == 0,
)
.first()
)
direction = (row.dibang_direction or "").strip() if row else None
if direction == "outbound":
return "出库"
if direction == "inbound":
return "入库"
return "出库"
def apply_archive_stop_feedback_attachments(
db: Session,
*,
tenant_no: str,
plan: PlPlan,
feedbacks: PlanArchiveFeedbacksBlock,
user_id: str,
dept_id: str = "",
) -> None:
if not plan.transport_id:
return
from app.models.pl_models import PlTransportDriverStopFeedback, PlTransportSiteStopFeedback
from app.services.pl_transport_stop_feedback_service import (
save_driver_stop_feedback,
save_site_stop_feedback,
)
transport_id = plan.transport_id
plan_id = plan.id
for item in feedbacks.driver_stops or []:
urls = [url for url in (item.attachment_urls or []) if url]
existing = (
db.query(PlTransportDriverStopFeedback)
.filter(
PlTransportDriverStopFeedback.transport_id == transport_id,
PlTransportDriverStopFeedback.tenant_no == tenant_no,
PlTransportDriverStopFeedback.stop_type == item.stop_type,
PlTransportDriverStopFeedback.stop_id == item.stop_id,
PlTransportDriverStopFeedback.del_flag == 0,
)
.first()
)
if not urls and not existing:
continue
save_driver_stop_feedback(
db,
tenant_no=tenant_no,
transport_id=transport_id,
plan_id=plan_id,
stop_type=item.stop_type,
stop_id=item.stop_id,
attachment_urls=urls,
user_id=user_id,
dept_id=dept_id,
)
for item in feedbacks.site_stops or []:
urls = [url for url in (item.attachment_urls or []) if url]
existing = (
db.query(PlTransportSiteStopFeedback)
.filter(
PlTransportSiteStopFeedback.transport_id == transport_id,
PlTransportSiteStopFeedback.tenant_no == tenant_no,
PlTransportSiteStopFeedback.stop_type == item.stop_type,
PlTransportSiteStopFeedback.stop_id == item.stop_id,
PlTransportSiteStopFeedback.del_flag == 0,
)
.first()
)
if not urls and not existing:
continue
business_type = _resolve_stop_business_type_for_archive(
db,
tenant_no=tenant_no,
plan_id=plan_id,
stop_type=item.stop_type,
stop_id=item.stop_id,
)
save_site_stop_feedback(
db,
tenant_no=tenant_no,
transport_id=transport_id,
plan_id=plan_id,
stop_type=item.stop_type,
stop_id=item.stop_id,
business_type=business_type,
attachment_urls=urls,
user_id=user_id,
dept_id=dept_id,
require_qty_before_attachments=False,
)
+23 -3
View File
@@ -10,11 +10,11 @@ StopType = Literal["load", "delivery"]
def resolve_stop_dibang_defaults(
load_customer_name: Optional[str],
customer_name: Optional[str],
stop_type: StopType,
) -> Tuple[bool, str]:
"""地磅默认勾选以装货客户是否为内部客户为准。"""
if not is_internal_customer_name(load_customer_name):
"""地磅默认勾选以本段客户是否为内部客户(山峡/云栋)为准。"""
if not is_internal_customer_name(customer_name):
return False, "none"
if stop_type == "load":
return True, "outbound"
@@ -23,6 +23,26 @@ def resolve_stop_dibang_defaults(
return False, "none"
def normalize_stop_dibang_fields(
customer_name: Optional[str],
stop_type: StopType,
generate_dibang: Optional[int],
dibang_direction: Optional[str],
) -> Tuple[int, str]:
"""归一化段次地磅勾选与方向:勾选但方向缺失/none 时按本段客户补默认方向。"""
default_gen, default_dir = resolve_stop_dibang_defaults(customer_name, stop_type)
gen = 1 if int(generate_dibang or 0) == 1 else (1 if default_gen else 0)
direction = (dibang_direction or "").strip()
if gen:
if direction not in ("outbound", "inbound"):
direction = default_dir if default_dir != "none" else (
"outbound" if stop_type == "load" else "inbound"
)
else:
direction = "none"
return gen, direction
def _extract_qty(item: Any, *field_names: str) -> Decimal:
for name in field_names:
if isinstance(item, dict):
+13 -7
View File
@@ -31,7 +31,7 @@ from app.schemas.pl.plan import (
)
from app.services.pl_brand_archive import load_brand_qtys_by_stop_product_ids
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_stop_rules import normalize_stop_dibang_fields, warn_qty_imbalance
from app.services.pl_plan_service import (
PLAN_CONTRACT_SIDE_DEMANDER,
PLAN_CONTRACT_SIDE_SUPPLIER,
@@ -707,9 +707,12 @@ def _resolve_or_create_plan_load(
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"
generate_dibang, dibang_direction = normalize_stop_dibang_fields(
load.customer_name,
"load",
load.generate_dibang,
load.dibang_direction,
)
existing = (
db.query(PlPlanLoad)
@@ -832,9 +835,12 @@ def replace_plan_stops(
)
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"
generate_dibang, dibang_direction = normalize_stop_dibang_fields(
delivery.customer_name,
"delivery",
delivery.generate_dibang,
delivery.dibang_direction,
)
delivery_id = generate_uuid()
db.add(
+6 -5
View File
@@ -86,7 +86,7 @@
"84": "Community 84",
"85": "allocate_next_biz_no",
"86": "Community 86",
"87": "Community 87",
"87": "list_customers",
"88": "CrmProduct",
"89": "pl_ocr_service.py",
"90": "WechatMessageService",
@@ -134,18 +134,19 @@
"132": ".to_list_kwargs",
"133": "inventory_id.py",
"134": "list_contacts",
"135": "context.py",
"136": "get_db_current_user_optional",
"137": "iter_user_menu_perm_codes",
"138": "Community 138",
"139": "get_current_user_by_token",
"139": "customer_options",
"140": "unsettled_plans_q_filter",
"141": "web_login_rsa_public_key",
"142": "clear_pl_plan_instance_data.py",
"143": "calc_age_from_chinese_id_card",
"143": "context.py",
"144": "response.py",
"147": "Community 147",
"149": "list_product_options",
"150": "get_db_current_user_optional",
"151": "Community 151",
"153": "pl_feedback_brand_qty.py",
"154": "LocalStorage",
"155": "WechatMessageService",
"162": ".to_tenant_user_dict",
+1 -1
View File
@@ -1 +1 @@
backend
/Users/wuzilong/work/00code/shanxia2.0/backend
@@ -0,0 +1,183 @@
{
"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": "list_customers",
"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",
"110": "pool_rule.py",
"111": "test_pl_public_transport_history.py",
"112": "merge_duplicate_crm_customers.py",
"113": "dict_type.py",
"114": "dept.py",
"115": "site.py",
"116": "Community 116",
"117": "pl_plan_list_attachments.py",
"118": "Community 118",
"119": "Community 119",
"120": "list_duty_staff_users",
"121": "_build_user_info_payload",
"122": "post.py",
"123": "customer_options",
"124": "LocalStorage",
"125": "ethnic.py",
"126": "oper_log.py",
"127": "Any",
"128": "api_crypto.py",
"129": "BaseStorage",
"130": "_filter_export_rows_by_ids",
"131": "resolve_crm_product",
"132": ".to_list_kwargs",
"133": "inventory_id.py",
"134": "list_contacts",
"135": "context.py",
"136": "get_db_current_user_optional",
"137": "iter_user_menu_perm_codes",
"138": "Community 138",
"139": "customer_options",
"142": "clear_pl_plan_instance_data.py",
"144": "response.py",
"147": "Community 147",
"149": "list_product_options",
"150": "get_db_current_user_optional",
"151": "Community 151",
"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,868 @@
# Graph Report - backend (2026-08-28)
## Corpus Check
- 361 files · ~255,278 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 5203 nodes · 19719 edges · 181 communities (167 shown, 14 thin omitted)
- Extraction: 95% EXTRACTED · 5% INFERRED · 0% AMBIGUOUS · INFERRED: 1007 edges (avg confidence: 0.52)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `16986f44`
- 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_list_customers|list_customers]]
- [[_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_pool_rule.py|pool_rule.py]]
- [[_COMMUNITY_test_pl_public_transport_history.py|test_pl_public_transport_history.py]]
- [[_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_pl_plan_list_attachments.py|pl_plan_list_attachments.py]]
- [[_COMMUNITY_Community 118|Community 118]]
- [[_COMMUNITY_Community 119|Community 119]]
- [[_COMMUNITY_list_duty_staff_users|list_duty_staff_users]]
- [[_COMMUNITY__build_user_info_payload|_build_user_info_payload]]
- [[_COMMUNITY_post.py|post.py]]
- [[_COMMUNITY_customer_options|customer_options]]
- [[_COMMUNITY_LocalStorage|LocalStorage]]
- [[_COMMUNITY_ethnic.py|ethnic.py]]
- [[_COMMUNITY_oper_log.py|oper_log.py]]
- [[_COMMUNITY_Any|Any]]
- [[_COMMUNITY_api_crypto.py|api_crypto.py]]
- [[_COMMUNITY_BaseStorage|BaseStorage]]
- [[_COMMUNITY__filter_export_rows_by_ids|_filter_export_rows_by_ids]]
- [[_COMMUNITY_resolve_crm_product|resolve_crm_product]]
- [[_COMMUNITY_.to_list_kwargs|.to_list_kwargs]]
- [[_COMMUNITY_inventory_id.py|inventory_id.py]]
- [[_COMMUNITY_list_contacts|list_contacts]]
- [[_COMMUNITY_context.py|context.py]]
- [[_COMMUNITY_get_db_current_user_optional|get_db_current_user_optional]]
- [[_COMMUNITY_iter_user_menu_perm_codes|iter_user_menu_perm_codes]]
- [[_COMMUNITY_Community 138|Community 138]]
- [[_COMMUNITY_customer_options|customer_options]]
- [[_COMMUNITY_clear_pl_plan_instance_data.py|clear_pl_plan_instance_data.py]]
- [[_COMMUNITY_response.py|response.py]]
- [[_COMMUNITY_Community 147|Community 147]]
- [[_COMMUNITY_list_product_options|list_product_options]]
- [[_COMMUNITY_get_db_current_user_optional|get_db_current_user_optional]]
- [[_COMMUNITY_Community 151|Community 151]]
- [[_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` - 531 edges
2. `get_tenant_no()` - 386 edges
3. `DbUserContext` - 310 edges
4. `success_response()` - 279 edges
5. `error_response()` - 274 edges
6. `generate_uuid()` - 215 edges
7. `BxUserContext` - 204 edges
8. `crm_user_info()` - 138 edges
9. `PlPlan` - 111 edges
10. `ExportValidationError` - 108 edges
## Surprising Connections (you probably didn't know these)
- `BackfillRule` --uses--> `Settings` [INFERRED]
scripts/migrate_crm_sys_oss.py → app/core/config.py
- `MigrationStats` --uses--> `Settings` [INFERRED]
scripts/migrate_bx_data.py → app/core/config.py
- `StepStats` --uses--> `Settings` [INFERRED]
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 (181 total, 14 thin omitted)
### Community 0 - "Community 0"
Cohesion: 0.08
Nodes (69): _generate_notify_message(), PlPlan, PlPlanChange, PlPlanProduct, 计划产品明细表 pl_plan_product, 计划变更记录表 pl_plan_change, PlanArchiveFeedbacksBlock, PlanArchiveFreightBlock (+61 more)
### Community 1 - "Community 1"
Cohesion: 0.07
Nodes (61): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, register_contract_routes(), batch_assign_owner(), batch_submit_contract_approval(), create_from_opportunity(), create_from_quote(), download_contract_pdf(), _ensure_contract_in_scope() (+53 more)
### Community 2 - "Community 2"
Cohesion: 0.18
Nodes (22): ReimburseDetailOut, allocate_reimburse_title_seq(), format_reimburse_title(), generate_apply_code(), generate_title(), is_auto_reimburse_title(), parse_optional_date(), parse_reimburse_date() (+14 more)
### Community 3 - "Community 3"
Cohesion: 0.07
Nodes (95): attachment_download_url(), attachment_preview_url(), create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite(), create_post() (+87 more)
### Community 4 - "Community 4"
Cohesion: 0.09
Nodes (76): _apply_list_filters(), assign_opportunities(), batch_update_expect_date(), batch_update_stage(), change_stage(), create_opportunity(), _decimal_value(), _enrich_user_names() (+68 more)
### Community 5 - "Community 5"
Cohesion: 0.11
Nodes (39): _assert_users_exist(), get_setting(), Any, Session, _row_to_dict(), save_setting(), _assert_users_exist(), get_setting() (+31 more)
### Community 6 - "Community 6"
Cohesion: 0.08
Nodes (68): contact_by_customer(), contact_detail(), contact_set_primary(), customer_create(), customer_detail(), customer_update(), follow_by_customer(), follow_detail() (+60 more)
### Community 7 - "Community 7"
Cohesion: 0.08
Nodes (47): create_carrier(), create_driver(), get_carrier(), get_driver(), list_carriers(), list_drivers(), _personnel_to_driver_read(), reject_carrier() (+39 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.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.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 11 - "Community 11"
Cohesion: 0.10
Nodes (55): cancel_apply(), create_apply(), create_disburse(), delete_applies(), delete_disburses(), get_apply(), get_disburse(), list_applies() (+47 more)
### Community 12 - "Community 12"
Cohesion: 0.05
Nodes (69): InventoryExportBody, InventoryRelatedData, RecognizeCertResult, BaseModel, SoftDeleteModel, AttachmentUploadResponse, ChangePasswordRequest, Config (+61 more)
### Community 13 - "Community 13"
Cohesion: 0.10
Nodes (53): PlTransportDbLink, 运输-地磅出入库关联 pl_transport_db_link, _apply_plan_quantity_delta(), apply_stop_dibang_options(), _create_db_inventory(), _create_db_plan(), _delivery_stop_products(), DibangInventoryLinkResult (+45 more)
### Community 14 - "Community 14"
Cohesion: 0.17
Nodes (17): CertRead, parse_resource_snapshot(), Any, 运输计划 - 安排运输时车辆/人员/证件资源快照 Schema, 从 ORM 文本列或 dict 解析快照。, SnapshotCertRead, SnapshotPersonnelRow, TransportResourceSnapshot (+9 more)
### Community 15 - "Community 15"
Cohesion: 0.09
Nodes (48): approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse(), export_approved_by_me_reimburses(), export_my_reimburses(), export_pending_approval_reimburses() (+40 more)
### Community 16 - "Community 16"
Cohesion: 0.03
Nodes (183): category_add(), category_delete(), category_tree(), category_update(), clue_detail(), clue_export(), clue_follow_detail(), clue_import() (+175 more)
### Community 17 - "Community 17"
Cohesion: 0.12
Nodes (43): approve_carrier(), bind_vehicle_driver(), CarrierExportBody, create_vehicle(), delete_carrier(), delete_driver(), delete_personnel(), delete_vehicle() (+35 more)
### Community 18 - "Community 18"
Cohesion: 0.12
Nodes (44): _advance_list_filters(), advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _export_advance_rows() (+36 more)
### Community 19 - "Community 19"
Cohesion: 0.19
Nodes (28): _apply_plan_product_update(), _apply_plan_update(), AutoGenerateMonthlyResult, _base_query(), create_plan(), delete_plan(), _generate_plan_no(), get_plan() (+20 more)
### Community 20 - "Community 20"
Cohesion: 0.09
Nodes (45): dump_export_row(), issue_status_label(), Any, Session, respond_xlsx(), status_label(), advance_issue_stats(), batch_offset() (+37 more)
### Community 21 - "Community 21"
Cohesion: 0.14
Nodes (41): PlVehicleRechargeApply, PlVehicleRechargeRecord, 车辆ETC/加油充值申请 pl_vehicle_recharge_apply, 车辆ETC/加油充值发放登记 pl_vehicle_recharge_record, Decimal, 发放登记页:申请单 + 关联发放信息(左连接), VehicleRechargeApplyCreate, VehicleRechargeApplyRead (+33 more)
### Community 22 - "Community 22"
Cohesion: 0.08
Nodes (28): parse_admin_request_json(), Any, Request, 运营 Web(/web/admin)JSON 请求体解析。 与 ApiCryptoMiddleware 配合:中间件未改写 body 时,在路由内解密 `{, 读取 JSON body;dict 时走 resolve_request_payload(明文 / 密文 / data 包装)。 Returns:, ApiCryptoError, _b64url_decode(), _b64url_encode() (+20 more)
### Community 23 - "Community 23"
Cohesion: 0.17
Nodes (24): PlPlanProductBrandQty, 计划产品归档品牌数量 pl_plan_product_brand_qty stop_product_id 为空:计划产品级汇总;非空:装货/送货段产品, _is_plan_level_row(), load_brand_qtys_by_plan_product_ids(), load_brand_qtys_by_stop_product_ids(), _parse_unit_price(), persist_plan_product_brand_qtys(), persist_stop_product_brand_qtys() (+16 more)
### 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 (99): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), export_unsettled_plans(), _generate_settlement_no(), get_settlement() (+91 more)
### Community 29 - "Community 29"
Cohesion: 0.12
Nodes (26): PlDocumentReminder, PlPlanDelivery, PlPlanDeliveryProduct, PlPlanLoad, PlPlanLoadProduct, 证件到期提醒表 pl_document_reminder, 运输计划-装货段 pl_plan_load(plan 1:1), 运输计划-装货段产品明细 pl_plan_load_product (+18 more)
### Community 30 - "Community 30"
Cohesion: 0.16
Nodes (26): clear_target_categories(), compute_level(), count_target_rows(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_runtime_settings() (+18 more)
### Community 31 - "Community 31"
Cohesion: 0.16
Nodes (35): PlPlanContract, 运输计划-合同关联(分侧多选) pl_plan_contract, PlanContractGapRead, PlanContractLink, PlanProductRead, is_internal_customer_name(), build_plan_contract_gap_read(), _clear_legacy_side_contracts() (+27 more)
### Community 32 - "Community 32"
Cohesion: 0.20
Nodes (22): create_user(), get_user(), get_user_with_relations(), _hash_password(), list_post_ids_for_user(), list_user_ids_bound_to_post(), list_users(), Any (+14 more)
### Community 33 - "Community 33"
Cohesion: 0.15
Nodes (25): 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 等价), ensure_crm_customer_linked_row_in_scope() (+17 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.05
Nodes (85): _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() (+77 more)
### Community 37 - "Community 37"
Cohesion: 0.09
Nodes (51): check_document_expiry(), document_reminder_stats(), DocumentReminderExportBody, export_document_reminders(), export_inventory_ledger(), get_inventory_ledger(), get_summary(), InventoryLedgerExportBody (+43 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.10
Nodes (29): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+21 more)
### Community 40 - "Community 40"
Cohesion: 0.10
Nodes (35): build_dict_value_from_label(), ensure_dict_data(), format_hhmm(), format_time_label(), grab(), join_work_plans(), normalize_person_name(), _pad_hhmm() (+27 more)
### Community 41 - "Community 41"
Cohesion: 0.22
Nodes (27): export_inbound(), _export_orders(), export_outbound(), _get_by_plan(), get_inbound(), get_inbound_by_plan(), _get_order(), get_outbound() (+19 more)
### Community 42 - "Community 42"
Cohesion: 0.19
Nodes (32): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_oss_id_to_url(), load_runtime_settings(), load_settings_env() (+24 more)
### Community 43 - "Community 43"
Cohesion: 0.08
Nodes (38): BxExportBodyBase, create_invoice(), delete_invoice(), export_invoice_wallets(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices() (+30 more)
### Community 44 - "Community 44"
Cohesion: 0.17
Nodes (30): apply_biz_backfill(), BackfillRule, BizRef, build_biz_index(), count_target_rows(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows() (+22 more)
### Community 45 - "Community 45"
Cohesion: 0.23
Nodes (54): AttachmentDownloadUrlBody, demo_xlsx_export(), DemoXlsxColumnSpec, DemoXlsxExportBody, DeptCreateBody, DeptExportBody, DeptUpdateBody, DictDataCreateBody (+46 more)
### Community 46 - "Community 46"
Cohesion: 0.15
Nodes (38): CrmProductBrand, PlTransportDriverStopFeedback, PlTransportSiteStopFeedback, 运输单-司机按段附件回传 pl_transport_driver_stop_feedback, 运输单-现场按段回传 pl_transport_site_stop_feedback, _direction_label(), _dump_product_feedbacks(), _dump_urls() (+30 more)
### Community 47 - "Community 47"
Cohesion: 0.16
Nodes (19): ApiRequestLogMiddleware, _claims_from_auth(), _format_body_bytes(), _persist_log(), Any, Request, 统一记录 API 请求/响应出入参的中间件, _redact_obj() (+11 more)
### Community 48 - "Community 48"
Cohesion: 0.09
Nodes (65): _apply_contract_entity_fields(), invalidate_all_approvals(), 作废该合同全部有效审批记录(含已通过/已拒绝),用于再编辑或重新提审。, _build_contract_filters(), _build_customer_address(), _calc_amount_with_tax(), _change_row_to_dict(), contract_no_exists() (+57 more)
### Community 49 - "Community 49"
Cohesion: 0.13
Nodes (34): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), create_process_def(), delete_process_def(), _enrich_task_list(), export_completed_tasks(), export_my_instances() (+26 more)
### Community 50 - "Community 50"
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 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.22
Nodes (24): _apply_inventory_product_update(), _apply_inventory_update(), _base_query(), create_inventory(), create_link_for_plan(), delete_inventory(), _generate_batch_no(), _get_inventory() (+16 more)
### Community 53 - "Community 53"
Cohesion: 0.08
Nodes (32): PlInboundOrder, PlOutboundOrder, PlTransportSiteLink, 运输计划现场链接 pl_transport_site_link(与地磅出入库单解耦), 运输计划-入库单 pl_inbound_order, 运输计划-出库单 pl_outbound_order, TransportSiteLinkRead, plan_has_load_stop() (+24 more)
### Community 54 - "Community 54"
Cohesion: 0.29
Nodes (9): ProductSnapshot, Session, 地磅模块 — CRM 产品解析与快照写入。, 校验 CRM 产品并返回名称/规格快照。新建单据 product_id 必填。 require_on_shelf=False 用于运输计划联动地磅等历, resolve_crm_product(), _product(), resolve_crm_product:运输联动场景允许已下架产品。, test_resolve_allows_off_shelf_when_not_required() (+1 more)
### Community 55 - "Community 55"
Cohesion: 0.12
Nodes (15): _db_pool_keepalive_loop(), _error_json(), lifespan(), Exception, Request, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误, 未捕获异常:统一 JSON 500,确保跨域场景下仍有 Access-Control-Allow-Origin, 定期 ping MySQL,避免远程库/NAT 回收空闲 TCP 后首请求长时间卡住。 (+7 more)
### Community 56 - "Community 56"
Cohesion: 0.07
Nodes (71): _build_site_product_read(), _as_date(), _build_driver_url(), _build_history_stop_reads(), _build_public_page(), _build_stop_product_reads(), _format_file_size(), _format_plan_date() (+63 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.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 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.24
Nodes (5): MinIOStorage, Any, 从 MINIO_BASE_URL 解析公网 endpoint;未配置或与内网相同时复用 self.client。, MinIO 预签名下载 URL,携带原始文件名。, MinIO 预签名内联预览 URL(图片新标签页 / PDF iframe 等)。 上传时 put_object 未写 content_typ
### Community 61 - "Community 61"
Cohesion: 0.11
Nodes (43): create_plan_full(), 创建运输计划(完整表单:供方/需方 + 产品库产品 + 可选预选车辆,不自动安排运输), update_plan(), PlanDeliveryBody, PlanLoadBody, PlanStopProductBody, _apply_stop_list_product_name(), attach_plan_stops_to_item() (+35 more)
### Community 62 - "Community 62"
Cohesion: 0.10
Nodes (50): assert_quote_editable_for_update(), _build_quote_filters(), calculate_quote_amount(), create_new_version(), create_quote(), _decimal_value(), _enrich_contact_fields(), _enrich_supplier_name() (+42 more)
### Community 63 - "Community 63"
Cohesion: 0.10
Nodes (30): CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), _enrich_change_rows(), execute_change(), export_contract_changes(), _get_change_row(), list_contract_changes(), Java Controller TODO — 保持 pending,记录备注 (+22 more)
### Community 64 - "Community 64"
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 65 - "Community 65"
Cohesion: 0.15
Nodes (42): PlVehicleMaintenanceApply, PlVehicleMaintenanceProcess, 车辆维保申请 pl_vehicle_maintenance_apply, 车辆维保处理登记 pl_vehicle_maintenance_process, Decimal, VehicleMaintenanceApplyCreate, VehicleMaintenanceApplyRead, VehicleMaintenanceApplyReminder (+34 more)
### Community 66 - "Community 66"
Cohesion: 0.09
Nodes (30): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), Session (+22 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.08
Nodes (59): CompletedTaskExportBody, MyInstanceExportBody, PendingTaskExportBody, ProcessDefCreateBody, ProcessDefExportBody, ProcessDefUpdateBody, PublishVersionBody, StartInstanceBody (+51 more)
### Community 70 - "Community 70"
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 71 - "Community 71"
Cohesion: 0.18
Nodes (20): get_plan_related(), format_datetime(), get_current_time(), parse_datetime(), datetime, _create_by_name(), datetime_end_of_day(), fmt_date() (+12 more)
### Community 72 - "Community 72"
Cohesion: 0.16
Nodes (20): duty_user_options(), _enrich_assign_names(), ensure_duty_dict(), month_summary(), Session, 指定用户时补全 personName(用 nick_name)。, 值班可安排人员:仅「值班人员」角色下的启用用户。, save_day() (+12 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.18
Nodes (25): _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), _get_weighing(), get_weighing_related(), _kg_to_ton() (+17 more)
### Community 75 - "apply_crm_create_by_scope"
Cohesion: 0.10
Nodes (40): menu_badge_stats(), Session, Session, recognize_cert(), RecognizeCertBody, cancel_apply(), create_apply(), create_process() (+32 more)
### Community 76 - "opportunity_follow.py"
Cohesion: 0.08
Nodes (49): operlog_detail(), operlog_export(), operlog_list(), OperLogExportBody, Session, 导出操作日志(当前筛选全量,或 ids 已选)。, 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), _user_info() (+41 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.19
Nodes (21): register_quote_routes(), 接口菜单权限守卫。super_admin 直接放行。, require_menu_code(), accept_quote(), generate_pdf(), generate_share(), _get_quote_in_scope(), get_template() (+13 more)
### Community 79 - "PlCarrier"
Cohesion: 0.19
Nodes (18): create_role(), get_role(), get_role_data_scope(), get_role_menu_ids(), list_roles(), Any, Session, 角色 CRUD(sys_role / sys_role_menu / sys_role_data_scope_detail) (+10 more)
### Community 80 - "resolve_crm_product"
Cohesion: 0.14
Nodes (20): _apply_exclude_follow_status_filter(), _apply_follow_status_filter(), export_plans(), list_plans(), _parse_status_csv(), _plan_plate_match(), PlanExportBody, 列表展示用:优先 CRM 标准名(详情仍返回库内 product_name,以便编辑反推别名)。 (+12 more)
### Community 81 - "customer_follow.py"
Cohesion: 0.39
Nodes (8): get_redis_client(), get_sync_redis_client(), Redis, 共享 Redis 客户端(同步:会话鉴权;异步:API 加密 nonce)。, 同步 Redis(auth 会话等,在线程池中调用)。, 异步 Redis(API 加密 nonce 等中间件)。, _redis_common_kwargs(), redis_enabled()
### Community 82 - "list_duty_staff_users"
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.15
Nodes (30): _advance_contract_after_approval(), approve_contract(), approve_contract_by_contract_id(), approve_pass(), approve_reject(), approve_transfer(), _build_approval_list_filters(), can_user_approve() (+22 more)
### Community 84 - "Community 84"
Cohesion: 0.23
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.07
Nodes (68): clue_assign(), clue_convert(), clue_create(), clue_delete(), clue_follow_create(), clue_follow_delete(), clue_follow_list(), clue_follow_update() (+60 more)
### Community 86 - "Community 86"
Cohesion: 0.19
Nodes (16): align_contract_no_to_sign_date(), date, 标准编号替换日期段,保留序号;非标准返回 None。, 将标准合同编号日期段对齐签订日;撞号则序号顺延(含软删查重)。 非标准编号原样返回。无签订日则原样返回。, replace_contract_no_date(), _mock_last_contract(), 软删占用的编号仍占唯一索引,生成时须跳过(对齐 uk_contract_tenant_no)。, 取最大流水号须含软删,避免复用已软删的最大编号。 (+8 more)
### Community 87 - "list_customers"
Cohesion: 0.15
Nodes (19): customer_dealed(), customer_key(), customer_list(), customer_long_time_no_follow(), customer_mine(), customer_to_follow(), customer_week_new(), pool_customer_export() (+11 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.16
Nodes (22): _build_contract_name_from_parties(), _get_supplier_short_name(), 根据供需方面板与主数据生成/校正合同名称。, ensure_crm_create_by_row_in_scope(), _apply_list_filters(), create_supplier_info(), get_supplier_info(), list_all_supplier_info() (+14 more)
### Community 91 - "unsettled_plans_q_filter"
Cohesion: 0.10
Nodes (33): API 路由包 — 山峡化工生产一体化门户, create_leave(), delete_leave(), export_leaves(), get_leave(), _leave_local_callback(), leave_workflow_callback(), LeaveExportBody (+25 more)
### Community 92 - "Community 92"
Cohesion: 0.26
Nodes (16): generate_uuid(), ConflictAction, PastePersonnelIn, PasteVehicleIn, 运输计划 - 三方粘贴识别提交 Schema, commit_paste_recognize(), _conflict_map(), _find_personnel_by_id_card() (+8 more)
### Community 93 - "api_request_log_middleware.py"
Cohesion: 0.25
Nodes (7): camel_to_snake(), CRUDBase, get_model_attr(), HistoryCRUD, Any, Session, ModelType
### 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.20
Nodes (20): _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 (+12 more)
### Community 96 - "minio_url.py"
Cohesion: 0.18
Nodes (17): get_oper_log_meta(), OperLogMeta, 请求级操作日志元数据(ContextVar), 供异步落库线程使用,避免 ContextVar 跨线程丢失。, set_oper_log_meta(), snapshot_oper_log_meta(), _format_summary(), oper_log() (+9 more)
### Community 97 - "contact.py"
Cohesion: 0.11
Nodes (21): BxAdvanceApply, BxAdvanceApproval, BxWorkflowNode, AdvanceService, Any, Session, 同一节点多次审批时,取 approval_time 最新的一条作为当前节点状态。, 返回全部审批动作,按时间正序排列,用于展示完整审批历史。 (+13 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.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 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.06
Nodes (56): _attach_history_products(), _build_history_page(), _build_page(), _get_by_token(), _history_status_label(), _models(), _parse_history_date(), date (+48 more)
### Community 102 - "BaseStorage"
Cohesion: 0.13
Nodes (18): calc_age_from_chinese_id_card(), date, 从 18 位身份证号计算周岁。号码不完整或出生日期无效时返回 None。, 运输计划 - 人员 upsert 与车辆-人员关联保存, 按 18 位身份证号重算 pl_personnel.age,仅更新算出值与库中不一致的记录。返回更新条数。, refresh_personnel_ages_from_id_card(), check_customer_protect_time(), pool_recovery_job() (+10 more)
### Community 103 - "pl_internal_customer.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 104 - "apply_crm_create_by_scope"
Cohesion: 0.13
Nodes (26): price_letter_add(), price_letter_detail(), price_letter_list(), price_letter_update(), price_letter_void(), create_price_letter(), get_price_letter(), list_price_letters() (+18 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.28
Nodes (14): DeliverySlipPrintRead, build_delivery_slip_print(), _customer_key(), _delivery_matches_customer(), get_delivery_slip_print_context(), list_delivery_print_customers(), _merge_stop_products(), Session (+6 more)
### Community 107 - "apply_pl_scope"
Cohesion: 0.30
Nodes (14): PlanArchiveDeliveryBlock, PlanArchiveLoadBlock, PlanArchiveStopProductItem, apply_archive_stop_quantities(), _apply_stop_product_archive(), _brand_rows_from_item(), iter_stop_archive_inventory_lines(), _persist_stop_brand_qtys() (+6 more)
### 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.12
Nodes (31): _extract_qty(), _fmt_qty(), normalize_stop_dibang_fields(), Any, Decimal, 运输计划多段:内部客户地磅默认值与数量平衡校验, 地磅默认勾选以本段客户是否为内部客户(山峡/云栋)为准。, 归一化段次地磅勾选与方向:勾选但方向缺失/none 时按本段客户补默认方向。 (+23 more)
### Community 110 - "pool_rule.py"
Cohesion: 0.08
Nodes (41): pool_customer_claim(), pool_record_detail(), pool_record_list(), pool_rule_add(), pool_rule_delete(), pool_rule_detail(), pool_rule_execute(), pool_rule_update() (+33 more)
### Community 111 - "test_pl_public_transport_history.py"
Cohesion: 0.34
Nodes (13): PlInventoryTransaction, 库存流水表 pl_inventory_transaction, apply_archive_inventory_for_plan(), apply_archive_inventory_for_plan_stops(), apply_brand_stock_change(), get_or_create_inventory(), Decimal, Session (+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 - "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.25
Nodes (13): get_storage(), download_file_bytes(), file_stream(), get_access_url(), get_download_url(), get_preview_url(), normalize_storage_path(), 报销附件存储适配 — 复用门户 app.core.storage,对外保持 bx 协议。 (+5 more)
### Community 116 - "Community 116"
Cohesion: 0.19
Nodes (26): batch_insert_quote_products(), calculate_subtotal(), _decimal_value(), delete_products_by_quote_id(), _ensure_quote_parent_scope(), _get_field(), get_quote_product(), insert_quote_product() (+18 more)
### Community 117 - "pl_plan_list_attachments.py"
Cohesion: 0.26
Nodes (12): load_plan_document_attachments_by_plan_ids(), _parse_image_urls(), Session, 运输计划列表:聚合司机/现场/出入库现场等单据附件。, _short_label(), _stop_sort_key(), _stop_source_label(), test_parse_image_urls_csv() (+4 more)
### Community 118 - "Community 118"
Cohesion: 0.12
Nodes (35): batch_insert_contract_products(), calculate_subtotal(), _decimal_value(), delete_price_tiers_by_contract_id(), delete_products_by_contract_id(), _get_field(), insert_contract_product(), _letter_oss_ids_to_json() (+27 more)
### 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 - "list_duty_staff_users"
Cohesion: 0.15
Nodes (3): BaseStorage, OSSStorage, 浏览器内联预览 URL;默认实现为普通访问地址。
### Community 121 - "_build_user_info_payload"
Cohesion: 0.12
Nodes (28): _avatar_url_field(), _build_user_info_payload(), change_current_user_password(), get_current_user_profile(), get_web_auth_menu_codes(), _jwt_user_payload(), public_quote_share(), Request (+20 more)
### Community 122 - "post.py"
Cohesion: 0.39
Nodes (10): create_post(), get_post(), list_posts(), post_code_exists(), Any, Session, _row_to_dict(), soft_delete_post() (+2 more)
### Community 123 - "customer_options"
Cohesion: 0.11
Nodes (32): CRM 报价单 API 路由 — 挂接到 crm.router, QuoteApproverSettingSaveBody, QuoteAcceptBody, QuoteApprovalApproveBody, QuoteApprovalListBody, QuoteApprovalRefreshNamesBody, QuoteApprovalWithdrawBody, QuoteCreateBody (+24 more)
### 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.08
Nodes (55): _make_handlers(), PlInboundOrderItem, PlInboundOrderItemBrandQty, PlOutboundOrderItem, PlOutboundOrderItemBrandQty, 出库明细品牌数量 pl_outbound_order_item_brand_qty, 运输计划-入库单明细 pl_inbound_order_item, 入库明细品牌数量 pl_inbound_order_item_brand_qty (+47 more)
### Community 126 - "oper_log.py"
Cohesion: 0.18
Nodes (6): convert_heic_to_jpeg(), _guess_preview_content_type(), QiniuStorage, 文件存储工具模块 支持多种存储方式: 1. 本地存储 (local) - 默认 2. 七牛云存储 (qiniu) - 推荐生产环境使用 3. 阿里云OSS (, 按对象键后缀推断内联预览 Content-Type(纠正上传时未写入 MIME 的情况)。, 将 HEIC/HEIF 格式转换为 JPEG 格式
### Community 127 - "Any"
Cohesion: 0.10
Nodes (46): PlanDeliveryRead, PlanLoadRead, PlanStopProductRead, _append_legacy_plan_product_rows(), _append_stop_product_rows(), build_plan_archive_export_rows(), _empty_product_fields(), _format_date_value() (+38 more)
### Community 128 - "api_crypto.py"
Cohesion: 0.29
Nodes (6): Config, format_api_error_message(), PageResult, Exception, 将 HTTP/SQLAlchemy 等异常转为可展示的错误文案(避免 str([]) 空列表)。, ResponseModel
### 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.49
Nodes (10): clue_statistics_level(), _apply_create_range(), _base_query(), get_clue_level_statistics(), get_clue_overview_statistics(), get_clue_owner_statistics(), get_clue_source_statistics(), get_clue_trend_statistics() (+2 more)
### Community 132 - ".to_list_kwargs"
Cohesion: 0.29
Nodes (9): extract_minio_object_key(), join_relative_urls(), MinIO 附件 URL 规范化(数据迁移共用)。 背景 ---- CRM / 地磅 / 报销与 shanxia2.0 共用同一 MinIO(bucket 默, 业务表 OSS ID 串 → 相对 URL 串(用于客户证照、跟进附件等)。, 去掉预签名 query(``?X-Amz-...``)。, 将绝对/相对 URL 规范为 MinIO object key(不含 bucket)。, resolve_oss_id_csv(), _strip_legacy_prefix() (+1 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.36
Nodes (7): list_ethnics(), Any, Session, 民族码表 CRUD(全局 sys_ethnic), _row_to_dict(), 民族码表 sys_ethnic(国标 GB/T 3304,全局), SysEthnic
### Community 135 - "context.py"
Cohesion: 0.33
Nodes (6): list_duty_staff_users(), 按固定 id 查找「值班人员」角色;找不到再按角色名兜底。, 本租户启用且绑定「值班人员」角色的用户(公开页 users / 管理端 options)。, resolve_duty_staff_role_id(), test_list_duty_staff_users_empty_when_no_role(), test_resolve_duty_staff_role_id_by_fixed_id()
### Community 136 - "get_db_current_user_optional"
Cohesion: 0.06
Nodes (50): export_role_management(), export_tenants(), export_users(), 导出角色列表(当前筛选全量,或 ids 已选)。, 导出租户列表(当前筛选全量,或 ids 已选)。, 导出用户列表(当前筛选全量,或 ids 已选)。, export_inventory(), 导出出入库列表(当前筛选全量,或 ids 已选)。 (+42 more)
### Community 137 - "iter_user_menu_perm_codes"
Cohesion: 0.40
Nodes (3): Any, 供 get_tenant_no 等门户工具使用。, 与门户 JWT / apply_data_scope 所需的 user_info 字段对齐。
### Community 138 - "Community 138"
Cohesion: 0.33
Nodes (19): check_python(), create_venv(), ensure_dirs(), ensure_valid_venv(), ensure_venv_and_runtime(), install_dependencies(), is_running(), log_error() (+11 more)
### Community 139 - "customer_options"
Cohesion: 0.50
Nodes (4): customer_options(), 客户下拉选项(租户内只读,不做 owner 数据权限), CustomerOptionsBody, 客户下拉选项请求体(租户内只读搜索,不做 owner 数据权限)
### 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 144 - "response.py"
Cohesion: 0.06
Nodes (89): archive_plan(), archive_plan_draft(), _build_driver_url(), cancel_plan(), cancel_plan_wait_notice(), ContractGapExportBody, count_plans_by_contract(), create_from_contract() (+81 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 149 - "list_product_options"
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 150 - "get_db_current_user_optional"
Cohesion: 0.16
Nodes (25): create_personnel(), get_personnel(), list_personnel(), _personnel_to_detail(), _personnel_to_read(), update_personnel(), PlCert, PlPersonnel (+17 more)
### Community 154 - "LocalStorage"
Cohesion: 0.15
Nodes (5): LocalStorage, process_image_content(), Path, 带下载文件名的访问 URL;默认实现为普通访问地址。, 处理图片内容,如果是 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.16
Nodes (20): logout(), 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。无 Token 或已失效时仍返回成功(幂等)。, decode_token(), extend_session(), get_client_ip(), get_current_user_simple(), is_refresh_token_valid(), is_session_valid() (+12 more)
### Community 173 - "resolve_create_time_bounds"
Cohesion: 0.07
Nodes (67): _apply_plan_logistics_from_payload(), _apply_transport_arrange_fields(), arrange_transport(), _assert_vehicle_carrier_eligible(), _build_arrange_result(), _build_driver_url(), create_transport(), _ensure_driver_access_token() (+59 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.21
Nodes (15): ApiCryptoMiddleware, _claims_from_auth(), _coerce_post_method_override_to_get(), _get_redis_client(), _is_crypto_api(), _json_error_response(), _mark_nonce_once(), _nonce_key() (+7 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.
- **14 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `generate_uuid()` connect `Community 92` to `Community 0`, `_filter_export_rows_by_ids`, `Community 2`, `Community 4`, `Community 5`, `Community 6`, `Community 7`, `Community 8`, `inventory_id.py`, `Community 11`, `Community 13`, `Community 15`, `response.py`, `Community 17`, `Community 19`, `list_product_options`, `get_db_current_user_optional`, `Community 23`, `Community 24`, `Community 25`, `Community 21`, `Community 28`, `Community 29`, `Community 31`, `Community 32`, `Community 33`, `Community 34`, `Community 36`, `Community 37`, `Community 39`, `Community 40`, `Community 43`, `resolve_create_time_bounds`, `Community 46`, `Community 48`, `Community 50`, `Community 51`, `Community 61`, `Community 62`, `Community 64`, `Community 65`, `Community 67`, `Community 69`, `Community 70`, `Community 71`, `Community 74`, `PlCarrier`, `Community 83`, `allocate_next_biz_no`, `CrmProduct`, `pl_ocr_service.py`, `WechatMessageService`, `unsettled_plans_q_filter`, `contact.py`, `LocalStorage`, `redis_client.py`, `BaseStorage`, `apply_crm_create_by_scope`, `pool_rule.py`, `test_pl_public_transport_history.py`, `dict_type.py`, `dept.py`, `Community 116`, `Community 118`, `_build_user_info_payload`, `post.py`, `LocalStorage`, `ethnic.py`?**
_High betweenness centrality (0.134) - this node is a cross-community bridge._
- **Why does `Settings` connect `price_letter_detail` to `Community 35`, `Community 67`, `tenant.py`, `Community 73`, `Community 42`, `Community 59`, `statistics.py`, `Community 44`, `Community 57`, `Community 26`, `Community 27`, `Community 30`?**
_High betweenness centrality (0.134) - this node is a cross-community bridge._
- **Why does `BaseModel` connect `Community 12` to `api_crypto.py`, `Community 1`, `Community 2`, `Community 3`, `Community 0`, `Community 6`, `Community 7`, `get_db_current_user_optional`, `customer_options`, `Community 11`, `Community 14`, `Community 15`, `response.py`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 16`, `get_db_current_user_optional`, `Community 21`, `Community 28`, `Community 29`, `Community 31`, `Community 33`, `Community 34`, `Community 37`, `Community 39`, `Community 41`, `Community 43`, `Community 45`, `resolve_create_time_bounds`, `Community 49`, `Community 51`, `Community 52`, `Community 53`, `Community 56`, `Community 58`, `Community 61`, `Community 63`, `Community 65`, `Community 66`, `Community 69`, `Community 72`, `Community 74`, `apply_crm_create_by_scope`, `opportunity_follow.py`, `resolve_crm_product`, `allocate_next_biz_no`, `list_customers`, `unsettled_plans_q_filter`, `Community 92`, `test_pl_public_link_archived.py`, `tenant.py`, `pl_internal_customer.py`, `apply_crm_create_by_scope`, `site.py`, `apply_pl_scope`, `pool_rule.py`, `Community 119`, `customer_options`?**
_High betweenness centrality (0.104) - 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?**
_655 weakly-connected nodes found - possible documentation gaps or missing edges._
- **Should `Community 0` be split into smaller, more focused modules?**
_Cohesion score 0.0825508607198748 - nodes in this community are weakly interconnected._
- **Should `Community 1` be split into smaller, more focused modules?**
_Cohesion score 0.07043650793650794 - 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
+237 -240
View File
@@ -1,16 +1,16 @@
# Graph Report - backend (2026-08-27)
# Graph Report - backend (2026-08-28)
## Corpus Check
- 361 files · ~254,633 words
- 361 files · ~255,383 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 5191 nodes · 19666 edges · 182 communities (166 shown, 16 thin omitted)
- Extraction: 95% EXTRACTED · 5% INFERRED · 0% AMBIGUOUS · INFERRED: 1009 edges (avg confidence: 0.52)
- 5210 nodes · 19739 edges · 183 communities (165 shown, 18 thin omitted)
- Extraction: 95% EXTRACTED · 5% INFERRED · 0% AMBIGUOUS · INFERRED: 1010 edges (avg confidence: 0.52)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `4611dbc2`
- Built from commit: `16986f44`
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
- Run `graphify update .` after code changes (no API cost).
@@ -102,7 +102,7 @@
- [[_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_list_customers|list_customers]]
- [[_COMMUNITY_CrmProduct|CrmProduct]]
- [[_COMMUNITY_pl_ocr_service.py|pl_ocr_service.py]]
- [[_COMMUNITY_WechatMessageService|WechatMessageService]]
@@ -150,18 +150,19 @@
- [[_COMMUNITY_.to_list_kwargs|.to_list_kwargs]]
- [[_COMMUNITY_inventory_id.py|inventory_id.py]]
- [[_COMMUNITY_list_contacts|list_contacts]]
- [[_COMMUNITY_context.py|context.py]]
- [[_COMMUNITY_get_db_current_user_optional|get_db_current_user_optional]]
- [[_COMMUNITY_iter_user_menu_perm_codes|iter_user_menu_perm_codes]]
- [[_COMMUNITY_Community 138|Community 138]]
- [[_COMMUNITY_get_current_user_by_token|get_current_user_by_token]]
- [[_COMMUNITY_customer_options|customer_options]]
- [[_COMMUNITY_unsettled_plans_q_filter|unsettled_plans_q_filter]]
- [[_COMMUNITY_web_login_rsa_public_key|web_login_rsa_public_key]]
- [[_COMMUNITY_clear_pl_plan_instance_data.py|clear_pl_plan_instance_data.py]]
- [[_COMMUNITY_calc_age_from_chinese_id_card|calc_age_from_chinese_id_card]]
- [[_COMMUNITY_context.py|context.py]]
- [[_COMMUNITY_response.py|response.py]]
- [[_COMMUNITY_Community 147|Community 147]]
- [[_COMMUNITY_list_product_options|list_product_options]]
- [[_COMMUNITY_get_db_current_user_optional|get_db_current_user_optional]]
- [[_COMMUNITY_Community 151|Community 151]]
- [[_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]]
@@ -189,129 +190,129 @@
- [[_COMMUNITY_PlanResourceSnapshotMixin|PlanResourceSnapshotMixin]]
## God Nodes (most connected - your core abstractions)
1. `BaseModel` - 529 edges
2. `get_tenant_no()` - 385 edges
3. `DbUserContext` - 309 edges
1. `BaseModel` - 531 edges
2. `get_tenant_no()` - 386 edges
3. `DbUserContext` - 310 edges
4. `success_response()` - 279 edges
5. `error_response()` - 274 edges
6. `generate_uuid()` - 215 edges
7. `BxUserContext` - 204 edges
8. `crm_user_info()` - 138 edges
9. `PlPlan` - 110 edges
9. `PlPlan` - 111 edges
10. `ExportValidationError` - 108 edges
## Surprising Connections (you probably didn't know these)
- `BackfillRule` --uses--> `Settings` [INFERRED]
scripts/migrate_crm_sys_oss.py → app/core/config.py
- `test_history_status_label()` --calls--> `_history_status_label()` [EXTRACTED]
tests/test_pl_public_transport_history.py → app/api/pl/public_transport.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 (182 total, 16 thin omitted)
## Communities (183 total, 18 thin omitted)
### Community 0 - "Community 0"
Cohesion: 0.05
Nodes (90): _build_driver_url(), create_from_contract(), _determine_plan_type(), _ensure_subpack_slip_no(), export_contract_gaps(), _format_subpack_slip_no(), _generate_notify_message(), _generate_plan_no() (+82 more)
Cohesion: 0.08
Nodes (62): PlPlanProduct, PlPlanTransport, 计划产品明细表 pl_plan_product, 计划-运输关联表 pl_plan_transport, PlanArchiveFeedbacksBlock, PlanArchiveFreightBlock, PlanArchiveProductItem, PlanProductBase (+54 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)
Nodes (37): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, ContractApproverSettingSaveBody, ContractApprovalActionBody, ContractApprovalPassBody, ContractApprovalRejectBody, ContractApprovalTransferBody, ContractBatchAssignBody, ContractBatchSubmitBody (+29 more)
### Community 2 - "Community 2"
Cohesion: 0.08
Nodes (47): 报销模块认证适配:门户 JWT 用户 → bx 业务上下文。, BxReimburseInvoice, BxReimburseOffset, BxWorkflowNode, 报销(bx)模块数据模型 — 对齐 docs/sql/20260606_bx_tables.sql, ReimburseDetailOut, filter_current_cycle_approvals(), 审批轮次过滤 — 驳回后重新提交时,进度接口仅展示当前轮次。 (+39 more)
Cohesion: 0.13
Nodes (28): ReimburseDetailOut, allocate_reimburse_title_seq(), format_reimburse_title(), generate_apply_code(), generate_title(), is_auto_reimburse_title(), parse_optional_date(), parse_reimburse_date() (+20 more)
### Community 3 - "Community 3"
Cohesion: 0.06
Nodes (86): attachment_download_url(), attachment_preview_url(), create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite(), create_post() (+78 more)
Cohesion: 0.08
Nodes (90): attachment_download_url(), attachment_preview_url(), create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite(), create_post() (+82 more)
### Community 4 - "Community 4"
Cohesion: 0.17
Nodes (43): _apply_list_filters(), assign_opportunities(), batch_update_expect_date(), batch_update_stage(), change_stage(), create_opportunity(), _decimal_value(), _enrich_user_names() (+35 more)
Cohesion: 0.12
Nodes (61): _apply_list_filters(), assign_opportunities(), batch_update_expect_date(), batch_update_stage(), change_stage(), create_opportunity(), _decimal_value(), _enrich_user_names() (+53 more)
### Community 5 - "Community 5"
Cohesion: 0.09
Nodes (70): archive_plan(), create_plan(), get_plan(), update_plan_driver_feedback(), update_plan_site_feedback(), PlPlan, PlPlanProduct, 计划产品明细表 pl_plan_product (+62 more)
Cohesion: 0.20
Nodes (21): _assert_users_exist(), get_setting(), Any, Session, _row_to_dict(), save_setting(), _assert_users_exist(), get_setting() (+13 more)
### Community 6 - "Community 6"
Cohesion: 0.10
Nodes (51): customer_create(), customer_update(), follow_by_customer(), follow_detail(), assign_customer(), batch_claim_customers(), check_duplicate_customer(), claim_customer() (+43 more)
Cohesion: 0.13
Nodes (44): assign_customer(), batch_claim_customers(), check_duplicate_customer(), claim_customer(), create_customer(), customer_name_exists(), deal_customer(), _enrich_user_names() (+36 more)
### Community 7 - "Community 7"
Cohesion: 0.15
Nodes (38): BxApplyListExportBody, approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse(), download_reimburse_import_template(), export_approved_by_me_reimburses() (+30 more)
Cohesion: 0.30
Nodes (12): PlCarrier, assert_carrier_eligible_for_transport(), carrier_agreement_expired(), carrier_audit_approved(), carrier_eligible_for_transport(), carrier_qualification_complete(), date, 资质附件均为选填,保留函数签名供兼容调用。 (+4 more)
### Community 8 - "Community 8"
Cohesion: 0.11
Nodes (32): approve_quote(), can_user_approve(), create_approval_records(), delete_pending_approvals(), get_quote_approval(), invalidate_all_approvals(), list_quote_approvals(), Any (+24 more)
Cohesion: 0.17
Nodes (22): approve_quote(), can_user_approve(), create_approval_records(), delete_pending_approvals(), get_quote_approval(), invalidate_all_approvals(), list_quote_approvals(), Any (+14 more)
### Community 9 - "Community 9"
Cohesion: 0.10
Nodes (48): 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(), is_example_row() (+40 more)
Nodes (49): 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() (+41 more)
### Community 10 - "Community 10"
Cohesion: 0.23
Nodes (12): change_current_user_password(), get_current_user_profile(), public_quote_share(), Request, Session, 获取当前用户信息(与 sys_user 字段对应)。, 公开分享查看报价单 — Java: GET /share/{shareCode}(无 JWT), get_current_user() (+4 more)
Cohesion: 0.10
Nodes (41): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), export_settlements(), export_unsettled_plans(), _generate_settlement_no() (+33 more)
### Community 11 - "Community 11"
Cohesion: 0.10
Nodes (59): cancel_apply(), create_apply(), create_disburse(), delete_applies(), delete_disburses(), export_urea_applies(), export_urea_disburse_board(), get_apply() (+51 more)
Nodes (55): cancel_apply(), create_apply(), create_disburse(), delete_applies(), delete_disburses(), get_apply(), get_disburse(), list_applies() (+47 more)
### Community 12 - "Community 12"
Cohesion: 0.06
Nodes (46): create_leave(), AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest, LoginResponse, Pydantic schemas - 用户认证, ResetPasswordRequest (+38 more)
Cohesion: 0.08
Nodes (40): AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest, LoginResponse, Pydantic schemas - 用户认证, ResetPasswordRequest, UserCreate (+32 more)
### Community 13 - "Community 13"
Cohesion: 0.09
Nodes (57): PlTransportDbLink, 运输-地磅出入库关联 pl_transport_db_link, default_execution_status(), generate_plan_no(), 生成计划号:SX-YYYYMMDDHHMMSS001, _apply_plan_quantity_delta(), apply_stop_dibang_options(), _create_db_inventory() (+49 more)
Nodes (59): _generate_notify_message(), _resolve_other_personnel(), _is_rearrange(), 仅计划已正式安排才算「调整运输」。 创建/编辑表单预选车辆会留下 draft 运输单,计划仍为 pending; 若把非 cancelled, PlPlan, PlTransport, parse_resource_snapshot(), Any (+51 more)
### Community 14 - "Community 14"
Cohesion: 0.14
Nodes (29): _build_driver_url(), _build_public_page(), _build_stop_product_reads(), _format_file_size(), _format_plan_date(), get_public_transport(), _get_transport_by_token(), _parse_feedback_images() (+21 more)
Cohesion: 0.07
Nodes (28): category_add(), category_delete(), category_tree(), category_update(), _map_product_export_column_keys(), product_add(), product_delete(), product_detail() (+20 more)
### Community 15 - "Community 15"
Cohesion: 0.11
Nodes (14): BxReimburseApply, BxReimburseApproval, BxReimburseDetail, 报销单勾选的发票附件(同一发票可勾选多个附件,各占一条)。, ReimburseApplyOut, ReimburseInvoiceBriefOut, ReimburseInvoiceLinkIn, Any (+6 more)
Nodes (16): BxReimburseApply, BxReimburseApproval, BxReimburseDetail, BxReimburseInvoice, BxReimburseOffset, 报销单勾选的发票附件(同一发票可勾选多个附件,各占一条)。, ReimburseInvoiceBriefOut, ReimburseInvoiceLinkIn (+8 more)
### Community 16 - "Community 16"
Cohesion: 0.04
Nodes (194): category_add(), category_delete(), category_tree(), category_update(), clue_check_convert(), clue_check_duplicate(), clue_detail(), clue_export() (+186 more)
Cohesion: 0.06
Nodes (88): clue_check_convert(), clue_check_duplicate(), clue_detail(), clue_export(), clue_follow_detail(), clue_follow_statistics(), clue_import(), clue_list() (+80 more)
### Community 17 - "Community 17"
Cohesion: 0.06
Nodes (94): approve_carrier(), bind_vehicle_driver(), CarrierExportBody, create_driver(), create_personnel(), create_vehicle(), delete_carrier(), delete_driver() (+86 more)
Cohesion: 0.04
Nodes (136): approve_carrier(), bind_vehicle_driver(), CarrierExportBody, create_carrier(), create_driver(), create_personnel(), create_vehicle(), delete_carrier() (+128 more)
### Community 18 - "Community 18"
Cohesion: 0.10
Nodes (43): _advance_list_filters(), advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _export_advance_rows() (+35 more)
Cohesion: 0.18
Nodes (34): BxApplyListExportBody, approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse(), export_approved_by_me_reimburses(), export_my_reimburses() (+26 more)
### Community 19 - "Community 19"
Cohesion: 0.12
Nodes (40): _apply_plan_product_update(), _apply_plan_update(), AutoGenerateMonthlyResult, _base_query(), create_plan(), delete_plan(), export_plans(), _generate_plan_no() (+32 more)
Cohesion: 0.13
Nodes (45): _apply_plan_product_update(), _apply_plan_update(), AutoGenerateMonthlyResult, _base_query(), create_plan(), delete_plan(), _generate_plan_no(), get_plan() (+37 more)
### Community 20 - "Community 20"
Cohesion: 0.10
Nodes (44): dump_export_row(), issue_status_label(), Any, Session, respond_xlsx(), status_label(), advance_issue_stats(), batch_offset() (+36 more)
Cohesion: 0.09
Nodes (41): advance_issue_stats(), batch_offset(), export_advance_issues(), export_advance_issues_xlsx(), export_pending_payments(), export_processed_payments(), issue_advance(), list_advance_issues() (+33 more)
### Community 21 - "Community 21"
Cohesion: 0.09
Nodes (64): cancel_apply(), create_apply(), create_record(), delete_applies(), delete_records(), export_recharge_applies(), export_recharge_disburse_board(), get_apply() (+56 more)
Cohesion: 0.08
Nodes (71): Session, recognize_cert(), RecognizeCertBody, cancel_apply(), create_apply(), create_record(), delete_applies(), delete_records() (+63 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.11
Nodes (38): PlInventory, PlInventoryTransaction, PlPlanProductBrandQty, 库存流水表 pl_inventory_transaction, 计划产品归档品牌数量 pl_plan_product_brand_qty stop_product_id 为空:计划产品级汇总;非空:装货/送货段产品, _is_plan_level_row(), load_brand_qtys_by_plan_product_ids(), load_brand_qtys_by_stop_product_ids() (+30 more)
Cohesion: 0.17
Nodes (24): PlPlanProductBrandQty, 计划产品归档品牌数量 pl_plan_product_brand_qty stop_product_id 为空:计划产品级汇总;非空:装货/送货段产品, _is_plan_level_row(), load_brand_qtys_by_plan_product_ids(), load_brand_qtys_by_stop_product_ids(), _parse_unit_price(), persist_plan_product_brand_qtys(), persist_stop_product_brand_qtys() (+16 more)
### Community 24 - "Community 24"
Cohesion: 0.19
@@ -330,60 +331,60 @@ 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.09
Nodes (61): PlFreightSettlement, PlFreightSettlementApproval, PlFreightSettlementTransport, PlRemittanceVoucher, 运费结算表 pl_freight_settlement, 运费结算审批 pl_freight_settlement_approval, 结算单-运输关联表 pl_freight_settlement_transport, 汇款凭证表 pl_remittance_voucher (+53 more)
Cohesion: 0.12
Nodes (53): PlFreightSettlement, PlFreightSettlementApproval, 运费结算表 pl_freight_settlement, 运费结算审批 pl_freight_settlement_approval, _advance_after_approval(), _approval_to_dict(), can_user_approve_settlement(), cancel_draft_settlement() (+45 more)
### Community 29 - "Community 29"
Cohesion: 0.11
Nodes (36): PlPlanDelivery, PlPlanDeliveryProduct, PlPlanLoad, PlPlanLoadProduct, 运输计划-装货段 pl_plan_load(plan 1:1), 运输计划-装货段产品明细 pl_plan_load_product, 运输计划-送货段 pl_plan_delivery(plan 1:N), 运输计划-送货段产品明细 pl_plan_delivery_product (+28 more)
Cohesion: 0.08
Nodes (40): DocumentReminderExportBody, SoftDeleteModel, BizAttachment, 流程连线/转移 wf_transition, WfTransition, PlDocumentReminder, PlDriver, PlFreightSettlementTransport (+32 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.19
Nodes (30): DutyAssignment, DutyDay, DutySlot, 值班排班模型 — docs/superpowers/specs/2026-08-14-duty-schedule-design.md, _assignment_dict(), build_public_url(), _count_active_assignments(), _day_dict() (+22 more)
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 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.17
Nodes (23): contact_by_customer(), contact_detail(), contact_set_primary(), customer_options(), 客户下拉选项(租户内只读,不做 owner 数据权限), create_contact(), get_contact(), list_contacts_by_customer() (+15 more)
Cohesion: 0.15
Nodes (32): create_contact(), get_contact(), list_contacts_by_customer(), _parse_optional_date(), Any, date, Session, _row_to_dict() (+24 more)
### Community 34 - "Community 34"
Cohesion: 0.14
Nodes (21): create_workflow(), delete_workflow(), get_workflow(), get_workflow_by_biz_type(), list_workflows(), Session, save_workflow_nodes(), update_workflow() (+13 more)
Cohesion: 0.13
Nodes (23): create_workflow(), delete_workflow(), get_workflow(), get_workflow_by_biz_type(), list_workflows(), Session, save_workflow_nodes(), update_workflow() (+15 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 (55): _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() (+47 more)
Cohesion: 0.07
Nodes (65): _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() (+57 more)
### Community 37 - "Community 37"
Cohesion: 0.09
Nodes (53): check_document_expiry(), document_reminder_stats(), export_document_reminders(), get_inventory_ledger(), get_summary(), list_document_reminders(), list_transactions(), list_warnings() (+45 more)
Cohesion: 0.12
Nodes (40): check_document_expiry(), document_reminder_stats(), export_document_reminders(), export_inventory_ledger(), get_inventory_ledger(), get_summary(), InventoryLedgerExportBody, list_document_reminders() (+32 more)
### Community 38 - "Community 38"
Cohesion: 0.31
Nodes (9): decrypt_login_payload(), ensure_initialized(), extract_login_credentials(), get_public_pem(), Any, 登录凭据 RSA 解密(与前端 JSEncrypt PKCS#1 v1.5 兼容)。, Base64 密文 -> JSON 对象(须含 username、password、ts 毫秒时间戳)。, 从请求体解析用户名、密码。 返回 (username, password, error_message);error_message 非空时表示失败。 (+1 more)
### Community 39 - "Community 39"
Cohesion: 0.18
Nodes (17): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+9 more)
Cohesion: 0.12
Nodes (25): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+17 more)
### Community 40 - "Community 40"
Cohesion: 0.11
Nodes (31): build_dict_value_from_label(), ensure_dict_data(), format_hhmm(), format_time_label(), grab(), normalize_person_name(), _pad_hhmm(), parse_hhmm() (+23 more)
Nodes (33): assert_user_is_duty_staff(), build_dict_value_from_label(), DutyBizError, ensure_dict_data(), grab(), list_duty_staff_users(), normalize_person_name(), _pad_hhmm() (+25 more)
### Community 41 - "Community 41"
Cohesion: 0.16
Nodes (36): export_inbound(), _export_orders(), export_outbound(), _get_by_plan(), get_inbound(), get_inbound_by_plan(), _get_order(), get_outbound() (+28 more)
Cohesion: 0.22
Nodes (27): export_inbound(), _export_orders(), export_outbound(), _get_by_plan(), get_inbound(), get_inbound_by_plan(), _get_order(), get_outbound() (+19 more)
### Community 42 - "Community 42"
Cohesion: 0.19
@@ -391,67 +392,67 @@ Nodes (32): _dec(), derive_source_url(), fetch_portal_admin_id(), fetch_source_r
### Community 43 - "Community 43"
Cohesion: 0.10
Nodes (31): create_invoice(), delete_invoice(), export_invoice_wallets(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices(), Request (+23 more)
Nodes (30): create_invoice(), delete_invoice(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices(), Request, Session (+22 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.30
Nodes (48): AttachmentDownloadUrlBody, DemoXlsxColumnSpec, DemoXlsxExportBody, DeptCreateBody, DeptExportBody, DeptUpdateBody, DictDataCreateBody, DictDataUpdateBody (+40 more)
Cohesion: 0.13
Nodes (80): AttachmentDownloadUrlBody, demo_xlsx_export(), DemoXlsxColumnSpec, DemoXlsxExportBody, DeptCreateBody, DeptExportBody, DeptUpdateBody, DictDataCreateBody (+72 more)
### Community 46 - "Community 46"
Cohesion: 0.16
Nodes (38): PlTransportDriverStopFeedback, PlTransportSiteStopFeedback, 运输单-司机按段附件回传 pl_transport_driver_stop_feedback, 运输单-现场按段回传 pl_transport_site_stop_feedback, _direction_label(), _dump_product_feedbacks(), _dump_urls(), _get_driver_feedback_row() (+30 more)
Cohesion: 0.06
Nodes (77): CrmProductBrand, PlPlanDelivery, PlPlanDeliveryProduct, PlPlanLoad, PlPlanLoadProduct, PlTransportDriverStopFeedback, PlTransportSiteStopFeedback, 运输计划-装货段 pl_plan_load(plan 1:1) (+69 more)
### Community 47 - "Community 47"
Cohesion: 0.12
Nodes (16): 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方详情 — Java: CrmSupplierInfoController.getInfo, 新增供方 — Java: CrmSupplierInfoController.add, 修改供方 — Java: CrmSupplierInfoController.edit, 删除供方 — Java: CrmSupplierInfoController.remove, supplier_info_add(), supplier_info_delete(), supplier_info_detail() (+8 more)
Cohesion: 0.23
Nodes (14): ApiRequestLogMiddleware, _claims_from_auth(), _format_body_bytes(), _persist_log(), Any, Request, 统一记录 API 请求/响应出入参的中间件, _redact_obj() (+6 more)
### Community 48 - "Community 48"
Cohesion: 0.10
Nodes (63): _apply_contract_entity_fields(), _build_contract_filters(), _build_contract_name_from_parties(), _build_customer_address(), _calc_amount_with_tax(), _change_row_to_dict(), contract_no_exists(), _contract_period_key() (+55 more)
Cohesion: 0.08
Nodes (84): 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() (+76 more)
### Community 49 - "Community 49"
Cohesion: 0.14
Nodes (31): register_contract_routes(), batch_assign_owner(), batch_submit_contract_approval(), download_contract_pdf(), export_contracts(), finish_contract(), get_contract_row(), _get_contract_row_in_scope() (+23 more)
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 50 - "Community 50"
Cohesion: 0.19
Nodes (11): get_current_time(), parse_datetime(), datetime, allocate_next_biz_no(), _format_biz_no(), _prefix_for(), datetime, Session (+3 more)
Cohesion: 0.22
Nodes (19): DbInboundOutbound, PlTransportDbLink, 运输-地磅出入库关联 pl_transport_db_link, _apply_plan_quantity_delta(), 装货段地磅往来单位取第一个送货客户;送货段取装货客户。, _resolve_link_contributed_qty(), resolve_stop_dibang_partner(), _subtract_plan_contribution() (+11 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.18
Nodes (29): _apply_inventory_product_update(), _apply_inventory_update(), _base_query(), create_inventory(), create_link_for_plan(), delete_inventory(), export_inventory(), _generate_batch_no() (+21 more)
Cohesion: 0.19
Nodes (25): _apply_inventory_product_update(), _apply_inventory_update(), _base_query(), create_inventory(), create_link_for_plan(), delete_inventory(), _generate_batch_no(), _get_inventory() (+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()
Cohesion: 0.18
Nodes (10): plan_requires_site_link(), Session, 装货或送货段任一段客户为山峡/云栋时,需要生成现场链接。, _FakeQuery, _FakeSession, _plan(), 现场链接生成条件:装货/送货段含山峡或云栋客户, test_external_stops_do_not_require_site_link() (+2 more)
### Community 54 - "Community 54"
Cohesion: 0.15
Nodes (21): _build_public_page(), _build_site_product_read(), _format_file_size(), get_public_site(), _get_site_link_by_token(), _parse_feedback_images(), Session, UploadFile (+13 more)
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 55 - "Community 55"
Cohesion: 0.09
Nodes (21): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), Config, _db_pool_keepalive_loop(), _error_json() (+13 more)
Cohesion: 0.12
Nodes (15): _db_pool_keepalive_loop(), _error_json(), lifespan(), Exception, Request, 数据库异常:返回 JSON 并保留 CORS 头,避免浏览器只报跨域错误, 未捕获异常:统一 JSON 500,确保跨域场景下仍有 Access-Control-Allow-Origin, 定期 ping MySQL,避免远程库/NAT 回收空闲 TCP 后首请求长时间卡住。 (+7 more)
### Community 56 - "Community 56"
Cohesion: 0.14
Nodes (34): _build_history_stop_reads(), get_public_transport_history(), _history_status_label(), _resolve_unit_label(), _build_public_page(), _build_site_history_stop_reads(), _build_site_url(), _format_file_size() (+26 more)
Cohesion: 0.04
Nodes (122): _attach_history_products(), _build_history_page(), _build_page(), _get_by_token(), _history_status_label(), _models(), _parse_history_date(), date (+114 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 (25): create_expense_item(), delete_expense_item(), ExpenseItemExportBody, export_expense_items(), _flatten_expense_tree(), get_expense_item(), get_expense_item_tree(), Session (+17 more)
Cohesion: 0.08
Nodes (39): create_expense_item(), delete_expense_item(), ExpenseItemExportBody, export_expense_items(), _flatten_expense_tree(), get_expense_item(), get_expense_item_tree(), Session (+31 more)
### Community 59 - "Community 59"
Cohesion: 0.20
@@ -462,108 +463,112 @@ Cohesion: 0.18
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.11
Nodes (50): create_plan_full(), 创建运输计划(完整表单:供方/需方 + 产品库产品 + 可选预选车辆,不自动安排运输), update_plan(), generate_uuid(), PlPlanContract, 运输计划-合同关联(分侧多选) pl_plan_contract, PlanContractLink, PlanDeliveryBody (+42 more)
Cohesion: 0.07
Nodes (75): update_plan(), PlPlanContract, 运输计划-合同关联(分侧多选) pl_plan_contract, PlanContractGapRead, PlanContractLink, PlanDeliveryBody, PlanLoadBody, PlanProductRead (+67 more)
### Community 62 - "Community 62"
Cohesion: 0.09
Nodes (72): register_quote_routes(), accept_quote(), assert_quote_editable_for_update(), _build_quote_filters(), calculate_quote_amount(), create_new_version(), create_quote(), _decimal_value() (+64 more)
Cohesion: 0.10
Nodes (68): register_quote_routes(), accept_quote(), assert_quote_editable_for_update(), _build_quote_filters(), calculate_quote_amount(), create_new_version(), create_quote(), _decimal_value() (+60 more)
### Community 63 - "Community 63"
Cohesion: 0.18
Nodes (25): CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), execute_change(), export_contract_templates(), _get_change_row(), get_contract_change_detail(), get_contract_template_detail(), list_contract_templates() (+17 more)
Cohesion: 0.16
Nodes (32): CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), _change_row_to_dict(), create_contract_change(), _enrich_change_rows(), execute_change(), export_contract_changes(), export_contract_templates() (+24 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)
Cohesion: 0.18
Nodes (32): generate_id(), DutyAssignment, DutyDay, DutySlot, 值班排班模型 — docs/superpowers/specs/2026-08-14-duty-schedule-design.md, _assignment_dict(), build_public_url(), _count_active_assignments() (+24 more)
### Community 65 - "Community 65"
Cohesion: 0.10
Nodes (60): cancel_apply(), create_apply(), create_process(), delete_applies(), delete_processes(), export_process_board(), get_apply(), get_process() (+52 more)
Nodes (58): cancel_apply(), create_apply(), create_process(), delete_applies(), delete_processes(), get_apply(), get_process(), list_applies() (+50 more)
### Community 66 - "Community 66"
Cohesion: 0.06
Nodes (40): 地磅 API 路由聚合 — REST 风格,协议对齐原 simple-dibang-xiaoshou。, API 路由包 — 山峡化工生产一体化门户, get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), operlog_detail(), operlog_list(), Session, 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构) (+32 more)
Cohesion: 0.11
Nodes (23): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), Session (+15 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)
Cohesion: 0.13
Nodes (29): _actor_ids(), _actor_names(), assert_row_deletable_by_creator(), assert_rows_deletable_by_creator(), can_delete_by_creator(), is_super_admin(), normalize_user_info(), Any (+21 more)
### Community 69 - "Community 69"
Cohesion: 0.08
Nodes (59): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), CompletedTaskExportBody, create_process_def(), delete_process_def(), _enrich_task_list(), export_completed_tasks() (+51 more)
### 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)
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 71 - "Community 71"
Cohesion: 0.05
Nodes (71): clue_assign(), clue_convert(), clue_create(), clue_delete(), clue_follow_create(), clue_follow_delete(), clue_follow_list(), clue_follow_update() (+63 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 72 - "Community 72"
Cohesion: 0.12
Nodes (26): day_detail(), delete_assignment(), duty_user_options(), _enrich_assign_names(), ensure_duty_dict(), month_summary(), Session, 指定用户时补全 personName(用 nick_name)。 (+18 more)
### Community 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.12
Nodes (46): get_plan_related(), _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), export_weighing(), _get_weighing() (+38 more)
Cohesion: 0.16
Nodes (30): _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), export_weighing(), _get_weighing(), get_weighing_related() (+22 more)
### Community 75 - "apply_crm_create_by_scope"
Cohesion: 0.06
Nodes (68): Session, read_customer_stop_pref(), approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), export_settlements() (+60 more)
Cohesion: 0.32
Nodes (14): menu_badge_stats(), Session, apply_pl_scope(), Session, build_menu_badge_counts(), count_document_reminder_expired_pending(), count_freight_approval_pending(), count_freight_disburse_pending() (+6 more)
### Community 76 - "opportunity_follow.py"
Cohesion: 0.10
Nodes (39): _append_user_scope_conditions(), apply_data_scope(), assert_row_in_data_scope(), _collect_scope_ids(), _get_child_dept_ids(), get_user_dept_id(), Session, 数据权限过滤(V0.3:基于角色 data_scope 的查询级行级过滤) data_scope 值: 1 = 全部数据 2 = 本部门数据 3 (+31 more)
Cohesion: 0.14
Nodes (28): _append_user_scope_conditions(), apply_data_scope(), assert_row_in_data_scope(), _collect_scope_ids(), _get_child_dept_ids(), get_user_dept_id(), Session, 数据权限过滤(V0.3:基于角色 data_scope 的查询级行级过滤) data_scope 值: 1 = 全部数据 2 = 本部门数据 3 (+20 more)
### 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.25
Nodes (19): opportunity_follow_add(), opportunity_follow_update(), create_opportunity_follow(), _ensure_parent_opportunity(), get_opportunity_follow(), list_follows_by_opportunity(), list_opportunity_follows(), _parse_optional_datetime() (+11 more)
Cohesion: 0.12
Nodes (16): 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方详情 — Java: CrmSupplierInfoController.getInfo, 新增供方 — Java: CrmSupplierInfoController.add, 修改供方 — Java: CrmSupplierInfoController.edit, 删除供方 — Java: CrmSupplierInfoController.remove, supplier_info_add(), supplier_info_delete(), supplier_info_detail() (+8 more)
### Community 79 - "PlCarrier"
Cohesion: 0.07
Nodes (41): DocumentReminderExportBody, export_inventory_ledger(), InventoryLedgerExportBody, ApiRequestLogCRUD, Session, list_ethnics(), Any, Session (+33 more)
Cohesion: 0.19
Nodes (18): create_role(), get_role(), get_role_data_scope(), get_role_menu_ids(), list_roles(), Any, Session, 角色 CRUD(sys_role / sys_role_menu / sys_role_data_scope_detail) (+10 more)
### Community 80 - "resolve_crm_product"
Cohesion: 0.36
Nodes (15): create_opportunity_follow(), _ensure_parent_opportunity(), get_opportunity_follow(), list_follows_by_opportunity(), list_opportunity_follows(), _parse_optional_datetime(), Any, datetime (+7 more)
### Community 81 - "customer_follow.py"
Cohesion: 0.17
Nodes (22): create_carrier(), get_carrier(), update_carrier(), PlCarrier, carrier_to_read(), CarrierBase, CarrierCreate, CarrierQualificationBase (+14 more)
Cohesion: 0.15
Nodes (14): invoice_info_add(), invoice_info_by_customer(), _invoice_info_by_customer_impl(), invoice_info_delete(), invoice_info_list(), invoice_info_set_default(), invoice_info_update(), 按客户ID查询开票信息(与 by-customer 等价) (+6 more)
### Community 82 - "list_duty_staff_users"
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.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)
Cohesion: 0.10
Nodes (42): _advance_contract_after_approval(), approve_contract(), approve_contract_by_contract_id(), approve_pass(), approve_reject(), approve_transfer(), _build_approval_list_filters(), can_user_approve() (+34 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.13
Nodes (42): clue_follow_detail(), assign_clues(), check_convert(), check_duplicate_clue(), convert_clue(), create_clue(), _enrich_user_names(), _ensure_clue_in_scope() (+34 more)
Cohesion: 0.14
Nodes (42): assign_clues(), check_convert(), check_duplicate_clue(), convert_clue(), create_clue(), _enrich_user_names(), _ensure_clue_in_scope(), create_clue_follow() (+34 more)
### Community 86 - "Community 86"
Cohesion: 0.18
Nodes (18): align_contract_no_to_sign_date(), generate_contract_no(), date, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号} 流水与撞号检测须含软删:uk_contr, 标准编号替换日期段,保留序号;非标准返回 None。, 将标准合同编号日期段对齐签订日;撞号则序号顺延(含软删查重)。 非标准编号原样返回。无签订日则原样返回。, replace_contract_no_date(), _mock_last_contract() (+10 more)
Cohesion: 0.16
Nodes (20): align_contract_no_to_sign_date(), contract_no_exists(), generate_contract_no(), date, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号} 流水与撞号检测须含软删:uk_contr, 租户内合同编号是否已占用(含软删,保证全局唯一)。, 标准编号替换日期段,保留序号;非标准返回 None。, 将标准合同编号日期段对齐签订日;撞号则序号顺延(含软删查重)。 非标准编号原样返回。无签订日则原样返回。 (+12 more)
### Community 87 - "Community 87"
Cohesion: 0.27
Nodes (17): apply_crm_create_by_scope(), 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() (+9 more)
### Community 87 - "list_customers"
Cohesion: 0.24
Nodes (14): get_web_auth_menu_codes(), 获取当前用户菜单权限标识(sys_menu.perms,经角色继承)。, _expand_with_ancestor_menu_ids(), _granted_menu_ids_for_user(), iter_user_menu_perm_codes(), Session, Web 管理端登录:基于 V0.3 sys_user / sys_user_role / sys_role 的角色与菜单权限解析, 角色仅勾选按钮(F)时,补齐祖先 C/M 菜单 id,便于前端匹配 :list 路由。 (+6 more)
### Community 88 - "CrmProduct"
Cohesion: 0.23
@@ -575,75 +580,75 @@ Nodes (22): PlOcrUsageMonth, 阿里云 OCR 月度调用计数 pl_ocr_usage_month
### Community 90 - "WechatMessageService"
Cohesion: 0.13
Nodes (25): _apply_list_filters(), create_supplier_info(), get_supplier_info(), list_all_supplier_info(), list_supplier_info(), Any, Session, CRM 供方信息 CRUD — 对照 CrmSupplierInfoServiceImpl.java (+17 more)
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 91 - "unsettled_plans_q_filter"
Cohesion: 0.14
Nodes (26): delete_leave(), export_leaves(), get_leave(), _leave_local_callback(), leave_workflow_callback(), LeaveExportBody, list_leaves(), Session (+18 more)
Cohesion: 0.33
Nodes (11): create_leave(), get_leave(), list_leaves(), Any, Session, _row_to_dict(), soft_delete_leave(), update_leave() (+3 more)
### Community 92 - "Community 92"
Cohesion: 0.18
Nodes (22): _assert_users_exist(), get_setting(), Any, Session, _row_to_dict(), save_setting(), _assert_users_exist(), get_setting() (+14 more)
Cohesion: 0.30
Nodes (12): business_type_from_path(), title_from_path(), _apply_oper_log_scope(), get_oper_log(), list_oper_logs(), _oper_log_row_in_scope(), _oper_status(), Any (+4 more)
### Community 93 - "api_request_log_middleware.py"
Cohesion: 0.24
Nodes (8): generate_id(), camel_to_snake(), CRUDBase, get_model_attr(), HistoryCRUD, Any, Session, ModelType
Cohesion: 0.25
Nodes (7): camel_to_snake(), CRUDBase, get_model_attr(), HistoryCRUD, Any, Session, ModelType
### 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.26
Nodes (18): _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 (+10 more)
Cohesion: 0.21
Nodes (19): _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 (+11 more)
### Community 96 - "minio_url.py"
Cohesion: 0.10
Nodes (31): ApiRequestLogMiddleware, _claims_from_auth(), _format_body_bytes(), _persist_log(), Any, Request, 统一记录 API 请求/响应出入参的中间件, _redact_obj() (+23 more)
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 97 - "contact.py"
Cohesion: 0.34
Nodes (18): batch_add_opportunity_products(), _calc_subtotal(), create_opportunity_product(), _decimal_value(), _fill_product_redundant(), _get_opportunity_for_product(), get_opportunity_product(), list_opportunity_products() (+10 more)
Cohesion: 0.09
Nodes (47): _advance_list_filters(), advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _export_advance_rows() (+39 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.27
Nodes (11): create_dict_data(), get_dict_data(), list_dict_data(), list_dict_data_options(), Any, Session, 字典数据 CRUD(sys_dict_data), 字典下拉选项:租户主数据,忽略数据范围(user_info 保留兼容调用方,不参与过滤)。 (+3 more)
Cohesion: 0.29
Nodes (12): build_name_pinyin_abbr(), normalize_name_pinyin_abbr(), 名称拼音首字母缩写:库内存小写,检索时大小写不敏感。, 保存时解析拼音字段。 - submitted_provided=True:用提交值(空则按 name 生成) - 否则:已有非空 existi, resolve_name_pinyin_abbr(), test_chinese_and_alnum(), test_empty_and_whitespace(), test_resolve_not_submitted_empty_existing_generates() (+4 more)
### Community 100 - "price_letter_detail"
Cohesion: 0.27
Nodes (15): Settings, BaseSettings, apply_renumber(), build_mapping(), fetch_products(), format_new_product_no(), load_settings_env(), main() (+7 more)
### Community 101 - "tenant.py"
Cohesion: 0.18
Nodes (17): 返回 (作废, 归档)。现场链接实际走入库/出库单公共页。, _resolve_io_order_link_flags(), _resolve_site_link_flags(), _resolve_driver_link_flags(), PublicTransportPageRead, PublicTransportSitePageRead, 运输计划司机/现场公共链接:归档后应标记并拦截写操作。, test_driver_link_flags_archived_when_plan_archived() (+9 more)
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.43
Nodes (5): calc_age_from_chinese_id_card(), date, 从 18 位身份证号计算周岁。号码不完整或出生日期无效时返回 None。, test_calc_age_from_18_digit_id(), test_calc_age_rejects_invalid()
Cohesion: 0.11
Nodes (26): get_pool_record(), list_pool_records(), Any, Session, _row_to_dict(), total_pages(), create_oss(), get_oss_by_id() (+18 more)
### Community 103 - "pl_internal_customer.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)
Cohesion: 0.16
Nodes (20): _assert_editable(), _build_public_page(), _format_file_size(), _get_inventory_by_token(), get_public_inventory(), _parse_feedback_images(), Session, UploadFile (+12 more)
### Community 104 - "apply_crm_create_by_scope"
Cohesion: 0.25
Nodes (17): create_price_letter(), get_price_letter(), list_price_letters(), _parse_date(), Any, date, Session, _row_to_dict() (+9 more)
Cohesion: 0.29
Nodes (15): create_price_letter(), get_price_letter(), list_price_letters(), _parse_date(), Any, date, Session, _row_to_dict() (+7 more)
### Community 105 - "pool_customer_assign"
Cohesion: 0.67
Nodes (3): parse_optional_plan_datetime(), datetime, 运输计划相关日期时间解析:前端 date-picker 仅传 YYYY-MM-DD。
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 106 - "site.py"
Cohesion: 0.40
Nodes (9): create_oss(), create_oss(), get_oss_by_id(), get_oss_by_url(), Session, 按主键 id 查询附件(兼容旧 CRM 雪花 oss_id 迁入后的记录), 将 fileUrl 或旧 CRM 数字 ossId 解析为 MinIO 相对路径。 门户新上传把相对路径写入业务字段;迁入合同附件仍存数字 ossId, resolve_storage_path() (+1 more)
Cohesion: 0.60
Nodes (9): apply_site_feedback(), _header(), _item(), test_apply_site_feedback_does_not_reset_first_submitted_at(), test_apply_site_feedback_keeps_in_progress_when_requested(), test_apply_site_feedback_rejects_already_voided(), test_apply_site_feedback_rejects_invalid_status(), test_apply_site_feedback_sets_status_completed() (+1 more)
### Community 107 - "apply_pl_scope"
Cohesion: 0.16
Nodes (29): create_instance(), create_process_def(), create_task(), get_all_tasks_for_business(), get_instance(), get_latest_version(), get_nodes_by_version(), get_pending_tasks_by_node() (+21 more)
Cohesion: 0.25
Nodes (7): contact_add(), contact_delete(), contact_update(), ContactCreateBody, ContactDeleteBody, ContactUpdateBody, CRM 联系人 Pydantic Schemas
### Community 108 - "statistics.py"
Cohesion: 0.20
@@ -651,15 +656,15 @@ Nodes (24): count_source_rows(), derive_source_url(), fetch_portal_admin_id(), f
### Community 109 - "test_pl_plan_stop_rules.py"
Cohesion: 0.12
Nodes (28): _extract_qty(), _fmt_qty(), Any, Decimal, 运输计划多段:内部客户地磅默认值与数量平衡校验, 地磅默认勾选以装货客户是否为内部客户为准。, resolve_stop_dibang_defaults(), _sum_qty() (+20 more)
Nodes (31): _extract_qty(), _fmt_qty(), normalize_stop_dibang_fields(), Any, Decimal, 运输计划多段:内部客户地磅默认值与数量平衡校验, 地磅默认勾选以本段客户是否为内部客户(山峡/云栋)为准。, 归一化段次地磅勾选与方向:勾选但方向缺失/none 时按本段客户补默认方向。 (+23 more)
### Community 110 - "pool_rule.py"
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)
Cohesion: 0.04
Nodes (81): clue_import_template(), customer_create(), customer_import_template(), opportunity_add(), opportunity_assign(), opportunity_batch_update_expect_date(), opportunity_batch_update_stage(), opportunity_change_stage() (+73 more)
### Community 111 - "test_pl_public_transport_history.py"
Cohesion: 0.31
Nodes (9): _as_date(), _history_matches_date(), _normalize_main_plate(), _parse_history_date(), date, test_history_matches_date_or_logic(), test_history_status_label(), test_normalize_main_plate_trims() (+1 more)
Cohesion: 0.42
Nodes (11): apply_archive_inventory_for_plan(), apply_archive_inventory_for_plan_stops(), apply_brand_stock_change(), get_or_create_inventory(), Decimal, Session, qty_delta_for_plan(), 计划归档按产品+品牌写入库存台账与流水。 直销单 (direct) 首期不记账;入库增加、出库扣减(允许负库存,不做不足拦截)。 调整归档时先按 plan_i (+3 more)
### Community 112 - "merge_duplicate_crm_customers.py"
Cohesion: 0.26
@@ -670,16 +675,16 @@ 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)
Cohesion: 0.13
Nodes (25): generate_uuid(), get_current_time(), parse_datetime(), datetime, allocate_next_biz_no(), _format_biz_no(), _prefix_for(), datetime (+17 more)
### Community 115 - "site.py"
Cohesion: 0.33
Nodes (8): DutyAssignmentIn, DutyDaySaveBody, DutySlotSaveIn, 缩容:已有 1 人抢班时 capacity=1 且再指定 1 人应失败。, 历史指定用户无值班人员角色时,原样再保存不得因角色校验失败。, test_save_day_grandfathers_existing_assign_without_role(), test_save_day_rejects_new_assign_without_role(), test_save_day_rejects_shrink_below_grab_count()
Cohesion: 0.25
Nodes (13): get_storage(), download_file_bytes(), file_stream(), get_access_url(), get_download_url(), get_preview_url(), normalize_storage_path(), 报销附件存储适配 — 复用门户 app.core.storage,对外保持 bx 协议。 (+5 more)
### Community 116 - "Community 116"
Cohesion: 0.19
Nodes (26): batch_insert_quote_products(), calculate_subtotal(), _decimal_value(), delete_products_by_quote_id(), _ensure_quote_parent_scope(), _get_field(), get_quote_product(), insert_quote_product() (+18 more)
Cohesion: 0.17
Nodes (28): batch_insert_quote_products(), calculate_subtotal(), _decimal_value(), delete_products_by_quote_id(), _ensure_quote_parent_scope(), _get_field(), get_quote_product(), insert_quote_product() (+20 more)
### Community 117 - "pl_plan_list_attachments.py"
Cohesion: 0.26
@@ -694,40 +699,36 @@ 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 - "list_duty_staff_users"
Cohesion: 0.33
Nodes (6): list_duty_staff_users(), 按固定 id 查找「值班人员」角色;找不到再按角色名兜底。, 本租户启用且绑定「值班人员」角色的用户(公开页 users / 管理端 options)。, resolve_duty_staff_role_id(), test_list_duty_staff_users_empty_when_no_role(), test_resolve_duty_staff_role_id_by_fixed_id()
Cohesion: 0.22
Nodes (3): BaseStorage, 带下载文件名的访问 URL;默认实现为普通访问地址。, 浏览器内联预览 URL;默认实现为普通访问地址。
### Community 121 - "_build_user_info_payload"
Cohesion: 0.40
Nodes (5): _avatar_url_field(), _build_user_info_payload(), 与 web-admin 静态路由 meta.roles(admin/super_admin)对齐的单元素数组。, 与 web-admin `userInfo` 字段约定一致。, _web_role_list()
Cohesion: 0.11
Nodes (43): _avatar_url_field(), _build_user_info_payload(), change_current_user_password(), get_current_user_profile(), _jwt_user_payload(), logout(), public_quote_share(), Request (+35 more)
### Community 122 - "post.py"
Cohesion: 0.39
Nodes (10): create_post(), get_post(), list_posts(), post_code_exists(), Any, Session, _row_to_dict(), soft_delete_post() (+2 more)
### Community 123 - "customer_options"
Cohesion: 0.05
Nodes (67): CRM 报价单 API 路由 — 挂接到 crm.router, RecognizeCertResult, PageResult, ResponseModel, BaseModel, SoftDeleteModel, PagedQuery, PagedResponse (+59 more)
Cohesion: 0.10
Nodes (34): CRM 报价单 API 路由 — 挂接到 crm.router, 接口菜单权限守卫。super_admin 直接放行。, require_menu_code(), QuoteApproverSettingSaveBody, QuoteAcceptBody, QuoteApprovalApproveBody, QuoteApprovalListBody, QuoteApprovalRefreshNamesBody (+26 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.06
Nodes (72): get_plan_arrange_info(), 获取计划已安排运输后的司机链接与地磅出入库关联(供查看弹窗复制简述/二维码)。, _make_handlers(), PlInboundOrder, PlInboundOrderItem, PlInboundOrderItemBrandQty, PlOutboundOrder, PlOutboundOrderItem (+64 more)
### Community 126 - "oper_log.py"
Cohesion: 0.28
Nodes (8): list_products(), 分页查询产品列表 keyword 默认匹配:名称 / 编号 / 拼音首字母。 选择器场景可关闭编号匹配、开启规格型号匹配(避免短数字误命中产品, 产品/客户列表 keyword:名称/编号/拼音首字母 OR 匹配。, 选择器:名称/拼音/规格型号,不匹配产品编号。, test_list_customer_options_keyword_includes_name_and_pinyin(), test_list_customers_keyword_includes_name_and_pinyin(), test_list_products_keyword_includes_name_and_pinyin(), test_list_products_keyword_selector_mode_excludes_product_no_includes_model()
Cohesion: 0.11
Nodes (36): _make_handlers(), apply_dibang_prefill_to_order(), apply_io_order_stop_site_feedbacks(), build_io_order_site_url(), create_io_order_for_transport(), _dibang_qty_by_plan_product(), enrich_io_items_with_brand_feedback(), enrich_io_order_dict() (+28 more)
### Community 127 - "Any"
Cohesion: 0.07
Nodes (67): DeliverySlipPrintRead, PlanDeliveryRead, PlanLoadRead, PlanStopProductRead, is_internal_customer_name(), 运输计划:内置山峡/云栋客户判定(合同可免), _append_legacy_plan_product_rows(), _append_stop_product_rows() (+59 more)
Cohesion: 0.08
Nodes (61): DeliveryPrintCustomerOption, DeliverySlipPrintRead, PlanDeliveryRead, PlanLoadRead, PlanStopProductRead, _append_legacy_plan_product_rows(), _append_stop_product_rows(), build_plan_archive_export_rows() (+53 more)
### Community 128 - "api_crypto.py"
Cohesion: 0.50
Nodes (5): assert_user_is_duty_staff(), DutyBizError, _resolve_grab_user(), soft_delete_assignment(), test_assert_user_is_duty_staff_rejects_without_role()
Cohesion: 0.32
Nodes (8): format_time_label(), parse_hhmm(), test_format_time_label_cross_day(), test_format_time_label_empty(), test_format_time_label_same_day(), test_parse_hhmm(), test_parse_hhmm_invalid_raises(), time
### Community 129 - "BaseStorage"
Cohesion: 0.12
@@ -738,60 +739,60 @@ Cohesion: 0.36
Nodes (13): _build_tree(), _cascade_soft_delete(), create_menu(), get_menu(), list_menus(), list_menus_tree(), menu_name_exists(), Any (+5 more)
### Community 131 - "resolve_crm_product"
Cohesion: 0.49
Nodes (10): clue_statistics_level(), _apply_create_range(), _base_query(), get_clue_level_statistics(), get_clue_overview_statistics(), get_clue_owner_statistics(), get_clue_source_statistics(), get_clue_trend_statistics() (+2 more)
Cohesion: 0.29
Nodes (15): clue_statistics_level(), clue_statistics_overview(), clue_statistics_owner(), clue_statistics_source(), clue_statistics_trend(), _apply_create_range(), _base_query(), get_clue_level_statistics() (+7 more)
### Community 132 - ".to_list_kwargs"
Cohesion: 0.24
Nodes (11): extract_minio_object_key(), join_relative_urls(), normalize_oss_storage_url(), MinIO 附件 URL 规范化(数据迁移共用)。 背景 ---- CRM / 地磅 / 报销与 shanxia2.0 共用同一 MinIO(bucket 默, 业务表 OSS ID 串 → 相对 URL 串(用于客户证照、跟进附件等)。, 去掉预签名 query(``?X-Amz-...``)。, 将绝对/相对 URL 规范为 MinIO object key(不含 bucket)。, 迁移 CRM ``sys_oss`` 行:``url`` + ``file_name`` → 门户相对路径。 (+3 more)
### 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;默认实现为普通访问地址。
Cohesion: 0.16
Nodes (15): ApiRequestLogCRUD, Session, list_ethnics(), Any, Session, 民族码表 CRUD(全局 sys_ethnic), _row_to_dict(), 数据模型(与 docs/sql/shanxia2.0.sql 全库导出基线对齐的核心系统表) (+7 more)
### Community 135 - "context.py"
Cohesion: 0.48
Nodes (7): _opp_list_kwargs(), opportunity_export(), opportunity_kanban(), opportunity_list(), opportunity_mine_list(), OpportunityKanbanBody, OpportunityListBody
### Community 136 - "get_db_current_user_optional"
Cohesion: 0.10
Nodes (25): demo_xlsx_export(), Demo 列表导出:接收已筛选行与列定义,生成 xlsx。, operlog_export(), OperLogExportBody, 导出操作日志(当前筛选全量,或 ids 已选)。, export_transports(), 导出运输列表(当前筛选全量,或 ids 已选)。, export_applies() (+17 more)
Cohesion: 0.05
Nodes (57): export_tenants(), export_users(), 导出租户列表(当前筛选全量,或 ids 已选)。, 导出用户列表(当前筛选全量,或 ids 已选)。, export_inventory(), 导出出入库列表(当前筛选全量,或 ids 已选)。, export_plans(), 导出计划列表(当前筛选全量,或 ids 已选)。 (+49 more)
### Community 137 - "iter_user_menu_perm_codes"
Cohesion: 0.20
Nodes (15): get_web_auth_menu_codes(), 获取当前用户菜单权限标识(sys_menu.perms,经角色继承)。, get_user_menu_codes(), Session, 读取用户授权的菜单权限标识集合(与前端 meta.menuCode / perms 对齐)。, _expand_with_ancestor_menu_ids(), _granted_menu_ids_for_user(), iter_user_menu_perm_codes() (+7 more)
Cohesion: 0.40
Nodes (3): Any, 供 get_tenant_no 等门户工具使用。, 与门户 JWT / apply_data_scope 所需的 user_info 字段对齐。
### 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.25
Nodes (13): get_storage(), download_file_bytes(), file_stream(), get_access_url(), get_download_url(), get_preview_url(), normalize_storage_path(), 报销附件存储适配 — 复用门户 app.core.storage,对外保持 bx 协议。 (+5 more)
### Community 139 - "customer_options"
Cohesion: 0.50
Nodes (4): customer_options(), 客户下拉选项(租户内只读,不做 owner 数据权限), CustomerOptionsBody, 客户下拉选项请求体(租户内只读搜索,不做 owner 数据权限)
### Community 140 - "unsettled_plans_q_filter"
Cohesion: 0.50
Nodes (4): 简易搜索:计划编号 / 客户(供应商) / 车牌 / 承运商名称。, unsettled_plans_q_filter(), 未结算计划简易搜索:q 应覆盖计划编号/客户/车牌/承运商名称。, test_unsettled_plans_q_filter_includes_carrier_and_plate()
### Community 142 - "clear_pl_plan_instance_data.py"
Cohesion: 0.46
Nodes (7): _count(), _delete(), _engine_from_env(), main(), Engine, 清空运输计划(pl_plan)及关联实例数据,便于测试环境重新走流程。 用法(在 backend 目录、已配置 .env DATABASE_URL): p, _table_exists()
### Community 143 - "calc_age_from_chinese_id_card"
Cohesion: 0.14
Nodes (25): PlCert, CertRead, 运输计划 - 安排运输时车辆/人员/证件资源快照 Schema, SnapshotCertRead, SnapshotPersonnelRow, TransportResourceSnapshot, certs_to_read(), list_owner_certs() (+17 more)
### Community 144 - "response.py"
Cohesion: 0.14
Nodes (23): _attach_history_products(), _build_history_page(), _build_page(), _get_by_token(), _history_status_label(), _models(), _parse_history_date(), date (+15 more)
Cohesion: 0.04
Nodes (109): _apply_exclude_follow_status_filter(), _apply_follow_status_filter(), archive_plan(), archive_plan_draft(), cancel_plan(), cancel_plan_wait_notice(), ContractGapExportBody, count_plans_by_contract() (+101 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 149 - "list_product_options"
Cohesion: 0.31
Nodes (9): 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(), auto_generate_monthly_plans_job() (+1 more)
### Community 150 - "get_db_current_user_optional"
Cohesion: 0.14
Nodes (19): get_pool_record(), list_pool_records(), Any, Session, _row_to_dict(), total_pages(), CrmCustomerPool, 按 18 位身份证号重算 pl_personnel.age,仅更新算出值与库中不一致的记录。返回更新条数。 (+11 more)
### 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)
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 154 - "LocalStorage"
Cohesion: 0.11
@@ -805,13 +806,9 @@ Nodes (9): 微信消息通知服务 支持微信小程序模板消息推送
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.13
Nodes (33): _jwt_user_payload(), logout(), 公共接口(Web 登录、刷新 Token、登出;用户模型对齐 docs/sql/shanxia2.0.sql 基线), 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。无 Token 或已失效时仍返回成功(幂等)。, Web 端登录用 RSA 公钥(PKCS#1 v1.5,与 JSEncrypt 一致), Web 端登录:账号为 sys_user.user_no,密码为 sys_user.password(bcrypt)。, refresh_token(), web_login() (+25 more)
### Community 173 - "resolve_create_time_bounds"
Cohesion: 0.07
Nodes (65): ContractGapExportBody, PlanExportBody, _resolve_plan_flags(), _apply_plan_logistics_from_payload(), _apply_transport_arrange_fields(), arrange_transport(), _assert_vehicle_carrier_eligible(), _build_arrange_result() (+57 more)
Nodes (71): _build_driver_url(), get_plan_arrange_info(), 获取计划已安排运输后的司机链接与地磅出入库关联(供查看弹窗复制简述/二维码)。, _apply_plan_logistics_from_payload(), _apply_transport_arrange_fields(), arrange_transport(), _assert_vehicle_carrier_eligible(), _build_arrange_result() (+63 more)
### Community 179 - "test_pl_vehicle_personnel_photo_schema.py"
Cohesion: 0.27
@@ -844,22 +841,22 @@ Nodes (6): eq_unicode(), like_unicode(), MySQL 字符串比较/模糊匹配时
## Knowledge Gaps
- **30 isolated node(s):** `Config`, `Config`, `Config`, `Config`, `Config` (+25 more)
These have ≤1 connection - possible missing edges or undocumented components.
- **16 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
- **18 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `generate_uuid()` connect `Community 61` to `Community 0`, `_filter_export_rows_by_ids`, `Community 2`, `Community 4`, `Community 5`, `Community 6`, `inventory_id.py`, `Community 8`, `Community 11`, `Community 13`, `Community 15`, `calc_age_from_chinese_id_card`, `Community 17`, `Community 18`, `Community 19`, `list_product_options`, `get_db_current_user_optional`, `Community 23`, `Community 24`, `Community 25`, `pl_feedback_brand_qty.py`, `Community 21`, `Community 28`, `Community 29`, `Community 31`, `Community 32`, `Community 33`, `Community 34`, `get_client_ip`, `Community 37`, `Community 36`, `Community 40`, `Community 43`, `resolve_create_time_bounds`, `Community 46`, `Community 48`, `Community 50`, `Community 51`, `Community 62`, `Community 65`, `Community 67`, `Community 72`, `Community 74`, `Community 78`, `PlCarrier`, `customer_follow.py`, `Community 83`, `allocate_next_biz_no`, `Community 87`, `CrmProduct`, `pl_ocr_service.py`, `WechatMessageService`, `unsettled_plans_q_filter`, `Community 92`, `contact.py`, `LocalStorage`, `redis_client.py`, `apply_crm_create_by_scope`, `site.py`, `apply_pl_scope`, `pool_rule.py`, `dict_type.py`, `dept.py`, `Community 116`, `Community 118`, `post.py`, `LocalStorage`, `ethnic.py`?**
_High betweenness centrality (0.137) - this node is a cross-community bridge._
- **Why does `Settings` connect `price_letter_detail` to `Community 35`, `Community 67`, `Community 73`, `Community 42`, `Community 59`, `statistics.py`, `Community 44`, `Community 55`, `Community 57`, `Community 26`, `Community 27`, `Community 30`?**
_High betweenness centrality (0.126) - this node is a cross-community bridge._
- **Why does `BaseModel` connect `customer_options` to `Community 0`, `Community 1`, `Community 2`, `Community 5`, `Community 6`, `Community 7`, `get_db_current_user_optional`, `Community 11`, `Community 12`, `Community 14`, `Community 15`, `Community 16`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 21`, `response.py`, `calc_age_from_chinese_id_card`, `Community 29`, `Community 33`, `Community 34`, `Community 37`, `Community 39`, `Community 41`, `Community 45`, `resolve_create_time_bounds`, `Community 47`, `Community 51`, `Community 52`, `Community 54`, `Community 56`, `Community 58`, `Community 61`, `Community 63`, `Community 65`, `Community 66`, `Community 69`, `Community 71`, `Community 74`, `apply_crm_create_by_scope`, `Community 78`, `PlCarrier`, `customer_follow.py`, `unsettled_plans_q_filter`, `test_pl_public_link_archived.py`, `tenant.py`, `pl_internal_customer.py`, `site.py`, `Community 119`, `ethnic.py`, `Any`?**
_High betweenness centrality (0.109) - this node is a cross-community bridge._
- **Why does `generate_uuid()` connect `dept.py` to `Community 0`, `_filter_export_rows_by_ids`, `Community 2`, `Community 4`, `Community 5`, `Community 6`, `inventory_id.py`, `Community 8`, `Community 11`, `Community 13`, `Community 15`, `response.py`, `Community 17`, `Community 19`, `list_product_options`, `Community 21`, `Community 23`, `Community 24`, `Community 25`, `Community 28`, `Community 31`, `Community 32`, `Community 33`, `Community 34`, `Community 36`, `Community 37`, `Community 39`, `Community 40`, `Community 43`, `resolve_create_time_bounds`, `Community 46`, `Community 48`, `Community 51`, `Community 61`, `Community 62`, `Community 63`, `Community 64`, `Community 65`, `Community 67`, `Community 68`, `Community 70`, `Community 71`, `Community 74`, `PlCarrier`, `resolve_crm_product`, `Community 83`, `allocate_next_biz_no`, `CrmProduct`, `pl_ocr_service.py`, `WechatMessageService`, `unsettled_plans_q_filter`, `contact.py`, `LocalStorage`, `BaseStorage`, `apply_crm_create_by_scope`, `test_pl_public_transport_history.py`, `dict_type.py`, `Community 116`, `Community 118`, `_build_user_info_payload`, `post.py`, `LocalStorage`, `ethnic.py`?**
_High betweenness centrality (0.140) - this node is a cross-community bridge._
- **Why does `Settings` connect `price_letter_detail` to `Community 35`, `Community 67`, `Community 73`, `Community 42`, `Community 59`, `statistics.py`, `Community 44`, `Community 56`, `Community 57`, `Community 26`, `Community 27`, `Community 30`?**
_High betweenness centrality (0.133) - this node is a cross-community bridge._
- **Why does `BaseModel` connect `Community 45` to `Community 0`, `Community 1`, `Community 2`, `resolve_crm_product`, `context.py`, `get_db_current_user_optional`, `Community 10`, `customer_options`, `Community 12`, `Community 11`, `Community 14`, `Community 15`, `response.py`, `Community 17`, `Community 18`, `Community 19`, `Community 20`, `Community 21`, `Community 16`, `Community 29`, `Community 34`, `Community 37`, `Community 39`, `Community 41`, `resolve_create_time_bounds`, `Community 46`, `Community 49`, `Community 51`, `Community 52`, `Community 56`, `Community 58`, `Community 61`, `Community 63`, `Community 65`, `Community 66`, `Community 69`, `Community 72`, `Community 74`, `Community 78`, `customer_follow.py`, `test_pl_public_link_archived.py`, `contact.py`, `pl_internal_customer.py`, `pool_customer_assign`, `apply_pl_scope`, `pool_rule.py`, `Community 119`, `customer_options`, `Any`?**
_High betweenness centrality (0.103) - 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?**
_654 weakly-connected nodes found - possible documentation gaps or missing edges._
_656 weakly-connected nodes found - possible documentation gaps or missing edges._
- **Should `Community 0` be split into smaller, more focused modules?**
_Cohesion score 0.05154639175257732 - nodes in this community are weakly interconnected._
_Cohesion score 0.08461538461538462 - 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._
_Cohesion score 0.0708245243128964 - nodes in this community are weakly interconnected._
@@ -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": "L49"}, {"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": "L57"}, {"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": "L64"}, {"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": "L74"}, {"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": "L80"}, {"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": "L86"}, {"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": "L90"}, {"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": "L94"}, {"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": "L105"}, {"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": "L155"}, {"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": "L173"}, {"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": "L219"}, {"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": "L240"}, {"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_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": "L28"}, {"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": "L37"}, {"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_brand_rows_from_item", "label": "_brand_rows_from_item()", "file_type": "code", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L79"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_persist_stop_brand_qtys", "label": "_persist_stop_brand_qtys()", "file_type": "code", "source_file": "app/services/pl_plan_archive_stop_service.py", "source_location": "L95"}, {"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": "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": "L129"}, {"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": "L234"}, {"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": "L313"}, {"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": "L329"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_stop_service_rationale_241", "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": "L241"}], "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": "Line 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_normalize_stop_dibang_fields", "label": "normalize_stop_dibang_fields()", "file_type": "code", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L26"}, {"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": "L46"}, {"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": "L57"}, {"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": "L64"}, {"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": "L70"}, {"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"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_rationale_16", "label": "\u5730\u78c5\u9ed8\u8ba4\u52fe\u9009\u4ee5\u672c\u6bb5\u5ba2\u6237\u662f\u5426\u4e3a\u5185\u90e8\u5ba2\u6237\uff08\u5c71\u5ce1/\u4e91\u680b\uff09\u4e3a\u51c6\u3002", "file_type": "rationale", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L16"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_rules_rationale_32", "label": "\u5f52\u4e00\u5316\u6bb5\u6b21\u5730\u78c5\u52fe\u9009\u4e0e\u65b9\u5411\uff1a\u52fe\u9009\u4f46\u65b9\u5411\u7f3a\u5931/none \u65f6\u6309\u672c\u6bb5\u5ba2\u6237\u8865\u9ed8\u8ba4\u65b9\u5411\u3002", "file_type": "rationale", "source_file": "app/services/pl_plan_stop_rules.py", "source_location": "L32"}], "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}, 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": "L89"}, {"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": "L106"}, {"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": "L124"}, {"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": "L143"}, {"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": "L162"}, {"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": "L182"}, {"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": "L193"}, {"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": "L209"}, {"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": "L260"}, {"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": "L267"}, {"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": "L284"}, {"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": "L298"}, {"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": "L350"}, {"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": "L355"}, {"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": "L360"}, {"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": "L366"}, {"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": "L401"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_deliveryprintcustomeroption", "label": "DeliLine 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": "L89"}, {"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": "L106"}, {"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": "L124"}, {"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": "L143"}, {"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": "L162"}, {"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": "L182"}, {"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": "L193"}, {"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": "L209"}, {"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": "L260"}, {"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": "L267"}, {"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": "L284"}, {"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": "L298"}, {"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": "L350"}, {"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": "L355"}, {"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": "L360"}, {"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": "L366"}, {"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": "L401"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_deliveryprintcustomeroption", "label": "DeliLine 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": "L37"}, {"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": "L47"}, {"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": "L54"}, {"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": "L63"}, {"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": "L76"}, {"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": "L88"}, {"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": "L100"}, {"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": "L111"}, {"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": "L118"}, {"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": "L126"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_resolve_stop_business_type", "label": "_resolve_stop_business_type()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L135"}, {"id": "plplanload", "label": "PlPlanLoad", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_dibang_bridge_service.py"}, {"id": "plplandelivery", "label": "PlPlanDelivery", "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_stop_product_quantity", "label": "_stop_product_quantity()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L148"}, {"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": "L154"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilongLine 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_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": "L46"}, {"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_attach_stop_brand_qtys", "label": "_attach_stop_brand_qtys()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L54"}, {"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_resolve_stop_list_product_name", "label": "_resolve_stop_list_product_name()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L66"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_stop_service_apply_stop_list_product_name", "label": "_apply_stop_list_product_name()", "file_type": "code", "source_file": "app/services/pl_plan_stop_service.py", "source_location": "L83"}, {"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": "L98"}, {"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": "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": "L117"}, {"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": "L136"}, {"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": "L159"}, {"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": "L174"}, {"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": "L183"}, {"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": "L224"}, {"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/apLine 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_tests_test_pl_dibang_plan_quantity_py", "label": "test_pl_dibang_plan_quantity.py", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_stopstub", "label": "_StopStub", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L17"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_stopstub_init", "label": ".__init__()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L18"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_test_resolve_stop_dibang_partner_load_uses_first_delivery", "label": "test_resolve_stop_dibang_partner_load_uses_first_delivery()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L22"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_test_resolve_stop_dibang_partner_delivery_uses_load", "label": "test_resolve_stop_dibang_partner_delivery_uses_load()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L28"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_test_resolve_stop_dibang_partner_load_fallback_without_delivery", "label": "test_resolve_stop_dibang_partner_load_fallback_without_delivery()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L34"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_test_apply_plan_quantity_delta_accumulates", "label": "test_apply_plan_quantity_delta_accumulates()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L39"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_test_apply_plan_quantity_delta_never_below_zero", "label": "test_apply_plan_quantity_delta_never_below_zero()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_test_resolve_link_contributed_qty_prefers_link_field", "label": "test_resolve_link_contributed_qty_prefers_link_field()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L52"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_test_resolve_link_contributed_qty_falls_back_to_inventory", "label": "test_resolve_link_contributed_qty_falls_back_to_inventory()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L58"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_test_resolve_link_contributed_qty_zero_when_missing", "label": "test_resolve_link_contributed_qty_zero_when_missing()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L64"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_test_revoke_subtracts_plan_quantity_on_cancel", "label": "test_revoke_subtracts_plan_quantity_on_cancel()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L71"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_test_revoke_blocks_when_weighing_exists", "label": "test_revoke_blocks_when_weighing_exists()", "file_type": "code", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L125"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_py", "target": "decimal", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_py", "target": "unittest_mock", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L3", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_py", "target": "pytest", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_dibang_plan_quantity_py", "target": "app_models_db_models", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "tests/test_pl_dibang_plan_quantity.py", "source_location":Line 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": "L485"}, {"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": "L507"}, {"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": "L535"}, {"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": "L566"}, {"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": "L595"}, {"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": "L631"}, {"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": "L694"}, {"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": "L715"}, {"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": "L738"}, {"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_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": "L37"}, {"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": "L47"}, {"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": "L54"}, {"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": "L63"}, {"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": "L76"}, {"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": "L88"}, {"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": "L100"}, {"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": "L111"}, {"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": "L118"}, {"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": "L126"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_dibang_bridge_service_resolve_stop_business_type", "label": "_resolve_stop_business_type()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L135"}, {"id": "plplanload", "label": "PlPlanLoad", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_dibang_bridge_service.py"}, {"id": "plplandelivery", "label": "PlPlanDelivery", "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_resolve_stop_dibang_partner", "label": "resolve_stop_dibang_partner()", "file_type": "code", "source_file": "app/services/pl_dibang_bridge_service.py", "source_location": "L148"}, {"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": "L161"}, {"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", "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": "L12"}, {"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": "L18"}, {"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": "L23"}, {"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": "L28"}, {"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": "L33"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_delivery_defaults_use_delivery_customer", "label": "test_delivery_defaults_use_delivery_customer()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L38"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_tests_test_pl_plan_stop_rules_test_normalize_stop_dibang_fields_repairs_none_direction", "label": "test_normalize_stop_dibang_fields_repairs_none_direction()", "file_type": "code", "source_file": "tests/test_pl_plan_stop_rules.py", "source_location": "L45"}, {"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": "L56"}, {"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": "L61"}, {"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": "L68"}, {"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": "L75"}, {"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": "L85"}, {"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": "L95"}, {"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": "L105"}, {"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": "L117"}, {"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": "L124"}, {"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\Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_py", "label": "pl_plan_archive_export.py", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_resolve_archive_list_io_column", "label": "resolve_archive_list_io_column()", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L45"}, {"id": "stopkind", "label": "StopKind", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_export.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_format_date_value", "label": "_format_date_value()", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L53"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_export.py"}, {"id": "datetime", "label": "datetime", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_export.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_format_plate_display", "label": "_format_plate_display()", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L59"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_get_stop_archive_actual_qty", "label": "_get_stop_archive_actual_qty()", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L69"}, {"id": "planstopproductread", "label": "PlanStopProductRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_export.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_archive_export.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_get_stop_archive_unit_price", "label": "_get_stop_archive_unit_price()", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L73"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_get_stop_archive_amount", "label": "_get_stop_archive_amount()", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L77"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_stop_kind_label", "label": "_stop_kind_label()", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L88"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_stop_time", "label": "_stop_time()", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L94"}, {"id": "planloadread", "label": "PlanLoadRead", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_export.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_archive_export.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_load_legacy_products_by_plan", "label": "_load_legacy_products_by_plan()", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L100"}, {"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_export.py"}, {"id": "plplanproduct", "label": "PlPlanProduct", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_plan_archive_export.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_archive_export_plan_common_export_fields", "label": "_plan_common_export_fields()", "file_type": "code", "source_file": "app/services/pl_plan_archive_export.py", "source_location": "L121"}, {"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_export.py"}, {"id": "pltransport", "label": "PlTransport", "fLine 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": "L151"}, {"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": "L167"}, {"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": "L171"}, {"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": "L203"}, {"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": "L207"}, {"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": "L232"}, {"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": "L240"}, {"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": "L272"}, {"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": "L277"}, {"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": "L286"}, {"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": "L306"}, {"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": "L320"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_parse_status_csv", "label": "_parse_status_csv()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L329"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_apply_follow_status_filter", "label": "_apply_follow_status_filter()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L335"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_apply_exclude_follow_status_filter", "label": "_apply_exclude_follow_status_filter()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L344"}, {"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": "L354"}, {"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_load_transports_by_id", "label": "_load_transports_by_id()", "file_type": "code", "source_file": "app/api/pl/plan.py", "Line truncated
+1 -1
View File
@@ -1 +1 @@
{"/Users/zlwu/work/00code/shanxia2.0/backend/start-prod.sh":{"size":7357,"mtime_ns":1782639355476060453,"hash":"ca89869446be74a2bf2367b3b28f448580220859a39a84ad9613ac5fe35a8433"},"/Users/zlwu/work/00code/shanxia2.0/backend/start.sh":{"size":9548,"mtime_ns":1780114661446983244,"hash":"4d632863e8a0cd81194b491d83a0218a4157435ae812dec76a6f6197b4d48e57"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/__init__.py":{"size":21,"mtime_ns":1780113982281973984,"hash":"60a04ff08fd97084e83ea809fd13feda6d2848be20ebf309e31fc1dad7523230"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/main.py":{"size":6280,"mtime_ns":1782790852770448643,"hash":"8f9da799977bee7134d87a26ff8434ac5ef8eabb0b7368dd537eee49ad7fd00b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/tasks/__init__.py":{"size":2207,"mtime_ns":1783208067881286091,"hash":"313e6da0e91d743ce891dd283458c79b50b24c4d909dc96ca7b3fd9d2bfa5013"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/auth.py":{"size":7457,"mtime_ns":1782790841500516545,"hash":"34bac56e1c2cb6215f4b5fa2dc32d77d4b4abca51428819eebf4afd269cc51cf"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_crypto.py":{"size":1870,"mtime_ns":1780108930724444498,"hash":"c04b748aea86890a5971f749523c7b17dbad1ddd6f9f7f07a5679d159c984e33"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/login_crypto.py":{"size":3858,"mtime_ns":1780108930725155710,"hash":"b82d51afabf2293a9cb1fb2e5f994c383948e7f47ea95fe674686b4f3f3342b1"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/config.py":{"size":6958,"mtime_ns":1784032424448146538,"hash":"c2fb44aedb880733de28afa7f92d2c1c681eb600f821bbeba2bcda3933e5bc37"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/wechat_pay.py":{"size":23585,"mtime_ns":1780108930725768130,"hash":"3d52265ce65d21e7103f94afa1e8547aee0823b5ea6d65c50317436ac81fb4fc"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_request_log_middleware.py":{"size":11971,"mtime_ns":1782701669198208175,"hash":"0b84c32828939e6102bb3647691fa8f04b1f68e0e0e9f28127374cc44e19a11c"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/database.py":{"size":1510,"mtime_ns":1782790847265601586,"hash":"8bc9c8ae62e2be2c6920036582ba448dfcd1711c41cebb62274ff6bc6ee14b0b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/security.py":{"size":728,"mtime_ns":1780108930725470004,"hash":"df0f01115064f7b8de1c81dbe9a6db39360c236610b68c33b3234a51d7f0025b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/request_payload.py":{"size":2842,"mtime_ns":1780108930725350836,"hash":"e9937151530ab1417ef297aef59111977725cf90be2a8fa76c00a0618789aba0"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/__init__.py":{"size":61,"mtime_ns":1780108930724312414,"hash":"3dd1842ee59b0c804176b03b4b8a323bd4a252b7feb1bbc32db64f3a8928570e"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/response.py":{"size":1824,"mtime_ns":1780108930725412462,"hash":"f1739352d65ea8287d76e282a59553aa8d63c97e35764c64ac378aa5bd9c347e"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/menu_guard.py":{"size":1611,"mtime_ns":1780108930725223002,"hash":"3e26077288c3620a4780038b891a326206b45bffe00aca545bdae30172487235"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/db_collation.py":{"size":548,"mtime_ns":1780108930725025043,"hash":"0c680e25a18244ca839a7de6ed1f4313b33bc8da118d89c463aee1b6af00c6f9"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/context.py":{"size":421,"mtime_ns":1780108930724824458,"hash":"83a10aee67162374993c10a30bf8bb8bd9c4b35cf48f42c832415ccebd91660f"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/utils.py":{"size":1498,"mtime_ns":1780108930725607296,"hash":"09323693661c1d4560458b86a954128ccff82bbaf6522da0b44f24da99ddf9ea"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/storage.py":{"size":14141,"mtime_ns":1782855136810943216,"hash":"3ae2c413c10898a8adb3d6773870bafbfbc18c739c10e0e8b4f765b4b5ca6c08"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/order_status_compat.py":{"size":2828,"mtime_ns":1780108930725284669,"hash":"5349e5a0745ee6734c4a995337779307adefc46f453906171988a77de2081540"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/exceptions.py":{"size":4946,"mtime_ns":1780108930725084335,"hash":"79c997d964bca1a4f12f2b92fb1f181fdb9e2b3cf72eae39f4cc164d23794fd7"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/data_scope.py":{"size":8043,"mtime_ns":1782648925694296304,"hash":"626dff86937e5cacec634ecbc61cd53d3763d760223a1d4ec7cd11f64e59a220"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/admin_request_json.py":{"size":2669,"mtime_ns":1780108930724378914,"hash":"4f68b3cf84291e7bddad6ecf4bb4d29ca5e1ec246a9f7f9c4cf5909d0ec1174a"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_crypto_middleware.py":{"size":10876,"mtime_ns":1782790001926627098,"hash":"b39f128b6612589ea6ac5babd30752e9585b3af07b82bb1ad53c9e3c0d90816f"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/wechat_message.py":{"size":11194,"mtime_ns":1780108930725684255,"hash":"5086070deb14d99d1a69e419b2299ec4Line truncated
{"/Users/zlwu/work/00code/shanxia2.0/backend/start-prod.sh":{"size":7357,"mtime_ns":1782639355476060453,"hash":"ca89869446be74a2bf2367b3b28f448580220859a39a84ad9613ac5fe35a8433"},"/Users/zlwu/work/00code/shanxia2.0/backend/start.sh":{"size":9548,"mtime_ns":1780114661446983244,"hash":"4d632863e8a0cd81194b491d83a0218a4157435ae812dec76a6f6197b4d48e57"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/__init__.py":{"size":21,"mtime_ns":1780113982281973984,"hash":"60a04ff08fd97084e83ea809fd13feda6d2848be20ebf309e31fc1dad7523230"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/main.py":{"size":6280,"mtime_ns":1782790852770448643,"hash":"8f9da799977bee7134d87a26ff8434ac5ef8eabb0b7368dd537eee49ad7fd00b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/tasks/__init__.py":{"size":2207,"mtime_ns":1783208067881286091,"hash":"313e6da0e91d743ce891dd283458c79b50b24c4d909dc96ca7b3fd9d2bfa5013"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/auth.py":{"size":7457,"mtime_ns":1782790841500516545,"hash":"34bac56e1c2cb6215f4b5fa2dc32d77d4b4abca51428819eebf4afd269cc51cf"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_crypto.py":{"size":1870,"mtime_ns":1780108930724444498,"hash":"c04b748aea86890a5971f749523c7b17dbad1ddd6f9f7f07a5679d159c984e33"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/login_crypto.py":{"size":3858,"mtime_ns":1780108930725155710,"hash":"b82d51afabf2293a9cb1fb2e5f994c383948e7f47ea95fe674686b4f3f3342b1"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/config.py":{"size":6958,"mtime_ns":1784032424448146538,"hash":"c2fb44aedb880733de28afa7f92d2c1c681eb600f821bbeba2bcda3933e5bc37"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/wechat_pay.py":{"size":23585,"mtime_ns":1780108930725768130,"hash":"3d52265ce65d21e7103f94afa1e8547aee0823b5ea6d65c50317436ac81fb4fc"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_request_log_middleware.py":{"size":11971,"mtime_ns":1782701669198208175,"hash":"0b84c32828939e6102bb3647691fa8f04b1f68e0e0e9f28127374cc44e19a11c"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/database.py":{"size":1510,"mtime_ns":1782790847265601586,"hash":"8bc9c8ae62e2be2c6920036582ba448dfcd1711c41cebb62274ff6bc6ee14b0b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/security.py":{"size":728,"mtime_ns":1780108930725470004,"hash":"df0f01115064f7b8de1c81dbe9a6db39360c236610b68c33b3234a51d7f0025b"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/request_payload.py":{"size":2842,"mtime_ns":1780108930725350836,"hash":"e9937151530ab1417ef297aef59111977725cf90be2a8fa76c00a0618789aba0"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/__init__.py":{"size":61,"mtime_ns":1780108930724312414,"hash":"3dd1842ee59b0c804176b03b4b8a323bd4a252b7feb1bbc32db64f3a8928570e"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/response.py":{"size":1824,"mtime_ns":1780108930725412462,"hash":"f1739352d65ea8287d76e282a59553aa8d63c97e35764c64ac378aa5bd9c347e"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/menu_guard.py":{"size":1611,"mtime_ns":1780108930725223002,"hash":"3e26077288c3620a4780038b891a326206b45bffe00aca545bdae30172487235"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/db_collation.py":{"size":548,"mtime_ns":1780108930725025043,"hash":"0c680e25a18244ca839a7de6ed1f4313b33bc8da118d89c463aee1b6af00c6f9"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/context.py":{"size":421,"mtime_ns":1780108930724824458,"hash":"83a10aee67162374993c10a30bf8bb8bd9c4b35cf48f42c832415ccebd91660f"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/utils.py":{"size":1498,"mtime_ns":1780108930725607296,"hash":"09323693661c1d4560458b86a954128ccff82bbaf6522da0b44f24da99ddf9ea"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/storage.py":{"size":14141,"mtime_ns":1782855136810943216,"hash":"3ae2c413c10898a8adb3d6773870bafbfbc18c739c10e0e8b4f765b4b5ca6c08"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/order_status_compat.py":{"size":2828,"mtime_ns":1780108930725284669,"hash":"5349e5a0745ee6734c4a995337779307adefc46f453906171988a77de2081540"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/exceptions.py":{"size":4946,"mtime_ns":1780108930725084335,"hash":"79c997d964bca1a4f12f2b92fb1f181fdb9e2b3cf72eae39f4cc164d23794fd7"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/data_scope.py":{"size":8043,"mtime_ns":1782648925694296304,"hash":"626dff86937e5cacec634ecbc61cd53d3763d760223a1d4ec7cd11f64e59a220"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/admin_request_json.py":{"size":2669,"mtime_ns":1780108930724378914,"hash":"4f68b3cf84291e7bddad6ecf4bb4d29ca5e1ec246a9f7f9c4cf5909d0ec1174a"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/api_crypto_middleware.py":{"size":10876,"mtime_ns":1782790001926627098,"hash":"b39f128b6612589ea6ac5babd30752e9585b3af07b82bb1ad53c9e3c0d90816f"},"/Users/zlwu/work/00code/shanxia2.0/backend/app/core/wechat_message.py":{"size":11194,"mtime_ns":1780108930725684255,"hash":"5086070deb14d99d1a69e419b2299ec4Line truncated
File diff suppressed because it is too large. Load diff
@@ -9,10 +9,33 @@ from app.models.pl_models import PlTransportDbLink
from app.services.pl_dibang_bridge_service import (
_apply_plan_quantity_delta,
_resolve_link_contributed_qty,
resolve_stop_dibang_partner,
revoke_regeneratable_dibang_for_transport,
)
class _StopStub:
def __init__(self, customer_name: str):
self.customer_name = customer_name
def test_resolve_stop_dibang_partner_load_uses_first_delivery():
load = _StopStub("安庆市山峡化工有限公司")
deliveries = [_StopStub("外部客户A"), _StopStub("外部客户B")]
assert resolve_stop_dibang_partner("load", load, deliveries) == "外部客户A"
def test_resolve_stop_dibang_partner_delivery_uses_load():
load = _StopStub("外部客户A")
deliveries = [_StopStub("安庆市山峡化工有限公司")]
assert resolve_stop_dibang_partner("delivery", load, deliveries) == "外部客户A"
def test_resolve_stop_dibang_partner_load_fallback_without_delivery():
load = _StopStub("安庆市山峡化工有限公司")
assert resolve_stop_dibang_partner("load", load, []) == "安庆市山峡化工有限公司"
def test_apply_plan_quantity_delta_accumulates():
db_plan = DbPurchasePlan(planned_quantity=30.0)
_apply_plan_quantity_delta(db_plan, 31, user_id="u1")
+18 -3
View File
@@ -2,7 +2,11 @@
from decimal import Decimal
from app.services.pl_internal_customer import INTERNAL_CUSTOMER_NAMES
from app.services.pl_plan_stop_rules import resolve_stop_dibang_defaults, warn_qty_imbalance
from app.services.pl_plan_stop_rules import (
normalize_stop_dibang_fields,
resolve_stop_dibang_defaults,
warn_qty_imbalance,
)
def test_internal_shanxia_load_outbound():
@@ -31,13 +35,24 @@ def test_external_customer_no_dibang():
assert resolve_stop_dibang_defaults("外部客户有限公司", "delivery") == (False, "none")
def test_delivery_defaults_follow_load_customer_not_delivery_customer():
"""送货段客户为外部时,仍以装货内部客户决定是否默认勾选地磅。"""
def test_delivery_defaults_use_delivery_customer():
"""送货段地磅默认以本段客户是否为内部客户为准。"""
internal = "安庆市山峡化工有限公司"
assert resolve_stop_dibang_defaults(internal, "delivery") == (True, "inbound")
assert resolve_stop_dibang_defaults("外部客户有限公司", "delivery") == (False, "none")
def test_normalize_stop_dibang_fields_repairs_none_direction():
gen, direction = normalize_stop_dibang_fields(
"安庆市山峡化工有限公司",
"delivery",
1,
"none",
)
assert gen == 1
assert direction == "inbound"
def test_external_empty_name_no_dibang():
assert resolve_stop_dibang_defaults(None, "load") == (False, "none")
assert resolve_stop_dibang_defaults(" ", "delivery") == (False, "none")
+1 -1
View File
@@ -1 +1 @@
{"/Users/wuzilong/work/00code/shanxia2.0/.agents/skills/brainstorming/scripts/start-server.sh":{"size":4606,"mtime_ns":1780108930000000000,"hash":"7c3c6c5cce454f755159758334ffb434c970a29960bbff6669efe0cb22d1f2fb"},"/Users/wuzilong/work/00code/shanxia2.0/.agents/skills/brainstorming/scripts/stop-server.sh":{"size":1314,"mtime_ns":1780108930000000000,"hash":"9581ff879388aaa10463aea1fc1e9f9c00d69f2106f055ac976f97513ab84aba"},"/Users/wuzilong/work/00code/shanxia2.0/.agents/skills/systematic-debugging/find-polluter.sh":{"size":1528,"mtime_ns":1780108930000000000,"hash":"8340aac47e1279874e46d7ecb4954b5faae531a883abf05b118951687d8ca044"},"/Users/wuzilong/work/00code/shanxia2.0/.cursor/mcp.json":{"size":468,"mtime_ns":1780120483000000000,"hash":"ce4b438767a095c6a830e4612c221303ea16ab46af23f438bfb033eace904c36"},"/Users/wuzilong/work/00code/shanxia2.0/.opencode/opencode.json":{"size":105,"mtime_ns":1780120095000000000,"hash":"936122822138b12f363fb9b7a8567edaa1f834c835137a4c72d81c17116ce11e"},"/Users/wuzilong/work/00code/shanxia2.0/.opencode/package.json":{"size":65,"mtime_ns":1780109751000000000,"hash":"cf97d417f1ebce0ba81ad4629a5345e13cc95cb799c6eb2632caead5364880de"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_17f66cf13ffeo6JpSbBDM7Jx4t.json":{"size":214,"mtime_ns":1780274139000000000,"hash":"26182a523926188400188b8cc668585f8e81586416fa2399fd3585b0c07ff86c"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_1818ffbf9ffezXCeRFVV3Jj01O.json":{"size":263,"mtime_ns":1780238536000000000,"hash":"bf2e860eaa6fa5051d4cb0f70a53cf419b558c57759154e559712efef636dcb5"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_181f43997ffeO8mkoWfZl8v2Ri.json":{"size":214,"mtime_ns":1780236423000000000,"hash":"8252a79ead22a73fe0e229ef4eb6e1aac159547cdc04607d4102c75b077501a2"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_1823f3f66ffesCD5qohVVcWtbf.json":{"size":214,"mtime_ns":1780230242000000000,"hash":"27ba5fb0606f8ddda44c4f01ce5fbce77d7429f890317c6a1a6f9456058b1f70"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_183d2d323ffeBMoLOLwwPmAXym.json":{"size":214,"mtime_ns":1780210339000000000,"hash":"26814a22a2f0ee80b65a7306c4f52becca5edb09358cc12b588efa896546f571"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_183f72fc4ffeCZI7jMs3P9gB5n.json":{"size":214,"mtime_ns":1780201410000000000,"hash":"cd6c278503c190ec5dae59675957e9a963cbd94ce09cf974b838a0e717b42817"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_184f894aeffej3cvErXgdYFhY8.json":{"size":263,"mtime_ns":1780201410000000000,"hash":"d3bb6c88a4c332c09d2684c3a34f10e311620956a8777a894cb1492ab15cce86"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_186a13679ffenULQIK102x2NfS.json":{"size":214,"mtime_ns":1780201410000000000,"hash":"eb2fe454abea5ef36854bc2858ba6e9ac5e8f4d18e0121901f007816e0e40ebe"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_187ac729affeBH1jDFb5X7rWz0.json":{"size":214,"mtime_ns":1780201410000000000,"hash":"b571d2be1c871201f1d572c536b57c89a277b0b3eb3f3a3e4125db5008b37a3f"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_18880f06fffeJSijqM7oWZ6JYI.json":{"size":214,"mtime_ns":1780201410000000000,"hash":"efb86e46a8d0c2af314450407bfacd3f422ec8f68025291a440760cffe4ca092"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_1892f6be2ffe1K80MWGl0oc2Fo.json":{"size":214,"mtime_ns":1780114611000000000,"hash":"9b109fac4a24678ea27b4afe2840bcd06c339b490508d6aa531e051fe3f034b7"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/__init__.py":{"size":21,"mtime_ns":1780113982000000000,"hash":"5d7c80dd077475acb7eb12227dc0e7cf38bbb5fd9e84c4eab9eb2be8c5406357"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/__init__.py":{"size":665,"mtime_ns":1780804649000000000,"hash":"349c40e55e8aae86d0913a17da2f9d338d842243e5fdf807bad52382bc2876d9"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/admin.py":{"size":73613,"mtime_ns":1787309685874849310,"hash":"b612a3b1a2e2ac925c2182e49e0b3f12b650ee5f9c31463ca14115091b305bb4"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/bx/__init__.py":{"size":827,"mtime_ns":1784980394000000000,"hash":"7605bb52b5361261c5e04d52bec9a1e704b49dd4ffe5c561da079831e8d8db9e"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/bx/advance.py":{"size":20025,"mtime_ns":1787307802337954064,"hash":"ade4859c374344c15623aa3f4a6cbd8c596692880a03a47d24460160c9e6527b"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/bx/attachment.py":{"size":5758,"mtime_ns":1782790898000000000,"hash":"f2d20fc5b2a98748835ae1710666f11eae1aa323d80a4678189bb2d032559b4b"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/bx/expense_item.py":{"size":5851,"mtime_ns":1787308158807308399,"hash":"755f1c4c10237240bf3c9cb06e33d4ebe5a3e8ac43c4728f5cf1df5fecb0035e"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/apLine truncated
{"/Users/wuzilong/work/00code/shanxia2.0/.agents/skills/brainstorming/scripts/start-server.sh":{"size":4606,"mtime_ns":1780108930000000000,"hash":"7c3c6c5cce454f755159758334ffb434c970a29960bbff6669efe0cb22d1f2fb"},"/Users/wuzilong/work/00code/shanxia2.0/.agents/skills/brainstorming/scripts/stop-server.sh":{"size":1314,"mtime_ns":1780108930000000000,"hash":"9581ff879388aaa10463aea1fc1e9f9c00d69f2106f055ac976f97513ab84aba"},"/Users/wuzilong/work/00code/shanxia2.0/.agents/skills/systematic-debugging/find-polluter.sh":{"size":1528,"mtime_ns":1780108930000000000,"hash":"8340aac47e1279874e46d7ecb4954b5faae531a883abf05b118951687d8ca044"},"/Users/wuzilong/work/00code/shanxia2.0/.cursor/mcp.json":{"size":468,"mtime_ns":1780120483000000000,"hash":"ce4b438767a095c6a830e4612c221303ea16ab46af23f438bfb033eace904c36"},"/Users/wuzilong/work/00code/shanxia2.0/.opencode/opencode.json":{"size":105,"mtime_ns":1780120095000000000,"hash":"936122822138b12f363fb9b7a8567edaa1f834c835137a4c72d81c17116ce11e"},"/Users/wuzilong/work/00code/shanxia2.0/.opencode/package.json":{"size":65,"mtime_ns":1780109751000000000,"hash":"cf97d417f1ebce0ba81ad4629a5345e13cc95cb799c6eb2632caead5364880de"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_17f66cf13ffeo6JpSbBDM7Jx4t.json":{"size":214,"mtime_ns":1780274139000000000,"hash":"26182a523926188400188b8cc668585f8e81586416fa2399fd3585b0c07ff86c"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_1818ffbf9ffezXCeRFVV3Jj01O.json":{"size":263,"mtime_ns":1780238536000000000,"hash":"bf2e860eaa6fa5051d4cb0f70a53cf419b558c57759154e559712efef636dcb5"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_181f43997ffeO8mkoWfZl8v2Ri.json":{"size":214,"mtime_ns":1780236423000000000,"hash":"8252a79ead22a73fe0e229ef4eb6e1aac159547cdc04607d4102c75b077501a2"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_1823f3f66ffesCD5qohVVcWtbf.json":{"size":214,"mtime_ns":1780230242000000000,"hash":"27ba5fb0606f8ddda44c4f01ce5fbce77d7429f890317c6a1a6f9456058b1f70"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_183d2d323ffeBMoLOLwwPmAXym.json":{"size":214,"mtime_ns":1780210339000000000,"hash":"26814a22a2f0ee80b65a7306c4f52becca5edb09358cc12b588efa896546f571"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_183f72fc4ffeCZI7jMs3P9gB5n.json":{"size":214,"mtime_ns":1780201410000000000,"hash":"cd6c278503c190ec5dae59675957e9a963cbd94ce09cf974b838a0e717b42817"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_184f894aeffej3cvErXgdYFhY8.json":{"size":263,"mtime_ns":1780201410000000000,"hash":"d3bb6c88a4c332c09d2684c3a34f10e311620956a8777a894cb1492ab15cce86"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_186a13679ffenULQIK102x2NfS.json":{"size":214,"mtime_ns":1780201410000000000,"hash":"eb2fe454abea5ef36854bc2858ba6e9ac5e8f4d18e0121901f007816e0e40ebe"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_187ac729affeBH1jDFb5X7rWz0.json":{"size":214,"mtime_ns":1780201410000000000,"hash":"b571d2be1c871201f1d572c536b57c89a277b0b3eb3f3a3e4125db5008b37a3f"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_18880f06fffeJSijqM7oWZ6JYI.json":{"size":214,"mtime_ns":1780201410000000000,"hash":"efb86e46a8d0c2af314450407bfacd3f422ec8f68025291a440760cffe4ca092"},"/Users/wuzilong/work/00code/shanxia2.0/.sisyphus/run-continuation/ses_1892f6be2ffe1K80MWGl0oc2Fo.json":{"size":214,"mtime_ns":1780114611000000000,"hash":"9b109fac4a24678ea27b4afe2840bcd06c339b490508d6aa531e051fe3f034b7"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/__init__.py":{"size":21,"mtime_ns":1780113982000000000,"hash":"5d7c80dd077475acb7eb12227dc0e7cf38bbb5fd9e84c4eab9eb2be8c5406357"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/__init__.py":{"size":665,"mtime_ns":1780804649000000000,"hash":"349c40e55e8aae86d0913a17da2f9d338d842243e5fdf807bad52382bc2876d9"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/admin.py":{"size":73613,"mtime_ns":1787309685874849310,"hash":"b612a3b1a2e2ac925c2182e49e0b3f12b650ee5f9c31463ca14115091b305bb4"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/bx/__init__.py":{"size":827,"mtime_ns":1784980394000000000,"hash":"7605bb52b5361261c5e04d52bec9a1e704b49dd4ffe5c561da079831e8d8db9e"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/bx/advance.py":{"size":20025,"mtime_ns":1787307802337954064,"hash":"ade4859c374344c15623aa3f4a6cbd8c596692880a03a47d24460160c9e6527b"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/bx/attachment.py":{"size":5758,"mtime_ns":1782790898000000000,"hash":"f2d20fc5b2a98748835ae1710666f11eae1aa323d80a4678189bb2d032559b4b"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/bx/expense_item.py":{"size":5851,"mtime_ns":1787308158807308399,"hash":"755f1c4c10237240bf3c9cb06e33d4ebe5a3e8ac43c4728f5cf1df5fecb0035e"},"/Users/wuzilong/work/00code/shanxia2.0/backend/app/apLine truncated
+55 -55
View File
@@ -1,4 +1,9 @@
{
"README.md": {
"mtime": 1780108931.0,
"ast_hash": "147541fa66bbe620e76eb05503d06e82",
"semantic_hash": ""
},
".vscode/extensions.json": {
"mtime": 1780108931.0,
"ast_hash": "0f065e87dfdf64ea3db5cf7cc99a6460",
@@ -1075,8 +1080,8 @@
"semantic_hash": ""
},
"src/api/pl/index.ts": {
"mtime": 1787821766.0107408,
"ast_hash": "9a3eac86d6c77915bc5537762dbb2df0",
"mtime": 1787889309.531482,
"ast_hash": "7e4a835468c5ba9ead9970fe6e41dab2",
"semantic_hash": ""
},
"src/api/pl/public-io-order.ts": {
@@ -1230,13 +1235,13 @@
"semantic_hash": ""
},
"src/components/business/db/DbInventoryRelatedViewDialog.vue": {
"mtime": 1782858535.0,
"ast_hash": "7961b8fec079052a8124f836ccd32818",
"mtime": 1787980319.9895875,
"ast_hash": "7d11397649860341d5808ad94e61ad3e",
"semantic_hash": ""
},
"src/components/business/db/DbPlanRelatedViewDialog.vue": {
"mtime": 1782858535.0,
"ast_hash": "46d4928e42b6fb5061b67736bcba51f3",
"mtime": 1787980129.7085667,
"ast_hash": "8aa6710835a7c4d979050e1ab345ce1d",
"semantic_hash": ""
},
"src/components/business/db/DbPoundSlipQrcodeDialog.vue": {
@@ -1245,8 +1250,8 @@
"semantic_hash": ""
},
"src/components/business/db/DbRelatedViewDialog.vue": {
"mtime": 1782858535.0,
"ast_hash": "d2cc813e6aaa11248161aefa72681c7f",
"mtime": 1787980741.7746189,
"ast_hash": "d9322cdd006b2f3ebb8e5c385332d4d2",
"semantic_hash": ""
},
"src/components/business/db/DualBarChart.vue": {
@@ -1255,8 +1260,8 @@
"semantic_hash": ""
},
"src/components/business/db/db-related-view.ts": {
"mtime": 1782858535.0,
"ast_hash": "5b2ff22f5b194a536714bdabd9b59b48",
"mtime": 1787980740.9994252,
"ast_hash": "79958779d8faed07b6f4aff45d4b9acb",
"semantic_hash": ""
},
"src/components/business/dialog-form-body/index.vue": {
@@ -1385,13 +1390,13 @@
"semantic_hash": ""
},
"src/components/business/pl-plan-archive-dialog/index.vue": {
"mtime": 1787818673.364886,
"ast_hash": "387bc6759d5f93266d103656a3ef906d",
"mtime": 1787892297.1751869,
"ast_hash": "09be31a4cb71bab11c492905567a4a94",
"semantic_hash": ""
},
"src/components/business/pl-plan-archive-segment-block/index.vue": {
"mtime": 1787815979.1616354,
"ast_hash": "8cb493267ee8692ba6c5adc934585690",
"mtime": 1787836780.120207,
"ast_hash": "12d201e4d1f611f27d75b51599c37e06",
"semantic_hash": ""
},
"src/components/business/pl-plan-cert-upload-dialog/index.vue": {
@@ -1415,13 +1420,13 @@
"semantic_hash": ""
},
"src/components/business/pl-plan-delivery-section/index.vue": {
"mtime": 1787809921.6938794,
"ast_hash": "41a28f60c6988702352038df34227200",
"mtime": 1787889960.4078283,
"ast_hash": "ed504c908a93fa16c798977cc186167d",
"semantic_hash": ""
},
"src/components/business/pl-plan-document-attachment-cell/index.vue": {
"mtime": 1787810456.1410487,
"ast_hash": "501f4d82ebde3b53f29e0897c61af0f8",
"mtime": 1787837088.7114453,
"ast_hash": "c9370eb680acd9517b05673d56bccd18",
"semantic_hash": ""
},
"src/components/business/pl-plan-driver-feedback-dialog/index.vue": {
@@ -1435,8 +1440,8 @@
"semantic_hash": ""
},
"src/components/business/pl-plan-form-dialog/index.vue": {
"mtime": 1787809951.0239673,
"ast_hash": "8aee7b46b7a4d54c8eb19d191137f510",
"mtime": 1787967817.0115614,
"ast_hash": "76c31969b7796f2f1bf798a706dcdf2a",
"semantic_hash": ""
},
"src/components/business/pl-plan-hazard-cert-view-table/index.vue": {
@@ -1455,8 +1460,8 @@
"semantic_hash": ""
},
"src/components/business/pl-plan-load-section/index.vue": {
"mtime": 1787809955.3455853,
"ast_hash": "ee900d2abde712924882b2243150f448",
"mtime": 1787889952.8581958,
"ast_hash": "d716c3b3b7ef2ef41a0df3b38fded1c6",
"semantic_hash": ""
},
"src/components/business/pl-plan-pound-qrcode-pick-dialog/index.vue": {
@@ -1470,8 +1475,8 @@
"semantic_hash": ""
},
"src/components/business/pl-plan-stop-feedback-panel/index.vue": {
"mtime": 1787809841.4209328,
"ast_hash": "7922090660ce8966ca238be8de0e564a",
"mtime": 1787836977.7958317,
"ast_hash": "81119d26e339acf7ff218b390322b742",
"semantic_hash": ""
},
"src/components/business/pl-plan-stop-product-table/index.vue": {
@@ -1495,13 +1500,13 @@
"semantic_hash": ""
},
"src/components/business/pl-plan-view-dialog/index.vue": {
"mtime": 1787794173.2035997,
"ast_hash": "883073e5757ab28976c38c4f40617323",
"mtime": 1787892297.1737883,
"ast_hash": "8ff9974895fcbd4144b758fcb3ae964c",
"semantic_hash": ""
},
"src/components/business/pl-plan-view-tabs/index.vue": {
"mtime": 1787816826.2776456,
"ast_hash": "013d02a96a650185acbd894ad6ed1a9c",
"mtime": 1787894039.5364575,
"ast_hash": "65a9eb3aba228e4f4e815b0e3b0162d2",
"semantic_hash": ""
},
"src/components/business/pl-product-name-hazard-cell/index.vue": {
@@ -2130,8 +2135,8 @@
"semantic_hash": ""
},
"src/components/core/layouts/art-work-tab/index.vue": {
"mtime": 1787219541.0344598,
"ast_hash": "8b676a7d606e1ccc2e72f5f1839845da",
"mtime": 1787965971.3762712,
"ast_hash": "8110f84d688eb9655908b87ebfa90919",
"semantic_hash": ""
},
"src/components/core/list-toolbar-date-shortcuts/index.vue": {
@@ -3040,8 +3045,8 @@
"semantic_hash": ""
},
"src/utils/pl-display.ts": {
"mtime": 1787817580.333424,
"ast_hash": "b816118a0b4d9a2d1dd4b3e66534c49c",
"mtime": 1787967550.884185,
"ast_hash": "022200f5252a4a89740ce8c098aaf0e6",
"semantic_hash": ""
},
"src/utils/pl-document-menu-badge.ts": {
@@ -3090,13 +3095,13 @@
"semantic_hash": ""
},
"src/utils/pl-plan-list-display-rows.ts": {
"mtime": 1787818938.7692337,
"ast_hash": "6d57b7faa730bb95779dfa17e250cdc9",
"mtime": 1787823760.3002028,
"ast_hash": "55b6a6c43d73b885b8681408b110aaf6",
"semantic_hash": ""
},
"src/utils/pl-plan-stop-form.ts": {
"mtime": 1787818636.5049572,
"ast_hash": "64f87817ddb45c988d037d0a3cc15dfe",
"mtime": 1787893417.103079,
"ast_hash": "4f841688d2bcf8b1d1c2463d87be8909",
"semantic_hash": ""
},
"src/utils/pl-pound-qrcode-display.ts": {
@@ -3805,18 +3810,18 @@
"semantic_hash": ""
},
"src/views/db/inventory/index.vue": {
"mtime": 1787665793.0339897,
"ast_hash": "ff3ca04d35a0c43fb05b7575ae9b4945",
"mtime": 1787980322.1426182,
"ast_hash": "a49c4ba49dccd96482b5690fafd4a542",
"semantic_hash": ""
},
"src/views/db/plans/index.vue": {
"mtime": 1787365367.3705466,
"ast_hash": "c495e6d846844f428aef78f4c0bc87c1",
"mtime": 1787980130.5963817,
"ast_hash": "c4a743e2406338ec9bebde10b925c921",
"semantic_hash": ""
},
"src/views/db/weighing/index.vue": {
"mtime": 1787665841.046509,
"ast_hash": "bbdd977f934f7c2c58c925635163717d",
"mtime": 1787980742.2870338,
"ast_hash": "89adb012b02cf4d9bf62b25d697ef9ee",
"semantic_hash": ""
},
"src/views/demo/category/index.vue": {
@@ -3965,18 +3970,18 @@
"semantic_hash": ""
},
"src/views/pl/plan-archive/index.vue": {
"mtime": 1787820390.2885768,
"ast_hash": "d088b9a479ad9d1752da60d80b871aa5",
"mtime": 1787889418.3376336,
"ast_hash": "0600745f3bcd66a53771b9409ebddd51",
"semantic_hash": ""
},
"src/views/pl/plan-cert/index.vue": {
"mtime": 1787820504.4602737,
"ast_hash": "ed70b65430c03e4aa4f7a3040366bcad",
"mtime": 1787966570.4910998,
"ast_hash": "a8d34d846b4d8c132794cde7e5890ac0",
"semantic_hash": ""
},
"src/views/pl/plan-contract/index.vue": {
"mtime": 1787821766.0106368,
"ast_hash": "cc34fd79396264f05500b64a23949f83",
"mtime": 1787823894.239796,
"ast_hash": "ad7e91a097aa530ab397b44af6f60ec2",
"semantic_hash": ""
},
"src/views/pl/plan/arrange.vue": {
@@ -3995,8 +4000,8 @@
"semantic_hash": ""
},
"src/views/pl/plan/index.vue": {
"mtime": 1787820508.2959898,
"ast_hash": "2aebf2a1235cd5a7c84a125ec113000b",
"mtime": 1787977775.8164089,
"ast_hash": "22e59f9161f80483e36eb4cea3350fb4",
"semantic_hash": ""
},
"src/views/pl/self-vehicle/index.vue": {
@@ -4249,11 +4254,6 @@
"ast_hash": "22a7e4c17949d2f4d0e811063e663e48",
"semantic_hash": ""
},
"README.md": {
"mtime": 1780108931.0,
"ast_hash": "147541fa66bbe620e76eb05503d06e82",
"semantic_hash": ""
},
"README.zh-CN.md": {
"mtime": 1780108931.0,
"ast_hash": "5869c08ab97ccf09c3075f21e1d9c0d9",
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-08-28
@@ -0,0 +1,42 @@
## Context
运输计划归档弹窗(`pl-plan-archive-dialog`)提交走 `POST /transport/plan/{id}/archive`,会写装卸货数量、运费、回传附件,触发库存,并将 `archive_status` 设为 `archived`。未归档计划无法中途保存部分填写内容。
## Goals / Non-Goals
**Goals:**
- 未正式归档时可暂存部分归档表单数据,下次打开自动回填
- 暂存不改库存、不完成计划
- 列表可区分未归档 / 已暂存 / 已归档
**Non-Goals:**
- localStorage 草稿、多人编辑锁
- 已归档「调整」模式的暂存
- 数据库新表或 DDL(`archive_status` 已为 VARCHAR(20))
## Decisions
1. **状态值 `draft`**:扩展 `archive_status` 为 `unarchived | draft | archived`,暂存时写入 `draft`;正式归档仍写 `archived`。备选「仅写字段不改状态」不利于列表识别,故不采用。
2. **独立草稿接口**:`POST .../archive-draft`,body 复用 `PlanArchiveBody`。与正式归档分离,避免误触发库存。
3. **同字段持久化**:草稿写入现有 `inbound_qty` / `outbound_qty` / 品牌 / 运费 / 附件字段;打开弹窗沿用现有加载逻辑即可回填。允许空数量(不强制 `_require_qty`)。
4. **运费暂存放宽**:`hasFreight=1` 但运输量未填齐时允许保存部分运费字段,跳过「运输量必须大于0」硬校验;正式归档仍严格校验。
5. **UI**:仅 `archiveStatus !== 'archived'` 显示「暂存」(Document 图标 + 中性描边);暂存成功后刷新列表状态并关闭弹窗。
## Risks / Trade-offs
- [Risk] 草稿部分数量被其他报表/导出误当成正式归档数 → Mitigation:导出与库存仅在 `archived` 时视为完成;列表明确「已暂存」
- [Risk] 运费草稿写入运输单后影响结算草稿 → Mitigation:沿用 `sync_draft_settlement_freight_for_transport`(仅草稿结算),正式结算仍受锁定校验约束
- [Risk] 产品行不完整提交 → Mitigation:草稿允许子集更新已提交行;缺失行保留库内原值
## Migration Plan
- 无 DDL;已有 `unarchived` 数据不变
- 回滚:前端隐藏暂存按钮并下线 draft 接口即可;库中 `draft` 可视为未归档处理
## Open Questions
- 无(方案 A 已确认)
@@ -0,0 +1,26 @@
## Why
运输计划归档弹窗目前只能一次性「确认归档」;现场数据往往分批到位,用户需要先填写部分内容、下次再补全后正式归档。缺少服务端暂存会导致重复录入与误操作风险。
## What Changes
- 归档弹窗在未正式归档(`unarchived` / `draft`)时增加「暂存」按钮;已归档「调整」模式不提供暂存
- 新增归档草稿接口:保存已填的装卸货数量/品牌/运费/回传附件,放宽必填校验,**不**触发库存,**不**将计划标为已归档
- `archive_status` 扩展第三值 `draft`(已暂存);列表与筛选同步展示
- 正式归档接口行为保持不变:`draft` 与 `unarchived` 均可正式归档;归档后状态为 `archived` 并走库存与完成态逻辑
## Capabilities
### New Capabilities
- `pl-plan-archive-draft`: 运输计划归档暂存(草稿状态、草稿 API、弹窗交互与列表展示)
### Modified Capabilities
- (无基线 `openspec/specs/` 归档能力需 delta;本变更以新 capability 为准)
## Impact
- 后端:`POST /transport/plan/{id}/archive-draft`;`PlPlan.archive_status` 注释与枚举语义;归档相关 service 增加「允许空数量」写入路径
- 前端:`pl-plan-archive-dialog` 底栏与提交逻辑;`plan-archive` 列表筛选/Tag;`pl-display` 状态文案;`planApi` 客户端
- 数据库:无新表;`archive_status` 列已是 `VARCHAR(20)`,可存 `draft`,无需 DDL
@@ -0,0 +1,49 @@
## ADDED Requirements
### Requirement: 运输计划归档支持暂存草稿
系统 SHALL 允许用户在运输计划尚未正式归档时,将归档弹窗中已填写的部分数据保存为草稿,以便下次打开继续填写并最终正式归档。
#### Scenario: 未归档计划可暂存
- **WHEN** 用户打开归档状态为 `unarchived` 或 `draft` 的计划的归档弹窗并点击「暂存」
- **THEN** 系统 SHALL 持久化已提交的装卸货数量、品牌、运费与回传附件(允许字段为空或部分填写),并将 `archive_status` 设为 `draft`
- **THEN** 系统 SHALL NOT 变更库存账
- **THEN** 系统 SHALL NOT 将 `archive_status` 设为 `archived`,SHALL NOT 将跟进状态标为已完成
- **THEN** 归档弹窗 SHALL 关闭
#### Scenario: 已归档调整模式不提供暂存
- **WHEN** 计划 `archive_status` 为 `archived`(调整归档内容)
- **THEN** 归档弹窗 SHALL NOT 展示「暂存」按钮
#### Scenario: 暂存后再次打开可回填
- **WHEN** 用户对已暂存(`draft`)计划再次打开归档弹窗
- **THEN** 系统 SHALL 回填上次暂存的装卸货、运费与附件相关字段
#### Scenario: 草稿可正式归档
- **WHEN** 用户在 `draft` 状态点击「确认归档」且通过正式归档校验
- **THEN** 系统 SHALL 按既有正式归档逻辑执行(含库存),并将 `archive_status` 设为 `archived`
### Requirement: 归档草稿接口
系统 SHALL 提供独立的归档草稿保存 API,请求体与正式归档表单结构兼容。
#### Scenario: 调用草稿接口
- **WHEN** 客户端对未作废且未正式归档的计划调用 `POST /transport/plan/{id}/archive-draft` 并提交 `PlanArchiveBody`(可部分字段)
- **THEN** 系统 SHALL 保存可解析的字段并返回最新计划
- **THEN** 若计划已作废或已归档,系统 SHALL 拒绝请求
### Requirement: 列表展示已暂存状态
运输计划归档列表 SHALL 将 `draft` 展示为「已暂存」,并支持按该状态筛选。
#### Scenario: 状态标签与筛选
- **WHEN** 列表中计划的 `archiveStatus` 为 `draft`
- **THEN** 归档状态列 SHALL 显示「已暂存」语义 Tag(warning)
- **WHEN** 用户在筛选中选择「已暂存」
- **THEN** 列表 SHALL 仅返回 `archive_status=draft` 的计划
@@ -0,0 +1,23 @@
## 1. Backend draft archive
- [x] 1.1 在 `pl_plan_archive_stop_service` 增加允许空数量的草稿写入(或 `strict=False` 参数)
- [x] 1.2 运费/品牌/回传附件支持草稿保存(放宽运输量必填)
- [x] 1.3 新增 `POST /{id}/archive-draft`:校验未作废且未 archived,写字段并设 `archive_status=draft`,不调库存
- [x] 1.4 更新模型注释与展示相关文案(archive_status 含 draft)
## 2. Frontend API 与展示
- [x] 2.1 `planApi` 增加 `archiveDraft`
- [x] 2.2 `pl-display` 增加「已暂存」标签与 Tag 类型
- [x] 2.3 归档列表筛选增加「已暂存」选项
## 3. 归档弹窗
- [x] 3.1 未归档/已暂存时底栏增加「暂存」按钮(中性描边 + Document 图标)
- [x] 3.2 实现暂存提交:弱校验、调草稿接口、成功提示、刷新列表并关闭弹窗
- [x] 3.3 确认归档逻辑不变;`draft` 与 `unarchived` 均可正式归档
## 4. 验证
- [x] 4.1 手动或脚本确认草稿不改库存、正式归档仍生效(py_compile + 代码路径复核:draft 接口无 inventory 调用)
- [x] 4.2 更新 graphify(若改了代码)
+11 -18
View File
@@ -256,13 +256,13 @@
"254": "db.ts",
"255": "Community 255",
"256": "Ha",
"257": "handleExportPdf",
"258": "index.vue",
"257": "handleDisburse",
"258": "Ha",
"259": "Community 259",
"260": "Community 260",
"261": "Community 261",
"262": "index.js",
"263": "StorageConfig",
"263": "fetchUploadAttachment",
"264": "assignmentMatchesFilter",
"265": "Community 265",
"266": "crypto.ts",
@@ -270,34 +270,28 @@
"268": "index.vue",
"269": "Community 269",
"270": "Community 270",
"271": "index.vue",
"272": "syncStatsColumnWidths",
"273": "product.ts",
"274": "zh_CN.js",
"271": "SettingDrawer.vue",
"272": "index.vue",
"273": "detail.vue",
"274": "loadUserOptions",
"275": "index.js",
"276": "index.vue",
"277": "index.vue",
"278": "fetchData",
"279": "error-handle.ts",
"276": "tabs.ts",
"277": "getPlMaintenanceApplyStatusLabel",
"278": "v2.4.2.1 - 2025-06-16",
"280": "Community 280",
"281": "index.js",
"282": "handleSearch",
"283": "Community 283",
"284": "Community 284",
"285": "Community 285",
"286": "Community 286",
"287": "pad",
"287": "index.vue",
"288": "form.vue",
"289": "handleEdit",
"290": "v2.4.2.3 - 2025-06-18",
"291": "index.vue",
"292": "Community 292",
"293": "index.vue",
"294": "index.vue",
"295": "Community 295",
"296": "Community 296",
"297": "getPlMaintenanceApplyStatusLabel",
"300": "zh_CN.js",
"302": "Community 302",
"303": "Community 303",
"304": "Community 304",
@@ -492,7 +486,6 @@
"733": "Community 733",
"734": "修复",
"766": "新增",
"770": "移除",
"772": "重构",
"779": "重构",
"785": "⚠️ 重要提示",
+1 -1
View File
@@ -1 +1 @@
.
/Users/wuzilong/work/00code/shanxia2.0/web-admin
@@ -0,0 +1,828 @@
{
"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": "Ha",
"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": "theme.min.js",
"27": "Community 27",
"28": "useCommon",
"29": "Community 29",
"30": "loader.ts",
"31": "RenewDialog.vue",
"32": "index.vue",
"33": "Community 33",
"34": "main.ts",
"35": "Community 35",
"36": "VoidDialog.vue",
"37": "pl-batch-print.ts",
"38": "view-fields.ts",
"39": "Community 39",
"40": "Community 40",
"41": "colors.ts",
"42": "Community 42",
"43": "Community 43",
"44": "Community 44",
"45": "Community 45",
"46": "Community 46",
"47": "fetchCustomerDetail",
"48": "Community 48",
"49": "Community 49",
"50": "Community 50",
"51": "price-letter-template.ts",
"52": "Community 52",
"53": "Community 53",
"54": "Community 54",
"55": "Community 55",
"56": "Community 56",
"57": "Community 57",
"58": "Community 58",
"59": "fetchData",
"60": "index.vue",
"61": "Community 61",
"62": "highlight.ts",
"63": "price-letter.ts",
"64": "Community 64",
"65": "detail.vue",
"66": "Community 66",
"67": "index.vue",
"68": "Community 68",
"69": "Community 69",
"70": "Community 70",
"71": "Community 71",
"72": "Community 72",
"73": "Community 73",
"74": "Community 74",
"75": "openEdit",
"76": "handleSearch",
"77": "loadUserOptions",
"78": "customerPool.ts",
"79": "Community 79",
"80": "product.ts",
"81": "Community 81",
"82": "Community 82",
"83": "useDictStore",
"84": "Community 84",
"85": "index.vue",
"86": "Community 86",
"87": "canDeleteByCreator",
"88": "index.vue",
"89": "detail.vue",
"90": "theme.min.js",
"91": "Community 91",
"92": "Community 92",
"93": "ArtUserMenu.vue",
"94": "formatYmd",
"95": "Community 95",
"96": "Community 96",
"97": "stringifyBody",
"98": "index.vue",
"99": "stringifyBody",
"100": "v2.4.2.1 - 2025-06-16",
"101": "price-letter.ts",
"102": "price-letter-template.ts",
"103": "SettingDrawer.vue",
"104": "contractType.ts",
"105": "index.vue",
"106": "Community 106",
"107": "Community 107",
"108": "Community 108",
"109": "Community 109",
"110": "Community 110",
"111": "format.ts",
"112": "inventory.ts",
"113": "Community 113",
"114": "index.vue",
"115": "useDictStore",
"116": "Community 116",
"117": "Community 117",
"118": "zh_CN.js",
"119": "Community 119",
"120": "Community 120",
"121": "chart.ts",
"122": "handleDisburse",
"123": "detail.vue",
"124": "index.vue",
"125": "Community 125",
"126": "Community 126",
"127": "selectContractRow",
"128": "Community 128",
"129": "Community 129",
"130": "system.ts",
"131": "index.vue",
"132": "Community 132",
"133": "Community 133",
"134": "index.vue",
"135": "detail.vue",
"136": "Community 136",
"137": "Community 137",
"138": "FollowDialog.vue",
"139": "RenewDialog.vue",
"140": "Community 140",
"141": "Community 141",
"142": "Community 142",
"143": "index.js",
"144": "Community 144",
"145": "api",
"146": "price-letter-template.ts",
"147": "index.vue",
"148": "Community 148",
"149": "fetchCustomerDetail",
"150": "Community 150",
"151": "Community 151",
"152": "SettingDrawer.vue",
"153": "index.vue",
"154": "index.vue",
"155": "error.ts",
"156": "v2.4.2.1 - 2025-06-16",
"157": "form.vue",
"158": "removeProductsNotAllowedByHazard",
"159": "detail.vue",
"160": "index.vue",
"161": "Community 161",
"162": "Community 162",
"163": "system.ts",
"164": "Community 164",
"165": "handleDisburse",
"166": "Community 166",
"167": "Community 167",
"168": "crypto.ts",
"169": "Community 169",
"170": "Community 170",
"171": "index.vue",
"172": "index.js",
"173": "index.vue",
"174": "Community 174",
"175": "handleEdit",
"176": "fetchData",
"177": "fetchCustomerDetail",
"178": "Community 178",
"179": "Community 179",
"180": "index.vue",
"181": "Community 181",
"182": "Community 182",
"183": "Ha",
"184": "highlight.ts",
"185": "handleConfirmApproval",
"186": "StorageKeyManager",
"187": "Community 187",
"188": "Community 188",
"189": "Community 189",
"190": "error-handle.ts",
"191": "formatYmd",
"192": "prepareLineAliasAndBrandForSubmit",
"193": "crm-product-display.ts",
"194": "index.ts",
"195": "Community 195",
"196": "Community 196",
"197": "v2.4.2.1 - 2025-06-16",
"198": "fetchRoleOptions",
"199": "colors.ts",
"200": "index.js",
"201": "Ha",
"202": "Community 202",
"203": "customerPool.ts",
"204": "DbCrmCustomerSelect.vue",
"205": "loadDefaultCustomerOptions",
"206": "onDrop",
"207": "SettingDrawer.vue",
"208": "index.vue",
"209": "Community 209",
"210": "Community 210",
"211": "loadUserOptions",
"212": "index.js",
"213": "Community 213",
"214": "Community 214",
"215": "index.vue",
"216": "VoidDialog.vue",
"217": "index.js",
"218": "index.js",
"219": "applyBrandSelectChange",
"220": "detail.vue",
"221": "index.js",
"222": "index.vue",
"223": "Community 223",
"224": "Community 224",
"225": "theme.min.js",
"226": "api",
"227": "Community 227",
"228": "Community 228",
"229": "useClientColumnFilters.ts",
"230": "SettingActions.vue",
"231": "index.vue",
"232": "handleConfirmApproval",
"233": "Community 233",
"234": "Community 234",
"235": "resolveDictValue",
"236": "index.vue",
"237": "colors.ts",
"238": "price-letter-template.ts",
"239": "Community 239",
"240": "detail.vue",
"241": "Ha",
"242": "Community 242",
"243": "Community 243",
"244": "v2.4.2.1 - 2025-06-16",
"245": "index.js",
"246": "fetchData",
"247": "Community 247",
"248": "Community 248",
"249": "SettingItem.vue",
"250": "loadDefaultCustomerOptions",
"251": "handleDisburse",
"252": "index.js",
"253": "Community 253",
"254": "db.ts",
"255": "Community 255",
"256": "Ha",
"257": "highlight.ts",
"258": "error-handle.ts",
"259": "Community 259",
"260": "Community 260",
"261": "Community 261",
"262": "index.js",
"263": "StorageConfig",
"264": "assignmentMatchesFilter",
"265": "Community 265",
"266": "crypto.ts",
"267": "index.vue",
"268": "index.vue",
"269": "Community 269",
"270": "Community 270",
"271": "SettingDrawer.vue",
"274": "index.vue",
"275": "index.js",
"277": "index.vue",
"279": "getPlMaintenanceApplyStatusLabel",
"280": "Community 280",
"281": "index.js",
"283": "Community 283",
"284": "Community 284",
"285": "Community 285",
"286": "Community 286",
"287": "v2.4.2.1 - 2025-06-16",
"289": "handleEdit",
"290": "v2.4.2.3 - 2025-06-18",
"292": "Community 292",
"293": "index.vue",
"295": "Community 295",
"296": "Community 296",
"302": "Community 302",
"303": "Community 303",
"304": "Community 304",
"305": "isIoPlanFrozen",
"306": "handleArrange",
"307": "Community 307",
"308": "Community 308",
"309": "Community 309",
"310": "Community 310",
"315": "Community 315",
"316": "Community 316",
"317": "Community 317",
"318": "Community 318",
"319": "Community 319",
"320": "Community 320",
"321": "Community 321",
"322": "Community 322",
"323": "Community 323",
"324": "Community 324",
"325": "Community 325",
"326": "Community 326",
"327": "Community 327",
"328": "Community 328",
"329": "Community 329",
"330": "Community 330",
"331": "Community 331",
"332": "Community 332",
"333": "Community 333",
"334": "Community 334",
"335": "Community 335",
"336": "Community 336",
"337": "Community 337",
"338": "Community 338",
"339": "Community 339",
"340": "Community 340",
"341": "Community 341",
"342": "error-handle.ts",
"344": "ArtException.vue",
"346": "Community 346",
"347": "Community 347",
"349": "Community 349",
"350": "Community 350",
"355": "Community 355",
"362": "Community 362",
"367": "Community 367",
"372": "detail.vue",
"377": "Community 377",
"379": "Community 379",
"380": "Community 380",
"381": "Community 381",
"391": "Community 391",
"392": "Community 392",
"393": "Community 393",
"406": "Community 406",
"408": "Community 408",
"410": "Community 410",
"412": "Community 412",
"416": "Community 416",
"417": "Community 417",
"422": "Community 422",
"423": "Community 423",
"424": "Community 424",
"425": "Community 425",
"426": "Community 426",
"427": "Community 427",
"435": "index.vue",
"443": "index.vue",
"444": "index.vue",
"445": "Community 445",
"459": "Community 459",
"460": "Community 460",
"471": "Community 471",
"472": "Community 472",
"474": "Community 474",
"475": "Community 475",
"476": "Community 476",
"487": "Community 487",
"488": "Community 488",
"496": "Community 496",
"499": "Community 499",
"521": "Community 521",
"522": "Community 522",
"528": "Community 528",
"534": "Community 534",
"535": "Community 535",
"536": "Community 536",
"537": "Community 537",
"539": "Community 539",
"540": "Community 540",
"550": "Community 550",
"551": "Community 551",
"552": "Community 552",
"553": "Community 553",
"555": "Community 555",
"556": "Community 556",
"557": "Community 557",
"559": "Community 559",
"560": "Community 560",
"561": "Community 561",
"562": "Community 562",
"571": "Community 571",
"572": "Community 572",
"573": "Community 573",
"574": "Community 574",
"575": "Community 575",
"576": "Community 576",
"580": "Community 580",
"581": "Community 581",
"582": "Community 582",
"583": "Community 583",
"584": "Community 584",
"585": "Community 585",
"586": "Community 586",
"597": "Community 597",
"598": "Community 598",
"599": "Community 599",
"600": "Community 600",
"601": "Community 601",
"602": "Community 602",
"603": "Community 603",
"604": "Community 604",
"607": "Community 607",
"608": "Community 608",
"609": "Community 609",
"610": "Community 610",
"611": "Community 611",
"612": "Community 612",
"613": "Community 613",
"614": "Community 614",
"615": "Community 615",
"630": "Community 630",
"631": "Community 631",
"632": "Community 632",
"633": "Community 633",
"634": "Community 634",
"635": "Community 635",
"636": "Community 636",
"637": "Community 637",
"638": "Community 638",
"639": "Community 639",
"640": "Community 640",
"641": "Community 641",
"642": "Community 642",
"643": "Community 643",
"644": "Community 644",
"645": "Community 645",
"650": "Community 650",
"651": "Community 651",
"652": "Community 652",
"653": "Community 653",
"654": "Community 654",
"655": "Community 655",
"658": "Community 658",
"659": "Community 659",
"660": "Community 660",
"662": "Community 662",
"663": "Community 663",
"664": "Community 664",
"665": "Community 665",
"666": "Community 666",
"667": "Community 667",
"668": "Community 668",
"669": "Community 669",
"670": "Community 670",
"671": "Community 671",
"700": "Community 700",
"701": "Fixed",
"702": "Community 702",
"703": "Community 703",
"704": "Community 704",
"705": "Community 705",
"706": "Community 706",
"707": "Community 707",
"710": "Community 710",
"711": "Community 711",
"713": "Community 713",
"715": "Community 715",
"716": "Community 716",
"717": "Community 717",
"718": "Community 718",
"720": "Community 720",
"722": "Community 722",
"723": "Community 723",
"724": "Community 724",
"725": "Community 725",
"726": "Community 726",
"727": "Community 727",
"729": "Community 729",
"730": "Community 730",
"731": "Community 731",
"732": "Community 732",
"733": "Community 733",
"734": "修复",
"766": "新增",
"772": "重构",
"779": "重构",
"785": "⚠️ 重要提示",
"786": "⚠️ 重要提示",
"788": "⚠️ 重要提示",
"796": "OpportunityForm.vue",
"836": "BxInvoiceFileSelect.vue",
"838": "CustomerSelector.vue",
"840": "index.vue",
"857": "index.ts",
"886": "index.vue",
"889": "QuoteSelector.vue",
"892": "index.vue",
"896": "MarkWonDialog.vue",
"950": "BatchUpdateStageDialog.vue",
"1010": "BxApprovalFlowTabs.vue",
"1015": "DealDialog.vue",
"1016": "TransferDialog.vue",
"1017": "BatchUpdateDateDialog.vue",
"1115": "v2.4.2.7 - 2025-06-25",
"1117": "v2.5.2 - 2025-07-13",
"1118": "v2.4.2.2 - 2025-06-16",
"1123": "v2.4.1.1 - 2025-06-07",
"1126": "v2.4.2.1 - 2025-06-16",
"1127": "v2.4.2.4 - 2025-06-18",
"1197": "icons.js",
"1198": "icons.min.js",
"1199": "index.js",
"1201": "index.js",
"1204": "plugin.js",
"1205": "plugin.min.js",
"1206": "index.js",
"1207": "plugin.js",
"1208": "plugin.min.js",
"1210": "plugin.js",
"1211": "plugin.min.js",
"1212": "index.js",
"1213": "plugin.js",
"1214": "plugin.min.js",
"1215": "index.js",
"1216": "index.js",
"1217": "plugin.js",
"1218": "plugin.min.js",
"1219": "index.js",
"1220": "index.js",
"1222": "emojiimages.js",
"1223": "emojiimages.min.js",
"1224": "emojis.js",
"1225": "emojis.min.js",
"1228": "ar.js",
"1229": "bg_BG.js",
"1230": "ca.js",
"1231": "cs.js",
"1232": "da.js",
"1233": "de.js",
"1234": "el.js",
"1235": "es.js",
"1236": "eu.js",
"1237": "fa.js",
"1238": "fi.js",
"1239": "fr_FR.js",
"1240": "he_IL.js",
"1241": "hi.js",
"1242": "hr.js",
"1243": "hu_HU.js",
"1244": "id.js",
"1245": "it.js",
"1246": "ja.js",
"1247": "kk.js",
"1248": "ko_KR.js",
"1249": "ms.js",
"1250": "nb_NO.js",
"1251": "nl.js",
"1252": "pl.js",
"1253": "pt_BR.js",
"1254": "pt_PT.js",
"1255": "ro.js",
"1256": "ru.js",
"1257": "sk.js",
"1258": "sl_SI.js",
"1259": "sv_SE.js",
"1260": "th_TH.js",
"1261": "tr.js",
"1262": "uk.js",
"1263": "vi.js",
"1265": "zh_TW.js",
"1266": "index.js",
"1267": "index.js",
"1268": "plugin.js",
"1269": "_",
"1271": "plugin.js",
"1272": "plugin.min.js",
"1277": "plugin.js",
"1278": "plugin.min.js",
"1280": "plugin.js",
"1281": "plugin.min.js",
"1283": "plugin.js",
"1284": "plugin.min.js",
"1287": "plugin.js",
"1288": "plugin.min.js",
"1290": "index.js",
"1292": "index.js",
"1293": "plugin.js",
"1294": "plugin.min.js",
"1297": "plugin.js",
"1298": "plugin.min.js",
"1299": "content.js",
"1300": "content.js",
"1301": "content.js",
"1302": "content.js",
"1303": "content.js",
"1304": "content.js",
"1305": "content.inline.js",
"1306": "content.js",
"1307": "skin.js",
"1308": "skin.shadowdom.js",
"1309": "content.inline.js",
"1310": "content.js",
"1311": "skin.js",
"1312": "skin.shadowdom.js",
"1313": "content.inline.js",
"1314": "content.js",
"1315": "skin.js",
"1316": "skin.shadowdom.js",
"1317": "content.inline.js",
"1318": "content.js",
"1319": "skin.js",
"1320": "skin.shadowdom.js",
"1324": "index.vue",
"1325": "index.vue",
"1326": "route-parent.vue",
"1327": "setupSubpackSlipEditorTypeCheckboxes",
"1328": "修复",
"1329": "优化",
"1330": "新增",
"1331": "⚠️ 重要提示",
"1332": "重构",
"1333": "优化",
"1334": "修复",
"1335": "新增",
"1336": "升级",
"1337": "⚠️ 重要提示",
"1338": "修复",
"1339": "优化",
"1340": "新增",
"1341": "优化",
"1342": "修复",
"1343": "⚠️ 重要提示",
"1344": "升级",
"1345": "修复",
"1346": "优化",
"1347": "⚠️ 重要提示",
"1348": "新增",
"1349": "修复",
"1350": "优化",
"1351": "新增",
"1352": "优化",
"1353": "修复",
"1354": "新增",
"1355": "重构",
"1356": "优化",
"1357": "修复",
"1358": "移除",
"1359": "新增",
"1360": "优化",
"1361": "修复",
"1362": "新增",
"1363": "重构",
"1364": "升级",
"1365": "优化",
"1366": "修复",
"1367": "新增",
"1368": "优化",
"1369": "修复",
"1370": "优化",
"1371": "修复",
"1372": "新增",
"1373": "重构",
"1374": "升级",
"1375": "移除",
"1376": "修复",
"1377": "⚠️ 重要提示",
"1378": "重构",
"1379": "优化",
"1380": "修复",
"1381": "修复",
"1382": "新增",
"1383": "优化",
"1384": "修复",
"1385": "重构",
"1386": "优化",
"1387": "新增",
"1388": "重构",
"1389": "重构",
"1390": "优化",
"1391": "重构",
"1392": "优化",
"1393": "重构",
"1394": "重构",
"1395": "修复",
"1396": "重构",
"1397": "新增",
"1398": "优化",
"1399": "修复",
"1400": "⚠️ 重要提示",
"1401": "优化",
"1402": "修复",
"1403": "新增",
"1404": "优化",
"1405": "修复",
"1406": "重构",
"1407": "新增",
"1408": "优化",
"1409": "⚠️ 重要提示",
"1410": "code:block1 (crm/clue/)",
"1411": "code:typescript ({)",
"1412": "code:block3 (crm:clue:list # 线索列表查询)",
"1413": "code:bash (mysql -u root -p your_database < crm/sql/crm/12-CRM字典数据汇总.md)",
"9890": "README.md",
"9959": "Fixed",
"9960": "Fixed",
"9961": "Fixed",
"9962": "Fixed",
"9963": "Fixed",
"9964": "Fixed",
"9965": "Fixed",
"9966": "Fixed",
"9967": "Fixed",
"9968": "Fixed",
"9969": "Fixed",
"9970": "Fixed",
"9971": "Fixed",
"9972": "Fixed",
"9973": "Fixed",
"9974": "⚠️ Important Notice",
"9975": "⚠️ Important Notice",
"9976": "⚠️ Important Notice",
"9977": "⚠️ Important Notice",
"9978": "⚠️ Important Notice",
"9979": "⚠️ Important Notice",
"9980": "⚠️ Important Notice",
"9981": "Optimized",
"9982": "Optimized",
"9983": "Optimized",
"9984": "Optimized",
"9985": "Optimized",
"9986": "Optimized",
"9987": "Optimized",
"9988": "Optimized",
"9989": "Optimized",
"9990": "Optimized",
"9991": "Optimized",
"9992": "Optimized",
"9993": "Optimized",
"9994": "Optimized",
"9995": "Optimized",
"9996": "Optimized",
"9997": "Optimized",
"9998": "Optimized",
"9999": "Optimized",
"10000": "Optimized",
"10001": "Refactored",
"10002": "Refactored",
"10003": "Refactored",
"10004": "Refactored",
"10005": "Refactored",
"10006": "Refactored",
"10007": "Refactored",
"10008": "Refactored",
"10009": "Refactored",
"10010": "Refactored",
"10011": "Refactored",
"10012": "Refactored",
"10013": "Removed",
"10014": "Removed",
"10015": "Upgraded",
"10016": "Upgraded",
"10017": "Upgraded",
"10018": "Upgraded",
"10019": "优化",
"10020": "修复",
"10021": "⚠️ 重要提示",
"10022": "修复",
"10023": "优化",
"10024": "优化",
"10025": "⚠️ 重要提示",
"10026": "修复",
"10027": "优化",
"10028": "优化",
"10029": "修复",
"10030": "重构",
"10031": "优化",
"10032": "修复",
"10033": "新增",
"10034": "移除",
"10035": "优化",
"10036": "修复",
"10037": "重构",
"10038": "升级",
"10039": "优化",
"10040": "修复",
"10041": "优化",
"10042": "修复",
"10043": "修复",
"10044": "重构",
"10045": "升级",
"10046": "移除",
"10047": "修复",
"10048": "⚠️ 重要提示",
"10049": "⚠️ 重要提示",
"10050": "优化",
"10051": "修复",
"10052": "优化",
"10053": "修复",
"10054": "优化",
"10055": "新增",
"10056": "重构",
"10057": "优化",
"10058": "优化",
"10059": "重构",
"10060": "修复",
"10061": "新增",
"10062": "优化",
"10063": "修复",
"10064": "优化",
"10065": "⚠️ 重要提示",
"10066": "优化",
"10067": "修复",
"10068": "优化",
"10069": "修复",
"10070": "新增",
"10071": "优化",
"10072": "⚠️ 重要提示",
"10073": "修复",
"10074": "新增",
"10075": "升级",
"10076": "⚠️ 重要提示",
"10077": "修复",
"10078": "优化",
"10079": "code:bash (# Install dependencies)",
"10080": "code:bash (pnpm clean:dev)",
"10081": "code:bash (# 安装依赖)",
"10082": "code:bash (pnpm clean:dev)"
}
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,835 @@
{
"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": "Ha",
"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": "theme.min.js",
"27": "Community 27",
"28": "useCommon",
"29": "Community 29",
"30": "loader.ts",
"31": "RenewDialog.vue",
"32": "index.vue",
"33": "Community 33",
"34": "main.ts",
"35": "Community 35",
"36": "VoidDialog.vue",
"37": "pl-batch-print.ts",
"38": "view-fields.ts",
"39": "Community 39",
"40": "Community 40",
"41": "colors.ts",
"42": "Community 42",
"43": "Community 43",
"44": "Community 44",
"45": "Community 45",
"46": "Community 46",
"47": "fetchCustomerDetail",
"48": "Community 48",
"49": "Community 49",
"50": "Community 50",
"51": "price-letter-template.ts",
"52": "Community 52",
"53": "Community 53",
"54": "Community 54",
"55": "Community 55",
"56": "Community 56",
"57": "Community 57",
"58": "Community 58",
"59": "fetchData",
"60": "index.vue",
"61": "Community 61",
"62": "highlight.ts",
"63": "price-letter.ts",
"64": "Community 64",
"65": "detail.vue",
"66": "Community 66",
"67": "index.vue",
"68": "Community 68",
"69": "Community 69",
"70": "Community 70",
"71": "Community 71",
"72": "Community 72",
"73": "Community 73",
"74": "Community 74",
"75": "openEdit",
"76": "handleSearch",
"77": "loadUserOptions",
"78": "customerPool.ts",
"79": "Community 79",
"80": "product.ts",
"81": "Community 81",
"82": "Community 82",
"83": "useDictStore",
"84": "Community 84",
"85": "index.vue",
"86": "Community 86",
"87": "canDeleteByCreator",
"88": "index.vue",
"89": "detail.vue",
"90": "theme.min.js",
"91": "Community 91",
"92": "Community 92",
"93": "ArtUserMenu.vue",
"94": "formatYmd",
"95": "Community 95",
"96": "Community 96",
"97": "stringifyBody",
"98": "index.vue",
"99": "stringifyBody",
"100": "v2.4.2.1 - 2025-06-16",
"101": "price-letter.ts",
"102": "price-letter-template.ts",
"103": "SettingDrawer.vue",
"104": "contractType.ts",
"105": "index.vue",
"106": "Community 106",
"107": "Community 107",
"108": "Community 108",
"109": "Community 109",
"110": "Community 110",
"111": "format.ts",
"112": "inventory.ts",
"113": "Community 113",
"114": "index.vue",
"115": "useDictStore",
"116": "Community 116",
"117": "Community 117",
"118": "zh_CN.js",
"119": "Community 119",
"120": "Community 120",
"121": "chart.ts",
"122": "handleDisburse",
"123": "detail.vue",
"124": "index.vue",
"125": "Community 125",
"126": "Community 126",
"127": "selectContractRow",
"128": "Community 128",
"129": "Community 129",
"130": "system.ts",
"131": "index.vue",
"132": "Community 132",
"133": "Community 133",
"134": "index.vue",
"135": "detail.vue",
"136": "Community 136",
"137": "Community 137",
"138": "FollowDialog.vue",
"139": "RenewDialog.vue",
"140": "Community 140",
"141": "Community 141",
"142": "Community 142",
"143": "index.js",
"144": "Community 144",
"145": "api",
"146": "price-letter-template.ts",
"147": "index.vue",
"148": "Community 148",
"149": "fetchCustomerDetail",
"150": "Community 150",
"151": "Community 151",
"152": "SettingDrawer.vue",
"153": "index.vue",
"154": "index.vue",
"155": "error.ts",
"156": "v2.4.2.1 - 2025-06-16",
"157": "form.vue",
"158": "removeProductsNotAllowedByHazard",
"159": "detail.vue",
"160": "index.vue",
"161": "Community 161",
"162": "Community 162",
"163": "system.ts",
"164": "Community 164",
"165": "handleDisburse",
"166": "Community 166",
"167": "Community 167",
"168": "crypto.ts",
"169": "Community 169",
"170": "Community 170",
"171": "index.vue",
"172": "index.js",
"173": "index.vue",
"174": "Community 174",
"175": "handleEdit",
"176": "fetchData",
"177": "fetchCustomerDetail",
"178": "Community 178",
"179": "Community 179",
"180": "index.vue",
"181": "Community 181",
"182": "Community 182",
"183": "Ha",
"184": "highlight.ts",
"185": "handleConfirmApproval",
"186": "StorageKeyManager",
"187": "Community 187",
"188": "Community 188",
"189": "Community 189",
"190": "error-handle.ts",
"191": "formatYmd",
"192": "prepareLineAliasAndBrandForSubmit",
"193": "crm-product-display.ts",
"194": "index.ts",
"195": "Community 195",
"196": "Community 196",
"197": "v2.4.2.1 - 2025-06-16",
"198": "fetchRoleOptions",
"199": "colors.ts",
"200": "index.js",
"201": "Ha",
"202": "Community 202",
"203": "customerPool.ts",
"204": "DbCrmCustomerSelect.vue",
"205": "loadDefaultCustomerOptions",
"206": "onDrop",
"207": "SettingDrawer.vue",
"208": "index.vue",
"209": "Community 209",
"210": "Community 210",
"211": "loadUserOptions",
"212": "index.js",
"213": "Community 213",
"214": "Community 214",
"215": "index.vue",
"216": "VoidDialog.vue",
"217": "index.js",
"218": "index.js",
"219": "applyBrandSelectChange",
"220": "detail.vue",
"221": "index.js",
"222": "index.vue",
"223": "Community 223",
"224": "Community 224",
"225": "theme.min.js",
"226": "api",
"227": "Community 227",
"228": "Community 228",
"229": "useClientColumnFilters.ts",
"230": "SettingActions.vue",
"231": "index.vue",
"232": "handleConfirmApproval",
"233": "Community 233",
"234": "Community 234",
"235": "resolveDictValue",
"236": "index.vue",
"237": "colors.ts",
"238": "price-letter-template.ts",
"239": "Community 239",
"240": "detail.vue",
"241": "Ha",
"242": "Community 242",
"243": "Community 243",
"244": "v2.4.2.1 - 2025-06-16",
"245": "index.js",
"246": "fetchData",
"247": "Community 247",
"248": "Community 248",
"249": "SettingItem.vue",
"250": "loadDefaultCustomerOptions",
"251": "handleDisburse",
"252": "index.js",
"253": "Community 253",
"254": "db.ts",
"255": "Community 255",
"256": "Ha",
"257": "handleDisburse",
"258": "Ha",
"259": "Community 259",
"260": "Community 260",
"261": "Community 261",
"262": "index.js",
"263": "fetchUploadAttachment",
"264": "assignmentMatchesFilter",
"265": "Community 265",
"266": "crypto.ts",
"267": "index.vue",
"268": "index.vue",
"269": "Community 269",
"270": "Community 270",
"271": "SettingDrawer.vue",
"272": "index.vue",
"273": "detail.vue",
"274": "loadUserOptions",
"275": "index.js",
"276": "tabs.ts",
"277": "getPlMaintenanceApplyStatusLabel",
"278": "v2.4.2.1 - 2025-06-16",
"279": "getPlMaintenanceApplyStatusLabel",
"280": "Community 280",
"281": "index.js",
"282": "ArtException.vue",
"283": "Community 283",
"284": "Community 284",
"285": "Community 285",
"286": "Community 286",
"287": "index.vue",
"288": "form.vue",
"289": "handleEdit",
"290": "v2.4.2.3 - 2025-06-18",
"292": "Community 292",
"293": "index.vue",
"295": "Community 295",
"296": "Community 296",
"302": "Community 302",
"303": "Community 303",
"304": "Community 304",
"305": "isIoPlanFrozen",
"306": "handleArrange",
"307": "Community 307",
"308": "Community 308",
"309": "Community 309",
"310": "Community 310",
"312": "index.vue",
"315": "Community 315",
"316": "Community 316",
"317": "Community 317",
"318": "Community 318",
"319": "Community 319",
"320": "Community 320",
"321": "Community 321",
"322": "Community 322",
"323": "Community 323",
"324": "Community 324",
"325": "Community 325",
"326": "Community 326",
"327": "Community 327",
"328": "Community 328",
"329": "Community 329",
"330": "Community 330",
"331": "Community 331",
"332": "Community 332",
"333": "Community 333",
"334": "Community 334",
"335": "Community 335",
"336": "Community 336",
"337": "Community 337",
"338": "Community 338",
"339": "Community 339",
"340": "Community 340",
"341": "Community 341",
"342": "error-handle.ts",
"344": "ArtException.vue",
"346": "Community 346",
"347": "Community 347",
"349": "Community 349",
"350": "Community 350",
"355": "Community 355",
"362": "Community 362",
"367": "Community 367",
"372": "detail.vue",
"377": "Community 377",
"379": "Community 379",
"380": "Community 380",
"381": "Community 381",
"391": "Community 391",
"392": "Community 392",
"393": "Community 393",
"406": "Community 406",
"408": "Community 408",
"410": "Community 410",
"412": "Community 412",
"416": "Community 416",
"417": "Community 417",
"422": "Community 422",
"423": "Community 423",
"424": "Community 424",
"425": "Community 425",
"426": "Community 426",
"427": "Community 427",
"435": "index.vue",
"443": "index.vue",
"444": "index.vue",
"445": "Community 445",
"459": "Community 459",
"460": "Community 460",
"471": "Community 471",
"472": "Community 472",
"474": "Community 474",
"475": "Community 475",
"476": "Community 476",
"487": "Community 487",
"488": "Community 488",
"496": "Community 496",
"499": "Community 499",
"521": "Community 521",
"522": "Community 522",
"528": "Community 528",
"534": "Community 534",
"535": "Community 535",
"536": "Community 536",
"537": "Community 537",
"539": "Community 539",
"540": "Community 540",
"550": "Community 550",
"551": "Community 551",
"552": "Community 552",
"553": "Community 553",
"555": "Community 555",
"556": "Community 556",
"557": "Community 557",
"559": "Community 559",
"560": "Community 560",
"561": "Community 561",
"562": "Community 562",
"571": "Community 571",
"572": "Community 572",
"573": "Community 573",
"574": "Community 574",
"575": "Community 575",
"576": "Community 576",
"580": "Community 580",
"581": "Community 581",
"582": "Community 582",
"583": "Community 583",
"584": "Community 584",
"585": "Community 585",
"586": "Community 586",
"597": "Community 597",
"598": "Community 598",
"599": "Community 599",
"600": "Community 600",
"601": "Community 601",
"602": "Community 602",
"603": "Community 603",
"604": "Community 604",
"607": "Community 607",
"608": "Community 608",
"609": "Community 609",
"610": "Community 610",
"611": "Community 611",
"612": "Community 612",
"613": "Community 613",
"614": "Community 614",
"615": "Community 615",
"630": "Community 630",
"631": "Community 631",
"632": "Community 632",
"633": "Community 633",
"634": "Community 634",
"635": "Community 635",
"636": "Community 636",
"637": "Community 637",
"638": "Community 638",
"639": "Community 639",
"640": "Community 640",
"641": "Community 641",
"642": "Community 642",
"643": "Community 643",
"644": "Community 644",
"645": "Community 645",
"650": "Community 650",
"651": "Community 651",
"652": "Community 652",
"653": "Community 653",
"654": "Community 654",
"655": "Community 655",
"658": "Community 658",
"659": "Community 659",
"660": "Community 660",
"662": "Community 662",
"663": "Community 663",
"664": "Community 664",
"665": "Community 665",
"666": "Community 666",
"667": "Community 667",
"668": "Community 668",
"669": "Community 669",
"670": "Community 670",
"671": "Community 671",
"700": "Community 700",
"701": "Fixed",
"702": "Community 702",
"703": "Community 703",
"704": "Community 704",
"705": "Community 705",
"706": "Community 706",
"707": "Community 707",
"710": "Community 710",
"711": "Community 711",
"713": "Community 713",
"715": "Community 715",
"716": "Community 716",
"717": "Community 717",
"718": "Community 718",
"720": "Community 720",
"722": "Community 722",
"723": "Community 723",
"724": "Community 724",
"725": "Community 725",
"726": "Community 726",
"727": "Community 727",
"729": "Community 729",
"730": "Community 730",
"731": "Community 731",
"732": "Community 732",
"733": "Community 733",
"734": "修复",
"766": "新增",
"772": "重构",
"779": "重构",
"785": "⚠️ 重要提示",
"786": "⚠️ 重要提示",
"788": "⚠️ 重要提示",
"796": "OpportunityForm.vue",
"836": "BxInvoiceFileSelect.vue",
"838": "CustomerSelector.vue",
"840": "index.vue",
"857": "index.ts",
"886": "index.vue",
"889": "QuoteSelector.vue",
"892": "index.vue",
"896": "MarkWonDialog.vue",
"950": "BatchUpdateStageDialog.vue",
"1010": "BxApprovalFlowTabs.vue",
"1015": "DealDialog.vue",
"1016": "TransferDialog.vue",
"1017": "BatchUpdateDateDialog.vue",
"1115": "v2.4.2.7 - 2025-06-25",
"1117": "v2.5.2 - 2025-07-13",
"1118": "v2.4.2.2 - 2025-06-16",
"1123": "v2.4.1.1 - 2025-06-07",
"1126": "v2.4.2.1 - 2025-06-16",
"1127": "v2.4.2.4 - 2025-06-18",
"1197": "icons.js",
"1198": "icons.min.js",
"1199": "index.js",
"1201": "index.js",
"1204": "plugin.js",
"1205": "plugin.min.js",
"1206": "index.js",
"1207": "plugin.js",
"1208": "plugin.min.js",
"1210": "plugin.js",
"1211": "plugin.min.js",
"1212": "index.js",
"1213": "plugin.js",
"1214": "plugin.min.js",
"1215": "index.js",
"1216": "index.js",
"1217": "plugin.js",
"1218": "plugin.min.js",
"1219": "index.js",
"1220": "index.js",
"1222": "emojiimages.js",
"1223": "emojiimages.min.js",
"1224": "emojis.js",
"1225": "emojis.min.js",
"1228": "ar.js",
"1229": "bg_BG.js",
"1230": "ca.js",
"1231": "cs.js",
"1232": "da.js",
"1233": "de.js",
"1234": "el.js",
"1235": "es.js",
"1236": "eu.js",
"1237": "fa.js",
"1238": "fi.js",
"1239": "fr_FR.js",
"1240": "he_IL.js",
"1241": "hi.js",
"1242": "hr.js",
"1243": "hu_HU.js",
"1244": "id.js",
"1245": "it.js",
"1246": "ja.js",
"1247": "kk.js",
"1248": "ko_KR.js",
"1249": "ms.js",
"1250": "nb_NO.js",
"1251": "nl.js",
"1252": "pl.js",
"1253": "pt_BR.js",
"1254": "pt_PT.js",
"1255": "ro.js",
"1256": "ru.js",
"1257": "sk.js",
"1258": "sl_SI.js",
"1259": "sv_SE.js",
"1260": "th_TH.js",
"1261": "tr.js",
"1262": "uk.js",
"1263": "vi.js",
"1265": "zh_TW.js",
"1266": "index.js",
"1267": "index.js",
"1268": "plugin.js",
"1269": "_",
"1271": "plugin.js",
"1272": "plugin.min.js",
"1277": "plugin.js",
"1278": "plugin.min.js",
"1280": "plugin.js",
"1281": "plugin.min.js",
"1283": "plugin.js",
"1284": "plugin.min.js",
"1287": "plugin.js",
"1288": "plugin.min.js",
"1290": "index.js",
"1292": "index.js",
"1293": "plugin.js",
"1294": "plugin.min.js",
"1297": "plugin.js",
"1298": "plugin.min.js",
"1299": "content.js",
"1300": "content.js",
"1301": "content.js",
"1302": "content.js",
"1303": "content.js",
"1304": "content.js",
"1305": "content.inline.js",
"1306": "content.js",
"1307": "skin.js",
"1308": "skin.shadowdom.js",
"1309": "content.inline.js",
"1310": "content.js",
"1311": "skin.js",
"1312": "skin.shadowdom.js",
"1313": "content.inline.js",
"1314": "content.js",
"1315": "skin.js",
"1316": "skin.shadowdom.js",
"1317": "content.inline.js",
"1318": "content.js",
"1319": "skin.js",
"1320": "skin.shadowdom.js",
"1324": "index.vue",
"1325": "index.vue",
"1326": "route-parent.vue",
"1327": "setupSubpackSlipEditorTypeCheckboxes",
"1328": "修复",
"1329": "优化",
"1330": "新增",
"1331": "⚠️ 重要提示",
"1332": "重构",
"1333": "优化",
"1334": "修复",
"1335": "新增",
"1336": "升级",
"1337": "⚠️ 重要提示",
"1338": "修复",
"1339": "优化",
"1340": "新增",
"1341": "优化",
"1342": "修复",
"1343": "⚠️ 重要提示",
"1344": "升级",
"1345": "修复",
"1346": "优化",
"1347": "⚠️ 重要提示",
"1348": "新增",
"1349": "修复",
"1350": "优化",
"1351": "新增",
"1352": "优化",
"1353": "修复",
"1354": "新增",
"1355": "重构",
"1356": "优化",
"1357": "修复",
"1358": "移除",
"1359": "新增",
"1360": "优化",
"1361": "修复",
"1362": "新增",
"1363": "重构",
"1364": "升级",
"1365": "优化",
"1366": "修复",
"1367": "新增",
"1368": "优化",
"1369": "修复",
"1370": "优化",
"1371": "修复",
"1372": "新增",
"1373": "重构",
"1374": "升级",
"1375": "移除",
"1376": "修复",
"1377": "⚠️ 重要提示",
"1378": "重构",
"1379": "优化",
"1380": "修复",
"1381": "修复",
"1382": "新增",
"1383": "优化",
"1384": "修复",
"1385": "重构",
"1386": "优化",
"1387": "新增",
"1388": "重构",
"1389": "重构",
"1390": "优化",
"1391": "重构",
"1392": "优化",
"1393": "重构",
"1394": "重构",
"1395": "修复",
"1396": "重构",
"1397": "新增",
"1398": "优化",
"1399": "修复",
"1400": "⚠️ 重要提示",
"1401": "优化",
"1402": "修复",
"1403": "新增",
"1404": "优化",
"1405": "修复",
"1406": "重构",
"1407": "新增",
"1408": "优化",
"1409": "⚠️ 重要提示",
"1410": "code:block1 (crm/clue/)",
"1411": "code:typescript ({)",
"1412": "code:block3 (crm:clue:list # 线索列表查询)",
"1413": "code:bash (mysql -u root -p your_database < crm/sql/crm/12-CRM字典数据汇总.md)",
"9890": "README.md",
"9959": "Fixed",
"9960": "Fixed",
"9961": "Fixed",
"9962": "Fixed",
"9963": "Fixed",
"9964": "Fixed",
"9965": "Fixed",
"9966": "Fixed",
"9967": "Fixed",
"9968": "Fixed",
"9969": "Fixed",
"9970": "Fixed",
"9971": "Fixed",
"9972": "Fixed",
"9973": "Fixed",
"9974": "⚠️ Important Notice",
"9975": "⚠️ Important Notice",
"9976": "⚠️ Important Notice",
"9977": "⚠️ Important Notice",
"9978": "⚠️ Important Notice",
"9979": "⚠️ Important Notice",
"9980": "⚠️ Important Notice",
"9981": "Optimized",
"9982": "Optimized",
"9983": "Optimized",
"9984": "Optimized",
"9985": "Optimized",
"9986": "Optimized",
"9987": "Optimized",
"9988": "Optimized",
"9989": "Optimized",
"9990": "Optimized",
"9991": "Optimized",
"9992": "Optimized",
"9993": "Optimized",
"9994": "Optimized",
"9995": "Optimized",
"9996": "Optimized",
"9997": "Optimized",
"9998": "Optimized",
"9999": "Optimized",
"10000": "Optimized",
"10001": "Refactored",
"10002": "Refactored",
"10003": "Refactored",
"10004": "Refactored",
"10005": "Refactored",
"10006": "Refactored",
"10007": "Refactored",
"10008": "Refactored",
"10009": "Refactored",
"10010": "Refactored",
"10011": "Refactored",
"10012": "Refactored",
"10013": "Removed",
"10014": "Removed",
"10015": "Upgraded",
"10016": "Upgraded",
"10017": "Upgraded",
"10018": "Upgraded",
"10019": "优化",
"10020": "修复",
"10021": "⚠️ 重要提示",
"10022": "修复",
"10023": "优化",
"10024": "优化",
"10025": "⚠️ 重要提示",
"10026": "修复",
"10027": "优化",
"10028": "优化",
"10029": "修复",
"10030": "重构",
"10031": "优化",
"10032": "修复",
"10033": "新增",
"10034": "移除",
"10035": "优化",
"10036": "修复",
"10037": "重构",
"10038": "升级",
"10039": "优化",
"10040": "修复",
"10041": "优化",
"10042": "修复",
"10043": "修复",
"10044": "重构",
"10045": "升级",
"10046": "移除",
"10047": "修复",
"10048": "⚠️ 重要提示",
"10049": "⚠️ 重要提示",
"10050": "优化",
"10051": "修复",
"10052": "优化",
"10053": "修复",
"10054": "优化",
"10055": "新增",
"10056": "重构",
"10057": "优化",
"10058": "优化",
"10059": "重构",
"10060": "修复",
"10061": "新增",
"10062": "优化",
"10063": "修复",
"10064": "优化",
"10065": "⚠️ 重要提示",
"10066": "优化",
"10067": "修复",
"10068": "优化",
"10069": "修复",
"10070": "新增",
"10071": "优化",
"10072": "⚠️ 重要提示",
"10073": "修复",
"10074": "新增",
"10075": "升级",
"10076": "⚠️ 重要提示",
"10077": "修复",
"10078": "优化",
"10079": "code:bash (# Install dependencies)",
"10080": "code:bash (pnpm clean:dev)",
"10081": "code:bash (# 安装依赖)",
"10082": "code:bash (pnpm clean:dev)"
}
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
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+16
View File
@@ -614,6 +614,8 @@ export interface PlanQuery {
planNo?: string
planType?: string
followStatus?: string
/** 排除的跟进状态,多个以英文逗号分隔 */
excludeFollowStatus?: string
transportStatus?: string
archiveStatus?: string
customerName?: string
@@ -790,11 +792,23 @@ export interface PlanArchiveFreightBlock {
hasInvoice?: number
}
export interface PlanArchiveStopFeedbackAttachmentItem {
stopType: 'load' | 'delivery'
stopId: string
attachmentUrls: string[]
}
export interface PlanArchiveFeedbacksBlock {
driverStops?: PlanArchiveStopFeedbackAttachmentItem[]
siteStops?: PlanArchiveStopFeedbackAttachmentItem[]
}
export interface PlanArchiveBody {
products?: PlanArchiveProductItem[]
load?: PlanArchiveLoadBlock
deliveries?: PlanArchiveDeliveryBlock[]
freight?: PlanArchiveFreightBlock
feedbacks?: PlanArchiveFeedbacksBlock
}
export interface PlanDriverFeedbackProductItem {
@@ -885,6 +899,8 @@ export const planApi = {
request.get<PlanArrangeInfo>(`/transport/plan/${id}/arrange-info`),
archive: (id: string, data?: PlanArchiveBody) =>
request.post<Plan>(`/transport/plan/${id}/archive`, data),
archiveDraft: (id: string, data: PlanArchiveBody) =>
request.post<Plan>(`/transport/plan/${id}/archive-draft`, data),
updateDriverFeedback: (id: string, data: PlanDriverFeedbackUpdateBody) =>
request.patch<Plan>(`/transport/plan/${id}/driver-feedback`, data),
updateSiteFeedback: (id: string, linkId: string, data: PlanSiteFeedbackUpdateBody) =>
@@ -1,7 +1,7 @@
<template>
<SystemViewDialog
v-model:visible="innerVisible"
title="查看关联数据"
title="查看出入库单"
:icon="Link"
:sections="sections"
:loading="loading"
@@ -22,12 +22,13 @@
import { computed } from 'vue'
import { Link } from '@element-plus/icons-vue'
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
import type { InventoryRelatedData } from '@/api/db/inventory'
import type { InventoryRecord, InventoryRelatedData } from '@/api/db/inventory'
import { buildInventoryRelatedSections } from '@/components/business/db/db-related-view'
const props = defineProps<{
visible: boolean
loading?: boolean
inventory?: InventoryRecord | null
data: InventoryRelatedData
}>()
@@ -40,5 +41,5 @@
set: (val) => emit('update:visible', val)
})
const sections = computed(() => buildInventoryRelatedSections(props.data))
const sections = computed(() => buildInventoryRelatedSections(props.data, props.inventory))
</script>
@@ -1,7 +1,7 @@
<template>
<SystemViewDialog
v-model:visible="innerVisible"
title="查看关联数据"
title="查看计划"
:icon="Link"
:sections="sections"
:loading="loading"
@@ -22,12 +22,13 @@
import { computed } from 'vue'
import { Link } from '@element-plus/icons-vue'
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
import type { PlanRelatedData } from '@/api/db/plans'
import type { Plan, PlanRelatedData } from '@/api/db/plans'
import { buildPlanRelatedSections } from '@/components/business/db/db-related-view'
const props = defineProps<{
visible: boolean
loading?: boolean
plan?: Plan | null
data: PlanRelatedData
}>()
@@ -40,5 +41,5 @@
set: (val) => emit('update:visible', val)
})
const sections = computed(() => buildPlanRelatedSections(props.data))
const sections = computed(() => buildPlanRelatedSections(props.data, props.plan))
</script>
@@ -1,7 +1,7 @@
<template>
<SystemViewDialog
v-model:visible="innerVisible"
title="查看关联数据"
title="查看地磅单"
:icon="Link"
:sections="sections"
:loading="loading"
@@ -1,6 +1,6 @@
import type { Plan, PlanInventoryRecord, PlanRelatedData, PlanWeighingRecord } from '@/api/db/plans'
import type { InventoryRecord, InventoryRelatedData, InventoryWeighingRecord } from '@/api/db/inventory'
import type { WeighingRelatedData } from '@/api/db/weighing'
import type { WeighingRecord, WeighingRelatedData } from '@/api/db/weighing'
import type { TagType, ViewField, ViewSection } from '@/components/business/system-view-dialog/index.vue'
export function businessTypeTagType(businessType: string): TagType {
@@ -85,7 +85,7 @@ export function buildInventoryViewSection(
}
export function buildWeighingViewSection(
record: PlanWeighingRecord | InventoryWeighingRecord,
record: PlanWeighingRecord | InventoryWeighingRecord | WeighingRecord,
title = '地磅单'
): ViewSection {
const fields: ViewField[] = [
@@ -161,17 +161,22 @@ function mergePlanRelatedItems(data: PlanRelatedData): MergedPlanRelatedItem[] {
})
}
export function buildPlanRelatedSections(data: PlanRelatedData): ViewSection[] {
export function buildPlanRelatedSections(
data: PlanRelatedData,
plan?: Plan | null
): ViewSection[] {
const sections: ViewSection[] = []
if (plan) sections.push(buildPlanViewSection(plan))
const items = mergePlanRelatedItems(data)
if (!items.length) {
return [
{
sections.push({
title: '关联数据',
fieldLayout: 'table',
tableMode: 'triple',
fields: [{ label: '说明', value: '暂无关联数据', span: 'full' }]
}
]
})
return sections
}
const inventoryCount = items.filter((item) => item.type === 'inventory').length
@@ -179,48 +184,55 @@ export function buildPlanRelatedSections(data: PlanRelatedData): ViewSection[] {
let inventoryIndex = 0
let weighingIndex = 0
return items.map((item) => {
items.forEach((item) => {
if (item.type === 'inventory') {
const title = sectionTitle('出入库单', inventoryIndex, inventoryCount)
inventoryIndex += 1
return buildInventoryViewSection(item, title)
sections.push(buildInventoryViewSection(item, title))
return
}
const title = sectionTitle('地磅单', weighingIndex, weighingCount)
weighingIndex += 1
return buildWeighingViewSection(item, title)
sections.push(buildWeighingViewSection(item, title))
})
return sections
}
export function buildInventoryRelatedSections(data: InventoryRelatedData): ViewSection[] {
export function buildInventoryRelatedSections(
data: InventoryRelatedData,
inventory?: InventoryRecord | null
): ViewSection[] {
const sections: ViewSection[] = []
if (inventory) sections.push(buildInventoryViewSection(inventory))
if (data.plan) sections.push(buildPlanViewSection(data.plan))
if (data.weighing) sections.push(buildWeighingViewSection(data.weighing))
if (!sections.length) {
return [
{
if (!data.plan && !data.weighing) {
sections.push({
title: '关联数据',
fieldLayout: 'table',
tableMode: 'triple',
fields: [{ label: '说明', value: '暂无关联数据', span: 'full' }]
}
]
})
}
return sections
}
export function buildWeighingRelatedSections(data: WeighingRelatedData): ViewSection[] {
export function buildWeighingRelatedSections(
data: WeighingRelatedData,
weighing?: WeighingRecord | null
): ViewSection[] {
const sections: ViewSection[] = []
if (weighing) sections.push(buildWeighingViewSection(weighing))
if (data.plan) sections.push(buildPlanViewSection(data.plan))
if (data.inventory) sections.push(buildInventoryViewSection(data.inventory))
if (!sections.length) {
return [
{
if (!data.plan && !data.inventory) {
sections.push({
title: '关联数据',
fieldLayout: 'table',
tableMode: 'triple',
fields: [{ label: '说明', value: '暂无关联数据', span: 'full' }]
}
]
})
}
return sections
}
@@ -39,17 +39,23 @@
<PlPlanStopsSplitShell :show-balance="false">
<template #load>
<PlPlanArchiveSegmentBlock
ref="loadSegmentRef"
stop-type="load"
:meta="loadArchiveMeta"
:view-products="loadViewProducts"
:products="loadProductRows"
archive-mode="inbound"
:show-stop-feedback="showStopFeedback"
editable-attachments
:generate-dibang="plan.load?.generateDibang"
:dibang-rows="loadDibangRows"
:driver-feedback="resolveDriverStopFeedback('load', loadStopId)"
:site-feedback="resolveSiteStopFeedback('load', loadStopId)"
:fallback-remark="transport?.feedbackRemark"
:driver-attachment-urls="getFeedbackAttachmentCsv('load', loadStopId, 'driver')"
:site-attachment-urls="getFeedbackAttachmentCsv('load', loadStopId, 'site')"
@update:driver-attachment-urls="setFeedbackAttachmentCsv('load', loadStopId, 'driver', $event)"
@update:site-attachment-urls="setFeedbackAttachmentCsv('load', loadStopId, 'site', $event)"
/>
</template>
<template #delivery>
@@ -72,18 +78,28 @@
class="pl-plan-view-delivery-block"
>
<PlPlanArchiveSegmentBlock
:ref="(el) => setDeliverySegmentRef(index, el)"
stop-type="delivery"
:meta="block.meta"
:view-products="getDeliveryViewProducts(index)"
:products="block.products"
archive-mode="outbound"
:show-stop-feedback="showStopFeedback"
editable-attachments
:feedback-stop-label="deliveryBlocks.length > 1 ? `送货 #${index + 1}` : '送货'"
:generate-dibang="plan.deliveries?.[index]?.generateDibang"
:dibang-rows="resolveDeliveryDibangRows(index)"
:driver-feedback="resolveDriverStopFeedback('delivery', block.stopId)"
:site-feedback="resolveSiteStopFeedback('delivery', block.stopId)"
:fallback-remark="transport?.feedbackRemark"
:driver-attachment-urls="getFeedbackAttachmentCsv('delivery', block.stopId, 'driver')"
:site-attachment-urls="getFeedbackAttachmentCsv('delivery', block.stopId, 'site')"
@update:driver-attachment-urls="
setFeedbackAttachmentCsv('delivery', block.stopId, 'driver', $event)
"
@update:site-attachment-urls="
setFeedbackAttachmentCsv('delivery', block.stopId, 'site', $event)
"
/>
</article>
</template>
@@ -194,6 +210,13 @@
<el-button @click="innerVisible = false">
<el-icon><Close /></el-icon>取消
</el-button>
<el-button
v-if="!isAdjustMode"
:loading="draftLoading"
@click="handleSaveDraft"
>
<el-icon><Document /></el-icon>暂存
</el-button>
<el-button type="primary" :loading="submitLoading" @click="handleSubmit">
<el-icon><Check /></el-icon>{{ submitLabel }}
</el-button>
@@ -203,7 +226,7 @@
</template>
<script setup lang="ts">
import { Check, Close } from '@element-plus/icons-vue'
import { Check, Close, Document } from '@element-plus/icons-vue'
import { fetchProductDetail, type ProductDetail } from '@/api/crm/product'
import {
inboundOrderApi,
@@ -211,6 +234,8 @@
planApi,
type Plan,
type PlanArchiveBody,
type PlanArchiveFeedbacksBlock,
type PlanArchiveStopFeedbackAttachmentItem,
type PlanDelivery,
type PlanProduct,
type PlanStopProduct,
@@ -244,6 +269,7 @@
resolveStopProductsForView,
type PlanStopProductFormRow
} from '@/utils/pl-plan-stop-form'
import { isPlInternalCustomerName } from '@/utils/pl-internal-customer'
const props = defineProps<{
visible: boolean
@@ -262,6 +288,7 @@
const loading = ref(false)
const submitLoading = ref(false)
const draftLoading = ref(false)
const activeTab = ref<'archive' | 'overview'>('archive')
const tabsRef = ref<InstanceType<typeof PlPlanViewTabs> | null>(null)
const vehicleViewVisible = ref(false)
@@ -287,6 +314,9 @@
}>
>([])
const archiveDeliveryTabIndex = ref(0)
const loadSegmentRef = ref<InstanceType<typeof PlPlanArchiveSegmentBlock> | null>(null)
const deliverySegmentRefs = ref<Array<InstanceType<typeof PlPlanArchiveSegmentBlock> | null>>([])
const feedbackAttachmentEdits = reactive<Record<string, string>>({})
const canSubmitStopArchive = computed(
() =>
Boolean(plan.value.load?.id) &&
@@ -395,7 +425,7 @@
function getDeliveryViewProducts(index: number): PlanStopProductFormRow[] {
const delivery = plan.value?.deliveries?.[index]
if (delivery) {
const mapped = mapDeliveriesFromApi([delivery], plan.value?.load?.customerName)[0]
const mapped = mapDeliveriesFromApi([delivery])[0]
return resolveStopProductsForView(mapped.products, productRows.value)
}
const legacy = mapLegacyPlanToStops(plan.value || ({} as Plan)).deliveries[index]
@@ -455,8 +485,139 @@
)
}
type FeedbackAttachmentKind = 'driver' | 'site'
function feedbackAttachmentKey(
stopType: 'load' | 'delivery',
stopId: string,
kind: FeedbackAttachmentKind
) {
return `${stopType}:${stopId}:${kind}`
}
function parseAttachmentCsv(csv: string) {
return csv
.split(',')
.map((item) => item.trim())
.filter(Boolean)
}
function resolveFeedbackAttachmentCsv(
stopType: 'load' | 'delivery',
stopId: string,
kind: FeedbackAttachmentKind
) {
const feedback =
kind === 'driver'
? resolveDriverStopFeedback(stopType, stopId)
: resolveSiteStopFeedback(stopType, stopId)
return (feedback?.attachmentUrls || []).join(',')
}
function initFeedbackAttachmentEdits() {
Object.keys(feedbackAttachmentEdits).forEach((key) => {
delete feedbackAttachmentEdits[key]
})
const loadId = loadStopId.value
if (loadId) {
feedbackAttachmentEdits[feedbackAttachmentKey('load', loadId, 'driver')] =
resolveFeedbackAttachmentCsv('load', loadId, 'driver')
if (shouldCollectSiteFeedbackAttachments('load', loadId)) {
feedbackAttachmentEdits[feedbackAttachmentKey('load', loadId, 'site')] =
resolveFeedbackAttachmentCsv('load', loadId, 'site')
}
}
deliveryBlocks.value.forEach((block) => {
if (!block.stopId) return
feedbackAttachmentEdits[feedbackAttachmentKey('delivery', block.stopId, 'driver')] =
resolveFeedbackAttachmentCsv('delivery', block.stopId, 'driver')
if (shouldCollectSiteFeedbackAttachments('delivery', block.stopId)) {
feedbackAttachmentEdits[feedbackAttachmentKey('delivery', block.stopId, 'site')] =
resolveFeedbackAttachmentCsv('delivery', block.stopId, 'site')
}
})
}
function shouldCollectSiteFeedbackAttachments(
stopType: 'load' | 'delivery',
stopId: string
) {
if (!stopId) return false
const customerName =
stopType === 'load'
? loadArchiveMeta.value.customerName
: deliveryBlocks.value.find((block) => block.stopId === stopId)?.customerName
return isPlInternalCustomerName(customerName)
}
function getFeedbackAttachmentCsv(
stopType: 'load' | 'delivery',
stopId: string,
kind: FeedbackAttachmentKind
) {
if (!stopId) return ''
const key = feedbackAttachmentKey(stopType, stopId, kind)
if (key in feedbackAttachmentEdits) {
return feedbackAttachmentEdits[key]
}
return resolveFeedbackAttachmentCsv(stopType, stopId, kind)
}
function setFeedbackAttachmentCsv(
stopType: 'load' | 'delivery',
stopId: string,
kind: FeedbackAttachmentKind,
csv: string
) {
if (!stopId) return
feedbackAttachmentEdits[feedbackAttachmentKey(stopType, stopId, kind)] = csv
}
function setDeliverySegmentRef(index: number, el: unknown) {
deliverySegmentRefs.value[index] = (el as InstanceType<typeof PlPlanArchiveSegmentBlock>) || null
}
function hasFeedbackAttachmentUploading() {
const refs = [loadSegmentRef.value, ...deliverySegmentRefs.value].filter(Boolean)
return refs.some((refItem) => refItem?.hasAttachmentUploading?.())
}
function collectFeedbackAttachmentsForSubmit(): PlanArchiveFeedbacksBlock {
const driverStops: PlanArchiveStopFeedbackAttachmentItem[] = []
const siteStops: PlanArchiveStopFeedbackAttachmentItem[] = []
const appendStop = (
stopType: 'load' | 'delivery',
stopId: string,
kind: FeedbackAttachmentKind,
target: PlanArchiveStopFeedbackAttachmentItem[]
) => {
if (!stopId) return
if (kind === 'site' && !shouldCollectSiteFeedbackAttachments(stopType, stopId)) return
target.push({
stopType,
stopId,
attachmentUrls: parseAttachmentCsv(getFeedbackAttachmentCsv(stopType, stopId, kind))
})
}
if (loadStopId.value) {
appendStop('load', loadStopId.value, 'driver', driverStops)
appendStop('load', loadStopId.value, 'site', siteStops)
}
deliveryBlocks.value.forEach((block) => {
appendStop('delivery', block.stopId, 'driver', driverStops)
appendStop('delivery', block.stopId, 'site', siteStops)
})
return { driverStops, siteStops }
}
function buildDeliveryArchiveMeta(delivery: PlanDelivery): ArchiveSegmentMeta {
const mappedRows = mapDeliveriesFromApi([delivery], plan.value?.load?.customerName)
const mappedRows = mapDeliveriesFromApi([delivery])
const mapped = mappedRows[0]
return {
customerId: mapped.customerId,
@@ -989,6 +1150,10 @@
loadProductRows.value = []
deliveryBlocks.value = []
archiveDeliveryTabIndex.value = 0
deliverySegmentRefs.value = []
Object.keys(feedbackAttachmentEdits).forEach((key) => {
delete feedbackAttachmentEdits[key]
})
Object.assign(formData, {
hasFreight: 1,
distanceKm: null,
@@ -1072,6 +1237,7 @@
}
syncMultiStopBrandActualQty()
await applyFreightPrefill(data)
initFeedbackAttachmentEdits()
} catch (error) {
innerVisible.value = false
const message = error instanceof Error ? error.message : '加载运输计划失败'
@@ -1089,6 +1255,109 @@
resetState()
}
function toOptionalNumber(value: unknown): number | undefined {
if (value == null || value === '') return undefined
const n = Number(value)
return Number.isFinite(n) ? n : undefined
}
function buildArchiveBody(options?: { allowEmptyQty?: boolean }): PlanArchiveBody {
const allowEmptyQty = options?.allowEmptyQty === true
const mapBrandQtys = (row: PlanFormProductRow) =>
(row.brandQtyRows || [])
.filter((item) => Number(item.qty) > 0)
.map((item) => ({
brandId: item.brandId,
brandName: item.brandName,
qty: Number(item.qty),
unitPrice:
(item as { price?: number }).price != null
? Number((item as { price?: number }).price)
: undefined
}))
const brandProducts = collectBrandProductsForSubmit()
return {
load: {
stopId: plan.value.load!.id!,
products: loadProductRows.value.map((row) => ({
id: row.id!,
inboundQty: allowEmptyQty
? toOptionalNumber(row.inboundQty)
: Number(row.inboundQty ?? 0),
inboundPrice: row.inboundPrice != null ? Number(row.inboundPrice) : undefined,
brandQtys: mapBrandQtys(row)
}))
},
deliveries: deliveryBlocks.value.map((block) => ({
stopId: block.stopId,
products: block.products.map((row) => ({
id: row.id!,
outboundQty: allowEmptyQty
? toOptionalNumber(row.outboundQty)
: Number(row.outboundQty ?? 0),
outboundPrice: row.outboundPrice != null ? Number(row.outboundPrice) : undefined,
brandQtys: mapBrandQtys(row)
}))
})),
...(brandProducts.length ? { products: brandProducts } : {}),
freight: {
hasFreight: formData.hasFreight,
freightRemark: formData.freightRemark || undefined,
...(formData.hasFreight === 1
? {
distanceKm: formData.distanceKm ?? undefined,
freightType: formData.freightType,
freightPrice:
formData.freightType === 'by_weight'
? (freightCalc.freightPrice.value ?? undefined)
: undefined,
freightAmount:
freightCalc.calculatedFreight.value ||
freightCalc.freightAmount.value ||
undefined,
transportQty:
formData.freightType === 'by_weight'
? (freightCalc.transportQty.value ?? undefined)
: undefined
}
: {})
},
...(plan.value.transportId ? { feedbacks: collectFeedbackAttachmentsForSubmit() } : {})
}
}
async function handleSaveDraft() {
if (isAdjustMode.value) return
if (!canSubmitStopArchive.value) {
ElMessage.warning('缺少装货/送货段数据,请先完成运输安排后再暂存')
return
}
if (hasFeedbackAttachmentUploading()) {
ElMessage.warning('附件正在上传,请稍候再暂存')
return
}
syncSegmentBrandTotals(loadProductRows.value, 'inbound')
deliveryBlocks.value.forEach((block) => syncSegmentBrandTotals(block.products, 'outbound'))
syncMultiStopBrandActualQty()
draftLoading.value = true
try {
const body = buildArchiveBody({ allowEmptyQty: true })
await planApi.archiveDraft(props.planId, body)
plan.value.archiveStatus = 'draft'
ElMessage.success('已暂存')
emit('success')
innerVisible.value = false
} catch (e: unknown) {
const message = e instanceof Error ? e.message : '暂存失败'
ElMessage.error(message)
} finally {
draftLoading.value = false
}
}
async function handleSubmit() {
if (!canSubmitStopArchive.value) {
ElMessage.warning('缺少装货/送货段数据,请先完成运输安排后再归档')
@@ -1130,7 +1399,6 @@
return
}
const brandProducts = collectBrandProductsForSubmit()
if (
formData.hasFreight === 1 &&
formData.freightType === 'by_weight' &&
@@ -1154,73 +1422,14 @@
}
}
submitLoading.value = true
try {
const body: PlanArchiveBody = {
load: {
stopId: plan.value.load!.id!,
products: loadProductRows.value.map((row) => ({
id: row.id!,
inboundQty: Number(row.inboundQty ?? 0),
inboundPrice: row.inboundPrice != null ? Number(row.inboundPrice) : undefined,
brandQtys: (row.brandQtyRows || [])
.filter((item) => Number(item.qty) > 0)
.map((item) => ({
brandId: item.brandId,
brandName: item.brandName,
qty: Number(item.qty),
unitPrice:
(item as { price?: number }).price != null
? Number((item as { price?: number }).price)
: undefined
}))
}))
},
deliveries: deliveryBlocks.value.map((block) => ({
stopId: block.stopId,
products: block.products.map((row) => ({
id: row.id!,
outboundQty: Number(row.outboundQty ?? 0),
outboundPrice: row.outboundPrice != null ? Number(row.outboundPrice) : undefined,
brandQtys: (row.brandQtyRows || [])
.filter((item) => Number(item.qty) > 0)
.map((item) => ({
brandId: item.brandId,
brandName: item.brandName,
qty: Number(item.qty),
unitPrice:
(item as { price?: number }).price != null
? Number((item as { price?: number }).price)
: undefined
}))
}))
})),
...(brandProducts.length ? { products: brandProducts } : {}),
freight: {
hasFreight: formData.hasFreight,
freightRemark: formData.freightRemark || undefined,
...(formData.hasFreight === 1
? {
distanceKm: formData.distanceKm ?? undefined,
freightType: formData.freightType,
freightPrice:
formData.freightType === 'by_weight'
? (freightCalc.freightPrice.value ?? undefined)
: undefined,
freightAmount:
freightCalc.calculatedFreight.value ||
freightCalc.freightAmount.value ||
undefined,
transportQty:
formData.freightType === 'by_weight'
? (freightCalc.transportQty.value ?? undefined)
: undefined
}
: {})
}
if (hasFeedbackAttachmentUploading()) {
ElMessage.warning('附件正在上传,请稍候再保存')
return
}
await planApi.archive(props.planId, body)
submitLoading.value = true
try {
await planApi.archive(props.planId, buildArchiveBody())
ElMessage.success(isAdjustMode.value ? '保存成功' : '归档成功')
tabsRef.value?.reload()
emit('success')
@@ -1409,8 +1618,8 @@
<style lang="scss">
.el-dialog.pl-plan-archive-dialog.dialog-form-layout {
width: calc(100vw - 48px) !important;
max-width: calc(100vw - 48px);
width: min(2000px, calc(100vw - 48px)) !important;
max-width: min(2000px, calc(100vw - 48px));
max-height: calc(100vh - 48px);
}
</style>
@@ -28,6 +28,7 @@
<PlPlanStopFeedbackPanel
v-if="showStopFeedback"
ref="feedbackPanelRef"
:stop-label="feedbackStopLabel"
:customer-name="meta.customerName"
:generate-dibang="generateDibang"
@@ -35,6 +36,11 @@
:driver-feedback="driverFeedback"
:site-feedback="siteFeedback"
:fallback-remark="fallbackRemark"
:editable-attachments="editableAttachments"
:driver-attachment-urls="driverAttachmentUrls"
:site-attachment-urls="siteAttachmentUrls"
@update:driver-attachment-urls="emit('update:driverAttachmentUrls', $event)"
@update:site-attachment-urls="emit('update:siteAttachmentUrls', $event)"
/>
<section class="pl-archive-segment-form">
@@ -169,8 +175,24 @@
driverFeedback?: TransportStopFeedback | null
siteFeedback?: TransportStopFeedback | null
fallbackRemark?: string | null
editableAttachments?: boolean
driverAttachmentUrls?: string
siteAttachmentUrls?: string
}>()
const emit = defineEmits<{
'update:driverAttachmentUrls': [value: string]
'update:siteAttachmentUrls': [value: string]
}>()
const feedbackPanelRef = ref<InstanceType<typeof PlPlanStopFeedbackPanel> | null>(null)
function hasAttachmentUploading() {
return Boolean(feedbackPanelRef.value?.hasAttachmentUploading?.())
}
defineExpose({ hasAttachmentUploading })
const dictStore = useDictStore()
const customerLabel = computed(() => (props.stopType === 'load' ? '装货客户' : '送货客户'))
@@ -2,7 +2,7 @@
<el-dialog
v-model="visibleProxy"
title="上传危化品证书"
width="min(960px, calc(100vw - 80px))"
width="min(2000px, calc(100vw - 80px))"
align-center
destroy-on-close
append-to-body
@@ -156,13 +156,16 @@
<div class="pl-plan-dibang-row">
<el-checkbox
:model-value="delivery.generateDibang === 1"
:disabled="isDibangLocked"
:disabled="isPlInternalCustomerName(delivery.customerName)"
@update:model-value="(checked) => handleDibangToggle(index, checked)"
>
生成地磅单({{ directionLabel(delivery.dibangDirection) }})
</el-checkbox>
<span v-if="isDibangLocked" class="pl-plan-dibang-row__hint">
装货客户为内部客户时默认勾选
<span
v-if="isPlInternalCustomerName(delivery.customerName)"
class="pl-plan-dibang-row__hint"
>
本段客户为内部客户时默认勾选
</span>
</div>
</el-form-item>
@@ -208,6 +211,7 @@
import PlPlanStopProductTable from '@/components/business/pl-plan-stop-product-table/index.vue'
import {
createEmptyDeliveryForm,
resolveStopDibangDefaults,
sumStopProductsPlanQty,
type PlanDeliveryForm
} from '@/utils/pl-plan-stop-form'
@@ -217,7 +221,6 @@
const props = withDefaults(
defineProps<{
modelValue: PlanDeliveryForm[]
loadCustomerName?: string
tabMode?: boolean
readonly?: boolean
compactProducts?: boolean
@@ -226,7 +229,6 @@
showSplitHint?: boolean
}>(),
{
loadCustomerName: '',
tabMode: true,
readonly: false,
compactProducts: true,
@@ -252,7 +254,6 @@
const activeIndex = ref(0)
const customerOptionsByIndex = ref<Record<number, CustomerOptionRow[]>>({})
const customerOptionsLoading = ref<Record<number, boolean>>({})
const isDibangLocked = computed(() => isPlInternalCustomerName(props.loadCustomerName))
watch(
() => props.modelValue.length,
@@ -304,7 +305,7 @@
const nextSeq = props.modelValue.length + 1
emit('update:modelValue', resequence([
...props.modelValue,
createEmptyDeliveryForm(nextSeq, props.loadCustomerName)
createEmptyDeliveryForm(nextSeq)
]))
activeIndex.value = props.modelValue.length
emit('add-delivery')
@@ -313,7 +314,7 @@
function removeDelivery(index: number) {
const next = props.modelValue.filter((_, i) => i !== index)
emit('update:modelValue', resequence(
next.length ? next : [createEmptyDeliveryForm(1, props.loadCustomerName)]
next.length ? next : [createEmptyDeliveryForm(1)]
))
if (activeIndex.value >= index && activeIndex.value > 0) {
activeIndex.value -= 1
@@ -474,10 +475,13 @@
(item) => String(item.id) === String(customerId)
)
const customerName = customer?.customerName || ''
const defaults = resolveStopDibangDefaults(customerName, 'delivery')
patchDelivery(index, {
customerId: String(customerId),
customerName,
contracts: [],
generateDibang: defaults.generateDibang,
dibangDirection: defaults.dibangDirection,
address: '',
lng: null,
lat: null,
@@ -511,7 +515,8 @@
function handleDibangToggle(index: number, checked: boolean) {
const delivery = props.modelValue[index]
const direction = isDibangLocked.value ? 'inbound' : delivery.dibangDirection || 'none'
const isInternal = isPlInternalCustomerName(delivery.customerName)
const direction = isInternal ? 'inbound' : delivery.dibangDirection || 'none'
patchDelivery(index, {
generateDibang: checked ? 1 : 0,
dibangDirection: checked ? direction : 'none'
@@ -22,7 +22,7 @@
>
<template #error>
<div class="pl-plan-document-attachment-cell__placeholder is-clickable is-common-thumb">
<el-icon :size="16" color="#10b981"><Picture /></el-icon>
<el-icon :size="18" color="#10b981"><Picture /></el-icon>
</div>
</template>
</el-image>
@@ -31,7 +31,7 @@
class="pl-plan-document-attachment-cell__placeholder is-clickable"
:class="{ 'is-common-thumb': usePlaceholderThumb }"
>
<el-icon :size="16" :color="usePlaceholderThumb ? '#10b981' : item.isPdf ? '#0284c7' : '#10b981'">
<el-icon :size="18" :color="usePlaceholderThumb ? '#10b981' : item.isPdf ? '#0284c7' : '#10b981'">
<Picture v-if="usePlaceholderThumb || item.isImage" />
<Document v-else />
</el-icon>
@@ -185,7 +185,7 @@
display: flex;
flex-direction: column;
align-items: center;
width: 56px;
width: 72px;
}
.pl-plan-document-attachment-cell__thumb {
@@ -193,11 +193,11 @@
display: flex;
align-items: center;
justify-content: center;
width: 56px;
height: 40px;
width: 72px;
height: 52px;
overflow: hidden;
border: 1px solid var(--border, #d9e8e2);
border-radius: 6px;
border-radius: 8px;
background: var(--table-head, #f8fafc);
}
@@ -237,24 +237,24 @@
.pl-plan-document-attachment-cell__ext {
margin-top: 2px;
font-size: 9px;
font-size: 10px;
line-height: 1;
color: #64748b;
}
.pl-plan-document-attachment-cell__download {
position: absolute;
right: 1px;
top: 1px;
right: 2px;
top: 2px;
z-index: 2;
width: 16px;
height: 16px;
width: 18px;
height: 18px;
border-radius: 50%;
background: #fff;
border: 1px solid #e2e8f0;
color: #1e293b;
cursor: pointer;
font-size: 10px;
font-size: 11px;
&:hover {
color: #1ca851;
@@ -268,10 +268,10 @@
right: 0;
bottom: 0;
left: 0;
padding: 1px 2px;
padding: 2px 3px;
background: rgba(15, 23, 42, 0.62);
color: #fff;
font-size: 10px;
font-size: 11px;
line-height: 1.2;
text-align: center;
word-break: keep-all;
@@ -98,7 +98,7 @@
<el-option
v-for="item in vehicleList"
:key="item.id"
:label="item.licensePlate"
:label="formatPlVehiclePlateOptionLabel(item.licensePlate, item.trailerNo)"
:value="item.id"
/>
</el-select>
@@ -226,7 +226,6 @@
<PlPlanDeliverySection
ref="deliverySectionRef"
v-model="deliveryForms"
:load-customer-name="loadForm.customerName"
tab-mode
compact-products
:qty-unit-label="planQtyUnitLabel"
@@ -365,7 +364,6 @@
mergePlanProductsFromLoadMirror,
sumStopProductsPlanQty,
syncDeliveriesProductsFromLoad,
syncDeliveryDibangFromLoad,
type PlanDeliveryForm,
type PlanLoadForm
} from '@/utils/pl-plan-stop-form'
@@ -377,6 +375,7 @@
initLineBrandMetaFromProduct,
prepareLineAliasAndBrandForSubmit
} from '@/utils/crm-product-brand'
import { formatPlVehiclePlateOptionLabel } from '@/utils/pl-display'
import {
buildMissingHazardCertReadyMessage,
enrichPlanProductsHazardFromCrm
@@ -948,7 +947,7 @@
stopFormsReady.value = false
if (data.load || data.deliveries?.length) {
loadForm.value = mapLoadFromApi(data.load)
deliveryForms.value = mapDeliveriesFromApi(data.deliveries, data.load?.customerName)
deliveryForms.value = mapDeliveriesFromApi(data.deliveries)
} else {
const legacy = mapLegacyPlanToStops(data)
loadForm.value = legacy.load
@@ -995,14 +994,6 @@
{ deep: true }
)
watch(
() => loadForm.value.customerName,
(loadCustomerName) => {
if (!stopFormsReady.value) return
deliveryForms.value = syncDeliveryDibangFromLoad(deliveryForms.value, loadCustomerName)
}
)
function openCustomerSelector(side: CustomerSide, deliveryIndex = 0) {
customerSelectorSide.value = side
customerSelectorDeliveryIndex.value = deliveryIndex
@@ -1691,7 +1682,10 @@
}
async function handleSubmit(mode: 'save' | 'saveAndArrange' | 'rearrange' = 'save') {
// 必须在 await validate 之前置位,避免连点并发多次 createFull
if (submitLoading.value) return
submitLoading.value = true
try {
const valid = await basicFormRef.value?.validate().catch(() => false)
if (!valid || !validateBusinessRules()) return
@@ -1707,11 +1701,10 @@
}
}
submitLoading.value = true
try {
mirrorPlanProductsFromLoad()
const commonPayload = buildPlanCommonPayload({ allowClearTransport: isEdit.value })
let planId = props.planId || ''
const wasCreate = !isEdit.value
if (isEdit.value) {
if (!props.planId) return
@@ -1741,6 +1734,15 @@
if ((mode === 'saveAndArrange' || mode === 'rearrange') && planId) {
const arranged = await performArrangeAfterSave(planId)
if (!arranged) {
// 计划已落库;关闭新建窗,避免停留在创建态再次点击又生成一张
if (wasCreate) {
ElMessage.warning(
'计划已创建成功,但未能安排运输。请至列表查看;若因危化证未就绪,请先完成【危化品证上传】后再安排。'
)
} else {
ElMessage.warning('计划已保存,但未能安排运输。请稍后在列表中重试安排。')
}
innerVisible.value = false
emit('success', { planId, arranged: false })
}
return
@@ -1771,7 +1773,7 @@
.pl-plan-transport-row--three {
display: grid;
grid-template-columns: max-content minmax(360px, 520px) minmax(280px, 1fr);
grid-template-columns: max-content minmax(240px, 340px) minmax(280px, 1fr);
gap: 12px 16px;
}
@@ -1782,7 +1784,7 @@
.pl-plan-transport-row__driver {
min-width: 0;
max-width: 520px;
max-width: 340px;
}
.pl-plan-transport-row__carrier {
@@ -1798,8 +1800,8 @@
}
.pl-plan-vehicle-with-library__select {
flex: 0 0 140px;
width: 140px;
flex: 0 0 220px;
width: 220px;
}
.pl-plan-carrier-with-library__select {
@@ -2149,12 +2151,22 @@
<style lang="scss">
.el-dialog.pl-plan-form-dialog.dialog-form-layout {
width: 100% !important;
max-width: calc(100vw - 48px);
width: min(2000px, calc(100vw - 32px)) !important;
max-width: min(2000px, calc(100vw - 32px));
height: var(--dialog-max-height, calc(100vh - 40px));
max-height: var(--dialog-max-height, calc(100vh - 40px));
}
.el-dialog.pl-plan-form-dialog.dialog-form-layout .el-dialog__body {
max-height: calc(100vh - 120px);
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
max-height: none;
}
.el-dialog.pl-plan-form-dialog.dialog-form-layout .pl-plan-form-body {
flex: 1;
min-height: 0;
}
</style>
@@ -109,7 +109,7 @@
>
生成地磅单({{ dibangDirectionLabel }})
</el-checkbox>
<span v-if="isInternal" class="pl-plan-dibang-row__hint">装货客户为内部客户时默认勾选</span>
<span v-if="isInternal" class="pl-plan-dibang-row__hint">本段客户为内部客户时默认勾选</span>
</div>
</el-form-item>
</div>
@@ -11,7 +11,10 @@
formatFeedbackTime(driverFeedback.feedbackTime)
}}</span>
</div>
<p v-if="!hasDriverFeedback" class="pl-plan-form-empty-hint pl-stop-feedback-ticket__empty">
<p
v-if="!hasDriverFeedback && !editableAttachments"
class="pl-plan-form-empty-hint pl-stop-feedback-ticket__empty"
>
暂无司机回传
</p>
<template v-else>
@@ -34,14 +37,17 @@
<div class="pl-stop-feedback-ticket__foot">
<span class="pl-stop-feedback-ticket__lab">附件</span>
<AttachmentUploadField
v-if="driverAttachmentCsv"
v-if="editableAttachments || driverAttachmentCsv"
ref="driverAttachRef"
class="pl-stop-feedback-ticket__attach"
:model-value="driverAttachmentCsv"
disabled
:class="{ 'pl-stop-feedback-ticket__attach--editable': editableAttachments }"
:model-value="driverAttachmentModel"
:disabled="!editableAttachments"
compact
folder="pl/transport/feedback"
accept="image/*,video/*,.pdf"
:limit="15"
@update:model-value="handleDriverAttachmentChange"
/>
<span v-else class="pl-plan-form-empty-hint">—</span>
</div>
@@ -57,7 +63,10 @@
formatFeedbackTime(siteFeedback.feedbackTime)
}}</span>
</div>
<p v-if="!hasSiteFeedback" class="pl-plan-form-empty-hint pl-stop-feedback-ticket__empty">
<p
v-if="!hasSiteFeedback && !editableAttachments"
class="pl-plan-form-empty-hint pl-stop-feedback-ticket__empty"
>
暂无现场回传
</p>
<template v-else>
@@ -111,14 +120,17 @@
<div class="pl-stop-feedback-ticket__foot">
<span class="pl-stop-feedback-ticket__lab">附件</span>
<AttachmentUploadField
v-if="siteAttachmentCsv"
v-if="editableAttachments || siteAttachmentCsv"
ref="siteAttachRef"
class="pl-stop-feedback-ticket__attach"
:model-value="siteAttachmentCsv"
disabled
:class="{ 'pl-stop-feedback-ticket__attach--editable': editableAttachments }"
:model-value="siteAttachmentModel"
:disabled="!editableAttachments"
compact
folder="pl/transport/site-feedback"
accept="image/*,video/*,.pdf"
:limit="15"
@update:model-value="handleSiteAttachmentChange"
/>
<span v-else class="pl-plan-form-empty-hint">—</span>
</div>
@@ -203,7 +215,7 @@
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { computed, ref } from 'vue'
import type { TransportStopFeedback } from '@/api/pl'
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
import { formatKgToTon } from '@/components/business/db/db-related-view'
@@ -223,6 +235,10 @@
fallbackRemark?: string
/** 无回传数据时也展示卡片空态 */
showWhenEmpty?: boolean
/** 归档弹窗等场景:允许编辑段级回传附件 */
editableAttachments?: boolean
driverAttachmentUrls?: string
siteAttachmentUrls?: string
}>(),
{
stopLabel: '',
@@ -232,10 +248,21 @@
driverFeedback: null,
siteFeedback: null,
fallbackRemark: '',
showWhenEmpty: true
showWhenEmpty: true,
editableAttachments: false,
driverAttachmentUrls: '',
siteAttachmentUrls: ''
}
)
const emit = defineEmits<{
'update:driverAttachmentUrls': [value: string]
'update:siteAttachmentUrls': [value: string]
}>()
const driverAttachRef = ref<InstanceType<typeof AttachmentUploadField> | null>(null)
const siteAttachRef = ref<InstanceType<typeof AttachmentUploadField> | null>(null)
const isInternalCustomer = computed(() => isPlInternalCustomerName(props.customerName))
const showSiteCard = computed(() => isInternalCustomer.value)
@@ -298,6 +325,44 @@
const driverAttachmentCsv = computed(() => (props.driverFeedback?.attachmentUrls || []).join(','))
const siteAttachmentCsv = computed(() => (props.siteFeedback?.attachmentUrls || []).join(','))
const driverAttachmentModel = computed({
get: () =>
props.editableAttachments ? props.driverAttachmentUrls || '' : driverAttachmentCsv.value,
set: (value: string) => {
if (props.editableAttachments) {
emit('update:driverAttachmentUrls', value)
}
}
})
const siteAttachmentModel = computed({
get: () =>
props.editableAttachments ? props.siteAttachmentUrls || '' : siteAttachmentCsv.value,
set: (value: string) => {
if (props.editableAttachments) {
emit('update:siteAttachmentUrls', value)
}
}
})
function handleDriverAttachmentChange(value: string) {
if (props.editableAttachments) {
emit('update:driverAttachmentUrls', value)
}
}
function handleSiteAttachmentChange(value: string) {
if (props.editableAttachments) {
emit('update:siteAttachmentUrls', value)
}
}
function hasAttachmentUploading() {
return Boolean(driverAttachRef.value?.hasUploading?.() || siteAttachRef.value?.hasUploading?.())
}
defineExpose({ hasAttachmentUploading })
function formatFeedbackTime(value?: string) {
return formatDateTime(value) || '—'
}
@@ -618,6 +683,21 @@
}
}
.pl-stop-feedback-ticket__attach--editable {
:deep(.upload-card) {
width: 88px;
height: 66px;
}
:deep(.attachment-item) {
width: 88px;
}
:deep(.attachment-preview) {
height: 66px;
}
}
@media (max-width: 1280px) {
.pl-stop-feedback-cards.is-cols-3 {
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -165,8 +165,8 @@
<style lang="scss">
.el-dialog.pl-plan-view-dialog.dialog-form-layout {
width: 100% !important;
max-width: calc(100vw - 48px);
width: min(2000px, calc(100vw - 48px)) !important;
max-width: min(2000px, calc(100vw - 48px));
height: var(--dialog-max-height, calc(100vh - 40px));
max-height: var(--dialog-max-height, calc(100vh - 40px));
}
@@ -1234,7 +1234,7 @@
const deliveryViews = computed(() => {
if (plan.value?.deliveries?.length) {
return mapDeliveriesFromApi(plan.value.deliveries, plan.value.load?.customerName).map(
return mapDeliveriesFromApi(plan.value.deliveries).map(
(row, index) => ({
id: plan.value?.deliveries?.[index]?.id,
...row,
@@ -1512,7 +1512,11 @@
money: hasFreight,
long: false
},
{ label: '是否开票', value: hasFreight ? displayHasInvoiceLabel.value : '—', long: false }
{ label: '是否开票', value: hasFreight ? displayHasInvoiceLabel.value : '—', long: false },
{
label: '运费备注',
value: hasFreight ? plan.value?.freightRemark?.trim() || '—' : '—'
}
]
})
@@ -378,14 +378,18 @@
useCommon().refresh()
return
}
// 强制重新加载:先将目标组件从 KeepAlive 缓存中排除
store.addKeepAliveExclude(item)
// 等待 Vue 处理 exclude 变更、清除缓存后再导航
nextTick(() => {
router.push({
// 切换到已打开的 Tab 时强制刷新。
// 说明:仅靠 keepAliveExclude 无效——① openTab 会立刻 removeKeepAliveExclude;
// ② KeepAlive 按组件 name 匹配,多数 views/**/index.vue 与路由 name 不一致。
router
.push({
path: item.path,
query: item.query as LocationQueryRaw
})
.then((failure) => {
if (!failure) {
useCommon().refresh()
}
})
}
+32 -7
View File
@@ -58,6 +58,18 @@ export function formatPlVehiclePlateDisplay(
return plate || trailer
}
/** 下拉选项:主车号(挂车号);无挂车号时仅主车号 */
export function formatPlVehiclePlateOptionLabel(
licensePlate?: string | null,
trailerNo?: string | null
) {
const plate = licensePlate?.trim() || ''
const trailer = trailerNo?.trim() || ''
if (!plate && !trailer) return '—'
if (plate && trailer) return `${plate}(${trailer})`
return plate || trailer
}
export function getPlCarrierStatusLabel(status: string) {
return status === '1' ? '合作中' : '已终止'
}
@@ -354,13 +366,13 @@ export const PL_PLAN_TYPE_TABS: { label: string; name: PlPlanTypeTab }[] = [
]
export const PL_PLAN_LIST_TABS: { label: string; name: PlPlanListTab }[] = [
...PL_PLAN_TYPE_TABS,
{ label: '待安排', name: 'pending_arrange' }
{ label: '待安排', name: 'pending_arrange' },
...PL_PLAN_TYPE_TABS
]
export const PL_PLAN_CERT_TABS: { label: string; name: PlPlanCertTab }[] = [
...PL_PLAN_TYPE_TABS,
{ label: '未上传证书', name: 'cert_incomplete' }
{ label: '未上传证书', name: 'cert_incomplete' },
...PL_PLAN_TYPE_TABS
]
export function plPlanTypeTabToFilter(tab: PlPlanTypeTab): string {
@@ -389,7 +401,11 @@ export function plPlanCertTabToFilters(tab: PlPlanCertTab): {
hazardCertReady?: string
} {
if (tab === 'cert_incomplete') {
return { planType: '', certUploadStatus: 'incomplete', hazardCertReady: '0' }
return {
planType: '',
certUploadStatus: 'incomplete',
hazardCertReady: '0'
}
}
return { planType: plPlanTypeTabToFilter(tab), hazardCertReady: '' }
}
@@ -410,6 +426,11 @@ export const PL_PLAN_FOLLOW_STATUS_OPTIONS = [
{ label: '已取消', value: 'cancelled' }
] as const
/** 运输计划/危化品证等列表:跟进状态默认勾选(不含已取消) */
export const PL_PLAN_DEFAULT_FOLLOW_STATUSES = PL_PLAN_FOLLOW_STATUS_OPTIONS.filter(
(opt) => opt.value !== 'cancelled'
).map((opt) => opt.value)
export function getPlPlanFollowStatusTagType(status?: string) {
const map: Record<string, string> = {
wait_notice: 'warning',
@@ -438,11 +459,15 @@ export function getPlPlanFollowStatusLabel(status?: string) {
}
export function getPlPlanArchiveStatusTagType(status?: string) {
return status === 'archived' ? 'info' : 'danger'
if (status === 'archived') return 'info'
if (status === 'draft') return 'warning'
return 'danger'
}
export function getPlPlanArchiveStatusLabel(status?: string) {
return status === 'archived' ? '已归档' : '未归档'
if (status === 'archived') return '已归档'
if (status === 'draft') return '已暂存'
return '未归档'
}
export function getPlPlanCompleteStatusLabel(status?: string) {
+41 -31
View File
@@ -111,12 +111,12 @@ export interface PlanDeliveryForm {
products: PlanStopProductFormRow[]
}
/** 地磅默认勾选以装货客户是否为内部客户(山峡/云栋)为准,与送货段客户无关。 */
/** 地磅默认勾选以本段客户是否为内部客户(山峡/云栋)为准。 */
export function resolveStopDibangDefaults(
loadCustomerName?: string | null,
customerName?: string | null,
stopType: 'load' | 'delivery' = 'load'
): { generateDibang: number; dibangDirection: string } {
if (!isPlInternalCustomerName(loadCustomerName)) {
if (!isPlInternalCustomerName(customerName)) {
return { generateDibang: 0, dibangDirection: 'none' }
}
if (stopType === 'load') {
@@ -125,16 +125,23 @@ export function resolveStopDibangDefaults(
return { generateDibang: 1, dibangDirection: 'inbound' }
}
export function syncDeliveryDibangFromLoad(
deliveries: PlanDeliveryForm[],
loadCustomerName?: string | null
): PlanDeliveryForm[] {
const defaults = resolveStopDibangDefaults(loadCustomerName, 'delivery')
return deliveries.map((row) => ({
...row,
generateDibang: defaults.generateDibang,
dibangDirection: defaults.dibangDirection
}))
function normalizeStopDibangFieldsFromApi(
customerName: string | null | undefined,
stopType: 'load' | 'delivery',
generateDibang?: number | null,
dibangDirection?: string | null
): { generateDibang: number; dibangDirection: string } {
const defaults = resolveStopDibangDefaults(customerName, stopType)
const gen = Number(generateDibang ?? defaults.generateDibang) === 1 ? 1 : 0
let direction = (dibangDirection || '').trim()
if (gen) {
if (direction !== 'outbound' && direction !== 'inbound') {
direction = defaults.dibangDirection
}
} else {
direction = 'none'
}
return { generateDibang: gen, dibangDirection: direction }
}
export function createStopProductsFromPlanProducts(
@@ -323,11 +330,7 @@ export function createEmptyLoadForm(): PlanLoadForm {
}
}
export function createEmptyDeliveryForm(
seq = 1,
loadCustomerName?: string | null
): PlanDeliveryForm {
const defaults = resolveStopDibangDefaults(loadCustomerName, 'delivery')
export function createEmptyDeliveryForm(seq = 1): PlanDeliveryForm {
return {
seq,
customerId: '',
@@ -338,8 +341,8 @@ export function createEmptyDeliveryForm(
deliveryTime: '',
contact: '',
notes: '',
generateDibang: defaults.generateDibang,
dibangDirection: defaults.dibangDirection,
generateDibang: 0,
dibangDirection: 'none',
contracts: [],
products: []
}
@@ -404,7 +407,12 @@ export function resolveDeliveryViewAddress(
export function mapLoadFromApi(load?: PlanLoad | null): PlanLoadForm {
if (!load) return createEmptyLoadForm()
const defaults = resolveStopDibangDefaults(load.customerName, 'load')
const dibang = normalizeStopDibangFieldsFromApi(
load.customerName,
'load',
load.generateDibang,
load.dibangDirection
)
return {
customerId: load.customerId || '',
customerName: load.customerName || '',
@@ -414,8 +422,8 @@ export function mapLoadFromApi(load?: PlanLoad | null): PlanLoadForm {
loadTime: (load.loadTime || '').slice(0, 10),
contact: load.contact || '',
notes: load.notes || '',
generateDibang: load.generateDibang ?? defaults.generateDibang,
dibangDirection: load.dibangDirection || defaults.dibangDirection,
generateDibang: dibang.generateDibang,
dibangDirection: dibang.dibangDirection,
contracts: (load.contracts || []).map((item) => ({
contractId: String(item.contractId || ''),
contractNo: item.contractNo
@@ -424,13 +432,15 @@ export function mapLoadFromApi(load?: PlanLoad | null): PlanLoadForm {
}
}
export function mapDeliveriesFromApi(
deliveries?: PlanDelivery[],
loadCustomerName?: string | null
): PlanDeliveryForm[] {
export function mapDeliveriesFromApi(deliveries?: PlanDelivery[]): PlanDeliveryForm[] {
if (!deliveries?.length) return [createEmptyDeliveryForm(1)]
return deliveries.map((row, index) => {
const defaults = resolveStopDibangDefaults(loadCustomerName, 'delivery')
const dibang = normalizeStopDibangFieldsFromApi(
row.customerName,
'delivery',
row.generateDibang,
row.dibangDirection
)
return {
seq: row.seq ?? index + 1,
customerId: row.customerId || '',
@@ -441,8 +451,8 @@ export function mapDeliveriesFromApi(
deliveryTime: (row.deliveryTime || '').slice(0, 10),
contact: row.contact || '',
notes: row.notes || '',
generateDibang: row.generateDibang ?? defaults.generateDibang,
dibangDirection: row.dibangDirection || defaults.dibangDirection,
generateDibang: dibang.generateDibang,
dibangDirection: dibang.dibangDirection,
contracts: (row.contracts || []).map((item) => ({
contractId: String(item.contractId || ''),
contractNo: item.contractNo
@@ -458,7 +468,7 @@ export function mapLegacyPlanToStops(plan: Plan): {
deliveries: PlanDeliveryForm[]
} {
const loadDefaults = resolveStopDibangDefaults(plan.supplierName, 'load')
const deliveryDefaults = resolveStopDibangDefaults(plan.supplierName, 'delivery')
const deliveryDefaults = resolveStopDibangDefaults(plan.customerName, 'delivery')
const stopProducts = createStopProductsFromPlanProducts(
(plan.products || []).map((item, index) => ({
id: item.id,
@@ -484,6 +484,7 @@
<DbInventoryRelatedViewDialog
v-model:visible="relatedModalOpen"
:loading="loadingRelated"
:inventory="viewingRecord"
:data="relatedData"
>
<template v-if="viewingRecord" #hero-actions>
+1
View File
@@ -447,6 +447,7 @@
<DbPlanRelatedViewDialog
v-model:visible="relatedModalOpen"
:loading="loadingRelated"
:plan="viewingRecord"
:data="relatedData"
>
<template v-if="viewingRecord" #hero-actions>
+3 -1
View File
@@ -684,7 +684,9 @@
relatedData.value = await weighingApi.getRelated(viewingRecord.value.id)
}
const relatedViewSections = computed(() => buildWeighingRelatedSections(relatedData.value))
const relatedViewSections = computed(() =>
buildWeighingRelatedSections(relatedData.value, viewingRecord.value)
)
const formRef = ref()
const formData = reactive<
+3 -32
View File
@@ -54,6 +54,7 @@
<el-form-item label="归档状态">
<el-select v-model="searchForm.archiveStatus" placeholder="全部" clearable>
<el-option label="未归档" value="unarchived" />
<el-option label="已暂存" value="draft" />
<el-option label="已归档" value="archived" />
</el-select>
</el-form-item>
@@ -222,7 +223,7 @@
<el-table-column
v-if="isColumnVisible('documentAttachments')"
label="单据附件"
min-width="220"
min-width="280"
align="left"
header-align="left"
>
@@ -611,10 +612,6 @@ import {
Search
} from '@element-plus/icons-vue'
import { planApi, type Plan } from '@/api/pl'
import {
buildMissingHazardCertReadyMessage,
enrichPlanProductsHazardFromCrm
} from '@/composables/usePlToxicProductCertCheck'
import { pickBxData } from '@/utils/http/bx'
import PlPlanContractCell from '@/components/business/pl-plan-contract-cell/index.vue'
import PlPlanArchiveDialog from '@/components/business/pl-plan-archive-dialog/index.vue'
@@ -967,33 +964,7 @@ function archiveButtonLabel(row: Plan) {
}
async function handleArchive(row: Plan) {
if (row.archiveStatus === 'archived') {
archivePlanId.value = row.id
archiveDialogVisible.value = true
return
}
try {
const res = await planApi.get(row.id)
const data = pickBxData<Plan>(res)
if (!data?.id) {
throw new Error('运输计划数据无效')
}
const rawProducts = Array.isArray(data.products) ? data.products : []
const enrichedProducts = await enrichPlanProductsHazardFromCrm(rawProducts)
const certMessage = buildMissingHazardCertReadyMessage(data, enrichedProducts)
if (certMessage) {
await ElMessageBox.alert(`${certMessage},请至【危化品证上传】页面操作。`, '无法归档', {
type: 'warning'
})
return
}
} catch (error) {
const message = error instanceof Error ? error.message : '加载运输计划失败'
ElMessage.error(message.includes('加载') ? message : `加载运输计划失败:${message}`)
return
}
// 打开归档弹窗:已归档走调整;未归档/已暂存可直接打开(证书齐备仅在「确认归档」时校验,以便支持暂存)
archivePlanId.value = row.id
archiveDialogVisible.value = true
}
+28 -16
View File
@@ -21,7 +21,12 @@
/>
</el-form-item>
<el-form-item label="跟进状态">
<el-select v-model="searchForm.followStatus" placeholder="全部" clearable>
<el-select
v-model="searchForm.followStatus"
placeholder="全部"
clearable
multiple
>
<el-option
v-for="opt in PL_PLAN_FOLLOW_STATUS_OPTIONS"
:key="opt.value"
@@ -543,6 +548,7 @@
getPlPlanFollowStatusLabel,
getPlPlanFollowStatusTagType,
normalizePlPersonnelSummaryDisplay,
PL_PLAN_DEFAULT_FOLLOW_STATUSES,
PL_PLAN_CERT_TABS,
PL_PLAN_FOLLOW_STATUS_OPTIONS,
PL_PLAN_HAZARD_CERT_READY_FILTER_OPTIONS,
@@ -644,7 +650,7 @@
q: keyword || undefined,
planNo: keyword ? undefined : searchForm.planNo || undefined,
planType: searchForm.planType || undefined,
followStatus: searchForm.followStatus || undefined,
followStatus: formatFollowStatusParam(searchForm.followStatus),
customerName: keyword ? undefined : searchForm.customerName || undefined,
planDateFrom: dateRange.value?.[0] || undefined,
planDateTo: dateRange.value?.[1] || undefined,
@@ -668,17 +674,28 @@
)
const dateRange = ref<string[]>([])
const quickSearch = ref('')
const activePlanTypeTab = ref<PlPlanCertTab>('all')
const activePlanTypeTab = ref<PlPlanCertTab>('cert_incomplete')
const searchForm = reactive({
planNo: '',
planType: '',
followStatus: '',
followStatus: [...PL_PLAN_DEFAULT_FOLLOW_STATUSES] as string[],
customerName: '',
certUploadStatus: '' as string,
hazardCertReady: '' as string
certUploadStatus: 'incomplete' as string,
hazardCertReady: '0' as string
})
function formatFollowStatusParam(statuses: string[]) {
return statuses.length ? statuses.join(',') : undefined
}
function applyPlanTypeTabFilters(tab: PlPlanCertTab) {
const filters = plPlanCertTabToFilters(tab)
searchForm.planType = filters.planType
searchForm.certUploadStatus = filters.certUploadStatus || ''
searchForm.hazardCertReady = filters.hazardCertReady ?? ''
}
function getPlanTypeLabel(type: string) {
const map: Record<string, string> = { direct: '直销单', inbound: '入库单', outbound: '出库单' }
return map[type] || type
@@ -692,7 +709,7 @@
q: keyword || undefined,
planNo: keyword ? undefined : searchForm.planNo || undefined,
planType: searchForm.planType || undefined,
followStatus: searchForm.followStatus || undefined,
followStatus: formatFollowStatusParam(searchForm.followStatus),
customerName: keyword ? undefined : searchForm.customerName || undefined,
planDateFrom: dateRange.value?.[0] || undefined,
planDateTo: dateRange.value?.[1] || undefined,
@@ -717,22 +734,17 @@
}
function handlePlanTypeTabChange(tab: PlPlanCertTab | string) {
const filters = plPlanCertTabToFilters(tab as PlPlanCertTab)
searchForm.planType = filters.planType
searchForm.certUploadStatus = filters.certUploadStatus || ''
searchForm.hazardCertReady = filters.hazardCertReady ?? ''
applyPlanTypeTabFilters(tab as PlPlanCertTab)
pagination.page = 1
fetchData()
}
function handleReset() {
activePlanTypeTab.value = 'all'
activePlanTypeTab.value = 'cert_incomplete'
searchForm.planNo = ''
searchForm.planType = ''
searchForm.followStatus = ''
searchForm.followStatus = [...PL_PLAN_DEFAULT_FOLLOW_STATUSES]
searchForm.customerName = ''
searchForm.certUploadStatus = ''
searchForm.hazardCertReady = ''
applyPlanTypeTabFilters('cert_incomplete')
quickSearch.value = ''
resetDateShortcut()
pagination.page = 1
@@ -345,7 +345,7 @@
v-model="supplementVisible"
class="dialog-form-layout pl-contract-supplement-dialog"
modal-class="order-module-dialog-mask"
width="960px"
width="min(2000px, calc(100vw - 48px))"
align-center
destroy-on-close
:close-on-click-modal="false"
+44 -35
View File
@@ -25,6 +25,7 @@
v-model="searchForm.followStatus"
placeholder="全部"
clearable
multiple
:disabled="activePlanTypeTab === 'pending_arrange'"
>
<el-option
@@ -291,10 +292,10 @@
</el-table-column>
<el-table-column
v-if="isColumnVisible('arrangeCopy')"
label="复制"
min-width="168"
align="left"
header-align="left"
label="链接复制"
min-width="88"
align="center"
header-align="center"
>
<template #default="{ row }">
<div
@@ -305,35 +306,38 @@
"
class="pl-plan-arrange-copy-cell"
>
<el-button
v-if="row.plan.canCopyToDriver"
class="btn-ghost"
:loading="
arrangeCopyLoadingId === row.plan.id && arrangeCopyLoadingAction === 'driver'
"
@click.stop="handleListCopyDriver(row.plan)"
>
<el-icon><CopyDocument /></el-icon>复制给司机
</el-button>
<el-button
v-if="row.plan.canCopyToSite"
class="btn-ghost"
:loading="
arrangeCopyLoadingId === row.plan.id && arrangeCopyLoadingAction === 'site'
"
@click.stop="handleListCopySite(row.plan)"
>
<el-icon><CopyDocument /></el-icon>复制给现场
</el-button>
<el-button
v-if="row.plan.canCopyPoundQrcode"
class="btn-ghost"
title="复制磅单二维码"
:loading="
arrangeCopyLoadingId === row.plan.id && arrangeCopyLoadingAction === 'qrcode'
"
@click.stop="handleListCopyPoundQrcode(row.plan)"
>
<el-icon><CopyDocument /></el-icon>复制磅单二维码
磅单码
</el-button>
<el-button
v-if="row.plan.canCopyToDriver"
class="btn-ghost"
title="复制给司机"
:loading="
arrangeCopyLoadingId === row.plan.id && arrangeCopyLoadingAction === 'driver'
"
@click.stop="handleListCopyDriver(row.plan)"
>
司机
</el-button>
<el-button
v-if="row.plan.canCopyToSite"
class="btn-ghost"
title="复制给现场"
:loading="
arrangeCopyLoadingId === row.plan.id && arrangeCopyLoadingAction === 'site'
"
@click.stop="handleListCopySite(row.plan)"
>
现场
</el-button>
</div>
<span v-else>—</span>
@@ -835,6 +839,7 @@
getPlPlanFollowStatusLabel,
getPlPlanFollowStatusTagType,
normalizePlPersonnelSummaryDisplay,
PL_PLAN_DEFAULT_FOLLOW_STATUSES,
PL_PLAN_FOLLOW_STATUS_OPTIONS,
PL_PLAN_LIST_TABS,
plPlanListTabToFilters,
@@ -885,7 +890,7 @@
{ prop: 'licensePlate', label: '车牌号' },
{ prop: 'personnelSummary', label: '人员' },
{ prop: 'followUserName', label: '跟进人', defaultVisible: false },
{ prop: 'arrangeCopy', label: '复制' },
{ prop: 'arrangeCopy', label: '链接复制' },
{ prop: 'stopKind', label: '段次' },
{ prop: 'stopCustomer', label: '客户' },
{ prop: 'stopAddressTime', label: '地址 / 时间' },
@@ -1079,7 +1084,7 @@
q: keyword || undefined,
planNo: keyword ? undefined : searchForm.planNo || undefined,
planType: tabFilters.planType || undefined,
followStatus: tabFilters.followStatus || searchForm.followStatus || undefined,
followStatus: tabFilters.followStatus || formatFollowStatusParam(searchForm.followStatus),
customerName: keyword ? undefined : searchForm.customerName || undefined,
productName: keyword ? undefined : searchForm.productName || undefined,
licensePlate: keyword ? undefined : searchForm.licensePlate || undefined,
@@ -1182,12 +1187,12 @@
)
const dateRange = ref<string[]>([])
const quickSearch = ref('')
const activePlanTypeTab = ref<PlPlanListTab>('all')
const activePlanTypeTab = ref<PlPlanListTab>('pending_arrange')
const searchForm = reactive({
planNo: '',
planType: '',
followStatus: '',
followStatus: ['pending_arrange'] as string[],
customerName: '',
productName: '',
licensePlate: ''
@@ -1199,6 +1204,10 @@
total: 0
})
function formatFollowStatusParam(statuses: string[]) {
return statuses.length ? statuses.join(',') : undefined
}
function getPlanTypeLabel(type?: string | null) {
if (!type) return '—'
const map: Record<string, string> = { direct: '直销单', inbound: '入库单', outbound: '出库单' }
@@ -1214,7 +1223,7 @@
q: keyword || undefined,
planNo: keyword ? undefined : searchForm.planNo || undefined,
planType: tabFilters.planType || undefined,
followStatus: tabFilters.followStatus || searchForm.followStatus || undefined,
followStatus: tabFilters.followStatus || formatFollowStatusParam(searchForm.followStatus),
customerName: keyword ? undefined : searchForm.customerName || undefined,
productName: keyword ? undefined : searchForm.productName || undefined,
licensePlate: keyword ? undefined : searchForm.licensePlate || undefined,
@@ -1243,19 +1252,19 @@
const filters = plPlanListTabToFilters(nextTab)
searchForm.planType = filters.planType
if (nextTab === 'pending_arrange') {
searchForm.followStatus = 'pending_arrange'
searchForm.followStatus = ['pending_arrange']
} else if (prevTab === 'pending_arrange') {
searchForm.followStatus = ''
searchForm.followStatus = [...PL_PLAN_DEFAULT_FOLLOW_STATUSES]
}
pagination.page = 1
fetchData()
}
function handleReset() {
activePlanTypeTab.value = 'all'
activePlanTypeTab.value = 'pending_arrange'
searchForm.planNo = ''
searchForm.planType = ''
searchForm.followStatus = ''
searchForm.followStatus = ['pending_arrange']
searchForm.customerName = ''
searchForm.productName = ''
searchForm.licensePlate = ''
@@ -1660,7 +1669,7 @@
.pl-plan-arrange-copy-cell {
display: flex;
flex-direction: column;
align-items: flex-start;
align-items: center;
gap: 8px;
width: 100%;
}
File diff suppressed because it is too large. Load diff