This commit is contained in:
upload
2026-10-08 17:34:02 +08:00
commit f216f6120b
961 changed files with 25144 additions and 0 deletions
Binary file not shown.
+154
View File
@@ -0,0 +1,154 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
"""从 Excel 读取 upccode+店名,逐条匹配写入 poi_category_filter,最后输出失败清单。
用法:python add_filter_excel_confirm.py
"""
import datetime
import sys
import time
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
from add_filter_manual import (
INSERT_SQL,
_db_write_one,
filter_exists,
lookup_category,
)
from read_upccode_excel import read_upccode_shop_from_excel
# ==================== 运行参数(改这里) ====================
TARGET_WORKID = str(datetime.date.today()).replace('-', '')
EXCEL_PATH = Path(__file__).resolve().parent / '周一需求.xlsx'
UPC_COLUMN = 'F'
SHOP_COLUMN = 'E'
DEDUPE = True
START_FROM = 1
SAVE_FAIL_FILE = True
SHOW_EACH = True # 每条打印一行
# ============================================================
def _short(text, n=20) -> str:
text = str(text or '')
return text if len(text) <= n else text[:n] + '...'
def _insert_row(row: dict, workid: str) -> None:
_db_write_one(INSERT_SQL, (
workid,
row['poi_id_str'],
row['shop_name'],
row['tag1'],
row['tag1_name'],
row['tag2'],
row['tag2_name'],
))
def _print_failed_list(failed_list: list[dict], workid: str) -> None:
print('\n' + '=' * 60)
if not failed_list:
print('[失败清单] 无')
return
print(f'[失败清单] 共 {len(failed_list)} 条')
lines = []
for item in failed_list:
line = (
f"[{item['index']}] upccode={item['upccode']} | "
f"店名={item['shop_name']} | {item['reason']}"
)
print(f' {line}')
lines.append(line)
if not SAVE_FAIL_FILE:
return
out_path = Path(__file__).resolve().parent / f'失败清单_{workid}.txt'
out_path.write_text(
'\n'.join([f'workid={workid}', f'失败共 {len(failed_list)} 条', '', *lines]),
encoding='utf-8',
)
print(f'\n[失败清单] 已保存: {out_path}')
def main():
t0 = time.time()
workid = TARGET_WORKID
items = read_upccode_shop_from_excel(
EXCEL_PATH, UPC_COLUMN, SHOP_COLUMN, dedupe=DEDUPE
)
total = len(items)
if total == 0:
print('Excel 没有可读数据')
return
start = max(1, START_FROM)
print(f'Excel: {EXCEL_PATH}')
print(f'upccode列={UPC_COLUMN} 店名列={SHOP_COLUMN} | 共 {total} 条 | workid={workid}')
if start > 1:
print(f'从第 {start} 条开始')
print('逐条处理中...\n')
stat = {'write': 0, 'skip_exist': 0, 'fail': 0}
failed_list: list[dict] = []
for i, item in enumerate(items, 1):
if i < start:
continue
upc = item['upccode']
excel_shop = item['shop_name']
row, err = lookup_category(upc, excel_shop, verbose=False)
if not row:
stat['fail'] += 1
failed_list.append({
'index': i,
'upccode': upc,
'shop_name': excel_shop,
'reason': err,
})
if SHOW_EACH:
print(f'[{i}/{total}] 失败 | {upc} | {_short(excel_shop)} | {err}')
continue
if filter_exists(workid, row['poi_id_str'], row['tag1'], row['tag2']):
stat['skip_exist'] += 1
if SHOW_EACH:
print(
f'[{i}/{total}] 已有 | {upc} | '
f'{row["tag1_name"]}/{row["tag2_name"]} | poi={row["poi_id_str"]}'
)
continue
_insert_row(row, workid)
stat['write'] += 1
if SHOW_EACH:
print(
f'[{i}/{total}] 写入 | {upc} | {_short(excel_shop)} -> '
f'{row["tag1_name"]}/{row["tag2_name"]} | poi={row["poi_id_str"]}'
)
if i == total or i % 50 == 0:
print(
f'--- 进度 {i}/{total} | 写入 {stat["write"]} | '
f'已有 {stat["skip_exist"]} | 失败 {stat["fail"]} ---'
)
elapsed = time.time() - t0
print('=' * 60)
print(
f'结束 | 写入 {stat["write"]} | 库中已有 {stat["skip_exist"]} | '
f'失败 {stat["fail"]} | 耗时 {elapsed:.1f}s'
)
_print_failed_list(failed_list, workid)
if __name__ == '__main__':
main()
+274
View File
@@ -0,0 +1,274 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
"""手动输入 upccode + 店名,查分类并写入 poi_category_filter 黑名单。
用法:python add_filter_manual.py
每行输入: upccode,店名
或分两次输入 upccode 和店名
输入 q 退出
"""
import datetime
import io
import sys
import threading
from concurrent.futures import ThreadPoolExecutor, as_completed
from contextlib import redirect_stdout
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent / 'run2_请求products'
sys.path.insert(0, str(ROOT))
sys.path.insert(0, str(Path(__file__).resolve().parent))
import newsetting as ten
from read_upccode_excel import normalize_shop_name
# ==================== 运行参数(改这里) ====================
TARGET_WORKID = str(datetime.date.today()).replace('-', '')
# ============================================================
tent = ten.All_Setting(host='183.6.7.91', port=23016, db='pyui_all_market')
INSERT_SQL = '''
INSERT IGNORE INTO poi_category_filter
(workid, poi_id_str, shop_name, tag1, tag1_name, tag2, tag2_name)
VALUES (%s, %s, %s, %s, %s, %s, %s)
'''
_SHOP_NORM = "REPLACE(REPLACE(REPLACE(c.shop_name,'(','('),')',')'),' ','')"
def _db_query(sql: str):
with redirect_stdout(io.StringIO()):
return tent.get_shoppingmalls(sql)
def _db_write_one(sql: str, data):
with redirect_stdout(io.StringIO()):
tent.write_data_one(sql, data)
def _sql_str(value) -> str:
return "'" + str(value).replace("'", "''") + "'"
def lookup_category(upccode: str, shop_name: str, *, verbose: bool = True) -> tuple[dict | None, str]:
"""upccode + 店名 -> categorylist2 分类。返回 (结果, 失败原因)。"""
upc = upccode.strip()
shop = normalize_shop_name(shop_name) or ''
if not upc.isdigit():
msg = f'upccode不是纯数字: {upc}'
if verbose:
print(f'[错误] {msg}')
return None, msg
if not shop:
msg = '店名不能为空'
if verbose:
print(f'[错误] {msg}')
return None, msg
upc_sql = _sql_str(upc)
shop_sql = shop.replace("'", "''")
sql = f'''
SELECT
p.upccode,
p.product_id,
p.product_name,
c.index_id,
c.poi_id_str,
c.shop_name,
c.tag1,
c.tag1_name,
c.tag2,
c.tag2_name
FROM productslist p
INNER JOIN categorylist2 c
ON c.poi_id_str = p.poi_id_str
AND (
{_SHOP_NORM} = '{shop_sql}'
OR c.shop_name LIKE '%{shop_sql[:20]}%'
OR '{shop_sql}' LIKE CONCAT('%', {_SHOP_NORM}, '%')
)
AND (
c.index_id = p.parent2_id
OR (
c.allSortedSpuId IS NOT NULL
AND c.allSortedSpuId != 'null'
AND (
JSON_CONTAINS(c.allSortedSpuId, CAST(p.product_id AS JSON), '$')
OR JSON_CONTAINS(c.allSortedSpuId, JSON_QUOTE(p.product_id), '$')
OR c.allSortedSpuId LIKE CONCAT('%"', p.product_id, '"%')
OR c.allSortedSpuId LIKE CONCAT('%', p.product_id, '%')
)
)
)
WHERE p.upccode = {upc_sql}
ORDER BY p.`index` DESC, c.update_time DESC, c.index_id DESC
LIMIT 1
'''
rows = _db_query(sql)
if not rows:
check = _db_query(f'SELECT 1 FROM productslist WHERE upccode = {upc_sql} LIMIT 1')
if not check:
msg = f'productslist无此upccode: {upc}'
if verbose:
print(f'[无商品] {msg}')
else:
msg = f'有商品但店名/分类对不上 | upc={upc} | 店={shop}'
if verbose:
print(f'[无分类] {msg}')
return None, msg
r = rows[0]
return {
'upccode': r[0],
'product_id': r[1],
'product_name': r[2],
'cat_index_id': r[3],
'poi_id_str': r[4],
'shop_name': r[5],
'tag1': r[6],
'tag1_name': r[7],
'tag2': r[8],
'tag2_name': r[9],
'excel_shop_name': shop,
}, ''
def _item_key(item: dict) -> str:
return f"{item['upccode']}@{item.get('shop_name', '')}"
def lookup_categories_parallel(
items: list[dict],
*,
workers: int = 12,
) -> tuple[list[dict], list[str], list[str]]:
"""多线程并行匹配,比大 SQL JOIN 快得多。items 需含 req_id/upccode/shop_name。"""
if not items:
return [], [], []
total = len(items)
workers = max(1, min(workers, 20))
print(f'[lookup] 并行匹配 {total} 条,线程数={workers}')
sys.stdout.flush()
matched: list[dict] = []
no_product: list[str] = []
no_category: list[str] = []
lock = threading.Lock()
done = 0
def _task(item: dict):
row, err = lookup_category(item['upccode'], item['shop_name'], verbose=False)
return item, row, err
with ThreadPoolExecutor(max_workers=workers) as pool:
futures = [pool.submit(_task, item) for item in items]
for fut in as_completed(futures):
item, row, err = fut.result()
with lock:
done += 1
if row:
row['req_id'] = item['req_id']
matched.append(row)
elif 'productslist无此upccode' in err:
no_product.append(_item_key(item))
else:
no_category.append(_item_key(item))
if done == total or done % 50 == 0:
fail_n = len(no_product) + len(no_category)
print(f'[lookup] 进度 {done}/{total} | 成功 {len(matched)} | 失败 {fail_n}')
sys.stdout.flush()
print(f'[lookup] 完成 | 成功 {len(matched)} | 无商品 {len(no_product)} | 无分类 {len(no_category)}')
return matched, no_product, no_category
def filter_exists(workid: str, poi_id_str, tag1, tag2) -> bool:
sql = f'''
SELECT 1 FROM poi_category_filter
WHERE workid = {_sql_str(workid)}
AND poi_id_str = {_sql_str(poi_id_str)}
AND tag1 = {_sql_str(tag1 or '')}
AND tag2 = {_sql_str(tag2 or '')}
LIMIT 1
'''
return bool(_db_query(sql))
def add_one(upccode: str, shop_name: str, workid: str = TARGET_WORKID) -> bool:
row, _err = lookup_category(upccode, shop_name)
if not row:
return False
print(
f'[匹配] {row["product_name"]} | db店={row["shop_name"]} | '
f'{row["tag1_name"]}/{row["tag2_name"]} | poi={row["poi_id_str"]}'
)
if filter_exists(workid, row['poi_id_str'], row['tag1'], row['tag2']):
print(f'[跳过] workid={workid} 库中已有该店该分类')
return True
data = (
workid,
row['poi_id_str'],
row['shop_name'],
row['tag1'],
row['tag1_name'],
row['tag2'],
row['tag2_name'],
)
_db_write_one(INSERT_SQL, data)
print(f'[写入] poi_category_filter 成功 workid={workid}')
return True
def _parse_line(line: str) -> tuple[str, str] | None:
line = line.strip()
if not line or line.lower() in ('q', 'quit', 'exit'):
return None
if ',' in line or ',' in line:
parts = line.replace(',', ',').split(',', 1)
if len(parts) == 2:
return parts[0].strip(), parts[1].strip()
return None
def main():
workid = TARGET_WORKID
print(f'手动加入 poi_category_filter | workid={workid}')
print('输入格式: upccode,店名 (例: 6971341304543,夜欲情趣成人用品(飞机杯·跳蛋·避孕套))')
print('输入 q 退出\n')
ok, fail = 0, 0
while True:
line = input('>>> ').strip()
if line.lower() in ('q', 'quit', 'exit'):
break
parsed = _parse_line(line)
if parsed:
upc, shop = parsed
else:
upc = line
shop = input('店名: ').strip()
if not upc or not shop:
print('[提示] upccode 和店名都不能为空')
continue
if add_one(upc, shop, workid):
ok += 1
else:
fail += 1
print()
print(f'结束 | 成功/跳过 {ok} | 失败 {fail}')
if __name__ == '__main__':
main()
+146
View File
@@ -0,0 +1,146 @@
import re
import pymysql
class All_Setting():
def __init__(self,host,port,db):
self.host = host
self.port = port
self.db = db
def remove_symbols(self,text):
pattern = re.compile(r'[^\w\s]')
return pattern.sub('', text)
def get_chinese(self,text,printTxt=False):
# text = "海王星辰(广州智慧城店)"
pattern = r'[^\w\s]'
result = re.sub(pattern, '', text)
if printTxt:
print(result)
return result
def get_shoppingmalls(self,sql):
res_list = []
conn = pymysql.connect(
host= self.host, # 我的IP地址
port=self.port, # 不是字符串不需要加引号。
user='root',
password='Aliyun@7646!',
db=self.db,
charset='utf8mb4'
)
if conn:
print('ok')
cursor = conn.cursor()
res = cursor.execute(sql)
c2 = cursor.fetchall()
return c2
def write_data(self,sql,data):
conn = pymysql.connect(
host= self.host, # 我的IP地址
port=self.port, # 不是字符串不需要加引号。
user='root',
password='Aliyun@7646!',
db=self.db,
charset='utf8mb4'
)
# 拿到游标
if conn:
print("连接成功!")
cursor = conn.cursor()
cursor.executemany(sql,data)
conn.commit()
cursor.close()
def update_data(self,sql):
conn = pymysql.connect(
host= self.host, # 我的IP地址
port=self.port, # 不是字符串不需要加引号。
user='root',
password='Aliyun@7646!',
db=self.db,
charset='utf8mb4'
)
# 拿到游标
if conn:
print("连接成功!")
cursor = conn.cursor()
cursor.execute(sql)
conn.commit()
cursor.close()
def write_data_one(self,sql,data):
conn = pymysql.connect(
host= self.host, # 我的IP地址
port=self.port, # 不是字符串不需要加引号。
user='root',
password='Aliyun@7646!',
db=self.db,
charset='utf8mb4'
)
# 拿到游标
if conn:
print("连接成功!")
cursor = conn.cursor()
cursor.execute(sql,data)
conn.commit()
cursor.close()
import json
import time,requests
def get_sign_meituan(url, dfpid, data):
url_mtg = "http://118.89.119.254:18003/mt_jym_1_2"
payload = json.dumps({
"url": url,
"data": data,
"dfpid": dfpid,
"method": "POST",
"ua_type": "android"
})
headers = {
'token': 'j760kynsopjfm0sa9ghjwsd',
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
'Content-Type': 'application/json'
}
response1 = requests.request("POST", url_mtg, headers=headers, data=payload)
print(response1.text)
mtgsig1 = response1.json()
return str(mtgsig1)
def get_sign_waimai(url, dfpid, data):
print('我是外卖mtg')
url_mtg = "http://118.89.119.254:18003/get_mt_tg_0507_jym"
payload = json.dumps({
"url": url,
"data": data,
"dfpid": dfpid,
"method": "POST",
# "ua_type": "android"
})
headers = {
'token': 'j760kynsopjfm0sa9ghjwsd',
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
'Content-Type': 'application/json'
}
response = requests.request("POST", url_mtg, headers=headers, data=payload)
mtgsig = response.json()
print(mtgsig)
return str(mtgsig)
def get_Datatext(dataq):
str1 = ''
for i in dataq:
key, value = i, dataq[i]
str2 = f'{key}={value}&'
str1 = str1 + str2
data = str1[0:-1]
return data
# 名称医乐邦
# 请输入坐标34.268453,117.165798
+217
View File
@@ -0,0 +1,217 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
"""从 Excel 读取 upccode + 店名,支持列字母或列名。"""
import re
from pathlib import Path
import pandas as pd
# ==================== 运行参数(单独测试时改这里) ====================
EXCEL_PATH = Path(__file__).resolve().parent / '周一需求.xlsx'
UPC_COLUMN = 'F'
SHOP_COLUMN = 'E'
DEDUPE = True # 按 (upccode, shop_name) 去重
# ====================================================================
_COL_LETTER_RE = re.compile(r'^[A-Za-z]{1,3}$')
_SHOP_HEADER_WORDS = {'小美门店名称', '门店名称', 'shop_name', '店名'}
def _col_letter_to_index(letter: str) -> int:
idx = 0
for ch in letter.strip().upper():
idx = idx * 26 + (ord(ch) - ord('A') + 1)
return idx - 1
def _is_col_letter(column: str) -> bool:
return bool(_COL_LETTER_RE.fullmatch(column.strip()))
def normalize_shop_name(value) -> str | None:
if value is None or (isinstance(value, float) and pd.isna(value)):
return None
text = str(value).strip()
if not text or text.lower() in ('nan', 'none', 'null'):
return None
if text in _SHOP_HEADER_WORDS:
return None
text = text.replace('(', '(').replace(')', ')').replace(' ', '')
return text or None
def _normalize_upccode(value) -> str | None:
if value is None or (isinstance(value, float) and pd.isna(value)):
return None
if isinstance(value, float):
if not value.is_integer():
return None
text = str(int(value))
elif isinstance(value, int):
text = str(value)
else:
text = str(value).strip()
if not text or text.lower() in ('nan', 'none', 'null'):
return None
if re.fullmatch(r'-?\d+\.?\d*e[+-]?\d+', text, flags=re.I):
try:
num = int(float(text))
if float(num) != float(text):
return None
text = str(num)
except (ValueError, OverflowError):
return None
if text.endswith('.0') and text[:-2].isdigit():
text = text[:-2]
if not text.isdigit():
return None
return text
def _load_excel(file_path: str | Path) -> pd.DataFrame:
path = Path(file_path)
if not path.exists():
raise FileNotFoundError(f'Excel 文件不存在: {path}')
return pd.read_excel(path, dtype=object, header=None)
def _read_series_by_column(df: pd.DataFrame, column: str) -> pd.Series:
col = column.strip()
if _is_col_letter(col):
idx = _col_letter_to_index(col)
if idx >= df.shape[1]:
raise KeyError(f'列字母 "{col.upper()}" 超出范围,当前共 {df.shape[1]} 列')
return df.iloc[:, idx]
if col in df.columns:
return df[col]
col_map = {str(c).strip(): c for c in df.columns}
if col in col_map:
return df[col_map[col]]
raise KeyError(f'列 "{column}" 不存在,当前列: {list(df.columns)}')
def read_upccode_shop_from_excel(
file_path: str | Path,
upc_column: str,
shop_column: str,
*,
dedupe: bool = True,
) -> list[dict]:
"""
读取 upccode + 店名。
Returns:
[{'upccode': '697...', 'shop_name': '夜欲情趣...'}, ...]
"""
df = _load_excel(file_path)
upc_series = _read_series_by_column(df, upc_column)
shop_series = _read_series_by_column(df, shop_column)
seen = set()
result = []
for upc_val, shop_val in zip(upc_series.tolist(), shop_series.tolist()):
upccode = _normalize_upccode(upc_val)
shop_name = normalize_shop_name(shop_val)
if not upccode or not shop_name:
continue
key = (upccode, shop_name)
if dedupe:
if key in seen:
continue
seen.add(key)
result.append({'upccode': upccode, 'shop_name': shop_name})
return result
def read_upccodes_from_excel(
file_path: str | Path,
column: str,
*,
dedupe: bool = True,
) -> list[str]:
"""仅读 upccode 列(兼容旧用法)。"""
df = _load_excel(file_path)
series = _read_series_by_column(df, column)
seen = set()
result = []
for value in series.tolist():
code = _normalize_upccode(value)
if not code:
continue
if dedupe:
if code in seen:
continue
seen.add(code)
result.append(code)
return result
def read_upccode_shop_from_excel_stats(
file_path: str | Path,
upc_column: str,
shop_column: str,
*,
dedupe: bool = True,
) -> dict:
df = _load_excel(file_path)
upc_series = _read_series_by_column(df, upc_column)
shop_series = _read_series_by_column(df, shop_column)
valid_pairs = []
invalid = 0
for upc_val, shop_val in zip(upc_series.tolist(), shop_series.tolist()):
upccode = _normalize_upccode(upc_val)
shop_name = normalize_shop_name(shop_val)
if upccode and shop_name:
valid_pairs.append((upccode, shop_name))
else:
invalid += 1
items = read_upccode_shop_from_excel(
file_path, upc_column, shop_column, dedupe=dedupe
)
return {
'total_rows': len(upc_series),
'valid_count': len(valid_pairs),
'invalid_count': invalid,
'unique_upccode_count': len({x[0] for x in valid_pairs}),
'unique_pair_count': len(set(valid_pairs)),
'result_count': len(items),
'items': items,
}
def main():
stats = read_upccode_shop_from_excel_stats(
EXCEL_PATH, UPC_COLUMN, SHOP_COLUMN, dedupe=DEDUPE
)
print(f'文件: {EXCEL_PATH}')
print(f'upccode列: {UPC_COLUMN} | 店名列: {SHOP_COLUMN}')
print(f'Excel 总行数: {stats["total_rows"]}')
print(f'有效行(upc+店名): {stats["valid_count"]}(无效/表头/空: {stats["invalid_count"]})')
print(f'不重复 upccode: {stats["unique_upccode_count"]}')
print(f'不重复 (upccode+店名): {stats["unique_pair_count"]}')
print(f'本次返回: {stats["result_count"]} 条(dedupe={DEDUPE})')
for row in stats['items'][:10]:
print(f" {row['upccode']} | {row['shop_name']}")
if stats['result_count'] > 10:
print(f'... 还有 {stats["result_count"] - 10} 条')
if __name__ == '__main__':
main()
+389
View File
@@ -0,0 +1,389 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
"""根据 upccode + 店名 反查分类,写入 poi_category_filter 黑名单(重复自动跳过)。"""
import datetime
import io
import re
import sys
from contextlib import redirect_stdout
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent / 'run2_请求products'
sys.path.insert(0, str(ROOT))
import newsetting as ten
from read_upccode_excel import normalize_shop_name, read_upccode_shop_from_excel
# ==================== 运行参数(改这里) ====================
TARGET_WORKID = str(datetime.date.today()).replace('-', '')
DRY_RUN = False # True=只预览不写库
USE_EXCEL = True
EXCEL_PATH = Path(__file__).resolve().parent / '周一需求.xlsx'
UPC_COLUMN = 'F'
SHOP_COLUMN = 'E'
EXCEL_DEDUPE = True
SHOW_EACH = True
SHOW_OK_ONLY = False
BATCH_SIZE = 200 # 每批 SQL 条数,太大可能超 MySQL 包长度
PREVIEW_LIMIT = 30
# ============================================================
tent = ten.All_Setting(host='183.6.7.91', port=23016, db='pyui_all_market')
INSERT_SQL = '''
INSERT IGNORE INTO poi_category_filter
(workid, poi_id_str, shop_name, tag1, tag1_name, tag2, tag2_name)
VALUES (%s, %s, %s, %s, %s, %s, %s)
'''
_SHOP_NORM_SQL = "REPLACE(REPLACE(REPLACE(c.shop_name,'(','('),')',')'),' ','')"
def _short(text, n=18) -> str:
text = str(text or '')
return text if len(text) <= n else text[:n] + '...'
def _sql_str(value) -> str:
return "'" + str(value).replace("'", "''") + "'"
def _db_query(sql: str):
buf = io.StringIO()
with redirect_stdout(buf):
return tent.get_shoppingmalls(sql)
def _db_write(sql: str, data):
buf = io.StringIO()
with redirect_stdout(buf):
tent.write_data(sql, data)
def parse_upccodes(text: str) -> list[str]:
parts = re.split(r'[\s,,;;\n\r\t]+', text.strip())
seen = set()
result = []
for p in parts:
code = p.strip()
if not code or code in seen:
continue
seen.add(code)
result.append(code)
return result
def _normalize_items(items: list[str] | list[dict]) -> list[dict]:
result = []
for i, item in enumerate(items, 1):
if isinstance(item, dict):
upccode = str(item.get('upccode', '')).strip()
raw_shop = item.get('shop_name')
shop_name = normalize_shop_name(raw_shop) if raw_shop else ''
req_id = item.get('req_id', i)
if upccode:
result.append({'req_id': req_id, 'upccode': upccode, 'shop_name': shop_name})
else:
code = str(item).strip()
if code:
result.append({'req_id': i, 'upccode': code, 'shop_name': ''})
return result
def _item_key(item: dict) -> str:
shop = item.get('shop_name') or ''
return f"{item['upccode']}@{shop}"
def _build_req_cte(batch: list[dict]) -> str:
parts = []
for item in batch:
parts.append(
f"SELECT {item['req_id']} AS req_id, "
f"{_sql_str(item['upccode'])} AS upccode, "
f"{_sql_str(item['shop_name'])} AS shop_name"
)
return ' UNION ALL '.join(parts)
def _lookup_batch_sql(batch: list[dict]) -> str:
req_cte = _build_req_cte(batch)
shop_match = f'''(
({_SHOP_NORM_SQL} = req.shop_name
OR c.shop_name LIKE CONCAT('%', LEFT(req.shop_name, 20), '%')
OR req.shop_name LIKE CONCAT('%', {_SHOP_NORM_SQL}, '%'))
OR req.shop_name = ''
)'''
product_match = '''(
c.index_id = p.parent2_id
OR (
c.allSortedSpuId IS NOT NULL
AND c.allSortedSpuId != 'null'
AND (
JSON_CONTAINS(c.allSortedSpuId, CAST(p.product_id AS JSON), '$')
OR JSON_CONTAINS(c.allSortedSpuId, JSON_QUOTE(p.product_id), '$')
OR c.allSortedSpuId LIKE CONCAT('%"', p.product_id, '"%')
OR c.allSortedSpuId LIKE CONCAT('%', p.product_id, '%')
)
)
)'''
return f'''
WITH req AS (
{req_cte}
),
matched AS (
SELECT
req.req_id,
req.upccode,
req.shop_name AS excel_shop_name,
p.product_id,
p.product_name,
p.poi_id_str AS prod_poi,
p.tag2_id,
p.parent2_id,
c.index_id AS cat_index_id,
c.poi_id_str,
c.shop_name,
c.tag1,
c.tag1_name,
c.tag2,
c.tag2_name,
c.workid AS cat_workid,
c.batch AS cat_batch,
c.update_time,
ROW_NUMBER() OVER (
PARTITION BY req.req_id
ORDER BY p.`index` DESC, c.update_time DESC, c.index_id DESC
) AS rn
FROM req
INNER JOIN productslist p ON p.upccode = req.upccode
INNER JOIN categorylist2 c
ON c.poi_id_str = p.poi_id_str
AND {shop_match}
AND {product_match}
)
SELECT
req_id, upccode, excel_shop_name, product_id, product_name, prod_poi,
tag2_id, parent2_id, cat_index_id, poi_id_str, shop_name,
tag1, tag1_name, tag2, tag2_name, cat_workid, cat_batch, update_time
FROM matched
WHERE rn = 1
'''
def _row_to_match(r) -> dict:
return {
'req_id': r[0],
'upccode': r[1],
'excel_shop_name': r[2],
'product_id': r[3],
'product_name': r[4],
'prod_poi': r[5],
'tag2_id': r[6],
'parent2_id': r[7],
'cat_index_id': r[8],
'poi_id_str': r[9],
'shop_name': r[10],
'tag1': r[11],
'tag1_name': r[12],
'tag2': r[13],
'tag2_name': r[14],
'cat_workid': r[15],
'cat_batch': r[16],
'update_time': r[17],
}
def _fetch_existing_upccodes(upccodes: list[str]) -> set[str]:
if not upccodes:
return set()
in_clause = ','.join(_sql_str(c) for c in upccodes)
sql = f'SELECT DISTINCT upccode FROM productslist WHERE upccode IN ({in_clause})'
rows = _db_query(sql)
return {str(r[0]) for r in rows}
def lookup_categories(items: list[str] | list[dict]) -> tuple[list[dict], list[str], list[str]]:
norm_items = _normalize_items(items)
if not norm_items:
return [], [], []
total = len(norm_items)
print(f'[lookup] 批量匹配开始,共 {total} 条,每批 {BATCH_SIZE} 条')
if DRY_RUN:
print('[dry_run] 当前为预览模式,匹配后会显示待写入条数,但不会写库')
sys.stdout.flush()
all_upccodes = [x['upccode'] for x in norm_items]
has_product = _fetch_existing_upccodes(all_upccodes)
matched_map: dict[int, dict] = {}
for start in range(0, total, BATCH_SIZE):
batch = norm_items[start:start + BATCH_SIZE]
batch_no = start // BATCH_SIZE + 1
batch_total = (total + BATCH_SIZE - 1) // BATCH_SIZE
print(f'[lookup] 查询第 {batch_no}/{batch_total} 批 ({len(batch)} 条)...')
sys.stdout.flush()
try:
rows = _db_query(_lookup_batch_sql(batch))
except Exception as e:
print(f'[lookup] 第 {batch_no} 批 SQL 出错: {e}')
raise
print(f'[lookup] 第 {batch_no} 批命中 {len(rows)} 条')
for r in rows:
item = _row_to_match(r)
matched_map[item['req_id']] = item
matched = []
no_product = []
no_category = []
for idx, item in enumerate(norm_items, 1):
upccode = item['upccode']
shop_name = item.get('shop_name') or '-'
if upccode not in has_product:
no_product.append(_item_key(item))
if SHOW_EACH and not SHOW_OK_ONLY:
print(f'[{idx}/{total}] 无商品 | {upccode} | {_short(shop_name)}')
continue
row = matched_map.get(item['req_id'])
if row:
matched.append(row)
if SHOW_EACH:
print(
f'[{idx}/{total}] 成功 | {upccode} | {_short(shop_name)} -> '
f'{row["tag1_name"]}/{row["tag2_name"]} | poi={row["poi_id_str"]}'
)
else:
no_category.append(_item_key(item))
if SHOW_EACH and not SHOW_OK_ONLY:
print(f'[{idx}/{total}] 无分类 | {upccode} | {_short(shop_name)}')
print(
f'[lookup] 完成 | 成功 {len(matched)} | 无商品 {len(no_product)} | 无分类 {len(no_category)}'
)
return matched, no_product, no_category
def dedupe_filter_rows(matched: list[dict], workid: str) -> list[dict]:
seen = set()
result = []
for item in matched:
key = (workid, str(item['poi_id_str']), str(item['tag1'] or ''), str(item['tag2'] or ''))
if key in seen:
continue
seen.add(key)
result.append(item)
return result
def get_existing_keys(workid: str, rows: list[dict]) -> set[tuple]:
if not rows:
return set()
poi_list = ','.join(_sql_str(r['poi_id_str']) for r in rows)
sql = f'''
SELECT poi_id_str, tag1, tag2
FROM poi_category_filter
WHERE workid = {_sql_str(workid)}
AND poi_id_str IN ({poi_list})
'''
exist = _db_query(sql)
return {(str(r[0]), str(r[1] or ''), str(r[2] or '')) for r in exist}
def insert_filter_rows(matched: list[dict], workid: str) -> tuple[int, int, int]:
unique_rows = dedupe_filter_rows(matched, workid)
batch_dup = len(matched) - len(unique_rows)
existing = get_existing_keys(workid, unique_rows)
to_insert = []
already_in_db = 0
for item in unique_rows:
key = (str(item['poi_id_str']), str(item['tag1'] or ''), str(item['tag2'] or ''))
if key in existing:
already_in_db += 1
continue
to_insert.append((
workid,
item['poi_id_str'],
item['shop_name'],
item['tag1'],
item['tag1_name'],
item['tag2'],
item['tag2_name'],
))
if DRY_RUN:
print(f'[dry_run] 待写入 {len(to_insert)} 条,库中已有 {already_in_db} 条,本批重复 {batch_dup} 条')
print('[dry_run] 要真正写入,请设 DRY_RUN = False')
return len(to_insert), already_in_db, batch_dup
if to_insert:
_db_write(INSERT_SQL, to_insert)
print(f'[db] 已写入 poi_category_filter {len(to_insert)} 条 (workid={workid})')
else:
print(f'[db] 无需写入,库中已有 {already_in_db} 条,本批重复 {batch_dup} 条')
return len(to_insert), already_in_db, batch_dup
def print_matched_preview(matched: list[dict], workid: str):
print(f'\n--- 匹配预览 (workid={workid}),共 {len(matched)} 条,展示前 {min(len(matched), PREVIEW_LIMIT)} 条 ---')
for i, item in enumerate(matched[:PREVIEW_LIMIT], 1):
excel_shop = item.get('excel_shop_name') or '-'
print(
f'{i}. upccode={item["upccode"]} | excel店={excel_shop} | db店={item["shop_name"]} | '
f'{item["tag1_name"]}/{item["tag2_name"]} | poi={item["poi_id_str"]} tag2={item["tag2"]}'
)
if len(matched) > PREVIEW_LIMIT:
print(f'... 还有 {len(matched) - PREVIEW_LIMIT} 条未展示')
def main():
workid = TARGET_WORKID
if USE_EXCEL:
items = read_upccode_shop_from_excel(
EXCEL_PATH, UPC_COLUMN, SHOP_COLUMN, dedupe=EXCEL_DEDUPE
)
print(f'Excel: {EXCEL_PATH}')
print(f'upccode列={UPC_COLUMN}, 店名列={SHOP_COLUMN}, 共 {len(items)} 条')
else:
upccodes = parse_upccodes(input('请输入upccode: ').strip())
items = [{'upccode': c, 'shop_name': None} for c in upccodes]
print(f'手动输入 {len(items)} 个 upccode(无店名)')
if not items:
print('没有可处理的数据,退出')
return
print(f'目标 workid={workid} | DRY_RUN={DRY_RUN}')
matched, no_product, no_category = lookup_categories(items)
print_matched_preview(matched, workid)
if no_product:
print(f'\n[无商品记录] ({len(no_product)}): {no_product[:10]}')
if no_category:
print(f'\n[无分类记录] ({len(no_category)}): {no_category[:10]}')
if not matched:
print('\n没有可写入的数据')
return
inserted, skipped_db, skipped_batch = insert_filter_rows(matched, workid)
print(
f'\n[完成] 新增 {inserted} 条 | 库中已存在跳过 {skipped_db} 条 | '
f'本批分类重复跳过 {skipped_batch} 条'
)
if __name__ == '__main__':
main()
Binary file not shown.
+142
View File
@@ -0,0 +1,142 @@
workid=20260620
失败共 139 条
[5] upccode=6932275402156 | 店名=夜欲情趣成人用品(飞机杯·跳蛋·避孕套) | 有商品但店名/分类对不上 | upc=6932275402156 | 店=夜欲情趣成人用品(飞机杯·跳蛋·避孕套)
[8] upccode=4547691439611 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=4547691439611 | 店=贪玩计划情趣成人用品(B12北京店)
[19] upccode=6970960521379 | 店名=夜欲情趣成人用品(飞机杯·跳蛋·避孕套) | 有商品但店名/分类对不上 | upc=6970960521379 | 店=夜欲情趣成人用品(飞机杯·跳蛋·避孕套)
[23] upccode=6923146100011 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146100011 | 店=贪玩计划情趣成人用品(B12北京店)
[24] upccode=4547691783387 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=4547691783387 | 店=贪玩计划情趣成人用品(B12北京店)
[26] upccode=6937486613865 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6937486613865 | 店=贪玩计划情趣成人用品(B12北京店)
[27] upccode=6923146102015 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146102015 | 店=贪玩计划情趣成人用品(B12北京店)
[31] upccode=4547691239129 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=4547691239129 | 店=贪玩计划情趣成人用品(B12北京店)
[32] upccode=6978427205268 | 店名=夜欲情趣成人用品(飞机杯·跳蛋·避孕套) | 有商品但店名/分类对不上 | upc=6978427205268 | 店=夜欲情趣成人用品(飞机杯·跳蛋·避孕套)
[33] upccode=6923250800678 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923250800678 | 店=贪玩计划情趣成人用品(B12北京店)
[34] upccode=4547691791696 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=4547691791696 | 店=贪玩计划情趣成人用品(B12北京店)
[35] upccode=6970130912167 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6970130912167 | 店=贪玩计划情趣成人用品(B12北京店)
[36] upccode=6923250800685 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923250800685 | 店=贪玩计划情趣成人用品(B12北京店)
[40] upccode=6923146105016 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146105016 | 店=贪玩计划情趣成人用品(B12北京店)
[48] upccode=6974408087052 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=6974408087052 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[52] upccode=6970960521379 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=6970960521379 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[55] upccode=6927099414362 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6927099414362 | 店=贪玩计划情趣成人用品(B12北京店)
[58] upccode=5521621239082 | 店名=夜欲情趣成人用品(飞机杯·跳蛋·避孕套) | productslist无此upccode: 5521621239082
[60] upccode=6973974749036 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6973974749036 | 店=贪玩计划情趣成人用品(B12北京店)
[62] upccode=6923146100615 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146100615 | 店=贪玩计划情趣成人用品(B12北京店)
[63] upccode=6936296774032 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6936296774032 | 店=贪玩计划情趣成人用品(B12北京店)
[65] upccode=6972731071199 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6972731071199 | 店=贪玩计划情趣成人用品(B12北京店)
[68] upccode=6923146107089 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146107089 | 店=贪玩计划情趣成人用品(B12北京店)
[69] upccode=6923146107089 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=6923146107089 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[70] upccode=6927099412108 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6927099412108 | 店=贪玩计划情趣成人用品(B12北京店)
[71] upccode=2923140105016 | 店名=夜欲情趣成人用品(飞机杯·跳蛋·避孕套) | productslist无此upccode: 2923140105016
[75] upccode=6971341300569 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6971341300569 | 店=贪玩计划情趣成人用品(B12北京店)
[80] upccode=6923146100370 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146100370 | 店=贪玩计划情趣成人用品(B12北京店)
[83] upccode=6974214220575 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6974214220575 | 店=贪玩计划情趣成人用品(B12北京店)
[85] upccode=6936296771512 | 店名=夜欲情趣成人用品(飞机杯·跳蛋·避孕套) | 有商品但店名/分类对不上 | upc=6936296771512 | 店=夜欲情趣成人用品(飞机杯·跳蛋·避孕套)
[88] upccode=6923146100394 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146100394 | 店=贪玩计划情趣成人用品(B12北京店)
[90] upccode=6970556031923 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6970556031923 | 店=贪玩计划情趣成人用品(B12北京店)
[91] upccode=6973974744451 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6973974744451 | 店=贪玩计划情趣成人用品(B12北京店)
[95] upccode=6923146100912 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146100912 | 店=贪玩计划情趣成人用品(B12北京店)
[96] upccode=6932564452596 | 店名=夜欲情趣成人用品(飞机杯·跳蛋·避孕套) | 有商品但店名/分类对不上 | upc=6932564452596 | 店=夜欲情趣成人用品(飞机杯·跳蛋·避孕套)
[97] upccode=6927099407623 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6927099407623 | 店=贪玩计划情趣成人用品(B12北京店)
[99] upccode=6973974744451 | 店名=夜欲情趣成人用品(飞机杯·跳蛋·避孕套) | 有商品但店名/分类对不上 | upc=6973974744451 | 店=夜欲情趣成人用品(飞机杯·跳蛋·避孕套)
[101] upccode=6923146100912 | 店名=夜欲情趣成人用品(飞机杯·跳蛋·避孕套) | 有商品但店名/分类对不上 | upc=6923146100912 | 店=夜欲情趣成人用品(飞机杯·跳蛋·避孕套)
[106] upccode=6973872500074 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6973872500074 | 店=贪玩计划情趣成人用品(B12北京店)
[110] upccode=6923146100028 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146100028 | 店=贪玩计划情趣成人用品(B12北京店)
[117] upccode=6973974749142 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6973974749142 | 店=贪玩计划情趣成人用品(B12北京店)
[119] upccode=4547691439628 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=4547691439628 | 店=贪玩计划情趣成人用品(B12北京店)
[120] upccode=6927099421698 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6927099421698 | 店=贪玩计划情趣成人用品(B12北京店)
[122] upccode=6926079595787 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=6926079595787 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[124] upccode=6970556032838 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=6970556032838 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[128] upccode=6977465904003 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=6977465904003 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[131] upccode=6932564457140 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6932564457140 | 店=贪玩计划情趣成人用品(B12北京店)
[135] upccode=6932564420045 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6932564420045 | 店=贪玩计划情趣成人用品(B12北京店)
[137] upccode=4547691239099 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=4547691239099 | 店=贪玩计划情趣成人用品(B12北京店)
[141] upccode=6932564453371 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6932564453371 | 店=贪玩计划情趣成人用品(B12北京店)
[142] upccode=6975488695274 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6975488695274 | 店=贪玩计划情趣成人用品(B12北京店)
[143] upccode=6973974749364 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6973974749364 | 店=贪玩计划情趣成人用品(B12北京店)
[147] upccode=6976309821513 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6976309821513 | 店=贪玩计划情趣成人用品(B12北京店)
[153] upccode=6923146102046 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146102046 | 店=贪玩计划情趣成人用品(B12北京店)
[154] upccode=6973193040198 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6973193040198 | 店=贪玩计划情趣成人用品(B12北京店)
[158] upccode=6923250800920 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923250800920 | 店=贪玩计划情趣成人用品(B12北京店)
[161] upccode=6976978540272 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6976978540272 | 店=贪玩计划情趣成人用品(B12北京店)
[165] upccode=6923250800982 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923250800982 | 店=贪玩计划情趣成人用品(B12北京店)
[168] upccode=4547691439628 | 店名=夜欲情趣成人用品(飞机杯·跳蛋·避孕套) | 有商品但店名/分类对不上 | upc=4547691439628 | 店=夜欲情趣成人用品(飞机杯·跳蛋·避孕套)
[169] upccode=6971298380218 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6971298380218 | 店=贪玩计划情趣成人用品(B12北京店)
[175] upccode=4547691810885 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=4547691810885 | 店=贪玩计划情趣成人用品(B12北京店)
[180] upccode=4547691239129 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=4547691239129 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[182] upccode=4547691689702 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=4547691689702 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[183] upccode=6975488695274 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=6975488695274 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[184] upccode=6973974741405 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6973974741405 | 店=贪玩计划情趣成人用品(B12北京店)
[185] upccode=6932564452596 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6932564452596 | 店=贪玩计划情趣成人用品(B12北京店)
[186] upccode=6973974742976 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6973974742976 | 店=贪玩计划情趣成人用品(B12北京店)
[187] upccode=6953123500756 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6953123500756 | 店=贪玩计划情趣成人用品(B12北京店)
[189] upccode=6973974743201 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=6973974743201 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[192] upccode=6923146100691 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146100691 | 店=贪玩计划情趣成人用品(B12北京店)
[193] upccode=6923146100585 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6923146100585 | 店=贪玩计划情趣成人用品(B12北京店)
[196] upccode=4547691783387 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=4547691783387 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[205] upccode=6932564453609 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6932564453609 | 店=贪玩计划情趣成人用品(B12北京店)
[218] upccode=6953123500749 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=6953123500749 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[219] upccode=6977465904003 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6977465904003 | 店=贪玩计划情趣成人用品(B12北京店)
[221] upccode=6953123500749 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6953123500749 | 店=贪玩计划情趣成人用品(B12北京店)
[222] upccode=6932564457133 | 店名=董小姐情趣成人用品(飞机杯跳蛋情趣内衣) | 有商品但店名/分类对不上 | upc=6932564457133 | 店=董小姐情趣成人用品(飞机杯跳蛋情趣内衣)
[226] upccode=6973974747193 | 店名=贪玩计划情趣成人用品(B12北京店) | 有商品但店名/分类对不上 | upc=6973974747193 | 店=贪玩计划情趣成人用品(B12北京店)
[242] upccode=100106547338 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | productslist无此upccode: 100106547338
[243] upccode=6970960520723 | 店名=愉羞情趣成人用品(避孕套·情趣内衣·飞机杯) | 有商品但店名/分类对不上 | upc=6970960520723 | 店=愉羞情趣成人用品(避孕套·情趣内衣·飞机杯)
[245] upccode=4547691239136 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=4547691239136 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[246] upccode=6976309820561 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6976309820561 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[247] upccode=6974408087052 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6974408087052 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[249] upccode=6923146102046 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6923146102046 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[250] upccode=100106547338 | 店名=愉羞情趣成人用品(避孕套·情趣内衣·飞机杯) | productslist无此upccode: 100106547338
[253] upccode=6923146100370 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6923146100370 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[261] upccode=6932564454224 | 店名=愉羞情趣成人用品(避孕套·情趣内衣·飞机杯) | 有商品但店名/分类对不上 | upc=6932564454224 | 店=愉羞情趣成人用品(避孕套·情趣内衣·飞机杯)
[262] upccode=6971298380003 | 店名=愉羞情趣成人用品(避孕套·情趣内衣·飞机杯) | productslist无此upccode: 6971298380003
[263] upccode=6926079595787 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6926079595787 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[266] upccode=6976309821513 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6976309821513 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[269] upccode=6976309821100 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6976309821100 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[272] upccode=5521621239082 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | productslist无此upccode: 5521621239082
[274] upccode=6974408085607 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6974408085607 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[276] upccode=6974408080794 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6974408080794 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[278] upccode=5521621239082 | 店名=愉羞情趣成人用品(避孕套·情趣内衣·飞机杯) | productslist无此upccode: 5521621239082
[283] upccode=6978427205268 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6978427205268 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[284] upccode=6923146105016 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6923146105016 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[286] upccode=6971298380003 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | productslist无此upccode: 6971298380003
[288] upccode=6937486613865 | 店名=考拉可可情趣成人用品(避孕套·飞机杯·跳蛋·海昌店) | 有商品但店名/分类对不上 | upc=6937486613865 | 店=考拉可可情趣成人用品(避孕套·飞机杯·跳蛋·海昌店)
[289] upccode=6970960520402 | 店名=董小姐情趣成人用品(喷剂·验孕棒·杜蕾斯避孕套) | 有商品但店名/分类对不上 | upc=6970960520402 | 店=董小姐情趣成人用品(喷剂·验孕棒·杜蕾斯避孕套)
[290] upccode=6932564457737 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6932564457737 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[291] upccode=4547691689696 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=4547691689696 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[296] upccode=6970556032838 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6970556032838 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[297] upccode=6976309822114 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6976309822114 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[298] upccode=6932564457393 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6932564457393 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[299] upccode=9999900390889 | 店名=愉羞情趣成人用品(避孕套·情趣内衣·飞机杯) | productslist无此upccode: 9999900390889
[306] upccode=6978427201031 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6978427201031 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[309] upccode=6933977227146 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6933977227146 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[312] upccode=6932564452596 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6932564452596 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[314] upccode=6923146100011 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6923146100011 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[315] upccode=6971341306103 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6971341306103 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[318] upccode=6971341300569 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6971341300569 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[321] upccode=6932564453371 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6932564453371 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[323] upccode=6970960521379 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6970960521379 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[325] upccode=6972731071199 | 店名=董小姐情趣成人用品(喷剂·验孕棒·杜蕾斯避孕套) | 有商品但店名/分类对不上 | upc=6972731071199 | 店=董小姐情趣成人用品(喷剂·验孕棒·杜蕾斯避孕套)
[329] upccode=6932564454224 | 店名=董小姐情趣成人用品(喷剂·验孕棒·杜蕾斯避孕套) | 有商品但店名/分类对不上 | upc=6932564454224 | 店=董小姐情趣成人用品(喷剂·验孕棒·杜蕾斯避孕套)
[330] upccode=6971298387798 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6971298387798 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[335] upccode=8850956133350 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=8850956133350 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[336] upccode=6970556031923 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6970556031923 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[338] upccode=6932564457829 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6932564457829 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[339] upccode=6973974743201 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6973974743201 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[340] upccode=6970960520723 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6970960520723 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[341] upccode=6928076668679 | 店名=考拉可可情趣成人用品(避孕套·飞机杯·跳蛋·海昌店) | productslist无此upccode: 6928076668679
[343] upccode=6923146100691 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6923146100691 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[347] upccode=6926970852194 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6926970852194 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[348] upccode=6936296754591 | 店名=董小姐情趣成人用品(喷剂·验孕棒·杜蕾斯避孕套) | 有商品但店名/分类对不上 | upc=6936296754591 | 店=董小姐情趣成人用品(喷剂·验孕棒·杜蕾斯避孕套)
[349] upccode=6923146100585 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6923146100585 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[353] upccode=6928076668679 | 店名=愉羞情趣成人用品(避孕套·情趣内衣·飞机杯) | productslist无此upccode: 6928076668679
[356] upccode=6936296771512 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6936296771512 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[360] upccode=6932564453609 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6932564453609 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[361] upccode=6970960520211 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6970960520211 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[365] upccode=6936296771512 | 店名=考拉可可情趣成人用品(避孕套·飞机杯·跳蛋·海昌店) | 有商品但店名/分类对不上 | upc=6936296771512 | 店=考拉可可情趣成人用品(避孕套·飞机杯·跳蛋·海昌店)
[366] upccode=6927099412108 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6927099412108 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[369] upccode=6932564454224 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6932564454224 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[374] upccode=6973974744451 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6973974744451 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[377] upccode=6970556032838 | 店名=董小姐情趣成人用品(喷剂·验孕棒·杜蕾斯避孕套) | 有商品但店名/分类对不上 | upc=6970556032838 | 店=董小姐情趣成人用品(喷剂·验孕棒·杜蕾斯避孕套)
[378] upccode=6923146100912 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6923146100912 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[379] upccode=6936296754591 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | 有商品但店名/分类对不上 | upc=6936296754591 | 店=喜悦月光情书(飞机杯.跳蛋.避孕套)
[385] upccode=6928076668679 | 店名=喜悦月光情书(飞机杯.跳蛋.避孕套) | productslist无此upccode: 6928076668679