Files
37duAutomation/plugins/XQ0001-0100/XQ0042 抖音平台核对/config/export_fields.py
T

170 lines
13 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""核销明细导出字段目录(平台 get_field_config 实测,2026-11-05)。
option_type:1=系统默认(必选、不可改);2=默认勾选(可取消);3=可选(多数默认不勾)。
is_default:平台当前默认是否勾选(用户切到「自定义字段」时的预勾选)。
导出用 field_key;field_name 仅用于界面展示与日志。
平台增删字段后重新跑一次抓取脚本再生成本文件(未知 key 后端会告警但照传)。
"""
FIELD_GROUPS = (
{
"value": "order_info",
"label": "订单基础信息",
"fields": (
{"key": "shop_order_id", "name": "订单编号", "option_type": 1, "is_default": True},
{"key": "order_tags", "name": "订单标签", "option_type": 1, "is_default": True},
{"key": "create_time", "name": "下单时间", "option_type": 1, "is_default": True},
{"key": "pay_time", "name": "支付时间", "option_type": 1, "is_default": True},
{"key": "deposit_pay_time", "name": "订金支付时间", "option_type": 3, "is_default": False},
{"key": "balance_pay_time", "name": "尾款支付时间", "option_type": 3, "is_default": False},
),
},
{
"value": "verify_info",
"label": "核销信息",
"fields": (
{"key": "verify_id", "name": "核销记录ID", "option_type": 3, "is_default": False},
{"key": "code", "name": "券码(已撤销核销加密)", "option_type": 1, "is_default": True},
{"key": "poi_province", "name": "核销门店省份", "option_type": 3, "is_default": True},
{"key": "poi_city", "name": "核销门店城市", "option_type": 3, "is_default": False},
{"key": "poi_id", "name": "核销门店ID", "option_type": 1, "is_default": True},
{"key": "poi_name", "name": "核销门店", "option_type": 1, "is_default": True},
{"key": "poi_name_remark", "name": "核销门店名称备注", "option_type": 3, "is_default": False},
{"key": "poi_id_remark", "name": "核销门店编号备注", "option_type": 3, "is_default": False},
{"key": "verify_status", "name": "核销状态", "option_type": 1, "is_default": True},
{"key": "verifier_account", "name": "核销人账号", "option_type": 3, "is_default": False},
{"key": "verifier_name", "name": "核销人昵称", "option_type": 3, "is_default": True},
{"key": "verifier_id", "name": "核销人ID", "option_type": 3, "is_default": True},
{"key": "fulfil_type_str", "name": "核销方式", "option_type": 3, "is_default": False},
{"key": "verify_time_str", "name": "核销时间", "option_type": 1, "is_default": True},
{"key": "use_complete_time_str", "name": "使用完成时间", "option_type": 1, "is_default": True},
{"key": "cancel_time_str", "name": "撤销核销时间", "option_type": 2, "is_default": True},
{"key": "external_good_id", "name": "外部货号", "option_type": 3, "is_default": False},
{"key": "merchant_remark", "name": "商家备注", "option_type": 3, "is_default": False},
{"key": "write_off_gift", "name": "赠品信息", "option_type": 2, "is_default": True},
),
},
{
"value": "product_info",
"label": "商品信息",
"fields": (
{"key": "product_name", "name": "商品名称", "option_type": 1, "is_default": True},
{"key": "product_type_name", "name": "商品类型", "option_type": 1, "is_default": True},
{"key": "product_id", "name": "商品ID", "option_type": 1, "is_default": True},
{"key": "category_name", "name": "商品类目", "option_type": 2, "is_default": True},
{"key": "product_owner_type", "name": "商品归属", "option_type": 3, "is_default": False},
{"key": "product_owner_account_name", "name": "商品归属商户", "option_type": 1, "is_default": True},
{"key": "product_owner_account_id", "name": "商品归属商户ID", "option_type": 1, "is_default": True},
{"key": "item_num", "name": "购买数量", "option_type": 1, "is_default": True},
{"key": "product_sale_currency", "name": "商品售价币种", "option_type": 3, "is_default": False},
{"key": "product_actual_amount", "name": "商品售价(单价)", "option_type": 1, "is_default": True},
{"key": "product_origin_amount", "name": "用户侧划线价", "option_type": 2, "is_default": True},
{"key": "once_origin_amount", "name": "单次划线价", "option_type": 3, "is_default": False},
{"key": "voucher_verify_info", "name": "代金券面额", "option_type": 3, "is_default": False},
{"key": "combo_product_name", "name": "组合商品名称", "option_type": 3, "is_default": False},
{"key": "combo_product_amount", "name": "组合商品价格", "option_type": 3, "is_default": False},
{"key": "sale_specs", "name": "商品规格", "option_type": 1, "is_default": True},
),
},
{
"value": "amount_info",
"label": "券金额信息",
"fields": (
{"key": "pay_amount_currency", "name": "用户实付币种", "option_type": 2, "is_default": True},
{"key": "pay_amount_str", "name": "用户实付", "option_type": 1, "is_default": True},
{"key": "payment_amount_currency", "name": "订单实收币种", "option_type": 2, "is_default": True},
{"key": "payment_amount", "name": "订单实收", "option_type": 1, "is_default": True},
{"key": "deposit_pay_amount", "name": "订金实付金额", "option_type": 3, "is_default": False},
{"key": "balance_pay_amount", "name": "尾款实付金额", "option_type": 3, "is_default": False},
{"key": "merchant_amount_currency", "name": "预计收入币种", "option_type": 2, "is_default": True},
{"key": "merchant_amount", "name": "预计收入", "option_type": 2, "is_default": True},
{"key": "purchase_fee", "name": "采购价", "option_type": 3, "is_default": False},
{"key": "benefit_verify_amount", "name": "惠享卡核销金额", "option_type": 3, "is_default": False},
{"key": "benefit_left_principal_amount", "name": "惠享卡本金核销余额", "option_type": 3, "is_default": False},
{"key": "benefit_left_benefit_amount", "name": "惠享卡赠送金核销余额", "option_type": 3, "is_default": False},
{"key": "merchant_funder_discount", "name": "代商家出资补贴", "option_type": 2, "is_default": True},
{"key": "merchant_discount_detail", "name": "商家补贴优惠明细", "option_type": 1, "is_default": True},
{"key": "merchant_discount_amount2", "name": "商家货款补贴", "option_type": 2, "is_default": True},
{"key": "pay_discount", "name": "抖音支付优惠", "option_type": 2, "is_default": True},
{"key": "platform_discount_amount", "name": "平台补贴", "option_type": 2, "is_default": True},
{"key": "platform_discount_detail", "name": "平台补贴优惠明细", "option_type": 2, "is_default": True},
{"key": "brand_discount_amount", "name": "品牌商补贴", "option_type": 2, "is_default": True},
{"key": "brand_discount_detail", "name": "品牌商补贴优惠明细", "option_type": 2, "is_default": True},
{"key": "provider_discount_amount", "name": "服务商补贴", "option_type": 2, "is_default": True},
{"key": "provider_discount_detail", "name": "服务商补贴优惠明细", "option_type": 2, "is_default": True},
{"key": "government_voucher_discount_amount", "name": "政府补贴", "option_type": 2, "is_default": True},
{"key": "government_voucher_discount_detail", "name": "政府补贴优惠明细", "option_type": 2, "is_default": True},
{"key": "combined_hote_sale_price", "name": "酒店房价", "option_type": 3, "is_default": False},
{"key": "combined_scenic_sale_price", "name": "景区分销金额", "option_type": 3, "is_default": False},
{"key": "commission_base", "name": "各类服务费率基数", "option_type": 2, "is_default": True},
{"key": "platform_service_amount", "name": "软件服务费", "option_type": 2, "is_default": True},
{"key": "platform_service_rate", "name": "软件服务费率", "option_type": 2, "is_default": True},
{"key": "ybq_fee", "name": "出单宝托管服务费", "option_type": 2, "is_default": False},
{"key": "ybq_fee_rate", "name": "出单宝托管服务费率", "option_type": 2, "is_default": False},
{"key": "ybq_platform_fee", "name": "平台费用抵扣", "option_type": 2, "is_default": False},
{"key": "handling_fee_amount", "name": "支付手续费(已含在软件服务费中)", "option_type": 2, "is_default": True},
{"key": "handling_fee_rate", "name": "支付手续费费率", "option_type": 2, "is_default": True},
{"key": "talent_commission_amount", "name": "达人服务费", "option_type": 2, "is_default": True},
{"key": "talent_commission_rate", "name": "达人服务费比例", "option_type": 2, "is_default": True},
{"key": "craftsman_commission_amount", "name": "职人激励金", "option_type": 2, "is_default": True},
{"key": "craftsman_commission_rate", "name": "职人激励金比例", "option_type": 2, "is_default": True},
{"key": "broker_commission_amount", "name": "团长服务费", "option_type": 2, "is_default": True},
{"key": "agent_commission_amount", "name": "服务商服务费", "option_type": 2, "is_default": True},
{"key": "agent_commission_rate", "name": "服务商服务费比例", "option_type": 2, "is_default": True},
{"key": "agent_account_name", "name": "服务商名称", "option_type": 2, "is_default": True},
{"key": "insurance_commission_amount", "name": "保险费用", "option_type": 3, "is_default": True},
{"key": "welfare_donation", "name": "公益捐赠", "option_type": 3, "is_default": False},
{"key": "clerk_commission_amount", "name": "店员激励金", "option_type": 2, "is_default": True},
{"key": "clerk_commission_rate", "name": "店员激励金比例", "option_type": 2, "is_default": True},
{"key": "month_pay_interest", "name": "月付贴息", "option_type": 2, "is_default": True},
{"key": "zlb_promotion_fee", "name": "增量宝", "option_type": 2, "is_default": True},
{"key": "content_production_fee", "name": "AIGC 服务费", "option_type": 2, "is_default": False},
),
},
{
"value": "channel_info",
"label": "渠道信息",
"fields": (
{"key": "sale_channel", "name": "成交渠道", "option_type": 2, "is_default": True},
{"key": "app_source", "name": "下单来源", "option_type": 2, "is_default": True},
{"key": "media_url", "name": "内容地址", "option_type": 3, "is_default": False},
{"key": "sale_role", "name": "带货角色", "option_type": 2, "is_default": True},
{"key": "sale_user_nickname", "name": "带货人", "option_type": 2, "is_default": True},
{"key": "transform_nickname", "name": "订单归属人昵称(字段如果获取不到就默认展示商家,如对账以账单为主)", "option_type": 2, "is_default": True},
{"key": "transform_uid", "name": "订单归属人uid", "option_type": 2, "is_default": True},
{"key": "talent_aweme_nickname", "name": "达人昵称", "option_type": 2, "is_default": True},
{"key": "talent_aweme_unique_id", "name": "达人抖音号", "option_type": 2, "is_default": True},
{"key": "talent_aweme_uid", "name": "达人uid", "option_type": 2, "is_default": True},
{"key": "craftsman_aweme_nickname", "name": "职人昵称", "option_type": 3, "is_default": False},
{"key": "craftsman_aweme_unique_id", "name": "职人抖音号", "option_type": 3, "is_default": False},
{"key": "craftsman_aweme_uid", "name": "职人uid", "option_type": 3, "is_default": False},
{"key": "clerk_aweme_nickname", "name": "店员昵称", "option_type": 3, "is_default": False},
{"key": "clerk__aweme_unique_id", "name": "店员抖音号", "option_type": 3, "is_default": False},
{"key": "clerk_aweme_uid", "name": "店员uid", "option_type": 3, "is_default": False},
),
},
{
"value": "pick_up_info",
"label": "提货信息",
"fields": (
{"key": "pick_up_spec", "name": "提货规格", "option_type": 2, "is_default": True},
{"key": "pick_up_validate_end_time", "name": "提货截止时间", "option_type": 2, "is_default": True},
),
},
)
def _all():
for group in FIELD_GROUPS:
for item in group["fields"]:
yield item
LOCKED_KEYS = tuple(i["key"] for i in _all() if i["option_type"] == 1)
DEFAULT_KEYS = tuple(i["key"] for i in _all()
if i["option_type"] in (1, 2) or i["is_default"])
ALL_KEYS = tuple(i["key"] for i in _all())
NAME_BY_KEY = {i["key"]: i["name"] for i in _all()}
TYPE_BY_KEY = {i["key"]: i["option_type"] for i in _all()}