This commit is contained in:
parent
5b9e4fbc9f
commit
bae20edd63
|
|
@ -0,0 +1,321 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "d40f14fe",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from login_for_cookie import Vc\n",
|
||||
"import requests\n",
|
||||
"import pandas as pd\n",
|
||||
"import re \n",
|
||||
"cookie = Vc()\n",
|
||||
"header = {\"cookie\":cookie}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "fa7b4aa7",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# 固定汇率\n",
|
||||
"def rate_to_rmb(curruency):\n",
|
||||
" if curruency == \"CNY\":\n",
|
||||
" rate = 1\n",
|
||||
" if curruency == \"USD\":\n",
|
||||
" rate = 7\n",
|
||||
" if curruency == \"EUR\":\n",
|
||||
" rate = 8 \n",
|
||||
" if curruency == \"GBP\":\n",
|
||||
" rate = 9\n",
|
||||
" if curruency == \"JPY\":\n",
|
||||
" rate = 0.05\n",
|
||||
" if curruency == \"AUD\":\n",
|
||||
" rate = 5\n",
|
||||
" if curruency == \"CAD\":\n",
|
||||
" rate = 5\n",
|
||||
" if curruency == \"HKD\":\n",
|
||||
" rate = 1\n",
|
||||
" return rate"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "99fd242f",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"aurl = \"https://cp.maso.hk/index.php?main=biphp&act=package_fund&key=W6BOYJ7BH27YCGRFCA0LWBVKMU1KRU5Q&package=991517855\"\n",
|
||||
"burl = \"https://cp.maso.hk/index.php?main=biphp&key=W6BOYJ7BH27YCGRFCA0LWBVKMU1KRU5Q&act=expend_settle_detail&id=3277\"\n",
|
||||
"curl = \"https://cp.maso.hk/index.php?main=biphp&key=W6BOYJ7BH27YCGRFCA0LWBVKMU1KRU5Q&act=bol_settle_detail&id=2324\"\n",
|
||||
"durl = \"https://cp.maso.hk/index.php?main=biphp&key=W6BOYJ7BH27YCGRFCA0LWBVKMU1KRU5Q&act=express_settle_detail&id=7787\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5e6e24f4",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"处理尾端结算数据"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "705c5336",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from utils.gtools import MySQLconnect\n",
|
||||
"with MySQLconnect(\"workflow\") as db:\n",
|
||||
" engine = db.engine()\n",
|
||||
" sql_list= pd.read_sql(\"SELECT 物流结算号 FROM `flow_check_tail`\", engine)\n",
|
||||
" # 转成列表\n",
|
||||
" D_LIST = sql_list['物流结算号'].dropna().astype(int).tolist()\n",
|
||||
"express_df = pd.DataFrame()\n",
|
||||
"for d in D_LIST:\n",
|
||||
" url = \"https://cp.maso.hk/index.php?main=biphp&key=W6BOYJ7BH27YCGRFCA0LWBVKMU1KRU5Q&act=express_settle_detail&id=%s\"% d\n",
|
||||
" p_get = requests.get(url)\n",
|
||||
" data = p_get.json()\n",
|
||||
" temp_df = pd.DataFrame(data[\"data\"])\n",
|
||||
" temp_df[\"结算号\"]=d\n",
|
||||
" temp_df[\"track_number\"] = temp_df[\"track_number\"].astype(str) \n",
|
||||
" express_df = pd.concat([express_df,temp_df],axis=0)\n",
|
||||
"\n",
|
||||
"from utils.gtools import MySQLconnect\n",
|
||||
"import json\n",
|
||||
"express_df['账单运费'] = pd.to_numeric(express_df['bill_express_fee'].str.replace(r'[A-Z]+', '', regex=True),errors='coerce')\n",
|
||||
"express_df['币种'] = express_df['bill_express_fee'].str.replace(r'[0-9.]+', '', regex=True)\n",
|
||||
"express_df['rmb'] = express_df.apply(lambda row: round(row['账单运费']*rate_to_rmb(row['币种'])[0],2), axis=1)\n",
|
||||
"\n",
|
||||
"# 根据快递跟踪号找到包裹号\n",
|
||||
"missing_odr_df = express_df[express_df['odr_express_id'].isna() | (express_df['odr_express_id']=='--')]\n",
|
||||
"track_list = missing_odr_df['track_number'].dropna().unique().tolist()\n",
|
||||
"if track_list:\n",
|
||||
" with MySQLconnect('ods') as db:\n",
|
||||
" conn = db.connect()\n",
|
||||
" format_strings = ','.join(['%s'] * len(track_list))\n",
|
||||
" sql = f\"SELECT 快递跟踪号 AS track_number,包裹号 AS odr_express_id FROM `order_express` WHERE 快递跟踪号 IN ({format_strings})\"\n",
|
||||
" df_mapping = pd.read_sql(sql, conn, params=track_list)\n",
|
||||
" mapping_dict = dict(zip(df_mapping['track_number'], df_mapping['odr_express_id']))\n",
|
||||
" def fill_odr(row):\n",
|
||||
" if pd.isna(row['odr_express_id']) or row['odr_express_id'] == '--':\n",
|
||||
" return mapping_dict.get(row['track_number'], row['odr_express_id'])\n",
|
||||
" else:\n",
|
||||
" return row['odr_express_id']\n",
|
||||
" express_df['odr_express_id'] = express_df.apply(fill_odr, axis=1)\n",
|
||||
"\n",
|
||||
"workflow = MySQLconnect('workflow')\n",
|
||||
"def safe_json(x):\n",
|
||||
" if isinstance(x, (dict, list, set)):\n",
|
||||
" return json.dumps(x, ensure_ascii=False)\n",
|
||||
" return x\n",
|
||||
"express_df['bill_add_express_fee'] = express_df['bill_add_express_fee'].apply(safe_json)\n",
|
||||
"express_df.to_sql('flow_check_express_wxx', workflow.engine(), if_exists='replace')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "af1fa88d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"处理头程结算数据"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "f30b25ad",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"with MySQLconnect(\"workflow\") as db:\n",
|
||||
" engine = db.engine()\n",
|
||||
" sql_list= pd.read_sql(\"SELECT 物流结算号 FROM `flow_check_head`\", engine)\n",
|
||||
" # 转成列表\n",
|
||||
" C_LIST = sql_list['物流结算号'].dropna().astype(int).tolist()\n",
|
||||
"\n",
|
||||
"bol_df = pd.DataFrame()\n",
|
||||
"for c in C_LIST:\n",
|
||||
" url = \"https://cp.maso.hk/index.php?main=biphp&key=W6BOYJ7BH27YCGRFCA0LWBVKMU1KRU5Q&act=bol_settle_detail&id=%s\"% c\n",
|
||||
" p_get = requests.get(url)\n",
|
||||
" # print(p_get.text\n",
|
||||
" p_get_new=p_get.text.replace(\"\\t\", \"\")\n",
|
||||
" data = json.loads(p_get_new)\n",
|
||||
" temp_df = pd.DataFrame(data[\"data\"])\n",
|
||||
" temp_df[\"结算号\"]=c\n",
|
||||
" bol_df = pd.concat([bol_df,temp_df],axis=0)\n",
|
||||
"bol_df"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "9bb83abf",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#处理头程费用转rmb和体积单价\n",
|
||||
"bol_df['price'] = bol_df['price'].astype(float)\n",
|
||||
"bol_df['rmb'] = bol_df.apply(lambda row: round(row['price']*rate_to_rmb(row['currency'])[0],2), axis=1)\n",
|
||||
"bol_list = bol_df['bol_code'].dropna().unique().tolist()\n",
|
||||
"if bol_list:\n",
|
||||
" with MySQLconnect('ods') as db:\n",
|
||||
" conn = db.connect()\n",
|
||||
" format_strings = ','.join(['%s'] * len(bol_list))\n",
|
||||
" sql = f\"\"\"WITH t1 AS (\n",
|
||||
" SELECT\n",
|
||||
" `提单/柜号` AS bol_code,\n",
|
||||
" `提单ID` AS bol_id ,\n",
|
||||
" `体积cm3`,\n",
|
||||
" ROW_NUMBER() OVER(PARTITION BY `提单/柜号` ORDER BY `离港时间` DESC) AS row_index\n",
|
||||
" FROM\n",
|
||||
" bol_list \n",
|
||||
" WHERE\n",
|
||||
" `提单/柜号` IN ({format_strings})\n",
|
||||
" )\n",
|
||||
" SELECT `bol_code`,`bol_id`,`体积cm3` FROM t1 WHERE row_index = 1\n",
|
||||
" \"\"\"\n",
|
||||
" df_mapping = pd.read_sql(sql, conn, params=bol_list)\n",
|
||||
" # 合并\n",
|
||||
" bol_df = pd.merge(bol_df, df_mapping, on=['bol_code'], how='left')\n",
|
||||
"bol_df['体积cm3'] = bol_df['体积cm3'].astype(float)\n",
|
||||
"bol_df['体积单价'] = bol_df['rmb']/bol_df['体积cm3'] \n",
|
||||
"workflow = MySQLconnect('workflow')\n",
|
||||
"bol_df.to_sql('flow_check_head_wxx', workflow.engine(), if_exists='replace') "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "4a78e03f",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#找bol_id下的所有包裹和体积,得到单包裹的头程价格\n",
|
||||
"bol_id_list = bol_df['bol_id'].dropna().unique().tolist()\n",
|
||||
"with MySQLconnect('ods') as db:\n",
|
||||
" conn = db.connect()\n",
|
||||
" format_strings = ','.join(['%s'] * len(bol_id_list))\n",
|
||||
" sql = f\"\"\"SELECT\n",
|
||||
" `包裹号`,\n",
|
||||
" btp.`提单ID` AS bol_id,\n",
|
||||
" length,\n",
|
||||
" width,\n",
|
||||
" hight,\n",
|
||||
" weight,\n",
|
||||
" length * width * hight AS 体积 \n",
|
||||
" FROM\n",
|
||||
" bol_to_package btp\n",
|
||||
" LEFT JOIN package_vol_info pvi ON btp.包裹号 = pvi.package \n",
|
||||
" WHERE btp.`提单ID` IN ({format_strings})\n",
|
||||
" \"\"\"\n",
|
||||
" bol_package = pd.read_sql(sql, conn, params=bol_id_list)\n",
|
||||
"\n",
|
||||
"# 根据bol_df计算每个bol_id的单价(多行求和),保存为一个map字典\n",
|
||||
"bol_id_price = bol_df.groupby('bol_id')['体积单价'].sum().to_dict()\n",
|
||||
"# bol_package新增一列,为体积*体积单价,体积单价根据bol_id从字典中获取\n",
|
||||
"bol_package['头程价格'] = bol_package['体积'] * bol_package['bol_id'].map(bol_id_price)\n",
|
||||
"bol_package = bol_package.drop_duplicates()\n",
|
||||
"workflow = MySQLconnect('workflow')\n",
|
||||
"bol_package.to_sql('flow_check_package_head_wxx', workflow.engine(), if_exists='replace') "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "431bcdff",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"处理额外费用数据"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "7184abdf",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"with MySQLconnect(\"workflow\") as db:\n",
|
||||
" engine = db.engine()\n",
|
||||
" sql_list= pd.read_sql(\"SELECT 物流结算号 FROM `flow_check_expend`\", engine)\n",
|
||||
" # 转成列表\n",
|
||||
" B_LIST = sql_list['物流结算号'].dropna().astype(int).tolist()\n",
|
||||
"\n",
|
||||
"expend_df = pd.DataFrame()\n",
|
||||
"for b in B_LIST:\n",
|
||||
" url = \"https://cp.maso.hk/index.php?main=biphp&key=W6BOYJ7BH27YCGRFCA0LWBVKMU1KRU5Q&act=expend_settle_detail&id=%s \"% b\n",
|
||||
" p_get = requests.get(url)\n",
|
||||
" data = p_get.json()\n",
|
||||
" temp_df = pd.DataFrame(data[\"data\"])\n",
|
||||
" temp_df[\"结算号\"]=b\n",
|
||||
" expend_df = pd.concat([expend_df,temp_df],axis=0)\n",
|
||||
"\n",
|
||||
"expend_df['账单运费'] = pd.to_numeric(expend_df['pay_price'].str.replace(r'[A-Z]+', '', regex=True),errors='coerce')\n",
|
||||
"expend_df['币种'] = expend_df['pay_price'].str.replace(r'[0-9.]+', '', regex=True)\n",
|
||||
"expend_df['rmb'] = expend_df.apply(lambda row: round(row['账单运费']*rate_to_rmb(row['币种'])[0],2), axis=1)\n",
|
||||
"\n",
|
||||
"workflow = MySQLconnect('workflow')\n",
|
||||
"expend_df.to_sql('flow_check_expend_wxx', workflow.engine(), if_exists='replace') "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "361b5796",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"三种费用合并,以包裹为单位保存"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "c6d66242",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"with MySQLconnect('workflow') as db:\n",
|
||||
" conn = db.connect()\n",
|
||||
" format_strings = ','.join(['%s'] * len(bol_id_list))\n",
|
||||
" sql = \"\"\"SELECT DISTINCT\n",
|
||||
" tail.odr_express_id,\n",
|
||||
" head.`头程价格`,\n",
|
||||
" tail.rmb AS 尾程费用,\n",
|
||||
" expend.rmb AS 额外费用\n",
|
||||
" FROM\n",
|
||||
" flow_check_express_wxx tail \n",
|
||||
" LEFT JOIN flow_check_package_head_wxx head ON tail.odr_express_id = head.`包裹号`\n",
|
||||
" LEFT JOIN flow_check_expend_wxx expend ON tail.odr_express_id = expend.odr_express_id\n",
|
||||
" \"\"\"\n",
|
||||
" package_fee = pd.read_sql(sql, conn)\n",
|
||||
" package_fee.to_sql('flow_check_package_fee_wxx', workflow.engine(), if_exists='replace') \n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "base",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.11.5"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
|
|
@ -1,148 +0,0 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"C:\\Users\\Admin\\AppData\\Local\\Temp\\ipykernel_2152\\2535791683.py:19: UserWarning: pandas only supports SQLAlchemy connectable (engine/connection) or database string URI or sqlite3 DBAPI2 connection. Other DBAPI2 objects are not tested. Please consider using SQLAlchemy.\n",
|
||||
" order_df = pd.read_sql(query, db.con)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
" DATE_FORMAT(order_date,'%Y-%m-%d') order_id \\\n",
|
||||
"0 2024-08-01 240801000602903 \n",
|
||||
"1 2024-08-01 240801000802198 \n",
|
||||
"2 2024-08-01 240801001202641 \n",
|
||||
"3 2024-08-01 240801001402908 \n",
|
||||
"4 2024-08-01 240801001414785 \n",
|
||||
"... ... ... \n",
|
||||
"143421 2025-01-20 250120235520923 \n",
|
||||
"143422 2025-01-20 250120235602837 \n",
|
||||
"143423 2025-01-20 250120235616266 \n",
|
||||
"143424 2025-01-20 250120235627823 \n",
|
||||
"143425 2025-01-20 250120235802366 \n",
|
||||
"\n",
|
||||
" order_price_dollar order_freight_price_dollar order_cate \n",
|
||||
"0 201.66 64.30 家具 \n",
|
||||
"1 420.65 53.60 家具 \n",
|
||||
"2 51.93 13.66 家具 \n",
|
||||
"3 2099.55 112.20 家具 \n",
|
||||
"4 154.47 39.78 灯具 \n",
|
||||
"... ... ... ... \n",
|
||||
"143421 496.54 50.00 家具 \n",
|
||||
"143422 121.50 17.02 灯具 \n",
|
||||
"143423 281.34 9.66 家具 \n",
|
||||
"143424 312.36 73.47 家具 \n",
|
||||
"143425 117.39 17.21 灯具 \n",
|
||||
"\n",
|
||||
"[143426 rows x 5 columns]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from utils.gtools import MySQLconnect\n",
|
||||
"import pandas as pd\n",
|
||||
"# 先找出去年八月之后的订单号,订单时间,订单费用,订单所属条目,订单物流成本\n",
|
||||
"with MySQLconnect('ods') as db:\n",
|
||||
" query = \"\"\"SELECT\n",
|
||||
" DATE_FORMAT( order_date, '%Y-%m-%d' ),\n",
|
||||
" order_id,\n",
|
||||
" order_price_dollar,\n",
|
||||
" order_cate,\n",
|
||||
" SUM(pfi.package_fund + pfi.head_way_express_fee + pfi.other_expend + pfi.indemnity)/7 AS `物流成本` \n",
|
||||
" FROM\n",
|
||||
" ods.order_list ol\n",
|
||||
" LEFT JOIN order_express oe ON ol.order_id = oe.`单号`\n",
|
||||
" LEFT JOIN package_fee_info pfi ON oe.包裹号 = pfi.package \n",
|
||||
" WHERE\n",
|
||||
" order_date >= '2024-08-01' \n",
|
||||
" AND order_date <= '2025-01-21' \n",
|
||||
" AND fund_status NOT REGEXP '等待|退款|失败|冻结' \n",
|
||||
" AND site_name = 'Litfad' \n",
|
||||
" GROUP BY\n",
|
||||
" order_id\n",
|
||||
" \"\"\"\n",
|
||||
" order_df = pd.read_sql(query, db.con)\n",
|
||||
" print(order_df)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# 取采购价\n",
|
||||
"order_id = order_df['order_id'].tolist()\n",
|
||||
"order_ids = ','.join(f\"'{i}'\" for i in order_id)\n",
|
||||
"with MySQLconnect('ods') as db:\n",
|
||||
" query = f\"\"\"\n",
|
||||
"with t1 AS (SELECT LEFT\n",
|
||||
" ( ol.out_detials_outlink_id, 15 ) AS order_id,\n",
|
||||
" SUM( out_detials_qty * price )/ 7 AS instock_cost,\n",
|
||||
"\t\t\t\tNULL AS buy_cost\n",
|
||||
" FROM\n",
|
||||
" ods.outstock_list ol\n",
|
||||
" JOIN ods.instock_list il ON ol.store_in_id = il.id \n",
|
||||
" WHERE\n",
|
||||
" LEFT ( ol.out_detials_outlink_id, 15 ) IN ({order_ids}) \n",
|
||||
" GROUP BY\n",
|
||||
" LEFT ( ol.out_detials_outlink_id, 15 )\n",
|
||||
"UNION ALL\n",
|
||||
" SELECT\n",
|
||||
" LEFT ( order_product_id, 15 ) as order_id, \n",
|
||||
"\t\t\t\tNULL as instock_cost,\n",
|
||||
"\t\t\t\tSUM(buy_num * actual_price)/ 7 AS buy_cost\n",
|
||||
" FROM\n",
|
||||
" `warehouse_purchasing`\n",
|
||||
" WHERE\n",
|
||||
" LEFT ( order_product_id, 15 ) IN ({order_ids}) \n",
|
||||
" AND buy_audit = \"采购完成\"\n",
|
||||
" group by LEFT ( order_product_id, 15 )\n",
|
||||
"\t\t)\n",
|
||||
"\t\t\n",
|
||||
"\tSELECT\n",
|
||||
"\torder_id,\n",
|
||||
"\tSUM(CASE \n",
|
||||
"\tWHEN instock_cost is null THEN\n",
|
||||
"\t\tbuy_cost\n",
|
||||
"\tELSE\n",
|
||||
"\t\tinstock_cost END) AS pur_cost\n",
|
||||
"\tFROM\n",
|
||||
"\tt1 \n",
|
||||
"\tGROUP BY order_id\n",
|
||||
"\t\n",
|
||||
"\"\"\"\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "base",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.11.5"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
BIN
data/~$售价尾端价格.xlsx (Stored with Git LFS)
BIN
data/~$售价尾端价格.xlsx (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
data/澳洲三大渠道.xlsx (Stored with Git LFS)
BIN
data/澳洲三大渠道.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
data/美国卡派-AM.xlsx (Stored with Git LFS)
BIN
data/美国卡派-AM.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
data/美国快递.xlsx (Stored with Git LFS)
BIN
data/美国快递.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
data/英国卡派.xlsx (Stored with Git LFS)
BIN
data/英国卡派.xlsx (Stored with Git LFS)
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
BIN
product_property_data.xlsx (Stored with Git LFS)
BIN
product_property_data.xlsx (Stored with Git LFS)
Binary file not shown.
|
|
@ -0,0 +1,85 @@
|
|||
|
||||
import pandas
|
||||
|
||||
# 日本空运
|
||||
def jp_air_order_price(packages):
|
||||
# 先判断包裹数
|
||||
if len(packages) > 30:
|
||||
return 0,"包裹数超过30"
|
||||
air_order_price = 0
|
||||
air_order_type = '空运'
|
||||
for package in packages:
|
||||
m = package.density
|
||||
v = package.get_volume_weight(6)
|
||||
if package.weight <= 2000:
|
||||
order_price = ((min(max(m, 37), 337) * 0.038 + 9.482 - 1.08) / 6 + 1.38 / 6 - 1.06) * v / 1000 / 0.359 + 4.03
|
||||
elif package.weight <= 5000:
|
||||
order_price = ((min(max(m, 37), 337) * 0.038 + 9.482 - 1.08) / 6 + 1.38 / 6 - 1.06) * v / 1000 / 0.359 + 4.57
|
||||
elif package.weight <= 10000:
|
||||
order_price = ((min(max(m, 37), 337) * 0.038 + 9.482 - 1.08) / 6 + 1.38 / 6 - 1.06) * v / 1000 / 0.359 + 5.83
|
||||
elif package.weight <= 20000:
|
||||
order_price = ((min(max(m, 37), 337) * 0.038 + 9.482 - 1.08) / 6 + 1.38 / 6 - 1.06) * v / 1000 / 0.359 + 8.7
|
||||
elif package.weight <= 30000:
|
||||
order_price = ((min(max(m, 37),337) * 0.038 + 9.482 - 1.08) / 6 + 1.38 / 6 - 1.06) * v / 1000 / 0.359 + 11.48
|
||||
else:
|
||||
return 999999,"不可发"
|
||||
air_order_price += order_price
|
||||
air_order_price = round(air_order_price, 2)
|
||||
return air_order_price,air_order_type
|
||||
|
||||
def jp_order_yamato(packages,t):
|
||||
# 先判断包裹数
|
||||
if len(packages) > 30:
|
||||
return 0,"包裹数超过30"
|
||||
order_type = 'yamato'
|
||||
order_fee = 0
|
||||
# 判断不可发
|
||||
|
||||
for package in packages:
|
||||
v = package.get_volume_weight(6)
|
||||
billing_weight = max(package.weight,v)
|
||||
if package.weight > 30000 or v > 49400:
|
||||
return 999999,"不可发"
|
||||
if billing_weight <= 2000:
|
||||
jp_base_fee = 700 if v<=1400 else 920
|
||||
order_fee1 = jp_base_fee /0.359/146 -7.82
|
||||
elif billing_weight <= 5000:
|
||||
jp_base_fee = 920 if v<=3200 else 1162
|
||||
order_fee1 = jp_base_fee /0.359/146 -6.64
|
||||
elif billing_weight <= 10000:
|
||||
jp_base_fee = 1162 if v<=6200 else 1382
|
||||
order_fee1 = jp_base_fee /0.359/146 -6.91
|
||||
elif billing_weight <=15000:
|
||||
jp_base_fee = 1382 if v<=10700 else 1624
|
||||
order_fee1 = jp_base_fee /0.359/146 -7.84
|
||||
elif billing_weight <=20000:
|
||||
jp_base_fee = 1624 if v<=16900 else 1844
|
||||
order_fee1 = jp_base_fee /0.359/146 -8.83
|
||||
elif billing_weight <=25000:
|
||||
jp_base_fee = 1844
|
||||
order_fee1 = jp_base_fee /0.359/146 -10.99
|
||||
elif billing_weight <=30000:
|
||||
if package.weight >25000 or v >25300:
|
||||
jp_base_fee = 2548
|
||||
elif v <=25300:
|
||||
jp_base_fee =1844
|
||||
order_fee1 = jp_base_fee /0.359/146 -12.87
|
||||
elif billing_weight <=36000:
|
||||
jp_base_fee = 2548
|
||||
order_fee1 = jp_base_fee /0.359/146 -14.57
|
||||
elif billing_weight <=49400:
|
||||
jp_base_fee =2988
|
||||
order_fee1 = jp_base_fee /0.359/146 -17.62
|
||||
order_fee += (order_fee1 -0.4*v/1000 +t*0.05)/0.97
|
||||
return round(order_fee,2),order_type
|
||||
|
||||
def min_price(packages):
|
||||
air_order_fee,air_type = jp_air_order_price(packages)
|
||||
yamato_order_fee,yamato_type = jp_order_yamato(packages)
|
||||
if air_order_fee <= yamato_order_fee:
|
||||
order_fee =air_order_fee
|
||||
order_type = air_type
|
||||
else:
|
||||
order_fee = yamato_order_fee
|
||||
order_type = yamato_type
|
||||
return order_fee,order_type
|
||||
|
|
@ -0,0 +1,604 @@
|
|||
{
|
||||
"90 - Coffee Tables": [
|
||||
"210000540",
|
||||
"210000571",
|
||||
"210000572",
|
||||
"210000600",
|
||||
"210000625",
|
||||
"210000663",
|
||||
"210000858",
|
||||
"210000946",
|
||||
"210000967",
|
||||
"210000999",
|
||||
"210001035",
|
||||
"210001041",
|
||||
"210001059",
|
||||
"210001084",
|
||||
"210001165",
|
||||
"210001191",
|
||||
"210001219",
|
||||
"210001223",
|
||||
"210001247",
|
||||
"210001274",
|
||||
"210001291",
|
||||
"210001377",
|
||||
"210001425",
|
||||
"210001450",
|
||||
"210001512",
|
||||
"210001535",
|
||||
"210001643",
|
||||
"210001653",
|
||||
"210001661",
|
||||
"210001673",
|
||||
"210001674",
|
||||
"21249142",
|
||||
"21249588",
|
||||
"21252084",
|
||||
"21332340",
|
||||
"21332467",
|
||||
"21332469",
|
||||
"21332728",
|
||||
"21333212",
|
||||
"21333497",
|
||||
"21333523",
|
||||
"21333567",
|
||||
"21333588",
|
||||
"21333590",
|
||||
"21333593",
|
||||
"21333596",
|
||||
"21333599",
|
||||
"21333602",
|
||||
"21333634",
|
||||
"21333638",
|
||||
"21524553",
|
||||
"21535749",
|
||||
"21538593",
|
||||
"21538748",
|
||||
"21539009",
|
||||
"21539772",
|
||||
"21555357",
|
||||
"21589210",
|
||||
"21593737",
|
||||
"21595949",
|
||||
"21614455",
|
||||
"21614613",
|
||||
"21614659",
|
||||
"21617425",
|
||||
"21617473",
|
||||
"21619743",
|
||||
"21619753",
|
||||
"21628450",
|
||||
"21632720",
|
||||
"21633273",
|
||||
"21633292",
|
||||
"21633312",
|
||||
"21633358",
|
||||
"21633525",
|
||||
"21633535",
|
||||
"21633814",
|
||||
"21633815",
|
||||
"21634501",
|
||||
"21635275",
|
||||
"21635455",
|
||||
"21636588",
|
||||
"21636722",
|
||||
"21636821",
|
||||
"21637177",
|
||||
"21637514",
|
||||
"21637573",
|
||||
"21637749",
|
||||
"21637782",
|
||||
"21637948",
|
||||
"21638031",
|
||||
"21638147",
|
||||
"21638224",
|
||||
"21638254",
|
||||
"21638271",
|
||||
"21638339",
|
||||
"21638522",
|
||||
"21639162",
|
||||
"21639267",
|
||||
"21639328",
|
||||
"21639725",
|
||||
"21640130",
|
||||
"21640184",
|
||||
"21640201",
|
||||
"21643669",
|
||||
"21643744",
|
||||
"21644153",
|
||||
"21644262",
|
||||
"21645703",
|
||||
"21645728",
|
||||
"21645926",
|
||||
"21646175",
|
||||
"21646262",
|
||||
"21649846",
|
||||
"21651013",
|
||||
"21658345",
|
||||
"21658362",
|
||||
"21658821",
|
||||
"21658873",
|
||||
"21658960",
|
||||
"21658972",
|
||||
"21659015",
|
||||
"21659022",
|
||||
"21659368",
|
||||
"21660746",
|
||||
"21662256",
|
||||
"21662361",
|
||||
"21662746",
|
||||
"21669515",
|
||||
"21674695",
|
||||
"21674723",
|
||||
"21674837",
|
||||
"21674878",
|
||||
"21675040",
|
||||
"21675058",
|
||||
"21675088",
|
||||
"21675127",
|
||||
"21675177",
|
||||
"21675218",
|
||||
"21675301",
|
||||
"21675377",
|
||||
"21675403",
|
||||
"21675421",
|
||||
"21675739",
|
||||
"21675827",
|
||||
"21675890",
|
||||
"21676130",
|
||||
"21676283",
|
||||
"21676303",
|
||||
"21676311",
|
||||
"21676382",
|
||||
"21676606",
|
||||
"21677799",
|
||||
"21677822",
|
||||
"21677868",
|
||||
"21677890",
|
||||
"21677907",
|
||||
"21679302",
|
||||
"21679303",
|
||||
"21679313",
|
||||
"21679458",
|
||||
"21679991",
|
||||
"21680190",
|
||||
"21680232",
|
||||
"21681127",
|
||||
"21682581",
|
||||
"21682648",
|
||||
"21682914",
|
||||
"21683023",
|
||||
"21683646",
|
||||
"21683690",
|
||||
"21683830",
|
||||
"21683879",
|
||||
"21684310",
|
||||
"21684380",
|
||||
"21684779",
|
||||
"21685908",
|
||||
"21685945",
|
||||
"21685959",
|
||||
"21685999",
|
||||
"21686185",
|
||||
"21686203",
|
||||
"21690675",
|
||||
"21690702",
|
||||
"21690793",
|
||||
"21691064",
|
||||
"21691105",
|
||||
"21691679",
|
||||
"21691689",
|
||||
"21691690",
|
||||
"21691708",
|
||||
"21691740",
|
||||
"21693108",
|
||||
"21693399",
|
||||
"21693401",
|
||||
"21693417",
|
||||
"21693503",
|
||||
"21693633",
|
||||
"21693675",
|
||||
"21693725",
|
||||
"21694003",
|
||||
"21694148",
|
||||
"21694606",
|
||||
"21694772",
|
||||
"21695017",
|
||||
"21695139",
|
||||
"21695213",
|
||||
"21695300",
|
||||
"21695559",
|
||||
"21696322",
|
||||
"21696356",
|
||||
"21696546",
|
||||
"21696563",
|
||||
"21696880",
|
||||
"21696910",
|
||||
"21696952",
|
||||
"21696987",
|
||||
"21697000",
|
||||
"21697001",
|
||||
"21697042",
|
||||
"21697170",
|
||||
"21697232",
|
||||
"21697333",
|
||||
"21697411",
|
||||
"21697471",
|
||||
"21698048",
|
||||
"21698912",
|
||||
"21700124",
|
||||
"21700187",
|
||||
"21700193",
|
||||
"21700204",
|
||||
"21700228",
|
||||
"21700306",
|
||||
"21700623",
|
||||
"21700880",
|
||||
"21700970",
|
||||
"21702275",
|
||||
"21702866",
|
||||
"21702911",
|
||||
"21702936",
|
||||
"21703158",
|
||||
"21703205",
|
||||
"21703212",
|
||||
"21703226",
|
||||
"21703239",
|
||||
"21703280",
|
||||
"21703323",
|
||||
"21704300",
|
||||
"21705852",
|
||||
"21706048",
|
||||
"21706115",
|
||||
"21706324",
|
||||
"21706462",
|
||||
"21706629",
|
||||
"21706943",
|
||||
"21707600",
|
||||
"21707816",
|
||||
"21707916",
|
||||
"21707937",
|
||||
"21707955",
|
||||
"21708877",
|
||||
"21708949",
|
||||
"21709030",
|
||||
"21709259",
|
||||
"21709320",
|
||||
"21709377",
|
||||
"21709469",
|
||||
"21709495",
|
||||
"21709497",
|
||||
"21709530",
|
||||
"21711034",
|
||||
"21713874",
|
||||
"21714151",
|
||||
"21715605",
|
||||
"21716330",
|
||||
"21716537",
|
||||
"21716854",
|
||||
"21716871",
|
||||
"21716884",
|
||||
"21716952",
|
||||
"21716995",
|
||||
"21717065",
|
||||
"21717208",
|
||||
"21717479",
|
||||
"21717530",
|
||||
"21717698",
|
||||
"21720828",
|
||||
"21721007",
|
||||
"21721255",
|
||||
"21721298",
|
||||
"21721458",
|
||||
"21721933",
|
||||
"21721978",
|
||||
"21722035",
|
||||
"21722071",
|
||||
"21722558",
|
||||
"21723195",
|
||||
"21723310",
|
||||
"21724694",
|
||||
"21725621",
|
||||
"21725655",
|
||||
"21725863",
|
||||
"21725909",
|
||||
"21725952",
|
||||
"21726108",
|
||||
"21726125",
|
||||
"21726331",
|
||||
"21727314",
|
||||
"21727452",
|
||||
"21727617",
|
||||
"21727619",
|
||||
"21728345",
|
||||
"21728526",
|
||||
"21728583",
|
||||
"21728615",
|
||||
"21728650",
|
||||
"21728764",
|
||||
"21728791",
|
||||
"21728847",
|
||||
"21728907",
|
||||
"21729062",
|
||||
"21729081",
|
||||
"21729171",
|
||||
"21729241",
|
||||
"21729672",
|
||||
"21729824",
|
||||
"21730257",
|
||||
"21730487",
|
||||
"21730520",
|
||||
"21731163",
|
||||
"21732790",
|
||||
"21732844",
|
||||
"21733127",
|
||||
"21735223",
|
||||
"21735305",
|
||||
"21737953",
|
||||
"21737972",
|
||||
"21738176",
|
||||
"21738367",
|
||||
"21738423",
|
||||
"21738461",
|
||||
"21739157",
|
||||
"21739180",
|
||||
"21739197",
|
||||
"21739440",
|
||||
"21739590",
|
||||
"21739692",
|
||||
"21739805",
|
||||
"21739819",
|
||||
"21739829",
|
||||
"21739857",
|
||||
"21739941",
|
||||
"21742298",
|
||||
"21742905",
|
||||
"21744704",
|
||||
"21744719",
|
||||
"21745213",
|
||||
"21745327",
|
||||
"21745554",
|
||||
"21745610",
|
||||
"21745691",
|
||||
"21745719",
|
||||
"21745729",
|
||||
"21745735",
|
||||
"21745768",
|
||||
"21745793",
|
||||
"21745814",
|
||||
"21745892",
|
||||
"21746227",
|
||||
"21746391",
|
||||
"21746460",
|
||||
"21746500",
|
||||
"21746524",
|
||||
"21746727",
|
||||
"21746741",
|
||||
"21746805",
|
||||
"21747031",
|
||||
"21747077",
|
||||
"21747132",
|
||||
"21747139",
|
||||
"21747154",
|
||||
"21748546",
|
||||
"21748650",
|
||||
"21748683",
|
||||
"21748729",
|
||||
"21748880",
|
||||
"21748954",
|
||||
"21749017",
|
||||
"21749018",
|
||||
"21749057",
|
||||
"21749743",
|
||||
"21750050",
|
||||
"21750078",
|
||||
"21750108",
|
||||
"21750137",
|
||||
"21750203",
|
||||
"21750220",
|
||||
"21750227",
|
||||
"21750235",
|
||||
"21750314",
|
||||
"21750392",
|
||||
"21750509",
|
||||
"21750635",
|
||||
"21750646",
|
||||
"21750693",
|
||||
"21750701",
|
||||
"21750719",
|
||||
"21750740",
|
||||
"21750745",
|
||||
"21750798",
|
||||
"21750828",
|
||||
"21750839",
|
||||
"21750876",
|
||||
"21751074",
|
||||
"21751445",
|
||||
"21754529",
|
||||
"21754600",
|
||||
"21754628",
|
||||
"21754851",
|
||||
"21754961",
|
||||
"21755023",
|
||||
"21755137",
|
||||
"21755746",
|
||||
"21755882",
|
||||
"21755900",
|
||||
"21755925",
|
||||
"21755951",
|
||||
"21755985",
|
||||
"21756001",
|
||||
"21756138",
|
||||
"21756234",
|
||||
"21756455",
|
||||
"21758328",
|
||||
"21758343",
|
||||
"21758443",
|
||||
"21758559",
|
||||
"21758617",
|
||||
"21758632",
|
||||
"21758831",
|
||||
"21759394",
|
||||
"21759468",
|
||||
"21759790",
|
||||
"21760059",
|
||||
"21760426",
|
||||
"21760439",
|
||||
"21760902",
|
||||
"21761316",
|
||||
"21761485",
|
||||
"21761794",
|
||||
"21761912",
|
||||
"21762153",
|
||||
"21762724",
|
||||
"21762778",
|
||||
"21763292",
|
||||
"21763309",
|
||||
"21763333",
|
||||
"21763382",
|
||||
"21763436",
|
||||
"21763445",
|
||||
"21764162",
|
||||
"21764224",
|
||||
"21764388",
|
||||
"21766045",
|
||||
"21766046",
|
||||
"21766162",
|
||||
"21766259",
|
||||
"21766699",
|
||||
"21766814",
|
||||
"21766966",
|
||||
"21769787",
|
||||
"21771694",
|
||||
"21771760",
|
||||
"21771934",
|
||||
"21771978",
|
||||
"21772100",
|
||||
"21772383",
|
||||
"21772859",
|
||||
"21772962",
|
||||
"21773024",
|
||||
"21775003",
|
||||
"21779013",
|
||||
"21779873",
|
||||
"21779964",
|
||||
"21780117",
|
||||
"21780151",
|
||||
"21780192",
|
||||
"21780370",
|
||||
"21780453",
|
||||
"21780605",
|
||||
"21780617",
|
||||
"21780650",
|
||||
"21780676",
|
||||
"21780702",
|
||||
"21780708",
|
||||
"21780954",
|
||||
"21780991",
|
||||
"21781032",
|
||||
"21781158",
|
||||
"21781202",
|
||||
"21781256",
|
||||
"21781339",
|
||||
"21782125",
|
||||
"21782233",
|
||||
"21782350",
|
||||
"21782429",
|
||||
"21782532",
|
||||
"21782561",
|
||||
"21782684",
|
||||
"21782894",
|
||||
"21782920",
|
||||
"21783332",
|
||||
"21784020",
|
||||
"21784068",
|
||||
"21784072",
|
||||
"21784163",
|
||||
"21784460",
|
||||
"21784518",
|
||||
"21785281",
|
||||
"21786006",
|
||||
"21787591",
|
||||
"21787949",
|
||||
"21787966",
|
||||
"21788007",
|
||||
"21788022",
|
||||
"21788228",
|
||||
"21788668",
|
||||
"21789126",
|
||||
"21791458",
|
||||
"21791579",
|
||||
"21791641",
|
||||
"21792009",
|
||||
"21792156",
|
||||
"21792226",
|
||||
"21792287",
|
||||
"21792451",
|
||||
"21792693",
|
||||
"21792840",
|
||||
"21793780",
|
||||
"21794244",
|
||||
"21794283",
|
||||
"21795095",
|
||||
"21795520",
|
||||
"21795569",
|
||||
"21795628",
|
||||
"21795889",
|
||||
"21796088",
|
||||
"21796312",
|
||||
"21796576",
|
||||
"21796599",
|
||||
"21796813",
|
||||
"21797556",
|
||||
"21797739",
|
||||
"21797795",
|
||||
"21797949",
|
||||
"21798579",
|
||||
"21798612",
|
||||
"21798624",
|
||||
"21798640",
|
||||
"21798736",
|
||||
"21798766",
|
||||
"21798800",
|
||||
"21798910",
|
||||
"21798945",
|
||||
"21798993",
|
||||
"21799192",
|
||||
"21799210",
|
||||
"21799413",
|
||||
"21799428",
|
||||
"21799445",
|
||||
"21799701",
|
||||
"21799758",
|
||||
"21800057",
|
||||
"21800133",
|
||||
"21800267",
|
||||
"21803663",
|
||||
"21804745",
|
||||
"21804865",
|
||||
"21804934",
|
||||
"21805927",
|
||||
"21807308",
|
||||
"21808139",
|
||||
"21809975",
|
||||
"21813220",
|
||||
"21814390",
|
||||
"21814966",
|
||||
"21815097",
|
||||
"21815258",
|
||||
"21815438",
|
||||
"21815762",
|
||||
"21816114",
|
||||
"21816288",
|
||||
"21818063",
|
||||
"21818159",
|
||||
"21818167",
|
||||
"21818332",
|
||||
"21818449",
|
||||
"21818480",
|
||||
"21818490",
|
||||
"21818513",
|
||||
"21818550",
|
||||
"21818803"
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
260021
test.ipynb
260021
test.ipynb
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10525
一票一件订单.ipynb
10525
一票一件订单.ipynb
File diff suppressed because it is too large
Load Diff
49
产品上限优化.ipynb
49
产品上限优化.ipynb
|
|
@ -2,7 +2,7 @@
|
|||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
"\t\tLEFT JOIN dws.order_product_list opl ON t2.SKU = opl.SKU \n",
|
||||
"\tWHERE\n",
|
||||
"\t\tt1.添加时间 BETWEEN '2023-01-01' \n",
|
||||
"\t\tAND '2025-06-16 23:59:59' \n",
|
||||
"\t\tAND '2024-12-31 23:59:59' \n",
|
||||
"\t\tAND 产品分类 = '{categories}'\n",
|
||||
"\t\tAND t2.SKU IS NOT NULL \n",
|
||||
"\t),\n",
|
||||
|
|
@ -73,7 +73,9 @@
|
|||
"source": [
|
||||
"import json\n",
|
||||
"import re\n",
|
||||
"from utils import Package,Package_group\n",
|
||||
"\n",
|
||||
"import numpy as np\n",
|
||||
"\n",
|
||||
"from sell.sell_price import call_sell_and_order_price\n",
|
||||
"def extract_number(value):\n",
|
||||
" # 提取字符串中的第一个数字\n",
|
||||
|
|
@ -91,9 +93,9 @@
|
|||
" package['高'] = extract_number(package['高'])\n",
|
||||
" package['重量'] = extract_number(package['重量'])\n",
|
||||
" size =sorted([package['长'],package['宽'],package['高']])\n",
|
||||
" fst_size = size[0]\n",
|
||||
" fst_size = size[2]\n",
|
||||
" snd_size = size[1]\n",
|
||||
" thd_size = size[2]\n",
|
||||
" thd_size = size[0]\n",
|
||||
" max_length=max(max_length,fst_size)\n",
|
||||
" max_girth=max(max_girth,fst_size+(snd_size+thd_size)*2)\n",
|
||||
" all_weight+=package['重量']/1000\n",
|
||||
|
|
@ -107,8 +109,43 @@
|
|||
" df.loc[index,'最大围长'] = max_girth\n",
|
||||
" df.loc[index,'总重量'] = all_weight\n",
|
||||
" df.loc[index,'总抛重'] = all_vol_weight\n",
|
||||
" print(index)\n",
|
||||
"\n",
|
||||
"# 按照那个分组,按照总抛重,每5总抛重为一组,最长边取大,最短边取小,最大实重取大,最小实重取小,网站售价求和,物流分摊费求和,订单物流费求和,尾端类型不要,"
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# 按照那个分组,按照总抛重,每5总抛重为一组,最长边取大,最短边取小,最大实重取大,最小实重取小,网站售价求和,物流分摊费求和,订单物流费求和,尾端类型不要,\n",
|
||||
"cost_bins = list(range(0, 4000, 10)) +[28700]\n",
|
||||
"df['成本价分组'] = pd.cut(df['成本价'], bins=cost_bins, right=True, labels=cost_bins[1:])\n",
|
||||
"\n",
|
||||
"# 2. 总抛重分组(按5为一组,0-5 为一组,5.01-10 为一组,等)\n",
|
||||
"df['总抛重分组'] = (np.ceil(df['总抛重'] / 5) * 5).astype(int)\n",
|
||||
"df = df.dropna(subset=['成本价分组'])\n",
|
||||
"# 3. 分组聚合\n",
|
||||
"agg_df = df.groupby(['成本价分组', '总抛重分组'], observed=True).agg({\n",
|
||||
" '最长边': ['max', 'min'], # 每组最大 每组最小\n",
|
||||
" '最大围长': 'max',\n",
|
||||
" '总重量': ['max', 'min','sum'], # 分别取最大/最小实重\n",
|
||||
" '网站售价': 'sum',\n",
|
||||
" '物流分摊费': 'sum',\n",
|
||||
" '订单物流费': 'sum',\n",
|
||||
" 'SKU': 'count'\n",
|
||||
"}).reset_index()\n",
|
||||
"\n",
|
||||
"# 4. 重命名列\n",
|
||||
"agg_df.columns = [\n",
|
||||
" '成本价分组', '总抛重分组',\n",
|
||||
" '最长边max', '最长边min', '最大围长',\n",
|
||||
" '总重量max', '总重量min','总重量',\n",
|
||||
" '网站售价', '物流分摊费', '订单物流费','SKU种类'\n",
|
||||
"]\n",
|
||||
"agg_df.to_clipboard(index=False)"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
BIN
单包裹SKU售价分析.xlsx (Stored with Git LFS)
BIN
单包裹SKU售价分析.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
单包裹SKU售价分析1.xlsx (Stored with Git LFS)
BIN
单包裹SKU售价分析1.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/1-3月利润分段.xlsx (Stored with Git LFS)
BIN
拦截数据/1-3月利润分段.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/batch_release.xlsx (Stored with Git LFS)
BIN
拦截数据/batch_release.xlsx (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
拦截数据/product_property_data.xlsx (Stored with Git LFS)
BIN
拦截数据/product_property_data.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/~$batch_release.xlsx (Stored with Git LFS)
BIN
拦截数据/~$batch_release.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/~$product_property_data.xlsx (Stored with Git LFS)
BIN
拦截数据/~$product_property_data.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/~$工作日报-文雪茜.xlsx (Stored with Git LFS)
BIN
拦截数据/~$工作日报-文雪茜.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/~$拦截总表.xlsx (Stored with Git LFS)
BIN
拦截数据/~$拦截总表.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/~$订单数据.xlsx (Stored with Git LFS)
BIN
拦截数据/~$订单数据.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/一票一件发货订单.xlsx (Stored with Git LFS)
BIN
拦截数据/一票一件发货订单.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/包裹自动拦截.csv (Stored with Git LFS)
BIN
拦截数据/包裹自动拦截.csv (Stored with Git LFS)
Binary file not shown.
|
BIN
拦截数据/处理表.xlsx (Stored with Git LFS)
BIN
拦截数据/处理表.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/拦截总表.xlsx (Stored with Git LFS)
BIN
拦截数据/拦截总表.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/拦截总表1.xlsx (Stored with Git LFS)
BIN
拦截数据/拦截总表1.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/拦截总表2.xlsx (Stored with Git LFS)
BIN
拦截数据/拦截总表2.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/拦截总表3.xlsx (Stored with Git LFS)
BIN
拦截数据/拦截总表3.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/拦截订单登记明细.xlsx (Stored with Git LFS)
BIN
拦截数据/拦截订单登记明细.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/提单价格.xlsx (Stored with Git LFS)
BIN
拦截数据/提单价格.xlsx (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
拦截数据/美国07-12预测和实际物流成本对比.xlsx (Stored with Git LFS)
BIN
拦截数据/美国07-12预测和实际物流成本对比.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/订单产品号自动拦截.csv (Stored with Git LFS)
BIN
拦截数据/订单产品号自动拦截.csv (Stored with Git LFS)
Binary file not shown.
|
BIN
拦截数据/订单数据.xlsx (Stored with Git LFS)
BIN
拦截数据/订单数据.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/订单数据1.xlsx (Stored with Git LFS)
BIN
拦截数据/订单数据1.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/订单数据2.xlsx (Stored with Git LFS)
BIN
拦截数据/订单数据2.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/订单数据3.xlsx (Stored with Git LFS)
BIN
拦截数据/订单数据3.xlsx (Stored with Git LFS)
Binary file not shown.
BIN
拦截数据/采购流程时间比.xlsx (Stored with Git LFS)
BIN
拦截数据/采购流程时间比.xlsx (Stored with Git LFS)
Binary file not shown.
|
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "a13175db",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"BASE_SQL = \"\"\"\n",
|
||||
"WITH \n",
|
||||
"odr_list AS ( \n",
|
||||
" SELECT \n",
|
||||
" dwd.order_list.order_id,\n",
|
||||
" dwd.order_list.site_name,\n",
|
||||
" dwd.order_list.order_date,\n",
|
||||
" dwd.order_list.delivery_country,\n",
|
||||
" dwd.order_list.postcode,\n",
|
||||
" dwd.order_list.currency,\n",
|
||||
" dwd.order_list.order_price,\n",
|
||||
" dwd.order_list.order_freight_price,\n",
|
||||
" dwd.order_list.order_price_dollar,\n",
|
||||
" dwd.order_list.order_freight_price_dollar,\n",
|
||||
" dwd.order_list.insurance,\n",
|
||||
" dwd.order_list.discount_code,\n",
|
||||
" dwd.order_list.order_cate,\n",
|
||||
" dwd.order_list.fund_status,\n",
|
||||
" dwd.order_list.convey \n",
|
||||
" FROM \n",
|
||||
" dwd.order_list \n",
|
||||
" WHERE \n",
|
||||
" site_name REGEXP \"^litfad|beau|kwowking|lakiq\" \n",
|
||||
" AND fund_status NOT REGEXP \"等待\" \n",
|
||||
" AND DATE_FORMAT(order_date,\"%Y-%m-01\") >= \"2025-06-01\"\n",
|
||||
"),\n",
|
||||
"\n",
|
||||
"refund AS (\n",
|
||||
" SELECT\n",
|
||||
" ol.order_id,\n",
|
||||
" SUM(`当次退款USD金额`) AS \"总退款金额\",\n",
|
||||
" sum(`当次退款申请比例`) AS \"当次退款申请比例\",\n",
|
||||
" `原订单退款比例`,\n",
|
||||
" MAX(`申请时间`) AS \"最后一次申请时间\"\n",
|
||||
" FROM\n",
|
||||
" dwd.`cpmaso_order_refund` cof\n",
|
||||
" LEFT JOIN dwd.order_list ol ON ol.order_id = cof.order_id \n",
|
||||
" WHERE\n",
|
||||
" 状态 = \"退款成功\" \n",
|
||||
" AND 网站 REGEXP \"litfad|lakiq|kwoking|beau\" \n",
|
||||
" AND ol.order_date >= \"2025-01-01\" \n",
|
||||
" AND EXISTS (\n",
|
||||
" SELECT 1 FROM odr_list WHERE odr_list.order_id = cof.order_id\n",
|
||||
" )\n",
|
||||
" GROUP BY\n",
|
||||
" ol.order_id\n",
|
||||
"),\n",
|
||||
"-- WITH\n",
|
||||
"sub_order AS (\n",
|
||||
"SELECT DISTINCT\n",
|
||||
" opl.order_id,\n",
|
||||
"\n",
|
||||
" CASE \n",
|
||||
" WHEN (LENGTH(opl.order_product_id) - LENGTH(REPLACE(opl.order_product_id, '_', ''))) = 1 THEN opl.order_product_id\n",
|
||||
" ELSE SUBSTRING_INDEX(opl.order_product_id, '_', 2)\n",
|
||||
" END AS 子订单号,\n",
|
||||
"\n",
|
||||
" CASE \n",
|
||||
" WHEN (LENGTH(opl.order_product_id) - LENGTH(REPLACE(opl.order_product_id, '_', ''))) = 2 THEN opl.order_product_id\n",
|
||||
" ELSE NULL\n",
|
||||
" END AS 子子订单号,\n",
|
||||
"\n",
|
||||
" lor.redo_type AS 补发类型\n",
|
||||
"-- wp.actual_price * wp.buy_num AS 采购金额,\n",
|
||||
"-- buy_audit\n",
|
||||
"\n",
|
||||
"FROM dwd.order_product_list opl \n",
|
||||
"LEFT JOIN dws.log_order_reissue_detail lord \n",
|
||||
" ON lord.order_product_id = opl.order_product_id\n",
|
||||
"LEFT JOIN dwd.log_order_reissue lor \n",
|
||||
" ON lord.order_product_id = lor.order_product_id\n",
|
||||
"WHERE DATE_FORMAT(opl.order_date, \"%Y-%m-01\") >= \"2025-06-01\"\n",
|
||||
"\n",
|
||||
"),\n",
|
||||
"sub_order2 AS (\n",
|
||||
"SELECT\n",
|
||||
"order_id,\n",
|
||||
"COUNT(CASE WHEN 子子订单号 IS NULL THEN 1 ELSE NULL END) AS 子订单数,\n",
|
||||
"COUNT(CASE WHEN 子子订单号 IS NOT NULL THEN 1 ELSE NULL END) AS 子子订单数,\n",
|
||||
"COUNT(CASE WHEN 子子订单号 IS NOT NULL AND 补发类型 REGEXP \"配件补发|整件补发\" THEN 1 ELSE NULL END) AS 补发订单数,\n",
|
||||
"COUNT(CASE WHEN 子子订单号 IS NOT NULL AND 补发类型 REGEXP \"换款\" THEN 1 ELSE NULL END) AS 换款订单数,\n",
|
||||
"COUNT(CASE WHEN 子子订单号 IS NOT NULL AND 补发类型 NOT REGEXP \"换款|配件补发|整件补发\" AND 补发类型 IS NOT NULL THEN 1 ELSE NULL END) AS 其他补发数,\n",
|
||||
"COUNT(CASE WHEN 子子订单号 IS NOT NULL AND 补发类型 IS NULL THEN 1 ELSE NULL END) AS 拆分订单数\n",
|
||||
"FROM\n",
|
||||
"sub_order\n",
|
||||
"GROUP BY order_id\n",
|
||||
"),\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"is_shipping AS (\n",
|
||||
"SELECT\n",
|
||||
" opl.order_id,\n",
|
||||
" count(distinct CASE WHEN oe.`关联提单号`<>\"--\" AND oe.`关联提单号`<>\"未关联\" AND oe.`包裹状态` not in ( \"已作废\",\"已删除\") THEN oe.`包裹号` ELSE null END) AS 已发货包裹数,\n",
|
||||
" COUNT(DISTINCT CASE WHEN oe.`包裹状态` not in ( \"已作废\",\"已删除\",\"--\") THEN oe.`包裹号` ELSE null END)AS 所有包裹数,\n",
|
||||
" MIN(oe.`客户签收时间`) AS 客户最早签收时间\n",
|
||||
" FROM order_express oe \n",
|
||||
" left join dwd.order_product_list opl on oe.`单号` = opl.order_id \n",
|
||||
" WHERE DATE_FORMAT(opl.order_date,\"%Y-%m-%d\") >'2025-01-01'\n",
|
||||
" GROUP BY opl.order_id\n",
|
||||
" \n",
|
||||
")\n",
|
||||
"\n",
|
||||
"SELECT\n",
|
||||
" ol.*,\n",
|
||||
" rf.总退款金额,\n",
|
||||
" 当次退款申请比例,\n",
|
||||
" 原订单退款比例,\n",
|
||||
" 最后一次申请时间,\n",
|
||||
" so.子订单数,\n",
|
||||
" so.子子订单数,\n",
|
||||
" so.补发订单数,\n",
|
||||
" so.换款订单数,\n",
|
||||
" so.其他补发数,\n",
|
||||
" so.拆分订单数,\n",
|
||||
" CASE when sp.已发货包裹数 =sp.所有包裹数 then \"订单已发货\"\n",
|
||||
" WHEN sp.已发货包裹数 < sp.所有包裹数 THEN \"部分发货\"\n",
|
||||
" WHEN sp.已发货包裹数 = 0 then\"未发货\" ELSE \"无包裹\" END AS \"订单发货状态\" ,\n",
|
||||
" sp.客户最早签收时间\n",
|
||||
"FROM\n",
|
||||
" odr_list ol\n",
|
||||
" LEFT JOIN refund rf ON ol.order_id = rf.order_id\n",
|
||||
" LEFT JOIN sub_order2 so ON ol.order_id = so.order_id\n",
|
||||
" LEFT JOIN is_shipping sp ON ol.order_id = sp.order_id\"\"\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "6b6089e2",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"\n",
|
||||
"#然后提取这些包裹号的提单ID\n",
|
||||
"#分析这些提单ID的总价和平均价格\n",
|
||||
"from utils.gtools import MySQLconnect\n",
|
||||
"import pandas as pd\n",
|
||||
"with MySQLconnect('ods') as db:\n",
|
||||
" engine = db.engine()\n",
|
||||
" order_df = pd.read_sql(BASE_SQL,engine)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "b9140af6",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#提取这些订单号的包裹号\n",
|
||||
"order_id = order_df['order_id'].tolist()\n",
|
||||
"order_ids = ','.join(f\"'{i}'\" for i in order_id)\n",
|
||||
"with MySQLconnect('ods') as db:\n",
|
||||
" conn = db.connect()\n",
|
||||
" cursor = conn.cursor()\n",
|
||||
" sql = f\"SELECT * FROM order_info WHERE order_id IN ({order_ids})\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "5e4096b2",
|
||||
"metadata": {},
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "base",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"name": "python",
|
||||
"version": "3.11.5"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
3274
自动化跟单.ipynb
3274
自动化跟单.ipynb
File diff suppressed because it is too large
Load Diff
781
自动化跟单11.ipynb
781
自动化跟单11.ipynb
|
|
@ -375,7 +375,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-05-16T15:38:46.563968Z",
|
||||
|
|
@ -398,7 +398,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -412,7 +412,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -431,7 +431,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-05-16T15:38:58.960899Z",
|
||||
|
|
@ -446,7 +446,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-05-16T15:39:01.808655Z",
|
||||
|
|
@ -454,772 +454,7 @@
|
|||
},
|
||||
"collapsed": false
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<div>\n",
|
||||
"<style scoped>\n",
|
||||
" .dataframe tbody tr th:only-of-type {\n",
|
||||
" vertical-align: middle;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe tbody tr th {\n",
|
||||
" vertical-align: top;\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
" .dataframe thead th {\n",
|
||||
" text-align: right;\n",
|
||||
" }\n",
|
||||
"</style>\n",
|
||||
"<table border=\"1\" class=\"dataframe\">\n",
|
||||
" <thead>\n",
|
||||
" <tr style=\"text-align: right;\">\n",
|
||||
" <th></th>\n",
|
||||
" <th>cpmaso_task_id</th>\n",
|
||||
" <th>buy_id</th>\n",
|
||||
" <th>trade_id</th>\n",
|
||||
" <th>trade_platform_order_num</th>\n",
|
||||
" <th>pay_date</th>\n",
|
||||
" <th>maintain_date</th>\n",
|
||||
" <th>last_task_id</th>\n",
|
||||
" <th>follow_type</th>\n",
|
||||
" <th>max_logis_date</th>\n",
|
||||
" <th>agreed_delivery_time</th>\n",
|
||||
" <th>trans_id</th>\n",
|
||||
" <th>payment_datetime</th>\n",
|
||||
" <th>platform</th>\n",
|
||||
" <th>task_status</th>\n",
|
||||
" <th>need_refund</th>\n",
|
||||
" <th>has_image</th>\n",
|
||||
" <th>clearly_specify_the_delivery_time</th>\n",
|
||||
" <th>one_more_time</th>\n",
|
||||
" <th>create_date</th>\n",
|
||||
" <th>upload_cpmaso</th>\n",
|
||||
" </tr>\n",
|
||||
" </thead>\n",
|
||||
" <tbody>\n",
|
||||
" <tr>\n",
|
||||
" <th>0</th>\n",
|
||||
" <td>343636</td>\n",
|
||||
" <td>2896029</td>\n",
|
||||
" <td>2896029</td>\n",
|
||||
" <td>2896029</td>\n",
|
||||
" <td>2025-05-20</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-21</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1863624</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-21</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
" <td>343650</td>\n",
|
||||
" <td>2896044</td>\n",
|
||||
" <td>2896044</td>\n",
|
||||
" <td>2896044</td>\n",
|
||||
" <td>2025-05-20</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-27</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1863645</td>\n",
|
||||
" <td>7</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-21</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>2</th>\n",
|
||||
" <td>345441</td>\n",
|
||||
" <td>2896633</td>\n",
|
||||
" <td>2896633</td>\n",
|
||||
" <td>2896633</td>\n",
|
||||
" <td>2025-05-21</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-22</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1864349</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-22</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>3</th>\n",
|
||||
" <td>345460</td>\n",
|
||||
" <td>2896653</td>\n",
|
||||
" <td>896653</td>\n",
|
||||
" <td>896653</td>\n",
|
||||
" <td>2025-05-21</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-22</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1864373</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-22</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>4</th>\n",
|
||||
" <td>345510</td>\n",
|
||||
" <td>2896706</td>\n",
|
||||
" <td>2896706</td>\n",
|
||||
" <td>2896706</td>\n",
|
||||
" <td>2025-05-21</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-23</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1864440</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-22</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>5</th>\n",
|
||||
" <td>347335</td>\n",
|
||||
" <td>2897332</td>\n",
|
||||
" <td>2897332</td>\n",
|
||||
" <td>2897332</td>\n",
|
||||
" <td>2025-05-22</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1865297</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-23</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>6</th>\n",
|
||||
" <td>347339</td>\n",
|
||||
" <td>2897336</td>\n",
|
||||
" <td>2897336</td>\n",
|
||||
" <td>2897336</td>\n",
|
||||
" <td>2025-05-22</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-27</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1865301</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-23</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>7</th>\n",
|
||||
" <td>347345</td>\n",
|
||||
" <td>2897342</td>\n",
|
||||
" <td>2897342</td>\n",
|
||||
" <td>2897342</td>\n",
|
||||
" <td>2025-05-22</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1865307</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-23</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>8</th>\n",
|
||||
" <td>347348</td>\n",
|
||||
" <td>2897345</td>\n",
|
||||
" <td>2897345</td>\n",
|
||||
" <td>2897345</td>\n",
|
||||
" <td>2025-05-22</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-24</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1865308</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-23</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>9</th>\n",
|
||||
" <td>347415</td>\n",
|
||||
" <td>2897416</td>\n",
|
||||
" <td>2897416</td>\n",
|
||||
" <td>2897416</td>\n",
|
||||
" <td>2025-05-22</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-27</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1865406</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-23</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>10</th>\n",
|
||||
" <td>349155</td>\n",
|
||||
" <td>2898014</td>\n",
|
||||
" <td>2578499365301538788</td>\n",
|
||||
" <td>1747991280236</td>\n",
|
||||
" <td>2025-05-23</td>\n",
|
||||
" <td>7</td>\n",
|
||||
" <td>532</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1866518</td>\n",
|
||||
" <td>7</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-24</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>11</th>\n",
|
||||
" <td>349191</td>\n",
|
||||
" <td>2898060</td>\n",
|
||||
" <td>2577712694448538788</td>\n",
|
||||
" <td>501566-186639528980603464</td>\n",
|
||||
" <td>2025-05-23</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>533</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-28</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1866395</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-24</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>12</th>\n",
|
||||
" <td>349219</td>\n",
|
||||
" <td>2898090</td>\n",
|
||||
" <td>2898090</td>\n",
|
||||
" <td>2898090</td>\n",
|
||||
" <td>2025-05-23</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1866272</td>\n",
|
||||
" <td>7</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-24</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>13</th>\n",
|
||||
" <td>349350</td>\n",
|
||||
" <td>2898239</td>\n",
|
||||
" <td>2898239</td>\n",
|
||||
" <td>2898239</td>\n",
|
||||
" <td>2025-05-23</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-28</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1866500</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-24</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>14</th>\n",
|
||||
" <td>352340</td>\n",
|
||||
" <td>2899178</td>\n",
|
||||
" <td>2579933964195538788</td>\n",
|
||||
" <td>501566-186750228991783425</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>537</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1867502</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>15</th>\n",
|
||||
" <td>352363</td>\n",
|
||||
" <td>2899201</td>\n",
|
||||
" <td>4354718580547688148</td>\n",
|
||||
" <td>1748139827823</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>540</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1867773</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>16</th>\n",
|
||||
" <td>352392</td>\n",
|
||||
" <td>2899231</td>\n",
|
||||
" <td>2580629125407538788</td>\n",
|
||||
" <td>501566-186754728992314910</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>542</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1867547</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>17</th>\n",
|
||||
" <td>352494</td>\n",
|
||||
" <td>2899334</td>\n",
|
||||
" <td>2579651619722538788</td>\n",
|
||||
" <td>501566-186769728993341037</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>553</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1867697</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>18</th>\n",
|
||||
" <td>352504</td>\n",
|
||||
" <td>2899345</td>\n",
|
||||
" <td>2580008664490538788</td>\n",
|
||||
" <td>501566-186771428993459718</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>555</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1867714</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>19</th>\n",
|
||||
" <td>352526</td>\n",
|
||||
" <td>2899368</td>\n",
|
||||
" <td>2579710119285538788</td>\n",
|
||||
" <td>501566-186775328993689331</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>558</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1867753</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>20</th>\n",
|
||||
" <td>352631</td>\n",
|
||||
" <td>2899481</td>\n",
|
||||
" <td>2579924751782538788</td>\n",
|
||||
" <td>501566-186789228994817432</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>580</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1867892</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>21</th>\n",
|
||||
" <td>352649</td>\n",
|
||||
" <td>2899501</td>\n",
|
||||
" <td>2899501</td>\n",
|
||||
" <td>2899501</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-28</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1867913</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>22</th>\n",
|
||||
" <td>352698</td>\n",
|
||||
" <td>2899552</td>\n",
|
||||
" <td>4355089779147463948</td>\n",
|
||||
" <td>1748152477497</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>594</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1867983</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>23</th>\n",
|
||||
" <td>352735</td>\n",
|
||||
" <td>2899590</td>\n",
|
||||
" <td>2580755954053538788</td>\n",
|
||||
" <td>501566-186804028995900068</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>601</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1868040</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>24</th>\n",
|
||||
" <td>352741</td>\n",
|
||||
" <td>2899596</td>\n",
|
||||
" <td>2580765530729538788</td>\n",
|
||||
" <td>501566-186804828995968241</td>\n",
|
||||
" <td>2025-05-25</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>603</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>2025-05-30</td>\n",
|
||||
" <td>None</td>\n",
|
||||
" <td>1868048</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>淘天</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2025-05-26</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
"</table>\n",
|
||||
"</div>"
|
||||
],
|
||||
"text/plain": [
|
||||
" cpmaso_task_id buy_id trade_id trade_platform_order_num \\\n",
|
||||
"0 343636 2896029 2896029 2896029 \n",
|
||||
"1 343650 2896044 2896044 2896044 \n",
|
||||
"2 345441 2896633 2896633 2896633 \n",
|
||||
"3 345460 2896653 896653 896653 \n",
|
||||
"4 345510 2896706 2896706 2896706 \n",
|
||||
"5 347335 2897332 2897332 2897332 \n",
|
||||
"6 347339 2897336 2897336 2897336 \n",
|
||||
"7 347345 2897342 2897342 2897342 \n",
|
||||
"8 347348 2897345 2897345 2897345 \n",
|
||||
"9 347415 2897416 2897416 2897416 \n",
|
||||
"10 349155 2898014 2578499365301538788 1747991280236 \n",
|
||||
"11 349191 2898060 2577712694448538788 501566-186639528980603464 \n",
|
||||
"12 349219 2898090 2898090 2898090 \n",
|
||||
"13 349350 2898239 2898239 2898239 \n",
|
||||
"14 352340 2899178 2579933964195538788 501566-186750228991783425 \n",
|
||||
"15 352363 2899201 4354718580547688148 1748139827823 \n",
|
||||
"16 352392 2899231 2580629125407538788 501566-186754728992314910 \n",
|
||||
"17 352494 2899334 2579651619722538788 501566-186769728993341037 \n",
|
||||
"18 352504 2899345 2580008664490538788 501566-186771428993459718 \n",
|
||||
"19 352526 2899368 2579710119285538788 501566-186775328993689331 \n",
|
||||
"20 352631 2899481 2579924751782538788 501566-186789228994817432 \n",
|
||||
"21 352649 2899501 2899501 2899501 \n",
|
||||
"22 352698 2899552 4355089779147463948 1748152477497 \n",
|
||||
"23 352735 2899590 2580755954053538788 501566-186804028995900068 \n",
|
||||
"24 352741 2899596 2580765530729538788 501566-186804828995968241 \n",
|
||||
"\n",
|
||||
" pay_date maintain_date last_task_id follow_type max_logis_date \\\n",
|
||||
"0 2025-05-20 0 0 1 2025-05-21 \n",
|
||||
"1 2025-05-20 0 0 1 2025-05-27 \n",
|
||||
"2 2025-05-21 0 0 1 2025-05-22 \n",
|
||||
"3 2025-05-21 0 0 1 2025-05-22 \n",
|
||||
"4 2025-05-21 0 0 1 2025-05-23 \n",
|
||||
"5 2025-05-22 0 0 1 2025-05-25 \n",
|
||||
"6 2025-05-22 0 0 1 2025-05-27 \n",
|
||||
"7 2025-05-22 0 0 1 2025-05-25 \n",
|
||||
"8 2025-05-22 0 0 1 2025-05-24 \n",
|
||||
"9 2025-05-22 0 0 1 2025-05-27 \n",
|
||||
"10 2025-05-23 7 532 1 2025-05-30 \n",
|
||||
"11 2025-05-23 3 533 1 2025-05-28 \n",
|
||||
"12 2025-05-23 0 0 1 2025-05-30 \n",
|
||||
"13 2025-05-23 0 0 1 2025-05-28 \n",
|
||||
"14 2025-05-25 0 537 1 2025-05-30 \n",
|
||||
"15 2025-05-25 5 540 1 2025-05-30 \n",
|
||||
"16 2025-05-25 0 542 1 2025-05-30 \n",
|
||||
"17 2025-05-25 0 553 1 2025-05-30 \n",
|
||||
"18 2025-05-25 0 555 1 2025-05-30 \n",
|
||||
"19 2025-05-25 0 558 1 2025-05-30 \n",
|
||||
"20 2025-05-25 0 580 1 2025-05-30 \n",
|
||||
"21 2025-05-25 0 0 1 2025-05-28 \n",
|
||||
"22 2025-05-25 5 594 1 2025-05-30 \n",
|
||||
"23 2025-05-25 0 601 1 2025-05-30 \n",
|
||||
"24 2025-05-25 5 603 1 2025-05-30 \n",
|
||||
"\n",
|
||||
" agreed_delivery_time trans_id payment_datetime platform task_status \\\n",
|
||||
"0 None 1863624 1 淘天 0 \n",
|
||||
"1 None 1863645 7 淘天 0 \n",
|
||||
"2 None 1864349 1 淘天 0 \n",
|
||||
"3 None 1864373 1 淘天 0 \n",
|
||||
"4 None 1864440 2 淘天 0 \n",
|
||||
"5 None 1865297 3 淘天 0 \n",
|
||||
"6 None 1865301 5 淘天 0 \n",
|
||||
"7 None 1865307 3 淘天 0 \n",
|
||||
"8 None 1865308 2 淘天 0 \n",
|
||||
"9 None 1865406 5 淘天 0 \n",
|
||||
"10 None 1866518 7 淘天 0 \n",
|
||||
"11 None 1866395 5 淘天 0 \n",
|
||||
"12 None 1866272 7 淘天 0 \n",
|
||||
"13 None 1866500 5 淘天 0 \n",
|
||||
"14 None 1867502 5 淘天 0 \n",
|
||||
"15 None 1867773 3 淘天 0 \n",
|
||||
"16 None 1867547 5 淘天 0 \n",
|
||||
"17 None 1867697 5 淘天 0 \n",
|
||||
"18 None 1867714 5 淘天 0 \n",
|
||||
"19 None 1867753 5 淘天 0 \n",
|
||||
"20 None 1867892 5 淘天 0 \n",
|
||||
"21 None 1867913 3 淘天 0 \n",
|
||||
"22 None 1867983 5 淘天 0 \n",
|
||||
"23 None 1868040 5 淘天 0 \n",
|
||||
"24 None 1868048 5 淘天 0 \n",
|
||||
"\n",
|
||||
" need_refund has_image clearly_specify_the_delivery_time one_more_time \\\n",
|
||||
"0 0 0 0 0 \n",
|
||||
"1 0 0 0 0 \n",
|
||||
"2 0 0 0 0 \n",
|
||||
"3 0 0 0 0 \n",
|
||||
"4 0 0 0 0 \n",
|
||||
"5 0 0 0 0 \n",
|
||||
"6 0 0 0 0 \n",
|
||||
"7 0 0 0 0 \n",
|
||||
"8 0 0 0 0 \n",
|
||||
"9 0 0 0 0 \n",
|
||||
"10 0 0 0 0 \n",
|
||||
"11 0 0 0 0 \n",
|
||||
"12 0 0 0 0 \n",
|
||||
"13 0 0 0 0 \n",
|
||||
"14 0 0 0 0 \n",
|
||||
"15 0 0 0 0 \n",
|
||||
"16 0 0 0 0 \n",
|
||||
"17 0 0 0 0 \n",
|
||||
"18 0 0 0 0 \n",
|
||||
"19 0 0 0 0 \n",
|
||||
"20 0 0 0 0 \n",
|
||||
"21 0 0 0 0 \n",
|
||||
"22 0 0 0 0 \n",
|
||||
"23 0 0 0 0 \n",
|
||||
"24 0 0 0 0 \n",
|
||||
"\n",
|
||||
" create_date upload_cpmaso \n",
|
||||
"0 2025-05-21 0 \n",
|
||||
"1 2025-05-21 0 \n",
|
||||
"2 2025-05-22 0 \n",
|
||||
"3 2025-05-22 0 \n",
|
||||
"4 2025-05-22 0 \n",
|
||||
"5 2025-05-23 0 \n",
|
||||
"6 2025-05-23 0 \n",
|
||||
"7 2025-05-23 0 \n",
|
||||
"8 2025-05-23 0 \n",
|
||||
"9 2025-05-23 0 \n",
|
||||
"10 2025-05-24 0 \n",
|
||||
"11 2025-05-24 0 \n",
|
||||
"12 2025-05-24 0 \n",
|
||||
"13 2025-05-24 0 \n",
|
||||
"14 2025-05-26 0 \n",
|
||||
"15 2025-05-26 0 \n",
|
||||
"16 2025-05-26 0 \n",
|
||||
"17 2025-05-26 0 \n",
|
||||
"18 2025-05-26 0 \n",
|
||||
"19 2025-05-26 0 \n",
|
||||
"20 2025-05-26 0 \n",
|
||||
"21 2025-05-26 0 \n",
|
||||
"22 2025-05-26 0 \n",
|
||||
"23 2025-05-26 0 \n",
|
||||
"24 2025-05-26 0 "
|
||||
]
|
||||
},
|
||||
"execution_count": 16,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"df = pd.read_sql(sql,mdm.engine())\n",
|
||||
"df"
|
||||
|
|
@ -1227,7 +462,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 17,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-05-15T15:26:13.035452Z",
|
||||
|
|
@ -1251,7 +486,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2025-05-16T15:45:35.889562Z",
|
||||
|
|
|
|||
145
账单预测.ipynb
145
账单预测.ipynb
|
|
@ -4,75 +4,7 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"C:\\Users\\Admin\\AppData\\Local\\Temp\\ipykernel_18728\\4048319598.py:101: UserWarning: pandas only supports SQLAlchemy connectable (engine/connection) or database string URI or sqlite3 DBAPI2 connection. Other DBAPI2 objects are not tested. Please consider using SQLAlchemy.\n",
|
||||
" df=pd.read_sql(sql,db.con)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
" 包裹测量时间 order_id SKU 订单时间 \\\n",
|
||||
"0 2025-03-01 14:06:35 250225025414549 22696 2025-February-25th \n",
|
||||
"1 2025-04-02 15:44:20 250330050647870 220934 2025-March-30th \n",
|
||||
"2 2025-03-03 16:31:27 250225062602893 221468 2025-February-25th \n",
|
||||
"3 2025-03-15 10:37:19 250311002220317 222890 2025-March-11th \n",
|
||||
"4 2025-04-03 18:16:25 250331190637251 224072 2025-March-31st \n",
|
||||
"... ... ... ... ... \n",
|
||||
"13489 2025-05-04 16:39:49 250429213610207 2207148642 2025-April-29th \n",
|
||||
"13490 2025-05-04 13:03:06 250501025810935 2207161446 2025-May-1st \n",
|
||||
"13491 2025-05-05 17:41:38 250430063602142 2207176415 2025-April-30th \n",
|
||||
"13492 2025-05-02 13:33:34 250430035236822 2207192083 2025-April-30th \n",
|
||||
"13493 2025-05-08 20:15:50 250430104809255 2207202010 2025-April-30th \n",
|
||||
"\n",
|
||||
" 包裹号 快递公司 运输方式 目的国 postcode ERP采购价 \\\n",
|
||||
"0 991344640 海MS-FEDEX 海运 United States 55414 50.0 \n",
|
||||
"1 991399418 海MS-FEDEX 海运 United States 37014 45.0 \n",
|
||||
"2 991348761 海MS-FEDEX02 海运 United States 11803 65.0 \n",
|
||||
"3 991369401 海MS-FEDEX02 海运 United States 54568-9248 35.0 \n",
|
||||
"4 991401728 海MS-FEDEX 海运 United States 34112 180.0 \n",
|
||||
"... ... ... ... ... ... ... \n",
|
||||
"13489 991447512 海MS-FEDEX-SAIR-H 海运 United States 32168 NaN \n",
|
||||
"13490 991446594 海MS-FEDEX-SAIR-H 海运 United States 92647 NaN \n",
|
||||
"13491 991449178 海MS-FEDEX-SAIR-H 海运 United States 90019 518.0 \n",
|
||||
"13492 991444756 海MS-FEDEX-SAIR-H 海运 United States 78572 228.0 \n",
|
||||
"13493 991454248 海MS-FEDEX-SAIR-H 海运 United States 89129 NaN \n",
|
||||
"\n",
|
||||
" ERP包裹数据 \\\n",
|
||||
"0 {\"包裹1\": {\"宽\": \"21.0\", \"长\": \"21.0\", \"高\": \"21.0\"... \n",
|
||||
"1 {\"包裹1\": {\"宽\": \"41.0\", \"长\": \"41.0\", \"高\": \"21.0\"... \n",
|
||||
"2 {\"包裹1\": {\"宽\": \"32.0\", \"长\": \"33.0\", \"高\": \"28.0\"... \n",
|
||||
"3 {\"包裹1\": {\"宽\": \"28.0\", \"长\": \"28.0\", \"高\": \"13.0\"... \n",
|
||||
"4 {\"包裹1\": {\"宽\": \"25.0\", \"长\": \"75.0\", \"高\": \"28.0\"... \n",
|
||||
"... ... \n",
|
||||
"13489 {\"包裹1\": {\"宽\": \"70.0\", \"长\": \"190.0\", \"高\": \"20.0... \n",
|
||||
"13490 {\"包裹1\": {\"宽\": \"48.0\", \"长\": \"54.0\", \"高\": \"14.0\"... \n",
|
||||
"13491 {\"包裹1\": {\"宽\": \"30.0\", \"长\": \"193.0\", \"高\": \"13.0... \n",
|
||||
"13492 {\"包裹1\": {\"宽\": \"51.0\", \"长\": \"53.0\", \"高\": \"33.0\"... \n",
|
||||
"13493 {\"包裹1\": {\"宽\": \"70.0\", \"长\": \"130.0\", \"高\": \"45.0... \n",
|
||||
"\n",
|
||||
" 实际包裹数据 \n",
|
||||
"0 {\"991344640\": {\"长\": 45.00, \"宽\": 45.00, \"高\": 17... \n",
|
||||
"1 {\"991399418\": {\"长\": 41.00, \"宽\": 41.00, \"高\": 21... \n",
|
||||
"2 {\"991348761\": {\"长\": 31.00, \"宽\": 31.00, \"高\": 24... \n",
|
||||
"3 {\"991369401\": {\"长\": 28.00, \"宽\": 28.00, \"高\": 12... \n",
|
||||
"4 {\"991401728\": {\"长\": 75.00, \"宽\": 25.00, \"高\": 16... \n",
|
||||
"... ... \n",
|
||||
"13489 {\"991447512\": {\"长\": 208.00, \"宽\": 54.00, \"高\": 1... \n",
|
||||
"13490 {\"991446594\": {\"长\": 53.00, \"宽\": 48.00, \"高\": 20... \n",
|
||||
"13491 {\"991449178\": {\"长\": 193.00, \"宽\": 30.00, \"高\": 1... \n",
|
||||
"13492 {\"991444756\": {\"长\": 53.00, \"宽\": 51.00, \"高\": 33... \n",
|
||||
"13493 {\"991454248\": {\"长\": 141.00, \"宽\": 76.00, \"高\": 2... \n",
|
||||
"\n",
|
||||
"[13494 rows x 12 columns]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import pandas as pd\n",
|
||||
"from utils.gtools import MySQLconnect\n",
|
||||
|
|
@ -388,18 +320,29 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"len(df)"
|
||||
"# 取需要获取实际采购价的表\n",
|
||||
"import pandas as pd\n",
|
||||
"df = pd.read_excel(r\"C:\\Users\\Admin\\Desktop\\售价数据类\\数据统计\\物流类\\2025-06测算物流.xlsx\",engine='openpyxl')\n",
|
||||
"df"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"已完成 50000 个 order_id 的查询\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from utils.gtools import MySQLconnect\n",
|
||||
"\n",
|
||||
"ods = MySQLconnect(\"ods\")\n",
|
||||
"ods = MySQLconnect(\"dwd\")\n",
|
||||
"engine = ods.engine()\n",
|
||||
"cursor = ods.connect().cursor()\n",
|
||||
"\n",
|
||||
|
|
@ -471,14 +414,7 @@
|
|||
"# purchase_order_df2[\"order_id\"] = purchase_order_df2[\"order_id\"].astype(str)\n",
|
||||
"# purchase_order_df = pd.merge(purchase_order_df1, purchase_order_df2, on='order_id', how='left')\n",
|
||||
"\n",
|
||||
"# 转换数据类型,确保匹配\n",
|
||||
"df[\"order_id\"] = df[\"order_id\"].astype(str)\n",
|
||||
"\n",
|
||||
"# 进行合并\n",
|
||||
"order_id_df_cal = pd.merge(df, purchase_order_df1, on='order_id', how='left')\n",
|
||||
"# order_id_df_cal.drop_duplicates(subset=[\"order_id\"], inplace=True)\n",
|
||||
"# 复制到剪贴板\n",
|
||||
"order_id_df_cal.to_clipboard(index=False)\n"
|
||||
"purchase_order_df1.to_clipboard(index=False) # 复制到剪贴板\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -487,7 +423,14 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"print(len(df),len(purchase_order_df1),len(order_id_df_cal))"
|
||||
"# 转换数据类型,确保匹配\n",
|
||||
"df[\"order_id\"] = df[\"order_id\"].astype(str)\n",
|
||||
"\n",
|
||||
"# 进行合并\n",
|
||||
"order_id_df_cal = pd.merge(df, purchase_order_df1, on='order_id', how='left')\n",
|
||||
"# order_id_df_cal.drop_duplicates(subset=[\"order_id\"], inplace=True)\n",
|
||||
"# 复制到剪贴板\n",
|
||||
"order_id_df_cal.to_clipboard(index=False)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -534,9 +477,21 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"ename": "ImportError",
|
||||
"evalue": "cannot import name 'call_sell_and_order_price' from 'sell.sell_price' (d:\\test\\logistics\\sell\\sell_price.py)",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)",
|
||||
"Cell \u001b[1;32mIn[4], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# 用系统售价模型和实际体积计算实际应该有的售价和订单价\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msell\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01msell_price\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m call_sell_and_order_price\n\u001b[0;32m 3\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mre\u001b[39;00m\n\u001b[0;32m 4\u001b[0m order_id_df_cal[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m预测售价\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n",
|
||||
"\u001b[1;31mImportError\u001b[0m: cannot import name 'call_sell_and_order_price' from 'sell.sell_price' (d:\\test\\logistics\\sell\\sell_price.py)"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"# 用系统售价模型和实际体积计算实际应该有的售价和订单价\n",
|
||||
"from sell.sell_price import call_sell_and_order_price\n",
|
||||
|
|
@ -1257,27 +1212,7 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"C:\\Users\\Admin\\AppData\\Local\\Temp\\ipykernel_8364\\2603640831.py:4: FutureWarning: The provided callable <built-in function max> is currently using SeriesGroupBy.max. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string \"max\" instead.\n",
|
||||
" all_df['SPU最大涨幅']=all_df.groupby('SPU')['售价涨跌幅'].transform(max)\n",
|
||||
"C:\\Users\\Admin\\AppData\\Local\\Temp\\ipykernel_8364\\2603640831.py:5: FutureWarning: The provided callable <built-in function min> is currently using SeriesGroupBy.min. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string \"min\" instead.\n",
|
||||
" all_df['SPU最小涨幅']=all_df.groupby('SPU')['售价涨跌幅'].transform(min)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"10{\"stdout\":\"[{\\\"variableName\\\": \\\"ID_TO_MEANING\\\", \\\"type\\\": \\\"dictionary\\\", \\\"supportedEngines\\\": [\\\"pandas\\\"], \\\"isLocalVariable\\\": true, \\\"rawType\\\": \\\"builtins.dict\\\"}, {\\\"variableName\\\": \\\"NULL\\\", \\\"type\\\": \\\"unknown\\\", \\\"supportedEngines\\\": [\\\"pandas\\\"], \\\"isLocalVariable\\\": true, \\\"rawType\\\": \\\"_pydevd_bundle.pydevd_constants.Null\\\"}]\\n\",\"stderr\":\"\",\"mime\":[]}\n",
|
||||
"10{\"stdout\":\"[{\\\"variableName\\\": \\\"ID_TO_MEANING\\\", \\\"type\\\": \\\"dictionary\\\", \\\"supportedEngines\\\": [\\\"pandas\\\"], \\\"isLocalVariable\\\": true, \\\"rawType\\\": \\\"builtins.dict\\\"}, {\\\"variableName\\\": \\\"NULL\\\", \\\"type\\\": \\\"unknown\\\", \\\"supportedEngines\\\": [\\\"pandas\\\"], \\\"isLocalVariable\\\": true, \\\"rawType\\\": \\\"_pydevd_bundle.pydevd_constants.Null\\\"}]\\n\",\"stderr\":\"\",\"mime\":[]}\n",
|
||||
"10{\"stdout\":\"[{\\\"variableName\\\": \\\"ID_TO_MEANING\\\", \\\"type\\\": \\\"dictionary\\\", \\\"supportedEngines\\\": [\\\"pandas\\\"], \\\"isLocalVariable\\\": true, \\\"rawType\\\": \\\"builtins.dict\\\"}, {\\\"variableName\\\": \\\"NULL\\\", \\\"type\\\": \\\"unknown\\\", \\\"supportedEngines\\\": [\\\"pandas\\\"], \\\"isLocalVariable\\\": true, \\\"rawType\\\": \\\"_pydevd_bundle.pydevd_constants.Null\\\"}]\\n\",\"stderr\":\"\",\"mime\":[]}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import pandas as pd\n",
|
||||
"all_df = pd.read_excel('单包裹SKU售价分析1.xlsx',sheet_name=\"Sheet1\")\n",
|
||||
|
|
|
|||
Loading…
Reference in New Issue