ey-commerce-lib 1.0.24__tar.gz → 1.0.25__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ey-commerce-lib might be problematic. Click here for more details.
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/PKG-INFO +1 -1
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/pyproject.toml +1 -1
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/main.py +72 -39
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/common.py +6 -12
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/order.py +2 -82
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/tests/dxm/test_purchase.py +23 -23
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/.gitignore +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/.python-version +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/README.md +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/pytest.ini +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/constant/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/constant/order.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/exception/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/exception/common.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/count.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/ebay_product.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/export_template.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/purchase.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/tracking.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/warehouse.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/common.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/dxm_commodity_product.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/ebay_product.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/export_package.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/order.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/tracking.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/warehouse.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/utils/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/utils/dxm_commodity_product.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/utils/mark.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/constant/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/constant/response.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/main.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/parser/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/parser/order.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/schemas/query/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/schemas/query/order.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/schemas/vo/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/schemas/vo/order.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/main.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/schemas/query/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/schemas/query/order.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/schemas/query/product.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/schemas/response/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/schemas/response/order.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/schemas/response/product.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/model.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/py.typed +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/takesend/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/takesend/config.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/takesend/main.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/takesend/parser/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/takesend/parser/order.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/utils/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/utils/close.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/utils/dxm.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/utils/float.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/utils/list_util.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/utils/str.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/tests/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/tests/dxm/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/tests/kogan/__init__.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/tests/kogan/test_client.py +0 -0
- {ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/uv.lock +0 -0
|
@@ -8,8 +8,8 @@ from ey_commerce_lib.dxm.constant.order import DxmOrderRuleType
|
|
|
8
8
|
from ey_commerce_lib.dxm.parser.common import get_page_info, get_purchase_pagination_info, get_tracking_page_info
|
|
9
9
|
from ey_commerce_lib.dxm.parser.count import parse_count
|
|
10
10
|
from ey_commerce_lib.dxm.parser.export_template import parse_list_export_template
|
|
11
|
-
from ey_commerce_lib.dxm.parser.order import
|
|
12
|
-
|
|
11
|
+
from ey_commerce_lib.dxm.parser.order import list_order_rule, get_rule_detail, \
|
|
12
|
+
parse_comm_search_list_html_get_authid_dict
|
|
13
13
|
from ey_commerce_lib.dxm.parser.purchase import list_purchasing_all, list_1688_purchase_order_number, \
|
|
14
14
|
list_wait_pay_page_purchase_order_number
|
|
15
15
|
from ey_commerce_lib.dxm.parser.tracking import parse_tracking_page
|
|
@@ -34,78 +34,111 @@ class DxmClient:
|
|
|
34
34
|
self.__async_client = AsyncClient(base_url=self.__base_url, cookies=cookies, headers=headers,
|
|
35
35
|
timeout=timeout)
|
|
36
36
|
|
|
37
|
-
async def
|
|
37
|
+
async def package_advanced_search_api(self, query: DxmOrderSearchForm):
|
|
38
38
|
"""
|
|
39
|
-
|
|
39
|
+
条件店小秘订单高级搜索api
|
|
40
40
|
:param query:
|
|
41
41
|
:return:
|
|
42
42
|
"""
|
|
43
43
|
# 查询分页数据
|
|
44
|
-
|
|
44
|
+
package_advanced_search_res = await self.__async_client.post("/api/package/advancedSearch.json",
|
|
45
|
+
data=query.model_dump(by_alias=True))
|
|
46
|
+
package_advanced_search_data = package_advanced_search_res.json()
|
|
47
|
+
if package_advanced_search_data.get('code') != 0:
|
|
48
|
+
raise Exception('店小秘订单高级查询接口失败')
|
|
45
49
|
# 获取分页信息
|
|
46
|
-
|
|
47
|
-
data = list_order_base_by_html(data.text)
|
|
48
|
-
return {
|
|
49
|
-
**page_info,
|
|
50
|
-
'data': data
|
|
51
|
-
}
|
|
50
|
+
return package_advanced_search_data
|
|
52
51
|
|
|
53
|
-
async def
|
|
52
|
+
async def package_advanced_search_list(self, query: DxmOrderSearchForm):
|
|
54
53
|
"""
|
|
55
|
-
|
|
54
|
+
条件店小秘订单高级搜索分页数据列表(根据条件将page中的list进行汇总)
|
|
56
55
|
:return:
|
|
57
56
|
"""
|
|
58
57
|
query.page_no = 1
|
|
59
|
-
|
|
60
|
-
total_page = data
|
|
61
|
-
|
|
58
|
+
package_advanced_search_data = await self.package_advanced_search_api(query)
|
|
59
|
+
total_page = package_advanced_search_data.get('data', {}).get('page', {}).get('totalPage')
|
|
60
|
+
package_advanced_search_data_list = package_advanced_search_data.get('data', {}).get('page', {}).get('list', [])
|
|
62
61
|
for page_number in range(2, total_page + 1):
|
|
62
|
+
# 更改条件查询的页码
|
|
63
63
|
query.page_no = page_number
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
# 调用api获取分页数据
|
|
65
|
+
page_package_advanced_search_data = await self.package_advanced_search_api(query)
|
|
66
|
+
# 获取每一页的数据,没有获取到则为空数组
|
|
67
|
+
page_package_advanced_search_data_list = (page_package_advanced_search_data.get('data', {})
|
|
68
|
+
.get('page', {}).get('list', []))
|
|
69
|
+
# 合并每一页的数据
|
|
70
|
+
package_advanced_search_data_list.extend(page_package_advanced_search_data_list)
|
|
71
|
+
return package_advanced_search_data_list
|
|
72
|
+
|
|
73
|
+
async def package_advanced_search_with_detail(self, query: DxmOrderSearchForm):
|
|
74
|
+
"""
|
|
75
|
+
条件店小秘订单高级搜索分页数据(带详情)
|
|
76
|
+
:param query:
|
|
77
|
+
:return:
|
|
78
|
+
"""
|
|
67
79
|
|
|
68
|
-
|
|
69
|
-
async def set_detail(order_base: dict):
|
|
80
|
+
async def set_detail(pkg: dict):
|
|
70
81
|
"""
|
|
71
|
-
|
|
72
|
-
:param
|
|
82
|
+
将包裹详情数据注入到订单高级查询数据中
|
|
83
|
+
:param pkg:每一条包裹
|
|
73
84
|
:return:
|
|
74
85
|
"""
|
|
75
|
-
|
|
86
|
+
pkg['withDetail'] = await self.package_detail_json_api(pkg.get('id'))
|
|
76
87
|
|
|
77
88
|
# 获取基本分页数据信息
|
|
78
|
-
|
|
89
|
+
package_advanced_search_data = await self.package_advanced_search_api(query)
|
|
79
90
|
# 获取并设置详情信息
|
|
80
91
|
await asyncio.gather(*[
|
|
81
|
-
set_detail(
|
|
82
|
-
for
|
|
92
|
+
set_detail(pkg)
|
|
93
|
+
for pkg in package_advanced_search_data.get('data', {}).get('page', {}).get('list', [])])
|
|
83
94
|
|
|
84
|
-
return
|
|
95
|
+
return package_advanced_search_data
|
|
85
96
|
|
|
86
|
-
async def
|
|
97
|
+
async def package_advanced_search_with_detail_list(self, query: DxmOrderSearchForm):
|
|
98
|
+
"""
|
|
99
|
+
条件店小秘订单高级搜索分页数据(带详情)
|
|
100
|
+
:param query:
|
|
101
|
+
:return:
|
|
102
|
+
"""
|
|
103
|
+
# 默认从第一页开始
|
|
87
104
|
query.page_no = 1
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
105
|
+
# 获取第一页数据
|
|
106
|
+
package_advanced_search_with_detail_data = await self.package_advanced_search_with_detail(query)
|
|
107
|
+
# 获取总页数
|
|
108
|
+
total_page = package_advanced_search_with_detail_data.get('data', {}).get('page', {}).get('totalPage', 0)
|
|
109
|
+
# 获取第一页数据列表
|
|
110
|
+
package_advanced_search_with_detail_list = package_advanced_search_with_detail_data.get('data', {}).get('page',
|
|
111
|
+
{}).get(
|
|
112
|
+
'list', [])
|
|
113
|
+
# 循环获取每一页数据
|
|
91
114
|
for page_number in range(2, total_page + 1):
|
|
115
|
+
# 变更页码
|
|
92
116
|
query.page_no = page_number
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
117
|
+
# 获取每一页数据
|
|
118
|
+
page_package_advanced_search_with_detail_data = await self.package_advanced_search_with_detail(query)
|
|
119
|
+
# 获取每一页数据列表
|
|
120
|
+
page_package_advanced_search_with_detail_data_list = page_package_advanced_search_with_detail_data.get(
|
|
121
|
+
'data', {}).get('page', {}).get('list', [])
|
|
122
|
+
# 合并
|
|
123
|
+
package_advanced_search_with_detail_list.extend(page_package_advanced_search_with_detail_data_list)
|
|
124
|
+
# 返回合并后的数据
|
|
125
|
+
return package_advanced_search_with_detail_list
|
|
126
|
+
|
|
127
|
+
async def package_detail_json_api(self, package_id: str):
|
|
98
128
|
"""
|
|
99
129
|
获取包裹的详情数据
|
|
100
130
|
:param package_id:
|
|
101
131
|
:return:
|
|
102
132
|
"""
|
|
103
133
|
async with self.__sem:
|
|
104
|
-
package_detail_res = await self.__async_client.post('/package/detail.
|
|
134
|
+
package_detail_res = await self.__async_client.post('/api/package/detail.json', data={
|
|
105
135
|
'packageId': package_id,
|
|
106
136
|
'history': ''
|
|
107
137
|
})
|
|
108
|
-
|
|
138
|
+
package_detail_json = package_detail_res.json()
|
|
139
|
+
if package_detail_json.get('code') != 0:
|
|
140
|
+
raise Exception(f'店小秘获取订单详情失败,失败原因是{traceback.format_exc()}')
|
|
141
|
+
return package_detail_json
|
|
109
142
|
|
|
110
143
|
async def move_process(self, package_id: str) -> DxmJsonResponse:
|
|
111
144
|
"""
|
|
@@ -14,23 +14,17 @@ class PageInfo(TypedDict):
|
|
|
14
14
|
page_number: int
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def get_page_info(
|
|
17
|
+
def get_page_info(page_order_data: dict) -> PageInfo:
|
|
18
18
|
"""
|
|
19
19
|
获取分页信息和分页数据
|
|
20
20
|
:return:
|
|
21
21
|
"""
|
|
22
|
-
|
|
23
|
-
page_size_list = tree.xpath('//input[@id="pageSize"]/@value')
|
|
24
|
-
total_page_list = tree.xpath('//input[@id="totalPage"]/@value')
|
|
25
|
-
total_size_list = tree.xpath('//input[@id="totalSize"]/@value')
|
|
26
|
-
page_number_list = tree.xpath('//input[@id="pageNo"]/@value')
|
|
27
|
-
if len(page_size_list) == 0 or len(total_page_list) == 0:
|
|
28
|
-
raise PageInfoNotFoundException("分页信息获取失败")
|
|
22
|
+
page_info = page_order_data.get('data').get('page')
|
|
29
23
|
return {
|
|
30
|
-
'page_size':
|
|
31
|
-
'total_page':
|
|
32
|
-
'total_size':
|
|
33
|
-
'page_number':
|
|
24
|
+
'page_size': page_info.get('pageSize'),
|
|
25
|
+
'total_page':page_info.get('totalPage'),
|
|
26
|
+
'total_size': page_info.get('totalSize'),
|
|
27
|
+
'page_number': page_info.get('pageNo')
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
|
|
@@ -136,88 +136,8 @@ def get_order_buyer_select_provider(good_element: html.HtmlElement):
|
|
|
136
136
|
return buyer_select_provider
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
def list_order_base_by_html(
|
|
140
|
-
|
|
141
|
-
获取基本的订单分页信息
|
|
142
|
-
有三种情况:
|
|
143
|
-
1. 合并单
|
|
144
|
-
2. 一单多件
|
|
145
|
-
3. 普通一单一件
|
|
146
|
-
:param html_str:
|
|
147
|
-
:return:
|
|
148
|
-
"""
|
|
149
|
-
tree = html.fromstring(html_str)
|
|
150
|
-
good_element_list = tree.xpath('//tbody[@class="xianshishujudate"]/tr[@class="goodsId"]')
|
|
151
|
-
order_list = list()
|
|
152
|
-
table_columns = tree.xpath('//table[@id="orderListTable"]/thead/tr/th/text()')
|
|
153
|
-
# 是否又物流方式
|
|
154
|
-
has_logistics = True if '物流方式' in table_columns else False
|
|
155
|
-
for good_element in good_element_list:
|
|
156
|
-
# 包裹号
|
|
157
|
-
package_number = good_element.xpath('.//a[@class="limingcentUrlpic"]/text()')[0]
|
|
158
|
-
# 包裹id
|
|
159
|
-
package_id = good_element.xpath('.//input[@class="input1"]/@value')[0]
|
|
160
|
-
# authid 物流方式的id
|
|
161
|
-
auth_id = good_element.xpath(f'.//input[@id="dxmAuthId{package_id}"]/@value')[0]
|
|
162
|
-
# data-custom-mark标记
|
|
163
|
-
data_custom_mark = get_str_list_first_not_blank_or_none(good_element.xpath('@data-custom-mark'))
|
|
164
|
-
buyer_select_provider = get_order_buyer_select_provider(good_element)
|
|
165
|
-
order_form_source = good_element.xpath('.//span[contains(@class, "order-form-source")]/text()')[0]
|
|
166
|
-
platform, shop = order_form_source.replace('「', '').replace('」', '').split(':')
|
|
167
|
-
order_class = f"orderId_{package_id}"
|
|
168
|
-
order_element_list = tree.xpath(f'//tr[@class="{order_class}"]')
|
|
169
|
-
order_first_element = order_element_list[0]
|
|
170
|
-
# 订单备注
|
|
171
|
-
hover_prompt_content_list = good_element.xpath('.//span[contains(@class, "hoverPrompt")]/@data-content')
|
|
172
|
-
# 物流方式, 要先检查是否包含物流方式这一列
|
|
173
|
-
logistics_info = None
|
|
174
|
-
if has_logistics:
|
|
175
|
-
# 物流方式
|
|
176
|
-
logistics_list = order_first_element.xpath('.//td[6]/span/a/text()')
|
|
177
|
-
# 可能又不存在的物流方式情况发生
|
|
178
|
-
if len(logistics_list) > 0:
|
|
179
|
-
logistics_info = dict()
|
|
180
|
-
logistics = logistics_list[0].strip()
|
|
181
|
-
# 物流单号
|
|
182
|
-
logistics_info['track_number'] = get_str_list_first_not_blank_or_none(
|
|
183
|
-
order_first_element.xpath('.//td[6]//span[contains(@class, "limingcentUrlpicson")]/a/text()'))
|
|
184
|
-
logistics_info['logistics'] = logistics
|
|
185
|
-
# 称重重量
|
|
186
|
-
weight_element_list = order_first_element.xpath('.//td[6]//span[@class="gray-c"]/text()')
|
|
187
|
-
weight = None
|
|
188
|
-
for weight_element in weight_element_list:
|
|
189
|
-
if '称重重量' in weight_element:
|
|
190
|
-
# 如果包含了称重重量的话,获取完整的数字部分
|
|
191
|
-
weight = float(re.search(r'\d+(?:\.\d+)?', weight_element).group())
|
|
192
|
-
# 设置重量部分
|
|
193
|
-
logistics_info['weight'] = weight
|
|
194
|
-
|
|
195
|
-
# 状态
|
|
196
|
-
if has_logistics:
|
|
197
|
-
status = get_str_list_first_not_blank_or_none(order_first_element.xpath('.//td[7]/text()'))
|
|
198
|
-
else:
|
|
199
|
-
status = get_str_list_first_not_blank_or_none(order_first_element.xpath('.//td[6]/text()'))
|
|
200
|
-
# 整理订单
|
|
201
|
-
if len(order_element_list) > 1:
|
|
202
|
-
# 合并单
|
|
203
|
-
order_item_list = get_merge_order_item_list(order_element_list)
|
|
204
|
-
else:
|
|
205
|
-
# 普通单
|
|
206
|
-
order_item_list = get_single_order_item_list(order_element_list[0])
|
|
207
|
-
order_list.append({
|
|
208
|
-
'package_id': package_id,
|
|
209
|
-
'auth_id': auth_id,
|
|
210
|
-
'package_number': package_number,
|
|
211
|
-
'data_custom_mark': data_custom_mark,
|
|
212
|
-
'buyer_select_provider': buyer_select_provider,
|
|
213
|
-
'platform': platform,
|
|
214
|
-
'shop': shop,
|
|
215
|
-
'hover_prompt_content_list': hover_prompt_content_list,
|
|
216
|
-
'logistics_info': logistics_info,
|
|
217
|
-
'status': status,
|
|
218
|
-
'order_item_list': order_item_list
|
|
219
|
-
})
|
|
220
|
-
return order_list
|
|
139
|
+
def list_order_base_by_html(page_order_data: dict) -> list[dict]:
|
|
140
|
+
return page_order_data.get('data').get('page').get('list')
|
|
221
141
|
|
|
222
142
|
|
|
223
143
|
def list_order_rule(html_str: str):
|
|
@@ -31,7 +31,6 @@ async def test_auto_login_4seller():
|
|
|
31
31
|
pass
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
|
|
35
34
|
cookies = {
|
|
36
35
|
|
|
37
36
|
}
|
|
@@ -44,33 +43,34 @@ headers = {
|
|
|
44
43
|
@pytest.mark.asyncio
|
|
45
44
|
async def test_dxm_api():
|
|
46
45
|
async with (DxmClient(headers=headers, cookies=cookies) as dxm_client):
|
|
47
|
-
|
|
46
|
+
data = await dxm_client.package_advanced_search_with_detail(query=ORDER_SEARCH_APPROVAL_BASE_FORM)
|
|
47
|
+
print(data.get('code'))
|
|
48
48
|
# for order in data:
|
|
49
49
|
# for pair_info in order.get('detail').get('pair_info_list'):
|
|
50
50
|
# print(pair_info.get('proid'))
|
|
51
51
|
# data = await dxm_client.update_dxm_commodity_front_sku('17773195771232287', 'fuck112')
|
|
52
52
|
# data = await dxm_client.get_authid_like_keyword('泰嘉')
|
|
53
|
-
data = await dxm_client.list_export_template()
|
|
54
|
-
for item in data:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
53
|
+
# data = await dxm_client.list_export_template()
|
|
54
|
+
# for item in data:
|
|
55
|
+
# if item.get('template_name') == '周报订单导出模板':
|
|
56
|
+
# template_json = await dxm_client.export_template_get_by_id_json(id_str=item.get('template_id'))
|
|
57
|
+
# template_id = template_json.get('template').get('id')
|
|
58
|
+
# template_field = template_json.get('template').get('templateField')
|
|
59
|
+
# url = await dxm_client.export_package_order(ExportPackageOrderModel(
|
|
60
|
+
# # 模板id
|
|
61
|
+
# template_id=f'{template_id}',
|
|
62
|
+
# # 导出字段
|
|
63
|
+
# export_keys=urllib.parse.quote(template_field),
|
|
64
|
+
# # 按包裹导出
|
|
65
|
+
# export_type='1',
|
|
66
|
+
# # 发货时间
|
|
67
|
+
# time_type='2',
|
|
68
|
+
# # 已发货
|
|
69
|
+
# state='shipped',
|
|
70
|
+
# start_time='2025-08-06 00:00:00',
|
|
71
|
+
# end_time='2025-08-12 23:59:59'
|
|
72
|
+
# ))
|
|
73
|
+
# print(f'导出成功,url={url}')
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
@pytest.mark.asyncio
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/constant/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/exception/__init__.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/exception/common.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/ebay_product.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/export_template.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/purchase.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/tracking.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/parser/warehouse.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/ebay_product.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/export_package.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/tracking.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/dxm/schemas/warehouse.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/parser/__init__.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/four_seller/parser/order.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/schemas/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/schemas/query/order.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/kogan/schemas/query/product.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/takesend/parser/__init__.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.24 → ey_commerce_lib-1.0.25}/src/ey_commerce_lib/takesend/parser/order.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|