修改方案

This commit is contained in:
honghuayuan 2025-06-26 00:50:14 +08:00
parent 7178520862
commit 2093056334
8 changed files with 538110 additions and 7662 deletions

BIN
data/~$售价尾端价格.xlsx (Stored with Git LFS) Normal file

Binary file not shown.

BIN
data/售价尾端价格.xlsx (Stored with Git LFS)

Binary file not shown.

View File

@ -1,3 +1,8 @@
# 类型更改计划
## 1. 先解决大量使用xlsx的问题, 统一通过使用LOGISDB数据库进行数据交互
## 2. 对售价模型或者其他类型的区分,统一使用数据库表管理
# 物流模块介绍 # 物流模块介绍
## [数据模块](data) ## [数据模块](data)
> 数据存放地,部分物流的价格表和部分国家的邮编 > 数据存放地,部分物流的价格表和部分国家的邮编

View File

@ -69,7 +69,7 @@ class SellPriceBase:
def __new__(cls, *args, **kwargs): def __new__(cls, *args, **kwargs):
"""实现单例模式,只加载一次文件""" """实现单例模式,只加载一次文件"""
if cls.df_2024 is None: if cls.df_2024 is None:
cls.df_2024 = pd.read_excel(cls._price_files,sheet_name="2024") cls.df_2024 = pd.read_excel(cls._price_files,sheet_name="2025")
if cls.df_2025 is None: if cls.df_2025 is None:
cls.df_2025 = pd.read_excel(cls._price_files,sheet_name="2025") cls.df_2025 = pd.read_excel(cls._price_files,sheet_name="2025")
return super().__new__(cls) return super().__new__(cls)

View File

@ -1,14 +1,14 @@
import json import json
import math import math
import sys import sys
sys.path.append(r'D:\test\logistics\sell') # sys.path.append(r'D:\test\logistics\sell')
import pandas as pd import pandas as pd
from sell.base_sell_price import SellPriceBase from sell.base_sell_price import SellPriceBase
from utils.Package import Package, Package_group from utils.Package import Package, Package_group
from utils.gtools import MySQLconnect from utils.gtools import MySQLconnect
import math import math
import re import re
express_price = pd.read_excel(r'D:\test\logistics\data\售价尾端价格.xlsx', sheet_name='Sheet1') express_price = pd.read_excel(r'D:\workspace\logistics\data\售价尾端价格.xlsx', sheet_name='2025')
key_column = express_price.iloc[:, 8] # 第 I 列 key_column = express_price.iloc[:, 8] # 第 I 列
value_column = express_price.iloc[:, 9] # 第 J 列 value_column = express_price.iloc[:, 9] # 第 J 列
small_column = express_price.iloc[:, 10] # 第 K 列 small_column = express_price.iloc[:, 10] # 第 K 列
@ -149,7 +149,7 @@ def call_sell_and_order_price(price, package_dict,head_type):
# 提取字符串中的第一个数字 # 提取字符串中的第一个数字
match = re.search(r"[-+]?\d*\.\d+|\d+", str(value)) match = re.search(r"[-+]?\d*\.\d+|\d+", str(value))
return float(match.group()) if match else 0.0 return float(match.group()) if match else 0.0
package_dict = json.loads(package_dict)
for key, package in package_dict.items(): for key, package in package_dict.items():
package[''] = extract_number(package['']) package[''] = extract_number(package[''])
package[''] = extract_number(package['']) package[''] = extract_number(package[''])
@ -157,14 +157,14 @@ def call_sell_and_order_price(price, package_dict,head_type):
package['重量'] = extract_number(package['重量']) package['重量'] = extract_number(package['重量'])
if package[''] == 0 or package[''] == 0 or package[''] == 0 or package['重量'] == 0: if package[''] == 0 or package[''] == 0 or package[''] == 0 or package['重量'] == 0:
return (0,0,0,0),0,0 return 0,0,0
packages.add_package(Package(key,package[''], package[''], package[''], package['重量'])) packages.add_package(Package(key,package[''], package[''], package[''], package['重量']))
if packages is None: if packages is None:
return (0,0,0,0),0,0 return 0,0,0
litfad = SellPriceBase.litfad(packages, price,1) litfad = SellPriceBase.litfad_2025(packages, price,1)
# 修改版本,网站售价 # 修改版本,网站售价
sell_price = litfad.cal_sell_price() sell_price = litfad.cal_sell_price_2025()
# 订单物流费 # 订单物流费
if "" in head_type: if "" in head_type:
order_price, order_type = ocean_order_price(packages) order_price, order_type = ocean_order_price(packages)

View File

@ -1,3 +1,5 @@
import sys
sys.path.append("D:\workspace\logistics")
from dataclasses import dataclass from dataclasses import dataclass
from typing import List, Literal from typing import List, Literal
import pandas as pd import pandas as pd

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff