Commit 732b69e1 authored by 邱阿朋's avatar 邱阿朋

refactor(gui): 优化店铺代码逻辑

- 将 VECELO 店铺代码逻辑移至最上方
- 移除了多余的 else 语句
- 在 payment模块中添加了 shop_code变量初始化

refactor(payment): 移除未使用的推送数据队列功能

- 删除了 payment.py 中的 push_data_queue 函数实现
- 保留了函数定义,返回 pass
parent 195be7a0
......@@ -394,26 +394,4 @@ class Payment(AutoInterface):
self.logger.info(f"文件 {new_file_name} 保存完成,路径:{os.path.abspath(new_file_name)}")
def push_data_queue(self):
rabbit.connection()
rabbit.connect(queue='refund_robot', routing_key='refund_robot', exchange='reports')
data = pd.read_excel(self.result_file_name, keep_default_na=False, na_values=[])
for _, item_row in data.iterrows():
push_data = {
'payment_number': item_row.get('Payment Number', ''), # 订单id
'order_date': str(item_row.get('Invoice Date', '')), # 发票时间
'payment_date': str(item_row.get('Payment Date', '')), # 支付时间
'order_no': item_row.get('Invoice Number', 0), # 订单号
'payment_type': item_row.get('Description', ''), # Description
'platform_payable_amount': item_row.get('Invoice Amount', ''), # 平台应付金额
'fee_amount': item_row.get("Terms Discount Taken", ''), # 手续费
'actual_payment': item_row.get('Amount Paid', ''), # 实际支付金额
'currency': item_row.get('Invoice Currency', ''), # 货币
'shop_code': self.shop_code, # 店铺code
}
# 推送数据
rabbit.send_message(push_data)
rabbit.close()
pass
......@@ -222,6 +222,7 @@ class VCManagerGUI(ttk.Window):
# 根据国家编码获取店铺代码
country = params['country']
shop_code = "VECELO"
if country == "JP":
shop_code = "JP-VC"
elif country == "UK":
......@@ -232,8 +233,6 @@ class VCManagerGUI(ttk.Window):
shop_code = "FR-VC"
elif country == "CA":
shop_code = "CA-VC"
else:
shop_code = "VECELO"
action = params['action']
if action == "payment":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment