This commit is contained in:
zlwu committed 2026-05-28 13:05:46 +08:00
1 parent f1f5d24eff
commit 3c7a47981a
138 files changed
+18654 -12092

No files matched your search

+26 -2
View File
@@ -158,6 +158,7 @@ class InfusionScheduleNestedBody(BaseModel):
infusion_time: Optional[str] = Field(None, alias="infusionTime")
infusion_location: Optional[str] = Field(None, alias="infusionLocation")
infusion_method: Optional[str] = Field(None, alias="infusionMethod")
amount: Optional[float] = None
cell_products: Optional[list[ScheduleProductNestedBody]] = Field(None, alias="cellProducts")
@@ -181,7 +182,9 @@ class ApplicationSaveBody(BaseModel):
id: Optional[str] = None
application_name: Optional[str] = Field(None, alias="applicationName")
channel_service_order_id: str = Field(..., alias="channelServiceOrderId")
channel_service_order_id: Optional[str] = Field(None, alias="channelServiceOrderId")
channel_id: Optional[str] = Field(None, alias="channelId")
biz_type: Optional[str] = Field(None, alias="bizType")
remark: Optional[str] = None
patient: Optional[PatientNestedBody] = None
infusion_plan: Optional[InfusionPlanNestedBody] = Field(None, alias="infusionPlan")
@@ -292,13 +295,22 @@ async def api_save_application(
dept_id = user.get("region_id", "")
is_edit = bool(body.id)
biz_type = body.biz_type or "pilot_service"
app_data: dict = {
"channelServiceOrderId": body.channel_service_order_id,
"channelServiceOrderId": body.channel_service_order_id or "",
"channelId": body.channel_id or "",
"bizType": biz_type,
"remark": body.remark,
}
if body.application_name is not None:
app_data["applicationName"] = body.application_name
if not is_edit and biz_type != "clinical_application" and not app_data["channelServiceOrderId"]:
return error_response(400, "请选择渠道服务订单")
if not is_edit and biz_type == "clinical_application" and not app_data["channelId"]:
return error_response(400, "请选择渠道")
if is_edit:
app_result = pilot_application.update_application(
db,
@@ -732,12 +744,18 @@ async def api_create_outbound_production(
tenant_no = _get_tenant_no(db, user)
from app.crud import production_work_order as pwo_svc
from app.crud.qc_work_order import resolve_outbound_biz_type_for_schedule
outbound_biz_type = resolve_outbound_biz_type_for_schedule(
db, body.scheduleId, tenant_no
)
wo = pwo_svc.create_outbound_production_work_order(
db,
schedule_id=body.scheduleId,
tenant_no=tenant_no,
user_id=user.get("user_id"),
create_dept_id=user.get("dept_id", ""),
biz_type=outbound_biz_type,
)
db.commit()
db.refresh(wo)
@@ -764,6 +782,11 @@ async def api_create_outbound_qc(
tenant_no = _get_tenant_no(db, user)
from app.crud import qc_work_order as qc_svc
from app.crud.qc_work_order import resolve_outbound_biz_type_for_schedule
outbound_biz_type = resolve_outbound_biz_type_for_schedule(
db, body.scheduleId, tenant_no
)
wo = qc_svc.create_outbound_qc_work_order(
db,
schedule_id=body.scheduleId,
@@ -771,6 +794,7 @@ async def api_create_outbound_qc(
tenant_no=tenant_no,
user_id=user.get("user_id"),
create_dept_id=user.get("dept_id", ""),
biz_type=outbound_biz_type,
)
return success_response(qc_svc._wo_to_dict(wo), message="创建出库质检工单成功")
except ValueError as e: