services.repositories.plan_repository
源文件
services/repositories/plan_repository.py· 由scripts/gen_api_docs.py自动生成,请勿手改
模块说明:
生产计划 CRUD 仓库
类
class PlanRepository
生产计划表的增删改查
定义行:8
方法
__init__
python
def __init__(self, db)⚠️ 待补 docstring
此函数暂无 docstring,欢迎补充。
定义行:11
ensure_table
python
def ensure_table(self)⚠️ 待补 docstring
此函数暂无 docstring,欢迎补充。
定义行:117
get_by_id
python
def get_by_id(self, plan_id: int) -> dict | None⚠️ 待补 docstring
此函数暂无 docstring,欢迎补充。
定义行:121
get_all
python
def get_all(self, status: str | None=None) -> list[dict]⚠️ 待补 docstring
此函数暂无 docstring,欢迎补充。
定义行:126
find_by_group_product
python
def find_by_group_product(self, group_number: int, product_type_id: int) -> int | None按分组号+产品查找已存在的子计划 id。
定义行:136
save
python
def save(self, plan: dict) -> int⚠️ 待补 docstring
此函数暂无 docstring,欢迎补充。
定义行:145
_allowed_fields
python
def _allowed_fields(fields: dict) -> dict⚠️ 待补 docstring
此函数暂无 docstring,欢迎补充。
定义行:178
update
python
def update(self, plan_id: int, **fields) -> bool⚠️ 待补 docstring
此函数暂无 docstring,欢迎补充。
定义行:181
update_many
python
def update_many(self, plan_ids: list[int], **fields) -> int批量更新多条计划的同一组字段(列名来自内部,参数化值)。返回受影响行数。
定义行:191
update_batch
python
def update_batch(self, rows: list[tuple[int, dict]]) -> int批量异构更新:rows = [(plan_id, {field: value}), ...],单连接单事务。返回更新行数。
定义行:203
insert_child_plan
python
def insert_child_plan(self, *, product_type_id: int, product_name: str, blueprint_type_id: int, runs: int, parallels: int, me_level: int, te_level: int, group_number: int, sub_level: int, mat_hangar_id: int | None, solar_system_id: int | None, deposit_hangar_id: int | None=None, source_mother_ids: str='', component_parent_type_id: int | None=None, demand: int=0) -> int插入一条拆解子计划(含分组/层级/机库/引用式需求字段)。
定义行:219
insert_split_remainder
python
def insert_split_remainder(self, plan_id: int, *, parallels: int, assigned_blueprint_id: int | None=None, conn=None) -> int复制 plan_id 的结构列,生成「部分启动」的未启动余量行(pending),返回新行 id。
定义行:325
delete_many
python
def delete_many(self, plan_ids: list[int]) -> int批量删除计划(蓝图表关联清理由调用方 release_blueprint 处理)。返回删除行数。
定义行:356
delete
python
def delete(self, plan_id: int) -> bool⚠️ 待补 docstring
此函数暂无 docstring,欢迎补充。
定义行:365