mirror of
https://github.com/zhinianboke/xianyu-auto-reply.git
synced 2025-08-30 09:37:35 +08:00
多数量发货
This commit is contained in:
parent
d5ae0488b5
commit
a01648012b
@ -173,7 +173,7 @@ class XianyuLive:
|
|||||||
# 通知防重复机制
|
# 通知防重复机制
|
||||||
self.last_notification_time = {} # 记录每种通知类型的最后发送时间
|
self.last_notification_time = {} # 记录每种通知类型的最后发送时间
|
||||||
self.notification_cooldown = 300 # 5分钟内不重复发送相同类型的通知
|
self.notification_cooldown = 300 # 5分钟内不重复发送相同类型的通知
|
||||||
self.token_refresh_notification_cooldown = 10800 # Token刷新异常通知冷却时间:3小时
|
self.token_refresh_notification_cooldown = 18000 # Token刷新异常通知冷却时间:3小时
|
||||||
|
|
||||||
# 自动发货防重复机制
|
# 自动发货防重复机制
|
||||||
self.last_delivery_time = {} # 记录每个商品的最后发货时间
|
self.last_delivery_time = {} # 记录每个商品的最后发货时间
|
||||||
|
@ -277,6 +277,15 @@ class DBManager:
|
|||||||
)
|
)
|
||||||
''')
|
''')
|
||||||
|
|
||||||
|
# 检查并添加 multi_quantity_delivery 列(用于多数量发货功能)
|
||||||
|
try:
|
||||||
|
self._execute_sql(cursor, "SELECT multi_quantity_delivery FROM item_info LIMIT 1")
|
||||||
|
except sqlite3.OperationalError:
|
||||||
|
# multi_quantity_delivery 列不存在,需要添加
|
||||||
|
logger.info("正在为 item_info 表添加 multi_quantity_delivery 列...")
|
||||||
|
self._execute_sql(cursor, "ALTER TABLE item_info ADD COLUMN multi_quantity_delivery BOOLEAN DEFAULT FALSE")
|
||||||
|
logger.info("item_info 表 multi_quantity_delivery 列添加完成")
|
||||||
|
|
||||||
# 创建自动发货规则表
|
# 创建自动发货规则表
|
||||||
cursor.execute('''
|
cursor.execute('''
|
||||||
CREATE TABLE IF NOT EXISTS delivery_rules (
|
CREATE TABLE IF NOT EXISTS delivery_rules (
|
||||||
|
@ -58,7 +58,7 @@ MANUAL_MODE:
|
|||||||
timeout: 3600
|
timeout: 3600
|
||||||
toggle_keywords: []
|
toggle_keywords: []
|
||||||
MESSAGE_EXPIRE_TIME: 300000
|
MESSAGE_EXPIRE_TIME: 300000
|
||||||
TOKEN_REFRESH_INTERVAL: 7200 # 从3600秒(1小时)增加到7200秒(2小时)
|
TOKEN_REFRESH_INTERVAL: 18000 # 从3600秒(1小时)增加到18000秒(5小时)
|
||||||
TOKEN_RETRY_INTERVAL: 1800 # 从300秒(5分钟)增加到1800秒(30分钟)
|
TOKEN_RETRY_INTERVAL: 1800 # 从300秒(5分钟)增加到1800秒(30分钟)
|
||||||
WEBSOCKET_HEADERS:
|
WEBSOCKET_HEADERS:
|
||||||
Accept-Encoding: gzip, deflate, br, zstd
|
Accept-Encoding: gzip, deflate, br, zstd
|
||||||
|
@ -445,10 +445,16 @@ class OrderDetailFetcher:
|
|||||||
# 从数量内容中提取数量值(使用冒号分割,取后面的值)
|
# 从数量内容中提取数量值(使用冒号分割,取后面的值)
|
||||||
if ':' in quantity_content:
|
if ':' in quantity_content:
|
||||||
quantity_value = quantity_content.split(':', 1)[1].strip()
|
quantity_value = quantity_content.split(':', 1)[1].strip()
|
||||||
|
# 去掉数量值前面的 'x' 符号(如 "x2" -> "2")
|
||||||
|
if quantity_value.startswith('x'):
|
||||||
|
quantity_value = quantity_value[1:]
|
||||||
result['quantity'] = quantity_value
|
result['quantity'] = quantity_value
|
||||||
logger.info(f"提取到数量: {quantity_value}")
|
logger.info(f"提取到数量: {quantity_value}")
|
||||||
print(f"🔢 数量: {quantity_value}")
|
print(f"🔢 数量: {quantity_value}")
|
||||||
else:
|
else:
|
||||||
|
# 去掉数量值前面的 'x' 符号(如 "x2" -> "2")
|
||||||
|
if quantity_content.startswith('x'):
|
||||||
|
quantity_content = quantity_content[1:]
|
||||||
result['quantity'] = quantity_content
|
result['quantity'] = quantity_content
|
||||||
logger.info(f"数量内容无冒号,直接使用: {quantity_content}")
|
logger.info(f"数量内容无冒号,直接使用: {quantity_content}")
|
||||||
print(f"🔢 数量: {quantity_content}")
|
print(f"🔢 数量: {quantity_content}")
|
||||||
@ -471,10 +477,16 @@ class OrderDetailFetcher:
|
|||||||
|
|
||||||
if ':' in content:
|
if ':' in content:
|
||||||
quantity_value = content.split(':', 1)[1].strip()
|
quantity_value = content.split(':', 1)[1].strip()
|
||||||
|
# 去掉数量值前面的 'x' 符号(如 "x2" -> "2")
|
||||||
|
if quantity_value.startswith('x'):
|
||||||
|
quantity_value = quantity_value[1:]
|
||||||
result['quantity'] = quantity_value
|
result['quantity'] = quantity_value
|
||||||
logger.info(f"提取到数量: {quantity_value}")
|
logger.info(f"提取到数量: {quantity_value}")
|
||||||
print(f"🔢 数量: {quantity_value}")
|
print(f"🔢 数量: {quantity_value}")
|
||||||
else:
|
else:
|
||||||
|
# 去掉数量值前面的 'x' 符号(如 "x2" -> "2")
|
||||||
|
if content.startswith('x'):
|
||||||
|
content = content[1:]
|
||||||
result['quantity'] = content
|
result['quantity'] = content
|
||||||
logger.info(f"数量内容无冒号,直接使用: {content}")
|
logger.info(f"数量内容无冒号,直接使用: {content}")
|
||||||
print(f"🔢 数量: {content}")
|
print(f"🔢 数量: {content}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user