refactor: 宏观状态统一(待仓库收货/已入库)废弃"在库"; WIP矩阵返回product_name并新增下钻明细

This commit is contained in:
2026-09-02 10:38:49 +08:00
parent e194b97649
commit 3019653dfa
6 changed files with 199 additions and 19 deletions

View File

@ -220,16 +220,16 @@ async def get_product_by_serial(db: AsyncSession, serial_number: str) -> Product
node_assignee = (outbound_log.operator_id if outbound_log else None) or last_transfer_operator or last_main.assignee_id
node_created_by = last_transfer_operator or last_main.assignee_id
elif inbound_log is not None:
# 情况 B:MOM 已扫码实收 → "在库" 已完成,负责人为仓库接收人
node_name = "在库"
node_status = "COMPLETED"
# 情况 B:MOM 已扫码实收 → "已入库",负责人为仓库接收人
node_name = "已入库"
node_status = "ARCHIVED"
node_assignee = inbound_log.operator_id or "仓库"
# "转入在库"始终显示操作转入库的人(车间),而不是 MOM 接收人
node_created_by = last_transfer_operator or last_main.assignee_id
else:
# 情况 A:MOM 还没扫码 → "待收货" 进行中,负责人为占位"待仓库扫码"
node_name = "待收货"
node_status = "IN_PROGRESS"
# 情况 A:MOM 还没扫码 → "已完成"(车间完工待实收),负责人为占位"待仓库扫码"
node_name = "已完成"
node_status = "COMPLETED"
node_assignee = "待仓库扫码"
node_created_by = last_transfer_operator or last_main.assignee_id