This commit is contained in:
zlwu committed 2026-08-09 14:51:41 +08:00
1 parent ca6aca2b14
commit f70dc26206
63 files changed
+589912 -9127

No files matched your search

+1 -1
View File
@@ -1 +1 @@
99535
31383
+4
View File
@@ -80,6 +80,9 @@ def register_contract_routes(router):
async def contract_list(
pageNum: int = Query(1, ge=1),
pageSize: int = Query(10, ge=1, le=100),
keyword: Optional[str] = Query(
None, description="即时检索:合同编号/合同产品名称/产品拼音首字母"
),
contractNo: Optional[str] = None,
contractName: Optional[str] = None,
customerName: Optional[str] = None,
@@ -110,6 +113,7 @@ def register_contract_routes(router):
query = ContractListQuery(
pageNum=pageNum,
pageSize=pageSize,
keyword=keyword,
contractNo=contractNo,
contractName=contractName,
customerName=customerName,
+132 -11
View File
@@ -79,15 +79,18 @@ from app.services.pl_plan_service import (
collect_hazard_product_ids,
determine_plan_type,
fetch_hazard_flags_map,
load_plan_contracts_grouped,
plan_has_hazard_product_exists,
plan_has_incomplete_hazard_cert_exists,
record_plan_change,
replace_plan_contracts,
resolve_hazard_flags_from_crm,
set_hazard_cert_ready,
sync_transport_prefill_for_plan,
update_plan_product_certs,
validate_create_full,
validate_hazard_cert_ready_for_transport,
validate_plan_party_contracts,
)
router = APIRouter(prefix="/plan", tags=["运输计划-计划管理"])
@@ -401,6 +404,7 @@ def list_plans(
tenant_no=tenant_no,
plan_product_ids=[p.id for p in all_products],
)
contracts_by_plan = load_plan_contracts_grouped(db, tenant_no, plan_ids)
result_list: list[PlanWithProducts] = []
for plan in plans:
@@ -435,6 +439,9 @@ def list_plans(
plan_item = PlanWithProducts.model_validate(plan)
plan_item.products = enriched_products
supplier_contracts, demander_contracts = contracts_by_plan.get(plan.id, ([], []))
plan_item.supplier_contracts = supplier_contracts
plan_item.demander_contracts = demander_contracts
if not (plan_item.personnel_summary or "").strip():
snapshot = plan_item.resource_snapshot
if snapshot and snapshot.personnel_summary:
@@ -452,12 +459,15 @@ def count_plans_by_contract(
db: Session = Depends(get_db),
user: DbUserContext = Depends(get_db_current_user),
) -> dict:
from app.models.pl_models import PlPlanContract
tenant_no = get_tenant_no(db, user.to_tenant_user_dict())
ids = [item.strip() for item in contract_ids.split(",") if item.strip()]
if not ids:
return {"counts": {}}
rows = (
# 旧单:主表 contract_id;新单:pl_plan_contract 分侧关联(按计划去重计数)
legacy_rows = (
db.query(PlPlan.contract_id, func.count(PlPlan.id))
.filter(
PlPlan.tenant_no == tenant_no,
@@ -465,8 +475,31 @@ def count_plans_by_contract(
PlPlan.contract_id.in_(ids),
)
)
rows = apply_pl_scope(rows, PlPlan, user, db, tenant_no).group_by(PlPlan.contract_id).all()
return {"counts": {contract_id: count for contract_id, count in rows}}
legacy_rows = apply_pl_scope(legacy_rows, PlPlan, user, db, tenant_no).group_by(PlPlan.contract_id).all()
counts: dict[str, int] = {contract_id: count for contract_id, count in legacy_rows}
link_q = (
db.query(PlPlanContract.contract_id, PlPlan.id)
.join(PlPlan, PlPlan.id == PlPlanContract.plan_id)
.filter(
PlPlanContract.tenant_no == tenant_no,
PlPlanContract.del_flag == 0,
PlPlanContract.contract_id.in_(ids),
PlPlan.tenant_no == tenant_no,
PlPlan.del_flag == 0,
)
)
link_q = apply_pl_scope(link_q, PlPlan, user, db, tenant_no)
seen: set[tuple[str, str]] = set()
for contract_id, plan_id in link_q.all():
key = (contract_id, plan_id)
if key in seen:
continue
seen.add(key)
# 若旧主表已计过同一计划+合同,不再重复加(新单主表 contract_id 应为空)
counts[contract_id] = counts.get(contract_id, 0) + 1
return {"counts": counts}
# =============================================================================
@@ -564,15 +597,26 @@ def create_plan_full(
db: Session = Depends(get_db),
user: DbUserContext = Depends(get_db_current_user),
) -> PlanWithProducts:
"""创建运输计划(完整表单:合同产品 + 可选预选车辆,不自动安排运输)"""
"""创建运输计划(完整表单:供方/需方 + 产品库产品 + 可选预选车辆,不自动安排运输)"""
validate_create_full(payload)
tenant_no = get_tenant_no(db, user.to_tenant_user_dict())
assert_contract_selectable_for_plan(db, payload.contract_id, tenant_no)
supplier_contracts, demander_contracts = validate_plan_party_contracts(
db,
tenant_no,
supplier_id=payload.supplier_id,
supplier_name=payload.supplier_name,
customer_id=payload.customer_id,
customer_name=payload.customer_name,
supplier_contracts=payload.supplier_contracts,
demander_contracts=payload.demander_contracts,
require_products=payload.products,
)
plan_no = _generate_plan_no(db)
# 单据类型由前端显式选择;未选则存空,不再自动推断为直销单
plan_type = (payload.plan_type or "").strip()
has_vehicle = bool(payload.transport and payload.transport.vehicle_id)
demander_name = (payload.customer_name or "").strip() or None
plan = PlPlan(
id=generate_uuid(),
@@ -586,12 +630,12 @@ def create_plan_full(
transport_status="pending",
archive_status="unarchived",
complete_status="no",
contract_id=payload.contract_id,
contract_no=payload.contract_no,
contract_id=None,
contract_no=None,
supplier_id=payload.supplier_id,
supplier_name=payload.supplier_name,
destination_id=payload.destination_id,
destination_name=payload.destination_name,
destination_id=payload.customer_id or payload.destination_id,
destination_name=demander_name or payload.destination_name,
customer_id=payload.customer_id,
customer_name=payload.customer_name,
contact_name=payload.contact_name,
@@ -645,6 +689,16 @@ def create_plan_full(
db.add(pp)
plan_products.append(pp)
replace_plan_contracts(
db,
tenant_no=tenant_no,
plan_id=plan.id,
supplier_contracts=supplier_contracts,
demander_contracts=demander_contracts,
user_id=user.id,
dept_id=user.dept_id,
)
if has_vehicle and payload.transport:
apply_vehicle_prefill_to_plan(
db,
@@ -661,6 +715,8 @@ def create_plan_full(
result = PlanWithProducts.model_validate(plan)
result.products = plan_products
result.supplier_contracts = supplier_contracts
result.demander_contracts = demander_contracts
return result
@@ -839,6 +895,11 @@ def get_plan(
result = PlanWithProducts.model_validate(plan)
result.products = enriched_products
supplier_contracts, demander_contracts = load_plan_contracts_grouped(
db, tenant_no, [id]
).get(id, ([], []))
result.supplier_contracts = supplier_contracts
result.demander_contracts = demander_contracts
return result
@@ -862,11 +923,68 @@ def update_plan(
# 更新主表字段(跟进状态仅由业务动作接口维护,忽略客户端写入)
update_data = payload.model_dump(
exclude_unset=True, exclude={"products", "transport", "follow_status"}
exclude_unset=True,
exclude={"products", "transport", "follow_status", "supplier_contracts", "demander_contracts"},
)
for key, value in update_data.items():
setattr(plan, key, value)
# 新模型:单一合同字段不再作为写入源
if "supplier_contracts" in payload.model_fields_set or "demander_contracts" in payload.model_fields_set:
plan.contract_id = None
plan.contract_no = None
if payload.customer_id is not None or payload.customer_name is not None:
plan.destination_id = plan.customer_id
plan.destination_name = plan.customer_name
supplier_id = plan.supplier_id
supplier_name = plan.supplier_name
customer_id = plan.customer_id
customer_name = plan.customer_name
supplier_contracts_in = (
payload.supplier_contracts
if "supplier_contracts" in payload.model_fields_set
else load_plan_contracts_grouped(db, tenant_no, [id]).get(id, ([], []))[0]
)
demander_contracts_in = (
payload.demander_contracts
if "demander_contracts" in payload.model_fields_set
else load_plan_contracts_grouped(db, tenant_no, [id]).get(id, ([], []))[1]
)
# 编辑保存若带了产品或任一侧合同字段,按新规则完整校验供方/需方
if (
payload.products is not None
or "supplier_contracts" in payload.model_fields_set
or "demander_contracts" in payload.model_fields_set
or payload.supplier_id is not None
or payload.customer_id is not None
):
supplier_contracts, demander_contracts = validate_plan_party_contracts(
db,
tenant_no,
supplier_id=supplier_id,
supplier_name=supplier_name,
customer_id=customer_id,
customer_name=customer_name,
supplier_contracts=supplier_contracts_in,
demander_contracts=demander_contracts_in,
require_products=payload.products if payload.products is not None else None,
)
replace_plan_contracts(
db,
tenant_no=tenant_no,
plan_id=id,
supplier_contracts=supplier_contracts,
demander_contracts=demander_contracts,
user_id=user.id,
dept_id=user.dept_id,
)
else:
supplier_contracts, demander_contracts = load_plan_contracts_grouped(db, tenant_no, [id]).get(
id, ([], [])
)
plan_type = payload.plan_type or plan.plan_type
# 更新产品明细
@@ -968,7 +1086,10 @@ def update_plan(
plan.update_by = user.id
db.commit()
db.refresh(plan)
return plan
result = PlanRead.model_validate(plan)
result.supplier_contracts = supplier_contracts
result.demander_contracts = demander_contracts
return result
@router.patch("/{id}/product-certs", response_model=PlanWithProducts)
+44 -5
View File
@@ -9,7 +9,7 @@ from datetime import date, datetime, timedelta
from decimal import Decimal, ROUND_HALF_UP
from typing import Any, Dict, List, Optional, Tuple
from sqlalchemy import func, or_
from sqlalchemy import and_, func, or_
from sqlalchemy.orm import Query, Session
from app.core.delete_guard import assert_row_deletable_by_creator
@@ -38,8 +38,10 @@ from app.models.crm_models import (
CrmContract,
CrmContractApproval,
CrmContractChange,
CrmContractProduct,
CrmContractTemplate,
CrmOpportunity,
CrmProduct,
CrmQuote,
)
from app.models.models import SysUser
@@ -259,6 +261,43 @@ def _build_contract_filters(
"""Java: buildQueryWrapper"""
q = q.filter(CrmContract.tenant_no == tenant_no, CrmContract.del_flag == 0)
keyword = (_get_field(filters, "keyword") or "").strip()
if keyword:
like = f"%{keyword}%"
pinyin_like = f"%{keyword.lower()}%"
product_match = (
db.query(CrmContractProduct.id)
.outerjoin(
CrmProduct,
and_(
CrmProduct.id == CrmContractProduct.product_id,
CrmProduct.del_flag == 0,
CrmProduct.tenant_no == tenant_no,
),
)
.filter(
CrmContractProduct.contract_id == CrmContract.id,
CrmContractProduct.tenant_no == tenant_no,
CrmContractProduct.del_flag == 0,
or_(
CrmContractProduct.product_name.like(like),
func.lower(func.coalesce(CrmProduct.product_name, "")).like(
f"%{keyword.lower()}%"
),
func.lower(func.coalesce(CrmProduct.name_pinyin_abbr, "")).like(
pinyin_like
),
),
)
.exists()
)
q = q.filter(
or_(
CrmContract.contract_no.like(like),
product_match,
)
)
contract_no = (_get_field(filters, "contract_no", "contractNo") or "").strip()
contract_name = (_get_field(filters, "contract_name", "contractName") or "").strip()
customer_name = (_get_field(filters, "customer_name", "customerName") or "").strip()
@@ -269,12 +308,12 @@ def _build_contract_filters(
and customer_name
and contract_no == contract_name == customer_name
):
keyword = contract_no
legacy_keyword = contract_no
q = q.filter(
or_(
CrmContract.contract_no.like(f"%{keyword}%"),
CrmContract.contract_name.like(f"%{keyword}%"),
CrmContract.customer_name.like(f"%{keyword}%"),
CrmContract.contract_no.like(f"%{legacy_keyword}%"),
CrmContract.contract_name.like(f"%{legacy_keyword}%"),
CrmContract.customer_name.like(f"%{legacy_keyword}%"),
)
)
else:
+2
View File
@@ -36,6 +36,7 @@ from app.models.pl_models import (
PlVehicleDriver,
PlVehiclePersonnel,
PlPlan,
PlPlanContract,
PlPlanProduct,
PlPlanProductBrandQty,
PlPlanChange,
@@ -100,6 +101,7 @@ __all__ = [
"PlVehicleDriver",
"PlVehiclePersonnel",
"PlPlan",
"PlPlanContract",
"PlPlanProduct",
"PlPlanProductBrandQty",
"PlPlanChange",
+22
View File
@@ -345,6 +345,28 @@ class PlPlan(Base):
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
class PlPlanContract(Base):
"""运输计划-合同关联(分侧多选) pl_plan_contract"""
__tablename__ = "pl_plan_contract"
id = Column(String(64), primary_key=True, comment="主键ID")
plan_id = Column(String(64), nullable=False, comment="运输计划ID")
side = Column(String(20), nullable=False, comment="supplier-供方 demander-需方")
contract_id = Column(String(64), nullable=False, comment="CRM合同ID")
contract_no = Column(String(50), nullable=True, comment="合同编号快照")
tenant_no = Column(String(64), nullable=False, default="shanxia2.0", comment="租户编号")
order_num = Column(Integer, nullable=True, comment="排序号")
remark = Column(String(512), nullable=True, comment="备注")
create_by = Column(String(64), nullable=True, comment="创建人id")
create_dept_id = Column(String(64), nullable=False, default="", comment="创建人部门ID")
create_time = Column(DateTime, nullable=False, default=datetime.now, comment="创建时间")
update_by = Column(String(64), nullable=True, comment="更新人id")
update_time = Column(DateTime, nullable=False, default=datetime.now, onupdate=datetime.now, comment="更新时间")
del_flag = Column(SmallInteger, nullable=False, default=0, comment="删除标记:0-正常 1-已删除")
class PlPlanProduct(Base):
"""计划产品明细表 pl_plan_product"""
+2
View File
@@ -59,6 +59,8 @@ class ContractListQuery(BaseModel):
pageNum: int = Field(default=1, ge=1)
pageSize: int = Field(default=10, ge=1, le=100)
# 即时检索:合同编号 / 合同产品名称 / 产品拼音首字母
keyword: Optional[str] = None
contractNo: Optional[str] = None
contractName: Optional[str] = None
customerName: Optional[str] = None
+2
View File
@@ -39,6 +39,7 @@ from app.schemas.pl.plan import (
PlanCreate,
PlanUpdate,
PlanRead,
PlanContractLink,
PlanWithProducts,
PlanListQuery,
PlanListResponse,
@@ -142,6 +143,7 @@ __all__ = [
"PlanCreate",
"PlanUpdate",
"PlanRead",
"PlanContractLink",
"PlanWithProducts",
"PlanListQuery",
"PlanListResponse",
+25 -1
View File
@@ -152,12 +152,24 @@ class PlanBase(BaseModel):
remark: Optional[str] = None
class PlanContractLink(BaseModel):
contract_id: str = Field(..., alias="contractId", description="CRM合同ID")
contract_no: Optional[str] = Field(default=None, max_length=50, alias="contractNo", description="合同编号")
model_config = {"populate_by_name": True}
class PlanCreate(PlanBase):
create_date: Optional[date] = Field(
default=None, alias="createDate", description="创建日期;缺省则服务端用当天"
)
plan_date: Optional[date] = Field(default=None, alias="planDate", description="计划日期(非必填)")
products: Optional[list[PlanProductCreate]] = Field(default=None, description="产品明细列表")
supplier_contracts: Optional[list[PlanContractLink]] = Field(
default=None, alias="supplierContracts", description="供方合同列表"
)
demander_contracts: Optional[list[PlanContractLink]] = Field(
default=None, alias="demanderContracts", description="需方合同列表"
)
model_config = {"populate_by_name": True}
@@ -214,6 +226,12 @@ class PlanUpdate(BaseModel):
follow_user_name: Optional[str] = Field(default=None, alias="followUserName")
remark: Optional[str] = None
products: Optional[list[PlanProductCreate]] = None
supplier_contracts: Optional[list[PlanContractLink]] = Field(
default=None, alias="supplierContracts", description="供方合同列表"
)
demander_contracts: Optional[list[PlanContractLink]] = Field(
default=None, alias="demanderContracts", description="需方合同列表"
)
transport: Optional[PlanTransportCreateBlock] = Field(default=None, description="运输预选/更新(有车牌时同步车辆与运费)")
model_config = {"populate_by_name": True}
@@ -248,6 +266,12 @@ class PlanRead(PlanBase, PlanResourceSnapshotMixin):
update_by: Optional[str] = Field(default=None, alias="updateBy")
update_time: datetime = Field(alias="updateTime")
del_flag: int = Field(default=0, alias="delFlag")
supplier_contracts: list[PlanContractLink] = Field(
default_factory=list, alias="supplierContracts", description="供方合同列表"
)
demander_contracts: list[PlanContractLink] = Field(
default_factory=list, alias="demanderContracts", description="需方合同列表"
)
model_config = {"from_attributes": True, "populate_by_name": True}
@@ -291,7 +315,7 @@ class CreateFromContractRequest(BaseModel):
class PlanCreateFull(PlanCreate):
contract_id: str = Field(..., alias="contractId", description="CRM合同ID")
contract_id: Optional[str] = Field(default=None, alias="contractId", description="旧字段:单一合同ID,已废弃为唯一源")
transport: Optional[PlanTransportCreateBlock] = Field(default=None, description="运输安排(有车牌时创建运输)")
model_config = {"populate_by_name": True}
@@ -0,0 +1,13 @@
"""运输计划:内置山峡/云栋客户判定(合同可免)"""
from typing import Optional
INTERNAL_CUSTOMER_NAMES = frozenset(
{
"安庆市山峡化工有限公司",
"安徽云栋化工有限公司",
}
)
def is_internal_customer_name(name: Optional[str]) -> bool:
return (name or "").strip() in INTERNAL_CUSTOMER_NAMES
+174 -5
View File
@@ -17,6 +17,7 @@ from app.models.pl_models import (
PlPersonnel,
PlPlan,
PlPlanChange,
PlPlanContract,
PlPlanProduct,
PlPlanTransport,
PlTransport,
@@ -27,12 +28,14 @@ from app.models.pl_models import (
from app.schemas.pl.plan import (
PlanArchiveFreightBlock,
PlanArchiveProductItem,
PlanContractLink,
PlanCreateFull,
PlanDriverFeedbackUpdateBody,
PlanProductCreate,
PlanSiteFeedbackUpdateBody,
PlanTransportCreateBlock,
)
from app.services.pl_internal_customer import is_internal_customer_name
from app.services.pl_brand_archive import persist_plan_product_brand_qtys, validate_brand_qty_rows
from app.services.pl_feedback_brand_qty import persist_transport_product_feedback
from app.services.pl_freight_settlement_service import sync_draft_settlement_freight_for_transport
@@ -1046,13 +1049,18 @@ def create_transport_for_plan(
PLAN_SELECTABLE_CONTRACT_STATUSES = ("approved", "executing")
PLAN_CONTRACT_SIDE_SUPPLIER = "supplier"
PLAN_CONTRACT_SIDE_DEMANDER = "demander"
def assert_contract_selectable_for_plan(
db: Session,
contract_id: str,
tenant_no: str,
) -> None:
*,
expected_customer_id: Optional[str] = None,
side_label: str = "合同",
):
from app.models.crm_models import CrmContract
contract = (
@@ -1065,17 +1073,178 @@ def assert_contract_selectable_for_plan(
.first()
)
if not contract:
raise HTTPException(status_code=404, detail="合同不存在")
raise HTTPException(status_code=404, detail=f"{side_label}不存在")
if contract.status not in PLAN_SELECTABLE_CONTRACT_STATUSES:
raise HTTPException(status_code=422, detail="仅已审批或执行中的合同可关联运输计划")
raise HTTPException(status_code=422, detail=f"仅已审批或执行中的合同可关联运输计划({side_label})")
if expected_customer_id and contract.customer_id != expected_customer_id:
raise HTTPException(status_code=422, detail=f"{side_label}不属于所选客户")
return contract
def _normalize_contract_links(
links: Optional[list[PlanContractLink]],
) -> list[PlanContractLink]:
if not links:
return []
seen: set[str] = set()
out: list[PlanContractLink] = []
for link in links:
cid = (link.contract_id or "").strip()
if not cid or cid in seen:
continue
seen.add(cid)
out.append(link)
return out
def validate_plan_party_contracts(
db: Session,
tenant_no: str,
*,
supplier_id: Optional[str],
supplier_name: Optional[str],
customer_id: Optional[str],
customer_name: Optional[str],
supplier_contracts: Optional[list[PlanContractLink]],
demander_contracts: Optional[list[PlanContractLink]],
require_products: Optional[list] = None,
) -> tuple[list[PlanContractLink], list[PlanContractLink]]:
if not (supplier_id or "").strip() or not (supplier_name or "").strip():
raise HTTPException(status_code=422, detail="请选择供方客户")
if not (customer_id or "").strip() or not (customer_name or "").strip():
raise HTTPException(status_code=422, detail="请选择需方客户")
if require_products is not None and not require_products:
raise HTTPException(status_code=422, detail="请至少保留一条产品明细")
supplier_links = _normalize_contract_links(supplier_contracts)
demander_links = _normalize_contract_links(demander_contracts)
if not is_internal_customer_name(supplier_name) and not supplier_links:
raise HTTPException(status_code=422, detail="请选择供方合同")
if not is_internal_customer_name(customer_name) and not demander_links:
raise HTTPException(status_code=422, detail="请选择需方合同")
resolved_supplier: list[PlanContractLink] = []
for link in supplier_links:
contract = assert_contract_selectable_for_plan(
db,
link.contract_id,
tenant_no,
expected_customer_id=supplier_id,
side_label="供方合同",
)
resolved_supplier.append(
PlanContractLink(contractId=contract.id, contractNo=contract.contract_no or link.contract_no)
)
resolved_demander: list[PlanContractLink] = []
for link in demander_links:
contract = assert_contract_selectable_for_plan(
db,
link.contract_id,
tenant_no,
expected_customer_id=customer_id,
side_label="需方合同",
)
resolved_demander.append(
PlanContractLink(contractId=contract.id, contractNo=contract.contract_no or link.contract_no)
)
return resolved_supplier, resolved_demander
def replace_plan_contracts(
db: Session,
*,
tenant_no: str,
plan_id: str,
supplier_contracts: list[PlanContractLink],
demander_contracts: list[PlanContractLink],
user_id: Optional[str],
dept_id: Optional[str],
) -> None:
now = datetime.now()
db.query(PlPlanContract).filter(
PlPlanContract.plan_id == plan_id,
PlPlanContract.tenant_no == tenant_no,
PlPlanContract.del_flag == 0,
).update(
{"del_flag": 1, "update_by": user_id, "update_time": now},
synchronize_session=False,
)
rows: list[tuple[str, list[PlanContractLink]]] = [
(PLAN_CONTRACT_SIDE_SUPPLIER, supplier_contracts),
(PLAN_CONTRACT_SIDE_DEMANDER, demander_contracts),
]
order_num = 0
for side, links in rows:
for link in links:
order_num += 1
db.add(
PlPlanContract(
id=generate_uuid(),
plan_id=plan_id,
side=side,
contract_id=link.contract_id,
contract_no=link.contract_no,
tenant_no=tenant_no,
order_num=order_num,
create_by=user_id,
create_dept_id=dept_id or "",
create_time=now,
update_by=user_id,
update_time=now,
del_flag=0,
)
)
def load_plan_contracts_grouped(
db: Session,
tenant_no: str,
plan_ids: list[str],
) -> dict[str, tuple[list[PlanContractLink], list[PlanContractLink]]]:
if not plan_ids:
return {}
rows = (
db.query(PlPlanContract)
.filter(
PlPlanContract.tenant_no == tenant_no,
PlPlanContract.plan_id.in_(plan_ids),
PlPlanContract.del_flag == 0,
)
.order_by(PlPlanContract.order_num.asc(), PlPlanContract.create_time.asc())
.all()
)
buckets: dict[str, list[list[PlanContractLink]]] = {
pid: [[], []] for pid in plan_ids
}
for row in rows:
bucket = buckets.setdefault(row.plan_id, [[], []])
link = PlanContractLink(contractId=row.contract_id, contractNo=row.contract_no)
if row.side == PLAN_CONTRACT_SIDE_SUPPLIER:
bucket[0].append(link)
elif row.side == PLAN_CONTRACT_SIDE_DEMANDER:
bucket[1].append(link)
return {pid: (lists[0], lists[1]) for pid, lists in buckets.items()}
def validate_create_full(payload: PlanCreateFull) -> None:
if not payload.contract_id:
raise HTTPException(status_code=422, detail="请选择合同")
if not (payload.supplier_id or "").strip() or not (payload.supplier_name or "").strip():
raise HTTPException(status_code=422, detail="请选择供方客户")
if not (payload.customer_id or "").strip() or not (payload.customer_name or "").strip():
raise HTTPException(status_code=422, detail="请选择需方客户")
if not payload.products:
raise HTTPException(status_code=422, detail="请至少保留一条产品明细")
supplier_links = _normalize_contract_links(payload.supplier_contracts)
demander_links = _normalize_contract_links(payload.demander_contracts)
if not is_internal_customer_name(payload.supplier_name) and not supplier_links:
raise HTTPException(status_code=422, detail="请选择供方合同")
if not is_internal_customer_name(payload.customer_name) and not demander_links:
raise HTTPException(status_code=422, detail="请选择需方合同")
transport = payload.transport
if not transport or not transport.vehicle_id:
return
@@ -198,7 +198,6 @@
"197": "_coerce_resource_snapshot",
"198": "user.py",
"200": "register_local_callback",
"201": ".to_tenant_user_dict",
"202": "statistics.py",
"206": "crm_quote_pdf.py",
"207": "shanxia2.0 后端骨架(FastAPI)",
@@ -0,0 +1,546 @@
{
"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": "Community 75",
"76": "Community 76",
"77": "Community 77",
"78": "Community 78",
"79": "Community 79",
"80": "Community 80",
"81": "Community 81",
"82": "Community 82",
"83": "Community 83",
"84": "Community 84",
"85": "Community 85",
"86": "Community 86",
"87": "Community 87",
"88": "Any",
"89": "pl_ocr_service.py",
"90": "Community 90",
"91": "pl_vehicle_recharge_service.py",
"92": "Community 92",
"93": "_invoice_info_by_customer_impl",
"94": "response.py",
"95": "Community 95",
"96": "Community 96",
"97": "_ensure_subpack_slip_no",
"98": "Community 98",
"99": "Community 99",
"100": "price_letter_detail",
"101": ".to_tenant_user_dict",
"102": "dept.py",
"103": "Community 103",
"104": "apply_crm_create_by_scope",
"105": "list_customers",
"106": "Community 106",
"107": "apply_pl_scope",
"108": "Community 108",
"109": "Community 109",
"110": "Base",
"111": "Community 111",
"112": "storage.py",
"113": "quote_share_log.py",
"114": "db_models.py",
"115": "site.py",
"116": "Community 116",
"117": "Community 117",
"118": "Community 118",
"119": "Community 119",
"120": "Community 120",
"121": "Community 121",
"122": "Community 122",
"123": "Community 123",
"124": "Community 124",
"125": "Community 125",
"126": "customer_pool.py",
"127": "Community 127",
"128": "plan.py",
"129": "BaseStorage",
"130": "datetime_parse.py",
"131": "LocalStorage",
"132": "crm_supplier_hazard.py",
"133": "Community 133",
"134": "Community 134",
"135": "unsettled_plans_q_filter",
"136": "Community 136",
"137": "statistics.py",
"138": "Community 138",
"139": "get_current_user_by_token",
"140": "Community 140",
"141": "PlTransport",
"142": "Community 142",
"143": "SysEthnic",
"144": "dict_data.py",
"145": "resolve_crm_product",
"146": "__init__.py",
"147": "Community 147",
"148": "storage.py",
"149": "Community 149",
"150": "apply_site_feedback",
"151": "Community 151",
"152": "response.py",
"153": "Community 153",
"154": "response.py",
"155": "Community 155",
"156": "utils.py",
"157": "Community 157",
"158": "Community 158",
"159": "customer_update",
"160": "register_local_callback",
"161": "backfill_crm_contract_attachment_urls.py",
"162": ".to_tenant_user_dict",
"163": "__init__.py",
"164": "get_client_ip",
"165": "Community 165",
"166": "code:block1 (/iflytek/shanxia2.0/backend)",
"167": "Community 167",
"168": "vehicle_urea.py",
"169": "product.py",
"170": "test_quote_approver_setting.py",
"171": "minio_url.py",
"172": "apply_pl_scope",
"173": "resolve_create_time_bounds",
"174": "register_local_callback",
"175": "vehicle_maintenance.py",
"176": "_forbid_legacy_invoice_fields",
"177": "vehicle_maintenance.py",
"178": ".__init__",
"179": "test_pl_vehicle_personnel_photo_schema.py",
"180": "OSSStorage",
"181": "allocate_next_biz_no",
"182": "statistics.py",
"183": "resolve_create_time_bounds",
"184": "__init__.py",
"185": "vehicle_urea.py",
"186": "transport_address.py",
"187": "_build_user_info_payload",
"188": "context.py",
"189": "create",
"190": "menu.py",
"191": "SoftDeleteModel",
"192": "pool_rule.py",
"193": "create_from_quote",
"194": "web_login_rsa_public_key",
"196": "crm_contract_sub_routes.py",
"197": "_coerce_resource_snapshot",
"198": "user.py",
"200": "register_local_callback",
"201": ".to_tenant_user_dict",
"202": "statistics.py",
"206": "crm_quote_pdf.py",
"207": "shanxia2.0 后端骨架(FastAPI)",
"211": "leave.py",
"216": "io_order.py",
"217": "auth.py",
"218": "pool_rule.py",
"220": "api_crypto_middleware.py",
"223": "workflow.py",
"224": "supplier_info.py",
"226": "get_active",
"228": "advance.py",
"230": "attachment.py",
"232": "transport_address.py",
"233": "customer_pool.py",
"235": "invoice_info.py",
"236": "price_letter.py",
"237": "order_status_compat.py",
"239": "shanxia2.0 Backend 生产部署说明",
"240": "delete",
"242": "leave.py",
"244": "expense_item.py",
"245": "__init__.py",
"246": "db_collation.py",
"247": "expense_item.py",
"249": "__init__.py",
"250": "invoice.py",
"251": "menu.py",
"252": "public_inventory.py",
"254": "Activate.ps1",
"256": "statistics.py",
"259": "一次上传一条发票:多文件挂同一档案,金额为总额,只写一条额度流水。",
"262": "reimburse.py",
"263": "__init__.py",
"264": "__init__.py",
"265": "__init__.py",
"266": "workflow.py",
"269": "__init__.py",
"270": "leave.py",
"271": "menu.py",
"272": "__init__.py",
"273": "__init__.py",
"274": "__init__.py",
"275": "__init__.py",
"276": "__init__.py",
"278": "__init__.py",
"281": "__init__.py",
"286": "send_delivery_notice",
"287": "__init__.py",
"288": "__init__.py",
"289": "send_delivery_warning",
"292": "send_order_status",
"293": "__init__.py",
"294": "__init__.py",
"295": "__init__.py",
"296": "__init__.py",
"297": "__init__.py",
"298": "__init__.py",
"299": "__init__.py",
"300": "__init__.py",
"301": "__init__.py",
"302": "send_payment_success",
"303": "send_refund_result",
"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",
"313": "send_urge_notification",
"314": "get",
"315": "get_multi_with_filters",
"317": "base.py",
"318": "clue.py",
"320": "customer_pool.py",
"321": "customer.py",
"323": "invoice_info.py",
"326": "price_letter.py",
"327": "product.py",
"328": "quote.py",
"329": "user.py",
"330": "base.py",
"331": "__tablename__",
"332": "__init__.py",
"333": "advance.py",
"334": "validate_expense_item_id",
"335": "attachment.py",
"336": "common.py",
"337": "validate_parent_id",
"338": "__init__.py",
"339": "invoice.py",
"340": "coerce_applicant_id",
"341": "details_must_not_be_empty",
"342": "reimburse.py",
"343": "validate_advance_id",
"344": "validate_expense_item_id",
"345": "validate_approver_id",
"346": "common.py",
"347": "contact.py",
"348": "customer_follow.py",
"349": "customer.py",
"350": "dashboard.py",
"351": "__init__.py",
"352": "inventory.py",
"353": "plans.py",
"354": "weighing.py",
"355": "__init__.py",
"356": "freight.py",
"357": "__init__.py",
"358": "plan.py",
"360": "validate_coordinates",
"361": "transport.py",
"362": "validate_amount",
"363": "validate_amount",
"364": "validate_recharge_type",
"365": "validate_amount",
"366": "validate_apply_amount",
"367": "validate_quantity",
"368": "approve",
"369": "create",
"370": "finance_issue_stats",
"371": "get_by_id",
"372": "get_paged",
"373": "global_status_counts",
"374": "issue",
"375": "_latest_approval_per_node",
"376": "_my_apply_base",
"377": "my_apply_stats",
"378": "offset_amount_map",
"379": "pending_approval_stats",
"380": "advance.py",
"381": "_query_approvals",
"382": "reject",
"383": "soft_delete",
"384": "submit",
"385": "_tenant_no",
"386": "update",
"387": "_workflow_nodes",
"389": "create",
"390": "get_by_biz",
"391": "get_by_id",
"392": "attachment.py",
"393": "soft_delete",
"394": "_tenant_no",
"395": "get_by_id",
"396": "get_paged",
"397": "base.py",
"398": "soft_delete",
"399": "update",
"401": "_build_tree",
"402": "create",
"403": "get_by_id",
"404": "get_item_tree",
"405": "expense_item.py",
"406": "soft_delete",
"407": "_tenant_no",
"408": "update",
"409": "_count_invoices",
"410": "create",
"411": "delete",
"412": "get_mine_summary",
"413": "is_wallet_admin",
"414": "add_entry",
"415": "assert_can_delete_invoice",
"416": "calc_summary",
"417": "debit_reimburse",
"418": "list_entries",
"419": "_lock_summary",
"420": "refresh_summary",
"421": "release_reimburse",
"422": "list_ledgers",
"423": "list_wallets",
"424": "_lookup_user_name",
"425": "out_rows_with_attachments",
"426": "invoice.py",
"427": "_require_wallet_admin",
"428": "_resolve_owner",
"429": "_resolve_owner_for_query",
"430": "_summary_to_dict",
"431": "_tenant_no",
"432": "approve",
"433": "batch_offset",
"434": "build_apply_out_with_details",
"435": "build_expense_name_condition",
"436": "can_change_applicant",
"437": "create_with_details",
"438": "finance_payment_stats",
"439": "get_by_id",
"440": "get_details",
"441": "get_details_map_by_reimburse_ids",
"442": "get_linked_invoice_ids",
"443": "get_linked_invoice_ids_map",
"444": "get_linked_invoices_brief",
"445": "get_paged",
"446": "global_status_counts",
"447": "_has_debit_reimburse",
"448": "_latest_approval_per_node",
"449": "_my_apply_base",
"450": "my_apply_stats",
"451": "offset",
"452": "out_one_with_attachment_counts",
"453": "out_rows_with_attachment_counts",
"454": "pay",
"455": "reimburse.py",
"456": "_query_approvals",
"457": "reject",
"458": "resolve_applicant",
"459": "soft_delete",
"460": "submit",
"461": "sync_reimburse_invoices",
"462": "_tenant_no",
"463": "update_with_details",
"464": "withdraw",
"465": "_workflow_nodes",
"466": "ensure_by_biz_type",
"467": "get_by_biz_type",
"468": "get_by_id",
"469": "get_paged",
"470": "workflow.py",
"471": "save_nodes",
"472": "soft_delete",
"473": "_tenant_no",
"474": "update",
"487": "_get_variable",
"488": "_parse_node_config",
"489": "_parse_variables",
"490": "customer_pool.py",
"491": "__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",
"510": "advance.py",
"511": "attachment.py",
"512": "expense_item.py",
"514": "workflow.py",
"517": "dashboard.py",
"518": "__init__.py",
"519": "inventory.py",
"520": "plans.py",
"521": "public_inventory.py",
"522": "weighing.py",
"523": "__init__.py",
"524": "leave.py",
"525": "menu.py",
"526": "base_data.py",
"527": "freight.py",
"528": "__init__.py",
"529": "inventory.py",
"530": "io_order.py",
"531": "plan.py",
"533": "transport_address.py",
"534": "transport.py",
"535": "vehicle_maintenance.py",
"536": "vehicle_recharge.py",
"537": "vehicle_urea.py",
"538": "workflow.py",
"539": "auth.py",
"545": "__init__.py",
"548": "storage.py",
"551": "base.py",
"553": "clue.py",
"554": "contact.py",
"555": "contract.py",
"556": "customer_follow.py",
"557": "customer_pool.py",
"558": "customer.py",
"559": "invoice_info.py",
"560": "opportunity.py",
"561": "pool_rule.py",
"562": "price_letter.py",
"563": "product.py",
"564": "quote.py",
"565": "statistics.py",
"566": "supplier_info.py",
"569": "__init__.py",
"570": "leave.py",
"571": "menu.py",
"573": "user.py",
"574": "workflow.py",
"576": "base.py",
"577": "__init__.py",
"578": "attachment.py",
"579": "auth.py",
"580": "advance.py",
"581": "attachment.py",
"582": "common.py",
"583": "expense_item.py",
"584": "__init__.py",
"585": "workflow.py",
"586": "common.py",
"587": "clue.py",
"588": "contact.py",
"589": "contract.py",
"590": "customer_follow.py",
"591": "customer_pool.py",
"592": "customer.py",
"593": "invoice_info.py",
"594": "opportunity.py",
"595": "pool_rule.py",
"596": "price_letter.py",
"597": "product.py",
"598": "quote.py",
"599": "statistics.py",
"600": "supplier_info.py",
"601": "dashboard.py",
"602": "__init__.py",
"603": "inventory.py",
"604": "plans.py",
"605": "public_inventory.py",
"606": "weighing.py",
"607": "__init__.py",
"608": "leave.py",
"609": "menu.py",
"610": "base_data.py",
"611": "freight.py",
"612": "__init__.py",
"613": "inventory.py",
"614": "io_order.py",
"615": "plan.py",
"616": "transport_address.py",
"617": "transport.py",
"618": "vehicle_maintenance.py",
"619": "vehicle_recharge.py",
"620": "vehicle_urea.py",
"621": "user.py",
"622": "workflow.py",
"623": "advance.py",
"624": "attachment.py",
"625": "base.py",
"626": "expense_item.py",
"627": "storage.py",
"628": "workflow.py",
"636": "customer_pool.py",
"638": "__init__.py"
}
@@ -0,0 +1,828 @@
# Graph Report - backend (2026-08-08)
## Corpus Check
- 326 files · ~212,760 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 4731 nodes · 15973 edges · 544 communities (525 shown, 19 thin omitted)
- Extraction: 97% EXTRACTED · 3% INFERRED · 0% AMBIGUOUS · INFERRED: 478 edges (avg confidence: 0.53)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `2df2ef08`
- 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 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 18|Community 18]]
- [[_COMMUNITY_Community 19|Community 19]]
- [[_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 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 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 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 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_Community 77|Community 77]]
- [[_COMMUNITY_Community 78|Community 78]]
- [[_COMMUNITY_Community 81|Community 81]]
- [[_COMMUNITY_Community 83|Community 83]]
- [[_COMMUNITY_Community 84|Community 84]]
- [[_COMMUNITY_Community 86|Community 86]]
- [[_COMMUNITY_Community 87|Community 87]]
- [[_COMMUNITY_Any|Any]]
- [[_COMMUNITY_pl_ocr_service.py|pl_ocr_service.py]]
- [[_COMMUNITY_pl_vehicle_recharge_service.py|pl_vehicle_recharge_service.py]]
- [[_COMMUNITY_Community 92|Community 92]]
- [[_COMMUNITY__invoice_info_by_customer_impl|_invoice_info_by_customer_impl]]
- [[_COMMUNITY_response.py|response.py]]
- [[_COMMUNITY_Community 95|Community 95]]
- [[_COMMUNITY__ensure_subpack_slip_no|_ensure_subpack_slip_no]]
- [[_COMMUNITY_price_letter_detail|price_letter_detail]]
- [[_COMMUNITY_.to_tenant_user_dict|.to_tenant_user_dict]]
- [[_COMMUNITY_dept.py|dept.py]]
- [[_COMMUNITY_apply_crm_create_by_scope|apply_crm_create_by_scope]]
- [[_COMMUNITY_list_customers|list_customers]]
- [[_COMMUNITY_Community 106|Community 106]]
- [[_COMMUNITY_apply_pl_scope|apply_pl_scope]]
- [[_COMMUNITY_Community 109|Community 109]]
- [[_COMMUNITY_Base|Base]]
- [[_COMMUNITY_Community 111|Community 111]]
- [[_COMMUNITY_storage.py|storage.py]]
- [[_COMMUNITY_quote_share_log.py|quote_share_log.py]]
- [[_COMMUNITY_db_models.py|db_models.py]]
- [[_COMMUNITY_site.py|site.py]]
- [[_COMMUNITY_Community 116|Community 116]]
- [[_COMMUNITY_Community 118|Community 118]]
- [[_COMMUNITY_Community 119|Community 119]]
- [[_COMMUNITY_Community 122|Community 122]]
- [[_COMMUNITY_Community 125|Community 125]]
- [[_COMMUNITY_customer_pool.py|customer_pool.py]]
- [[_COMMUNITY_Community 127|Community 127]]
- [[_COMMUNITY_plan.py|plan.py]]
- [[_COMMUNITY_BaseStorage|BaseStorage]]
- [[_COMMUNITY_datetime_parse.py|datetime_parse.py]]
- [[_COMMUNITY_LocalStorage|LocalStorage]]
- [[_COMMUNITY_crm_supplier_hazard.py|crm_supplier_hazard.py]]
- [[_COMMUNITY_Community 134|Community 134]]
- [[_COMMUNITY_unsettled_plans_q_filter|unsettled_plans_q_filter]]
- [[_COMMUNITY_Community 136|Community 136]]
- [[_COMMUNITY_statistics.py|statistics.py]]
- [[_COMMUNITY_Community 138|Community 138]]
- [[_COMMUNITY_get_current_user_by_token|get_current_user_by_token]]
- [[_COMMUNITY_PlTransport|PlTransport]]
- [[_COMMUNITY_SysEthnic|SysEthnic]]
- [[_COMMUNITY_dict_data.py|dict_data.py]]
- [[_COMMUNITY_resolve_crm_product|resolve_crm_product]]
- [[_COMMUNITY___init__.py|__init__.py]]
- [[_COMMUNITY_Community 147|Community 147]]
- [[_COMMUNITY_apply_site_feedback|apply_site_feedback]]
- [[_COMMUNITY_Community 151|Community 151]]
- [[_COMMUNITY_response.py|response.py]]
- [[_COMMUNITY_response.py|response.py]]
- [[_COMMUNITY_utils.py|utils.py]]
- [[_COMMUNITY_customer_update|customer_update]]
- [[_COMMUNITY_register_local_callback|register_local_callback]]
- [[_COMMUNITY_backfill_crm_contract_attachment_urls.py|backfill_crm_contract_attachment_urls.py]]
- [[_COMMUNITY_.to_tenant_user_dict|.to_tenant_user_dict]]
- [[_COMMUNITY___init__.py|__init__.py]]
- [[_COMMUNITY_get_client_ip|get_client_ip]]
- [[_COMMUNITY_codeblock1 (iflytekshanxia2.0backend)|code:block1 (/iflytek/shanxia2.0/backend)]]
- [[_COMMUNITY_test_quote_approver_setting.py|test_quote_approver_setting.py]]
- [[_COMMUNITY_minio_url.py|minio_url.py]]
- [[_COMMUNITY_apply_pl_scope|apply_pl_scope]]
- [[_COMMUNITY_resolve_create_time_bounds|resolve_create_time_bounds]]
- [[_COMMUNITY_register_local_callback|register_local_callback]]
- [[_COMMUNITY_.__init__|.__init__]]
- [[_COMMUNITY_test_pl_vehicle_personnel_photo_schema.py|test_pl_vehicle_personnel_photo_schema.py]]
- [[_COMMUNITY_OSSStorage|OSSStorage]]
- [[_COMMUNITY_allocate_next_biz_no|allocate_next_biz_no]]
- [[_COMMUNITY_statistics.py|statistics.py]]
- [[_COMMUNITY_resolve_create_time_bounds|resolve_create_time_bounds]]
- [[_COMMUNITY___init__.py|__init__.py]]
- [[_COMMUNITY__build_user_info_payload|_build_user_info_payload]]
- [[_COMMUNITY_context.py|context.py]]
- [[_COMMUNITY_SoftDeleteModel|SoftDeleteModel]]
- [[_COMMUNITY_create_from_quote|create_from_quote]]
- [[_COMMUNITY_web_login_rsa_public_key|web_login_rsa_public_key]]
- [[_COMMUNITY_crm_contract_sub_routes.py|crm_contract_sub_routes.py]]
- [[_COMMUNITY_register_local_callback|register_local_callback]]
- [[_COMMUNITY_.to_tenant_user_dict|.to_tenant_user_dict]]
- [[_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_一次上传一条发票:多文件挂同一档案,金额为总额,只写一条额度流水。|一次上传一条发票:多文件挂同一档案,金额为总额,只写一条额度流水。]]
- [[_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` - 446 edges
2. `get_tenant_no()` - 350 edges
3. `success_response()` - 258 edges
4. `DbUserContext` - 254 edges
5. `error_response()` - 240 edges
6. `generate_uuid()` - 195 edges
7. `BxUserContext` - 183 edges
8. `crm_user_info()` - 137 edges
9. `assert_row_deletable_by_creator()` - 83 edges
10. `ApiResponse` - 79 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 (544 total, 19 thin omitted)
### Community 0 - "Community 0"
Cohesion: 0.16
Nodes (32): check_document_expiry(), document_reminder_stats(), get_inventory_ledger(), get_summary(), list_document_reminders(), list_transactions(), list_warnings(), date (+24 more)
### Community 1 - "Community 1"
Cohesion: 0.08
Nodes (38): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, 接口菜单权限守卫。super_admin 直接放行。, require_menu_code(), ContractApproverSettingSaveBody, ContractApprovalActionBody, ContractApprovalPassBody, ContractApprovalRejectBody, ContractApprovalTransferBody (+30 more)
### Community 2 - "Community 2"
Cohesion: 0.20
Nodes (27): _apply_inventory_product_update(), _apply_inventory_update(), _base_query(), create_inventory(), create_link_for_plan(), delete_inventory(), _generate_batch_no(), _get_inventory() (+19 more)
### Community 3 - "Community 3"
Cohesion: 0.07
Nodes (65): attachment_download_url(), attachment_preview_url(), create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite(), create_post() (+57 more)
### Community 4 - "Community 4"
Cohesion: 0.12
Nodes (61): _apply_list_filters(), assign_opportunities(), batch_update_expect_date(), batch_update_stage(), change_stage(), create_opportunity(), _decimal_value(), _enrich_user_names() (+53 more)
### Community 5 - "Community 5"
Cohesion: 0.15
Nodes (34): CRM 合同子模块路由 — 变更/模板/审批独立页, register_contract_sub_routes(), _change_row_to_dict(), create_contract_change(), create_contract_template(), _enrich_change_rows(), execute_change(), export_contract_changes() (+26 more)
### Community 6 - "Community 6"
Cohesion: 0.11
Nodes (48): assign_customer(), batch_claim_customers(), check_duplicate_customer(), claim_customer(), create_customer(), deal_customer(), _enrich_user_names(), _ensure_customer_in_scope() (+40 more)
### Community 7 - "Community 7"
Cohesion: 0.05
Nodes (59): clue_check_convert(), clue_check_duplicate(), clue_park_area_list(), customer_check_duplicate(), customer_generate_no(), customer_park_area_list(), customer_transfer(), _opp_list_kwargs() (+51 more)
### Community 8 - "Community 8"
Cohesion: 0.08
Nodes (75): register_quote_routes(), create_from_quote(), _quote_products_to_contract_products(), Java: createFromQuote — 返回合同 id, accept_quote(), delete_pending_approvals(), Java: deletePendingApprovals, assert_quote_editable_for_update() (+67 more)
### Community 11 - "Community 11"
Cohesion: 0.11
Nodes (54): cancel_apply(), create_apply(), create_disburse(), delete_applies(), delete_disburses(), get_apply(), get_disburse(), list_applies() (+46 more)
### Community 12 - "Community 12"
Cohesion: 0.07
Nodes (43): AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest, LoginResponse, Pydantic schemas - 用户认证, ResetPasswordRequest, UserCreate (+35 more)
### Community 13 - "Community 13"
Cohesion: 0.20
Nodes (7): BxAdvanceApply, BxAdvanceApproval, AdvanceService, Any, Session, 同一节点多次审批时,取 approval_time 最新的一条作为当前节点状态。, 返回全部审批动作,按时间正序排列,用于展示完整审批历史。
### Community 14 - "Community 14"
Cohesion: 0.13
Nodes (41): approve_carrier(), bind_vehicle_driver(), create_carrier(), create_driver(), create_personnel(), delete_carrier(), delete_driver(), delete_personnel() (+33 more)
### Community 15 - "Community 15"
Cohesion: 0.10
Nodes (41): approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse(), get_approval_history(), get_approvals(), get_generated_title() (+33 more)
### Community 16 - "Community 16"
Cohesion: 0.09
Nodes (60): cancel_apply(), create_apply(), create_record(), delete_applies(), delete_records(), get_apply(), get_record(), list_applies() (+52 more)
### Community 18 - "Community 18"
Cohesion: 0.09
Nodes (61): advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _fill_offset_amounts(), get_advance() (+53 more)
### Community 19 - "Community 19"
Cohesion: 0.06
Nodes (74): archive_plan(), cancel_plan(), cancel_plan_wait_notice(), count_plans_by_contract(), create_from_contract(), create_plan(), create_plan_full(), delete_plan() (+66 more)
### Community 21 - "Community 21"
Cohesion: 0.09
Nodes (58): _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() (+50 more)
### Community 22 - "Community 22"
Cohesion: 0.08
Nodes (28): parse_admin_request_json(), Any, Request, 运营 Web(/web/admin)JSON 请求体解析。 与 ApiCryptoMiddleware 配合:中间件未改写 body 时,在路由内解密 `{, 读取 JSON body;dict 时走 resolve_request_payload(明文 / 密文 / data 包装)。 Returns:, ApiCryptoError, _b64url_decode(), _b64url_encode() (+20 more)
### Community 23 - "Community 23"
Cohesion: 0.14
Nodes (7): convert_heic_to_jpeg(), process_image_content(), QiniuStorage, 文件存储工具模块 支持多种存储方式: 1. 本地存储 (local) - 默认 2. 七牛云存储 (qiniu) - 推荐生产环境使用 3. 阿里云OSS (, 将 HEIC/HEIF 格式转换为 JPEG 格式, 处理图片内容,如果是 HEIC 格式则转换为 JPEG, BytesIO
### Community 24 - "Community 24"
Cohesion: 0.26
Nodes (20): get_plan_related(), list_weighing(), format_datetime(), _create_by_name(), datetime_end_of_day(), fmt_date(), fmt_datetime(), inventory_date_to_api() (+12 more)
### Community 25 - "Community 25"
Cohesion: 0.12
Nodes (28): PlInventory, PlInventoryTransaction, 库存流水表 pl_inventory_transaction, load_brand_qtys_by_plan_product_ids(), persist_plan_product_brand_qtys(), Any, Decimal, Session (+20 more)
### Community 26 - "Community 26"
Cohesion: 0.25
Nodes (10): _cert_url_blank(), plan_has_hazard_product_exists(), plan_has_incomplete_hazard_cert_exists(), 证书 URL 为空(NULL / 空串 / 纯空白)。, 列表筛选:计划下存在 CRM 标识为易制毒/易制爆的产品。, 列表筛选:存在危化产品且至少一张必需证书未上传。, _compile(), 危化品证上传列表筛选:EXISTS 子查询应覆盖 CRM 危化标识与证书缺口。 (+2 more)
### Community 27 - "Community 27"
Cohesion: 0.05
Nodes (67): CRM 报价单 API 路由 — 挂接到 crm.router, BaseModel, PagedQuery, PagedResponse, InvoiceAttachmentOut, InvoiceOut, LedgerOut, WalletSummaryOut (+59 more)
### Community 28 - "Community 28"
Cohesion: 0.09
Nodes (64): PlFreightSettlement, PlFreightSettlementApproval, PlFreightSettlementTransport, PlRemittanceVoucher, 运费结算表 pl_freight_settlement, 运费结算审批 pl_freight_settlement_approval, 结算单-运输关联表 pl_freight_settlement_transport, 汇款凭证表 pl_remittance_voucher (+56 more)
### Community 29 - "Community 29"
Cohesion: 0.10
Nodes (58): PlPlan, PlPlanChange, PlPlanProduct, PlPlanTransport, 计划产品明细表 pl_plan_product, 计划变更记录表 pl_plan_change, 计划-运输关联表 pl_plan_transport, PlanArchiveFreightBlock (+50 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 33 - "Community 33"
Cohesion: 0.14
Nodes (21): 报销模块认证适配:门户 JWT 用户 → bx 业务上下文。, BxReimburseInvoice, BxReimburseOffset, BxWorkflowNode, 报销(bx)模块数据模型 — 对齐 docs/sql/20260606_bx_tables.sql, filter_current_cycle_approvals(), 审批轮次过滤 — 驳回后重新提交时,进度接口仅展示当前轮次。, 审批进度仅展示当前轮次;完整历史由 get_approval_history 返回。 (+13 more)
### Community 34 - "Community 34"
Cohesion: 0.15
Nodes (32): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), create_process_def(), delete_process_def(), _enrich_task_list(), get_business_all_tasks(), _get_business_form_fields() (+24 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.15
Nodes (27): 验证密码(哈希非 bcrypt 或损坏时返回 False,避免抛错), verify_password(), change_password(), create_user(), get_user(), get_user_with_relations(), _hash_password(), list_post_ids_for_user() (+19 more)
### Community 37 - "Community 37"
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 38 - "Community 38"
Cohesion: 0.20
Nodes (13): create_expense_item(), delete_expense_item(), get_expense_item(), get_expense_item_tree(), Session, update_expense_item(), BxExpenseItem, _coerce_id() (+5 more)
### Community 39 - "Community 39"
Cohesion: 0.22
Nodes (27): assign_clues(), check_convert(), check_duplicate_clue(), convert_clue(), create_clue(), _enrich_user_names(), _ensure_clue_in_scope(), get_clue() (+19 more)
### Community 42 - "Community 42"
Cohesion: 0.20
Nodes (31): _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() (+23 more)
### Community 43 - "Community 43"
Cohesion: 0.11
Nodes (27): create_invoice(), delete_invoice(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices(), Request, Session (+19 more)
### Community 44 - "Community 44"
Cohesion: 0.08
Nodes (81): register_contract_routes(), _apply_contract_entity_fields(), batch_assign_owner(), batch_submit_contract_approval(), _build_contract_filters(), _build_contract_name_from_parties(), _build_customer_address(), _calc_amount_with_tax() (+73 more)
### Community 45 - "Community 45"
Cohesion: 0.08
Nodes (72): _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() (+64 more)
### Community 46 - "Community 46"
Cohesion: 0.06
Nodes (55): customer_create(), customer_delete(), customer_update(), opportunity_follow_add(), opportunity_follow_update(), pool_customer_assign(), pool_customer_claim(), pool_customer_list() (+47 more)
### Community 48 - "Community 48"
Cohesion: 0.27
Nodes (10): 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() (+2 more)
### Community 49 - "Community 49"
Cohesion: 0.13
Nodes (32): create_clue_follow(), delete_clue_follow(), get_clue_follow(), get_follow_statistics(), list_clue_follows(), Any, Session, 更新线索跟进记录,必要时同步线索 next_time (+24 more)
### Community 50 - "Community 50"
Cohesion: 0.25
Nodes (17): _cargo_stats(), get_dashboard_stats(), get_inbound_by_cargo(), get_inbound_by_partner_cargo(), get_outbound_by_cargo(), get_outbound_by_partner_cargo(), _partner_cargo_stats(), Session (+9 more)
### Community 51 - "Community 51"
Cohesion: 0.05
Nodes (57): operlog_detail(), operlog_list(), Session, 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), _user_info(), ApiRequestLogMiddleware, _claims_from_auth(), _format_body_bytes() (+49 more)
### Community 52 - "Community 52"
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 53 - "Community 53"
Cohesion: 0.34
Nodes (30): AttachmentDownloadUrlBody, DeptCreateBody, DeptUpdateBody, DictDataCreateBody, DictDataUpdateBody, DictTypeCreateBody, DictTypeUpdateBody, MenuCreateBody (+22 more)
### Community 54 - "Community 54"
Cohesion: 0.23
Nodes (25): _get_by_plan(), get_inbound(), get_inbound_by_plan(), _get_order(), get_outbound(), get_outbound_by_plan(), inbound_site_url(), list_inbound() (+17 more)
### Community 58 - "Community 58"
Cohesion: 0.17
Nodes (26): _apply_plan_product_update(), _apply_plan_update(), AutoGenerateMonthlyResult, _base_query(), create_plan(), delete_plan(), _generate_plan_no(), get_plan() (+18 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.09
Nodes (21): 分页查询供方列表 — Java: CrmSupplierInfoController.list, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方详情 — Java: CrmSupplierInfoController.getInfo, 新增供方 — Java: CrmSupplierInfoController.add, 修改供方 — Java: CrmSupplierInfoController.edit, 删除供方 — Java: CrmSupplierInfoController.remove, 导出供方列表 — Java: CrmSupplierInfoController.export, supplier_info_add() (+13 more)
### Community 61 - "Community 61"
Cohesion: 0.11
Nodes (43): PlTransportDbLink, 运输-地磅出入库关联 pl_transport_db_link, _apply_plan_quantity_delta(), _create_db_inventory(), _create_db_plan(), DibangInventoryLinkResult, find_monthly_db_plan(), _generate_batch_no() (+35 more)
### Community 62 - "Community 62"
Cohesion: 0.18
Nodes (25): _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), _get_weighing(), get_weighing_related(), Session (+17 more)
### Community 63 - "Community 63"
Cohesion: 0.13
Nodes (11): _coerce_id(), OffsetItem, PaymentFinanceStatsOut, 报销单勾选的发票附件(同一发票可勾选多个附件,各占一条)。, ReimburseApplyCreate, ReimburseApprovalOut, ReimburseApproverPendingStatsOut, ReimburseDetailCreate (+3 more)
### Community 64 - "Community 64"
Cohesion: 0.09
Nodes (63): clue_detail(), clue_export(), clue_follow_detail(), clue_follow_statistics(), clue_import(), clue_list(), clue_mine(), clue_to_follow() (+55 more)
### Community 65 - "Community 65"
Cohesion: 0.10
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.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 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.33
Nodes (13): _build_tree(), _cascade_soft_delete(), _collect_with_ancestors(), create_dept(), get_dept(), list_depts(), list_depts_tree(), Any (+5 more)
### Community 69 - "Community 69"
Cohesion: 0.12
Nodes (31): _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 (+23 more)
### Community 70 - "Community 70"
Cohesion: 0.18
Nodes (18): align_contract_no_to_sign_date(), generate_contract_no(), date, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号} 流水与撞号检测须含软删:uk_contr, 标准编号替换日期段,保留序号;非标准返回 None。, 将标准合同编号日期段对齐签订日;撞号则序号顺延(含软删查重)。 非标准编号原样返回。无签订日则原样返回。, replace_contract_no_date(), _mock_last_contract() (+10 more)
### Community 71 - "Community 71"
Cohesion: 0.15
Nodes (26): create_vehicle(), get_vehicle(), list_personnel(), list_vehicles(), update_vehicle(), _vehicle_to_detail(), _vehicle_to_read(), PlCert (+18 more)
### Community 72 - "Community 72"
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 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.04
Nodes (58): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), menu_badge_stats() (+50 more)
### Community 77 - "Community 77"
Cohesion: 0.11
Nodes (12): get_wechat_pay_client(), get_wechat_pay_v2(), Any, 微信支付工具模块 支持微信支付 V3 API 文档参考: https://pay.weixin.qq.com/docs/v3/apis/index.html, 统一下单接口 (V3) Args: out_trade_no: 商户订单号 total_amo, 申请退款 Args: out_trade_no: 商户订单号 total_amount: 订单, 小程序调起支付的二次签名参数(与公众号 JSAPI 规则一致), 统一下单 (V2 API) Args: out_trade_no: 商户订单号 total_f (+4 more)
### Community 78 - "Community 78"
Cohesion: 0.24
Nodes (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 81 - "Community 81"
Cohesion: 0.20
Nodes (16): build_name_pinyin_abbr(), normalize_name_pinyin_abbr(), 名称拼音首字母缩写:库内存小写,检索时大小写不敏感。, 保存时解析拼音字段。 - submitted_provided=True:用提交值(空则按 name 生成) - 否则:已有非空 existi, resolve_name_pinyin_abbr(), backfill_model(), _empty_pinyin_filter(), load_settings_env() (+8 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 86 - "Community 86"
Cohesion: 0.25
Nodes (7): contact_add(), contact_delete(), contact_update(), ContactCreateBody, ContactDeleteBody, ContactUpdateBody, CRM 联系人 Pydantic Schemas
### Community 87 - "Community 87"
Cohesion: 0.22
Nodes (17): approve_quote(), can_user_approve(), create_approval_records(), get_quote_approval(), list_quote_approvals(), Any, Session, CRM 报价单审批 CRUD — 对照 CrmQuoteApprovalServiceImpl.java (+9 more)
### Community 88 - "Any"
Cohesion: 0.18
Nodes (30): _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() (+22 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 91 - "pl_vehicle_recharge_service.py"
Cohesion: 0.17
Nodes (12): 流程实例 wf_process_instance, WfProcessInstance, _dispatch_local(), Any, 工作流回调服务 —— 流程状态变更时通知业务系统, 尝试本地直调。返回 True 表示已处理,False 表示无匹配的本地回调。, 流程实例状态变更后,向业务系统发送回调通知。 优先级: 1. 如果 callback_url 是内部路径(以 / 开头),优先尝试本地直调, trigger_callback() (+4 more)
### Community 92 - "Community 92"
Cohesion: 0.20
Nodes (21): _assert_users_exist(), get_setting(), Any, Session, _row_to_dict(), save_setting(), _assert_users_exist(), get_setting() (+13 more)
### Community 93 - "_invoice_info_by_customer_impl"
Cohesion: 0.08
Nodes (43): generate_uuid(), get_current_time(), parse_datetime(), datetime, get_pool_record(), list_pool_records(), Any, Session (+35 more)
### Community 94 - "response.py"
Cohesion: 0.17
Nodes (17): 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() (+9 more)
### Community 95 - "Community 95"
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 97 - "_ensure_subpack_slip_no"
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 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 - ".to_tenant_user_dict"
Cohesion: 0.19
Nodes (14): CRM 模块 Excel 导出列定义(字段与字典类型对齐 Java *Vo @ExcelDictFormat)。, _build_workbook(), DictLabelResolver, export_rows_to_xlsx_response(), ExportColumn, load_dict_label_maps(), Any, Session (+6 more)
### Community 102 - "dept.py"
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 104 - "apply_crm_create_by_scope"
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 - "list_customers"
Cohesion: 0.29
Nodes (6): Config, format_api_error_message(), PageResult, Exception, 将 HTTP/SQLAlchemy 等异常转为可展示的错误文案(避免 str([]) 空列表)。, ResponseModel
### Community 106 - "Community 106"
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)
### Community 107 - "apply_pl_scope"
Cohesion: 0.16
Nodes (31): 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() (+23 more)
### Community 109 - "Community 109"
Cohesion: 0.29
Nodes (16): paste_recognize_commit(), PlVehicle, ConflictAction, PasteCommitBody, PasteCommitResult, PastePersonnelIn, PasteVehicleIn, 运输计划 - 三方粘贴识别提交 Schema (+8 more)
### Community 110 - "Base"
Cohesion: 0.18
Nodes (11): Config, decrypt_login_payload(), ensure_initialized(), extract_login_credentials(), get_public_pem(), Any, 登录凭据 RSA 解密(与前端 JSEncrypt PKCS#1 v1.5 兼容)。, Base64 密文 -> JSON 对象(须含 username、password、ts 毫秒时间戳)。 (+3 more)
### Community 111 - "Community 111"
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 112 - "storage.py"
Cohesion: 0.06
Nodes (58): 返回 (作废, 归档)。现场链接实际走入库/出库单公共页。, _resolve_io_order_link_flags(), _build_public_page(), _build_site_product_read(), _format_file_size(), get_public_site(), _get_site_link_by_token(), _parse_feedback_images() (+50 more)
### Community 113 - "quote_share_log.py"
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 114 - "db_models.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 115 - "site.py"
Cohesion: 0.28
Nodes (17): _address_to_read(), _build_address_query(), create_transport_address(), delete_transport_address(), _get_address(), get_transport_address(), list_all_transport_addresses(), list_transport_addresses() (+9 more)
### Community 116 - "Community 116"
Cohesion: 0.19
Nodes (26): batch_insert_quote_products(), calculate_subtotal(), _decimal_value(), _ensure_quote_parent_scope(), _get_field(), get_quote_product(), insert_quote_product(), list_products_by_quote_ids() (+18 more)
### Community 118 - "Community 118"
Cohesion: 0.20
Nodes (24): batch_insert_contract_products(), calculate_subtotal(), _decimal_value(), delete_price_tiers_by_contract_id(), delete_products_by_contract_id(), _get_field(), insert_contract_product(), _letter_oss_ids_to_json() (+16 more)
### Community 119 - "Community 119"
Cohesion: 0.16
Nodes (29): CertRow, VehiclePersonnelRow, _cert_row_complete(), collect_required_cert_errors(), _find_cert_for_required(), get_required_personnel_cert_names(), match_required_cert_name(), _missing_field_labels() (+21 more)
### Community 122 - "Community 122"
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 125 - "Community 125"
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 126 - "customer_pool.py"
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 127 - "Community 127"
Cohesion: 0.11
Nodes (38): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), _generate_settlement_no(), get_settlement(), get_settlement_approval_flow() (+30 more)
### Community 128 - "plan.py"
Cohesion: 0.39
Nodes (10): create_site(), get_site(), list_sites(), Any, Session, _row_to_dict(), site_code_exists(), soft_delete_site() (+2 more)
### Community 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 - "datetime_parse.py"
Cohesion: 0.29
Nodes (16): ensure_crm_customer_linked_row_in_scope(), ensure_crm_owner_row_in_scope(), Session, CRM 数据权限辅助(负责人 owner_user_id + 标准 create_by/create_dept_id)。, 客户子表(开票信息等):先校验关联客户 owner scope,否则校验 create_by。, _clear_default_for_customer(), create_invoice_info(), get_invoice_info() (+8 more)
### Community 131 - "LocalStorage"
Cohesion: 0.60
Nodes (3): assert_contract_editable_for_update(), test_assert_allows_editable(), test_assert_rejects_non_editable()
### Community 132 - "crm_supplier_hazard.py"
Cohesion: 0.29
Nodes (12): build_updates(), derive_source_url(), fetch_source_customers(), legacy_id_to_str(), load_oss_map(), load_runtime_settings(), load_settings_env(), main() (+4 more)
### Community 134 - "Community 134"
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 135 - "unsettled_plans_q_filter"
Cohesion: 0.08
Nodes (23): category_add(), category_delete(), category_tree(), category_update(), product_add(), product_delete(), product_detail(), product_options() (+15 more)
### Community 136 - "Community 136"
Cohesion: 0.26
Nodes (14): 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) (+6 more)
### Community 137 - "statistics.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 138 - "Community 138"
Cohesion: 0.33
Nodes (19): check_python(), create_venv(), ensure_dirs(), ensure_valid_venv(), ensure_venv_and_runtime(), install_dependencies(), is_running(), log_error() (+11 more)
### Community 139 - "get_current_user_by_token"
Cohesion: 0.22
Nodes (15): get_storage(), download_file_bytes(), file_stream(), get_access_url(), get_download_url(), get_preview_url(), normalize_storage_path(), 报销附件存储适配 — 复用门户 app.core.storage,对外保持 bx 协议。 (+7 more)
### Community 141 - "PlTransport"
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 143 - "SysEthnic"
Cohesion: 0.40
Nodes (9): create_leave(), get_leave(), list_leaves(), Any, Session, _row_to_dict(), soft_delete_leave(), update_leave() (+1 more)
### Community 144 - "dict_data.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 145 - "resolve_crm_product"
Cohesion: 0.14
Nodes (21): PlVehiclePersonnel, 车辆-人员关联表 pl_vehicle_personnel, 运输计划 - 安排运输时车辆/人员/证件资源快照 Schema, SnapshotCertRead, SnapshotPersonnelRow, TransportResourceSnapshot, build_personnel_summary(), load_vehicle_personnel_rows() (+13 more)
### Community 146 - "__init__.py"
Cohesion: 0.13
Nodes (16): CarrierBase, CarrierCreate, CarrierQualificationBase, PersonnelBase, PersonnelCreate, PersonnelListResponse, PersonnelUpdate, 运输计划管理 - 基础数据 Schema(承运商、车辆、人员、证书) (+8 more)
### Community 147 - "Community 147"
Cohesion: 0.37
Nodes (17): check_env(), check_python(), create_venv(), init_env(), install_dependencies(), log_error(), log_info(), log_success() (+9 more)
### Community 150 - "apply_site_feedback"
Cohesion: 0.17
Nodes (8): 发送订单状态通知 Args: openid: 用户openid order_n, 发送支付成功通知 Args: openid: 用户openid order_n, 发送配送通知 Args: openid: 配送员openid task_no:, 发送配送时效预警 Args: openid: 配送员openid task_n, 发送退款结果通知 Args: openid: 用户openid order_n, 发送催单通知给配送员 Args: deliver_openid: 配送员openid, 发送模板消息 Args: openid: 用户openid template_, WechatMessageService
### Community 152 - "response.py"
Cohesion: 0.29
Nodes (16): create_contact(), get_contact(), list_contacts_by_customer(), _parse_optional_date(), Any, date, Session, _row_to_dict() (+8 more)
### Community 154 - "response.py"
Cohesion: 0.19
Nodes (7): _guess_preview_content_type(), MinIOStorage, Any, 从 MINIO_BASE_URL 解析公网 endpoint;未配置或与内网相同时复用 self.client。, 按对象键后缀推断内联预览 Content-Type(纠正上传时未写入 MIME 的情况)。, MinIO 预签名下载 URL,携带原始文件名。, MinIO 预签名内联预览 URL(图片新标签页 / PDF iframe 等)。 上传时 put_object 未写 content_typ
### Community 156 - "utils.py"
Cohesion: 0.24
Nodes (16): allocate_reimburse_title_seq(), format_reimburse_title(), generate_apply_code(), generate_title(), is_auto_reimburse_title(), parse_reimburse_date(), preview_reimburse_title_seq(), date (+8 more)
### Community 159 - "customer_update"
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 160 - "register_local_callback"
Cohesion: 0.20
Nodes (16): API 路由包 — 山峡化工生产一体化门户, create_leave(), delete_leave(), get_leave(), _leave_local_callback(), leave_workflow_callback(), list_leaves(), Session (+8 more)
### Community 161 - "backfill_crm_contract_attachment_urls.py"
Cohesion: 0.33
Nodes (10): load_oss_map(), load_runtime_settings(), load_settings_env(), main(), Any, Engine, 返回 (新值, 是否发生了 id→url 替换)。, resolve_token() (+2 more)
### Community 162 - ".to_tenant_user_dict"
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 163 - "__init__.py"
Cohesion: 0.20
Nodes (15): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+7 more)
### Community 164 - "get_client_ip"
Cohesion: 0.15
Nodes (29): _jwt_user_payload(), logout(), 公共接口(Web 登录、刷新 Token、登出;用户模型对齐 docs/sql/shanxia2.0.sql 基线), 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。, Web 端登录:账号为 sys_user.user_no,密码为 sys_user.password(bcrypt)。, refresh_token(), web_login(), create_access_token() (+21 more)
### Community 170 - "test_quote_approver_setting.py"
Cohesion: 0.22
Nodes (3): BaseStorage, 带下载文件名的访问 URL;默认实现为普通访问地址。, 浏览器内联预览 URL;默认实现为普通访问地址。
### Community 171 - "minio_url.py"
Cohesion: 0.24
Nodes (13): normalize_attachment_csv(), normalize_attachment_csv(), extract_minio_object_key(), join_relative_urls(), normalize_oss_storage_url(), MinIO 附件 URL 规范化(数据迁移共用)。 背景 ---- CRM / 地磅 / 报销与 shanxia2.0 共用同一 MinIO(bucket 默, 业务表 OSS ID 串 → 相对 URL 串(用于客户证照、跟进附件等)。, 去掉预签名 query(``?X-Amz-...``)。 (+5 more)
### Community 172 - "apply_pl_scope"
Cohesion: 0.49
Nodes (10): apply_pl_scope(), Session, build_menu_badge_counts(), count_document_reminder_expired_pending(), count_freight_approval_pending(), count_freight_disburse_pending(), _count_pending_applies(), count_plan_archive_pending() (+2 more)
### Community 173 - "resolve_create_time_bounds"
Cohesion: 0.08
Nodes (39): ApiRequestLogCRUD, Session, list_ethnics(), Any, Session, 民族码表 CRUD(全局 sys_ethnic), _row_to_dict(), BizAttachment (+31 more)
### Community 174 - "register_local_callback"
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 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 181 - "allocate_next_biz_no"
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 182 - "statistics.py"
Cohesion: 0.17
Nodes (25): clue_import_template(), customer_import_template(), product_import_template(), statistics_follow(), statistics_industry(), statistics_level(), statistics_overview(), statistics_owner() (+17 more)
### Community 183 - "resolve_create_time_bounds"
Cohesion: 0.52
Nodes (6): parse_create_time_day_bounds(), _parse_day_start(), datetime, 报销模块日期范围工具(从 bx-backend 迁移)。, 解析申请时间筛选边界,返回 (含起, 不含止)。, resolve_create_time_bounds()
### Community 184 - "__init__.py"
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 187 - "_build_user_info_payload"
Cohesion: 0.40
Nodes (5): _avatar_url_field(), _build_user_info_payload(), 与 web-admin 静态路由 meta.roles(admin/super_admin)对齐的单元素数组。, 与 web-admin `userInfo` 字段约定一致。, _web_role_list()
### Community 188 - "context.py"
Cohesion: 0.67
Nodes (3): parse_optional_plan_datetime(), datetime, 运输计划相关日期时间解析:前端 date-picker 仅传 YYYY-MM-DD。
### Community 193 - "create_from_quote"
Cohesion: 0.50
Nodes (4): customer_options(), 客户下拉选项(租户内只读,不做 owner 数据权限), CustomerOptionsBody, 客户下拉选项请求体(租户内只读搜索,不做 owner 数据权限)
### Community 196 - "crm_contract_sub_routes.py"
Cohesion: 0.27
Nodes (10): apply_product_snapshot_to_plan(), ProductSnapshot, Session, 地磅模块 — CRM 产品解析与快照写入。, 校验 CRM 产品并返回名称/规格快照。新建单据 product_id 必填。 require_on_shelf=False 用于运输计划联动地磅等历, resolve_crm_product(), _product(), resolve_crm_product:运输联动场景允许已下架产品。 (+2 more)
### Community 200 - "register_local_callback"
Cohesion: 0.07
Nodes (59): PlTransportProductFeedback, 运输单按产品回传 pl_transport_product_feedback, _dict_field(), format_brand_qty_summary(), load_transport_driver_product_feedbacks(), persist_io_item_brand_qtys(), persist_transport_product_feedback(), Any (+51 more)
### Community 201 - ".to_tenant_user_dict"
Cohesion: 0.40
Nodes (3): Any, 供 get_tenant_no 等门户工具使用。, 与门户 JWT / apply_data_scope 所需的 user_info 字段对齐。
### 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.
- **19 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `Settings` connect `price_letter_detail` to `backfill_crm_contract_attachment_urls.py`, `_ensure_subpack_slip_no`, `Community 35`, `crm_supplier_hazard.py`, `Community 37`, `Community 67`, `Community 72`, `Community 73`, `Community 42`, `Base`, `Community 52`, `Any`, `Community 59`, `Community 30`?**
_High betweenness centrality (0.107) - this node is a cross-community bridge._
- **Why does `BaseModel` connect `Community 27` to `Community 0`, `Community 1`, `Community 2`, `Community 5`, `Community 7`, `unsettled_plans_q_filter`, `Community 11`, `Community 12`, `Community 14`, `Community 15`, `Community 16`, `resolve_crm_product`, `Community 18`, `__init__.py`, `Community 19`, `Community 28`, `Community 29`, `customer_update`, `register_local_callback`, `Community 34`, `__init__.py`, `Community 38`, `Community 45`, `resolve_create_time_bounds`, `Community 46`, `Community 50`, `Community 51`, `Community 53`, `statistics.py`, `Community 54`, `__init__.py`, `Community 58`, `Community 60`, `Community 62`, `Community 63`, `Community 64`, `SoftDeleteModel`, `Community 66`, `create_from_quote`, `Community 65`, `Community 74`, `Community 86`, `list_customers`, `Community 109`, `Community 111`, `site.py`, `Community 119`, `Community 125`, `Community 127`?**
_High betweenness centrality (0.101) - this node is a cross-community bridge._
- **Why does `generate_uuid()` connect `_invoice_info_by_customer_impl` to `Community 0`, `plan.py`, `datetime_parse.py`, `Community 4`, `Community 5`, `Community 6`, `Community 134`, `Community 8`, `statistics.py`, `Community 136`, `Community 11`, `Community 13`, `Community 14`, `SysEthnic`, `dict_data.py`, `Community 15`, `resolve_crm_product`, `Community 19`, `Community 16`, `Community 21`, `response.py`, `Community 25`, `Community 28`, `Community 29`, `Community 33`, `get_client_ip`, `Community 36`, `Community 39`, `Community 43`, `Community 44`, `Community 45`, `Community 48`, `Community 49`, `allocate_next_biz_no`, `Community 58`, `Community 61`, `Community 62`, `Community 65`, `Community 66`, `Community 67`, `Community 68`, `Community 71`, `register_local_callback`, `Community 83`, `Community 87`, `pl_ocr_service.py`, `Community 92`, `Community 95`, `dept.py`, `apply_crm_create_by_scope`, `apply_pl_scope`, `Community 109`, `quote_share_log.py`, `db_models.py`, `site.py`, `Community 116`, `Community 118`, `Community 122`, `customer_pool.py`?**
_High betweenness centrality (0.099) - this node is a cross-community bridge._
- **Are the 8 inferred relationships involving `DbUserContext` (e.g. with `InventoryRelatedData` and `AutoGenerateMonthlyResult`) actually correct?**
_`DbUserContext` has 8 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?**
_539 weakly-connected nodes found - possible documentation gaps or missing edges._
- **Should `Community 1` be split into smaller, more focused modules?**
_Cohesion score 0.07804878048780488 - nodes in this community are weakly interconnected._
- **Should `Community 3` be split into smaller, more focused modules?**
_Cohesion score 0.07226107226107226 - 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
+202 -195
View File
@@ -1,16 +1,16 @@
# Graph Report - backend (2026-08-08)
# Graph Report - backend (2026-08-09)
## Corpus Check
- 326 files · ~212,760 words
- 329 files · ~214,176 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 4731 nodes · 15973 edges · 544 communities (525 shown, 19 thin omitted)
- Extraction: 97% EXTRACTED · 3% INFERRED · 0% AMBIGUOUS · INFERRED: 478 edges (avg confidence: 0.53)
- 4743 nodes · 16026 edges · 543 communities (527 shown, 16 thin omitted)
- Extraction: 97% EXTRACTED · 3% INFERRED · 0% AMBIGUOUS · INFERRED: 479 edges (avg confidence: 0.53)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `2df2ef08`
- Built from commit: `ca6aca2b`
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
- Run `graphify update .` after code changes (no API cost).
@@ -162,7 +162,6 @@
- [[_COMMUNITY_web_login_rsa_public_key|web_login_rsa_public_key]]
- [[_COMMUNITY_crm_contract_sub_routes.py|crm_contract_sub_routes.py]]
- [[_COMMUNITY_register_local_callback|register_local_callback]]
- [[_COMMUNITY_.to_tenant_user_dict|.to_tenant_user_dict]]
- [[_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]]
@@ -184,20 +183,18 @@
- [[_COMMUNITY_PlanResourceSnapshotMixin|PlanResourceSnapshotMixin]]
## God Nodes (most connected - your core abstractions)
1. `BaseModel` - 446 edges
1. `BaseModel` - 447 edges
2. `get_tenant_no()` - 350 edges
3. `success_response()` - 258 edges
4. `DbUserContext` - 254 edges
5. `error_response()` - 240 edges
6. `generate_uuid()` - 195 edges
5. `error_response()` - 239 edges
6. `generate_uuid()` - 198 edges
7. `BxUserContext` - 183 edges
8. `crm_user_info()` - 137 edges
9. `assert_row_deletable_by_creator()` - 83 edges
10. `ApiResponse` - 79 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]
@@ -206,27 +203,29 @@
scripts/migrate_crm_clue.py → app/core/config.py
- `StepStats` --uses--> `Settings` [INFERRED]
scripts/migrate_crm_clue.py → app/core/config.py
- `MigrationStats` --uses--> `Settings` [INFERRED]
scripts/migrate_crm_contract.py → app/core/config.py
## Import Cycles
- None detected.
## Communities (544 total, 19 thin omitted)
## Communities (543 total, 16 thin omitted)
### Community 0 - "Community 0"
Cohesion: 0.16
Nodes (32): check_document_expiry(), document_reminder_stats(), get_inventory_ledger(), get_summary(), list_document_reminders(), list_transactions(), list_warnings(), date (+24 more)
Cohesion: 0.15
Nodes (33): check_document_expiry(), document_reminder_stats(), get_inventory_ledger(), get_summary(), list_document_reminders(), list_transactions(), list_warnings(), date (+25 more)
### Community 1 - "Community 1"
Cohesion: 0.08
Nodes (38): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, 接口菜单权限守卫。super_admin 直接放行。, require_menu_code(), ContractApproverSettingSaveBody, ContractApprovalActionBody, ContractApprovalPassBody, ContractApprovalRejectBody, ContractApprovalTransferBody (+30 more)
Nodes (36): CRM 合同 API 路由 — GET/PUT/DELETE/POST 对齐原 Java CRM, ContractApproverSettingSaveBody, ContractApprovalActionBody, ContractApprovalPassBody, ContractApprovalRejectBody, ContractApprovalTransferBody, ContractBatchAssignBody, ContractBatchSubmitBody (+28 more)
### Community 2 - "Community 2"
Cohesion: 0.20
Nodes (27): _apply_inventory_product_update(), _apply_inventory_update(), _base_query(), create_inventory(), create_link_for_plan(), delete_inventory(), _generate_batch_no(), _get_inventory() (+19 more)
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 3 - "Community 3"
Cohesion: 0.07
Nodes (65): attachment_download_url(), attachment_preview_url(), create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite(), create_post() (+57 more)
Cohesion: 0.08
Nodes (95): attachment_download_url(), attachment_preview_url(), AttachmentDownloadUrlBody, create_dept(), create_dict_data(), create_dict_type(), create_menu(), create_menu_favorite() (+87 more)
### Community 4 - "Community 4"
Cohesion: 0.12
@@ -241,80 +240,80 @@ Cohesion: 0.11
Nodes (48): assign_customer(), batch_claim_customers(), check_duplicate_customer(), claim_customer(), create_customer(), deal_customer(), _enrich_user_names(), _ensure_customer_in_scope() (+40 more)
### Community 7 - "Community 7"
Cohesion: 0.05
Nodes (59): clue_check_convert(), clue_check_duplicate(), clue_park_area_list(), customer_check_duplicate(), customer_generate_no(), customer_park_area_list(), customer_transfer(), _opp_list_kwargs() (+51 more)
Cohesion: 0.06
Nodes (128): clue_check_convert(), clue_check_duplicate(), clue_detail(), clue_follow_detail(), clue_follow_statistics(), clue_import(), clue_list(), clue_mine() (+120 more)
### Community 8 - "Community 8"
Cohesion: 0.08
Nodes (75): register_quote_routes(), create_from_quote(), _quote_products_to_contract_products(), Java: createFromQuote — 返回合同 id, accept_quote(), delete_pending_approvals(), Java: deletePendingApprovals, assert_quote_editable_for_update() (+67 more)
Cohesion: 0.11
Nodes (55): register_quote_routes(), create_from_quote(), _quote_products_to_contract_products(), Java: createFromQuote — 返回合同 id, accept_quote(), assert_quote_editable_for_update(), _build_quote_filters(), calculate_quote_amount() (+47 more)
### Community 11 - "Community 11"
Cohesion: 0.11
Nodes (54): cancel_apply(), create_apply(), create_disburse(), delete_applies(), delete_disburses(), get_apply(), get_disburse(), list_applies() (+46 more)
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.07
Nodes (43): AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest, LoginResponse, Pydantic schemas - 用户认证, ResetPasswordRequest, UserCreate (+35 more)
Cohesion: 0.06
Nodes (59): customer_create(), customer_update(), customer_name_exists(), BaseModel, AttachmentUploadResponse, ChangePasswordRequest, Config, LoginRequest (+51 more)
### Community 13 - "Community 13"
Cohesion: 0.20
Nodes (7): BxAdvanceApply, BxAdvanceApproval, AdvanceService, Any, Session, 同一节点多次审批时,取 approval_time 最新的一条作为当前节点状态。, 返回全部审批动作,按时间正序排列,用于展示完整审批历史。
Cohesion: 0.12
Nodes (20): BxAdvanceApply, BxAdvanceApproval, AdvanceService, Any, Session, 同一节点多次审批时,取 approval_time 最新的一条作为当前节点状态。, 返回全部审批动作,按时间正序排列,用于展示完整审批历史。, filter_current_cycle_approvals() (+12 more)
### Community 14 - "Community 14"
Cohesion: 0.13
Nodes (41): approve_carrier(), bind_vehicle_driver(), create_carrier(), create_driver(), create_personnel(), delete_carrier(), delete_driver(), delete_personnel() (+33 more)
Cohesion: 0.09
Nodes (54): approve_carrier(), create_carrier(), create_driver(), create_personnel(), delete_carrier(), delete_driver(), delete_personnel(), delete_vehicle() (+46 more)
### Community 15 - "Community 15"
Cohesion: 0.10
Nodes (41): approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse(), get_approval_history(), get_approvals(), get_generated_title() (+33 more)
Cohesion: 0.12
Nodes (14): BxReimburseApply, BxReimburseApproval, BxReimburseDetail, BxReimburseInvoice, BxReimburseOffset, ReimburseApplyOut, ReimburseInvoiceBriefOut, Any (+6 more)
### Community 16 - "Community 16"
Cohesion: 0.09
Nodes (60): cancel_apply(), create_apply(), create_record(), delete_applies(), delete_records(), get_apply(), get_record(), list_applies() (+52 more)
Cohesion: 0.15
Nodes (39): PlVehicleRechargeApply, PlVehicleRechargeRecord, 车辆ETC/加油充值申请 pl_vehicle_recharge_apply, 车辆ETC/加油充值发放登记 pl_vehicle_recharge_record, Decimal, 发放登记页:申请单 + 关联发放信息(左连接), VehicleRechargeApplyRead, VehicleRechargeDisburseBoardItem (+31 more)
### Community 18 - "Community 18"
Cohesion: 0.09
Nodes (61): advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _fill_offset_amounts(), get_advance() (+53 more)
Cohesion: 0.11
Nodes (37): advance_pending_approval_stats(), advance_status_counts(), approve_advance(), approved_by_me(), create_advance(), delete_advance(), _fill_offset_amounts(), get_advance() (+29 more)
### Community 19 - "Community 19"
Cohesion: 0.06
Nodes (74): archive_plan(), cancel_plan(), cancel_plan_wait_notice(), count_plans_by_contract(), create_from_contract(), create_plan(), create_plan_full(), delete_plan() (+66 more)
Cohesion: 0.05
Nodes (89): archive_plan(), _build_driver_url(), cancel_plan(), cancel_plan_wait_notice(), count_plans_by_contract(), create_from_contract(), create_plan(), create_plan_full() (+81 more)
### Community 21 - "Community 21"
Cohesion: 0.09
Nodes (58): _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() (+50 more)
Cohesion: 0.08
Nodes (61): _alias_row_to_dict(), _assert_brand_deletable(), barcode_exists(), _brand_row_to_dict(), _build_category_tree(), category_code_exists(), _category_row_to_dict(), _collect_category_with_ancestors() (+53 more)
### Community 22 - "Community 22"
Cohesion: 0.08
Nodes (28): parse_admin_request_json(), Any, Request, 运营 Web(/web/admin)JSON 请求体解析。 与 ApiCryptoMiddleware 配合:中间件未改写 body 时,在路由内解密 `{, 读取 JSON body;dict 时走 resolve_request_payload(明文 / 密文 / data 包装)。 Returns:, ApiCryptoError, _b64url_decode(), _b64url_encode() (+20 more)
### Community 23 - "Community 23"
Cohesion: 0.14
Nodes (7): convert_heic_to_jpeg(), process_image_content(), QiniuStorage, 文件存储工具模块 支持多种存储方式: 1. 本地存储 (local) - 默认 2. 七牛云存储 (qiniu) - 推荐生产环境使用 3. 阿里云OSS (, 将 HEIC/HEIF 格式转换为 JPEG 格式, 处理图片内容,如果是 HEIC 格式则转换为 JPEG, BytesIO
Cohesion: 0.15
Nodes (6): convert_heic_to_jpeg(), process_image_content(), QiniuStorage, 将 HEIC/HEIF 格式转换为 JPEG 格式, 处理图片内容,如果是 HEIC 格式则转换为 JPEG, BytesIO
### Community 24 - "Community 24"
Cohesion: 0.26
Nodes (20): get_plan_related(), list_weighing(), format_datetime(), _create_by_name(), datetime_end_of_day(), fmt_date(), fmt_datetime(), inventory_date_to_api() (+12 more)
Cohesion: 0.15
Nodes (39): _apply_plan_update(), _base_query(), create_plan(), delete_plan(), _generate_plan_no(), get_plan(), _get_plan_by_id_only(), get_plan_related() (+31 more)
### Community 25 - "Community 25"
Cohesion: 0.12
Nodes (28): PlInventory, PlInventoryTransaction, 库存流水表 pl_inventory_transaction, load_brand_qtys_by_plan_product_ids(), persist_plan_product_brand_qtys(), Any, Decimal, Session (+20 more)
Cohesion: 0.21
Nodes (15): load_brand_qtys_by_plan_product_ids(), persist_plan_product_brand_qtys(), Any, Decimal, Session, 按计划产品明细 ID 批量加载归档品牌数量(brandId/brandName/qty)。, 软删旧品牌量行后按归档结果插入;无品牌约定则只软删不插入。, validate_brand_qty_rows() (+7 more)
### Community 26 - "Community 26"
Cohesion: 0.25
Nodes (10): _cert_url_blank(), plan_has_hazard_product_exists(), plan_has_incomplete_hazard_cert_exists(), 证书 URL 为空(NULL / 空串 / 纯空白)。, 列表筛选:计划下存在 CRM 标识为易制毒/易制爆的产品。, 列表筛选:存在危化产品且至少一张必需证书未上传。, _compile(), 危化品证上传列表筛选:EXISTS 子查询应覆盖 CRM 危化标识与证书缺口。 (+2 more)
Cohesion: 0.11
Nodes (34): Session, recognize_cert(), RecognizeCertBody, RecognizeCertResult, cancel_apply(), create_apply(), create_record(), delete_applies() (+26 more)
### Community 27 - "Community 27"
Cohesion: 0.05
Nodes (67): CRM 报价单 API 路由 — 挂接到 crm.router, BaseModel, PagedQuery, PagedResponse, InvoiceAttachmentOut, InvoiceOut, LedgerOut, WalletSummaryOut (+59 more)
Cohesion: 0.11
Nodes (32): CRM 报价单 API 路由 — 挂接到 crm.router, QuoteApproverSettingSaveBody, QuoteAcceptBody, QuoteApprovalApproveBody, QuoteApprovalListBody, QuoteApprovalRefreshNamesBody, QuoteApprovalWithdrawBody, QuoteCreateBody (+24 more)
### Community 28 - "Community 28"
Cohesion: 0.09
Nodes (64): PlFreightSettlement, PlFreightSettlementApproval, PlFreightSettlementTransport, PlRemittanceVoucher, 运费结算表 pl_freight_settlement, 运费结算审批 pl_freight_settlement_approval, 结算单-运输关联表 pl_freight_settlement_transport, 汇款凭证表 pl_remittance_voucher (+56 more)
Nodes (61): PlFreightSettlement, PlFreightSettlementApproval, PlFreightSettlementTransport, PlRemittanceVoucher, 运费结算表 pl_freight_settlement, 运费结算审批 pl_freight_settlement_approval, 结算单-运输关联表 pl_freight_settlement_transport, 汇款凭证表 pl_remittance_voucher (+53 more)
### Community 29 - "Community 29"
Cohesion: 0.10
Nodes (58): PlPlan, PlPlanChange, PlPlanProduct, PlPlanTransport, 计划产品明细表 pl_plan_product, 计划变更记录表 pl_plan_change, 计划-运输关联表 pl_plan_transport, PlanArchiveFreightBlock (+50 more)
Cohesion: 0.09
Nodes (62): QrCodeResponse, PlPlan, PlPlanProduct, PlPlanTransport, 计划产品明细表 pl_plan_product, 计划-运输关联表 pl_plan_transport, PlanArchiveFreightBlock, PlanArchiveProductItem (+54 more)
### Community 30 - "Community 30"
Cohesion: 0.16
@@ -322,115 +321,115 @@ Nodes (26): clear_target_categories(), compute_level(), count_target_rows(), der
### Community 33 - "Community 33"
Cohesion: 0.14
Nodes (21): 报销模块认证适配:门户 JWT 用户 → bx 业务上下文。, BxReimburseInvoice, BxReimburseOffset, BxWorkflowNode, 报销(bx)模块数据模型 — 对齐 docs/sql/20260606_bx_tables.sql, filter_current_cycle_approvals(), 审批轮次过滤 — 驳回后重新提交时,进度接口仅展示当前轮次。, 审批进度仅展示当前轮次;完整历史由 get_approval_history 返回。 (+13 more)
Nodes (24): PlTransportProductBrandQty, PlTransportProductFeedback, 运输单按产品回传 pl_transport_product_feedback, 运输单产品回传品牌数量 pl_transport_product_brand_qty, _dict_field(), format_brand_qty_summary(), load_transport_driver_product_feedbacks(), persist_io_item_brand_qtys() (+16 more)
### Community 34 - "Community 34"
Cohesion: 0.15
Nodes (32): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), create_process_def(), delete_process_def(), _enrich_task_list(), get_business_all_tasks(), _get_business_form_fields() (+24 more)
Cohesion: 0.09
Nodes (45): approve_task(), _assert_wf_instance_in_scope(), _business_type_label(), create_process_def(), delete_process_def(), _enrich_task_list(), get_business_all_tasks(), _get_business_form_fields() (+37 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.15
Nodes (27): 验证密码(哈希非 bcrypt 或损坏时返回 False,避免抛错), verify_password(), change_password(), create_user(), get_user(), get_user_with_relations(), _hash_password(), list_post_ids_for_user() (+19 more)
Cohesion: 0.08
Nodes (42): 验证密码(哈希非 bcrypt 或损坏时返回 False,避免抛错), verify_password(), list_ethnics(), Any, Session, 民族码表 CRUD(全局 sys_ethnic), _row_to_dict(), change_password() (+34 more)
### Community 37 - "Community 37"
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 38 - "Community 38"
Cohesion: 0.20
Nodes (13): create_expense_item(), delete_expense_item(), get_expense_item(), get_expense_item_tree(), Session, update_expense_item(), BxExpenseItem, _coerce_id() (+5 more)
Cohesion: 0.15
Nodes (17): create_expense_item(), delete_expense_item(), get_expense_item(), get_expense_item_tree(), Session, update_expense_item(), BxExpenseItem, _coerce_id() (+9 more)
### Community 39 - "Community 39"
Cohesion: 0.22
Nodes (27): assign_clues(), check_convert(), check_duplicate_clue(), convert_clue(), create_clue(), _enrich_user_names(), _ensure_clue_in_scope(), get_clue() (+19 more)
Nodes (28): assign_clues(), check_convert(), check_duplicate_clue(), convert_clue(), create_clue(), _enrich_user_names(), _ensure_clue_in_scope(), get_clue() (+20 more)
### Community 42 - "Community 42"
Cohesion: 0.20
Nodes (31): _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() (+23 more)
### Community 43 - "Community 43"
Cohesion: 0.11
Nodes (27): create_invoice(), delete_invoice(), get_mine_wallet_summary(), list_invoice_ledgers(), list_invoice_wallets(), list_invoices(), Request, Session (+19 more)
Cohesion: 0.10
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.08
Nodes (81): register_contract_routes(), _apply_contract_entity_fields(), batch_assign_owner(), batch_submit_contract_approval(), _build_contract_filters(), _build_contract_name_from_parties(), _build_customer_address(), _calc_amount_with_tax() (+73 more)
Cohesion: 0.09
Nodes (59): register_contract_routes(), batch_assign_owner(), batch_submit_contract_approval(), _build_contract_name_from_parties(), _build_customer_address(), _contract_period_key(), contract_row_to_dict(), download_contract_pdf() (+51 more)
### Community 45 - "Community 45"
Cohesion: 0.08
Nodes (72): _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() (+64 more)
Cohesion: 0.07
Nodes (86): get_plan_arrange_info(), 获取计划已安排运输后的司机链接与地磅出入库关联(供查看弹窗复制简述/二维码)。, _build_public_page(), _format_file_size(), _format_plan_date(), get_public_transport(), _get_transport_by_token(), _parse_feedback_images() (+78 more)
### Community 46 - "Community 46"
Cohesion: 0.06
Nodes (55): customer_create(), customer_delete(), customer_update(), opportunity_follow_add(), opportunity_follow_update(), pool_customer_assign(), pool_customer_claim(), pool_customer_list() (+47 more)
Nodes (58): clue_assign(), clue_convert(), clue_create(), clue_delete(), clue_follow_create(), clue_follow_delete(), clue_follow_list(), clue_follow_update() (+50 more)
### Community 48 - "Community 48"
Cohesion: 0.27
Nodes (10): 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() (+2 more)
Cohesion: 0.18
Nodes (15): AutoGenerateMonthlyResult, 手动触发计划按月自动生成(定时任务同款逻辑)。, run_auto_generate_monthly(), get_last_month_range(), month_range(), date, Session, 地磅计划按月自动生成 — 迁移自 simple-dibang-xiaoshou/auto-create-plan/auto_create_monthly_pla (+7 more)
### Community 49 - "Community 49"
Cohesion: 0.13
Nodes (32): create_clue_follow(), delete_clue_follow(), get_clue_follow(), get_follow_statistics(), list_clue_follows(), Any, Session, 更新线索跟进记录,必要时同步线索 next_time (+24 more)
Cohesion: 0.15
Nodes (30): create_clue_follow(), delete_clue_follow(), get_clue_follow(), get_follow_statistics(), list_clue_follows(), Any, Session, 更新线索跟进记录,必要时同步线索 next_time (+22 more)
### Community 50 - "Community 50"
Cohesion: 0.25
Nodes (17): _cargo_stats(), get_dashboard_stats(), get_inbound_by_cargo(), get_inbound_by_partner_cargo(), get_outbound_by_cargo(), get_outbound_by_partner_cargo(), _partner_cargo_stats(), Session (+9 more)
Cohesion: 0.32
Nodes (16): _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 (+8 more)
### Community 51 - "Community 51"
Cohesion: 0.05
Nodes (57): operlog_detail(), operlog_list(), Session, 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), _user_info(), ApiRequestLogMiddleware, _claims_from_auth(), _format_body_bytes() (+49 more)
Cohesion: 0.24
Nodes (7): camel_to_snake(), CRUDBase, get_model_attr(), HistoryCRUD, Any, Session, ModelType
### Community 52 - "Community 52"
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 53 - "Community 53"
Cohesion: 0.34
Nodes (30): AttachmentDownloadUrlBody, DeptCreateBody, DeptUpdateBody, DictDataCreateBody, DictDataUpdateBody, DictTypeCreateBody, DictTypeUpdateBody, MenuCreateBody (+22 more)
Cohesion: 0.22
Nodes (22): advance_issue_stats(), batch_offset(), export_advance_issues(), issue_advance(), list_advance_issues(), list_advance_offset_records(), list_pending_payments(), list_processed_payments() (+14 more)
### Community 54 - "Community 54"
Cohesion: 0.23
Nodes (25): _get_by_plan(), get_inbound(), get_inbound_by_plan(), _get_order(), get_outbound(), get_outbound_by_plan(), inbound_site_url(), list_inbound() (+17 more)
Cohesion: 0.26
Nodes (23): _get_by_plan(), get_inbound(), get_inbound_by_plan(), _get_order(), get_outbound(), get_outbound_by_plan(), inbound_site_url(), list_inbound() (+15 more)
### Community 58 - "Community 58"
Cohesion: 0.17
Nodes (26): _apply_plan_product_update(), _apply_plan_update(), AutoGenerateMonthlyResult, _base_query(), create_plan(), delete_plan(), _generate_plan_no(), get_plan() (+18 more)
Cohesion: 0.20
Nodes (22): _apply_contract_entity_fields(), _build_contract_filters(), _calc_amount_with_tax(), contract_no_exists(), create_contract(), create_from_opportunity(), _decimal_value(), _get_field() (+14 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.09
Nodes (21): 分页查询供方列表 — Java: CrmSupplierInfoController.list, 供方全量列表(下拉)— Java: CrmSupplierInfoController.listAll, 供方详情 — Java: CrmSupplierInfoController.getInfo, 新增供方 — Java: CrmSupplierInfoController.add, 修改供方 — Java: CrmSupplierInfoController.edit, 删除供方 — Java: CrmSupplierInfoController.remove, 导出供方列表 — Java: CrmSupplierInfoController.export, supplier_info_add() (+13 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 61 - "Community 61"
Cohesion: 0.11
Nodes (43): PlTransportDbLink, 运输-地磅出入库关联 pl_transport_db_link, _apply_plan_quantity_delta(), _create_db_inventory(), _create_db_plan(), DibangInventoryLinkResult, find_monthly_db_plan(), _generate_batch_no() (+35 more)
Cohesion: 0.16
Nodes (35): PlanRelatedData, DbInboundOutbound, DbPurchasePlan, PlTransportDbLink, 运输-地磅出入库关联 pl_transport_db_link, _apply_plan_quantity_delta(), _create_db_inventory(), _create_db_plan() (+27 more)
### Community 62 - "Community 62"
Cohesion: 0.18
Nodes (25): _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), _get_weighing(), get_weighing_related(), Session (+17 more)
Cohesion: 0.16
Nodes (25): 地磅 API 路由聚合 — REST 风格,协议对齐原 simple-dibang-xiaoshou。, _apply_weighing_product_update(), _apply_weighing_update(), _base_query(), create_weighing(), delete_weighing(), _get_weighing(), get_weighing_related() (+17 more)
### Community 63 - "Community 63"
Cohesion: 0.13
Nodes (11): _coerce_id(), OffsetItem, PaymentFinanceStatsOut, 报销单勾选的发票附件(同一发票可勾选多个附件,各占一条)。, ReimburseApplyCreate, ReimburseApprovalOut, ReimburseApproverPendingStatsOut, ReimburseDetailCreate (+3 more)
Cohesion: 0.10
Nodes (40): bx_health(), 报销(bx)API 路由聚合 — REST 风格,协议对齐 bx 原系统。, P0 健康检查:验证 bx 路由已挂载且响应协议为 code=0。, approve_reimburse(), approved_by_me(), _build_details_data(), create_reimburse(), delete_reimburse() (+32 more)
### Community 64 - "Community 64"
Cohesion: 0.09
Nodes (63): clue_detail(), clue_export(), clue_follow_detail(), clue_follow_statistics(), clue_import(), clue_list(), clue_mine(), clue_to_follow() (+55 more)
Cohesion: 0.11
Nodes (23): clue_export(), clue_import_template(), contact_birthday(), contact_by_customer(), contact_decision(), contact_export(), contact_list(), contact_primary() (+15 more)
### Community 65 - "Community 65"
Cohesion: 0.10
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.19
Nodes (17): create_workflow(), delete_workflow(), get_workflow(), get_workflow_by_biz_type(), list_workflows(), Session, save_workflow_nodes(), update_workflow() (+9 more)
Cohesion: 0.16
Nodes (20): create_workflow(), delete_workflow(), get_workflow(), get_workflow_by_biz_type(), list_workflows(), Session, save_workflow_nodes(), update_workflow() (+12 more)
### Community 67 - "Community 67"
Cohesion: 0.12
@@ -441,28 +440,28 @@ 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 69 - "Community 69"
Cohesion: 0.12
Nodes (31): _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 (+23 more)
Cohesion: 0.11
Nodes (32): _append_user_scope_conditions(), apply_data_scope(), assert_row_in_data_scope(), _collect_scope_ids(), _get_child_dept_ids(), get_user_dept_id(), Session, 数据权限过滤(V0.3:基于角色 data_scope 的查询级行级过滤) data_scope 值: 1 = 全部数据 2 = 本部门数据 3 (+24 more)
### Community 70 - "Community 70"
Cohesion: 0.18
Nodes (18): align_contract_no_to_sign_date(), generate_contract_no(), date, Java: generateContractNo — {供方编码}/X-JT{yyyyMMdd}{3位序号} 流水与撞号检测须含软删:uk_contr, 标准编号替换日期段,保留序号;非标准返回 None。, 将标准合同编号日期段对齐签订日;撞号则序号顺延(含软删查重)。 非标准编号原样返回。无签订日则原样返回。, replace_contract_no_date(), _mock_last_contract() (+10 more)
### Community 71 - "Community 71"
Cohesion: 0.15
Nodes (26): create_vehicle(), get_vehicle(), list_personnel(), list_vehicles(), update_vehicle(), _vehicle_to_detail(), _vehicle_to_read(), PlCert (+18 more)
Cohesion: 0.11
Nodes (31): list_personnel(), list_vehicles(), PlCert, PlDocumentReminder, 证件到期提醒表 pl_document_reminder, CertRead, 运输计划 - 安排运输时车辆/人员/证件资源快照 Schema, SnapshotCertRead (+23 more)
### Community 72 - "Community 72"
Cohesion: 0.19
Nodes (28): apply_biz_backfill(), BackfillRule, BizRef, build_biz_index(), count_target_rows(), derive_source_url(), fetch_portal_admin_id(), fetch_source_rows() (+20 more)
Cohesion: 0.18
Nodes (30): Settings, BaseSettings, apply_biz_backfill(), BackfillRule, BizRef, build_biz_index(), count_target_rows(), derive_source_url() (+22 more)
### Community 73 - "Community 73"
Cohesion: 0.20
Nodes (25): derive_source_url(), fetch_portal_admin_id(), fetch_source_rows(), legacy_id_to_str(), load_oss_id_to_url(), load_runtime_settings(), load_settings_env(), load_user_mapping() (+17 more)
### Community 74 - "Community 74"
Cohesion: 0.04
Nodes (58): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), menu_badge_stats() (+50 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 77 - "Community 77"
Cohesion: 0.11
@@ -485,12 +484,12 @@ 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 86 - "Community 86"
Cohesion: 0.25
Nodes (7): contact_add(), contact_delete(), contact_update(), ContactCreateBody, ContactDeleteBody, ContactUpdateBody, CRM 联系人 Pydantic Schemas
Cohesion: 0.18
Nodes (10): contact_add(), contact_delete(), contact_update(), ContactByCustomerBody, ContactCreateBody, ContactDeleteBody, ContactDetailBody, ContactSetPrimaryBody (+2 more)
### Community 87 - "Community 87"
Cohesion: 0.22
Nodes (17): approve_quote(), can_user_approve(), create_approval_records(), get_quote_approval(), list_quote_approvals(), Any, Session, CRM 报价单审批 CRUD — 对照 CrmQuoteApprovalServiceImpl.java (+9 more)
Cohesion: 0.20
Nodes (19): approve_quote(), can_user_approve(), create_approval_records(), delete_pending_approvals(), get_quote_approval(), list_quote_approvals(), Any, Session (+11 more)
### Community 88 - "Any"
Cohesion: 0.18
@@ -502,19 +501,19 @@ Nodes (22): PlOcrUsageMonth, 阿里云 OCR 月度调用计数 pl_ocr_usage_month
### Community 91 - "pl_vehicle_recharge_service.py"
Cohesion: 0.17
Nodes (12): 流程实例 wf_process_instance, WfProcessInstance, _dispatch_local(), Any, 工作流回调服务 —— 流程状态变更时通知业务系统, 尝试本地直调。返回 True 表示已处理,False 表示无匹配的本地回调。, 流程实例状态变更后,向业务系统发送回调通知。 优先级: 1. 如果 callback_url 是内部路径(以 / 开头),优先尝试本地直调, trigger_callback() (+4 more)
Nodes (16): get_pool_record(), list_pool_records(), Any, Session, _row_to_dict(), total_pages(), CrmCustomerPool, CRM 模块数据模型(产品分类、产品主表、统一附件表、客户管理、公海池、线索管理) (+8 more)
### Community 92 - "Community 92"
Cohesion: 0.20
Nodes (21): _assert_users_exist(), get_setting(), Any, Session, _row_to_dict(), save_setting(), _assert_users_exist(), get_setting() (+13 more)
### Community 93 - "_invoice_info_by_customer_impl"
Cohesion: 0.08
Nodes (43): generate_uuid(), get_current_time(), parse_datetime(), datetime, get_pool_record(), list_pool_records(), Any, Session (+35 more)
Cohesion: 0.11
Nodes (26): generate_uuid(), get_current_time(), parse_datetime(), datetime, allocate_next_biz_no(), _format_biz_no(), _prefix_for(), datetime (+18 more)
### Community 94 - "response.py"
Cohesion: 0.17
Nodes (17): 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() (+9 more)
Cohesion: 0.16
Nodes (19): 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() (+11 more)
### Community 95 - "Community 95"
Cohesion: 0.35
@@ -525,12 +524,12 @@ 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 100 - "price_letter_detail"
Cohesion: 0.27
Nodes (15): Settings, BaseSettings, apply_renumber(), build_mapping(), fetch_products(), format_new_product_no(), load_settings_env(), main() (+7 more)
Cohesion: 0.31
Nodes (13): apply_renumber(), build_mapping(), fetch_products(), format_new_product_no(), load_settings_env(), main(), product_id_sort_key(), Engine (+5 more)
### Community 101 - ".to_tenant_user_dict"
Cohesion: 0.19
Nodes (14): CRM 模块 Excel 导出列定义(字段与字典类型对齐 Java *Vo @ExcelDictFormat)。, _build_workbook(), DictLabelResolver, export_rows_to_xlsx_response(), ExportColumn, load_dict_label_maps(), Any, Session (+6 more)
Cohesion: 0.21
Nodes (11): CRM 模块 Excel 导出列定义(字段与字典类型对齐 Java *Vo @ExcelDictFormat)。, _build_workbook(), DictLabelResolver, ExportColumn, load_dict_label_maps(), Any, Session, Excel 导出工具:集中处理字典 code → label(对齐 Java ExcelDictConvert / ExcelDictPreloadConver (+3 more)
### Community 102 - "dept.py"
Cohesion: 0.36
@@ -541,48 +540,48 @@ 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 - "list_customers"
Cohesion: 0.29
Nodes (6): Config, format_api_error_message(), PageResult, Exception, 将 HTTP/SQLAlchemy 等异常转为可展示的错误文案(避免 str([]) 空列表)。, ResponseModel
Cohesion: 0.09
Nodes (25): API 路由包 — 山峡化工生产一体化门户, get_menu_list(), 运营端菜单接口(与 web-admin 前端静态路由 sqxp.ts 对齐,14 个一级菜单), operlog_detail(), operlog_list(), Session, 操作日志分页列表(基于 API 请求日志适配 RuoYi OperLog 结构), _user_info() (+17 more)
### Community 106 - "Community 106"
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.15
Nodes (17): _avatar_url_field(), _build_user_info_payload(), change_current_user_password(), get_current_user_profile(), public_quote_share(), Request, Session, 获取当前用户信息(与 sys_user 字段对应)。 (+9 more)
### Community 107 - "apply_pl_scope"
Cohesion: 0.16
Nodes (31): 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() (+23 more)
Nodes (30): 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() (+22 more)
### Community 109 - "Community 109"
Cohesion: 0.29
Nodes (16): paste_recognize_commit(), PlVehicle, ConflictAction, PasteCommitBody, PasteCommitResult, PastePersonnelIn, PasteVehicleIn, 运输计划 - 三方粘贴识别提交 Schema (+8 more)
Cohesion: 0.27
Nodes (17): bind_vehicle_driver(), paste_recognize_commit(), ConflictAction, PasteCommitBody, PasteCommitResult, PastePersonnelIn, PasteVehicleIn, 运输计划 - 三方粘贴识别提交 Schema (+9 more)
### Community 110 - "Base"
Cohesion: 0.18
Nodes (11): Config, decrypt_login_payload(), ensure_initialized(), extract_login_credentials(), get_public_pem(), Any, 登录凭据 RSA 解密(与前端 JSEncrypt PKCS#1 v1.5 兼容)。, Base64 密文 -> JSON 对象(须含 username、password、ts 毫秒时间戳)。 (+3 more)
### Community 111 - "Community 111"
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.21
Nodes (17): _assert_editable(), _build_public_page(), _format_file_size(), _get_inventory_by_token(), get_public_inventory(), _parse_feedback_images(), Session, UploadFile (+9 more)
### Community 112 - "storage.py"
Cohesion: 0.06
Nodes (58): 返回 (作废, 归档)。现场链接实际走入库/出库单公共页。, _resolve_io_order_link_flags(), _build_public_page(), _build_site_product_read(), _format_file_size(), get_public_site(), _get_site_link_by_token(), _parse_feedback_images() (+50 more)
Cohesion: 0.12
Nodes (30): _build_public_page(), _build_site_product_read(), _format_file_size(), get_public_site(), _get_site_link_by_token(), _parse_feedback_images(), Session, UploadFile (+22 more)
### Community 113 - "quote_share_log.py"
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 114 - "db_models.py"
Cohesion: 0.24
Nodes (12): DbSequence, 地磅(db)模块数据模型 — 对齐 docs/sql/db_tables.sql, _allocate_inbound_outbound_id(), _ensure_sequence_row(), max_numeric_inbound_outbound_id(), next_inbound_outbound_id(), Session, 出入库单 id 生成 — 租户内纯数字自增,并发安全。 (+4 more)
Cohesion: 0.16
Nodes (17): list_public_vehicle_plates(), Session, 地磅公共只读:免登车牌 options(现场填写页), 免登:按出入库/计划解析 tenant_no,返回 pl_vehicle 车牌(self + carrier)。, _resolve_tenant_no(), DbSequence, 地磅(db)模块数据模型 — 对齐 docs/sql/db_tables.sql, _allocate_inbound_outbound_id() (+9 more)
### Community 115 - "site.py"
Cohesion: 0.28
Nodes (17): _address_to_read(), _build_address_query(), create_transport_address(), delete_transport_address(), _get_address(), get_transport_address(), list_all_transport_addresses(), list_transport_addresses() (+9 more)
### Community 116 - "Community 116"
Cohesion: 0.19
Nodes (26): batch_insert_quote_products(), calculate_subtotal(), _decimal_value(), _ensure_quote_parent_scope(), _get_field(), get_quote_product(), insert_quote_product(), list_products_by_quote_ids() (+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 118 - "Community 118"
Cohesion: 0.20
@@ -590,15 +589,15 @@ Nodes (24): batch_insert_contract_products(), calculate_subtotal(), _decimal_val
### Community 119 - "Community 119"
Cohesion: 0.16
Nodes (29): CertRow, VehiclePersonnelRow, _cert_row_complete(), collect_required_cert_errors(), _find_cert_for_required(), get_required_personnel_cert_names(), match_required_cert_name(), _missing_field_labels() (+21 more)
Nodes (28): CertRow, _cert_row_complete(), collect_required_cert_errors(), _find_cert_for_required(), get_required_personnel_cert_names(), match_required_cert_name(), _missing_field_labels(), Session (+20 more)
### Community 122 - "Community 122"
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 125 - "Community 125"
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)
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 126 - "customer_pool.py"
Cohesion: 0.36
@@ -606,7 +605,7 @@ Nodes (13): _build_tree(), _cascade_soft_delete(), create_menu(), get_menu(), li
### Community 127 - "Community 127"
Cohesion: 0.11
Nodes (38): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), _generate_settlement_no(), get_settlement(), get_settlement_approval_flow() (+30 more)
Nodes (37): approve_settlement_legacy(), cancel_settlement(), create_settlement(), delete_settlement(), disburse_settlement(), _generate_settlement_no(), get_settlement(), get_settlement_approval_flow() (+29 more)
### Community 128 - "plan.py"
Cohesion: 0.39
@@ -617,8 +616,8 @@ 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 - "datetime_parse.py"
Cohesion: 0.29
Nodes (16): ensure_crm_customer_linked_row_in_scope(), ensure_crm_owner_row_in_scope(), Session, CRM 数据权限辅助(负责人 owner_user_id + 标准 create_by/create_dept_id)。, 客户子表(开票信息等):先校验关联客户 owner scope,否则校验 create_by。, _clear_default_for_customer(), create_invoice_info(), get_invoice_info() (+8 more)
Cohesion: 0.32
Nodes (14): ensure_crm_customer_linked_row_in_scope(), CRM 数据权限辅助(负责人 owner_user_id + 标准 create_by/create_dept_id)。, 客户子表(开票信息等):先校验关联客户 owner scope,否则校验 create_by。, _clear_default_for_customer(), create_invoice_info(), get_invoice_info(), list_invoice_info_by_customer(), Any (+6 more)
### Community 131 - "LocalStorage"
Cohesion: 0.60
@@ -634,11 +633,11 @@ Nodes (18): batch_generate_sample_codes(), batch_issue_sample_codes(), batch_rev
### Community 135 - "unsettled_plans_q_filter"
Cohesion: 0.08
Nodes (23): category_add(), category_delete(), category_tree(), category_update(), product_add(), product_delete(), product_detail(), product_options() (+15 more)
Nodes (25): category_add(), category_delete(), category_tree(), category_update(), product_add(), product_delete(), product_detail(), product_options() (+17 more)
### Community 136 - "Community 136"
Cohesion: 0.26
Nodes (14): 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) (+6 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 137 - "statistics.py"
Cohesion: 0.35
@@ -653,24 +652,24 @@ Cohesion: 0.22
Nodes (15): get_storage(), download_file_bytes(), file_stream(), get_access_url(), get_download_url(), get_preview_url(), normalize_storage_path(), 报销附件存储适配 — 复用门户 app.core.storage,对外保持 bx 协议。 (+7 more)
### Community 141 - "PlTransport"
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)
Cohesion: 0.60
Nodes (5): product_allowed(), test_dual_requires_both(), test_explosive_only_requires_allow_explosive(), test_plain_always_allowed(), test_toxic_only_requires_allow_toxic()
### Community 143 - "SysEthnic"
Cohesion: 0.40
Nodes (9): create_leave(), get_leave(), list_leaves(), Any, Session, _row_to_dict(), soft_delete_leave(), update_leave() (+1 more)
Cohesion: 0.22
Nodes (17): _apply_list_filters(), create_supplier_info(), get_supplier_info(), list_all_supplier_info(), list_supplier_info(), Any, Session, CRM 供方信息 CRUD — 对照 CrmSupplierInfoServiceImpl.java (+9 more)
### Community 144 - "dict_data.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 145 - "resolve_crm_product"
Cohesion: 0.14
Nodes (21): PlVehiclePersonnel, 车辆-人员关联表 pl_vehicle_personnel, 运输计划 - 安排运输时车辆/人员/证件资源快照 Schema, SnapshotCertRead, SnapshotPersonnelRow, TransportResourceSnapshot, build_personnel_summary(), load_vehicle_personnel_rows() (+13 more)
Cohesion: 0.20
Nodes (19): create_vehicle(), get_vehicle(), update_vehicle(), _vehicle_to_detail(), _vehicle_to_read(), PlVehicle, PlVehiclePersonnel, 车辆-人员关联表 pl_vehicle_personnel (+11 more)
### Community 146 - "__init__.py"
Cohesion: 0.13
Nodes (16): CarrierBase, CarrierCreate, CarrierQualificationBase, PersonnelBase, PersonnelCreate, PersonnelListResponse, PersonnelUpdate, 运输计划管理 - 基础数据 Schema(承运商、车辆、人员、证书) (+8 more)
Cohesion: 0.22
Nodes (15): ApiRequestLogMiddleware, _claims_from_auth(), _format_body_bytes(), _persist_log(), Any, Request, 统一记录 API 请求/响应出入参的中间件, _redact_obj() (+7 more)
### Community 147 - "Community 147"
Cohesion: 0.37
@@ -681,24 +680,24 @@ Cohesion: 0.17
Nodes (8): 发送订单状态通知 Args: openid: 用户openid order_n, 发送支付成功通知 Args: openid: 用户openid order_n, 发送配送通知 Args: openid: 配送员openid task_no:, 发送配送时效预警 Args: openid: 配送员openid task_n, 发送退款结果通知 Args: openid: 用户openid order_n, 发送催单通知给配送员 Args: deliver_openid: 配送员openid, 发送模板消息 Args: openid: 用户openid template_, WechatMessageService
### Community 152 - "response.py"
Cohesion: 0.29
Nodes (16): create_contact(), get_contact(), list_contacts_by_customer(), _parse_optional_date(), Any, date, Session, _row_to_dict() (+8 more)
Cohesion: 0.30
Nodes (14): create_contact(), get_contact(), _parse_optional_date(), date, Session, set_primary_contact(), soft_delete_contact(), total_pages() (+6 more)
### Community 154 - "response.py"
Cohesion: 0.19
Nodes (7): _guess_preview_content_type(), MinIOStorage, Any, 从 MINIO_BASE_URL 解析公网 endpoint;未配置或与内网相同时复用 self.client。, 按对象键后缀推断内联预览 Content-Type(纠正上传时未写入 MIME 的情况)。, MinIO 预签名下载 URL,携带原始文件名。, MinIO 预签名内联预览 URL(图片新标签页 / PDF iframe 等)。 上传时 put_object 未写 content_typ
Cohesion: 0.24
Nodes (5): MinIOStorage, Any, 从 MINIO_BASE_URL 解析公网 endpoint;未配置或与内网相同时复用 self.client。, MinIO 预签名下载 URL,携带原始文件名。, MinIO 预签名内联预览 URL(图片新标签页 / PDF iframe 等)。 上传时 put_object 未写 content_typ
### Community 156 - "utils.py"
Cohesion: 0.24
Cohesion: 0.26
Nodes (16): allocate_reimburse_title_seq(), format_reimburse_title(), generate_apply_code(), generate_title(), is_auto_reimburse_title(), parse_reimburse_date(), preview_reimburse_title_seq(), date (+8 more)
### Community 159 - "customer_update"
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)
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 160 - "register_local_callback"
Cohesion: 0.20
Nodes (16): API 路由包 — 山峡化工生产一体化门户, create_leave(), delete_leave(), get_leave(), _leave_local_callback(), leave_workflow_callback(), list_leaves(), Session (+8 more)
Cohesion: 0.12
Nodes (29): create_leave(), delete_leave(), get_leave(), _leave_local_callback(), leave_workflow_callback(), list_leaves(), Session, submit_leave() (+21 more)
### Community 161 - "backfill_crm_contract_attachment_urls.py"
Cohesion: 0.33
@@ -709,12 +708,12 @@ 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 163 - "__init__.py"
Cohesion: 0.20
Nodes (15): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+7 more)
Cohesion: 0.12
Nodes (27): bind_biz(), delete_attachment(), download_file(), list_by_biz(), _parse_id_list(), preview_attachment(), Session, UploadFile (+19 more)
### Community 164 - "get_client_ip"
Cohesion: 0.15
Nodes (29): _jwt_user_payload(), logout(), 公共接口(Web 登录、刷新 Token、登出;用户模型对齐 docs/sql/shanxia2.0.sql 基线), 登出:吊销 Redis 会话(若已配置 REDIS_HOST)。, Web 端登录:账号为 sys_user.user_no,密码为 sys_user.password(bcrypt)。, refresh_token(), web_login(), create_access_token() (+21 more)
Nodes (29): _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() (+21 more)
### Community 170 - "test_quote_approver_setting.py"
Cohesion: 0.22
@@ -725,60 +724,68 @@ Cohesion: 0.24
Nodes (13): normalize_attachment_csv(), normalize_attachment_csv(), extract_minio_object_key(), join_relative_urls(), normalize_oss_storage_url(), MinIO 附件 URL 规范化(数据迁移共用)。 背景 ---- CRM / 地磅 / 报销与 shanxia2.0 共用同一 MinIO(bucket 默, 业务表 OSS ID 串 → 相对 URL 串(用于客户证照、跟进附件等)。, 去掉预签名 query(``?X-Amz-...``)。 (+5 more)
### Community 172 - "apply_pl_scope"
Cohesion: 0.49
Nodes (10): apply_pl_scope(), Session, build_menu_badge_counts(), count_document_reminder_expired_pending(), count_freight_approval_pending(), count_freight_disburse_pending(), _count_pending_applies(), count_plan_archive_pending() (+2 more)
Cohesion: 0.25
Nodes (14): menu_badge_stats(), Session, PlMenuBadgeStatsRead, apply_pl_scope(), Session, build_menu_badge_counts(), count_document_reminder_expired_pending(), count_freight_approval_pending() (+6 more)
### Community 173 - "resolve_create_time_bounds"
Cohesion: 0.08
Nodes (39): ApiRequestLogCRUD, Session, list_ethnics(), Any, Session, 民族码表 CRUD(全局 sys_ethnic), _row_to_dict(), BizAttachment (+31 more)
Nodes (42): PlDriver, PlInboundOrder, PlInboundOrderItem, PlInboundOrderItemBrandQty, PlInventory, PlInventoryTransaction, PlInventoryWarning, PlOutboundOrder (+34 more)
### Community 174 - "register_local_callback"
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()
Cohesion: 0.19
Nodes (15): 返回 (作废, 归档)。现场链接实际走入库/出库单公共页。, _resolve_io_order_link_flags(), _resolve_site_link_flags(), _resolve_driver_link_flags(), 运输计划司机/现场公共链接:归档后应标记并拦截写操作。, test_driver_link_flags_archived_when_plan_archived(), test_driver_link_flags_voided_by_transport_cancelled(), test_driver_link_flags_voided_takes_precedence_shape() (+7 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 180 - "OSSStorage"
Cohesion: 0.20
Nodes (4): _guess_preview_content_type(), OSSStorage, 文件存储工具模块 支持多种存储方式: 1. 本地存储 (local) - 默认 2. 七牛云存储 (qiniu) - 推荐生产环境使用 3. 阿里云OSS (, 按对象键后缀推断内联预览 Content-Type(纠正上传时未写入 MIME 的情况)。
### Community 181 - "allocate_next_biz_no"
Cohesion: 0.33
Nodes (8): allocate_next_biz_no(), _format_biz_no(), _prefix_for(), datetime, Session, 业务协议号自动生成:XBCC / JZCC + YYYYMMDD + 6 位序号, 原子分配下一个业务协议号。 须在 create 事务内调用;使用 MySQL LAST_INSERT_ID 保证并发安全。, BizNoKind
Cohesion: 0.20
Nodes (15): _fill_contract_linked_count(), list_quotes(), _parse_optional_datetime(), _period_key(), Any, datetime, query_versions(), quote_row_to_dict() (+7 more)
### Community 182 - "statistics.py"
Cohesion: 0.17
Nodes (25): clue_import_template(), customer_import_template(), product_import_template(), statistics_follow(), statistics_industry(), statistics_level(), statistics_overview(), statistics_owner() (+17 more)
Cohesion: 0.45
Nodes (11): _customer_base_query(), get_follow_statistics(), get_industry_statistics(), get_level_statistics(), get_overview_statistics(), get_owner_statistics(), get_source_statistics(), get_trend_statistics() (+3 more)
### Community 183 - "resolve_create_time_bounds"
Cohesion: 0.52
Nodes (6): parse_create_time_day_bounds(), _parse_day_start(), datetime, 报销模块日期范围工具(从 bx-backend 迁移)。, 解析申请时间筛选边界,返回 (含起, 不含止)。, resolve_create_time_bounds()
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 184 - "__init__.py"
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 187 - "_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.17
Nodes (11): price_letter_add(), price_letter_detail(), price_letter_list(), price_letter_update(), price_letter_void(), PriceLetterCreateBody, PriceLetterDetailBody, PriceLetterListBody (+3 more)
### Community 188 - "context.py"
Cohesion: 0.67
Nodes (3): parse_optional_plan_datetime(), datetime, 运输计划相关日期时间解析:前端 date-picker 仅传 YYYY-MM-DD。
### Community 193 - "create_from_quote"
### Community 191 - "SoftDeleteModel"
Cohesion: 0.50
Nodes (4): customer_options(), 客户下拉选项(租户内只读,不做 owner 数据权限), CustomerOptionsBody, 客户下拉选项请求体(租户内只读搜索,不做 owner 数据权限)
Nodes (4): ApiRequestLogCRUD, Session, SysApiRequestLog, SysApiRequestLogHis
### Community 193 - "create_from_quote"
Cohesion: 0.48
Nodes (7): _opp_list_kwargs(), opportunity_export(), opportunity_kanban(), opportunity_list(), opportunity_mine_list(), OpportunityKanbanBody, OpportunityListBody
### Community 194 - "web_login_rsa_public_key"
Cohesion: 0.50
Nodes (5): assert_products_allowed_for_supplier(), enrich_products_with_hazard_flags(), Any, Session, 批量回填明细行 isToxic/isExplosive(来自产品主数据,供前端切换主体剔除)。
### Community 196 - "crm_contract_sub_routes.py"
Cohesion: 0.27
Nodes (10): apply_product_snapshot_to_plan(), ProductSnapshot, Session, 地磅模块 — CRM 产品解析与快照写入。, 校验 CRM 产品并返回名称/规格快照。新建单据 product_id 必填。 require_on_shelf=False 用于运输计划联动地磅等历, resolve_crm_product(), _product(), resolve_crm_product:运输联动场景允许已下架产品。 (+2 more)
Cohesion: 0.26
Nodes (11): _apply_plan_product_update(), apply_product_snapshot_to_plan(), ProductSnapshot, Session, 地磅模块 — CRM 产品解析与快照写入。, 校验 CRM 产品并返回名称/规格快照。新建单据 product_id 必填。 require_on_shelf=False 用于运输计划联动地磅等历, resolve_crm_product(), _product() (+3 more)
### Community 200 - "register_local_callback"
Cohesion: 0.07
Nodes (59): PlTransportProductFeedback, 运输单按产品回传 pl_transport_product_feedback, _dict_field(), format_brand_qty_summary(), load_transport_driver_product_feedbacks(), persist_io_item_brand_qtys(), persist_transport_product_feedback(), Any (+51 more)
### Community 201 - ".to_tenant_user_dict"
Cohesion: 0.40
Nodes (3): Any, 供 get_tenant_no 等门户工具使用。, 与门户 JWT / apply_data_scope 所需的 user_info 字段对齐。
Cohesion: 0.08
Nodes (52): _build_page(), _get_by_token(), _make_handlers(), _models(), Session, 运输计划 · 入库/出库单现场免登录公共 API, PublicIoOrderFeedback, 按运输计划单据类型解析地磅往来单位(不区分 CRM 合同类型)。 - 入库单 inbound:供方 → party_a,其次 supplier_nam (+44 more)
### Community 206 - "crm_quote_pdf.py"
Cohesion: 0.36
@@ -789,8 +796,8 @@ 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)
Cohesion: 0.14
Nodes (23): ApiCryptoMiddleware, _claims_from_auth(), _coerce_post_method_override_to_get(), _get_redis_client(), _is_crypto_api(), _json_error_response(), _mark_nonce_once(), _nonce_key() (+15 more)
### Community 237 - "order_status_compat.py"
Cohesion: 0.36
@@ -807,22 +814,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.
- **19 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
- **16 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `Settings` connect `price_letter_detail` to `backfill_crm_contract_attachment_urls.py`, `_ensure_subpack_slip_no`, `Community 35`, `crm_supplier_hazard.py`, `Community 37`, `Community 67`, `Community 72`, `Community 73`, `Community 42`, `Base`, `Community 52`, `Any`, `Community 59`, `Community 30`?**
_High betweenness centrality (0.107) - this node is a cross-community bridge._
- **Why does `BaseModel` connect `Community 27` to `Community 0`, `Community 1`, `Community 2`, `Community 5`, `Community 7`, `unsettled_plans_q_filter`, `Community 11`, `Community 12`, `Community 14`, `Community 15`, `Community 16`, `resolve_crm_product`, `Community 18`, `__init__.py`, `Community 19`, `Community 28`, `Community 29`, `customer_update`, `register_local_callback`, `Community 34`, `__init__.py`, `Community 38`, `Community 45`, `resolve_create_time_bounds`, `Community 46`, `Community 50`, `Community 51`, `Community 53`, `statistics.py`, `Community 54`, `__init__.py`, `Community 58`, `Community 60`, `Community 62`, `Community 63`, `Community 64`, `SoftDeleteModel`, `Community 66`, `create_from_quote`, `Community 65`, `Community 74`, `Community 86`, `list_customers`, `Community 109`, `Community 111`, `site.py`, `Community 119`, `Community 125`, `Community 127`?**
_High betweenness centrality (0.101) - this node is a cross-community bridge._
- **Why does `generate_uuid()` connect `_invoice_info_by_customer_impl` to `Community 0`, `plan.py`, `datetime_parse.py`, `Community 4`, `Community 5`, `Community 6`, `Community 134`, `Community 8`, `statistics.py`, `Community 136`, `Community 11`, `Community 13`, `Community 14`, `SysEthnic`, `dict_data.py`, `Community 15`, `resolve_crm_product`, `Community 19`, `Community 16`, `Community 21`, `response.py`, `Community 25`, `Community 28`, `Community 29`, `Community 33`, `get_client_ip`, `Community 36`, `Community 39`, `Community 43`, `Community 44`, `Community 45`, `Community 48`, `Community 49`, `allocate_next_biz_no`, `Community 58`, `Community 61`, `Community 62`, `Community 65`, `Community 66`, `Community 67`, `Community 68`, `Community 71`, `register_local_callback`, `Community 83`, `Community 87`, `pl_ocr_service.py`, `Community 92`, `Community 95`, `dept.py`, `apply_crm_create_by_scope`, `apply_pl_scope`, `Community 109`, `quote_share_log.py`, `db_models.py`, `site.py`, `Community 116`, `Community 118`, `Community 122`, `customer_pool.py`?**
_High betweenness centrality (0.099) - this node is a cross-community bridge._
- **Why does `Settings` connect `Community 72` to `backfill_crm_contract_attachment_urls.py`, `_ensure_subpack_slip_no`, `Community 35`, `crm_supplier_hazard.py`, `Community 37`, `Community 67`, `price_letter_detail`, `Community 73`, `Community 42`, `Base`, `Community 52`, `Any`, `Community 59`, `Community 30`?**
_High betweenness centrality (0.097) - this node is a cross-community bridge._
- **Why does `BaseModel` connect `Community 12` to `Community 0`, `Community 1`, `Community 2`, `Community 3`, `Community 5`, `Community 7`, `unsettled_plans_q_filter`, `Community 11`, `Community 14`, `Community 15`, `Community 16`, `resolve_crm_product`, `Community 18`, `Community 19`, `Community 24`, `Community 26`, `Community 27`, `Community 29`, `register_local_callback`, `Community 34`, `__init__.py`, `Community 36`, `Community 38`, `Community 43`, `apply_pl_scope`, `resolve_create_time_bounds`, `Community 46`, `Community 45`, `Community 48`, `Community 50`, `Community 53`, `Community 54`, `__init__.py`, `_build_user_info_payload`, `Community 60`, `Community 61`, `Community 62`, `Community 63`, `Community 64`, `create_from_quote`, `Community 66`, `Community 65`, `Community 71`, `register_local_callback`, `Community 86`, `list_customers`, `Community 109`, `Community 111`, `site.py`, `Community 119`, `Community 127`?**
_High betweenness centrality (0.093) - this node is a cross-community bridge._
- **Why does `generate_uuid()` connect `_invoice_info_by_customer_impl` to `Community 0`, `plan.py`, `datetime_parse.py`, `Community 4`, `Community 5`, `Community 6`, `Community 134`, `Community 8`, `statistics.py`, `Community 136`, `Community 11`, `Community 13`, `Community 14`, `SysEthnic`, `dict_data.py`, `resolve_crm_product`, `Community 15`, `Community 19`, `Community 16`, `Community 21`, `Community 24`, `response.py`, `Community 25`, `utils.py`, `Community 28`, `Community 29`, `register_local_callback`, `Community 33`, `__init__.py`, `get_client_ip`, `Community 36`, `Community 38`, `Community 39`, `Community 43`, `Community 44`, `Community 45`, `resolve_create_time_bounds`, `Community 48`, `Community 49`, `Community 58`, `Community 61`, `Community 62`, `Community 65`, `Community 66`, `Community 67`, `Community 68`, `Community 71`, `register_local_callback`, `Community 83`, `Community 87`, `pl_ocr_service.py`, `pl_vehicle_recharge_service.py`, `Community 92`, `Community 95`, `dept.py`, `apply_crm_create_by_scope`, `apply_pl_scope`, `Community 109`, `storage.py`, `quote_share_log.py`, `db_models.py`, `site.py`, `Community 116`, `Community 118`, `Community 122`, `customer_pool.py`?**
_High betweenness centrality (0.090) - this node is a cross-community bridge._
- **Are the 8 inferred relationships involving `DbUserContext` (e.g. with `InventoryRelatedData` and `AutoGenerateMonthlyResult`) actually correct?**
_`DbUserContext` has 8 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?**
_539 weakly-connected nodes found - possible documentation gaps or missing edges._
_541 weakly-connected nodes found - possible documentation gaps or missing edges._
- **Should `Community 0` be split into smaller, more focused modules?**
_Cohesion score 0.1492063492063492 - nodes in this community are weakly interconnected._
- **Should `Community 1` be split into smaller, more focused modules?**
_Cohesion score 0.07804878048780488 - nodes in this community are weakly interconnected._
- **Should `Community 3` be split into smaller, more focused modules?**
_Cohesion score 0.07226107226107226 - nodes in this community are weakly interconnected._
_Cohesion score 0.08367071524966262 - nodes in this community are weakly interconnected._
@@ -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": "L102"}, {"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": "L118"}, {"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": "L122"}, {"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": "L154"}, {"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": "L158"}, {"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": "L183"}, {"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": "L191"}, {"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": "L223"}, {"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": "L228"}, {"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": "L237"}, {"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": "L257"}, {"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": "L271"}, {"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": "L281"}, {"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_count_plans_by_contract", "label": "count_plans_by_contract()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L457"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_pl_plan_create_plan", "label": "create_plan()", "file_type": "code", "source_file": "app/api/pl/plan.py", "source_location": "L511"}, {"id": "plancreate", "label": "PlanCreate", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/pl/plan.py"}, {"id": "planread", "label": "PlanRead", "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_cLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_init_py", "label": "__init__.py", "file_type": "code", "source_file": "app/schemas/pl/__init__.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_init_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212\u7ba1\u7406 - Pydantic Schema", "file_type": "rationale", "source_file": "app/schemas/pl/__init__.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_init_py", "target": "app_schemas_pl_base_data", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/__init__.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_init_py", "target": "app_schemas_pl_plan", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/__init__.py", "source_location": "L33", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_init_py", "target": "app_schemas_pl_transport", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/__init__.py", "source_location": "L50", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_init_py", "target": "app_schemas_pl_freight", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/__init__.py", "source_location": "L63", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_init_py", "target": "app_schemas_pl_inventory", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/__init__.py", "source_location": "L75", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_init_py", "target": "app_schemas_pl_vehicle_recharge", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/__init__.py", "source_location": "L95", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_init_rationale_1", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_init_py", "relation": "rationale_for", "confidence": "EXTRACTED", "source_file": "app/schemas/pl/__init__.py", "source_location": "L1", "weight": 1.0}], "raw_calls": []}
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_py", "label": "quote.py", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_ensure_quote_in_scope", "label": "_ensure_quote_in_scope()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L42"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/quote.py"}, {"id": "crmquote", "label": "CrmQuote", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/quote.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_get_quote_in_scope", "label": "_get_quote_in_scope()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L46"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_total_pages", "label": "total_pages()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L60"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_decimal_value", "label": "_decimal_value()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L66"}, {"id": "any", "label": "Any", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/quote.py"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/quote.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_parse_optional_date", "label": "_parse_optional_date()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L74"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/quote.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_parse_optional_datetime", "label": "_parse_optional_datetime()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L92"}, {"id": "datetime", "label": "datetime", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/quote.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_get_field", "label": "_get_field()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L108"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_resolve_user_display_name", "label": "_resolve_user_display_name()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L115"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_row_to_dict", "label": "_row_to_dict()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L125"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_quote_row_to_dict", "label": "quote_row_to_dict()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L177"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_build_quote_filters", "label": "_build_quote_filters()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L181"}, {"id": "query", "label": "Query", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/quote.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_fill_contract_linked_count", "label": "_fill_contract_linked_count()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L323"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_calculate_quote_amount", "label": "calculate_quote_amount()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L345"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_resolve_quote_product_ids", "label": "_resolve_quote_product_ids()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L371"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_generate_quote_no", "label": "generate_quote_no()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L392"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_quote_generate_quote_title", "label": "generate_quote_title()", "file_type": "code", "source_file": "app/crud/crm/quote.py", "source_location": "L442"}, {"id": "users_wuLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_init_py", "label": "__init__.py", "file_type": "code", "source_file": "app/models/__init__.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_init_py", "target": "app_models_base", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/models/__init__.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_init_py", "target": "app_models_models", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/models/__init__.py", "source_location": "L3", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_init_py", "target": "app_models_pl_models", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/models/__init__.py", "source_location": "L30", "weight": 1.0}], "raw_calls": [{"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_init_py", "callee": "SysUser", "is_member_call": false, "indirect": true, "context": "assignment", "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/models/__init__.py", "source_location": "L61"}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_init_py", "callee": "SysApiRequestLog", "is_member_call": false, "indirect": true, "context": "assignment", "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/models/__init__.py", "source_location": "L62"}]}
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_py", "label": "contract.py", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractproductpricetieritem", "label": "ContractProductPriceTierItem", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L8"}, {"id": "basemodel", "label": "BaseModel", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractproductitem", "label": "ContractProductItem", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L23"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractlistquery", "label": "ContractListQuery", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L55"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractcreatebody", "label": "ContractCreateBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L85"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractupdatebody", "label": "ContractUpdateBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L149"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractsubmitbody", "label": "ContractSubmitBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L153"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractbatchsubmitbody", "label": "ContractBatchSubmitBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L159"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractwithdrawbody", "label": "ContractWithdrawBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L165"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractstatusbody", "label": "ContractStatusBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L170"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractinvalidbody", "label": "ContractInvalidBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L175"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contracttemplatesavebody", "label": "ContractTemplateSaveBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L181"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractdeletebody", "label": "ContractDeleteBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L187"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractapprovalactionbody", "label": "ContractApprovalActionBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L191"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractuploadfilebody", "label": "ContractUploadFileBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L203"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractuploadattachmentsbody", "label": "ContractUploadAttachmentsBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L208"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractexportbody", "label": "ContractExportBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L216"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractstatisticsoverviewquery", "label": "ContractStatisticsOverviewQuery", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L221"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractstatisticstrendquery", "label": "ContractStatisticsTrendQuery", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L227"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractrenewbody", "label": "ContractRenewBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L233"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_crm_contract_contractapprovalpassbody", "label": "ContractApprovalPassBody", "file_type": "code", "source_file": "app/schemas/crm/contract.py", "source_location": "L237"}, {"id": "users_wuLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "label": "crm_contract_routes.py", "file_type": "code", "source_file": "app/api/crm_contract_routes.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_register_contract_routes", "label": "register_contract_routes()", "file_type": "code", "source_file": "app/api/crm_contract_routes.py", "source_location": "L78"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_rationale_1", "label": "CRM \u5408\u540c API \u8def\u7531 \u2014 GET/PUT/DELETE/POST \u5bf9\u9f50\u539f Java CRM", "file_type": "rationale", "source_file": "app/api/crm_contract_routes.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "datetime", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L4", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L5", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "fastapi", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L7", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "sqlalchemy_orm", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L8", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_core_database", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L10", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_core_menu_guard", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L11", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_core_oper_log_decorator", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L12", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_core_response", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L13", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_core_tenant_context", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L14", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_crud_crm_data_scope_helpers", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L15", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_crud_crm_contract", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L16", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_crud_crm_contract_approval", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L47", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_crud_crm_contract_approver_setting", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L51", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_crud_crm_contract_approver_setting", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/api/crm_contract_routes.py", "source_location": "L52", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_crm_contract_routes_py", "target": "app_schemas_crLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_py", "label": "pl_models.py", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcarrier", "label": "PlCarrier", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L28"}, {"id": "base", "label": "Base", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehicle", "label": "PlVehicle", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L57"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plpersonnel", "label": "PlPersonnel", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L84"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportaddress", "label": "PlTransportAddress", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L119"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plcert", "label": "PlCert", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L143"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pldriver", "label": "PlDriver", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L169"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehiclepersonnel", "label": "PlVehiclePersonnel", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L195"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plvehicledriver", "label": "PlVehicleDriver", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L216"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplan", "label": "PlPlan", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L241"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplancontract", "label": "PlPlanContract", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L348"}, {"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": "L370"}, {"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": "L429"}, {"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": "L451"}, {"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": "L478"}, {"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": "L540"}, {"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": "L561"}, {"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": "L584"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plplantransport", "label": "PlPlanTransport", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L607"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_pltransportsitelink", "label": "PlTransportSiteLink", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L626"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plinboundorder", "label": "PlInboundOrder", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L659"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plinboundorderitem", "label": "PlInboundOrderItem", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L689"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_models_pl_models_plinboundorderitembrandqty", "label": "PlInboundOrderItemBrandQty", "file_type": "code", "source_file": "app/models/pl_models.py", "source_location": "L715"}, {"id": "users_wuzilong_work_00codLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_py", "label": "pl_plan_service.py", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_plan_service_determine_plan_type", "label": "determine_plan_type()", "file_type": "code", "source_file": "app/services/pl_plan_service.py", "source_location": "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_internal_customer_py", "label": "pl_internal_customer.py", "file_type": "code", "source_file": "app/services/pl_internal_customer.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_internal_customer_is_internal_customer_name", "label": "is_internal_customer_name()", "file_type": "code", "source_file": "app/services/pl_internal_customer.py", "source_location": "L12"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_internal_customer_rationale_1", "label": "\u8fd0\u8f93\u8ba1\u5212\uff1a\u5185\u7f6e\u5c71\u5ce1/\u4e91\u680b\u5ba2\u6237\u5224\u5b9a\uff08\u5408\u540c\u53ef\u514d\uff09", "file_type": "rationale", "source_file": "app/services/pl_internal_customer.py", "source_location": "L1"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_internal_customer_py", "target": "typing", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "app/services/pl_internal_customer.py", "source_location": "L2", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_internal_customer_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_internal_customer_is_internal_customer_name", "relation": "contains", "confidence": "EXTRACTED", "source_file": "app/services/pl_internal_customer.py", "source_location": "L12", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_internal_customer_rationale_1", "target": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_internal_customer_py", "relation": "rationale_for", "confidence": "EXTRACTED", "source_file": "app/services/pl_internal_customer.py", "source_location": "L1", "weight": 1.0}], "raw_calls": [{"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_internal_customer_is_internal_customer_name", "callee": "strip", "is_member_call": true, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/services/pl_internal_customer.py", "source_location": "L13", "receiver": null}], "callable_nids": ["users_wuzilong_work_00code_shanxia2_0_backend_app_services_pl_internal_customer_is_internal_customer_name"]}
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_py", "label": "plan.py", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductbase", "label": "PlanProductBase", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L16"}, {"id": "basemodel", "label": "BaseModel", "file_type": "code", "source_file": "", "source_location": ""}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductcreate", "label": "PlanProductCreate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L55"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductupdate", "label": "PlanProductUpdate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L59"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planarchivebrandqtyitem", "label": "PlanArchiveBrandQtyItem", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L81"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductread", "label": "PlanProductRead", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L88"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planbase", "label": "PlanBase", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L105"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plancontractlink", "label": "PlanContractLink", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L155"}, {"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": "L161"}, {"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": "L176"}, {"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": "L190"}, {"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": "L239"}, {"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": "L244"}, {"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": "L278"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planinboundsliptemplatesave", "label": "PlanInboundSlipTemplateSave", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L282"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plandeliverysliptemplatesave", "label": "PlanDeliverySlipTemplateSave", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L287"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plansubpacksliptemplatesave", "label": "PlanSubpackSlipTemplateSave", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L294"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_createfromcontractrequest", "label": "CreateFromContractRequest", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L306"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_plancreatefull", "label": "PlanCreateFull", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L317"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planlistquery", "label": "PlanListQuery", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L328"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductcertitem", "label": "PlanProductCertItem", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L353"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_schemas_pl_plan_planproductcertsupdate", "label": "PlanProductCertsUpdate", "file_type": "code", "source_file": "app/schemas/pl/plan.py", "source_location": "L361"}, {"id": "users_wuzilong_work_00code_sLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_py", "label": "public.py", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_avatar_url_field", "label": "_avatar_url_field()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L39"}, {"id": "sysuser", "label": "SysUser", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/public.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_web_role_list", "label": "_web_role_list()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L47"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_build_user_info_payload", "label": "_build_user_info_payload()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L53"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_jwt_user_payload", "label": "_jwt_user_payload()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L71"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_web_login_rsa_public_key", "label": "web_login_rsa_public_key()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L84"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_web_login", "label": "web_login()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L91"}, {"id": "request", "label": "Request", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/public.py"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/api/public.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_refresh_token", "label": "refresh_token()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L149"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_logout", "label": "logout()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L211"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_get_current_user_profile", "label": "get_current_user_profile()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L228"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_get_web_auth_menu_codes", "label": "get_web_auth_menu_codes()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L263"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_change_current_user_password", "label": "change_current_user_password()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L312"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_public_quote_share", "label": "public_quote_share()", "file_type": "code", "source_file": "app/api/public.py", "source_location": "L345"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_rationale_1", "label": "\u516c\u5171\u63a5\u53e3\uff08Web \u767b\u5f55\u3001\u5237\u65b0 Token\u3001\u767b\u51fa\uff1b\u7528\u6237\u6a21\u578b\u5bf9\u9f50 docs/sql/shanxia2.0.sql \u57fa\u7ebf\uff09", "file_type": "rationale", "source_file": "app/api/public.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_rationale_48", "label": "\u4e0e web-admin \u9759\u6001\u8def\u7531 meta.roles\uff08admin/super_admin\uff09\u5bf9\u9f50\u7684\u5355\u5143\u7d20\u6570\u7ec4\u3002", "file_type": "rationale", "source_file": "app/api/public.py", "source_location": "L48"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_rationale_54", "label": "\u4e0e web-admin `userInfo` \u5b57\u6bb5\u7ea6\u5b9a\u4e00\u81f4\u3002", "file_type": "rationale", "source_file": "app/api/public.py", "source_location": "L54"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_rationale_85", "label": "Web \u7aef\u767b\u5f55\u7528 RSA \u516c\u94a5\uff08PKCS#1 v1.5\uff0c\u4e0e JSEncrypt \u4e00\u81f4\uff09", "file_type": "rationale", "source_file": "app/api/public.py", "source_location": "L85"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_rationale_96", "label": "Web \u7aef\u767b\u5f55\uff1a\u8d26\u53f7\u4e3a sys_user.user_no\uff0c\u5bc6\u7801\u4e3a sys_user.password\uff08bcrypt\uff09\u3002", "file_type": "rationale", "source_file": "app/api/public.py", "source_location": "L96"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_api_public_rationale_212", "label": "\u767b\u51fa\uff1a\u540a\u9500 Redis \u4f1a\u8bdd\uff08\u82e5\u5df2\u914d\u7f6e REDIS_HOST\uff09\u3002\u65e0 Token \u6216\u5df2\u5931Line truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_py", "label": "contract.py", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_ensure_contract_in_scope", "label": "_ensure_contract_in_scope()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L51"}, {"id": "session", "label": "Session", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/contract.py"}, {"id": "crmcontract", "label": "CrmContract", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/contract.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_get_contract_row_in_scope", "label": "_get_contract_row_in_scope()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L55"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_total_pages", "label": "total_pages()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L72"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_decimal_value", "label": "_decimal_value()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L78"}, {"id": "any", "label": "Any", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/contract.py"}, {"id": "decimal", "label": "Decimal", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/contract.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_parse_optional_date", "label": "_parse_optional_date()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L86"}, {"id": "date", "label": "date", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/contract.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_parse_optional_datetime", "label": "_parse_optional_datetime()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L104"}, {"id": "datetime", "label": "datetime", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/contract.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_get_field", "label": "_get_field()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L120"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_resolve_user_display_name", "label": "_resolve_user_display_name()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L127"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_is_blank", "label": "_is_blank()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L137"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_first_non_blank", "label": "_first_non_blank()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L141"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_get_default_invoice_info", "label": "_get_default_invoice_info()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L149"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_build_customer_address", "label": "_build_customer_address()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L159"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_row_to_dict", "label": "_row_to_dict()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L171"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_contract_row_to_dict", "label": "contract_row_to_dict()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L250"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_build_contract_filters", "label": "_build_contract_filters()", "file_type": "code", "source_file": "app/crud/crm/contract.py", "source_location": "L254"}, {"id": "query", "label": "Query", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/app/crud/crm/contract.py"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_app_crud_crm_contract_list_contracts", "label": "list_contractsLine truncated
@@ -0,0 +1 @@
{"nodes": [{"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_py", "label": "migrate_20260808_pl_plan_legacy_party_contracts.py", "file_type": "code", "source_file": "scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L1"}, {"id": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_main", "label": "main()", "file_type": "code", "source_file": "scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L30"}], "edges": [{"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_py", "target": "argparse", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L16", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_py", "target": "sys", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L17", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_py", "target": "datetime", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L18", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_py", "target": "pathlib", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L19", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_py", "target": "app_core_database", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L25", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_py", "target": "app_core_utils", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L26", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_py", "target": "app_models_pl_models", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L27", "weight": 1.0}, {"source": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_py", "target": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_main", "relation": "contains", "confidence": "EXTRACTED", "source_file": "scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L30", "weight": 1.0}], "raw_calls": [{"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_main", "callee": "ArgumentParser", "is_member_call": true, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L31", "receiver": "argparse"}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_main", "callee": "add_argument", "is_member_call": true, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L32", "receiver": "parser"}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_main", "callee": "parse_args", "is_member_call": true, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L33", "receiver": "parser"}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_main", "callee": "SessionLocal", "is_member_call": false, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scripts/migrate_20260808_pl_plan_legacy_party_contracts.py", "source_location": "L35", "receiver": null}, {"caller_nid": "users_wuzilong_work_00code_shanxia2_0_backend_scripts_migrate_20260808_pl_plan_legacy_party_contracts_main", "callee": "now", "is_member_call": true, "source_file": "/Users/wuzilong/work/00code/shanxia2.0/backend/scriptsLine 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
+4 -4
View File
@@ -63,12 +63,12 @@
</div>
<div id="legend"></div>
</div>
<div id="stats">4731 nodes &middot; 15973 edges &middot; 544 communities</div>
<div id="stats">4743 nodes &middot; 16026 edges &middot; 543 communities</div>
</div>
<script>
const RAW_NODES = [{"id": "app_init", "label": "__init__.py", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "__init__.py", "community": 304, "community_name": "__init__.py", "source_file": "app/__init__.py", "file_type": "code", "degree": 0}, {"id": "app_api_init", "label": "__init__.py", "color": {"background": "#4E79A7", "border": "#4E79A7", "highlight": {"background": "#ffffff", "border": "#4E79A7"}}, "size": 10.6, "font": {"size": 0, "color": "#ffffff"}, "title": "__init__.py", "community": 160, "community_name": "register_local_callback", "source_file": "app/api/__init__.py", "file_type": "code", "degree": 10}, {"id": "app_api_init_rationale_1", "label": "API \u8def\u7531\u5305 \u2014 \u5c71\u5ce1\u5316\u5de5\u751f\u4ea7\u4e00\u4f53\u5316\u95e8\u6237", "color": {"background": "#4E79A7", "border": "#4E79A7", "highlight": {"background": "#ffffff", "border": "#4E79A7"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "API \u8def\u7531\u5305 \u2014 \u5c71\u5ce1\u5316\u5de5\u751f\u4ea7\u4e00\u4f53\u5316\u95e8\u6237", "community": 160, "community_name": "register_local_callback", "source_file": "app/api/__init__.py", "file_type": "rationale", "degree": 1}, {"id": "app_api_admin", "label": "admin.py", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 17.7, "font": {"size": 12, "color": "#ffffff"}, "title": "admin.py", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 119}, {"id": "app_api_admin_list_roles_for_select", "label": "list_roles_for_select()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "list_roles_for_select()", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 5}, {"id": "app_api_admin_py_session", "label": "Session", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 13.7, "font": {"size": 0, "color": "#ffffff"}, "title": "Session", "community": 3, "community_name": "Community 3", "source_file": "", "file_type": "code", "degree": 57}, {"id": "app_api_admin_list_users_for_select", "label": "list_users_for_select()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "list_users_for_select()", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 5}, {"id": "app_api_admin_list_roles_for_designer", "label": "list_roles_for_designer()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "list_roles_for_designer()", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 5}, {"id": "app_api_admin_tenantcreatebody", "label": "TenantCreateBody", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.6, "font": {"size": 0, "color": "#ffffff"}, "title": "TenantCreateBody", "community": 53, "community_name": "Community 53", "source_file": "app/api/admin.py", "file_type": "code", "degree": 10}, {"id": "app_api_admin_tenantupdatebody", "label": "TenantUpdateBody", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.6, "font": {"size": 0, "color": "#ffffff"}, "title": "TenantUpdateBody", "community": 53, "community_name": "Community 53", "source_file": "app/api/admin.py", "file_type": "code", "degree": 10}, {"id": "app_api_admin_list_tenants", "label": "list_tenants()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "list_tenants()", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 3}, {"id": "app_api_admin_create_tenant", "label": "create_tenant()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "create_tenant()", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 5}, {"id": "app_api_admin_update_tenant", "label": "update_tenant()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "bordLine truncated
const RAW_EDGES = [{"from": "app_api_init", "to": "app_api_admin", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_bx_init", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_crm", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_db_init", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_leave", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_menu", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_monitor", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_public", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_workflow", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init_rationale_1", "to": "app_api_init", "label": "rationale_for", "title": "rationale_for [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_attachment_download_url", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_attachment_preview_url", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_attachmentdownloadurlbody", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_dept", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_dict_data", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_dict_type", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_menu", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_menu_favorite", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_post", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_role_management", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_site", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_tenant", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_user", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_delete_dept", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_delete_dict_data", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"Line truncated
const LEGEND = [{"cid": 0, "color": "#4E79A7", "label": "Community 0", "count": 35}, {"cid": 1, "color": "#F28E2B", "label": "Community 1", "count": 41}, {"cid": 2, "color": "#E15759", "label": "Community 2", "count": 29}, {"cid": 3, "color": "#76B7B2", "label": "Community 3", "count": 66}, {"cid": 4, "color": "#59A14F", "label": "Community 4", "count": 63}, {"cid": 5, "color": "#EDC948", "label": "Community 5", "count": 35}, {"cid": 6, "color": "#B07AA1", "label": "Community 6", "count": 51}, {"cid": 7, "color": "#FF9DA7", "label": "Community 7", "count": 60}, {"cid": 8, "color": "#9C755F", "label": "Community 8", "count": 76}, {"cid": 9, "color": "#BAB0AC", "label": "Community 9", "count": 1}, {"cid": 10, "color": "#4E79A7", "label": "Community 10", "count": 1}, {"cid": 11, "color": "#F28E2B", "label": "Community 11", "count": 60}, {"cid": 12, "color": "#E15759", "label": "Community 12", "count": 51}, {"cid": 13, "color": "#76B7B2", "label": "Community 13", "count": 30}, {"cid": 14, "color": "#59A14F", "label": "Community 14", "count": 42}, {"cid": 15, "color": "#EDC948", "label": "Community 15", "count": 82}, {"cid": 16, "color": "#B07AA1", "label": "Community 16", "count": 66}, {"cid": 17, "color": "#FF9DA7", "label": "Community 17", "count": 1}, {"cid": 18, "color": "#9C755F", "label": "Community 18", "count": 69}, {"cid": 19, "color": "#BAB0AC", "label": "Community 19", "count": 78}, {"cid": 20, "color": "#4E79A7", "label": "Community 20", "count": 1}, {"cid": 21, "color": "#F28E2B", "label": "Community 21", "count": 60}, {"cid": 22, "color": "#E15759", "label": "Community 22", "count": 43}, {"cid": 23, "color": "#76B7B2", "label": "Community 23", "count": 19}, {"cid": 24, "color": "#59A14F", "label": "Community 24", "count": 21}, {"cid": 25, "color": "#EDC948", "label": "Community 25", "count": 31}, {"cid": 26, "color": "#B07AA1", "label": "Community 26", "count": 11}, {"cid": 27, "color": "#FF9DA7", "label": "Community 27", "count": 75}, {"cid": 28, "color": "#9C755F", "label": "Community 28", "count": 66}, {"cid": 29, "color": "#BAB0AC", "label": "Community 29", "count": 60}, {"cid": 30, "color": "#4E79A7", "label": "Community 30", "count": 27}, {"cid": 31, "color": "#F28E2B", "label": "Community 31", "count": 1}, {"cid": 32, "color": "#E15759", "label": "Community 32", "count": 1}, {"cid": 33, "color": "#76B7B2", "label": "Community 33", "count": 38}, {"cid": 34, "color": "#59A14F", "label": "Community 34", "count": 33}, {"cid": 35, "color": "#EDC948", "label": "Community 35", "count": 38}, {"cid": 36, "color": "#B07AA1", "label": "Community 36", "count": 31}, {"cid": 37, "color": "#FF9DA7", "label": "Community 37", "count": 26}, {"cid": 38, "color": "#9C755F", "label": "Community 38", "count": 24}, {"cid": 39, "color": "#BAB0AC", "label": "Community 39", "count": 28}, {"cid": 40, "color": "#4E79A7", "label": "Community 40", "count": 1}, {"cid": 41, "color": "#F28E2B", "label": "Community 41", "count": 1}, {"cid": 42, "color": "#E15759", "label": "Community 42", "count": 33}, {"cid": 43, "color": "#76B7B2", "label": "Community 43", "count": 54}, {"cid": 44, "color": "#59A14F", "label": "Community 44", "count": 82}, {"cid": 45, "color": "#EDC948", "label": "Community 45", "count": 78}, {"cid": 46, "color": "#B07AA1", "label": "Community 46", "count": 61}, {"cid": 47, "color": "#FF9DA7", "label": "Community 47", "count": 1}, {"cid": 48, "color": "#9C755F", "label": "Community 48", "count": 13}, {"cid": 49, "color": "#BAB0AC", "label": "Community 49", "count": 34}, {"cid": 50, "color": "#4E79A7", "label": "Community 50", "count": 21}, {"cid": 51, "color": "#F28E2B", "label": "Community 51", "count": 78}, {"cid": 52, "color": "#E15759", "label": "Community 52", "count": 31}, {"cid": 53, "color": "#76B7B2", "label": "Community 53", "count": 31}, {"cid": 54, "color": "#59A14F", "label": "Community 54", "count": 27}, {"cid": 55, "color": "#EDC948", "label": "Community 55", "count": 1}, {"cid": 56, "color": "#B07AA1", "label": "Community 56", "count": 1}, {"cid": 57, "color": "#FF9DA7", "label": "Community 57", "count": 1}, {"cid": 58, "color": "#9C755F", "label": "Community 58", "count": 28}, {"cid": 59, "color": "#BAB0AC", "label": "Community 59", "count": 30}, {"cid": 60, "color": "#4E79A7", "label": "Community 60", "count": 22}, {"cid": 61, "color": "#F28E2B", "label": "Community 61", "count": 46}, {"cid": 62, "color": "#E15759", "label": "Community 62", "count": 28}, {"cid": 63, "color": "#76B7B2", "label": "Community 63", "count": 20}, {"cid": 64, "color": "#59A14F", "label": "Community 64", "count": 64}, {"cid": 65, "color": "#EDC948", "label": "Community 65", "count": 62}, {"cid": 66, "color": "#B07AA1", "label": "Community 66", "count": 29}, {"cid": 67, "color": "#FF9DA7", "label": "Community 67", "count": 38}, {"cid": 68, "color": "#9C755F", "label": "Community 68", "count": 14}, {"cid": 69, "color": "#BAB0AC", "label": "Community 69", "count": 35}, {"cid": 70, "color": "#4E79A7", "label": "ComLine truncated
const RAW_NODES = [{"id": "app_init", "label": "__init__.py", "color": {"background": "#59A14F", "border": "#59A14F", "highlight": {"background": "#ffffff", "border": "#59A14F"}}, "size": 10.0, "font": {"size": 0, "color": "#ffffff"}, "title": "__init__.py", "community": 304, "community_name": "__init__.py", "source_file": "app/__init__.py", "file_type": "code", "degree": 0}, {"id": "app_api_init", "label": "__init__.py", "color": {"background": "#EDC948", "border": "#EDC948", "highlight": {"background": "#ffffff", "border": "#EDC948"}}, "size": 10.6, "font": {"size": 0, "color": "#ffffff"}, "title": "__init__.py", "community": 105, "community_name": "list_customers", "source_file": "app/api/__init__.py", "file_type": "code", "degree": 10}, {"id": "app_api_init_rationale_1", "label": "API \u8def\u7531\u5305 \u2014 \u5c71\u5ce1\u5316\u5de5\u751f\u4ea7\u4e00\u4f53\u5316\u95e8\u6237", "color": {"background": "#EDC948", "border": "#EDC948", "highlight": {"background": "#ffffff", "border": "#EDC948"}}, "size": 10.1, "font": {"size": 0, "color": "#ffffff"}, "title": "API \u8def\u7531\u5305 \u2014 \u5c71\u5ce1\u5316\u5de5\u751f\u4ea7\u4e00\u4f53\u5316\u95e8\u6237", "community": 105, "community_name": "list_customers", "source_file": "app/api/__init__.py", "file_type": "rationale", "degree": 1}, {"id": "app_api_admin", "label": "admin.py", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 17.7, "font": {"size": 12, "color": "#ffffff"}, "title": "admin.py", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 119}, {"id": "app_api_admin_list_roles_for_select", "label": "list_roles_for_select()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "list_roles_for_select()", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 5}, {"id": "app_api_admin_py_session", "label": "Session", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 13.7, "font": {"size": 0, "color": "#ffffff"}, "title": "Session", "community": 3, "community_name": "Community 3", "source_file": "", "file_type": "code", "degree": 57}, {"id": "app_api_admin_list_users_for_select", "label": "list_users_for_select()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "list_users_for_select()", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 5}, {"id": "app_api_admin_list_roles_for_designer", "label": "list_roles_for_designer()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "list_roles_for_designer()", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 5}, {"id": "app_api_admin_tenantcreatebody", "label": "TenantCreateBody", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.6, "font": {"size": 0, "color": "#ffffff"}, "title": "TenantCreateBody", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 10}, {"id": "app_api_admin_tenantupdatebody", "label": "TenantUpdateBody", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.6, "font": {"size": 0, "color": "#ffffff"}, "title": "TenantUpdateBody", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 10}, {"id": "app_api_admin_list_tenants", "label": "list_tenants()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.2, "font": {"size": 0, "color": "#ffffff"}, "title": "list_tenants()", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 3}, {"id": "app_api_admin_create_tenant", "label": "create_tenant()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "size": 10.3, "font": {"size": 0, "color": "#ffffff"}, "title": "create_tenant()", "community": 3, "community_name": "Community 3", "source_file": "app/api/admin.py", "file_type": "code", "degree": 5}, {"id": "app_api_admin_update_tenant", "label": "update_tenant()", "color": {"background": "#76B7B2", "border": "#76B7B2", "highlight": {"background": "#ffffff", "border": "#76B7B2"}}, "sizLine truncated
const RAW_EDGES = [{"from": "app_api_init", "to": "app_api_admin", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_bx_init", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_crm", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_db_init", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_leave", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_menu", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_monitor", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_public", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init", "to": "app_api_workflow", "label": "re_exports", "title": "re_exports [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_init_rationale_1", "to": "app_api_init", "label": "rationale_for", "title": "rationale_for [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_attachment_download_url", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_attachment_preview_url", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_attachmentdownloadurlbody", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_dept", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_dict_data", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_dict_type", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_menu", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_menu_favorite", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_post", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_role_management", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_site", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_tenant", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_create_user", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_delete_dept", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"}, {"from": "app_api_admin", "to": "app_api_admin_delete_dict_data", "label": "contains", "title": "contains [EXTRACTED]", "dashes": false, "width": 2, "color": {"opacity": 0.7}, "confidence": "EXTRACTED"Line truncated
const LEGEND = [{"cid": 0, "color": "#4E79A7", "label": "Community 0", "count": 36}, {"cid": 1, "color": "#F28E2B", "label": "Community 1", "count": 39}, {"cid": 2, "color": "#E15759", "label": "Community 2", "count": 27}, {"cid": 3, "color": "#76B7B2", "label": "Community 3", "count": 97}, {"cid": 4, "color": "#59A14F", "label": "Community 4", "count": 63}, {"cid": 5, "color": "#EDC948", "label": "Community 5", "count": 35}, {"cid": 6, "color": "#B07AA1", "label": "Community 6", "count": 51}, {"cid": 7, "color": "#FF9DA7", "label": "Community 7", "count": 129}, {"cid": 8, "color": "#9C755F", "label": "Community 8", "count": 56}, {"cid": 9, "color": "#BAB0AC", "label": "Community 9", "count": 1}, {"cid": 10, "color": "#4E79A7", "label": "Community 10", "count": 1}, {"cid": 11, "color": "#F28E2B", "label": "Community 11", "count": 61}, {"cid": 12, "color": "#E15759", "label": "Community 12", "count": 71}, {"cid": 13, "color": "#76B7B2", "label": "Community 13", "count": 46}, {"cid": 14, "color": "#59A14F", "label": "Community 14", "count": 61}, {"cid": 15, "color": "#EDC948", "label": "Community 15", "count": 53}, {"cid": 16, "color": "#B07AA1", "label": "Community 16", "count": 42}, {"cid": 17, "color": "#FF9DA7", "label": "Community 17", "count": 1}, {"cid": 18, "color": "#9C755F", "label": "Community 18", "count": 42}, {"cid": 19, "color": "#BAB0AC", "label": "Community 19", "count": 94}, {"cid": 20, "color": "#4E79A7", "label": "Community 20", "count": 1}, {"cid": 21, "color": "#F28E2B", "label": "Community 21", "count": 65}, {"cid": 22, "color": "#E15759", "label": "Community 22", "count": 43}, {"cid": 23, "color": "#76B7B2", "label": "Community 23", "count": 17}, {"cid": 24, "color": "#59A14F", "label": "Community 24", "count": 42}, {"cid": 25, "color": "#EDC948", "label": "Community 25", "count": 17}, {"cid": 26, "color": "#B07AA1", "label": "Community 26", "count": 41}, {"cid": 27, "color": "#FF9DA7", "label": "Community 27", "count": 35}, {"cid": 28, "color": "#9C755F", "label": "Community 28", "count": 63}, {"cid": 29, "color": "#BAB0AC", "label": "Community 29", "count": 65}, {"cid": 30, "color": "#4E79A7", "label": "Community 30", "count": 27}, {"cid": 31, "color": "#F28E2B", "label": "Community 31", "count": 1}, {"cid": 32, "color": "#E15759", "label": "Community 32", "count": 1}, {"cid": 33, "color": "#76B7B2", "label": "Community 33", "count": 26}, {"cid": 34, "color": "#59A14F", "label": "Community 34", "count": 61}, {"cid": 35, "color": "#EDC948", "label": "Community 35", "count": 38}, {"cid": 36, "color": "#B07AA1", "label": "Community 36", "count": 53}, {"cid": 37, "color": "#FF9DA7", "label": "Community 37", "count": 26}, {"cid": 38, "color": "#9C755F", "label": "Community 38", "count": 33}, {"cid": 39, "color": "#BAB0AC", "label": "Community 39", "count": 29}, {"cid": 40, "color": "#4E79A7", "label": "Community 40", "count": 1}, {"cid": 41, "color": "#F28E2B", "label": "Community 41", "count": 1}, {"cid": 42, "color": "#E15759", "label": "Community 42", "count": 33}, {"cid": 43, "color": "#76B7B2", "label": "Community 43", "count": 58}, {"cid": 44, "color": "#59A14F", "label": "Community 44", "count": 60}, {"cid": 45, "color": "#EDC948", "label": "Community 45", "count": 95}, {"cid": 46, "color": "#B07AA1", "label": "Community 46", "count": 64}, {"cid": 47, "color": "#FF9DA7", "label": "Community 47", "count": 1}, {"cid": 48, "color": "#9C755F", "label": "Community 48", "count": 18}, {"cid": 49, "color": "#BAB0AC", "label": "Community 49", "count": 32}, {"cid": 50, "color": "#4E79A7", "label": "Community 50", "count": 18}, {"cid": 51, "color": "#F28E2B", "label": "Community 51", "count": 20}, {"cid": 52, "color": "#E15759", "label": "Community 52", "count": 31}, {"cid": 53, "color": "#76B7B2", "label": "Community 53", "count": 24}, {"cid": 54, "color": "#59A14F", "label": "Community 54", "count": 24}, {"cid": 55, "color": "#EDC948", "label": "Community 55", "count": 1}, {"cid": 56, "color": "#B07AA1", "label": "Community 56", "count": 1}, {"cid": 57, "color": "#FF9DA7", "label": "Community 57", "count": 1}, {"cid": 58, "color": "#9C755F", "label": "Community 58", "count": 22}, {"cid": 59, "color": "#BAB0AC", "label": "Community 59", "count": 30}, {"cid": 60, "color": "#4E79A7", "label": "Community 60", "count": 17}, {"cid": 61, "color": "#F28E2B", "label": "Community 61", "count": 37}, {"cid": 62, "color": "#E15759", "label": "Community 62", "count": 30}, {"cid": 63, "color": "#76B7B2", "label": "Community 63", "count": 52}, {"cid": 64, "color": "#59A14F", "label": "Community 64", "count": 24}, {"cid": 65, "color": "#EDC948", "label": "Community 65", "count": 62}, {"cid": 66, "color": "#B07AA1", "label": "Community 66", "count": 34}, {"cid": 67, "color": "#FF9DA7", "label": "Community 67", "count": 38}, {"cid": 68, "color": "#9C755F", "label": "Community 68", "count": 14}, {"cid": 69, "color": "#BAB0AC", "label": "Community 69", "count": 37}, {"cid": 70, "color": "#4E79A7", "label": "CoLine truncated
// HTML-escape helper — prevents XSS when injecting graph data into innerHTML
function esc(s) {
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,22 @@
-- backend/scripts/migrate_20260808_pl_plan_contract.sql
-- 运输计划:供方/需方分侧多合同关联
CREATE TABLE IF NOT EXISTS `pl_plan_contract` (
`id` varchar(64) NOT NULL COMMENT '主键ID',
`plan_id` varchar(64) NOT NULL COMMENT '运输计划ID',
`side` varchar(20) NOT NULL COMMENT 'supplier-供方 demander-需方',
`contract_id` varchar(64) NOT NULL COMMENT 'CRM合同ID',
`contract_no` varchar(50) DEFAULT NULL COMMENT '合同编号快照',
`tenant_no` varchar(64) NOT NULL DEFAULT 'shanxia2.0' COMMENT '租户编号',
`order_num` int DEFAULT NULL COMMENT '排序号',
`remark` varchar(512) DEFAULT NULL COMMENT '备注',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建人id',
`create_dept_id` varchar(64) NOT NULL DEFAULT '' COMMENT '创建人部门ID',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新人id',
`update_time` datetime NOT NULL COMMENT '更新时间',
`del_flag` smallint NOT NULL DEFAULT 0 COMMENT '删除标记:0-正常 1-已删除',
PRIMARY KEY (`id`),
KEY `idx_pl_plan_contract_plan` (`plan_id`, `del_flag`),
KEY `idx_pl_plan_contract_side` (`plan_id`, `side`, `del_flag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运输计划-合同关联(分侧多选)';
@@ -0,0 +1,158 @@
#!/usr/bin/env python3
"""将历史运输计划的单一合同/客户,按单据类型落到供方或需方。
规则(与产品确认一致):
- 出库单 outbound / 直销单 direct / 其它或空:旧合同 + 客户 → 需方
- 入库单 inbound:旧合同 + 客户 → 供方(customer_* 清空,写入 supplier_*)
处理范围:
1) 仍有 pl_plan.contract_id,且尚无 pl_plan_contract 有效关联 → 写入分侧合同
2) 无合同但有客户:按单据类型把客户落到供方/需方(便于用户继续完善)
用法(在 backend 目录、已激活 venv):
ENV_FILE=.env.production python scripts/migrate_20260808_pl_plan_legacy_party_contracts.py --dry-run
ENV_FILE=.env.production python scripts/migrate_20260808_pl_plan_legacy_party_contracts.py
"""
from __future__ import annotations
import argparse
import sys
from datetime import datetime
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from app.core.database import SessionLocal # noqa: E402
from app.core.utils import generate_uuid # noqa: E402
from app.models.pl_models import PlPlan, PlPlanContract # noqa: E402
def _resolve_side(plan_type: str) -> str:
return "supplier" if (plan_type or "").strip() == "inbound" else "demander"
def _has_text(value) -> bool:
return bool(str(value or "").strip())
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("--dry-run", action="store_true", help="只统计不落库")
args = parser.parse_args()
db = SessionLocal()
now = datetime.now()
linked = 0
party_updated = 0
skipped = 0
try:
plans = db.query(PlPlan).filter(PlPlan.del_flag == 0).all()
for plan in plans:
side = _resolve_side(plan.plan_type or "")
has_contract = _has_text(plan.contract_id)
has_customer = _has_text(plan.customer_id) or _has_text(plan.customer_name)
has_supplier = _has_text(plan.supplier_id) or _has_text(plan.supplier_name)
exists_link = (
db.query(PlPlanContract.id)
.filter(
PlPlanContract.plan_id == plan.id,
PlPlanContract.del_flag == 0,
)
.first()
)
changed = False
# 1) 合同落到分侧关联表
if has_contract and not exists_link:
if not args.dry_run:
db.add(
PlPlanContract(
id=generate_uuid(),
plan_id=plan.id,
side=side,
contract_id=plan.contract_id,
contract_no=plan.contract_no,
tenant_no=plan.tenant_no,
order_num=1,
create_by=plan.update_by or plan.create_by,
create_dept_id=plan.create_dept_id or "",
create_time=now,
update_by=plan.update_by or plan.create_by,
update_time=now,
del_flag=0,
)
)
linked += 1
changed = True
# 2) 客户落到供方/需方
if side == "supplier":
# 入库:客户 → 供方;清空需方客户
# - 供方为空:整段迁移
# - 供方与客户同名:清掉重复的需方客户
# - 供方与客户不同:保留两边,留给人工确认(不覆盖供方)
if has_customer and not has_supplier:
if not args.dry_run:
plan.supplier_id = plan.customer_id
plan.supplier_name = plan.customer_name
plan.customer_id = None
plan.customer_name = None
plan.destination_id = None
plan.destination_name = None
plan.update_time = now
party_updated += 1
changed = True
elif (
has_customer
and has_supplier
and str(plan.customer_name or "").strip()
== str(plan.supplier_name or "").strip()
):
if not args.dry_run:
plan.customer_id = None
plan.customer_name = None
plan.destination_id = None
plan.destination_name = None
plan.update_time = now
party_updated += 1
changed = True
else:
# 出库/直销:客户保留在需方;补齐 destination
if has_customer and not _has_text(plan.destination_name):
if not args.dry_run:
plan.destination_id = plan.customer_id
plan.destination_name = plan.customer_name
plan.update_time = now
party_updated += 1
changed = True
if not changed:
skipped += 1
if args.dry_run:
db.rollback()
print(
f"[dry-run] would link contracts={linked}, "
f"update party fields={party_updated}, skipped={skipped}"
)
else:
db.commit()
print(
f"ok linked contracts={linked}, "
f"updated party fields={party_updated}, skipped={skipped}"
)
return 0
except Exception as exc:
db.rollback()
print(f"ERR {type(exc).__name__}: {exc}")
return 1
finally:
db.close()
if __name__ == "__main__":
raise SystemExit(main())
File diff suppressed because it is too large. Load diff
+922
View File
@@ -0,0 +1,922 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fresh Mint · 首页菜单目录 Demo(找得到)</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
<style>
:root {
--primary: #10b981;
--primary-dark: #059669;
--primary-bg: #ecfdf5;
--text: #1e293b;
--text-muted: #64748b;
--border: #d9e8e2;
--surface: #ffffff;
--bg-page: #f8fafc;
--shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
--radius: 10px;
--warn: #d97706;
--row-hover: #ecfdf5;
--hit: #065f46;
}
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
font-size: 14px;
line-height: 1.5;
color: var(--text);
background: var(--bg-page);
}
button, input { font-family: inherit; }
.page { max-width: 1080px; margin: 0 auto; padding: 24px 16px 72px; }
.intro { margin-bottom: 16px; }
.intro h1 {
margin: 0 0 6px;
font-size: 20px;
font-weight: 700;
}
.intro h1 span { color: var(--primary); }
.intro p {
margin: 0;
font-size: 13px;
color: var(--text-muted);
max-width: 760px;
}
.intro ul {
margin: 10px 0 0;
padding: 10px 12px 10px 28px;
background: #fff;
border: 1px solid var(--border);
border-radius: 8px;
font-size: 12px;
color: var(--text-muted);
}
.intro li { margin: 3px 0; }
.intro b { color: var(--text); font-weight: 600; }
/* 工作区 */
.shell {
border: 1px solid var(--border);
border-radius: 12px;
background: #fff;
box-shadow: var(--shadow);
overflow: hidden;
display: grid;
grid-template-rows: auto 1fr;
min-height: 620px;
max-height: calc(100vh - 140px);
}
.search-bar {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 16px;
border-bottom: 1px solid var(--border);
background: linear-gradient(180deg, #ecfdf5 0%, #fff 85%);
}
.search-wrap {
position: relative;
flex: 1;
}
.search-wrap svg {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
width: 18px;
height: 18px;
color: var(--text-muted);
pointer-events: none;
}
.search-wrap input {
width: 100%;
height: 42px;
padding: 0 96px 0 40px;
border: 1px solid var(--border);
border-radius: 8px;
font-size: 15px;
font-weight: 500;
outline: none;
background: #fff;
}
.search-wrap input:focus {
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.search-wrap .hint {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
font-size: 11px;
color: #94a3b8;
pointer-events: none;
}
.search-meta {
flex-shrink: 0;
font-size: 12px;
color: var(--text-muted);
white-space: nowrap;
}
.search-meta b {
color: var(--primary-dark);
font-variant-numeric: tabular-nums;
}
.body {
display: grid;
grid-template-columns: 168px 1fr 36px;
min-height: 0;
}
@media (max-width: 800px) {
.body { grid-template-columns: 1fr; }
.index, .letters { display: none !important; }
}
/* 左侧:模块索引(只负责跳转/过滤,不铺卡片) */
.index {
border-right: 1px solid var(--border);
background: #f8fafc;
overflow: auto;
padding: 8px 6px;
}
.index-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: 6px;
width: 100%;
padding: 8px 10px;
margin: 1px 0;
border: 0;
border-radius: 8px;
background: transparent;
color: var(--text);
font-size: 13px;
font-weight: 500;
text-align: left;
cursor: pointer;
}
.index-item:hover { background: #eef2f7; }
.index-item.is-on {
background: var(--primary-bg);
color: var(--primary-dark);
font-weight: 700;
}
.index-item .n {
font-size: 11px;
font-weight: 600;
color: #94a3b8;
font-variant-numeric: tabular-nums;
}
.index-item.is-on .n { color: var(--primary-dark); }
/* 中间:可扫读的菜单目录 */
.dir {
overflow: auto;
min-height: 0;
padding: 0 0 16px;
scroll-behavior: smooth;
}
.fav-box {
margin: 12px 14px 8px;
padding: 10px 12px;
border: 1px solid #bbf7d0;
border-radius: 8px;
background: #f0fdf4;
}
.fav-box.is-hidden { display: none; }
.fav-box__title {
margin: 0 0 8px;
font-size: 12px;
font-weight: 700;
color: var(--primary-dark);
}
.fav-links {
display: flex;
flex-wrap: wrap;
gap: 6px 14px;
}
.fav-links a {
font-size: 13px;
font-weight: 600;
color: var(--text);
text-decoration: none;
border-bottom: 1px dashed transparent;
}
.fav-links a:hover {
color: var(--primary-dark);
border-bottom-color: var(--primary);
}
.group {
padding: 4px 0 2px;
scroll-margin-top: 8px;
}
.group.is-hidden { display: none; }
.group__head {
position: sticky;
top: 0;
z-index: 2;
display: flex;
align-items: center;
gap: 8px;
padding: 8px 14px;
background: rgba(255, 255, 255, 0.96);
border-bottom: 1px solid #eef2f0;
backdrop-filter: none;
}
.group__head h3 {
margin: 0;
font-size: 13px;
font-weight: 700;
}
.group__head span {
font-size: 11px;
color: var(--text-muted);
font-weight: 500;
}
/* 关键:多列文字链接,一眼扫名称 */
.menu-cols {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 0 8px;
padding: 4px 10px 10px;
}
@media (max-width: 960px) {
.menu-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
.menu-cols { grid-template-columns: 1fr; }
}
.menu-row {
display: grid;
grid-template-columns: 1fr auto;
align-items: center;
gap: 4px;
min-height: 34px;
padding: 4px 8px;
border-radius: 6px;
cursor: pointer;
border: 0;
background: transparent;
text-align: left;
width: 100%;
color: inherit;
}
.menu-row:hover,
.menu-row.is-active {
background: var(--row-hover);
}
.menu-row.is-hidden { display: none; }
.menu-row__name {
font-size: 13px;
font-weight: 600;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.menu-row__name mark {
background: #a7f3d0;
color: var(--hit);
border-radius: 2px;
padding: 0 1px;
font-weight: 700;
}
.menu-row__path {
display: none;
font-size: 11px;
color: var(--text-muted);
margin-top: 1px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 搜索时显示路径,帮助消歧 */
.dir.is-filtering .menu-row__path { display: block; }
.dir.is-filtering .menu-cols {
grid-template-columns: 1fr;
gap: 0;
padding: 4px 10px 12px;
}
.dir.is-filtering .menu-row {
grid-template-columns: 1fr 28px;
min-height: 40px;
padding: 6px 10px;
border-bottom: 1px solid #f1f5f9;
border-radius: 0;
}
.menu-row__star {
width: 24px;
height: 24px;
border: 0;
border-radius: 6px;
background: transparent;
color: #cbd5e1;
cursor: pointer;
display: grid;
place-items: center;
padding: 0;
opacity: 0;
flex-shrink: 0;
}
.menu-row:hover .menu-row__star,
.menu-row__star.is-on { opacity: 1; }
.menu-row__star.is-on { color: var(--warn); }
.menu-row__star:hover { background: #fff7ed; color: var(--warn); }
.empty {
display: none;
padding: 48px 20px;
text-align: center;
color: var(--text-muted);
font-size: 13px;
}
.empty.show { display: block; }
.empty code {
padding: 1px 6px;
border-radius: 4px;
background: #f1f5f9;
color: var(--text);
}
/* 右侧:拼音首字母快速跳转 */
.letters {
border-left: 1px solid var(--border);
background: #f8fafc;
display: flex;
flex-direction: column;
align-items: center;
padding: 8px 0;
gap: 1px;
overflow: auto;
}
.letters button {
width: 28px;
height: 20px;
border: 0;
border-radius: 4px;
background: transparent;
color: var(--text-muted);
font-size: 11px;
font-weight: 700;
cursor: pointer;
padding: 0;
}
.letters button:hover:not(:disabled) {
background: var(--primary-bg);
color: var(--primary-dark);
}
.letters button:disabled {
opacity: 0.25;
cursor: default;
}
.letters button.is-on {
background: var(--primary);
color: #fff;
}
.toast {
position: fixed;
left: 50%;
bottom: 24px;
transform: translateX(-50%) translateY(12px);
opacity: 0;
padding: 8px 14px;
border-radius: 8px;
background: #1e293b;
color: #fff;
font-size: 13px;
transition: .18s ease;
pointer-events: none;
z-index: 30;
}
.toast.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
</style>
</head>
<body>
<div class="page">
<header class="intro">
<h1>首页 · <span>菜单目录</span>(以「找得到」为目标)</h1>
<p>不做卡片墙、不做整行模块区。首页就是一张可搜索的菜单目录:左边点模块,中间扫名称,右边按拼音首字母跳转;搜索即时过滤并高亮匹配字。</p>
<ul>
<li><b>记得名字</b> → 直接输入(支持中文 / 拼音 / 首字母,如 <code>ht</code>、<code>hetong</code>、<code>合同</code>)</li>
<li><b>记得模块</b> → 左侧点模块,中间只看该模块</li>
<li><b>按字母找</b> → 右侧 A–Z 跳到对应首字母分组</li>
<li><b>常用</b> → 顶部收藏链接,一键直达</li>
</ul>
</header>
<div class="shell">
<div class="search-bar">
<div class="search-wrap">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
<circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" />
</svg>
<input id="q" type="search" placeholder="输入菜单名 / 拼音 / 首字母,回车打开第一条" autocomplete="off" autofocus />
<span class="hint">Enter 打开 · Esc 清空</span>
</div>
<div class="search-meta">匹配 <b id="hit-n">0</b> / <span id="total-n">0</span></div>
</div>
<div class="body">
<aside class="index" id="index" aria-label="模块"></aside>
<main class="dir" id="dir">
<div class="fav-box" id="fav-box">
<div class="fav-box__title">常用</div>
<div class="fav-links" id="fav-links"></div>
</div>
<div id="groups"></div>
<div class="empty" id="empty">没有匹配 <code id="empty-q"></code> 的菜单。可换拼音首字母试试,如 <code>ht</code></div>
</main>
<aside class="letters" id="letters" aria-label="拼音首字母"></aside>
</div>
</div>
</div>
<div class="toast" id="toast"></div>
<script>
/**
* 目标:最快找到菜单。
* - 即时过滤(不切页面)
* - 密排文字目录(比图标墙更好扫读)
* - 拼音 / 首字母(演示用内置字段)
* - 左侧模块 + 右侧字母双索引
*/
const MODULES = [
{
id: 'crm', title: 'CRM 管理',
items: [
{ name: '客户档案', py: 'kehu dang\'an', ab: 'khda' },
{ name: '联系人', py: 'lianxiren', ab: 'lxr' },
{ name: '商机跟进', py: 'shangji genjin', ab: 'sjgj' },
{ name: '合同管理', py: 'hetong guanli', ab: 'htgl' },
{ name: '回款记录', py: 'huikuan jilu', ab: 'hkjl' },
{ name: '报价单', py: 'baojia dan', ab: 'bjd' },
{ name: '拜访计划', py: 'baifang jihua', ab: 'bfjh' },
{ name: '公海池', py: 'gonghai chi', ab: 'ghc' }
]
},
{
id: 'pl', title: '计划物流',
items: [
{ name: '运输计划', py: 'yunshu jihua', ab: 'ysjh' },
{ name: '车辆调度', py: 'cheliang diaodu', ab: 'cldd' },
{ name: '人员排班', py: 'renyuan paiban', ab: 'rypb' },
{ name: '运力看板', py: 'yunli kanban', ab: 'ylkb' },
{ name: '线路管理', py: 'xianlu guanli', ab: 'xlgl' },
{ name: '运费结算', py: 'yunfei jiesuan', ab: 'yfjs' },
{ name: '异常反馈', py: 'yichang fankui', ab: 'ycfk' }
]
},
{
id: 'delivery', title: '配送业务',
items: [
{ name: '配送订单', py: 'peisong dingdan', ab: 'psdd' },
{ name: '配送任务', py: 'peisong renwu', ab: 'psrw' },
{ name: '签收管理', py: 'qianshou guanli', ab: 'qsgl' },
{ name: '配送员', py: 'peisong yuan', ab: 'psy' },
{ name: '站点配置', py: 'zhandian peizhi', ab: 'zdpz' }
]
},
{
id: 'weigh', title: '地磅协同',
items: [
{ name: '过磅记录', py: 'guobang jilu', ab: 'gbjl' },
{ name: '车辆登记', py: 'cheliang dengji', ab: 'cldj' },
{ name: '物资对照', py: 'wuzi duizhao', ab: 'wzd z' },
{ name: '异常过磅', py: 'yichang guobang', ab: 'ycgb' }
]
},
{
id: 'product', title: '商品中心',
items: [
{ name: '商品列表', py: 'shangpin liebiao', ab: 'splb' },
{ name: '分类管理', py: 'fenlei guanli', ab: 'flgl' },
{ name: '计量单位', py: 'jiliang danwei', ab: 'jldw' },
{ name: '价格策略', py: 'jiage celue', ab: 'jgcl' },
{ name: '库存概览', py: 'kucun gailan', ab: 'kcgl' }
]
},
{
id: 'order', title: '订单中心',
items: [
{ name: '销售订单', py: 'xiaoshou dingdan', ab: 'xsdd' },
{ name: '采购订单', py: 'caigou dingdan', ab: 'cgdd' },
{ name: '退货单', py: 'tuihuo dan', ab: 'thd' },
{ name: '对账单', py: 'duizhang dan', ab: 'dzd' }
]
},
{
id: 'supplier', title: '供应商',
items: [
{ name: '供应商档案', py: 'gongyingshang dang\'an', ab: 'gysda' },
{ name: '资质审核', py: 'zizhi shenhe', ab: 'zzsh' },
{ name: '供货协议', py: 'gonghuo xieyi', ab: 'ghxy' },
{ name: '评价记录', py: 'pingjia jilu', ab: 'pjjl' }
]
},
{
id: 'system', title: '系统管理',
items: [
{ name: '用户管理', py: 'yonghu guanli', ab: 'yhgl' },
{ name: '角色权限', py: 'juese quanxian', ab: 'jsqx' },
{ name: '部门管理', py: 'bumen guanli', ab: 'bmgl' },
{ name: '租户管理', py: 'zuhu guanli', ab: 'zhgl' },
{ name: '菜单管理', py: 'caidan guanli', ab: 'cdgl' },
{ name: '字典配置', py: 'zidian peizhi', ab: 'zdpz' },
{ name: '操作日志', py: 'caozuo rizhi', ab: 'czrz' }
]
},
{
id: 'demo', title: 'Demo',
items: [
{ name: '标准列表', py: 'biaozhun liebiao', ab: 'bzlb' },
{ name: '复杂列表', py: 'fuza liebiao', ab: 'fzlb' },
{ name: '商品列表', py: 'shangpin liebiao', ab: 'splb' },
{ name: '树形主数据', py: 'shuxing zhushuju', ab: 'sxzsj' },
{ name: '系统用户', py: 'xitong yonghu', ab: 'xtyh' }
]
}
]
// 修正笔误
MODULES.find((m) => m.id === 'weigh').items[2].ab = 'wzdz'
const FLAT = MODULES.flatMap((m) =>
m.items.map((it) => ({
...it,
moduleId: m.id,
moduleTitle: m.title,
letter: (it.py.replace(/^[^a-z]*/i, '')[0] || '#').toUpperCase(),
path: m.title
}))
)
let pins = ['合同管理', '运输计划', '配送订单', '用户管理']
let activeModule = 'all'
let activeLetter = ''
let activeName = ''
const starSvg = (on) =>
on
? '<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>'
: '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m12 17.27 6.18 3.73-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27z"/></svg>'
function toast(msg) {
const el = document.getElementById('toast')
el.textContent = msg
el.classList.add('show')
clearTimeout(toast._t)
toast._t = setTimeout(() => el.classList.remove('show'), 1100)
}
function normalize(s) {
return String(s || '')
.toLowerCase()
.replace(/['\s]/g, '')
}
function matchItem(it, q) {
if (!q) return true
const nq = normalize(q)
return (
it.name.includes(q) ||
normalize(it.py).includes(nq) ||
normalize(it.ab).includes(nq) ||
normalize(it.moduleTitle).includes(nq)
)
}
function highlight(name, q) {
if (!q || !name.includes(q)) return name
return name.split(q).join('<mark>' + q + '</mark>')
}
function openMenu(name) {
activeName = name
document.querySelectorAll('.menu-row').forEach((el) => {
el.classList.toggle('is-active', el.getAttribute('data-name') === name)
})
toast('打开「' + name + '」')
}
function togglePin(name) {
if (pins.includes(name)) pins = pins.filter((x) => x !== name)
else pins = [name, ...pins]
renderFav()
// 更新星标状态
document.querySelectorAll('.menu-row__star').forEach((btn) => {
const n = btn.getAttribute('data-star')
const on = pins.includes(n)
btn.classList.toggle('is-on', on)
btn.innerHTML = starSvg(on)
})
toast(pins.includes(name) ? '已加入常用' : '已取消常用')
}
function renderFav() {
const box = document.getElementById('fav-box')
const root = document.getElementById('fav-links')
const q = document.getElementById('q').value.trim()
const list = pins.filter((n) => {
const it = FLAT.find((x) => x.name === n)
return it && matchItem(it, q) && (activeModule === 'all' || it.moduleId === activeModule)
})
box.classList.toggle('is-hidden', !list.length && !pins.length)
if (!pins.length) {
root.innerHTML = '<span style="font-size:12px;color:#94a3b8">点击菜单右侧星标加入常用</span>'
return
}
if (!list.length) {
box.classList.add('is-hidden')
return
}
box.classList.remove('is-hidden')
root.innerHTML = list
.map((n) => '<a href="#" data-open="' + n + '">' + n + '</a>')
.join('')
root.querySelectorAll('[data-open]').forEach((a) => {
a.addEventListener('click', (e) => {
e.preventDefault()
openMenu(a.getAttribute('data-open'))
})
})
}
function renderIndex(counts) {
const root = document.getElementById('index')
const allCount = Object.values(counts).reduce((a, b) => a + b, 0)
const rows = [{ id: 'all', title: '全部菜单', n: allCount }].concat(
MODULES.map((m) => ({ id: m.id, title: m.title, n: counts[m.id] || 0 }))
)
root.innerHTML = rows
.map((r) => {
if (r.id !== 'all' && r.n === 0 && document.getElementById('q').value.trim()) {
return ''
}
return (
'<button type="button" class="index-item' +
(activeModule === r.id ? ' is-on' : '') +
'" data-mod="' +
r.id +
'"><span>' +
r.title +
'</span><span class="n">' +
r.n +
'</span></button>'
)
})
.join('')
root.querySelectorAll('[data-mod]').forEach((btn) => {
btn.addEventListener('click', () => {
activeModule = btn.getAttribute('data-mod')
activeLetter = ''
applyFilter({ scrollMod: activeModule === 'all' ? null : activeModule })
})
})
}
function renderLetters(available) {
const root = document.getElementById('letters')
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')
root.innerHTML = alphabet
.map((L) => {
const ok = available.has(L)
return (
'<button type="button" data-letter="' +
L +
'"' +
(ok ? '' : ' disabled') +
(activeLetter === L ? ' class="is-on"' : '') +
'>' +
L +
'</button>'
)
})
.join('')
root.querySelectorAll('button[data-letter]:not(:disabled)').forEach((btn) => {
btn.addEventListener('click', () => {
const L = btn.getAttribute('data-letter')
activeLetter = activeLetter === L ? '' : L
// 字母跳转:滚到该字母第一条
applyFilter({ scrollLetter: activeLetter || null })
})
})
}
function applyFilter(opts) {
opts = opts || {}
const q = document.getElementById('q').value.trim()
const dir = document.getElementById('dir')
const groupsRoot = document.getElementById('groups')
dir.classList.toggle('is-filtering', !!q)
const counts = {}
MODULES.forEach((m) => (counts[m.id] = 0))
const letters = new Set()
let hit = 0
let firstHitName = null
groupsRoot.innerHTML = MODULES.map((m) => {
const rows = m.items
.map((it) => {
const full = { ...it, moduleId: m.id, moduleTitle: m.title, path: m.title, letter: (it.py[0] || '#').toUpperCase() }
const okMatch = matchItem(full, q)
const okMod = activeModule === 'all' || activeModule === m.id
const okLetter = !activeLetter || full.letter === activeLetter
const show = okMatch && okMod && okLetter
if (okMatch && (activeModule === 'all' || activeModule === m.id)) {
// 计数不受字母限制,便于看模块存量;字母只影响列表显示
}
if (okMatch && okMod) {
counts[m.id]++
letters.add(full.letter)
}
if (!show) {
return (
'<button type="button" class="menu-row is-hidden" data-name="' +
it.name +
'" data-letter="' +
full.letter +
'"></button>'
)
}
hit++
if (!firstHitName) firstHitName = it.name
const on = pins.includes(it.name)
return (
'<div class="menu-row-wrap">' +
'<button type="button" class="menu-row' +
(activeName === it.name ? ' is-active' : '') +
'" data-name="' +
it.name +
'" data-letter="' +
full.letter +
'">' +
'<span>' +
'<div class="menu-row__name">' +
highlight(it.name, q) +
'</div>' +
'<div class="menu-row__path">' +
m.title +
' / ' +
it.name +
'</div>' +
'</span>' +
'<button type="button" class="menu-row__star' +
(on ? ' is-on' : '') +
'" data-star="' +
it.name +
'" aria-label="常用" tabindex="-1">' +
starSvg(on) +
'</button>' +
'</button>' +
'</div>'
)
})
.join('')
const groupShow = counts[m.id] > 0 && (activeModule === 'all' || activeModule === m.id)
// 若选了字母,组内可能全隐藏
const visibleInLetter = m.items.some((it) => {
const letter = (it.py[0] || '#').toUpperCase()
return matchItem({ ...it, moduleTitle: m.title }, q) && (!activeLetter || letter === activeLetter)
})
if (!groupShow || (activeLetter && !visibleInLetter && activeModule !== 'all' && activeModule !== m.id)) {
/* keep */
}
const showGroup =
(activeModule === 'all' || activeModule === m.id) &&
counts[m.id] > 0 &&
(!activeLetter ||
m.items.some((it) => {
const letter = (it.py[0] || '#').toUpperCase()
return matchItem({ ...it, moduleTitle: m.title }, q) && letter === activeLetter
}))
return (
'<section class="group' +
(showGroup ? '' : ' is-hidden') +
'" id="mod-' +
m.id +
'" data-mod="' +
m.id +
'">' +
'<div class="group__head"><h3>' +
m.title +
'</h3><span>' +
counts[m.id] +
' 项</span></div>' +
'<div class="menu-cols">' +
rows +
'</div>' +
'</section>'
)
}).join('')
// 字母过滤时隐藏不匹配行(上面已写入 is-hidden;再扫一遍修正)
groupsRoot.querySelectorAll('.menu-row').forEach((row) => {
if (!row.getAttribute('data-name')) {
row.remove()
return
}
const name = row.getAttribute('data-name')
const it = FLAT.find((x) => x.name === name)
if (!it) return
const okMatch = matchItem(it, q)
const okMod = activeModule === 'all' || activeModule === it.moduleId
const okLetter = !activeLetter || it.letter === activeLetter
const show = okMatch && okMod && okLetter
row.classList.toggle('is-hidden', !show)
// 重新统计 hit(上面 hit 在字母时可能偏大)
})
// 精确重算 hit
hit = groupsRoot.querySelectorAll('.menu-row:not(.is-hidden)').length
firstHitName =
(groupsRoot.querySelector('.menu-row:not(.is-hidden)') || {}).getAttribute?.('data-name') || null
document.getElementById('hit-n').textContent = String(hit)
document.getElementById('total-n').textContent = String(FLAT.length)
document.getElementById('empty').classList.toggle('show', hit === 0)
document.getElementById('empty-q').textContent = q || activeLetter || '当前条件'
renderIndex(counts)
renderLetters(letters)
renderFav()
groupsRoot.querySelectorAll('.menu-row:not(.is-hidden)').forEach((row) => {
row.addEventListener('click', (e) => {
if (e.target.closest('[data-star]')) return
openMenu(row.getAttribute('data-name'))
})
})
groupsRoot.querySelectorAll('[data-star]').forEach((btn) => {
btn.addEventListener('click', (e) => {
e.stopPropagation()
togglePin(btn.getAttribute('data-star'))
})
})
if (opts.scrollMod) {
const el = document.getElementById('mod-' + opts.scrollMod)
if (el && !el.classList.contains('is-hidden')) el.scrollIntoView({ block: 'start' })
}
if (opts.scrollLetter) {
const el = groupsRoot.querySelector(
'.menu-row:not(.is-hidden)[data-letter="' + opts.scrollLetter + '"]'
)
if (el) el.scrollIntoView({ block: 'center' })
}
applyFilter._first = firstHitName
}
const qInput = document.getElementById('q')
qInput.addEventListener('input', () => {
activeLetter = ''
applyFilter()
})
qInput.addEventListener('keydown', (e) => {
if (e.key === 'Enter') {
e.preventDefault()
if (applyFilter._first) openMenu(applyFilter._first)
}
if (e.key === 'Escape') {
qInput.value = ''
activeLetter = ''
applyFilter()
}
})
document.addEventListener('keydown', (e) => {
if (e.key === '/' && document.activeElement !== qInput) {
e.preventDefault()
qInput.focus()
qInput.select()
}
})
applyFilter()
qInput.focus()
</script>
</body>
</html>
@@ -39,7 +39,7 @@
- Create: `docs/sql/` 下增量 SQL(与仓库现有 pl 迁移脚本风格一致)
- Modify: `backend/app/models/pl_models.py`
- [ ] **Step 1: 编写建表 SQL**
- [x] **Step 1: 编写建表 SQL**
```sql
CREATE TABLE IF NOT EXISTS `pl_plan_contract` (
@@ -1,7 +1,7 @@
# 运输计划:供方/需方 + 合同多选 + 产品自由选择
**日期:** 2026-08-08
**状态:** 待评审
**状态:** 已实现(待联调验收)
**选定方案:** 方案 A — 主表存供方/需方客户;关联表存多侧多合同;产品走产品库 `ProductSelector`
## 1. 目标
@@ -74,9 +74,18 @@
### 3.5 历史数据
- 改造后打开旧计划编辑:供方客户、需方客户、两侧合同 **均显示为空**,不把旧 `contractId` / `customerName` 等映射进新 UI。
- 业务后续手工补全;保存时按新规则校验。
- 库内旧 `pl_plan.contract_id` / `contract_no` / `customer_*` 等字段可保留原值,但 **新读写以新模型为准**;新保存不再依赖「单一合同必填」。
**只做一次性数据刷新,业务代码不做历史兼容分支。**
用迁移脚本按单据类型把旧「单一合同 + 客户名称」写入新模型字段:
| 单据类型 | 旧合同 + 客户名称 | 另一侧 |
|----------|-------------------|--------|
| 出库单 `outbound` | → **需方**(`customer_*` + `pl_plan_contract.side=demander`) | 供方保留原 `supplier_*`(若有) |
| 直销单 `direct` / 空类型 | → **需方** | 同上 |
| 入库单 `inbound` | → **供方**(写入 `supplier_*`,清空 `customer_*`) | 需方留空 |
脚本:`backend/scripts/migrate_20260808_pl_plan_legacy_party_contracts.py`(`--dry-run` 可预览)。
迁移完成后,列表/编辑/详情只读新字段,不再在接口或前端适配旧 `contractId`。
## 4. 交互结构(新建/编辑弹窗)
+42 -32
View File
@@ -935,8 +935,8 @@
"semantic_hash": ""
},
"src/api/crm/contract/index.ts": {
"mtime": 1786031285.1914878,
"ast_hash": "99d7c4f81fcc44f6b5c1c90dbd56a520",
"mtime": 1786239385.8152473,
"ast_hash": "a141436b2cb8edf0e80801b254ef3336",
"semantic_hash": ""
},
"src/api/crm/contract/template.ts": {
@@ -945,8 +945,8 @@
"semantic_hash": ""
},
"src/api/crm/contract/types.ts": {
"mtime": 1786171262.9136248,
"ast_hash": "d301421896652a4cf4125e3fca2ebed8",
"mtime": 1786239385.815235,
"ast_hash": "e77bdb139daca593fbd2c008688f8eb2",
"semantic_hash": ""
},
"src/api/crm/customer.ts": {
@@ -1075,8 +1075,8 @@
"semantic_hash": ""
},
"src/api/pl/index.ts": {
"mtime": 1785970872.8240886,
"ast_hash": "daefbd0bb02f0f629cfde33fab26b550",
"mtime": 1786203614.841436,
"ast_hash": "d500d2145490101a6aac395a81889ec1",
"semantic_hash": ""
},
"src/api/pl/public-io-order.ts": {
@@ -1155,8 +1155,8 @@
"semantic_hash": ""
},
"src/components/QuoteSelector.vue": {
"mtime": 1786201461.8957162,
"ast_hash": "721a1efdc38ad56c57ed1e2d1f4ddf11",
"mtime": 1786201922.9244518,
"ast_hash": "2fe381187e74d218116f2955a81e199a",
"semantic_hash": ""
},
"src/components/TinyMceEditor/index.vue": {
@@ -1190,8 +1190,8 @@
"semantic_hash": ""
},
"src/components/business/contract-selector/index.vue": {
"mtime": 1786032256.4690578,
"ast_hash": "cb6c14ea1e4669264d3bf917fa3d12c4",
"mtime": 1786239834.7274897,
"ast_hash": "faa9d8b18f1987bea611c71864d732ba",
"semantic_hash": ""
},
"src/components/business/db/DbCrmCustomerSelect.vue": {
@@ -1340,8 +1340,8 @@
"semantic_hash": ""
},
"src/components/business/pl-plan-archive-dialog/index.vue": {
"mtime": 1785744290.2303405,
"ast_hash": "8aae97a8cdc2fba9410f778384320b7a",
"mtime": 1786243896.1124194,
"ast_hash": "eb96187d4dd6b71c388ac141da1b544c",
"semantic_hash": ""
},
"src/components/business/pl-plan-arrange-dialog/index.vue": {
@@ -1354,19 +1354,24 @@
"ast_hash": "97bdc1e9c176f701f1685103cf0c2719",
"semantic_hash": ""
},
"src/components/business/pl-plan-contract-multi-select/index.vue": {
"mtime": 1786243637.2230868,
"ast_hash": "3de3ff9e3995fb02858dbad0cc8b1c29",
"semantic_hash": ""
},
"src/components/business/pl-plan-driver-feedback-dialog/index.vue": {
"mtime": 1785452280.7953598,
"ast_hash": "1e1faf8b12eb1dab6ec4074bd7d52e5f",
"semantic_hash": ""
},
"src/components/business/pl-plan-form-dialog/PlPlanFormProductTable.vue": {
"mtime": 1786192906.9524052,
"ast_hash": "d1e569996b8e3464665f48c25fb1f0d6",
"mtime": 1786242615.7521327,
"ast_hash": "04b50436c316e3ad64c67c6765d079b3",
"semantic_hash": ""
},
"src/components/business/pl-plan-form-dialog/index.vue": {
"mtime": 1786074714.1603935,
"ast_hash": "89509e4a9aef9f94c789b8ec9f2e2b04",
"mtime": 1786242552.4727957,
"ast_hash": "263a00d703ba8934d049ed8e255abdcf",
"semantic_hash": ""
},
"src/components/business/pl-plan-hazard-cert-view-table/index.vue": {
@@ -1390,8 +1395,8 @@
"semantic_hash": ""
},
"src/components/business/pl-plan-transport-feedback-blocks/index.vue": {
"mtime": 1785747851.111156,
"ast_hash": "fe05504f4eb93f047e986affa2baafa8",
"mtime": 1786243251.1208916,
"ast_hash": "bf4df0b891df720a984ae280d85d254f",
"semantic_hash": ""
},
"src/components/business/pl-plan-type-tabs/index.vue": {
@@ -1405,8 +1410,8 @@
"semantic_hash": ""
},
"src/components/business/pl-plan-view-tabs/index.vue": {
"mtime": 1785969982.7022471,
"ast_hash": "a357a04abe3c9f84be6278ce3163d157",
"mtime": 1786252078.5323207,
"ast_hash": "fb8696cf3071a4d6b9b31064b6e7e8de",
"semantic_hash": ""
},
"src/components/business/pl-product-name-hazard-cell/index.vue": {
@@ -2874,6 +2879,11 @@
"ast_hash": "8f7ff061b93a84cdbab5afb9b1cbc984",
"semantic_hash": ""
},
"src/utils/pl-internal-customer.ts": {
"mtime": 1786203608.767169,
"ast_hash": "a7c37ae45a3e9d952e9e8626f1823e46",
"semantic_hash": ""
},
"src/utils/pl-paste-recognize.ts": {
"mtime": 1785656689.388857,
"ast_hash": "10746a1e7a735dca458ae9bbf50ed2b3",
@@ -2930,8 +2940,8 @@
"semantic_hash": ""
},
"src/utils/router/portal-home-cards.ts": {
"mtime": 1786161734.1522784,
"ast_hash": "4e99d4efb35fd946594cf108c78b30df",
"mtime": 1786255097.1612754,
"ast_hash": "7ac9835baf3632d4267f53766397a4c2",
"semantic_hash": ""
},
"src/utils/router/portal-menu.ts": {
@@ -3215,8 +3225,8 @@
"semantic_hash": ""
},
"src/views/crm/contract/ContractListPage.vue": {
"mtime": 1786190113.0920904,
"ast_hash": "3ac6223e32db2fe10a7d814ced2461a2",
"mtime": 1786201986.3166819,
"ast_hash": "2cb8aa3df837a6571567fbaa60defbb3",
"semantic_hash": ""
},
"src/views/crm/contract/approval-record/index.vue": {
@@ -3725,13 +3735,13 @@
"semantic_hash": ""
},
"src/views/pl/plan-archive/index.vue": {
"mtime": 1786197035.7200282,
"ast_hash": "e753264e0e5f4cd0d2ac7ad4b306afb9",
"mtime": 1786254044.121564,
"ast_hash": "20d86e606ec30eaa9f2cb76a076c2213",
"semantic_hash": ""
},
"src/views/pl/plan-cert/index.vue": {
"mtime": 1786197037.217237,
"ast_hash": "8fef9e3eda810d83d6d37d086398e437",
"mtime": 1786254210.7890842,
"ast_hash": "dc473bf8c9f8a328456b6b82fff6aa47",
"semantic_hash": ""
},
"src/views/pl/plan/arrange.vue": {
@@ -3750,8 +3760,8 @@
"semantic_hash": ""
},
"src/views/pl/plan/index.vue": {
"mtime": 1786197036.7124588,
"ast_hash": "b21a0b880d17f4d39606e2e10e5568b0",
"mtime": 1786243081.8223443,
"ast_hash": "5d07bc928a9abb5221d86824ad93cedb",
"semantic_hash": ""
},
"src/views/pl/self-vehicle/index.vue": {
@@ -3805,8 +3815,8 @@
"semantic_hash": ""
},
"src/views/portal/home/index.vue": {
"mtime": 1786164745.646318,
"ast_hash": "6195e5f6b88f0d1d79fcfc7b211f2cfe",
"mtime": 1786255147.3486447,
"ast_hash": "39f52e4b2bda1f236ce40d2c5d27d166",
"semantic_hash": ""
},
"src/views/public/db/inventory/index.vue": {
+23 -7
View File
@@ -111,7 +111,7 @@
"109": "Community 109",
"110": "Community 110",
"111": "format.ts",
"112": "types.ts",
"112": "inventory.ts",
"113": "Community 113",
"114": "index.vue",
"115": "useDictStore",
@@ -144,6 +144,7 @@
"142": "Community 142",
"143": "index.js",
"144": "Community 144",
"145": "api",
"146": "price-letter-template.ts",
"147": "loading.ts",
"148": "Community 148",
@@ -151,40 +152,58 @@
"150": "Community 150",
"151": "Community 151",
"152": "SettingDrawer.vue",
"153": "index.vue",
"154": "detail.vue",
"155": "ArtException.vue",
"155": "contractType.ts",
"156": "v2.5.7 - 2025-09-14",
"157": "form.vue",
"158": "removeProductsNotAllowedByHazard",
"159": "detail.vue",
"160": "product.ts",
"161": "Community 161",
"162": "Community 162",
"163": "pool.ts",
"164": "Community 164",
"165": "handleDisburse",
"166": "Community 166",
"167": "Community 167",
"168": "AssignDialog.vue",
"169": "Community 169",
"170": "Community 170",
"171": "index.vue",
"172": "index.js",
"173": "index.vue",
"174": "Community 174",
"175": "v2.5.7 - 2025-09-14",
"176": "index.vue",
"177": "emit",
"178": "Community 178",
"179": "Community 179",
"180": "index.vue",
"181": "Community 181",
"182": "Community 182",
"185": "zh_CN.js",
"183": "StorageConfig",
"184": "system.ts",
"185": "SettingActions.vue",
"186": "StorageKeyManager",
"187": "Community 187",
"188": "Community 188",
"189": "Community 189",
"194": "detail.vue",
"190": "ViewKvTableCell.vue",
"191": "handleConfirmApproval",
"192": "handleDisburse",
"195": "Community 195",
"196": "Community 196",
"200": "index.js",
"201": "index.vue",
"202": "Community 202",
"206": "index.vue",
"207": "Community 207",
"208": "Community 208",
"209": "Community 209",
"210": "Community 210",
"211": "v2.4.2.1 - 2025-06-16",
"212": "index.js",
"213": "Community 213",
"214": "Community 214",
"223": "Community 223",
@@ -209,7 +228,6 @@
"265": "Community 265",
"269": "Community 269",
"270": "Community 270",
"276": "Community 276",
"280": "Community 280",
"283": "Community 283",
"284": "Community 284",
@@ -298,7 +316,6 @@
"459": "Community 459",
"460": "Community 460",
"462": "Community 462",
"465": "index.vue",
"471": "Community 471",
"472": "Community 472",
"473": "Community 473",
@@ -438,7 +455,6 @@
"840": "index.vue",
"857": "index.ts",
"886": "index.vue",
"887": "index.vue",
"889": "QuoteSelector.vue",
"892": "index.vue",
"896": "MarkWonDialog.vue",
@@ -0,0 +1,811 @@
{
"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": "fetchCustomerDetail",
"99": "StorageKeyManager",
"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": "crm-product-display.ts",
"122": "handleDisburse",
"123": "detail.vue",
"124": "index.vue",
"125": "Community 125",
"126": "Community 126",
"127": "selectContractRow",
"128": "Community 128",
"129": "Community 129",
"130": "emit",
"131": "prepareLineAliasAndBrandForSubmit",
"132": "Community 132",
"133": "Community 133",
"134": "index.vue",
"135": "detail.vue",
"136": "Community 136",
"137": "Community 137",
"138": "index.vue",
"139": "useTableColumns.ts",
"140": "Community 140",
"141": "Community 141",
"142": "Community 142",
"143": "index.js",
"144": "Community 144",
"145": "api",
"146": "price-letter-template.ts",
"147": "loading.ts",
"148": "Community 148",
"149": "fetchCustomerDetail",
"150": "Community 150",
"151": "Community 151",
"152": "SettingDrawer.vue",
"153": "index.vue",
"154": "detail.vue",
"155": "contractType.ts",
"156": "v2.5.7 - 2025-09-14",
"157": "form.vue",
"158": "removeProductsNotAllowedByHazard",
"159": "detail.vue",
"160": "product.ts",
"161": "Community 161",
"162": "Community 162",
"163": "pool.ts",
"164": "Community 164",
"165": "handleDisburse",
"166": "Community 166",
"167": "Community 167",
"168": "AssignDialog.vue",
"169": "Community 169",
"170": "Community 170",
"171": "index.vue",
"172": "index.js",
"173": "index.vue",
"174": "Community 174",
"175": "v2.5.7 - 2025-09-14",
"176": "index.vue",
"177": "emit",
"178": "Community 178",
"179": "Community 179",
"180": "index.vue",
"181": "Community 181",
"182": "Community 182",
"183": "StorageConfig",
"184": "system.ts",
"185": "SettingActions.vue",
"186": "StorageKeyManager",
"187": "Community 187",
"188": "Community 188",
"189": "Community 189",
"190": "ViewKvTableCell.vue",
"191": "handleConfirmApproval",
"192": "handleDisburse",
"194": "handlePublish",
"195": "Community 195",
"196": "Community 196",
"199": "index.vue",
"200": "index.js",
"201": "index.vue",
"202": "Community 202",
"206": "index.vue",
"207": "Community 207",
"208": "Community 208",
"209": "Community 209",
"210": "Community 210",
"211": "v2.4.2.1 - 2025-06-16",
"212": "index.js",
"213": "Community 213",
"214": "Community 214",
"223": "Community 223",
"224": "Community 224",
"227": "Community 227",
"228": "Community 228",
"233": "Community 233",
"234": "Community 234",
"235": "index.vue",
"239": "Community 239",
"242": "Community 242",
"243": "Community 243",
"247": "Community 247",
"248": "Community 248",
"251": "handleDisburse",
"253": "Community 253",
"254": "Community 254",
"255": "Community 255",
"259": "Community 259",
"260": "Community 260",
"261": "Community 261",
"265": "Community 265",
"269": "Community 269",
"270": "Community 270",
"280": "Community 280",
"283": "Community 283",
"284": "Community 284",
"285": "Community 285",
"286": "Community 286",
"292": "Community 292",
"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",
"354": "Community 354",
"355": "Community 355",
"362": "Community 362",
"364": "Community 364",
"367": "Community 367",
"372": "detail.vue",
"377": "Community 377",
"379": "Community 379",
"380": "Community 380",
"381": "Community 381",
"383": "ApproverSelector.vue",
"391": "Community 391",
"392": "Community 392",
"393": "Community 393",
"394": "Community 394",
"405": "zh_CN.js",
"406": "Community 406",
"408": "Community 408",
"409": "DbCrmCustomerSelect.vue",
"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",
"428": "Community 428",
"435": "index.vue",
"443": "index.vue",
"444": "index.vue",
"445": "Community 445",
"458": "Community 458",
"459": "Community 459",
"460": "Community 460",
"462": "Community 462",
"471": "Community 471",
"472": "Community 472",
"473": "Community 473",
"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",
"708": "Community 708",
"709": "Community 709",
"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": "新增",
"770": "移除",
"772": "重构",
"779": "重构",
"785": "⚠️ 重要提示",
"786": "⚠️ 重要提示",
"788": "⚠️ 重要提示",
"796": "OpportunityForm.vue",
"806": "index.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",
"919": "ToContractDialog.vue",
"924": "OpportunitySelector.vue",
"950": "BatchUpdateStageDialog.vue",
"1010": "BxApprovalFlowTabs.vue",
"1015": "DealDialog.vue",
"1016": "TransferDialog.vue",
"1017": "BatchUpdateDateDialog.vue",
"1027": "IntoPoolDialog.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",
"1175": "index.vue",
"1197": "icons.js",
"1198": "icons.min.js",
"1199": "index.js",
"1200": "index.js",
"1201": "index.js",
"1202": "index.js",
"1203": "index.js",
"1204": "plugin.js",
"1205": "plugin.min.js",
"1206": "index.js",
"1207": "plugin.js",
"1208": "plugin.min.js",
"1209": "index.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",
"1221": "index.js",
"1222": "emojiimages.js",
"1223": "emojiimages.min.js",
"1224": "emojis.js",
"1225": "emojis.min.js",
"1226": "index.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": "_",
"1270": "index.js",
"1271": "plugin.js",
"1272": "plugin.min.js",
"1275": "index.js",
"1277": "plugin.js",
"1278": "plugin.min.js",
"1279": "index.js",
"1280": "plugin.js",
"1281": "plugin.min.js",
"1282": "index.js",
"1283": "plugin.js",
"1284": "plugin.min.js",
"1286": "index.js",
"1287": "plugin.js",
"1288": "plugin.min.js",
"1289": "index.js",
"1290": "index.js",
"1291": "index.js",
"1292": "index.js",
"1293": "plugin.js",
"1294": "plugin.min.js",
"1295": "index.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",
"1323": "index.vue",
"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
+1
View File
@@ -23,6 +23,7 @@ function mapListQuery(query: ContractQuery = {}): Record<string, any> {
pageSize: query.pageSize ?? 20
}
const fields: (keyof ContractQuery)[] = [
'keyword',
'contractNo',
'contractName',
'customerName',
+2
View File
@@ -9,6 +9,8 @@
export interface ContractQuery {
pageNum?: number
pageSize?: number
/** 即时检索:合同编号 / 合同产品名称 / 产品拼音首字母 */
keyword?: string
contractNo?: string
contractName?: string
customerId?: number | string
+17 -1
View File
@@ -380,6 +380,11 @@ export const driverApi = {
// 计划管理 API
// =============================================================================
export interface PlanContractLink {
contractId: string
contractNo?: string
}
export interface PlanProduct {
id: string
planId: string
@@ -418,6 +423,11 @@ export interface PlanProduct {
remark?: string
}
export interface PlanContractLink {
contractId: string
contractNo?: string
}
export interface Plan {
id: string
planNo: string
@@ -431,6 +441,8 @@ export interface Plan {
completeStatus: string
contractId?: string
contractNo?: string
supplierContracts?: PlanContractLink[]
demanderContracts?: PlanContractLink[]
supplierId?: string
supplierName?: string
destinationId?: string
@@ -479,6 +491,8 @@ export interface Plan {
createBy?: string
createTime: string
products?: PlanProduct[]
supplierContracts?: PlanContractLink[]
demanderContracts?: PlanContractLink[]
}
export interface PlanQuery {
@@ -520,7 +534,7 @@ export interface PlanTransportCreateBlock {
}
export interface PlanCreateFullPayload {
contractId: string
contractId?: string
createDate: string
planDate?: string | null
belongsCompany: string
@@ -556,6 +570,8 @@ export interface PlanCreateFullPayload {
followUserId?: string
followUserName?: string
remark?: string
supplierContracts?: PlanContractLink[]
demanderContracts?: PlanContractLink[]
products: Array<{
productId: string
productNo: string
@@ -15,51 +15,22 @@
>
<p v-if="selectableStatusHint" class="contract-selector-hint">{{ selectableStatusHint }}</p>
<div class="filter-block contract-selector-filter">
<el-form ref="queryFormRef" :model="queryParams" class="filter-form" @submit.prevent>
<div class="filter-grid">
<el-form-item label="合同编号" prop="contractNo">
<el-input
v-model="queryParams.contractNo"
placeholder="搜索合同编号"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="合同名称" prop="contractName">
<el-input
v-model="queryParams.contractName"
placeholder="搜索合同名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="客户名称" prop="customerName">
<el-input
v-model="queryParams.customerName"
placeholder="搜索客户名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
</div>
<div class="filter-actions">
<div class="filter-actions-start" />
<div class="filter-actions-end">
<el-button class="btn-ghost" :loading="loading" @click="resetQuery">
<el-icon><RefreshLeft /></el-icon>重置
</el-button>
<el-button class="btn-main" type="primary" :loading="loading" @click="handleQuery">
<el-icon><Search /></el-icon>搜索
</el-button>
</div>
</div>
</el-form>
</div>
<div class="panel dialog-list-panel contract-selector-panel">
<div class="contract-selector-quick-search">
<el-input
v-model="queryParams.keyword"
clearable
placeholder="合同编号 / 产品名称 / 产品拼音首字母"
>
<template #prefix>
<el-icon><Search /></el-icon>
</template>
</el-input>
</div>
<div class="panel dialog-list-panel">
<div class="list-body list-wrap dialog-list-body-only">
<ListTable table-key="business-contract-selector"
<ListTable
table-key="business-contract-selector"
ref="tableRef"
v-loading="loading"
:data="contractList"
@@ -74,7 +45,15 @@
>
<el-table-column label="" min-width="48" align="center" header-align="center">
<template #default="{ row }">
<el-checkbox
v-if="multiple"
:model-value="selectedIdSet.has(String(row.id))"
:disabled="!isContractSelectable(row)"
@click.stop
@change="checked => handleCheckboxChange(row, !!checked)"
/>
<el-radio
v-else
v-model="selectedId"
:label="String(row.id)"
:disabled="!isContractSelectable(row)"
@@ -89,7 +68,7 @@
<el-table-column
prop="contractNo"
label="合同编号"
min-width="150"
min-width="140"
align="center"
header-align="center"
show-overflow-tooltip
@@ -106,15 +85,7 @@
<span v-else>—</span>
</template>
</el-table-column>
<el-table-column
prop="customerName"
label="客户名称"
min-width="150"
align="center"
header-align="center"
show-overflow-tooltip
/>
<el-table-column label="产品信息" min-width="280" align="left" header-align="center">
<el-table-column label="产品信息" min-width="260" align="left" header-align="center">
<template #default="{ row }">
<div v-if="row.products?.length" class="contract-selector-products">
<div
@@ -128,34 +99,36 @@
<span v-else class="contract-selector-products__empty">—</span>
</template>
</el-table-column>
<el-table-column prop="contractType" label="合同类型" min-width="110" align="center" header-align="center">
<el-table-column
prop="contractType"
label="合同类型"
min-width="110"
align="center"
header-align="center"
>
<template #default="{ row }">
<DictTag dict-type="crm_contract_type" :value="row.contractType" />
</template>
</el-table-column>
<el-table-column label="已关联的运输计划数" min-width="140" align="center" header-align="center">
<template #default="{ row }">
{{ planCountMap[String(row.id)] ?? 0 }}
</template>
</el-table-column>
<el-table-column prop="status" label="状态" min-width="100" align="center" header-align="center">
<template #default="{ row }">
<DictTag dict-type="crm_contract_status" :value="row.status" />
</template>
</el-table-column>
<el-table-column
v-if="!hideAmount"
prop="amount"
label="合同金额"
min-width="120"
align="right"
prop="customerName"
label="客户名称"
min-width="150"
align="center"
header-align="center"
>
<template #default="{ row }">
<span class="money-display">{{ formatMoneyDisplay(row.amount) }}</span>
</template>
</el-table-column>
show-overflow-tooltip
/>
<el-table-column prop="signDate" label="签订日期" min-width="120" align="center" header-align="center" />
<el-table-column label="已关联的运输计划数" min-width="140" align="center" header-align="center">
<template #default="{ row }">
{{ planCountMap[String(row.id)] ?? 0 }}
</template>
</el-table-column>
</ListTable>
<ListPagination
@@ -176,7 +149,7 @@
<el-button
class="btn-main"
type="primary"
:disabled="!currentRow"
:disabled="multiple ? selectedIdSet.size < 1 : !currentRow"
:loading="detailLoading"
@click="handleConfirm"
>
@@ -190,15 +163,14 @@
</template>
<script setup lang="ts">
import { Check, Close, RefreshLeft, Search } from '@element-plus/icons-vue'
import type { FormInstance, TableInstance } from 'element-plus'
import { Check, Close, Search } from '@element-plus/icons-vue'
import type { TableInstance } from 'element-plus'
import { getContract, listContract } from '@/api/crm/contract'
import type { ContractProductForm, ContractQuery, ContractVO } from '@/api/crm/contract/types'
import { planApi } from '@/api/pl'
import DictTag from '@/components/DictTag/index.vue'
import ListPagination from '@/components/ListPagination/index.vue'
import { useDictStore } from '@/store/modules/dict'
import { formatMoneyDisplay } from '@/utils/money-format'
import { formatPlanProductListText } from '@/utils/pl-display'
const ContractDetailDialog = defineAsyncComponent(
@@ -211,10 +183,19 @@ const props = withDefaults(
hideAmount?: boolean
/** 仅这些状态的合同可被选中;未配置时列表内均可选 */
selectableStatuses?: string[]
/** 限定客户:只展示该客户合同 */
customerId?: string
/** 多选模式(运输计划供方/需方) */
multiple?: boolean
/** 多选模式下已选合同 ID(打开时预勾选) */
selectedIds?: string[]
}>(),
{
hideAmount: false,
selectableStatuses: undefined
selectableStatuses: undefined,
customerId: undefined,
multiple: false,
selectedIds: () => []
}
)
@@ -223,6 +204,7 @@ const dictStore = useDictStore()
const emit = defineEmits<{
'update:visible': [value: boolean]
confirm: [contract: ContractVO]
confirmMultiple: [contracts: ContractVO[]]
}>()
const innerVisible = computed({
@@ -230,7 +212,6 @@ const innerVisible = computed({
set: value => emit('update:visible', value)
})
const queryFormRef = ref<FormInstance>()
const tableRef = ref<TableInstance>()
const loading = ref(false)
const detailLoading = ref(false)
@@ -245,20 +226,30 @@ const contractDetailRef = ref<InstanceType<typeof ContractDetailDialog>>()
const queryParams = reactive<ContractQuery>({
pageNum: 1,
pageSize: 20,
contractNo: '',
contractName: '',
customerName: '',
keyword: '',
customerId: undefined,
excludeStatus: 'invalid',
includeProducts: true
})
const selectedIdSet = ref<Set<string>>(new Set())
const selectableStatusHint = computed(() => {
if (!props.selectableStatuses?.length) return ''
const labels = props.selectableStatuses
.map(status => dictStore.getLabel('crm_contract_status', status))
.filter(Boolean)
if (!labels.length) return '仅部分状态的合同可被选择'
return `仅「${labels.join('」「')}」状态的合同可被选择,其他状态仅展示不可选`
const parts: string[] = []
if (props.customerId) {
parts.push('仅展示当前客户下的合同')
}
if (props.selectableStatuses?.length) {
const labels = props.selectableStatuses
.map(status => dictStore.getLabel('crm_contract_status', status))
.filter(Boolean)
if (labels.length) {
parts.push(`仅「${labels.join('」「')}」状态可被选择,其他状态仅展示不可选`)
} else {
parts.push('仅部分状态的合同可被选择')
}
}
return parts.join(';')
})
function formatContractProductLine(product: ContractProductForm) {
@@ -357,6 +348,15 @@ function selectContractRow(row: ContractVO | null | undefined, options?: { silen
}
function handleRowClick(row: ContractVO) {
if (props.multiple) {
if (!isContractSelectable(row)) {
warnContractNotSelectable(row)
return
}
const id = String(row.id)
handleCheckboxChange(row, !selectedIdSet.value.has(id))
return
}
selectContractRow(row)
}
@@ -364,6 +364,19 @@ function handleRadioChange(row: ContractVO) {
selectContractRow(row)
}
function handleCheckboxChange(row: ContractVO, checked: boolean) {
if (!row?.id) return
if (!isContractSelectable(row)) {
warnContractNotSelectable(row)
return
}
const id = String(row.id)
const next = new Set(selectedIdSet.value)
if (checked) next.add(id)
else next.delete(id)
selectedIdSet.value = next
}
async function loadPlanCounts() {
const ids = contractList.value.map(item => String(item.id)).filter(Boolean)
if (!ids.length) {
@@ -379,28 +392,13 @@ async function loadPlanCounts() {
}
}
function handleQuery() {
queryParams.pageNum = 1
getList()
}
function resetQuery() {
queryFormRef.value?.resetFields()
queryParams.pageNum = 1
getList()
}
watchDebounced(
() => ({
contractNo: queryParams.contractNo,
contractName: queryParams.contractName,
customerName: queryParams.customerName
}),
() => queryParams.keyword,
() => {
queryParams.pageNum = 1
getList()
},
{ debounce: 300, deep: true }
{ debounce: 300 }
)
function handleCurrentChange(row: ContractVO | undefined) {
@@ -422,8 +420,11 @@ function handleCurrentChange(row: ContractVO | undefined) {
function handleOpen() {
selectedId.value = ''
currentRow.value = null
selectedIdSet.value = new Set((props.selectedIds || []).map(String).filter(Boolean))
planCountMap.value = {}
queryParams.pageNum = 1
queryParams.keyword = ''
queryParams.customerId = props.customerId || undefined
nextTick(() => {
tableRef.value?.setCurrentRow(undefined)
})
@@ -431,6 +432,26 @@ function handleOpen() {
}
async function handleConfirm() {
if (props.multiple) {
const ids = Array.from(selectedIdSet.value)
if (!ids.length) {
ElMessage.warning('请至少选择一份合同')
return
}
detailLoading.value = true
try {
const details: ContractVO[] = []
for (const id of ids) {
const res = await getContract(id)
details.push((res.data ?? res) as ContractVO)
}
emit('confirmMultiple', details)
innerVisible.value = false
} finally {
detailLoading.value = false
}
return
}
if (!currentRow.value?.id) return
if (!isContractSelectable(currentRow.value)) {
warnContractNotSelectable(currentRow.value)
@@ -460,48 +481,18 @@ async function handleConfirm() {
border-radius: 8px;
}
.contract-selector-filter {
padding: 12px 16px 10px;
background: var(--mint-surface);
border: 1px solid var(--mint-border);
border-radius: var(--mint-radius);
margin-bottom: 12px;
.filter-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 10px 14px;
}
.filter-actions {
margin-top: 10px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.filter-actions-end {
display: flex;
align-items: center;
gap: 8px;
margin-left: auto;
}
.filter-actions-end .el-button + .el-button {
margin-left: 0 !important;
.contract-selector-panel {
> .list-body.list-wrap {
border-top: none;
}
}
@media (max-width: 1100px) {
.contract-selector-filter .filter-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
.contract-selector-quick-search {
margin: 0 0 12px;
@media (max-width: 560px) {
.contract-selector-filter .filter-grid {
grid-template-columns: 1fr;
:deep(.el-input) {
width: 100%;
max-width: 420px;
}
}
@@ -19,7 +19,6 @@
<el-tab-pane label="归档填写" name="archive" />
<el-tab-pane label="计划概况" name="overview" />
<el-tab-pane label="运输信息" name="transport" />
<el-tab-pane label="合同信息" name="contract" />
</el-tabs>
<div v-show="activeTab === 'archive'" class="pl-archive-tab-panel pl-arrange-form-scroll">
@@ -189,7 +188,7 @@
const loading = ref(false)
const submitLoading = ref(false)
const activeTab = ref<'archive' | 'overview' | 'transport' | 'contract'>('archive')
const activeTab = ref<'archive' | 'overview' | 'transport'>('archive')
const tabsRef = ref<InstanceType<typeof PlPlanViewTabs> | null>(null)
const plan = ref<Partial<Plan>>({})
const feedbackMirrorEl = ref<HTMLElement | null>(null)
@@ -0,0 +1,418 @@
<!-- eslint-disable vue/no-v-model-argument -->
<template>
<div class="pl-plan-contract-panel" v-loading="loadingDetails">
<slot
name="toolbar"
:open="openSelector"
:disabled="triggerDisabled"
:hint="hintText"
:hint-warn="hintWarn"
:count="selectedIds.length"
>
<div v-if="!readonly" class="pl-plan-contract-panel__toolbar">
<el-button class="btn-ghost" :disabled="triggerDisabled" @click="openSelector">
<el-icon><Search /></el-icon>选择合同
</el-button>
<span v-if="hintText" class="pl-plan-contract-panel__hint" :class="{ 'is-warn': hintWarn }">
{{ hintText }}
</span>
</div>
</slot>
<div v-if="detailRows.length" class="pl-plan-contract-cards">
<article v-for="row in detailRows" :key="row.id" class="pl-plan-contract-card">
<div class="pl-plan-contract-card__head">
<div class="pl-plan-contract-card__meta">
<span class="pl-plan-contract-card__no">{{ row.contractNo || row.id || '—' }}</span>
<DictTag dict-type="crm_contract_type" :value="row.contractType" />
<span class="pl-plan-contract-card__count">
{{ row.products?.length || 0 }} 个产品
</span>
</div>
<div class="pl-plan-contract-card__actions">
<el-button link type="primary" @click="handleViewContract(String(row.id))">
<el-icon><View /></el-icon>查看
</el-button>
<el-button v-if="!readonly" link type="danger" @click="removeContract(String(row.id))">
<el-icon><Delete /></el-icon>移除
</el-button>
</div>
</div>
<div v-if="row.products?.length" class="pl-plan-contract-card__body">
<div class="pl-plan-contract-card__table-scroll">
<el-table
:data="row.products"
class="list-table pl-plan-contract-card__table"
size="small"
stripe
>
<el-table-column label="产品名称" min-width="110" align="left" show-overflow-tooltip>
<template #default="{ row: product }">
{{ product.standardProductName || product.productName || '—' }}
</template>
</el-table-column>
<el-table-column label="别名" min-width="80" align="center" show-overflow-tooltip>
<template #default="{ row: product }">
{{ product.aliasName || '—' }}
</template>
</el-table-column>
<el-table-column label="品牌" min-width="72" align="center" show-overflow-tooltip>
<template #default="{ row: product }">
{{ formatBrandConstraintLabel(product.brandMode, product.brandName) }}
</template>
</el-table-column>
<el-table-column label="型号/规格" min-width="90" align="center" show-overflow-tooltip>
<template #default="{ row: product }">
{{ product.model || product.productModel || '—' }}
</template>
</el-table-column>
<el-table-column label="数量" min-width="64" align="right" show-overflow-tooltip>
<template #default="{ row: product }">
{{ product.quantity ?? '—' }}
</template>
</el-table-column>
<el-table-column label="单位" min-width="56" align="center">
<template #default="{ row: product }">
<DictTag dict-type="crm_product_unit" :value="product.unit" />
</template>
</el-table-column>
<el-table-column label="包装规格" min-width="90" align="center" show-overflow-tooltip>
<template #default="{ row: product }">
{{ product.packageSpec || '—' }}
</template>
</el-table-column>
<el-table-column label="送货方式" min-width="80" align="center" show-overflow-tooltip>
<template #default="{ row: product }">
{{ product.deliveryMethod || '—' }}
</template>
</el-table-column>
<el-table-column label="备注" min-width="90" align="left" show-overflow-tooltip>
<template #default="{ row: product }">
{{ product.remark || '—' }}
</template>
</el-table-column>
</el-table>
</div>
</div>
<p v-else class="pl-plan-contract-card__empty">暂无产品明细</p>
</article>
</div>
<p v-else-if="readonly || customerId" class="pl-plan-contract-panel__empty-hint">
{{ readonly ? '暂无关联合同' : '暂未选择合同' }}
</p>
<ContractSelector
v-if="!readonly"
v-model:visible="selectorVisible"
:customer-id="customerId"
:selectable-statuses="selectableStatuses"
multiple
:selected-ids="selectedIds"
hide-amount
@confirm-multiple="handleConfirmMultiple"
/>
<ContractDetailDialog
v-if="contractDetailDialogActive"
ref="contractDetailRef"
hide-product-price
/>
</div>
</template>
<script setup lang="ts">
import { Delete, Search, View } from '@element-plus/icons-vue'
import { getContract } from '@/api/crm/contract'
import type { ContractProductForm, ContractVO } from '@/api/crm/contract/types'
import { fetchProductDetail } from '@/api/crm/product'
import ContractSelector from '@/components/business/contract-selector/index.vue'
import DictTag from '@/components/DictTag/index.vue'
import { applyAliasDisplayMeta, formatBrandConstraintLabel } from '@/utils/crm-product-brand'
const ContractDetailDialog = defineAsyncComponent(
() => import('@/views/crm/contract/components/ContractDetailDialog.vue')
)
export interface PlanContractLinkForm {
contractId: string
contractNo?: string
}
const props = withDefaults(
defineProps<{
modelValue: PlanContractLinkForm[]
customerId?: string
disabled?: boolean
required?: boolean
/** 只读:展示合同卡片,标题栏提供「查看」 */
readonly?: boolean
selectableStatuses?: string[]
}>(),
{
disabled: false,
required: false,
readonly: false,
selectableStatuses: () => ['approved', 'executing']
}
)
const emit = defineEmits<{
'update:modelValue': [value: PlanContractLinkForm[]]
view: [contractId: string]
}>()
const selectorVisible = ref(false)
const detailRows = ref<ContractVO[]>([])
const loadingDetails = ref(false)
const contractDetailDialogActive = ref(false)
const contractDetailRef = ref<InstanceType<typeof ContractDetailDialog>>()
const selectedIds = computed(() =>
(props.modelValue || []).map(item => String(item.contractId)).filter(Boolean)
)
const triggerDisabled = computed(() => props.disabled || !props.customerId)
const hintWarn = computed(
() => !!props.customerId && props.required && !selectedIds.value.length
)
const hintText = computed(() => {
if (!props.customerId) return '请先选择客户'
if (hintWarn.value) return '请至少选择一份合同'
if (selectedIds.value.length) return `已选 ${selectedIds.value.length} 份`
return ''
})
function openSelector() {
if (props.readonly || triggerDisabled.value) return
selectorVisible.value = true
}
async function enrichContractProducts(contract: ContractVO): Promise<ContractVO> {
const products = (contract.products || []) as ContractProductForm[]
if (!products.length) return contract
await Promise.all(
products.map(async line => {
if (!line.productId) {
line.standardProductName = line.standardProductName || line.productName
return
}
if (line.standardProductName || line.aliasName) return
try {
const res: any = await fetchProductDetail({ id: String(line.productId) })
const data = res?.data ?? res
if (data) applyAliasDisplayMeta(line, data)
} catch {
line.standardProductName = line.productName
line.aliasName = undefined
}
})
)
return { ...contract, products }
}
function emitLinksFromDetails(rows: ContractVO[]) {
emit(
'update:modelValue',
rows.map(row => ({
contractId: String(row.id),
contractNo: row.contractNo || undefined
}))
)
}
async function loadDetails(ids: string[]) {
if (!ids.length) {
detailRows.value = []
return
}
loadingDetails.value = true
try {
const rows: ContractVO[] = []
for (const id of ids) {
const existing = detailRows.value.find(item => String(item.id) === id)
if (existing?.products?.length) {
rows.push(await enrichContractProducts(existing))
continue
}
try {
const res = await getContract(id)
const detail = (res.data ?? res) as ContractVO
rows.push(await enrichContractProducts(detail))
} catch {
const link = (props.modelValue || []).find(item => String(item.contractId) === id)
rows.push({
id,
contractNo: link?.contractNo || id,
products: []
} as ContractVO)
}
}
detailRows.value = rows
} finally {
loadingDetails.value = false
}
}
async function handleConfirmMultiple(contracts: ContractVO[]) {
const enriched = await Promise.all((contracts || []).map(item => enrichContractProducts(item)))
detailRows.value = enriched
emitLinksFromDetails(detailRows.value)
}
function removeContract(id: string) {
const next = detailRows.value.filter(item => String(item.id) !== id)
detailRows.value = next
emitLinksFromDetails(next)
}
async function handleViewContract(contractId: string) {
const id = String(contractId || '').trim()
if (!id) {
ElMessage.warning('暂无关联合同')
return
}
emit('view', id)
contractDetailDialogActive.value = true
await nextTick()
contractDetailRef.value?.open(id)
}
defineExpose({
openSelector
})
watch(
() => props.customerId,
(id, prev) => {
if (props.readonly) return
if (prev && id !== prev) {
detailRows.value = []
emit('update:modelValue', [])
}
}
)
watch(
selectedIds,
ids => {
const current = detailRows.value.map(item => String(item.id)).join(',')
const next = ids.join(',')
if (current !== next) {
loadDetails(ids)
}
},
{ immediate: true }
)
</script>
<style scoped lang="scss">
.pl-plan-contract-panel {
width: 100%;
min-width: 0;
}
.pl-plan-contract-panel__toolbar {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 8px;
}
.pl-plan-contract-panel__hint {
font-size: 12px;
color: #64748b;
&.is-warn {
color: #d97706;
}
}
.pl-plan-contract-cards {
display: flex;
flex-direction: column;
gap: 10px;
min-width: 0;
}
.pl-plan-contract-card {
min-width: 0;
overflow: hidden;
border: 1px solid var(--mint-border, #d9e8e2);
border-radius: 8px;
background: #fff;
}
.pl-plan-contract-card__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding: 8px 12px;
background: var(--primary-bg, #ecfdf5);
border-bottom: 1px solid #a7f3d0;
}
.pl-plan-contract-card__meta {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 10px;
min-width: 0;
}
.pl-plan-contract-card__actions {
display: inline-flex;
align-items: center;
flex-shrink: 0;
gap: 4px;
}
.pl-plan-contract-card__no {
font-size: 13px;
font-weight: 700;
color: var(--primary-dark, #059669);
word-break: break-all;
}
.pl-plan-contract-card__count {
font-size: 12px;
color: #64748b;
}
.pl-plan-contract-card__body {
min-width: 0;
}
.pl-plan-contract-card__table-scroll {
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.pl-plan-contract-card__table {
width: max-content;
min-width: 100%;
:deep(.el-table__header th) {
padding: 6px 0;
font-size: 12px;
background: #f8fafc;
}
:deep(.el-table__body td) {
padding: 6px 0;
font-size: 12px;
}
}
.pl-plan-contract-card__empty,
.pl-plan-contract-panel__empty-hint {
margin: 0;
padding: 10px 12px;
font-size: 12px;
color: #94a3b8;
}
</style>
@@ -124,10 +124,56 @@
{{ formatBrandQtySummary(row.brandQtyRows) || '—' }}
</template>
</el-table-column>
<el-table-column prop="packageSpec" label="包装规格" min-width="110" show-overflow-tooltip />
<el-table-column label="送货方式" min-width="100" align="center">
<el-table-column prop="packageSpec" label="包装规格" min-width="150" align="center">
<template #default="{ row }">
<el-tag size="small" type="info">{{ getDeliveryMethodLabel(row.deliveryMethod) }}</el-tag>
<el-select
v-if="editablePackageDelivery"
v-model="row.packageSpec"
class="pl-plan-product-cell-control"
placeholder="请选择包装规格"
filterable
allow-create
default-first-option
clearable
style="width: 100%"
@change="val => handlePackageSpecChange(row, val)"
>
<el-option
v-for="dict in dictStore.getOptions('crm_product_gg')"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<template v-else>
<DictTag v-if="row.packageSpec" dict-type="crm_product_gg" :value="row.packageSpec" />
<span v-else>—</span>
</template>
</template>
</el-table-column>
<el-table-column label="送货方式" min-width="150" align="center">
<template #default="{ row }">
<el-select
v-if="editablePackageDelivery"
v-model="row.deliveryMethod"
class="pl-plan-product-cell-control"
placeholder="请选择送货方式"
clearable
style="width: 100%"
>
<el-option
v-for="dict in dictStore.getOptions('crm_shfs')"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<template v-else>
<el-tag v-if="row.deliveryMethod" size="small" type="info">
{{ getDeliveryMethodDisplay(row.deliveryMethod) }}
</el-tag>
<span v-else>—</span>
</template>
</template>
</el-table-column>
<el-table-column v-if="editableRemark" label="备注" min-width="140">
@@ -190,6 +236,7 @@ import { formatBrandQtySummary } from '@/utils/pl-display'
import PlProductNameHazardCell from '@/components/business/pl-product-name-hazard-cell/index.vue'
import ProductAliasBrandDialog from '@/components/business/product-alias-brand-dialog/index.vue'
import DictTag from '@/components/DictTag/index.vue'
import { useDictStore } from '@/store/modules/dict'
const props = defineProps<{
products: PlanFormProductRow[]
@@ -201,6 +248,8 @@ const props = defineProps<{
editableQty?: boolean
/** 产品信息区:别名 / 品牌可改 */
editableAliasBrand?: boolean
/** 包装规格 / 送货方式可下拉编辑(对齐报价单) */
editablePackageDelivery?: boolean
/** 新增/编辑弹窗默认不展示实际数量 */
showActualQty?: boolean
/** 展示归档品牌数量摘要(如:君正 12 / 红四方 13) */
@@ -214,10 +263,22 @@ const emit = defineEmits<{
select: [row: PlanFormProductRow, index: number]
}>()
const dictStore = useDictStore()
const selectedProductIdSet = computed(
() => new Set((props.selectedProductIds || []).map(id => String(id)))
)
function handlePackageSpecChange(row: PlanFormProductRow, value: string | number | boolean | undefined) {
row.packageSpec = value == null || value === '' ? '' : String(value)
}
function getDeliveryMethodDisplay(method?: string) {
const label = dictStore.getLabel('crm_shfs', method || '')
if (label && label !== method) return label
return getDeliveryMethodLabel(method)
}
function isProductSelected(row: PlanFormProductRow) {
return selectedProductIdSet.value.has(String(row.productId))
}
File diff suppressed because it is too large. Load diff
@@ -1,68 +1,15 @@
<!-- eslint-disable vue/no-v-model-argument -->
<template>
<div class="pl-plan-transport-feedback-blocks">
<section class="pl-feedback-shared-products">
<section class="pl-plan-form-section pl-plan-form-section--plain">
<h3 class="pl-plan-form-section-title">产品信息</h3>
<p v-if="!sharedProductTableRows.length && !loading" class="pl-plan-form-empty-hint"
>暂无产品</p
>
<div v-else class="view-subtable-wrap">
<ListTable
table-key="business-pl-plan-transport-feedback-shared-products"
:data="sharedProductTableRows"
class="view-subtable list-table"
stripe
>
<el-table-column type="index" label="序号" min-width="68" align="center" />
<el-table-column
prop="productNo"
label="产品编码"
min-width="110"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.productNo || '—' }}</template>
</el-table-column>
<el-table-column
prop="productName"
label="产品名称"
min-width="120"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.productName || '—' }}</template>
</el-table-column>
<el-table-column prop="aliasName" label="别名" min-width="110" show-overflow-tooltip>
<template #default="{ row }">{{ row.aliasName || '—' }}</template>
</el-table-column>
<el-table-column prop="brandName" label="品牌" min-width="100" show-overflow-tooltip>
<template #default="{ row }">{{ row.brandName || '—' }}</template>
</el-table-column>
<el-table-column
prop="specification"
label="型号/规格"
min-width="100"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.specification || '—' }}</template>
</el-table-column>
<el-table-column prop="unitLabel" label="单位" min-width="72" align="center">
<template #default="{ row }">{{ row.unitLabel || '—' }}</template>
</el-table-column>
<el-table-column prop="planQty" label="计划数量" min-width="100" align="right">
<template #default="{ row }">{{ row.planQty ?? '—' }}</template>
</el-table-column>
<el-table-column
prop="packageSpec"
label="包装规格"
min-width="110"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.packageSpec || '—' }}</template>
</el-table-column>
<el-table-column prop="remark" label="备注" min-width="120" show-overflow-tooltip>
<template #default="{ row }">{{ row.remark || '—' }}</template>
</el-table-column>
</ListTable>
</div>
<p v-if="!planProductRows.length && !loading" class="pl-plan-form-empty-hint">暂无产品明细</p>
<PlPlanFormProductTable
v-else
:products="planProductRows"
show-actual-qty
show-brand-qty
/>
</section>
<div class="pl-feedback-cards-row">
@@ -377,6 +324,7 @@
import { computed } from 'vue'
import { CopyDocument, Edit } from '@element-plus/icons-vue'
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
import PlPlanFormProductTable from '@/components/business/pl-plan-form-dialog/PlPlanFormProductTable.vue'
import {
businessTypeTagType,
formatKgToTon
@@ -422,19 +370,6 @@
siteFeedbackImages: string
}
type SharedProductTableRow = {
key: string
productNo?: string
productName: string
aliasName?: string
brandName?: string
specification?: string
unitLabel?: string
planQty?: number | null
packageSpec?: string
remark?: string
}
type TicketQtyRow = {
key: string
refLabel: string
@@ -599,63 +534,19 @@
return props.ioOrder.kind === 'inbound' ? '入库单回传' : '出库单回传'
})
const sharedProductTableRows = computed<SharedProductTableRow[]>(() => {
if (props.planProductRows?.length) {
return props.planProductRows.map((row, index) => {
const unitLabel =
dictStore.getLabel('crm_product_unit', row.unit) || row.unit || ''
const brandLabel = resolveDisplayBrandLabel({
brandMode: row.brandMode,
brandName: row.brandName
})
return {
key: `plan-${row.id || row.productId || index}`,
productNo: row.productNo,
productName: row.standardProductName || row.productName || '',
aliasName: row.aliasName,
brandName: brandLabel,
specification: row.model,
unitLabel,
planQty: row.quantity,
packageSpec: row.packageSpec,
remark: row.remark
}
})
const feedbackQtyUnit = computed(() => {
const planRow = props.planProductRows?.[0]
if (planRow?.unit) {
return dictStore.getLabel('crm_product_unit', planRow.unit) || planRow.unit || '吨'
}
if (props.driverFeedbackTableRows?.length) {
return props.driverFeedbackTableRows.map((row, index) => ({
key: `driver-${index}-${row.productNo || row.productName}`,
productNo: row.productNo,
productName: row.productName || '',
aliasName: row.aliasName,
brandName: row.brandName,
specification: row.specification || row.model,
unitLabel: row.unitLabel || row.unit,
planQty: row.planQty,
packageSpec: row.packageSpec,
remark: row.remark
}))
const driverRow = props.driverFeedbackTableRows?.[0]
if (driverRow?.unitLabel || driverRow?.unit) {
return driverRow.unitLabel || driverRow.unit || '吨'
}
return resolvedIoOrderItems.value.map((row, index) => ({
key: `io-${index}-${row.productId || row.productName}`,
productNo: row.productNo,
productName: row.productName || '',
aliasName: row.aliasName,
brandName: row.brandName,
specification: row.specification,
unitLabel: row.unitLabel || row.unit,
planQty: row.planQty,
packageSpec: row.packageSpec,
remark: row.remark
}))
const ioRow = resolvedIoOrderItems.value[0]
return ioRow?.unitLabel || ioRow?.unit || '吨'
})
const feedbackQtyUnit = computed(
() => sharedProductTableRows.value[0]?.unitLabel || '吨'
)
function formatTicketQty(value: unknown) {
if (value == null || value === '') return '—'
return String(value)
@@ -780,42 +671,6 @@
flex-shrink: 0;
}
.pl-feedback-shared-products {
padding: 16px;
border: 1px solid #e2e8f0;
border-radius: 10px;
background: #fff;
}
.view-subtable-wrap {
border: 1px solid #e2e8f0;
border-radius: 8px;
overflow: hidden;
background: #fff;
}
.view-subtable-wrap :deep(.el-table.view-subtable) {
--el-table-header-bg-color: #f8fafc;
--el-table-header-text-color: #1e293b;
--el-table-border-color: #e2e8f0;
width: 100%;
.el-table__header th.el-table__cell,
.el-table__body td.el-table__cell {
font-size: 14px;
padding: 8px 0;
}
.el-table__header th.el-table__cell .cell {
font-weight: 500;
color: #1e293b;
}
.el-table__body td.el-table__cell .cell {
color: #1e293b;
}
}
.pl-feedback-cards-row {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
@@ -9,7 +9,7 @@
<el-tab-pane label="计划概况" name="overview">
<section class="pl-plan-form-section pl-plan-form-section--plain">
<h3 class="pl-plan-form-section-title">基础信息</h3>
<ViewKvTable :fields="overviewBasicViewFields" mode="quint" />
<ViewKvTable :fields="overviewBasicViewFields" mode="sept" />
</section>
<section class="pl-plan-form-section pl-plan-form-section--plain">
@@ -18,6 +18,82 @@
<PlPlanFormProductTable v-else :products="productRows" show-actual-qty show-brand-qty />
</section>
<section class="pl-plan-form-section pl-plan-form-section--plain">
<h3 class="pl-plan-form-section-title">供需双方</h3>
<div class="pl-plan-party-row">
<div class="pl-plan-party-block">
<h4 class="pl-plan-subtitle">供方信息</h4>
<PlPlanContractMultiSelect
:model-value="plan?.supplierContracts || []"
:customer-id="plan?.supplierId"
readonly
>
<template #toolbar>
<div class="pl-plan-party-select-row">
<div class="pl-plan-view-party-field pl-plan-party-select-row__customer">
<span class="pl-plan-view-party-field__value">{{
plan?.supplierName || '—'
}}</span>
<span
v-if="supplierContactText"
class="pl-plan-view-party-field__contact"
>
{{ supplierContactText }}
</span>
</div>
</div>
</template>
</PlPlanContractMultiSelect>
</div>
<div class="pl-plan-flow-bridge" aria-hidden="true">
<span class="pl-plan-flow-bridge__label">供货</span>
<span class="pl-plan-flow-bridge__arrow">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path
d="M5 12h11.5"
stroke="currentColor"
stroke-width="2.75"
stroke-linecap="round"
/>
<path
d="M13.5 8.5 18.5 12l-5 3.5"
stroke="currentColor"
stroke-width="2.75"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</span>
</div>
<div class="pl-plan-party-block">
<h4 class="pl-plan-subtitle">需方信息</h4>
<PlPlanContractMultiSelect
:model-value="plan?.demanderContracts || []"
:customer-id="plan?.customerId"
readonly
>
<template #toolbar>
<div class="pl-plan-party-select-row">
<div class="pl-plan-view-party-field pl-plan-party-select-row__customer">
<span class="pl-plan-view-party-field__value">{{
plan?.customerName || '—'
}}</span>
<span
v-if="demanderContactText"
class="pl-plan-view-party-field__contact"
>
{{ demanderContactText }}
</span>
</div>
</div>
</template>
</PlPlanContractMultiSelect>
</div>
</div>
</section>
<section class="pl-plan-form-section pl-plan-form-section--plain">
<h3 class="pl-plan-form-section-title">危化品证书信息</h3>
<PlPlanHazardCertViewTable :products="hazardProducts" />
@@ -127,59 +203,6 @@
/>
</el-tab-pane>
<el-tab-pane label="合同信息" name="contract">
<section class="pl-plan-form-section pl-plan-form-section--plain">
<p v-if="!contractSnapshot" class="pl-plan-form-empty-hint">暂无关联合同信息</p>
<template v-else>
<div class="pl-plan-form-section-head">
<h3 class="pl-plan-form-section-title">基本信息</h3>
<div class="pl-plan-form-section-actions">
<el-button class="btn-ghost" @click="handleViewContract">
<el-icon><View /></el-icon>查看合同
</el-button>
</div>
</div>
<ViewKvTable :fields="contractBasicViewFields" mode="triple" />
<h4 class="pl-plan-subtitle">供需双方</h4>
<div class="parties-row">
<div class="party-panel">
<div class="party-panel__title">供方信息</div>
<ViewKvTable :fields="contractSupplierViewFields" mode="dual" />
</div>
<div class="party-flow-bridge" aria-hidden="true">
<span class="party-flow-bridge__label">供货</span>
<span class="party-flow-bridge__arrow">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path
d="M5 12h11.5"
stroke="currentColor"
stroke-width="2.75"
stroke-linecap="round"
/>
<path
d="M13.5 8.5 18.5 12l-5 3.5"
stroke="currentColor"
stroke-width="2.75"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
</span>
</div>
<div class="party-panel">
<div class="party-panel__title">需方信息</div>
<ViewKvTable :fields="contractBuyerViewFields" mode="dual" />
</div>
</div>
<h4 class="pl-plan-subtitle">合同产品预览</h4>
<PlPlanFormProductTable :products="contractProductRows" />
</template>
</section>
</el-tab-pane>
</el-tabs>
<!-- defer:目标在同次渲染的兄弟节点(归档左侧)时,等 flush 后再解析,避免 emitsOptions 空引用 -->
@@ -187,7 +210,6 @@
<PlPlanTransportFeedbackBlocks v-bind="feedbackBlocksBind" v-on="feedbackBlocksOn" />
</Teleport>
<ContractDetailDialog v-if="contractDetailDialogActive" ref="contractDetailRef" hide-product-price />
<PlPlanDriverFeedbackDialog
v-model:visible="driverFeedbackDialogVisible"
:plan-id="planId"
@@ -335,8 +357,9 @@
</template>
<script setup lang="ts">
import { Check, Close, CopyDocument, View } from '@element-plus/icons-vue'
import { Check, Close, CopyDocument } from '@element-plus/icons-vue'
import AttachmentUploadField from '@/components/business/attachment-upload-field/index.vue'
import PlPlanContractMultiSelect from '@/components/business/pl-plan-contract-multi-select/index.vue'
import BrandQtyChipsField, {
type BrandQtyRow
} from '@/components/business/brand-qty-chips-field/index.vue'
@@ -352,6 +375,8 @@
import ViewKvTable from '@/components/business/system-view-dialog/ViewKvTable.vue'
import type { ViewField } from '@/components/business/system-view-dialog/types'
import type { ContractVO } from '@/api/crm/contract/types'
import { getContactByCustomerId } from '@/api/crm/customer'
import type { ContactVO } from '@/api/crm/customerTypes'
import { inventoryApi } from '@/api/db/inventory'
import {
inboundOrderApi,
@@ -362,7 +387,6 @@
import {
enrichPlanProductLinesAlias,
getDeliveryMethodLabel,
mapContractProducts,
type PlanFormProductRow
} from '@/composables/usePlContractToPlan'
import { mapPlanProductToFormRow, usePlPlanViewDetail, type PlPlanTransportSiteRow } from '@/composables/usePlPlanViewDetail'
@@ -387,10 +411,6 @@
import { formatMoneyDisplay } from '@/utils/money-format'
import type { Transport, TransportDriverProductFeedback } from '@/api/pl'
const ContractDetailDialog = defineAsyncComponent(
() => import('@/views/crm/contract/components/ContractDetailDialog.vue')
)
const dictStore = useDictStore()
const props = withDefaults(
@@ -405,7 +425,7 @@
feedbackMirrorTo?: string | HTMLElement | null
/** 隐藏内部 Tab 导航(由外层统一控制 Tab) */
hideNav?: boolean
/** 受控当前 Tab:overview / transport / contract */
/** 受控当前 Tab:overview / transport */
tab?: string
}>(),
{
@@ -441,8 +461,6 @@
}
}
)
const contractDetailDialogActive = ref(false)
const contractDetailRef = ref<InstanceType<typeof ContractDetailDialog>>()
const vehicleViewVisible = ref(false)
const driverFeedbackDialogVisible = ref(false)
const siteFeedbackDialogVisible = ref(false)
@@ -469,6 +487,80 @@
resetDetail
} = usePlPlanViewDetail()
type PartyContactDisplay = { contactName?: string; phone?: string }
const supplierContact = ref<PartyContactDisplay>({})
const demanderContact = ref<PartyContactDisplay>({})
let partyContactLoadSeq = 0
function pickPrimaryContact(list: ContactVO[]): PartyContactDisplay {
if (!list.length) return {}
const primary =
list.find(item => Number(item.isPrimary) === 1) ||
list.find(item => Number(item.isKey) === 1) ||
list[0]
const contactName = String(primary?.contactName || '').trim()
const phone = String(primary?.mobile || primary?.telephone || '').trim()
return {
contactName: contactName || undefined,
phone: phone || undefined
}
}
function formatPartyContactText(contact: PartyContactDisplay): string {
const parts: string[] = []
if (contact.contactName) parts.push(contact.contactName)
if (contact.phone) parts.push(contact.phone)
return parts.join(' ')
}
const supplierContactText = computed(() => formatPartyContactText(supplierContact.value))
const demanderContactText = computed(() => formatPartyContactText(demanderContact.value))
async function loadPartyContact(customerId?: string | null): Promise<PartyContactDisplay> {
const id = String(customerId || '').trim()
if (!id) return {}
try {
const res = await getContactByCustomerId(id)
const list = (res?.data || []) as ContactVO[]
return pickPrimaryContact(Array.isArray(list) ? list : [])
} catch {
return {}
}
}
async function refreshPartyContacts() {
const seq = ++partyContactLoadSeq
const supplierId = plan.value?.supplierId
const customerId = plan.value?.customerId
const [supplier, demanderFromCrm] = await Promise.all([
loadPartyContact(supplierId),
loadPartyContact(customerId)
])
if (seq !== partyContactLoadSeq) return
supplierContact.value = supplier
const planContactName = String(plan.value?.contactName || '').trim()
const planContactPhone = String(plan.value?.contactPhone || '').trim()
demanderContact.value = {
contactName: demanderFromCrm.contactName || planContactName || undefined,
phone: demanderFromCrm.phone || planContactPhone || undefined
}
}
watch(
() => [plan.value?.id, plan.value?.supplierId, plan.value?.customerId] as const,
() => {
if (!plan.value?.id) {
supplierContact.value = {}
demanderContact.value = {}
return
}
void refreshPartyContacts()
},
{ immediate: true }
)
const ioOrderEditVisible = ref(false)
const ioOrderSaving = ref(false)
const ioOrderEditForm = ref<PlIoOrder | null>(null)
@@ -1123,7 +1215,9 @@
{ label: '计划日期', value: plan.value?.planDate },
{ label: '归属公司', value: getPlPlanCompanyLabel(plan.value?.belongsCompany) },
{ label: '单据类型', value: getPlPlanTypeLabel(plan.value?.planType || '') },
{ label: '跟进人', value: plan.value?.followUserName }
{ label: '跟进人', value: plan.value?.followUserName },
{ label: '供方', value: plan.value?.supplierName },
{ label: '需方', value: plan.value?.customerName }
])
const summaryCarrierName = computed(() => displayCarrierName.value)
@@ -1181,57 +1275,6 @@
]
})
const contractBasicViewFields = computed<ViewField[]>(() => {
const c = contractSnapshot.value
if (!c) return []
const settlementLabel = c.settlementMethod
? dictStore.getLabel('crm_settlement_method', c.settlementMethod)
: '—'
return [
{ label: '合同编号', value: c.contractNo, long: false },
{ label: '合同名称', value: c.contractName, long: false },
{ label: '签订日期', value: c.signDate },
{
label: '合同有效期',
value: c.startDate && c.endDate ? `${c.startDate} ~ ${c.endDate}` : '—',
long: false
},
{ label: '结算方式', value: settlementLabel }
]
})
const contractSupplierViewFields = computed<ViewField[]>(() => {
const c = contractSnapshot.value
if (!c) return []
return [
{ label: '单位名称(章)', value: c.partyA },
{ label: '单位地址', value: c.partyAAddress },
{ label: '法定代表人', value: c.partyALegalPerson },
{ label: '代理人', value: c.partyAAgent },
{ label: '电话/传真', value: c.partyAPhoneFax },
{ label: '开户银行', value: c.partyABank },
{ label: '账号', value: c.partyAAccount }
]
})
const contractBuyerViewFields = computed<ViewField[]>(() => {
const c = contractSnapshot.value
if (!c) return []
return [
{ label: '单位名称(章)', value: c.partyB },
{ label: '单位地址', value: c.partyBAddress },
{ label: '法定代表人', value: c.partyBLegalPerson },
{ label: '代理人', value: c.partyBAgent },
{ label: '电话/传真', value: c.partyBPhoneFax },
{ label: '开户银行', value: c.partyBBank },
{ label: '账号', value: c.partyBAccount }
]
})
const contractProductRows = computed<PlanFormProductRow[]>(() =>
mapContractProducts(contractSnapshot.value?.products)
)
/** 危化证区域展示 CRM 标准名(productRows 已回填 standardProductName;库内 productName 可能是别名) */
const hazardProducts = computed(() =>
products.value
@@ -1244,18 +1287,6 @@
})
)
async function handleViewContract() {
const contractId = contractSnapshot.value?.id || plan.value?.contractId
if (!contractId) {
ElMessage.warning('暂无关联合同')
return
}
contractDetailDialogActive.value = true
await nextTick()
contractDetailRef.value?.open(contractId)
}
watch(
() => props.planId,
async (planId) => {
@@ -1443,7 +1474,8 @@
grid-column: 1 / -1;
}
.parties-row {
.parties-row,
.pl-plan-party-row {
display: flex;
align-items: stretch;
gap: 0;
@@ -1451,6 +1483,100 @@
min-height: 0;
}
.pl-plan-party-block {
flex: 1 1 0;
min-width: 0;
padding: 12px;
border: 1px solid #e2e8f0;
border-radius: 8px;
background: #f8fafc;
overflow: hidden;
}
.pl-plan-subtitle {
margin: 0 0 10px;
font-size: 13px;
font-weight: 600;
color: #1e293b;
}
.pl-plan-party-select-row {
display: flex;
align-items: flex-start;
gap: 12px;
margin-bottom: 8px;
}
.pl-plan-party-select-row__customer {
flex: 1.4 1 0;
min-width: 0;
}
.pl-plan-view-party-field {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 0 12px;
min-width: 0;
}
.pl-plan-view-party-field__value {
font-size: 14px;
font-weight: 600;
color: #1e293b;
word-break: break-word;
line-height: 1.5;
}
.pl-plan-view-party-field__contact {
font-size: 14px;
font-weight: 400;
color: var(--mint-text-muted, #64748b);
white-space: nowrap;
line-height: 1.5;
}
.pl-plan-flow-bridge {
flex: 0 0 88px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
padding: 0 8px;
}
.pl-plan-flow-bridge__label {
font-size: 12px;
font-weight: 600;
color: var(--primary-dark, #168f45);
letter-spacing: 0.06em;
padding: 4px 10px;
border-radius: 999px;
background: #e6f8ed;
border: 1px solid #a8e0b8;
line-height: 1.2;
}
.pl-plan-flow-bridge__arrow {
display: flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
border-radius: 50%;
color: var(--primary-dark, #168f45);
background: linear-gradient(145deg, #e6f8ed 0%, #d4f0de 100%);
border: 1px solid #a8e0b8;
box-shadow: 0 2px 8px rgba(28, 168, 81, 0.14);
svg {
width: 22px;
height: 22px;
display: block;
}
}
.party-panel {
flex: 1 1 0;
min-width: 0;
@@ -1536,19 +1662,22 @@
}
@media (max-width: 1100px) {
.parties-row {
.parties-row,
.pl-plan-party-row {
flex-direction: column;
min-height: 0;
}
.party-flow-bridge {
.party-flow-bridge,
.pl-plan-flow-bridge {
flex: 0 0 auto;
flex-direction: row;
gap: 12px;
padding: 12px 0;
}
.party-flow-bridge__arrow {
.party-flow-bridge__arrow,
.pl-plan-flow-bridge__arrow {
transform: rotate(90deg);
}
}
@@ -0,0 +1,10 @@
/** 运输计划:内置山峡/云栋客户(该侧合同可免) */
export const PL_INTERNAL_CUSTOMER_NAMES = [
'安庆市山峡化工有限公司',
'安徽云栋化工有限公司'
] as const
export function isPlInternalCustomerName(name?: string | null): boolean {
const n = (name || '').trim()
return (PL_INTERNAL_CUSTOMER_NAMES as readonly string[]).includes(n)
}
@@ -1,12 +1,7 @@
import { pinyin } from 'pinyin-pro'
import type { AppRouteRecord } from '@/types/router'
import {
filterPortalTopModules,
resolveMegaPanelL3Links
} from '@/utils/router/portal-menu'
import {
filterSidebarRoutes,
isSidebarNavigableRoute
} from '@/utils/router/sidebar-menu-filter'
import { filterPortalTopModules, resolveMegaPanelL3Links } from '@/utils/router/portal-menu'
import { filterSidebarRoutes, isSidebarNavigableRoute } from '@/utils/router/sidebar-menu-filter'
export interface PortalHomeCardItem {
path: string
@@ -21,10 +16,51 @@ export interface PortalHomeSection {
cards: PortalHomeCardItem[]
}
/** 首页菜单目录条目(含拼音检索元数据) */
export interface PortalHomeMenuItem extends PortalHomeCardItem {
modulePath: string
moduleTitle: string
/** 菜单全拼(小写、去空格与符号) */
py: string
/** 菜单首字母缩写(小写) */
abbr: string
/** 拼音首字母 A–Z,其它为 # */
letter: string
/** 模块名全拼 */
modulePy: string
/** 模块名首字母缩写 */
moduleAbbr: string
}
function routeTitle(item: AppRouteRecord): string {
return String(item.meta?.title ?? item.name ?? item.path ?? '')
}
function normalizeSearchKey(s: string): string {
return String(s || '')
.toLowerCase()
.replace(/[\s'·・\-_/]/g, '')
}
function buildPinyinMeta(title: string): { py: string; abbr: string; letter: string } {
const text = String(title || '').trim()
if (!text) {
return { py: '', abbr: '', letter: '#' }
}
const py = normalizeSearchKey(pinyin(text, { toneType: 'none', type: 'string', separator: '' }))
const abbr = normalizeSearchKey(
pinyin(text, {
pattern: 'first',
toneType: 'none',
type: 'string',
separator: ''
})
)
const first = (abbr[0] || py[0] || '#').toUpperCase()
const letter = /[A-Z]/.test(first) ? first : '#'
return { py, abbr, letter }
}
function toCard(item: AppRouteRecord): PortalHomeCardItem | null {
const path = String(item.meta?.activePath || item.path || '')
if (!path) return null
@@ -72,6 +108,55 @@ export function collectPortalHomeSections(menuList: AppRouteRecord[]): PortalHom
.filter((s) => s.cards.length > 0)
}
/** 扁平化首页菜单并附带拼音检索字段 */
export function flattenPortalHomeMenus(menuList: AppRouteRecord[]): PortalHomeMenuItem[] {
const sections = collectPortalHomeSections(menuList)
const out: PortalHomeMenuItem[] = []
const seen = new Set<string>()
for (const sec of sections) {
const moduleMeta = buildPinyinMeta(sec.moduleTitle)
for (const card of sec.cards) {
if (seen.has(card.path)) continue
seen.add(card.path)
const meta = buildPinyinMeta(card.title)
out.push({
...card,
modulePath: sec.modulePath,
moduleTitle: sec.moduleTitle,
py: meta.py,
abbr: meta.abbr,
letter: meta.letter,
modulePy: moduleMeta.py,
moduleAbbr: moduleMeta.abbr
})
}
}
return out
}
/** 中文名 / 模块名 / 全拼 / 首字母 匹配 */
export function matchPortalHomeMenuItem(item: PortalHomeMenuItem, query: string): boolean {
const q = String(query || '').trim()
if (!q) return true
if (item.title.includes(q) || item.moduleTitle.includes(q)) return true
const nq = normalizeSearchKey(q)
if (!nq) return true
return (
item.py.includes(nq) ||
item.abbr.includes(nq) ||
item.modulePy.includes(nq) ||
item.moduleAbbr.includes(nq)
)
}
/** 标题内高亮查询子串(仅字面匹配) */
export function highlightPortalHomeTitle(title: string, query: string): string {
const q = String(query || '').trim()
if (!q || !title.includes(q)) return title
return title.split(q).join(`<mark>${q}</mark>`)
}
/** 在全部分区中按 path 查找卡片元数据 */
export function findHomeCardByPath(
sections: PortalHomeSection[],
+42 -17
View File
@@ -179,14 +179,26 @@
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('customerName')"
prop="customerName"
label="客户名称"
min-width="240"
v-if="isColumnVisible('supplierName')"
prop="supplierName"
label="供方"
min-width="200"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
show-overflow-tooltip
/>
<el-table-column
v-if="isColumnVisible('customerName')"
prop="customerName"
label="需方"
min-width="200"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
show-overflow-tooltip
/>
<el-table-column
v-if="isColumnVisible('productName')"
@@ -213,17 +225,6 @@
<PlPlanListProductCell :products="row.products" field="spec" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productQty')"
label="数量"
min-width="90"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="qty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productUnit')"
label="单位"
@@ -235,6 +236,28 @@
<PlPlanListProductCell :products="row.products" field="unit" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productPlanQty')"
label="计划数量"
min-width="100"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="planQty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productActualQty')"
label="实际数量"
min-width="100"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="actualQty" />
</template>
</el-table-column>
<el-table-column v-if="isColumnVisible('planAttachments')" label="计划附件" min-width="200">
<template #default="{ row }">
<PlPlanListCertCell :products="row.products" compact hide-product />
@@ -368,11 +391,13 @@ const listColumnDefs = [
{ prop: 'archiveStatus', label: '归档状态' },
{ prop: 'followStatus', label: '跟进状态' },
{ prop: 'planType', label: '单据类型' },
{ prop: 'customerName', label: '客户名称' },
{ prop: 'supplierName', label: '供方' },
{ prop: 'customerName', label: '需方' },
{ prop: 'productName', label: '产品名称' },
{ prop: 'productSpec', label: '型号/规格' },
{ prop: 'productQty', label: '数量' },
{ prop: 'productUnit', label: '单位' },
{ prop: 'productPlanQty', label: '计划数量' },
{ prop: 'productActualQty', label: '实际数量' },
{ prop: 'planAttachments', label: '计划附件' },
{ prop: 'licensePlate', label: '车牌号' },
{ prop: 'personnelSummary', label: '人员' },
+60 -35
View File
@@ -167,7 +167,7 @@
header-align="center"
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
/>
<el-table-column prop="planNo" label="计划编号" min-width="180" show-overflow-tooltip>
<el-table-column prop="planNo" label="计划编号" min-width="150" show-overflow-tooltip>
<template #default="{ row }">
<el-link type="primary" @click="handleView(row)">{{ row.planNo }}</el-link>
</template>
@@ -180,14 +180,26 @@
align="center"
/>
<el-table-column
v-if="isColumnVisible('customerName')"
prop="customerName"
label="客户名称"
min-width="240"
v-if="isColumnVisible('supplierName')"
prop="supplierName"
label="供方"
min-width="200"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
show-overflow-tooltip
/>
<el-table-column
v-if="isColumnVisible('customerName')"
prop="customerName"
label="需方"
min-width="200"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
show-overflow-tooltip
/>
<el-table-column
v-if="isColumnVisible('planType')"
@@ -202,6 +214,19 @@
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('followStatus')"
prop="followStatus"
label="跟进状态"
min-width="100"
align="center"
>
<template #default="{ row }">
<el-tag :type="getPlPlanFollowStatusTagType(row.followStatus)" size="small">
{{ getPlPlanFollowStatusLabel(row.followStatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('hazardCertReady')"
label="证书齐备"
@@ -217,7 +242,7 @@
<el-table-column
v-if="isColumnVisible('productName')"
label="产品名称"
min-width="240"
min-width="160"
align="left"
header-align="left"
class-name="col-name-wrap"
@@ -230,7 +255,7 @@
<el-table-column
v-if="isColumnVisible('productSpec')"
label="型号/规格"
min-width="120"
min-width="96"
align="center"
header-align="center"
show-overflow-tooltip
@@ -239,21 +264,10 @@
<PlPlanListProductCell :products="row.products" field="spec" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productQty')"
label="数量"
min-width="90"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="qty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productUnit')"
label="单位"
min-width="80"
min-width="64"
align="center"
header-align="center"
>
@@ -261,6 +275,28 @@
<PlPlanListProductCell :products="row.products" field="unit" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productPlanQty')"
label="计划数量"
min-width="88"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="planQty" />
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productActualQty')"
label="实际数量"
min-width="88"
align="right"
header-align="right"
>
<template #default="{ row }">
<PlPlanListProductCell :products="row.products" field="actualQty" />
</template>
</el-table-column>
<el-table-column v-if="isColumnVisible('planAttachments')" label="计划附件" min-width="280">
<template #default="{ row }">
<PlPlanListCertCell
@@ -273,19 +309,6 @@
/>
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('followStatus')"
prop="followStatus"
label="跟进状态"
min-width="100"
align="center"
>
<template #default="{ row }">
<el-tag :type="getPlPlanFollowStatusTagType(row.followStatus)" size="small">
{{ getPlPlanFollowStatusLabel(row.followStatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('licensePlate')"
prop="licensePlate"
@@ -431,15 +454,17 @@ const planList = ref<Plan[]>([])
const listColumnDefs = [
{ prop: 'planDate', label: '计划日期' },
{ prop: 'customerName', label: '客户名称' },
{ prop: 'supplierName', label: '供方' },
{ prop: 'customerName', label: '需方' },
{ prop: 'planType', label: '单据类型' },
{ prop: 'followStatus', label: '跟进状态' },
{ prop: 'hazardCertReady', label: '证书齐备' },
{ prop: 'productName', label: '产品名称' },
{ prop: 'productSpec', label: '型号/规格' },
{ prop: 'productQty', label: '数量' },
{ prop: 'productUnit', label: '单位' },
{ prop: 'productPlanQty', label: '计划数量' },
{ prop: 'productActualQty', label: '实际数量' },
{ prop: 'planAttachments', label: '计划附件' },
{ prop: 'followStatus', label: '跟进状态' },
{ prop: 'licensePlate', label: '车牌号' },
{ prop: 'personnelSummary', label: '人员' },
{ prop: 'followUserName', label: '跟进人', defaultVisible: false }
+105 -68
View File
@@ -26,10 +26,10 @@
/>
</el-select>
</el-form-item>
<el-form-item label="客户名称">
<el-form-item label="需方">
<el-input
v-model="searchForm.customerName"
placeholder="搜索客户名称"
placeholder="搜索需方客户名称"
clearable
@keyup.enter="handleSearch"
/>
@@ -230,15 +230,53 @@
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('customerName')"
prop="customerName"
label="客户名称"
min-width="240"
v-if="isColumnVisible('supplierName')"
prop="supplierName"
label="供方"
min-width="200"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
show-overflow-tooltip
/>
<el-table-column
v-if="isColumnVisible('customerName')"
prop="customerName"
label="需方"
min-width="200"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
show-overflow-tooltip
/>
<el-table-column
v-if="isColumnVisible('contractSummary')"
label="合同"
min-width="220"
align="left"
header-align="left"
class-name="col-name-wrap"
label-class-name="col-name-wrap"
>
<template #default="{ row }">
<div
v-if="planContractLines(row).length"
class="pl-plan-contract-cell"
>
<div
v-for="(line, index) in planContractLines(row)"
:key="`${line.side}-${line.no}-${index}`"
class="pl-plan-contract-cell__row"
>
<span class="pl-plan-contract-cell__side">{{ line.side }}</span>
<span class="pl-plan-contract-cell__no">{{ line.no }}</span>
</div>
</div>
<span v-else class="pl-plan-contract-cell__empty">—</span>
</template>
</el-table-column>
<el-table-column
v-if="isColumnVisible('productName')"
label="产品名称"
@@ -454,17 +492,6 @@
>
<el-icon><CircleClose /></el-icon>作废
</el-button>
<el-button
v-if="canDeletePlan(viewingPlan)"
class="btn-ghost"
type="danger"
:disabled="!canDeleteByCreator(viewingPlan)"
:title="getDeletePlanDisabledTitle(viewingPlan)"
:loading="deleteLoading"
@click="handleDelete(viewingPlan)"
>
<el-icon><Delete /></el-icon>删除
</el-button>
</template>
</PlPlanViewDialog>
@@ -486,7 +513,6 @@ import {
Bell,
CircleClose,
CopyDocument,
Delete,
Edit,
Plus,
Printer,
@@ -510,7 +536,6 @@ import PlPlanTypeTabs from '@/components/business/pl-plan-type-tabs/index.vue'
import ListToolbarDateShortcuts from '@/components/core/list-toolbar-date-shortcuts/index.vue'
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
import { useListDateShortcut } from '@/composables/useListDateShortcut'
import { canDeleteByCreator, CREATOR_DELETE_TIP } from '@/utils/creator-delete'
import { canBatchPrintSlip } from '@/utils/pl-batch-print'
import {
canPrintSlipCommand,
@@ -529,7 +554,6 @@ const router = useRouter()
const loading = ref(false)
const voidLoading = ref(false)
const deleteLoading = ref(false)
const waitNoticeLoading = ref(false)
const formDialogVisible = ref(false)
const editingPlanId = ref('')
@@ -548,7 +572,9 @@ const listColumnDefs = [
{ prop: 'followStatus', label: '跟进状态' },
{ prop: 'planDate', label: '计划日期' },
{ prop: 'planType', label: '单据类型' },
{ prop: 'customerName', label: '客户名称' },
{ prop: 'supplierName', label: '供方' },
{ prop: 'customerName', label: '需方' },
{ prop: 'contractSummary', label: '合同' },
{ prop: 'productName', label: '产品名称' },
{ prop: 'productSpec', label: '型号/规格' },
{ prop: 'productPackageSpec', label: '包装规格' },
@@ -582,10 +608,7 @@ async function refreshViewIfOpen() {
await viewDialogRef.value?.reload()
}
function getPlanArrangePrerequisiteGaps(plan: Pick<
Plan,
'createDate' | 'planDate' | 'belongsCompany' | 'planType' | 'followUserId' | 'followUserName'
>): string[] {
function getPlanArrangePrerequisiteGaps(plan: Plan): string[] {
const missing: string[] = []
if (!String(plan.createDate || '').trim()) missing.push('创建日期')
if (!String(plan.planDate || '').trim()) missing.push('计划日期')
@@ -594,6 +617,12 @@ function getPlanArrangePrerequisiteGaps(plan: Pick<
if (!String(plan.followUserId || '').trim() && !String(plan.followUserName || '').trim()) {
missing.push('跟进人')
}
if (!String(plan.supplierId || '').trim() || !String(plan.supplierName || '').trim()) {
missing.push('供方客户')
}
if (!String(plan.customerId || '').trim() || !String(plan.customerName || '').trim()) {
missing.push('需方客户')
}
return missing
}
@@ -670,6 +699,20 @@ function getPlanTypeLabel(type?: string | null) {
return map[type] || type
}
/** 合同列:供/需合同各占一行展示 */
function planContractLines(plan: Plan): Array<{ side: string; no: string }> {
const lines: Array<{ side: string; no: string }> = []
for (const item of plan.supplierContracts || []) {
const no = item.contractNo || item.contractId
if (no) lines.push({ side: '供', no: String(no) })
}
for (const item of plan.demanderContracts || []) {
const no = item.contractNo || item.contractId
if (no) lines.push({ side: '需', no: String(no) })
}
return lines
}
async function fetchData() {
loading.value = true
try {
@@ -801,14 +844,6 @@ function canVoidPlan(row: Plan) {
return row.archiveStatus !== 'archived' && row.followStatus !== 'cancelled'
}
function canDeletePlan(row: Plan) {
return (
(row.followStatus === 'pending_arrange' || row.followStatus === 'wait_notice') &&
row.transportStatus === 'pending' &&
row.archiveStatus !== 'archived'
)
}
function canWaitNotice(row: Plan) {
return (
row.followStatus === 'pending_arrange' &&
@@ -820,12 +855,6 @@ function canCancelWaitNotice(row: Plan) {
return row.followStatus === 'wait_notice' && row.archiveStatus !== 'archived'
}
function getDeletePlanDisabledTitle(row: Plan) {
if (!canDeletePlan(row)) return '只能删除待安排或等通知且未安排运输的计划'
if (!canDeleteByCreator(row)) return CREATOR_DELETE_TIP
return ''
}
function syncViewingPlan(updated: Plan) {
if (viewingPlan.value?.id === updated.id) {
viewingPlan.value = { ...viewingPlan.value, ...updated }
@@ -869,35 +898,6 @@ function handleToolbarWaitNotice() {
handleWaitNotice(selectedPlan.value)
}
async function handleDelete(row: Plan) {
if (!canDeletePlan(row)) {
ElMessage.warning('只能删除待安排或等通知且未安排运输的计划')
return
}
if (!canDeleteByCreator(row)) {
ElMessage.warning(CREATOR_DELETE_TIP)
return
}
await ElMessageBox.confirm('确定删除该运输计划吗?删除后不可恢复。', '删除运输计划', {
type: 'warning'
})
deleteLoading.value = true
try {
await planApi.delete(row.id)
ElMessage.success('删除成功')
if (viewingPlan.value?.id === row.id) {
viewVisible.value = false
viewingPlan.value = null
}
fetchData()
} catch (e) {
const message = e instanceof Error ? e.message : '删除失败'
ElMessage.error(message)
} finally {
deleteLoading.value = false
}
}
async function handleVoid(row: Plan) {
const hint =
row.transportStatus === 'arranged'
@@ -1044,4 +1044,41 @@ async function openArrangeFromQuery() {
font-weight: 700;
}
}
.pl-plan-contract-cell {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
width: 100%;
text-align: left;
}
.pl-plan-contract-cell__row {
display: flex;
align-items: baseline;
gap: 6px;
width: 100%;
min-width: 0;
font-size: 13px;
line-height: 1.5;
color: var(--text, #1e293b);
}
.pl-plan-contract-cell__side {
flex-shrink: 0;
font-weight: 600;
color: var(--mint-text-muted, #64748b);
}
.pl-plan-contract-cell__no {
min-width: 0;
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
}
.pl-plan-contract-cell__empty {
color: var(--mint-text-muted, #64748b);
}
</style>
+418 -155
View File
@@ -1,76 +1,116 @@
<template>
<div class="portal-home">
<div class="portal-home-hero">
<div>
<h3>{{ greetText }},{{ displayName }}</h3>
<p>{{ dateText }} · 点击卡片进入业务,星标加入收藏</p>
<div v-if="modules.length" class="portal-home-shell">
<aside class="portal-home-aside" aria-label="一级菜单">
<button
type="button"
class="portal-home-aside__item"
:class="{ 'is-on': isFavView }"
@click="activeModule = FAV_KEY"
>
<span>收藏</span>
<span class="n">{{ favoriteList.length }}</span>
</button>
<button
v-for="mod in modules"
:key="mod.modulePath"
type="button"
class="portal-home-aside__item"
:class="{ 'is-on': activeModule === mod.modulePath }"
@click="activeModule = mod.modulePath"
>
<span>{{ mod.moduleTitle }}</span>
<span class="n">{{ mod.cards.length }}</span>
</button>
</aside>
<div class="portal-home-panel">
<header class="portal-home-panel__head">
<div>
<h2 class="portal-home-panel__title">{{ panelTitle }}</h2>
<p class="portal-home-panel__desc">{{ panelDesc }}</p>
</div>
<span class="portal-home-panel__count">{{ panelCount }} 项</span>
</header>
<section v-if="isFavView" class="portal-home-block portal-home-block--fav">
<VueDraggable
v-if="favoriteList.length"
v-model="favoriteList"
class="portal-home-grid"
ghost-class="portal-home-card--ghost"
chosen-class="portal-home-card--chosen"
:animation="180"
@start="onFavDragStart"
@end="onFavDragEnd"
>
<button
v-for="card in favoriteList"
:key="'fav-' + card.path"
type="button"
class="portal-home-card portal-home-card--fav"
@click="onFavCardClick(card.path)"
>
<span class="portal-home-card__badge portal-home-card__badge--fav" aria-hidden="true">
{{ titleAbbr(card.title) }}
</span>
<span class="portal-home-card__body">
<span class="portal-home-card__title">{{ card.title }}</span>
<span class="portal-home-card__sub">{{ favSubTitle(card.path) }}</span>
</span>
<button
type="button"
class="portal-home-card__star is-on"
aria-label="取消收藏"
@click.stop="onToggleStar(card.path)"
>
<ElIcon><StarFilled /></ElIcon>
</button>
</button>
</VueDraggable>
<p v-else class="portal-home-empty">暂无收藏,可在各模块菜单卡片上点星标添加</p>
</section>
<section v-else class="portal-home-block">
<div class="portal-home-grid">
<button
v-for="card in activeCards"
:key="card.path"
type="button"
class="portal-home-card"
@click="openCard(card.path)"
>
<span
class="portal-home-card__badge"
:data-tone="toneIndex(activeModule)"
aria-hidden="true"
>
{{ titleAbbr(card.title) }}
</span>
<span class="portal-home-card__body">
<span class="portal-home-card__title">{{ card.title }}</span>
<span class="portal-home-card__sub">{{ panelTitle }}</span>
</span>
<button
type="button"
class="portal-home-card__star"
:class="{ 'is-on': favoritePathSet.has(card.path) }"
:aria-label="favoritePathSet.has(card.path) ? '取消收藏' : '加入收藏'"
@click.stop="onToggleStar(card.path)"
>
<ElIcon>
<StarFilled v-if="favoritePathSet.has(card.path)" />
<Star v-else />
</ElIcon>
</button>
</button>
</div>
<p v-if="!activeCards.length" class="portal-home-empty">该模块暂无可用菜单</p>
</section>
</div>
</div>
<div class="portal-home-cards-area">
<section v-if="favoriteList.length" class="portal-home-section">
<div class="portal-home-section__head">
<h2 class="title-bar-heading">收藏</h2>
<span class="portal-home-section__tip">可拖拽调整顺序</span>
</div>
<VueDraggable
v-model="favoriteList"
class="portal-home-grid"
ghost-class="portal-home-card--ghost"
chosen-class="portal-home-card--chosen"
:animation="180"
@start="onFavDragStart"
@end="onFavDragEnd"
>
<button
v-for="card in favoriteList"
:key="'fav-' + card.path"
type="button"
class="portal-home-card portal-home-card--fav"
@click="onFavCardClick(card.path)"
>
<span class="portal-home-card__title">{{ card.title }}</span>
<button
type="button"
class="portal-home-card__star is-on"
aria-label="取消收藏"
@click.stop="onToggleStar(card.path)"
>
<ElIcon><StarFilled /></ElIcon>
</button>
</button>
</VueDraggable>
</section>
<section
v-for="sec in visibleSections"
:key="sec.modulePath"
class="portal-home-section"
>
<h2 class="title-bar-heading">{{ sec.moduleTitle }}</h2>
<div class="portal-home-grid">
<button
v-for="card in sec.cards"
:key="card.path"
type="button"
class="portal-home-card"
@click="openCard(card.path)"
>
<span class="portal-home-card__title">{{ card.title }}</span>
<button
type="button"
class="portal-home-card__star"
aria-label="收藏"
@click.stop="onToggleStar(card.path)"
>
<ElIcon><Star /></ElIcon>
</button>
</button>
</div>
</section>
<p v-if="!sections.length" class="portal-home-empty">暂无可用菜单</p>
</div>
<p v-else class="portal-home-empty portal-home-empty--page">暂无可用菜单</p>
</div>
</template>
@@ -82,7 +122,6 @@
import { VueDraggable } from 'vue-draggable-plus'
import { useMenuStore } from '@/store/modules/menu'
import { useMenuFavoriteStore } from '@/store/modules/menuFavorite'
import { useUserStore } from '@/store/modules/user'
import {
collectPortalHomeSections,
findHomeCardByPath,
@@ -91,58 +130,85 @@
defineOptions({ name: 'PortalHome' })
const FAV_KEY = '__favorites__'
const router = useRouter()
const menuStore = useMenuStore()
const favStore = useMenuFavoriteStore()
const userStore = useUserStore()
const { menuList } = storeToRefs(menuStore)
const { items: favItems } = storeToRefs(favStore)
const sections = computed(() => collectPortalHomeSections(menuList.value || []))
const favoritePathSet = computed(() => new Set(favItems.value.map((i) => i.path)))
/** 模块区隐藏已在收藏中展示的菜单,避免重复 */
const visibleSections = computed(() =>
sections.value
.map((sec) => ({
...sec,
cards: sec.cards.filter((c) => !favoritePathSet.value.has(c.path))
}))
.filter((sec) => sec.cards.length > 0)
)
const activeModule = ref(FAV_KEY)
const favoriteList = ref<PortalHomeCardItem[]>([])
const favDragging = ref(false)
const suppressFavClick = ref(false)
const modules = computed(() => collectPortalHomeSections(menuList.value || []))
const favoritePathSet = computed(() => new Set(favItems.value.map((i) => i.path)))
const isFavView = computed(() => activeModule.value === FAV_KEY)
const activeCards = computed(() => {
if (isFavView.value) return []
const sec = modules.value.find((m) => m.modulePath === activeModule.value)
return sec?.cards || []
})
const panelTitle = computed(() => {
if (isFavView.value) return '收藏'
return modules.value.find((m) => m.modulePath === activeModule.value)?.moduleTitle || ''
})
const panelDesc = computed(() =>
isFavView.value ? '可拖拽调整顺序,星标取消收藏' : '点击卡片进入功能,星标加入收藏'
)
const panelCount = computed(() =>
isFavView.value ? favoriteList.value.length : activeCards.value.length
)
const titleAbbr = (title: string) => {
const t = String(title || '').trim()
if (!t) return '?'
return t.slice(0, 1)
}
const favSubTitle = (path: string) => {
for (const sec of modules.value) {
if (sec.cards.some((c) => c.path === path)) return sec.moduleTitle
}
return '收藏入口'
}
/** 同模块稳定色相,便于扫读区分(低饱和薄荷绿系) */
const toneIndex = (modulePath: string) => {
const s = String(modulePath || '')
let h = 0
for (let i = 0; i < s.length; i++) h = (h * 31 + s.charCodeAt(i)) >>> 0
return String(h % 5)
}
const ensureActiveModule = () => {
if (activeModule.value === FAV_KEY) return
const list = modules.value
if (!list.length) {
activeModule.value = FAV_KEY
return
}
if (!list.some((m) => m.modulePath === activeModule.value)) {
activeModule.value = FAV_KEY
}
}
const syncFavoriteList = () => {
favoriteList.value = favItems.value.map(
(i) => findHomeCardByPath(sections.value, i.path) || { path: i.path, title: i.path }
(i) => findHomeCardByPath(modules.value, i.path) || { path: i.path, title: i.path }
)
}
watch([favItems, sections], syncFavoriteList, { immediate: true, deep: true })
const displayName = computed(() => {
const info = userStore.getUserInfo || ({} as Api.Auth.UserInfo)
return String(info.realName || info.userName || info.username || '').trim() || '管理员'
})
const greetText = computed(() => {
const h = new Date().getHours()
if (h < 12) return '上午好'
if (h < 18) return '下午好'
return '晚上好'
})
const dateText = computed(() =>
new Date().toLocaleDateString('zh-CN', {
month: 'long',
day: 'numeric',
weekday: 'short'
})
)
watch(modules, ensureActiveModule, { immediate: true, deep: true })
watch([favItems, modules], syncFavoriteList, { immediate: true, deep: true })
onMounted(async () => {
if (!favStore.loaded) {
@@ -187,72 +253,171 @@
<style scoped lang="scss">
.portal-home {
padding: 16px 0 24px;
display: flex;
flex-direction: column;
height: calc(var(--art-full-height, 70vh) - 24px);
min-height: 420px;
padding: 12px 0;
}
.portal-home-hero {
.portal-home-shell {
display: grid;
flex: 1;
grid-template-columns: 180px 1fr;
min-height: 0;
overflow: hidden;
background: #fff;
border: 1px solid var(--mint-border, #d9e8e2);
border-radius: 12px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.portal-home-aside {
display: flex;
flex-direction: column;
gap: 2px;
min-height: 0;
padding: 10px 8px;
overflow: auto;
background: #f8fafc;
border-right: 1px solid var(--mint-border, #d9e8e2);
}
.portal-home-aside__item {
display: flex;
gap: 8px;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 4px;
padding: 12px 14px;
border: 1px solid #bbf7d0;
border-radius: 10px;
background:
radial-gradient(100% 120% at 100% 0%, rgba(16, 185, 129, 0.14), transparent 55%),
linear-gradient(135deg, #ecfdf5 0%, #ffffff 60%, #f8fafc 100%);
width: 100%;
padding: 9px 12px;
font-size: 13px;
font-weight: 500;
color: var(--mint-text, #1e293b);
text-align: left;
cursor: pointer;
background: transparent;
border: 0;
border-radius: 8px;
transition:
background 0.15s ease,
color 0.15s ease;
h3 {
margin: 0 0 2px;
font-size: 16px;
span:first-child {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.n {
flex-shrink: 0;
font-size: 11px;
font-weight: 600;
font-variant-numeric: tabular-nums;
color: #94a3b8;
}
&:hover {
background: #eef2f7;
}
&.is-on {
font-weight: 700;
color: var(--mint-text, #1e293b);
}
color: var(--mint-primary-dark, #059669);
background: var(--mint-primary-bg, #ecfdf5);
p {
margin: 0;
font-size: 12px;
color: var(--mint-text-muted, #64748b);
.n {
color: var(--mint-primary-dark, #059669);
}
}
}
/* 卡片区:与问候条拉开,左右留白 */
.portal-home-cards-area {
margin-top: 4px;
padding: 12px 16px 8px;
.portal-home-panel {
min-height: 0;
padding: 0 0 18px;
overflow: auto;
background:
radial-gradient(80% 40% at 100% 0%, rgba(16, 185, 129, 0.06), transparent 55%), #fefefe;
}
.portal-home-section {
margin-bottom: 22px;
.portal-home-panel__head {
position: sticky;
top: 0;
z-index: 3;
display: flex;
gap: 12px;
align-items: flex-start;
justify-content: space-between;
padding: 16px 18px 12px;
background: rgba(254, 254, 254, 0.94);
border-bottom: 1px solid #eef2f0;
}
.portal-home-panel__title {
margin: 0 0 2px;
font-size: 16px;
font-weight: 700;
color: var(--mint-text, #1e293b);
letter-spacing: -0.01em;
}
.portal-home-panel__desc {
margin: 0;
font-size: 12px;
color: var(--mint-text-muted, #64748b);
}
.portal-home-panel__count {
flex-shrink: 0;
display: inline-flex;
align-items: center;
height: 26px;
padding: 0 10px;
font-size: 12px;
font-weight: 600;
font-variant-numeric: tabular-nums;
color: var(--mint-primary-dark, #059669);
background: var(--mint-primary-bg, #ecfdf5);
border: 1px solid #bbf7d0;
border-radius: 8px;
}
.portal-home-block {
margin: 0 18px 18px;
&:last-child {
margin-bottom: 4px;
}
&--fav {
margin-top: 14px;
padding: 12px 12px 14px;
background: linear-gradient(180deg, #ecfdf5 0%, #fff 72%);
border: 1px solid #bbf7d0;
border-radius: 10px;
}
}
.portal-home-section__head {
.portal-home-block__head {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
}
.portal-home-section__tip {
.portal-home-block__tip {
font-size: 12px;
font-weight: 400;
color: var(--mint-text-muted, #94a3b8);
}
/* 不在 .panel-top 内,自行补绿色竖条 */
.title-bar-heading {
position: relative;
display: inline-flex;
align-items: center;
gap: 8px;
margin: 0;
padding-left: 0;
font-size: 15px;
font-size: 14px;
font-weight: 600;
color: var(--mint-text, #1e293b);
@@ -268,23 +433,24 @@
.portal-home-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
gap: 8px;
margin-top: 12px;
grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
gap: 10px;
margin-top: 10px;
}
.portal-home-card {
position: relative;
display: flex;
gap: 10px;
align-items: center;
justify-content: center;
min-height: 56px;
padding: 12px 22px 12px 10px;
text-align: center;
min-height: 64px;
padding: 12px 34px 12px 12px;
text-align: left;
cursor: pointer;
background: #fff;
border: 1px solid var(--mint-border, #e2e8f0);
border-radius: 10px;
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
transition:
transform 0.15s ease,
box-shadow 0.15s ease,
@@ -292,10 +458,18 @@
background 0.15s ease;
&:hover {
background: var(--mint-primary-bg, #ecfdf5);
background: #fff;
border-color: #6ee7b7;
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
box-shadow: 0 6px 16px rgba(16, 185, 129, 0.12);
transform: translateY(-1px);
.portal-home-card__badge {
transform: scale(1.04);
}
.portal-home-card__title {
color: var(--mint-primary-dark, #059669);
}
}
&:active {
@@ -304,6 +478,8 @@
&--fav {
cursor: grab;
background: #fff;
border-color: #a7f3d0;
&:active {
cursor: grabbing;
@@ -311,7 +487,6 @@
}
}
/* Sortable 幽灵节点可能无 scoped 属性 */
:deep(.portal-home-card--ghost) {
background: var(--mint-primary-bg, #ecfdf5);
border-style: dashed;
@@ -324,29 +499,89 @@
box-shadow: 0 6px 16px rgba(16, 185, 129, 0.16);
}
.portal-home-card__badge {
display: grid;
flex-shrink: 0;
place-items: center;
width: 36px;
height: 36px;
font-size: 14px;
font-weight: 700;
border-radius: 9px;
transition: transform 0.15s ease;
&[data-tone='0'] {
color: #047857;
background: #d1fae5;
}
&[data-tone='1'] {
color: #0f766e;
background: #ccfbf1;
}
&[data-tone='2'] {
color: #065f46;
background: #ecfdf5;
box-shadow: inset 0 0 0 1px #a7f3d0;
}
&[data-tone='3'] {
color: #334155;
background: #e2e8f0;
}
&[data-tone='4'] {
color: #115e59;
background: #f0fdfa;
box-shadow: inset 0 0 0 1px #99f6e4;
}
&--fav {
color: #b45309;
background: #fef3c7;
}
}
.portal-home-card__body {
display: flex;
flex: 1;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.portal-home-card__title {
display: -webkit-box;
width: 100%;
overflow: hidden;
font-size: 13px;
font-weight: 600;
line-height: 1.35;
color: var(--mint-text, #1e293b);
text-align: center;
word-break: break-all;
transition: color 0.15s ease;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.portal-home-card__sub {
overflow: hidden;
font-size: 11px;
line-height: 1.3;
color: var(--mint-text-muted, #94a3b8);
text-overflow: ellipsis;
white-space: nowrap;
}
.portal-home-card__star {
position: absolute;
top: 4px;
right: 4px;
top: 6px;
right: 6px;
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
width: 24px;
height: 24px;
padding: 0;
font-size: 13px;
line-height: 1;
@@ -355,7 +590,7 @@
background: transparent;
border: 0;
border-radius: 6px;
opacity: 0.55;
opacity: 0.45;
transition:
background 0.15s ease,
color 0.15s ease,
@@ -363,7 +598,7 @@
&:hover {
color: #d97706;
background: #f1f5f9;
background: #fff7ed;
opacity: 1;
}
@@ -378,8 +613,36 @@
}
.portal-home-empty {
margin-top: 48px;
margin-top: 32px;
font-size: 13px;
color: var(--mint-text-muted, #94a3b8);
text-align: center;
&--page {
margin: 48px 0;
}
}
@media (max-width: 720px) {
.portal-home-shell {
grid-template-columns: 1fr;
}
.portal-home-aside {
flex-direction: row;
flex-wrap: wrap;
max-height: 140px;
border-right: 0;
border-bottom: 1px solid var(--mint-border, #d9e8e2);
}
.portal-home-aside__item {
width: auto;
max-width: 100%;
}
.portal-home-grid {
grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
}
</style>