背景:订单组对应wish中间表需要调整迁移;利润需要整改
需求:wish 添加 V3 版本后,将同时存在V2, V3 , 订单进来后判断 V2/V3 版本进行取值落地;
订单改造字段如下背景------------------------------------
(RB_Wish_OrderInfo)的中间表 相关字段 将做移除;
http://pm.irobotbox.com/zentao/task-view-21278.html
{
Quantity 数量
OrderTotal 订单价格
Price 产品价格
Cost
Shipping
ShippingCost
ChinaPostSubsidyAmount
ShippingReimbursementAmount
EligibleForShippingReimbursement 判断字段,对应是否合并计划;
MerchantResponsibleRefundAmount
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
利润需求如下:
1. Wish 新方法 对应关系
202110310745108571711 案例
V2 V3
"quantity": "1" "product_quantity": 1【备注:Wish 产品数量 】
"shipping_cost": "16.1" shipping_merchant_payment ,"amount": 16.1, 【 取值来源 :general_payment_details. shipping_merchant_payment."amount": 11.47】
"Price" "product_price" 19.48 【备注:Wish 产品单一价格 需要* 数量得出销售收入】
"cost": "56.18" "product_merchant_payment" "amount": 56.18, 【取值来源:general_payment_details. product_merchant_payment.amount】
"payment_total: 19.7【取值来源:general_payment_details. payment_total.amount】
"order_total": "72.28" "product_shipping_price" 【取值来源:general_payment_details. payment_total.amount】
"shipping_reimbursement_amount": "0.0" "shipping_reimbursements": []
"merchant_responsible_amount": "72.28" "merchant_responsible_amount":19.7 【取值来源:merchant_responsible_amount.amount: 19.7】
"shipping": "20.64" "product_shipping_price" "amount": 20.64
"transaction_tax": "20.69" "Transacation_tax ": 20.69 ,【取 Transacation_information. tax_type = Transacation_tax [amount : 20.69 ] 备注:Wish 税费】
"eligible_for_shipping_reimbursement": "False" "shipping_reimbursements": [] 该项有值则为WishPost运费
【取值来源:只取 数组里唯一 amount [ 备注:wish 订单运费补贴] ,
多于一条amount 取第一条 并且 Currency_code = 'CNY' 正常只有这条,不正常就不取了
取大于0 为补贴计划,为0 或者空值非补贴】
"refund_amount": "72.28" 【取值来源:"refunds"."refund_amount"."amount": 19.7 只取一条,第一条】
V2 判断合并计划方法:
1、非合并计划订单(EligibleForShippingReimbursement)不计算该项费用。
2、合并计划订单需计(EligibleForShippingReimbursement)算该项费用。
- 合并计划订单有WishPost运费(ShippingReimbursementAmount),其他收入取值WishPost运费,该费用为真实值。
- 合并计划订单没有WishPost运费(ShippingReimbursementAmount),其他收入取值本地仓派送运费,该费用非预估值。
ShippingReimbursementAmount 非空 其他收入 = ShippingReimbursementAmount"
ShippingReimbursementAmount 空值 其他收入 = 本地仓派送运费
"shipping_reimbursements": [] 非空 ,其他收入 = "shipping_reimbursements"
"shipping_reimbursements": [] 空值 ,其他收入 = 本地仓派送运费
如下为订单参考内容
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
订单组更新:
原来的需求V3 , 一共 11个字段,
Version(V2 ,V3公共字段 ) : 枚举 : v2 / v3
"product_quantity": 1
shipping_merchant_payment ,"amount": 16.1,
"product_price" "amount": 72.02
"product_merchant_payment" "amount": 56.18,
"payment_total" "amount": 72.28,
"shipping_reimbursements": []
"merchant_responsible_amount" "amount": 72.28,
"refund_amount": "72.28"
"product_shipping_price" "amount": 20.64
"tax_amount_in_merchant_currency" "amount": 20.69
优化下解释的需求V3 , 一共 12个字段,(这个为准, 加了个货币字段)
Version(V2 ,V3公共字段 ) : 枚举 : v2 / v3
"product_quantity": 1 【备注:Wish 产品数量 】
shipping_merchant_payment : 11.47 【 取值来源 :general_payment_details. shipping_merchant_payment."amount": 11.47】
"product_price" 19.48 【备注:Wish 产品单一价格 需要* 数量得出销售收入】
Currency_code : 'CNY'
"product_merchant_payment" 15.19,【取值来源:general_payment_details. product_merchant_payment.amount】
"payment_total: 19.7【取值来源:general_payment_details. payment_total.amount】
"shipping_reimbursements": 【取值来源:只取 数组里唯一 amount [ 备注:wish 订单运费补贴] , 多于一条amount 取第一条 并且 Currency_code = 'CNY' 正常只有这条,不正常就不取了 】
"product_shipping_price" 【取值来源:general_payment_details. payment_total.amount】
"merchant_responsible_amount":19.7 【取值来源:merchant_responsible_amount.amount: 19.7】
"refund_amount"19.7【取值来源:"refunds"."refund_amount"."amount": 19.7 只取一条,第一条】
简化 "Transacation_tax ": 20.69 ,【取 Transacation_information. tax_type = Transacation_tax [amount : 20.69 ] 备注:Wish 税费】

测试通过预计上线时间2022/1/11
合并计划,有WishPost运费
V2
创建合并计划订单
合并计划,没有WishPost运费
创建订单
V3
合并计划,有WishPost运费
合并计划,没有WishPost运费
合并计划订单有预估运费