|
@@ -493,22 +493,24 @@ def updateGoodsAreaSupplierPrice(app_id, token, uploadFile):
|
|
for area_price in area_prices:
|
|
for area_price in area_prices:
|
|
supply_price_list = []
|
|
supply_price_list = []
|
|
if area_price['副单位'] is not None:
|
|
if area_price['副单位'] is not None:
|
|
- a = {'is_min_unit': True,
|
|
|
|
- 'unit': area_price['最小单位'],
|
|
|
|
- 'suggested_order_price': area_price['最小单位售价'] * 100,
|
|
|
|
- 'supply_price': area_price['最小单位采购价'] * 100}
|
|
|
|
b = {'is_min_unit': False,
|
|
b = {'is_min_unit': False,
|
|
'unit': area_price['副单位'],
|
|
'unit': area_price['副单位'],
|
|
'suggested_order_price': area_price['副单位售价'] * 100,
|
|
'suggested_order_price': area_price['副单位售价'] * 100,
|
|
'supply_price': area_price['副单位采购价'] * 100}
|
|
'supply_price': area_price['副单位采购价'] * 100}
|
|
- supply_price_list.append ( a )
|
|
|
|
supply_price_list.append ( b )
|
|
supply_price_list.append ( b )
|
|
- else:
|
|
|
|
- a = {'is_min_unit': True,
|
|
|
|
- 'unit': area_price['最小单位'],
|
|
|
|
- 'suggested_order_price': area_price['最小单位售价'] * 100,
|
|
|
|
- 'supply_price': area_price['最小单位采购价'] * 100}
|
|
|
|
- supply_price_list.append ( a )
|
|
|
|
|
|
+
|
|
|
|
+ if area_price['副单位1'] is not None:
|
|
|
|
+ c = {'is_min_unit': False,
|
|
|
|
+ 'unit': area_price['副单位1'],
|
|
|
|
+ 'suggested_order_price': area_price['副单位1售价'] * 100,
|
|
|
|
+ 'supply_price': area_price['副单位1采购价'] * 100}
|
|
|
|
+ supply_price_list.append(c)
|
|
|
|
+
|
|
|
|
+ a = {'is_min_unit': True,
|
|
|
|
+ 'unit': area_price['最小单位'],
|
|
|
|
+ 'suggested_order_price': area_price['最小单位售价'] * 100,
|
|
|
|
+ 'supply_price': area_price['最小单位采购价'] * 100}
|
|
|
|
+ supply_price_list.append ( a )
|
|
area_prices_dict[str ( area_price['供货区域'] )] = supply_price_list
|
|
area_prices_dict[str ( area_price['供货区域'] )] = supply_price_list
|
|
# print(area_prices_dict)
|
|
# print(area_prices_dict)
|
|
headers = {
|
|
headers = {
|
|
@@ -641,20 +643,22 @@ def updateSingleGoodsPriceInGoodsInfoCentre(app_id, token, uploadFile, mode):
|
|
sup_info = sup_ids_l[0]
|
|
sup_info = sup_ids_l[0]
|
|
unit_price_list = []
|
|
unit_price_list = []
|
|
if str ( sup_info['副单位'] ) != 'nan':
|
|
if str ( sup_info['副单位'] ) != 'nan':
|
|
- a = {'is_min_unit': True,
|
|
|
|
- 'unit': sup_info['最小单位'],
|
|
|
|
- 'actual_amount': int ( sup_info['最小单位售价'] * 100 )}
|
|
|
|
b = {'is_min_unit': False,
|
|
b = {'is_min_unit': False,
|
|
'unit': sup_info['副单位'],
|
|
'unit': sup_info['副单位'],
|
|
'actual_amount': int ( sup_info['副单位售价'] * 100 )}
|
|
'actual_amount': int ( sup_info['副单位售价'] * 100 )}
|
|
- unit_price_list.append ( a )
|
|
|
|
unit_price_list.append ( b )
|
|
unit_price_list.append ( b )
|
|
|
|
|
|
- else:
|
|
|
|
- a = {'is_min_unit': True,
|
|
|
|
- 'unit': sup_info['最小单位'],
|
|
|
|
- 'actual_amount': int ( sup_info['最小单位售价'] * 100 )}
|
|
|
|
- unit_price_list.append ( a )
|
|
|
|
|
|
+ if str ( sup_info['副单位1'] ) != 'nan':
|
|
|
|
+ c = {'is_min_unit': False,
|
|
|
|
+ 'unit': sup_info['副单位1'],
|
|
|
|
+ 'actual_amount': int ( sup_info['副单位1售价'] * 100 )}
|
|
|
|
+ unit_price_list.append ( c )
|
|
|
|
+
|
|
|
|
+ a = {'is_min_unit': True,
|
|
|
|
+ 'unit': sup_info['最小单位'],
|
|
|
|
+ 'actual_amount': int ( sup_info['最小单位售价'] * 100 )}
|
|
|
|
+ unit_price_list.append ( a )
|
|
|
|
+
|
|
if str ( sup_info['限订量'] ) != 'nan':
|
|
if str ( sup_info['限订量'] ) != 'nan':
|
|
buy_limit_max = sup_info['限订量']
|
|
buy_limit_max = sup_info['限订量']
|
|
else:
|
|
else:
|
|
@@ -955,20 +959,22 @@ def updateGoodsPriceInGoodsInfoCentre(app_id, token, uploadFile):
|
|
sup_info = sup_ids_l[0]
|
|
sup_info = sup_ids_l[0]
|
|
unit_price_list = []
|
|
unit_price_list = []
|
|
if str ( sup_info['副单位'] ) != 'nan':
|
|
if str ( sup_info['副单位'] ) != 'nan':
|
|
- a = {'is_min_unit': True,
|
|
|
|
- 'unit': sup_info['最小单位'],
|
|
|
|
- 'actual_amount': int ( sup_info['最小单位售价'] * 100 )}
|
|
|
|
b = {'is_min_unit': False,
|
|
b = {'is_min_unit': False,
|
|
'unit': sup_info['副单位'],
|
|
'unit': sup_info['副单位'],
|
|
'actual_amount': int ( sup_info['副单位售价'] * 100 )}
|
|
'actual_amount': int ( sup_info['副单位售价'] * 100 )}
|
|
- unit_price_list.append ( a )
|
|
|
|
unit_price_list.append ( b )
|
|
unit_price_list.append ( b )
|
|
|
|
|
|
- else:
|
|
|
|
- a = {'is_min_unit': True,
|
|
|
|
- 'unit': sup_info['最小单位'],
|
|
|
|
- 'actual_amount': int ( sup_info['最小单位售价'] * 100 )}
|
|
|
|
- unit_price_list.append ( a )
|
|
|
|
|
|
+ if str ( sup_info['副单位1'] ) != 'nan':
|
|
|
|
+ c = {'is_min_unit': False,
|
|
|
|
+ 'unit': sup_info['副单位1'],
|
|
|
|
+ 'actual_amount': int ( sup_info['副单位1售价'] * 100 )}
|
|
|
|
+ unit_price_list.append ( c )
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ a = {'is_min_unit': True,
|
|
|
|
+ 'unit': sup_info['最小单位'],
|
|
|
|
+ 'actual_amount': int ( sup_info['最小单位售价'] * 100 )}
|
|
|
|
+ unit_price_list.append ( a )
|
|
if str ( sup_info['限订量'] ) != 'nan':
|
|
if str ( sup_info['限订量'] ) != 'nan':
|
|
buy_limit_max = sup_info['限订量']
|
|
buy_limit_max = sup_info['限订量']
|
|
else:
|
|
else:
|
|
@@ -1305,6 +1311,7 @@ def selectGoodInGoodsCentreSUPshops(app_id, token, goods_id, shop_window_id):
|
|
"shop_window_id": shop_window_id,
|
|
"shop_window_id": shop_window_id,
|
|
"app_id": app_id}
|
|
"app_id": app_id}
|
|
resp = requests.post ( url, headers = headers, json = json_params ).json ()
|
|
resp = requests.post ( url, headers = headers, json = json_params ).json ()
|
|
|
|
+ print(resp)
|
|
return resp
|
|
return resp
|
|
|
|
|
|
|
|
|
|
@@ -1327,6 +1334,7 @@ def updateGoodsInGoodsCentreSUPshops(app_id, token, uploadFile):
|
|
apply_types = list (
|
|
apply_types = list (
|
|
set ( shop_window_ids_df[shop_window_ids_df['橱窗id'] == shop_window_id]['适用类型'] ) ) # 适用类型
|
|
set ( shop_window_ids_df[shop_window_ids_df['橱窗id'] == shop_window_id]['适用类型'] ) ) # 适用类型
|
|
for apply_type in apply_types:
|
|
for apply_type in apply_types:
|
|
|
|
+ time.sleep(random.uniform(2,4))
|
|
brand_id = list ( set ( shop_window_ids_df[shop_window_ids_df['橱窗id'] == shop_window_id]['品牌id'] ) )[0]
|
|
brand_id = list ( set ( shop_window_ids_df[shop_window_ids_df['橱窗id'] == shop_window_id]['品牌id'] ) )[0]
|
|
apply_store_ids = list ( set ( apply_store_ids_df[apply_store_ids_df['适用类型'] == apply_type]['门店编号'] ) )
|
|
apply_store_ids = list ( set ( apply_store_ids_df[apply_store_ids_df['适用类型'] == apply_type]['门店编号'] ) )
|
|
apply_store_ids1 = selectStoreIdByStoreNo ( app_id, token, apply_store_ids, brand_id ) # 门店编码转门店id
|
|
apply_store_ids1 = selectStoreIdByStoreNo ( app_id, token, apply_store_ids, brand_id ) # 门店编码转门店id
|
|
@@ -1911,16 +1919,34 @@ def runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode = 'p
|
|
print(task_id)
|
|
print(task_id)
|
|
df_path = invoiceDownload(app_id, token, task_id, save_path, start_date, end_date, mode)
|
|
df_path = invoiceDownload(app_id, token, task_id, save_path, start_date, end_date, mode)
|
|
print(df_path)
|
|
print(df_path)
|
|
|
|
+ if 1==1:
|
|
|
|
+ dfFormatting(df_path)
|
|
return df_path
|
|
return df_path
|
|
|
|
|
|
|
|
+def dfFormatting(df_in_path):
|
|
|
|
+ df_in = pd.read_excel(df_in_path)
|
|
|
|
+ df_in['一级区域'] = df_in['一级区域'].fillna('')
|
|
|
|
+ df_in['二级区域'] = df_in['二级区域'].fillna('')
|
|
|
|
+ df_in['三级区域'] = df_in['三级区域'].fillna('')
|
|
|
|
+ df_in['所属省市区'] = df_in['一级区域'] + df_in['二级区域'] + df_in['三级区域']
|
|
|
|
+ df_in['商品分类'] = df_in['二级分类'].fillna(df_in['一级分类'])
|
|
|
|
+ df_in['发货单号'] = df_in['发货单号'].astype(str)
|
|
|
|
+ df_in['订货单号'] = df_in['订货单号'].astype(str)
|
|
|
|
+ # print(df_in.info())
|
|
|
|
+ df_out = df_in[
|
|
|
|
+ ['订货门店编号', '订货门店名称', '品牌', '所属省市区', '发货单号', '订货单号', '发货方', '发货单金额', '结算金额', '服务费', '交易手续费', '通道手续费', '发货单状态',
|
|
|
|
+ '创建时间', '下单时间', '发货时间', '签收时间', '商品分类', '商品编号', '商品名称', '商品厂商', '货号', '规格', '数量', '订货单价', '订货小计', '采购单价',
|
|
|
|
+ '采购小计', '单位', '收货人', '收货人电话', '收货地址']]
|
|
|
|
+ df_out.to_excel(df_in_path,index = False)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
- app_id, token = getToken ()
|
|
|
|
- print ( app_id, token )
|
|
|
|
- # app_id = '7005337094168150016'
|
|
|
|
- # token ='20230207-bff9c872aa2842d2b03f75e25bfb37a0'
|
|
|
|
- goods_no = 'P4464051565'
|
|
|
|
- io_path = 'C:/Users/ClownHe/Desktop/店务通数据'
|
|
|
|
|
|
+ if 1==1:
|
|
|
|
+ app_id, token = getToken ()
|
|
|
|
+ print ( app_id, token )
|
|
|
|
+ # app_id = '7005337094168150016'
|
|
|
|
+ # token ='20230207-bff9c872aa2842d2b03f75e25bfb37a0'
|
|
|
|
+ goods_no = 'P4464051565'
|
|
|
|
+ io_path = 'C:/Users/ClownHe/Desktop/店务通数据'
|
|
if 1 == 0:
|
|
if 1 == 0:
|
|
# 获取商品上下架状态及商品id
|
|
# 获取商品上下架状态及商品id
|
|
publish_state, goods_id = selectGoodsInfoPubAndId ( app_id, token, goods_no )
|
|
publish_state, goods_id = selectGoodsInfoPubAndId ( app_id, token, goods_no )
|
|
@@ -1994,34 +2020,37 @@ if __name__ == '__main__':
|
|
if 1==0:
|
|
if 1==0:
|
|
goodsInGoodsCentre(app_id, token, io_path)
|
|
goodsInGoodsCentre(app_id, token, io_path)
|
|
|
|
|
|
|
|
+ if 1==0:
|
|
|
|
+ updateGoodsInGoodsCentreSUPshops(app_id, token, io_path + '/updateGoodsInGoodsCentreSUPshops.xlsx')
|
|
|
|
+
|
|
if 1==1:
|
|
if 1==1:
|
|
# 操作区
|
|
# 操作区
|
|
# 运行发货单下载 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间
|
|
# 运行发货单下载 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间
|
|
start_date = '2024-03-01'
|
|
start_date = '2024-03-01'
|
|
- end_date = '2024-03-08'
|
|
|
|
|
|
+ end_date = '2024-03-31'
|
|
mode = 'supplier_split' # 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间
|
|
mode = 'supplier_split' # 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间
|
|
save_path = io_path
|
|
save_path = io_path
|
|
runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode)
|
|
runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode)
|
|
- # start_date = '2024-03-01'
|
|
|
|
- # end_date = '2024-03-01'
|
|
|
|
- # mode = 'supplier_split' # 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间 11
|
|
|
|
- # save_path = io_path
|
|
|
|
- # runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode)
|
|
|
|
- start_date = '2024-03-02'
|
|
|
|
- end_date = '2024-03-08'
|
|
|
|
|
|
+ start_date = '2024-04-01'
|
|
|
|
+ end_date = '2024-04-05'
|
|
|
|
+ mode = 'supplier_split' # 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间 11
|
|
|
|
+ save_path = io_path
|
|
|
|
+ runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode)
|
|
|
|
+ start_date = '2024-03-30'
|
|
|
|
+ end_date = '2024-04-05'
|
|
mode = 'supplier_split' # 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间
|
|
mode = 'supplier_split' # 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间
|
|
save_path = io_path
|
|
save_path = io_path
|
|
runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode)
|
|
runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode)
|
|
start_date = '2024-03-01'
|
|
start_date = '2024-03-01'
|
|
- end_date = '2024-03-08'
|
|
|
|
|
|
+ end_date = '2024-03-31'
|
|
|
|
+ mode = 'pay' # 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间
|
|
|
|
+ save_path = io_path
|
|
|
|
+ runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode)
|
|
|
|
+ start_date = '2024-04-01'
|
|
|
|
+ end_date = '2024-04-05'
|
|
mode = 'pay' # 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间
|
|
mode = 'pay' # 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间
|
|
save_path = io_path
|
|
save_path = io_path
|
|
runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode)
|
|
runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode)
|
|
- # start_date = '2023-12-01'
|
|
|
|
- # end_date = '2023-12-01'
|
|
|
|
- # mode = 'pay' # 'pay'指定为下单时间 'supplier_split'指定为供应商预结算时间
|
|
|
|
- # save_path = io_path
|
|
|
|
- # runInvoiceDownload(app_id, token, save_path, start_date, end_date, mode)
|
|
|
|
|
|
|
|
# upLoadFile_goods = '/selectAllGoodsInfoInDetailPrice(20231012.16.50).xlsx'
|
|
# upLoadFile_goods = '/selectAllGoodsInfoInDetailPrice(20231012.16.50).xlsx'
|
|
# upLoadFile_orderids = '/活动赠送产品订单查询10.12v1.xlsx'
|
|
# upLoadFile_orderids = '/活动赠送产品订单查询10.12v1.xlsx'
|
|
@@ -2043,3 +2072,9 @@ if __name__ == '__main__':
|
|
for goods_id in goods_id_list:
|
|
for goods_id in goods_id_list:
|
|
result = updatePublishState ( app_id, token, 0, goods_id )
|
|
result = updatePublishState ( app_id, token, 0, goods_id )
|
|
print ( goods_id, result )
|
|
print ( goods_id, result )
|
|
|
|
+
|
|
|
|
+ if 1==0:
|
|
|
|
+ df_path = r'C:\Users\ClownHe\Desktop\店务通数据\2024-03-01至2024-03-31发货单(pay).xlsx'
|
|
|
|
+ df_in = pd.read_excel(df_path)
|
|
|
|
+ col = list(df_in.columns)
|
|
|
|
+ print(col)
|