ey-commerce-lib 1.0.12__tar.gz → 1.0.14__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.12 → ey_commerce_lib-1.0.14}/PKG-INFO +1 -1
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/pyproject.toml +1 -1
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/main.py +63 -0
- ey_commerce_lib-1.0.14/src/ey_commerce_lib/dxm/parser/count.py +43 -0
- ey_commerce_lib-1.0.14/src/ey_commerce_lib/dxm/parser/ebay_product.py +16 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/parser/order.py +10 -1
- ey_commerce_lib-1.0.14/src/ey_commerce_lib/dxm/schemas/dxm_commodity_product.py +416 -0
- ey_commerce_lib-1.0.14/src/ey_commerce_lib/dxm/schemas/ebay_product.py +56 -0
- ey_commerce_lib-1.0.14/src/ey_commerce_lib/dxm/utils/dxm_commodity_product.py +118 -0
- ey_commerce_lib-1.0.14/src/ey_commerce_lib/takesend/config.py +26 -0
- ey_commerce_lib-1.0.14/src/ey_commerce_lib/takesend/main.py +52 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/tests/dxm/test_purchase.py +17 -9
- ey_commerce_lib-1.0.14/tests/kogan/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/.gitignore +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/.python-version +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/README.md +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/pytest.ini +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/constant/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/constant/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/exception/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/exception/common.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/parser/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/parser/common.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/parser/purchase.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/parser/warehouse.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/schemas/common.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/schemas/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/schemas/warehouse.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/utils/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/utils/mark.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/constant/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/constant/response.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/main.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/parser/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/parser/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/schemas/query/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/schemas/query/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/schemas/vo/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/schemas/vo/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/main.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/schemas/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/schemas/query/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/schemas/query/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/schemas/query/product.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/schemas/response/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/schemas/response/order.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/schemas/response/product.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/model.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/py.typed +0 -0
- {ey_commerce_lib-1.0.12/src/ey_commerce_lib/utils → ey_commerce_lib-1.0.14/src/ey_commerce_lib/takesend}/__init__.py +0 -0
- {ey_commerce_lib-1.0.12/tests → ey_commerce_lib-1.0.14/src/ey_commerce_lib/utils}/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/utils/close.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/utils/dxm.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/utils/list_util.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/utils/str.py +0 -0
- {ey_commerce_lib-1.0.12/tests/dxm → ey_commerce_lib-1.0.14/tests}/__init__.py +0 -0
- {ey_commerce_lib-1.0.12/tests/kogan → ey_commerce_lib-1.0.14/tests/dxm}/__init__.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/tests/kogan/test_client.py +0 -0
- {ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/uv.lock +0 -0
|
@@ -4,12 +4,15 @@ from httpx import AsyncClient, Timeout
|
|
|
4
4
|
|
|
5
5
|
from ey_commerce_lib.dxm.constant.order import DxmOrderRuleType
|
|
6
6
|
from ey_commerce_lib.dxm.parser.common import get_page_info, get_purchase_pagination_info
|
|
7
|
+
from ey_commerce_lib.dxm.parser.count import parse_count
|
|
7
8
|
from ey_commerce_lib.dxm.parser.order import list_order_base_by_html, list_order_rule, get_rule_detail, \
|
|
8
9
|
get_order_detail_by_html
|
|
9
10
|
from ey_commerce_lib.dxm.parser.purchase import list_purchasing_all, list_1688_purchase_order_number, \
|
|
10
11
|
list_wait_pay_page_purchase_order_number
|
|
11
12
|
from ey_commerce_lib.dxm.parser.warehouse import list_warehouse_product
|
|
12
13
|
from ey_commerce_lib.dxm.schemas.common import Page
|
|
14
|
+
from ey_commerce_lib.dxm.schemas.dxm_commodity_product import ViewDxmCommodityProductResponse
|
|
15
|
+
from ey_commerce_lib.dxm.schemas.ebay_product import DxmEbayProductModel
|
|
13
16
|
from ey_commerce_lib.dxm.schemas.order import DxmOrderSearchForm, DxmJsonResponse, DxmCheckProcessResponse, DxmOrderRule
|
|
14
17
|
from ey_commerce_lib.dxm.schemas.warehouse import WarehouseProduct, WarehouseProductQuery, PurchasingAllQuery
|
|
15
18
|
|
|
@@ -631,6 +634,66 @@ class DxmClient:
|
|
|
631
634
|
raise Exception(f'添加订单标记数据失败错误原因{add_comment_res.json().get("msg")}')
|
|
632
635
|
return data
|
|
633
636
|
|
|
637
|
+
async def get_state_count_api(self):
|
|
638
|
+
"""
|
|
639
|
+
获取订单各个状态统计api
|
|
640
|
+
:return:
|
|
641
|
+
"""
|
|
642
|
+
async with self.__sem:
|
|
643
|
+
get_state_res = await self.__async_client.post('/package/getStateCount.json')
|
|
644
|
+
return get_state_res.json()
|
|
645
|
+
|
|
646
|
+
async def __stat_index(self):
|
|
647
|
+
"""
|
|
648
|
+
获取店小秘订单统计页api
|
|
649
|
+
:return:
|
|
650
|
+
"""
|
|
651
|
+
async with self.__sem:
|
|
652
|
+
params = {
|
|
653
|
+
'shopIds': 'all',
|
|
654
|
+
'isIndex': '1',
|
|
655
|
+
'currency': 'USD',
|
|
656
|
+
}
|
|
657
|
+
stat_index_res = await self.__async_client.get('/stat/order/orderPerform.htm', params=params)
|
|
658
|
+
stat_index_html = stat_index_res.text
|
|
659
|
+
|
|
660
|
+
return parse_count(stat_index_html)
|
|
661
|
+
|
|
662
|
+
async def list_order_count(self):
|
|
663
|
+
"""
|
|
664
|
+
获取店小秘订单统计
|
|
665
|
+
:return:
|
|
666
|
+
"""
|
|
667
|
+
|
|
668
|
+
return await self.__stat_index()
|
|
669
|
+
|
|
670
|
+
async def ebay_product_page_list(self, query_params: DxmEbayProductModel):
|
|
671
|
+
"""
|
|
672
|
+
ebay在线产品列表
|
|
673
|
+
:param query_params: 查询参数
|
|
674
|
+
:return:
|
|
675
|
+
"""
|
|
676
|
+
query_data = query_params.model_dump(by_alias=True)
|
|
677
|
+
async with self.__sem:
|
|
678
|
+
ebay_product_page_res = await self.__async_client.post('/ebayProduct/pageList.htm', data=query_data)
|
|
679
|
+
ebay_product_page_text = ebay_product_page_res.text
|
|
680
|
+
# TODO 完成后续的逻辑
|
|
681
|
+
|
|
682
|
+
async def view_dxm_commodity_product(self, proid: str):
|
|
683
|
+
"""
|
|
684
|
+
仓库管理-商品管理-查看店小秘商品
|
|
685
|
+
:param proid:
|
|
686
|
+
:return:
|
|
687
|
+
"""
|
|
688
|
+
data = {
|
|
689
|
+
'id': proid,
|
|
690
|
+
}
|
|
691
|
+
async with self.__sem:
|
|
692
|
+
view_dxm_commodity_product_res = await self.__async_client.post(
|
|
693
|
+
'/dxmCommodityProduct/viewDxmCommodityProduct.json',
|
|
694
|
+
data=data)
|
|
695
|
+
return ViewDxmCommodityProductResponse.model_validate(view_dxm_commodity_product_res.json())
|
|
696
|
+
|
|
634
697
|
async def __aenter__(self):
|
|
635
698
|
return self
|
|
636
699
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from lxml import html
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def parse_count(html_content: str):
|
|
5
|
+
tree = html.fromstring(html_content)
|
|
6
|
+
data_list = tree.xpath("//tr[@class='content']")
|
|
7
|
+
result = []
|
|
8
|
+
for data in data_list:
|
|
9
|
+
date = data.xpath('./td/text()')[0].strip()
|
|
10
|
+
order_number = data.xpath('./td/text()')[1].strip()
|
|
11
|
+
# 订单总金额
|
|
12
|
+
total_amount = data.xpath('./td/text()')[2].strip()
|
|
13
|
+
# 订单手续费
|
|
14
|
+
fee = data.xpath('./td/text()')[3].strip()
|
|
15
|
+
# 物流费用
|
|
16
|
+
logistics = data.xpath('./td/text()')[4].strip()
|
|
17
|
+
# 利润
|
|
18
|
+
profit = data.xpath('./td/text()')[5].strip()
|
|
19
|
+
# 退单数量
|
|
20
|
+
return_number = data.xpath('./td/text()')[6].strip()
|
|
21
|
+
# 退单金额
|
|
22
|
+
return_amount = data.xpath('./td/text()')[7].strip()
|
|
23
|
+
# 退款率
|
|
24
|
+
return_rate = data.xpath('./td/text()')[8].strip()
|
|
25
|
+
# 成本利润
|
|
26
|
+
cost_profit = data.xpath('./td/text()')[9].strip()
|
|
27
|
+
# 销售利润
|
|
28
|
+
sale_profit = data.xpath('./td/text()')[10].strip()
|
|
29
|
+
# 添加数据
|
|
30
|
+
result.append({
|
|
31
|
+
'date': date,
|
|
32
|
+
'order_number': order_number,
|
|
33
|
+
'total_amount': total_amount,
|
|
34
|
+
'fee': fee,
|
|
35
|
+
'logistics': logistics,
|
|
36
|
+
'profit': profit,
|
|
37
|
+
'return_number': return_number,
|
|
38
|
+
'return_amount': return_amount,
|
|
39
|
+
'return_rate': return_rate,
|
|
40
|
+
'cost_profit': cost_profit,
|
|
41
|
+
'sale_profit': sale_profit
|
|
42
|
+
})
|
|
43
|
+
return result
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from lxml import html
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def parse_ebay_product_page(page_html: str):
|
|
5
|
+
tree = html.fromstring(page_html)
|
|
6
|
+
# 获取eBay产【
|
|
7
|
+
ebay_product_items = tree.xpath('//tbody[@id="ebaySysMsg"]/tr')
|
|
8
|
+
for ebay_product_item in ebay_product_items:
|
|
9
|
+
ebay_id = ebay_product_item.xpath('@data-id')
|
|
10
|
+
sku = ebay_product_item.xpath('./td[4]/text()')
|
|
11
|
+
# 获取子表
|
|
12
|
+
sub_table = ebay_product_item.xpath('.//table[@class="in-table-in"]//tr')
|
|
13
|
+
# 获取proId
|
|
14
|
+
pro_id = sub_table[0].xpath('./td[1]/text()')
|
|
15
|
+
# TODO 获取后续逻辑
|
|
16
|
+
|
|
@@ -36,6 +36,10 @@ def get_single_order_item_list(order_element: html.HtmlElement):
|
|
|
36
36
|
xpath('.//ul[@id="dropSourceUrl"]/li[@role="presentation"]/a/text()'))
|
|
37
37
|
source_presentation_element_list = [source_presentation_element.strip().split(':')[1]
|
|
38
38
|
for source_presentation_element in source_presentation_element_list]
|
|
39
|
+
try:
|
|
40
|
+
float(price.replace(',', ''))
|
|
41
|
+
except:
|
|
42
|
+
raise Exception(f'价格格式错误, sku是{sku}')
|
|
39
43
|
sku_list.append({
|
|
40
44
|
'sku': sku,
|
|
41
45
|
'quantity': int(quantity),
|
|
@@ -314,6 +318,7 @@ def get_order_detail_by_html(html_str: str):
|
|
|
314
318
|
for pair_info_element in pair_info_element_list:
|
|
315
319
|
pair_info_sku = pair_info_element.xpath('.//span[@class="pairProInfoSku"]/text()')[0].split(' x')[0].strip()
|
|
316
320
|
pair_info_sku_quantity = int(pair_info_element.xpath('.//span[@class="pairProInfoSku"]/span/text()')[0].strip())
|
|
321
|
+
proid = get_str_list_first_not_blank_or_none(pair_info_element.xpath('.//input[@proid]/@proid'))
|
|
317
322
|
# warehouse_sku, warehouse_sku_quantity = pair_info_element.xpath(
|
|
318
323
|
# './/div[contains(@class, "normalDiv")]/p[1]/text()')[0].split(' x ')
|
|
319
324
|
warehouse_sku_info_list = pair_info_element.xpath('.//div[contains(@class, "normalDiv")]/p[1]/text()')
|
|
@@ -324,11 +329,15 @@ def get_order_detail_by_html(html_str: str):
|
|
|
324
329
|
|
|
325
330
|
warehouse_available_quantity_element_list = pair_info_element.xpath(
|
|
326
331
|
'.//div[contains(@class, "normalDiv")]/p[2]/span[2]/text()')
|
|
327
|
-
|
|
332
|
+
warehouse_available_quantity_str = warehouse_available_quantity_element_list[0].strip()
|
|
333
|
+
if warehouse_available_quantity_str.endswith('+'):
|
|
334
|
+
warehouse_available_quantity_str = warehouse_available_quantity_str[:-1]
|
|
335
|
+
warehouse_available_quantity = int(warehouse_available_quantity_str) if len(
|
|
328
336
|
warehouse_available_quantity_element_list) > 0 else None
|
|
329
337
|
pair_info_list.append({
|
|
330
338
|
'pair_info_sku': pair_info_sku,
|
|
331
339
|
'pair_info_sku_quantity': pair_info_sku_quantity,
|
|
340
|
+
'proid': proid,
|
|
332
341
|
'warehouse_sku': warehouse_sku,
|
|
333
342
|
'warehouse_sku_quantity': warehouse_sku_quantity,
|
|
334
343
|
'warehouse_available_quantity': warehouse_available_quantity
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import List, Optional, Dict, Any
|
|
3
|
+
from pydantic import BaseModel, Field, ConfigDict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class DxmProductAlbum(BaseModel):
|
|
7
|
+
"""商品相册信息"""
|
|
8
|
+
id: int = Field(..., alias="id", description="相册ID")
|
|
9
|
+
puid: int = Field(..., alias="puid", description="用户ID")
|
|
10
|
+
product_id: int = Field(..., alias="productId", description="商品ID")
|
|
11
|
+
name: Optional[str] = Field(None, alias="name", description="图片名称")
|
|
12
|
+
img_url: Optional[str] = Field(None, alias="imgUrl", description="图片URL")
|
|
13
|
+
img_original_size: int = Field(0, alias="imgOriginalSize", description="图片原始大小")
|
|
14
|
+
img_compress_size: int = Field(0, alias="imgCompressSize", description="图片压缩后大小")
|
|
15
|
+
img_height: int = Field(0, alias="imgHeight", description="图片高度")
|
|
16
|
+
img_width: int = Field(0, alias="imgWidth", description="图片宽度")
|
|
17
|
+
is_qc: int = Field(0, alias="isQc", description="是否质检图片")
|
|
18
|
+
is_from_net: int = Field(1, alias="isFromNet", description="是否来自网络")
|
|
19
|
+
is_del: int = Field(0, alias="isDel", description="是否删除")
|
|
20
|
+
upload_state: int = Field(0, alias="uploadState", description="上传状态")
|
|
21
|
+
survey_index: int = Field(0, alias="surveyIndex", description="调查索引")
|
|
22
|
+
create_time: datetime = Field(..., alias="createTime", description="创建时间")
|
|
23
|
+
update_time: datetime = Field(..., alias="updateTime", description="更新时间")
|
|
24
|
+
is_main: Optional[int] = Field(None, alias="isMain", description="是否主图")
|
|
25
|
+
id_str: Optional[str] = Field(None, alias="idStr", description="ID字符串形式")
|
|
26
|
+
|
|
27
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ProductVariation(BaseModel):
|
|
31
|
+
"""商品变体信息"""
|
|
32
|
+
id: int = Field(..., alias="id", description="变体ID")
|
|
33
|
+
puid: int = Field(..., alias="puid", description="用户ID")
|
|
34
|
+
product_id: int = Field(..., alias="productId", description="商品ID")
|
|
35
|
+
sku: str = Field(..., alias="sku", description="SKU编码")
|
|
36
|
+
create_time: datetime = Field(..., alias="createTime", description="创建时间")
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class SupplierProductRelation(BaseModel):
|
|
42
|
+
"""供应商商品关系"""
|
|
43
|
+
supplier_name: str = Field(..., alias="supplierName", description="供应商名称")
|
|
44
|
+
is_albaba: int = Field(..., alias="isAlbaba", description="是否阿里巴巴供应商")
|
|
45
|
+
supplier_id: str = Field(..., alias="supplierId", description="供应商ID")
|
|
46
|
+
is_main: int = Field(..., alias="isMain", description="是否主供应商")
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class DxmWarehouseProduct(BaseModel):
|
|
52
|
+
"""仓库商品信息"""
|
|
53
|
+
id: int = Field(..., alias="id", description="仓库商品ID")
|
|
54
|
+
puid: int = Field(..., alias="puid", description="用户ID")
|
|
55
|
+
warehose_id: int = Field(..., alias="warehoseId", description="仓库ID")
|
|
56
|
+
goods_shelf_id: int = Field(..., alias="goodsShelfId", description="货架ID")
|
|
57
|
+
shelf_name: str = Field(..., alias="shelfName", description="货架名称")
|
|
58
|
+
agent_id: int = Field(0, alias="agentId", description="代理商ID")
|
|
59
|
+
development_id: int = Field(..., alias="developmentId", description="开发人员ID")
|
|
60
|
+
product_id: int = Field(..., alias="productId", description="商品ID")
|
|
61
|
+
product_sku: str = Field(..., alias="productSku", description="商品SKU")
|
|
62
|
+
full_cid: str = Field(..., alias="fullCid", description="完整分类ID")
|
|
63
|
+
supplier_id: int = Field(..., alias="supplierId", description="供应商ID")
|
|
64
|
+
price: float = Field(..., alias="price", description="价格")
|
|
65
|
+
stock_num: int = Field(0, alias="stockNum", description="库存数量")
|
|
66
|
+
safe_stock_num: int = Field(0, alias="safeStockNum", description="安全库存数量")
|
|
67
|
+
presell_num: int = Field(0, alias="presellNum", description="预售数量")
|
|
68
|
+
lock_stock_num: int = Field(0, alias="lockStockNum", description="锁定库存数量")
|
|
69
|
+
amount: float = Field(0.0, alias="amount", description="金额")
|
|
70
|
+
on_passage_num: int = Field(0, alias="onPassageNum", description="在途数量")
|
|
71
|
+
on_passage_num_move: int = Field(0, alias="onPassageNumMove", description="移动中的在途数量")
|
|
72
|
+
comment: str = Field("", alias="comment", description="备注")
|
|
73
|
+
propasal_comment: Optional[str] = Field(None, alias="propasalComment", description="提案备注")
|
|
74
|
+
comment_color: Optional[str] = Field(None, alias="commentColor", description="备注颜色")
|
|
75
|
+
is_used: int = Field(1, alias="isUsed", description="是否使用")
|
|
76
|
+
product_status: int = Field(0, alias="productStatus", description="商品状态")
|
|
77
|
+
is_material: bool = Field(False, alias="isMaterial", description="是否原材料")
|
|
78
|
+
create_time: datetime = Field(..., alias="createTime", description="创建时间")
|
|
79
|
+
update_time: datetime = Field(..., alias="updateTime", description="更新时间")
|
|
80
|
+
group_state: int = Field(0, alias="groupState", description="分组状态")
|
|
81
|
+
allot_lock_stock_num: int = Field(0, alias="allotLockStockNum", description="分配锁定库存数量")
|
|
82
|
+
warehouse_lock_stock_num: int = Field(0, alias="warehouseLockStockNum", description="仓库锁定库存数量")
|
|
83
|
+
order_num: int = Field(0, alias="orderNum", description="订单数量")
|
|
84
|
+
option_mode: int = Field(1, alias="optionMode", description="操作模式")
|
|
85
|
+
pur_num: int = Field(0, alias="purNum", description="采购数量")
|
|
86
|
+
purchasing_audit_num: int = Field(0, alias="purchasingAuditNum", description="采购审核数量")
|
|
87
|
+
mark_no_purch: int = Field(1, alias="markNoPurch", description="标记不采购")
|
|
88
|
+
v: int = Field(0, alias="v", description="版本号")
|
|
89
|
+
pur_wait_in_num: int = Field(0, alias="purWaitInNum", description="待入库采购数量")
|
|
90
|
+
available_stock_num: Optional[int] = Field(None, alias="availableStockNum", description="可用库存数量")
|
|
91
|
+
oversea_lock_stock_num: int = Field(0, alias="overseaLockStockNum", description="海外锁定库存数量")
|
|
92
|
+
oversea_move_pair_mark: int = Field(1, alias="overseaMovePairMark", description="海外移动配对标记")
|
|
93
|
+
oversea_warehose_id: str = Field("", alias="overseaWarehoseId", description="海外仓库ID")
|
|
94
|
+
full_name: Optional[str] = Field(None, alias="fullName", description="完整名称")
|
|
95
|
+
sku: Optional[str] = Field(None, alias="sku", description="SKU编码")
|
|
96
|
+
sku_code: Optional[str] = Field(None, alias="skuCode", description="SKU代码")
|
|
97
|
+
name: Optional[str] = Field(None, alias="name", description="名称")
|
|
98
|
+
img_url: Optional[str] = Field(None, alias="imgUrl", description="图片URL")
|
|
99
|
+
tiny_img_url: Optional[str] = Field(None, alias="tinyImgUrl", description="缩略图URL")
|
|
100
|
+
source_url: Optional[str] = Field(None, alias="sourceUrl", description="来源URL")
|
|
101
|
+
sbm_id: Optional[str] = Field(None, alias="sbmId", description="SBM ID")
|
|
102
|
+
sku_pro: Optional[str] = Field(None, alias="skuPro", description="SKU属性")
|
|
103
|
+
name_pro: Optional[str] = Field(None, alias="namePro", description="名称属性")
|
|
104
|
+
weight_pro: Optional[float] = Field(None, alias="weightPro", description="重量属性")
|
|
105
|
+
price_pro: Optional[float] = Field(None, alias="pricePro", description="价格属性")
|
|
106
|
+
source_url_pro: Optional[str] = Field(None, alias="sourceUrlPro", description="来源URL属性")
|
|
107
|
+
comment_pro: Optional[str] = Field(None, alias="commentPro", description="备注属性")
|
|
108
|
+
img_url_pro: Optional[str] = Field(None, alias="imgUrlPro", description="图片URL属性")
|
|
109
|
+
is_used_pro: Optional[int] = Field(None, alias="isUsedPro", description="是否使用属性")
|
|
110
|
+
full_cid_pro: Optional[str] = Field(None, alias="fullCidPro", description="完整分类ID属性")
|
|
111
|
+
name_cn_bg: Optional[str] = Field(None, alias="nameCnBg", description="中文名称背景")
|
|
112
|
+
name_en_bg: Optional[str] = Field(None, alias="nameEnBg", description="英文名称背景")
|
|
113
|
+
weight_bg: Optional[float] = Field(None, alias="weightBg", description="重量背景")
|
|
114
|
+
price_bg: Optional[float] = Field(None, alias="priceBg", description="价格背景")
|
|
115
|
+
agent_name: Optional[str] = Field(None, alias="agentName", description="代理商名称")
|
|
116
|
+
development_name: Optional[str] = Field(None, alias="developmentName", description="开发人员名称")
|
|
117
|
+
proposal_num: Optional[int] = Field(None, alias="proposalNum", description="提案数量")
|
|
118
|
+
recent_in_time: Optional[datetime] = Field(None, alias="recentInTime", description="最近入库时间")
|
|
119
|
+
recent_out_time: Optional[datetime] = Field(None, alias="recentOutTime", description="最近出库时间")
|
|
120
|
+
ids: Optional[List[int]] = Field(None, alias="ids", description="ID列表")
|
|
121
|
+
prices: Optional[List[float]] = Field(None, alias="prices", description="价格列表")
|
|
122
|
+
kc_nums: Optional[List[int]] = Field(None, alias="kcNums", description="库存数量列表")
|
|
123
|
+
aqkc_nums: Optional[List[int]] = Field(None, alias="aqkcNums", description="安全库存数量列表")
|
|
124
|
+
good_shelf_ids: Optional[List[int]] = Field(None, alias="goodShelfIds", description="货架ID列表")
|
|
125
|
+
comments: Optional[List[str]] = Field(None, alias="comments", description="备注列表")
|
|
126
|
+
full_cids: Optional[List[str]] = Field(None, alias="fullCids", description="完整分类ID列表")
|
|
127
|
+
stock_num_zh: Optional[int] = Field(None, alias="stockNumZh", description="库存数量中文")
|
|
128
|
+
group_num: Optional[int] = Field(None, alias="groupNum", description="分组数量")
|
|
129
|
+
group_sku_table: Optional[str] = Field(None, alias="groupSkuTable", description="分组SKU表")
|
|
130
|
+
old_price: Optional[float] = Field(None, alias="oldPrice", description="旧价格")
|
|
131
|
+
old_stock_num: Optional[int] = Field(None, alias="oldStockNum", description="旧库存数量")
|
|
132
|
+
last_pur_price: Optional[float] = Field(None, alias="lastPurPrice", description="最后采购价格")
|
|
133
|
+
sale_cofficient: Optional[float] = Field(None, alias="saleCofficient", description="销售系数")
|
|
134
|
+
dxm_warehose_product_g: Optional[str] = Field(None, alias="dxmWarehoseProductG", description="DXM仓库商品G")
|
|
135
|
+
proposal_set: Optional[str] = Field(None, alias="proposalSet", description="提案集")
|
|
136
|
+
proposal_set_json: Optional[str] = Field(None, alias="proposalSetJson", description="提案集JSON")
|
|
137
|
+
this_arrival_num: Optional[int] = Field(None, alias="thisArrivalNum", description="本次到货数量")
|
|
138
|
+
daily_sale: Optional[float] = Field(None, alias="dailySale", description="日销量")
|
|
139
|
+
daily_sale_num: Optional[int] = Field(None, alias="dailySaleNum", description="日销售数量")
|
|
140
|
+
warning_day: Optional[int] = Field(None, alias="warningDay", description="预警天数")
|
|
141
|
+
purchase_plan_number: int = Field(0, alias="purchasePlanNumber", description="采购计划数量")
|
|
142
|
+
warehouse_name: str = Field(..., alias="warehouseName", description="仓库名称")
|
|
143
|
+
goods_shelf_lock: int = Field(0, alias="goodsShelfLock", description="货架锁定")
|
|
144
|
+
state: Optional[int] = Field(None, alias="state", description="状态")
|
|
145
|
+
goods_shelf_type: int = Field(0, alias="goodsShelfType", description="货架类型")
|
|
146
|
+
picking_safe_stock_num: int = Field(0, alias="pickingSafeStockNum", description="拣货安全库存数量")
|
|
147
|
+
oversea_product_sku: Optional[str] = Field(None, alias="overseaProductSku", description="海外商品SKU")
|
|
148
|
+
authorization_id: Optional[str] = Field(None, alias="authorizationId", description="授权ID")
|
|
149
|
+
sfxz: Optional[str] = Field(None, alias="sfxz", description="SFXZ")
|
|
150
|
+
oversea_platfrom: Optional[str] = Field(None, alias="overseaPlatfrom", description="海外平台")
|
|
151
|
+
unbilled_order_num: int = Field(0, alias="unbilledOrderNum", description="未开票订单数量")
|
|
152
|
+
id_str: str = Field(..., alias="idStr", description="ID字符串形式")
|
|
153
|
+
supplier_id_str: str = Field(..., alias="supplierIdStr", description="供应商ID字符串形式")
|
|
154
|
+
product_id_str: str = Field(..., alias="productIdStr", description="商品ID字符串形式")
|
|
155
|
+
goods_shelf_id_str: str = Field(..., alias="goodsShelfIdStr", description="货架ID字符串形式")
|
|
156
|
+
|
|
157
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
class DxmCommodityProduct(BaseModel):
|
|
161
|
+
"""DXM商品信息"""
|
|
162
|
+
id: int = Field(..., alias="id", description="商品ID")
|
|
163
|
+
puid: int = Field(..., alias="puid", description="用户ID")
|
|
164
|
+
full_cid: str = Field(..., alias="fullCid", description="完整分类ID")
|
|
165
|
+
name: str = Field(..., alias="name", description="商品名称")
|
|
166
|
+
name_en: str = Field("", alias="nameEn", description="商品英文名称")
|
|
167
|
+
spu: str = Field(..., alias="spu", description="SPU编码")
|
|
168
|
+
sku: str = Field(..., alias="sku", description="SKU编码")
|
|
169
|
+
sku_code: str = Field(..., alias="skuCode", description="SKU代码")
|
|
170
|
+
parent_id: int = Field(..., alias="parentId", description="父商品ID")
|
|
171
|
+
survey_id: int = Field(0, alias="surveyId", description="调查ID")
|
|
172
|
+
data_source: Optional[str] = Field(None, alias="dataSource", description="数据来源")
|
|
173
|
+
attr: Optional[str] = Field(None, alias="attr", description="属性")
|
|
174
|
+
type: Optional[str] = Field(None, alias="type", description="类型")
|
|
175
|
+
price: float = Field(..., alias="price", description="价格")
|
|
176
|
+
process_fee: float = Field(0.0, alias="processFee", description="加工费")
|
|
177
|
+
weight: float = Field(..., alias="weight", description="重量")
|
|
178
|
+
allow_weight_error: float = Field(0.0, alias="allowWeightError", description="允许重量误差")
|
|
179
|
+
comment: str = Field("", alias="comment", description="备注")
|
|
180
|
+
propasal_comment: Optional[str] = Field(None, alias="propasalComment", description="提案备注")
|
|
181
|
+
comment_color: Optional[str] = Field(None, alias="commentColor", description="备注颜色")
|
|
182
|
+
img_url: str = Field(..., alias="imgUrl", description="图片URL")
|
|
183
|
+
img_url_exception: int = Field(2, alias="imgUrlException", description="图片URL异常")
|
|
184
|
+
source_url: str = Field(..., alias="sourceUrl", description="来源URL")
|
|
185
|
+
is_used: int = Field(1, alias="isUsed", description="是否使用")
|
|
186
|
+
product_status: int = Field(0, alias="productStatus", description="商品状态")
|
|
187
|
+
is_del: int = Field(0, alias="isDel", description="是否删除")
|
|
188
|
+
variant_or_not: int = Field(0, alias="variantOrNot", description="是否有变体")
|
|
189
|
+
state: int = Field(1, alias="state", description="状态")
|
|
190
|
+
is_stock: int = Field(0, alias="isStock", description="是否有库存")
|
|
191
|
+
group_state: int = Field(0, alias="groupState", description="分组状态")
|
|
192
|
+
sbm_id: Optional[str] = Field(None, alias="sbmId", description="SBM ID")
|
|
193
|
+
agent_id: int = Field(0, alias="agentId", description="代理商ID")
|
|
194
|
+
development_id: int = Field(..., alias="developmentId", description="开发人员ID")
|
|
195
|
+
sales_id: int = Field(0, alias="salesId", description="销售人员ID")
|
|
196
|
+
uninue_flag: int = Field(0, alias="uninueFlag", description="唯一标志")
|
|
197
|
+
product_type: str = Field(..., alias="productType", description="商品类型")
|
|
198
|
+
qc_type: int = Field(0, alias="qcType", description="质检类型")
|
|
199
|
+
is_qc_collect: int = Field(0, alias="isQcCollect", description="是否质检收集")
|
|
200
|
+
qc_template_id: int = Field(0, alias="qcTemplateId", description="质检模板ID")
|
|
201
|
+
is_bind_compliance: bool = Field(False, alias="isBindCompliance", description="是否绑定合规")
|
|
202
|
+
template_id: Optional[str] = Field(None, alias="templateId", description="模板ID")
|
|
203
|
+
template_name: Optional[str] = Field(None, alias="templateName", description="模板名称")
|
|
204
|
+
tiny_img_url: Optional[str] = Field(None, alias="tinyImgUrl", description="缩略图URL")
|
|
205
|
+
length: float = Field(0.0, alias="length", description="长度")
|
|
206
|
+
width: float = Field(0.0, alias="width", description="宽度")
|
|
207
|
+
height: float = Field(0.0, alias="height", description="高度")
|
|
208
|
+
package_length: float = Field(0.0, alias="packageLength", description="包装长度")
|
|
209
|
+
package_width: float = Field(0.0, alias="packageWidth", description="包装宽度")
|
|
210
|
+
package_height: float = Field(0.0, alias="packageHeight", description="包装高度")
|
|
211
|
+
package_weight: float = Field(0.0, alias="packageWeight", description="包装重量")
|
|
212
|
+
create_time: datetime = Field(..., alias="createTime", description="创建时间")
|
|
213
|
+
update_time: datetime = Field(..., alias="updateTime", description="更新时间")
|
|
214
|
+
name_cn_bg: Optional[str] = Field(None, alias="nameCnBg", description="中文名称背景")
|
|
215
|
+
name_en_bg: Optional[str] = Field(None, alias="nameEnBg", description="英文名称背景")
|
|
216
|
+
weight_bg: Optional[float] = Field(None, alias="weightBg", description="重量背景")
|
|
217
|
+
price_bg: Optional[float] = Field(None, alias="priceBg", description="价格背景")
|
|
218
|
+
material_bg: Optional[str] = Field(None, alias="materialBg", description="材料背景")
|
|
219
|
+
purpose_bg: Optional[str] = Field(None, alias="purposeBg", description="用途背景")
|
|
220
|
+
hgbm_bg: Optional[str] = Field(None, alias="hgbmBg", description="海关编码背景")
|
|
221
|
+
danger_des_bg: Optional[str] = Field(None, alias="dangerDesBg", description="危险描述背景")
|
|
222
|
+
is_customs: Optional[bool] = Field(None, alias="isCustoms", description="是否海关")
|
|
223
|
+
vids_ys: Optional[str] = Field(None, alias="vidsYs", description="视频YS")
|
|
224
|
+
sku_ys: Optional[str] = Field(None, alias="skuYs", description="SKU YS")
|
|
225
|
+
pt_ys: Optional[str] = Field(None, alias="ptYs", description="PT YS")
|
|
226
|
+
shop_id_ys: Optional[str] = Field(None, alias="shopIdYs", description="店铺ID YS")
|
|
227
|
+
pid_ys: Optional[str] = Field(None, alias="pidYs", description="PID YS")
|
|
228
|
+
smt_vids: Optional[str] = Field(None, alias="smtVids", description="SMT视频")
|
|
229
|
+
smt_pts: Optional[str] = Field(None, alias="smtPts", description="SMT PT")
|
|
230
|
+
smt_pids: Optional[str] = Field(None, alias="smtPids", description="SMT PID")
|
|
231
|
+
smt_shop_ids: Optional[str] = Field(None, alias="smtShopIds", description="SMT店铺ID")
|
|
232
|
+
our_vids: Optional[str] = Field(None, alias="ourVids", description="我们的视频")
|
|
233
|
+
our_pts: Optional[str] = Field(None, alias="ourPts", description="我们的PT")
|
|
234
|
+
our_pids: Optional[str] = Field(None, alias="ourPids", description="我们的PID")
|
|
235
|
+
our_shop_ids: Optional[str] = Field(None, alias="ourShopIds", description="我们的店铺ID")
|
|
236
|
+
sf_order: Optional[str] = Field(None, alias="sfOrder", description="顺丰订单")
|
|
237
|
+
full_name: str = Field(..., alias="fullName", description="完整名称")
|
|
238
|
+
warehose_id: Optional[str] = Field(None, alias="warehoseId", description="仓库ID")
|
|
239
|
+
warehose_name: Optional[str] = Field(None, alias="warehoseName", description="仓库名称")
|
|
240
|
+
invoice_save: bool = Field(False, alias="invoiceSave", description="发票保存")
|
|
241
|
+
ncm: Optional[str] = Field(None, alias="ncm", description="NCM编码")
|
|
242
|
+
cest: Optional[str] = Field(None, alias="cest", description="CEST编码")
|
|
243
|
+
unit: Optional[str] = Field(None, alias="unit", description="单位")
|
|
244
|
+
origin: Optional[str] = Field(None, alias="origin", description="产地")
|
|
245
|
+
group_num: Optional[int] = Field(None, alias="groupNum", description="分组数量")
|
|
246
|
+
contain_weight: float = Field(0.0, alias="containWeight", description="包含重量")
|
|
247
|
+
child_ids: Optional[str] = Field(None, alias="childIds", description="子商品ID")
|
|
248
|
+
child_nums: Optional[str] = Field(None, alias="childNums", description="子商品数量")
|
|
249
|
+
group_sku_table: Optional[str] = Field(None, alias="groupSkuTable", description="分组SKU表")
|
|
250
|
+
goods_shelf_id: Optional[str] = Field(None, alias="goodsShelfId", description="货架ID")
|
|
251
|
+
good_shelf_name: Optional[str] = Field(None, alias="goodShelfName", description="货架名称")
|
|
252
|
+
product_type_list: Optional[str] = Field(None, alias="productTypeList", description="商品类型列表")
|
|
253
|
+
relation_flag: Optional[str] = Field(None, alias="relationFlag", description="关系标志")
|
|
254
|
+
relation_str: Optional[str] = Field(None, alias="relationStr", description="关系字符串")
|
|
255
|
+
ghs_count: Optional[int] = Field(None, alias="ghsCount", description="GHS计数")
|
|
256
|
+
sfxz: Optional[str] = Field(None, alias="sfxz", description="SFXZ")
|
|
257
|
+
arrival_num: Optional[int] = Field(None, alias="arrivalNum", description="到货数量")
|
|
258
|
+
dxm_label: Optional[str] = Field(None, alias="dxmLabel", description="DXM标签")
|
|
259
|
+
stock_num: Optional[int] = Field(None, alias="stockNum", description="库存数量")
|
|
260
|
+
goods_shelf_name: Optional[str] = Field(None, alias="goodsShelfName", description="货架名称")
|
|
261
|
+
dxm_product_customs: Optional[str] = Field(None, alias="dxmProductCustoms", description="DXM商品海关")
|
|
262
|
+
dxm_commodity_product_g: Optional[str] = Field(None, alias="dxmCommodityProductG", description="DXM商品G")
|
|
263
|
+
dxm_product_album_list: List[DxmProductAlbum] = Field(..., alias="dxmProductAlbumList",
|
|
264
|
+
description="DXM商品相册列表")
|
|
265
|
+
product_variation_list: List[ProductVariation] = Field(..., alias="productVariationList",
|
|
266
|
+
description="商品变体列表")
|
|
267
|
+
product_variation_str: Optional[str] = Field(None, alias="productVariationStr", description="商品变体字符串")
|
|
268
|
+
alibaba_pair_product_list: Optional[str] = Field(None, alias="alibabaPairProductList",
|
|
269
|
+
description="阿里巴巴配对商品列表")
|
|
270
|
+
alias_sku: Optional[str] = Field(None, alias="aliasSku", description="别名SKU")
|
|
271
|
+
color: Optional[str] = Field(None, alias="color", description="颜色")
|
|
272
|
+
size: Optional[str] = Field(None, alias="size", description="尺寸")
|
|
273
|
+
check_detail_list: Optional[str] = Field(None, alias="checkDetailList", description="检查详情列表")
|
|
274
|
+
supplier_id: Optional[str] = Field(None, alias="supplierId", description="供应商ID")
|
|
275
|
+
supplier_ids: Optional[str] = Field(None, alias="supplierIds", description="供应商ID列表")
|
|
276
|
+
qc_content: Optional[str] = Field(None, alias="qcContent", description="质检内容")
|
|
277
|
+
qc_img_url: Optional[str] = Field(None, alias="qcImgUrl", description="质检图片URL")
|
|
278
|
+
qc_img_num: int = Field(0, alias="qcImgNum", description="质检图片数量")
|
|
279
|
+
product_packs: Optional[str] = Field(None, alias="productPacks", description="商品包装")
|
|
280
|
+
main_supplier_name: Optional[str] = Field(None, alias="mainSupplierName", description="主供应商名称")
|
|
281
|
+
main_supplier_id: Optional[str] = Field(None, alias="mainSupplierId", description="主供应商ID")
|
|
282
|
+
dxm_supplier_list_str: Optional[str] = Field(None, alias="dxmSupplierListStr", description="DXM供应商列表字符串")
|
|
283
|
+
supplier_size: int = Field(0, alias="supplierSize", description="供应商大小")
|
|
284
|
+
variant_sku_count: int = Field(0, alias="variantSkuCount", description="变体SKU计数")
|
|
285
|
+
current_sku_count: int = Field(0, alias="currentSkuCount", description="当前SKU计数")
|
|
286
|
+
reference_by_group: int = Field(0, alias="referenceByGroup", description="按组引用")
|
|
287
|
+
agent_name: Optional[str] = Field(None, alias="agentName", description="代理商名称")
|
|
288
|
+
development_name: str = Field(..., alias="developmentName", description="开发人员名称")
|
|
289
|
+
sales_name: Optional[str] = Field(None, alias="salesName", description="销售人员名称")
|
|
290
|
+
productuu_id: Optional[str] = Field(None, alias="productuuId", description="商品UUID")
|
|
291
|
+
auth_id: Optional[str] = Field(None, alias="authId", description="授权ID")
|
|
292
|
+
ov_warehose_id: Optional[str] = Field(None, alias="ovWarehoseId", description="OV仓库ID")
|
|
293
|
+
product_amount_price: Optional[str] = Field(None, alias="productAmountPrice", description="商品金额价格")
|
|
294
|
+
is_pair_oversea: int = Field(0, alias="isPairOversea", description="是否配对海外")
|
|
295
|
+
id_str: str = Field(..., alias="idStr", description="ID字符串形式")
|
|
296
|
+
product_variation_str_list: List[str] = Field(..., alias="productVariationStrList",
|
|
297
|
+
description="商品变体字符串列表")
|
|
298
|
+
qc_template_id_str: str = Field(..., alias="qcTemplateIdStr", description="质检模板ID字符串")
|
|
299
|
+
goods_shelf_id_str: Optional[str] = Field(None, alias="goodsShelfIdStr", description="货架ID字符串形式")
|
|
300
|
+
|
|
301
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class DxmProductCustoms(BaseModel):
|
|
305
|
+
"""DXM商品海关信息"""
|
|
306
|
+
id: int = Field(..., alias="id", description="海关信息ID")
|
|
307
|
+
product_id: int = Field(..., alias="productId", description="商品ID")
|
|
308
|
+
name_cn: str = Field(..., alias="nameCn", description="中文名称")
|
|
309
|
+
name_en: str = Field(..., alias="nameEn", description="英文名称")
|
|
310
|
+
price: float = Field(..., alias="price", description="价格")
|
|
311
|
+
weight: float = Field(..., alias="weight", description="重量")
|
|
312
|
+
material: str = Field("", alias="material", description="材料")
|
|
313
|
+
purpose: str = Field("", alias="purpose", description="用途")
|
|
314
|
+
hgbm: str = Field(..., alias="hgbm", description="海关编码")
|
|
315
|
+
danger_des: int = Field(0, alias="dangerDes", description="危险描述")
|
|
316
|
+
puid: int = Field(..., alias="puid", description="用户ID")
|
|
317
|
+
create_time: datetime = Field(..., alias="createTime", description="创建时间")
|
|
318
|
+
update_time: datetime = Field(..., alias="updateTime", description="更新时间")
|
|
319
|
+
sku: Optional[str] = Field(None, alias="sku", description="SKU编码")
|
|
320
|
+
id_str: str = Field(..., alias="idStr", description="ID字符串形式")
|
|
321
|
+
|
|
322
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
class ProductDTO(BaseModel):
|
|
326
|
+
"""商品数据传输对象"""
|
|
327
|
+
dxm_commodity_product: DxmCommodityProduct = Field(..., alias="dxmCommodityProduct", description="DXM商品信息")
|
|
328
|
+
dxm_product_customs: DxmProductCustoms = Field(..., alias="dxmProductCustoms", description="DXM商品海关信息")
|
|
329
|
+
dxm_warehose_list: Optional[List[Any]] = Field(None, alias="dxmWarehoseList", description="DXM仓库列表")
|
|
330
|
+
warehouse_id_list: Optional[List[Any]] = Field(None, alias="warehouseIdList", description="仓库ID列表")
|
|
331
|
+
dxm_quality_check_template: Optional[Any] = Field(None, alias="dxmQualityCheckTemplate", description="DXM质检模板")
|
|
332
|
+
dxm_supplier_product_relation_list: Optional[List[Any]] = Field(None, alias="dxmSupplierProductRelationList",
|
|
333
|
+
description="DXM供应商商品关系列表")
|
|
334
|
+
dxm_commodity_product_list: Optional[List[Any]] = Field(None, alias="dxmCommodityProductList",
|
|
335
|
+
description="DXM商品列表")
|
|
336
|
+
spu: Optional[str] = Field(None, alias="spu", description="SPU编码")
|
|
337
|
+
dxm_product_packs: List[Any] = Field(..., alias="dxmProductPacks", description="DXM商品包装列表")
|
|
338
|
+
supplier_product_relation_map_list: List[SupplierProductRelation] = Field(...,
|
|
339
|
+
alias="supplierProductRelationMapList",
|
|
340
|
+
description="供应商商品关系映射列表")
|
|
341
|
+
dxm_warehouse_product_list: List[DxmWarehouseProduct] = Field(..., alias="dxmWarehouseProductList",
|
|
342
|
+
description="DXM仓库商品列表")
|
|
343
|
+
count: int = Field(0, alias="count", description="计数")
|
|
344
|
+
|
|
345
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
class ViewDxmCommodityProductResponse(BaseModel):
|
|
349
|
+
"""查看DXM商品信息响应"""
|
|
350
|
+
product_dto: ProductDTO = Field(..., alias="productDTO", description="商品数据传输对象")
|
|
351
|
+
|
|
352
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
# =============================编辑部分=========================================
|
|
356
|
+
|
|
357
|
+
class EditDxmCommodityProduct(BaseModel):
|
|
358
|
+
product_id: str = Field("", alias="productId")
|
|
359
|
+
name: str
|
|
360
|
+
name_en: str = Field("", alias="nameEn")
|
|
361
|
+
sku_code: str = Field("", alias="skuCode")
|
|
362
|
+
sku: str
|
|
363
|
+
product_variation_str: str = Field("", alias="productVariationStr")
|
|
364
|
+
sbm_id: str = Field("", alias="sbmId")
|
|
365
|
+
agent_id: str = Field("", alias="agentId")
|
|
366
|
+
development_id: str = Field("", alias="developmentId")
|
|
367
|
+
sales_id: str = Field("", alias="salesId")
|
|
368
|
+
weight: str
|
|
369
|
+
allow_weight_error: str = Field("", alias="allowWeightError")
|
|
370
|
+
price: str
|
|
371
|
+
source_url: str = Field("", alias="sourceUrl")
|
|
372
|
+
img_url: str = Field("", alias="imgUrl")
|
|
373
|
+
is_used: int = Field(..., alias="isUsed")
|
|
374
|
+
full_cid: str = Field(..., alias="fullCid")
|
|
375
|
+
product_type: str = Field(..., alias="productType")
|
|
376
|
+
length: int
|
|
377
|
+
width: int
|
|
378
|
+
height: int
|
|
379
|
+
qc_type: int = Field(..., alias="qcType")
|
|
380
|
+
product_status: str = Field(..., alias="productStatus")
|
|
381
|
+
child_ids: str = Field("", alias="childIds")
|
|
382
|
+
child_nums: str = Field("", alias="childNums")
|
|
383
|
+
process_fee: int = Field(..., alias="processFee")
|
|
384
|
+
qc_content: str = Field("", alias="qcContent")
|
|
385
|
+
qc_img_str: str = Field("", alias="qcImgStr")
|
|
386
|
+
qc_img_num: int = Field("", alias="qcImgNum")
|
|
387
|
+
group_state: str = Field("", alias="groupState")
|
|
388
|
+
ncm: str = Field("", alias="ncm")
|
|
389
|
+
cest: str = Field("", alias="cest")
|
|
390
|
+
unit: str = Field("", alias="unit")
|
|
391
|
+
origin: str = Field("", alias="origin")
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
class EditDxmProductCustoms(BaseModel):
|
|
395
|
+
name_cn_bg: str = Field(..., alias="nameCnBg")
|
|
396
|
+
name_en_bg: str = Field(..., alias="nameEnBg")
|
|
397
|
+
weight_bg: str = Field(..., alias="weightBg")
|
|
398
|
+
price_bg: str = Field(..., alias="priceBg")
|
|
399
|
+
material_bg: str = Field("", alias="materialBg")
|
|
400
|
+
purpose_bg: str = Field("", alias="purposeBg")
|
|
401
|
+
hgbm_bg: str = Field("", alias="hgbmBg")
|
|
402
|
+
danger_des_bg: str = Field(..., alias="dangerDesBg")
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
class EditSupplierProductRelationMap(BaseModel):
|
|
406
|
+
supplier_id: str = Field(..., alias="supplierId")
|
|
407
|
+
is_main: int = Field(..., alias="isMain")
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
class EditObj(BaseModel):
|
|
411
|
+
dxm_commodity_product: DxmCommodityProduct = Field(..., alias="dxmCommodityProduct")
|
|
412
|
+
dxm_product_customs: DxmProductCustoms = Field(..., alias="dxmProductCustoms")
|
|
413
|
+
warehouse_id_list: str = Field("", alias="warehouseIdList")
|
|
414
|
+
supplier_product_relation_map_list: List[EditSupplierProductRelationMap] = Field(..., alias="supplierProductRelationMapList")
|
|
415
|
+
dxm_product_packs: List = Field(..., alias="dxmProductPacks")
|
|
416
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from pydantic import BaseModel, Field, ConfigDict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DxmEbayProductModel(BaseModel):
|
|
5
|
+
page_no: str = Field(default='', alias='pageNo', description="页码")
|
|
6
|
+
page_size: str = Field(default='', alias='pageSize', description="每页数量")
|
|
7
|
+
shop_id: str = Field(default=-1, alias='shopId', description="店铺ID 全部:-1")
|
|
8
|
+
shop_group_id: str = Field(default='', alias='shopGroupId')
|
|
9
|
+
full_cid: str = Field(default='', alias='fullCid')
|
|
10
|
+
dxm_state: str = Field(default='online', alias='dxmState', description="店小秘在线状态 online/offline")
|
|
11
|
+
dxm_offline_state: str = Field(default='', alias='dxmOfflineState', description="店小秘离线状态")
|
|
12
|
+
search_type: str = Field(default='1', alias='searchType', description="搜索类型(1:标题-3:sku-4:SubSku)")
|
|
13
|
+
search_value: str = Field(default='', alias='searchValue', description="搜索内容")
|
|
14
|
+
sort_name: str = Field(default='', alias='sortName', description="排序字段")
|
|
15
|
+
sort_value: str = Field(default='0', alias='sortValue', description="排序内容")
|
|
16
|
+
sell_ype: str = Field(default='0', alias='sellType', description="售卖形式 全部:0,拍卖:'1'具体参照页面")
|
|
17
|
+
listing_status: str = Field(default='', alias='listingStatus')
|
|
18
|
+
advanced_search: str = Field(default='yes', alias='advancedSearch')
|
|
19
|
+
price_lift: str = Field(default='', alias='priceLift')
|
|
20
|
+
price_right: str = Field(default='', alias='priceRight')
|
|
21
|
+
inventory_lift: str = Field(default='', alias='inventoryLift')
|
|
22
|
+
inventory_right: str = Field(default='', alias='inventoryRight')
|
|
23
|
+
save_lift: str = Field(default='', alias='saveLift')
|
|
24
|
+
save_right: str = Field(default='', alias='saveRight')
|
|
25
|
+
sold_lift: str = Field(default='', alias='soldLift')
|
|
26
|
+
sold_right: str = Field(default='', alias='soldRight')
|
|
27
|
+
time_lift: str = Field(default='', alias='timeLift')
|
|
28
|
+
time_right: str = Field(default='', alias='timeRight')
|
|
29
|
+
hit_count_lift: str = Field(default='', alias='hitCountLift')
|
|
30
|
+
hit_count_right: str = Field(default='', alias='hitCountRight')
|
|
31
|
+
listing_duration: str = Field(default='', alias='listingDuration')
|
|
32
|
+
dispatch_time_max: str = Field(default='', alias='dispatchTimeMax')
|
|
33
|
+
paypal: str = Field(default='', alias='paypal')
|
|
34
|
+
gpsr_manufacturer: str = Field(default='-1', alias='gpsrManufacturer')
|
|
35
|
+
gpsr_responsible_persons: str = Field(default='-1', alias='gpsrResponsiblePersons')
|
|
36
|
+
gpsr_safety: str = Field(default='-1', alias='gpsrSafety')
|
|
37
|
+
gpsr_documents: str = Field(default='-1', alias='gpsrDocuments')
|
|
38
|
+
gpsr_document_status: str = Field(default='-1', alias='gpsrDocumentStatus')
|
|
39
|
+
country: str = Field(default='', alias='country')
|
|
40
|
+
advanced_time: str = Field(default='1', alias='advancedTime')
|
|
41
|
+
source_url: str = Field(default='', alias='sourceUrl')
|
|
42
|
+
product_search_type: str = Field(default='1', alias='productSearchType')
|
|
43
|
+
site: str = Field(default='', alias='site', description="站点(国家代码 例如US )")
|
|
44
|
+
product_category_id: str = Field(default='', alias='productCategoryId')
|
|
45
|
+
store_category_id: str = Field(default='0', alias='storeCategoryId')
|
|
46
|
+
location_name: str = Field(default='', alias='locationName')
|
|
47
|
+
video_sel: str = Field(default='-1', alias='videoSel')
|
|
48
|
+
comment_type: str = Field(default='0', alias='commentType')
|
|
49
|
+
comment_content: str = Field(default='', alias='commentContent')
|
|
50
|
+
vat_percent_type: str = Field(default='', alias='vatPercentType')
|
|
51
|
+
motor_state: str = Field(default='0', alias='motorState')
|
|
52
|
+
|
|
53
|
+
model_config = ConfigDict(
|
|
54
|
+
populate_by_name=True,
|
|
55
|
+
title="店小秘ebay在线产品查询模型"
|
|
56
|
+
)
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
from ey_commerce_lib.dxm.schemas.dxm_commodity_product import ViewDxmCommodityProductResponse, EditObj
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def get_edit_commodity_product_by_view_dxm_response(data: ViewDxmCommodityProductResponse):
|
|
5
|
+
"""
|
|
6
|
+
根据查看店小秘接口的响应
|
|
7
|
+
:return:
|
|
8
|
+
"""
|
|
9
|
+
dxm_commodity_product = data.product_dto.dxm_commodity_product
|
|
10
|
+
dxm_product_customs = data.product_dto.dxm_product_customs
|
|
11
|
+
|
|
12
|
+
product_id = dxm_commodity_product.id
|
|
13
|
+
name = dxm_commodity_product.name
|
|
14
|
+
name_en = dxm_commodity_product.name_en
|
|
15
|
+
sku_code = dxm_commodity_product.sku_code
|
|
16
|
+
sku = dxm_commodity_product.sku
|
|
17
|
+
product_variation_str = dxm_commodity_product.product_variation_str
|
|
18
|
+
sbm_id = dxm_commodity_product.sbm_id
|
|
19
|
+
agent_id = dxm_commodity_product.agent_id
|
|
20
|
+
development_id = dxm_commodity_product.development_id
|
|
21
|
+
sales_id = dxm_commodity_product.sales_id
|
|
22
|
+
weight = dxm_commodity_product.weight
|
|
23
|
+
allow_weight_error = dxm_commodity_product.allow_weight_error
|
|
24
|
+
price = dxm_commodity_product.price
|
|
25
|
+
source_url = dxm_commodity_product.source_url
|
|
26
|
+
img_url = dxm_commodity_product.img_url
|
|
27
|
+
is_used = dxm_commodity_product.is_used
|
|
28
|
+
full_cid = dxm_commodity_product.full_cid
|
|
29
|
+
product_type = dxm_commodity_product.product_type
|
|
30
|
+
length = dxm_commodity_product.length
|
|
31
|
+
width = dxm_commodity_product.width
|
|
32
|
+
height = dxm_commodity_product.height
|
|
33
|
+
qc_type = dxm_commodity_product.qc_type
|
|
34
|
+
product_status = dxm_commodity_product.product_status
|
|
35
|
+
child_ids = dxm_commodity_product.child_ids
|
|
36
|
+
child_nums = dxm_commodity_product.child_nums
|
|
37
|
+
process_fee = dxm_commodity_product.process_fee
|
|
38
|
+
qc_content = dxm_commodity_product.qc_content
|
|
39
|
+
qc_img_num = dxm_commodity_product.qc_img_num
|
|
40
|
+
group_state = dxm_commodity_product.group_state
|
|
41
|
+
ncm = dxm_commodity_product.ncm
|
|
42
|
+
cest = dxm_commodity_product.cest
|
|
43
|
+
unit = dxm_commodity_product.unit
|
|
44
|
+
origin = dxm_commodity_product.origin
|
|
45
|
+
|
|
46
|
+
name_cn_bg = dxm_product_customs.name_cn
|
|
47
|
+
name_en_bg = dxm_product_customs.name_en
|
|
48
|
+
weight_bg = dxm_product_customs.weight
|
|
49
|
+
price_bg = dxm_commodity_product.price_bg
|
|
50
|
+
material_bg = dxm_commodity_product.material_bg
|
|
51
|
+
purpose_bg = dxm_commodity_product.purpose_bg
|
|
52
|
+
hgbm_bg = dxm_commodity_product.hgbm_bg
|
|
53
|
+
danger_des_bg = dxm_commodity_product.danger_des_bg
|
|
54
|
+
|
|
55
|
+
warehouse_id_list = data.product_dto.warehouse_id_list
|
|
56
|
+
|
|
57
|
+
supplier_product_relation_map_list = data.product_dto.supplier_product_relation_map_list
|
|
58
|
+
new_supplier_product_relation_map_list = []
|
|
59
|
+
for supplier_product_relation_map in supplier_product_relation_map_list:
|
|
60
|
+
supplier_id = supplier_product_relation_map.supplier_id
|
|
61
|
+
is_main = supplier_product_relation_map.is_main
|
|
62
|
+
new_supplier_product_relation_map_list.append({
|
|
63
|
+
'supplierId': supplier_id,
|
|
64
|
+
'isMain': is_main
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
dxm_product_packs = data.product_dto.dxm_product_packs
|
|
68
|
+
|
|
69
|
+
return EditObj.model_validate({
|
|
70
|
+
'dxmCommodityProduct': {
|
|
71
|
+
'productId': product_id,
|
|
72
|
+
'name': name,
|
|
73
|
+
'nameEn': name_en,
|
|
74
|
+
'skuCode': sku_code,
|
|
75
|
+
'sku': sku,
|
|
76
|
+
'productVariationStr': product_variation_str,
|
|
77
|
+
'sbmId': sbm_id,
|
|
78
|
+
'agentId': agent_id,
|
|
79
|
+
'developmentId': development_id,
|
|
80
|
+
'salesId': sales_id,
|
|
81
|
+
'weight': weight,
|
|
82
|
+
'allowWeightError': allow_weight_error,
|
|
83
|
+
'price': price,
|
|
84
|
+
'sourceUrl': source_url,
|
|
85
|
+
'imgUrl': img_url,
|
|
86
|
+
'isUsed': is_used,
|
|
87
|
+
'fullCid': full_cid,
|
|
88
|
+
'productType': product_type,
|
|
89
|
+
'length': length,
|
|
90
|
+
'width': width,
|
|
91
|
+
'height': height,
|
|
92
|
+
'qcType': qc_type,
|
|
93
|
+
'productStatus': product_status,
|
|
94
|
+
'childIds': child_ids,
|
|
95
|
+
'childNums': child_nums,
|
|
96
|
+
'processFee': process_fee,
|
|
97
|
+
'qcContent': qc_content,
|
|
98
|
+
'qcImgNum': qc_img_num,
|
|
99
|
+
'groupState': group_state,
|
|
100
|
+
'ncm': ncm,
|
|
101
|
+
'cest': cest,
|
|
102
|
+
'unit': unit,
|
|
103
|
+
'origin': origin
|
|
104
|
+
},
|
|
105
|
+
'dxmProductCustoms': {
|
|
106
|
+
'nameCnBg': name_cn_bg,
|
|
107
|
+
'nameEnBg': name_en_bg,
|
|
108
|
+
'weightBg': weight_bg,
|
|
109
|
+
'priceBg': price_bg,
|
|
110
|
+
'materialBg': material_bg,
|
|
111
|
+
'purposeBg': purpose_bg,
|
|
112
|
+
'hgbmBg': hgbm_bg,
|
|
113
|
+
'dangerDesBg': danger_des_bg
|
|
114
|
+
},
|
|
115
|
+
'warehouseIdList': warehouse_id_list,
|
|
116
|
+
'supplierProductRelationMapList': new_supplier_product_relation_map_list,
|
|
117
|
+
'dxmProductPacks': dxm_product_packs
|
|
118
|
+
}).model_dump_json(by_alias=True)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
LOGIN_HEADERS = {
|
|
2
|
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,'
|
|
3
|
+
'*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
|
4
|
+
'Accept-Language': 'zh-CN,zh;q=0.9',
|
|
5
|
+
'Cache-Control': 'no-cache',
|
|
6
|
+
'Connection': 'keep-alive',
|
|
7
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
8
|
+
'Origin': 'http://k5.takesend.com:8180',
|
|
9
|
+
'Pragma': 'no-cache',
|
|
10
|
+
'Referer': 'http://k5.takesend.com:8180/c_index.jsp',
|
|
11
|
+
'Upgrade-Insecure-Requests': '1',
|
|
12
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
EDIT_HEADERS = {
|
|
16
|
+
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
|
17
|
+
'Accept-Language': 'zh-CN,zh;q=0.9',
|
|
18
|
+
'Cache-Control': 'no-cache',
|
|
19
|
+
'Connection': 'keep-alive',
|
|
20
|
+
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
21
|
+
'Origin': 'http://k5.takesend.com:8180',
|
|
22
|
+
'Pragma': 'no-cache',
|
|
23
|
+
'Referer': 'http://k5.takesend.com:8180/client/Logon?action=initMenu',
|
|
24
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
|
|
25
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
26
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from httpx import AsyncClient, Timeout
|
|
2
|
+
|
|
3
|
+
from ey_commerce_lib.takesend.config import LOGIN_HEADERS, EDIT_HEADERS
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class TakeSendClient(object):
|
|
7
|
+
|
|
8
|
+
def __init__(self, username: str, password: str):
|
|
9
|
+
timeout = Timeout(connect=5.0, read=20.0, write=10.0, pool=10.0)
|
|
10
|
+
self.__async_client = AsyncClient(
|
|
11
|
+
base_url="http://k5.takesend.com:8180",
|
|
12
|
+
timeout=timeout)
|
|
13
|
+
self.__username = username
|
|
14
|
+
self.__password = password
|
|
15
|
+
|
|
16
|
+
async def login(self):
|
|
17
|
+
"""
|
|
18
|
+
自动登录
|
|
19
|
+
:return:
|
|
20
|
+
"""
|
|
21
|
+
# 1. 先访问首页更新JESSIONID
|
|
22
|
+
await self.__async_client.get("/c_index.jsp")
|
|
23
|
+
# 2.在登录
|
|
24
|
+
params = {
|
|
25
|
+
'action': 'logon'
|
|
26
|
+
}
|
|
27
|
+
data = {
|
|
28
|
+
'userid': self.__username,
|
|
29
|
+
'password': self.__password
|
|
30
|
+
}
|
|
31
|
+
await self.__async_client.post("//client/Logon", params=params, data=data, headers=LOGIN_HEADERS)
|
|
32
|
+
|
|
33
|
+
async def __client_cc_order(self, excel_data: list):
|
|
34
|
+
"""
|
|
35
|
+
修改泰嘉产品上传重量数据
|
|
36
|
+
:param excel_data:
|
|
37
|
+
:return:
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
params = {
|
|
41
|
+
'action': 'updateDweight',
|
|
42
|
+
}
|
|
43
|
+
data = {
|
|
44
|
+
'excel[]': excel_data,
|
|
45
|
+
}
|
|
46
|
+
return await self.__async_client.post("/Client/CCOrder", params=params, data=data, headers=EDIT_HEADERS)
|
|
47
|
+
|
|
48
|
+
async def __aenter__(self):
|
|
49
|
+
return self
|
|
50
|
+
|
|
51
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
52
|
+
await self.__async_client.aclose()
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
1
3
|
import pytest
|
|
2
4
|
|
|
3
5
|
from ey_commerce_lib.dxm.constant.order import ORDER_SEARCH_APPROVAL_BASE_FORM, \
|
|
4
6
|
ORDER_SEARCH_PENDING_PROCESSING_BASE_FORM, ORDER_SEARCH_SELF_WAREHOUSE_BASE_FORM, \
|
|
5
|
-
ORDER_SEARCH_OUT_OF_STOCK_BASE_FORM
|
|
7
|
+
ORDER_SEARCH_OUT_OF_STOCK_BASE_FORM, ORDER_SEARCH_HAVE_GOODS_BASE_FORM
|
|
6
8
|
from ey_commerce_lib.dxm.main import DxmClient
|
|
7
9
|
from ey_commerce_lib.dxm.schemas.warehouse import WarehouseProductQuery
|
|
8
10
|
from ey_commerce_lib.dxm.utils.mark import get_custom_mark_content_list_by_data_custom_mark, \
|
|
9
11
|
generate_add_or_update_user_comment_data_by_content_list
|
|
10
12
|
from ey_commerce_lib.four_seller.main import FourSellerClient
|
|
11
13
|
from ey_commerce_lib.four_seller.schemas.query.order import FourSellerOrderQueryModel
|
|
14
|
+
from ey_commerce_lib.takesend.main import TakeSendClient
|
|
15
|
+
import ey_commerce_lib.dxm.utils.dxm_commodity_product as dxm_commodity_product_util
|
|
12
16
|
|
|
13
17
|
|
|
14
18
|
async def login_success(user_token: str):
|
|
@@ -28,22 +32,26 @@ async def test_auto_login_4seller():
|
|
|
28
32
|
await four_seller_client.list_history_order(FourSellerOrderQueryModel())
|
|
29
33
|
|
|
30
34
|
|
|
31
|
-
cookies = {
|
|
32
|
-
|
|
33
|
-
}
|
|
34
35
|
|
|
35
|
-
headers = {
|
|
36
|
-
|
|
37
|
-
}
|
|
38
36
|
|
|
39
37
|
|
|
40
38
|
@pytest.mark.asyncio
|
|
41
39
|
async def test_dxm_api():
|
|
42
40
|
async with (DxmClient(headers=headers, cookies=cookies) as dxm_client):
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
# data = await dxm_client.list_order_detail_async(query=ORDER_SEARCH_HAVE_GOODS_BASE_FORM)
|
|
42
|
+
# for order in data:
|
|
43
|
+
# for pair_info in order.get('detail').get('pair_info_list'):
|
|
44
|
+
# print(pair_info.get('proid'))
|
|
45
|
+
data = await dxm_client.view_dxm_commodity_product('17773195770895797')
|
|
46
|
+
print(json.dumps(dxm_commodity_product_util.get_edit_commodity_product_by_view_dxm_response(data)))
|
|
45
47
|
|
|
46
48
|
@pytest.mark.asyncio
|
|
47
49
|
async def test_warehouse():
|
|
48
50
|
async with (DxmClient(headers=headers, cookies=cookies) as dxm_client):
|
|
49
51
|
print(await dxm_client.page_warehouse_product(WarehouseProductQuery()))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@pytest.mark.asyncio
|
|
55
|
+
async def test_tasksend_api():
|
|
56
|
+
async with (TakeSendClient(username="", password="") as tasksend_client):
|
|
57
|
+
await tasksend_client.login()
|
|
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.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/constant/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/exception/__init__.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/exception/common.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/parser/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/parser/purchase.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/parser/warehouse.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/schemas/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/dxm/schemas/warehouse.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/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.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/four_seller/parser/__init__.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/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.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/schemas/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/src/ey_commerce_lib/kogan/schemas/query/order.py
RENAMED
|
File without changes
|
{ey_commerce_lib-1.0.12 → ey_commerce_lib-1.0.14}/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
|
{ey_commerce_lib-1.0.12/tests → ey_commerce_lib-1.0.14/src/ey_commerce_lib/utils}/__init__.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
|