补齐项目组负责人审批、费用信息、合作客户、生产出库菜单、申请单号 LCKY 前缀及配套 SQL 迁移,并同步相关前后端与单测。 Co-authored-by: Cursor <cursoragent@cursor.com>
52 lines
1.5 KiB
Python
52 lines
1.5 KiB
Python
"""中试/临床/科研类申请单业务类型辅助。"""
|
|
from typing import Optional
|
|
|
|
# 临床科研与委托加工共用申请/交付/缴费/出库流程
|
|
RESEARCH_LIKE_BIZ_TYPES = ("basic_experiment", "contract_processing")
|
|
|
|
BIZ_TYPE_LABELS = {
|
|
"pilot_service": "中试服务",
|
|
"clinical_application": "临床应用",
|
|
"basic_experiment": "临床科研",
|
|
"contract_processing": "委托加工",
|
|
}
|
|
|
|
APPLICATION_NO_PREFIX = {
|
|
"clinical_application": "LCSQ",
|
|
"basic_experiment": "LCKY",
|
|
"contract_processing": "WTJG",
|
|
"pilot_service": "ZSSQ",
|
|
}
|
|
|
|
# 申请单项目组负责人审批(后续规则引擎可覆盖审批人,本期固定项目组负责人)
|
|
APPROVAL_PENDING = "dsp"
|
|
APPROVAL_PASSED = "ytg"
|
|
APPROVAL_REJECTED = "yth"
|
|
APPROVAL_STATUS_LABELS = {
|
|
APPROVAL_PENDING: "待审批",
|
|
APPROVAL_PASSED: "已通过",
|
|
APPROVAL_REJECTED: "已驳回",
|
|
}
|
|
|
|
|
|
def is_research_like_biz(biz_type: Optional[str]) -> bool:
|
|
return (biz_type or "") in RESEARCH_LIKE_BIZ_TYPES
|
|
|
|
|
|
def biz_type_label(biz_type: Optional[str]) -> str:
|
|
key = biz_type or ""
|
|
return BIZ_TYPE_LABELS.get(key, key or "")
|
|
|
|
|
|
def application_no_prefix(biz_type: Optional[str]) -> str:
|
|
key = biz_type or "pilot_service"
|
|
return APPLICATION_NO_PREFIX.get(key, APPLICATION_NO_PREFIX["pilot_service"])
|
|
|
|
|
|
def requires_leader_approval(biz_type: Optional[str]) -> bool:
|
|
return is_research_like_biz(biz_type)
|
|
|
|
|
|
def is_leader_approval_passed(approval_status: Optional[str]) -> bool:
|
|
return (approval_status or "") == APPROVAL_PASSED
|