feat(backend): expose GET /production-waste-outputs list API.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
79f9649610
commit
301df76c65
1 file changed
+28
@@ -39,6 +39,7 @@ from app.schemas.process_route import (
|
||||
from app.models.models import SysUser
|
||||
from app.crud import production_work_order as production_work_order_svc
|
||||
from app.crud import production_task as production_task_svc
|
||||
from app.crud import production_waste_output as production_waste_output_svc
|
||||
from app.crud import cell_product as cell_product_svc
|
||||
from app.crud import qc_work_order as qc_work_order_svc
|
||||
from app.schemas.production_work_order import (
|
||||
@@ -2078,6 +2079,33 @@ async def list_production_tasks(
|
||||
return success_response({"list": items, "total": total, "page": page, "pageSize": pageSize, "totalPages": tp})
|
||||
|
||||
|
||||
@router.get("/production-waste-outputs")
|
||||
async def list_production_waste_outputs(
|
||||
page: int = Query(1, ge=1),
|
||||
pageSize: int = Query(10, ge=1, le=100, alias="pageSize"),
|
||||
keyword: Optional[str] = None,
|
||||
createTimeStart: Optional[str] = Query(None, alias="createTimeStart"),
|
||||
createTimeEnd: Optional[str] = Query(None, alias="createTimeEnd"),
|
||||
user: dict = Depends(require_admin_or_super_admin),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
tenant_no = _get_tenant_no(db, user)
|
||||
items, total = production_waste_output_svc.list_production_waste_outputs(
|
||||
db,
|
||||
tenant_no=tenant_no,
|
||||
page=page,
|
||||
page_size=pageSize,
|
||||
keyword=keyword,
|
||||
create_time_start=createTimeStart,
|
||||
create_time_end=createTimeEnd,
|
||||
user_info=user,
|
||||
)
|
||||
tp = production_waste_output_svc.total_pages(total, pageSize)
|
||||
return success_response(
|
||||
{"list": items, "total": total, "page": page, "pageSize": pageSize, "totalPages": tp}
|
||||
)
|
||||
|
||||
|
||||
@router.post("/production-tasks/list-by-work-orders")
|
||||
async def list_production_tasks_by_work_orders(
|
||||
body: ProductionTaskListByWorkOrdersBody,
|
||||
|
||||
Reference in new issue
Block a user