feat(in-transit-transfer): inbound/outbound 幂等重命名与解析用途分层
- receipt→inbound 三件套改名(回调桥/文件门禁/触发服务),回调链幂等去重,迁移 tt14 同步台账键与测试基建 - 库存解析用途分层 onhand/inbound/outbound(迁移 tt15):解析档案、文件存储与下载名按用途隔离,管理端表单同步 - 「成熟」概念退役(迁移 tt16):数据无成熟属性,日期边界由调用方入参严格判定 - backlog 新增重解析服务,在途重识别投影 processing,EML 父项不再停留处理中 - 收料 RPA 回调/归档/排程链路同步改名挂点,运维脚本复位假完成状态 - 文档随批:ADR 0003 模块边界决策、10-15/10-16 计划与设计、调拨文档族与 demand/tec/funclist - 同步 chat/errors 文案四语言、调拨前端卡片与 e2e、测试全家
This commit is contained in:
1 parent
43dceaf027
commit
8102a1fe44
151 files changed
+8057
-2382
No files matched your search
@@ -259,7 +259,7 @@ def _receipt_report_config_payload(config: ShippingReceiptReportConfig) -> dict[
|
||||
'id': config.id, 'inventory_source_id': config.inventory_source_id,
|
||||
'report_path_json': config.report_path_json or {},
|
||||
'query_parameters_json': config.query_parameters_json or [],
|
||||
# 异动解析绑定:供抽屉回显当前规则;摘要只取展示字段,不透传定义。
|
||||
# 入站解析绑定:供抽屉回显当前规则;摘要只取展示字段,不透传定义。
|
||||
'parsing_profile_id': config.parsing_profile_id,
|
||||
'parsing_profile': ({
|
||||
'id': profile.id, 'profile_code': profile.profile_code, 'display_name': profile.display_name,
|
||||
@@ -270,23 +270,23 @@ def _receipt_report_config_payload(config: ShippingReceiptReportConfig) -> dict[
|
||||
}
|
||||
|
||||
|
||||
def _validate_movement_profile_binding(profile_id: Any) -> int | None:
|
||||
"""校验收料配置绑定的异动解析规则:必须已发布且 purpose='movement';空值表示解绑。
|
||||
def _validate_inbound_profile_binding(profile_id: Any) -> int | None:
|
||||
"""校验收料配置绑定的入站解析规则:必须已发布且 purpose='inbound';空值表示解绑。
|
||||
|
||||
Args:
|
||||
profile_id: 请求中的 parsing_profile_id;None/空串表示解绑。
|
||||
Returns:
|
||||
规整后的规则 id 或 None。
|
||||
Raises:
|
||||
ValidationError: 规则不存在/未发布/用途不是 movement(fail-closed,防误绑库存规则)。
|
||||
ValidationError: 规则不存在/未发布/用途不是 inbound(fail-closed,防误绑在手/出站规则)。
|
||||
"""
|
||||
if profile_id is None or str(profile_id).strip() == '':
|
||||
return None
|
||||
profile = db.session.get(ShippingInventoryParsingProfile, int(profile_id))
|
||||
if profile is None or profile.status != 'published' or profile.purpose != 'movement':
|
||||
if profile is None or profile.status != 'published' or profile.purpose != 'inbound':
|
||||
raise ValidationError(
|
||||
'Receipt movement parsing profile must be published with purpose movement',
|
||||
code='SHIPPING.RECEIPT_MOVEMENT_PROFILE_INVALID',
|
||||
'Inbound parsing profile must be published with purpose inbound',
|
||||
code='SHIPPING.INBOUND_PROFILE_INVALID',
|
||||
)
|
||||
return profile.id
|
||||
|
||||
@@ -352,7 +352,7 @@ def save_receipt_report_config(source_id: int, data: dict[str, Any], *, actor_id
|
||||
config.config_version += 1
|
||||
config.report_path_json = path
|
||||
config.query_parameters_json = parameters
|
||||
config.parsing_profile_id = _validate_movement_profile_binding(data.get('parsing_profile_id'))
|
||||
config.parsing_profile_id = _validate_inbound_profile_binding(data.get('parsing_profile_id'))
|
||||
config.updated_by = actor_id
|
||||
db.session.flush()
|
||||
after = _receipt_report_config_payload(config)
|
||||
|
||||
Reference in new issue
Block a user