update
This commit is contained in:
parent
46d750d15f
commit
0a4f5b97fd
@ -96,6 +96,7 @@ def calculate_price(price_request: OrderPriceCalculateRequest,user: UserDB,db: S
|
|||||||
base_price = settings.ORDER_BASE_PRICE
|
base_price = settings.ORDER_BASE_PRICE
|
||||||
extra_package_price = settings.ORDER_EXTRA_PACKAGE_PRICE
|
extra_package_price = settings.ORDER_EXTRA_PACKAGE_PRICE
|
||||||
extra_package_threshold = settings.ORDER_EXTRA_PACKAGE_THRESHOLD
|
extra_package_threshold = settings.ORDER_EXTRA_PACKAGE_THRESHOLD
|
||||||
|
base_more_station_price = 0
|
||||||
|
|
||||||
# 获取小区定价
|
# 获取小区定价
|
||||||
if price_request.community_id > 0:
|
if price_request.community_id > 0:
|
||||||
@ -106,6 +107,7 @@ def calculate_price(price_request: OrderPriceCalculateRequest,user: UserDB,db: S
|
|||||||
base_price = float(community.base_price)
|
base_price = float(community.base_price)
|
||||||
extra_package_price = float(community.extra_package_price)
|
extra_package_price = float(community.extra_package_price)
|
||||||
extra_package_threshold = int(community.extra_package_threshold)
|
extra_package_threshold = int(community.extra_package_threshold)
|
||||||
|
base_more_station_price = float(community.more_station_price)
|
||||||
|
|
||||||
# 是否有多驿站
|
# 是否有多驿站
|
||||||
more_station_price = float(community.more_station_price) * (len(price_request.packages) - 1) if len(price_request.packages) > 1 else 0
|
more_station_price = float(community.more_station_price) * (len(price_request.packages) - 1) if len(price_request.packages) > 1 else 0
|
||||||
@ -152,7 +154,7 @@ def calculate_price(price_request: OrderPriceCalculateRequest,user: UserDB,db: S
|
|||||||
result.price_info.final_amount = round(remaining_amount, 2)
|
result.price_info.final_amount = round(remaining_amount, 2)
|
||||||
|
|
||||||
# 计算价格详情
|
# 计算价格详情
|
||||||
result.price_detail_text = f"基础配送费 {round(base_price, 1)} 元(限 {extra_package_threshold} 件),超件 {round(extra_package_price, 1)} 元 / 件,多驿站每件加收 {round(more_station_price, 1)} 元 。"
|
result.price_detail_text = f"基础配送费{round(base_price, 1)}元(限{extra_package_threshold}件), 超件{round(extra_package_price, 1)}元/件, 超过1个驿站加收{round(base_more_station_price, 1)}元/站。"
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
BIN
jobs.sqlite
BIN
jobs.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user