Commit da4092cb authored by 邱阿朋's avatar 邱阿朋

refactor(gui): 注释掉不必要的数据队列推送

feat(return_goods): 增加对退货数据为空的处理
- 在读取退货详情数据时,增加空数据检查并记录日志
- 在处理退货明细前,增加空列表检查并记录日志
parent e172dc84
......@@ -69,6 +69,10 @@ class ReturnGoods(AutoInterface):
# 下载退货详情表格读取数据
item_data = self.__export_item_read_data(return_id)
if item_data.empty:
self.logger.warning(f"{return_id} 订单详情读取失败")
continue
# 按 'Purchase order' 和 'ASIN' 分组,并对 'Quantity' 和 Total amount 进行求和
item_data_result = item_data.groupby(['Purchase order', 'ASIN', 'Reason'], as_index=False).agg({
'Quantity': 'sum',
......@@ -96,6 +100,10 @@ class ReturnGoods(AutoInterface):
# 追加数据
new_list_data.append(data_dict)
if len(new_list_data) == 0:
self.logger.warning("退货明细为空")
return
excel.save_xls(new_list_data, self.result_file_name)
self.logger.info(f"文件 {self.result_file_name} 保存完成,路径:{os.path.abspath(self.result_file_name)}")
......
......@@ -199,7 +199,7 @@ class VCManagerGUI(ttk.Window):
# 执行核心操作
self.log(f"开始执行 {params['action']} 操作...")
processor.run(params['file_name'])
processor.push_data_queue()
# processor.push_data_queue()
self.log("操作成功完成!")
except Exception as e:
......
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