任务描述
暂无
需求描述

需求地址:M-15393 FMS:速卖通订单联盟及交易佣金公式调整(责任人:林很) · 钉钉文档 (dingtalk.com)


反馈人:王易婧

问题类型:202307012008146399570

系统0.71美金,后台实际收取0.31美金


[步骤]


[结果]联盟佣金同步错误


[期望]联盟佣金同步正确



验收标准
暂无
历史记录  
  1. 2023-07-10 09:24:01, 由 许瑞丰 创建。
  2. 2023-07-14 14:53:50, 由 许瑞丰 指派给 何智军。
    修改了 指派给,旧值为 "xuruifeng",新值为 "hezhijun"。
  3. 2023-07-14 14:54:18, 由 何智军 启动。
    修改了 实际开始,旧值为 "0000-00-00 00:00:00",新值为 "2023-07-14 14:54:15"。
    修改了 任务状态,旧值为 "wait",新值为 "doing"。
  4. 2023-07-16 16:32:00, 由 何智军 完成。
    修改了 总计消耗,旧值为 "0",新值为 "6"。
    修改了 指派给 ,旧值为 "hezhijun",新值为 "xuruifeng"。
    修改了 实际完成,旧值为 "",新值为 "2023-07-16 12:46:09"。
    修改了 任务状态,旧值为 "doing",新值为 "done"。
    修改了 预计剩余,旧值为 "6",新值为 "0"。
    修改了 由谁完成,旧值为 "",新值为 "hezhijun"。

    影响范围

    速卖通平台订单联盟佣金和交易佣金计算是否准确


    提交记录


    自测报告

    1、建速卖通客户订单,并关联好平台订单和后台订单关系。

    2、计算订单费用

    3、对照需求计算逻辑看费用是否准确


    附上计算逻辑sql如下:


    DECLARE @ProductTotalPrice DECIMAL(18,2)=0
    DECLARE @Tex DECIMAL(18,2)=0
    DECLARE @TransportPay DECIMAL(18,2)=0
    DECLARE @SellerOrderAmountAmount DECIMAL(18,2)=0
    DECLARE @DiscountPrice DECIMAL(18,2)=0
    DECLARE @ShipTex DECIMAL(18,2)=0
    DECLARE @ProductTexPrice DECIMAL(18,2)=0
    DECLARE @AfflicateFeeRate DECIMAL(18,2)=0
    DECLARE @EscrowFeeRate DECIMAL(18,2)=0
    SELECT @ProductTotalPrice=ISNULL(oc.ProductPriceAmount,0)*oc.ProductCount,
    @Tex=ISNULL(ao.OrderAmountAmount,0) - ISNULL(ao.SellerOrderAmountAmount,0),
    @TransportPay=oi.TransportPay,
    @SellerOrderAmountAmount =  ao.SellerOrderAmountAmount,
    @AfflicateFeeRate = oc.AfflicateFeeRate,
    @EscrowFeeRate = oc.EscrowFeeRate
    FROM RB_AliExpress_OrderChildOrderList oc(NOLOCK) INNER JOIn RB_AliExpress_OrderInfo(NOLOCK) ao
    ON oc.CustomerID=ao.CustomerID AND oc.AliExpressOrderID=ao.AliExpressOrderID
    INNER JOIN RB_OrderInfo oi ON ao.CustomerID=oi.CustomerID AND ao.AliExpressOrderID=oi.ClientOrderCode
    WHERE oc.AliExpressOrderID='8151235343874884' 
    
    SELECT @DiscountPrice = @ProductTotalPrice - @Tex + @TransportPay - @SellerOrderAmountAmount
    SELECT @ShipTex = (@TransportPay /(@ProductTotalPrice+@TransportPay-@DiscountPrice))*@Tex
    SELECT @ProductTexPrice = @Tex - @ShipTex;
    
    SELECT (@ProductTotalPrice - @DiscountPrice - @ProductTexPrice) * @AfflicateFeeRate AS '联盟拥金',
    (@ProductTotalPrice - @DiscountPrice - @ProductTexPrice) * @EscrowFeeRate + ((@TransportPay- @ShipTex) * 0.05) AS '交易佣金'
    相关费用计算逻辑代码如下:


    //产品总价
    decimal productTotalPrice = aliExpressOrderList!=null && aliExpressOrderList.Any()? aliExpressOrderList.Sum(a => (a.ProductPriceAmount * (a.ProductCount ?? 0))) : 0;
    //税费收入
    decimal tex = aliExpressOrderInfo.OrderAmountAmount - sellerOrderAmountAmount;
    //运费收入
    decimal transportPay = _orderInfo.TransportPay;
    //总收入(不含税)
    decimal totalPrice = aliExpressOrderInfo.OrderAmountAmount;
    //优惠金额=产品总价-税费收入+运费收入-总收入(不含税)
    decimal discountPrice = productTotalPrice - tex + transportPay - totalPrice;
    //运费税费=(运费收入/(产品总价+运费收入-优惠金额))*税费收入
    decimal shipTex = (transportPay / (productTotalPrice + transportPay - discountPrice)) * tex;
    //产品总价税费=税费收入-运费税费
    decimal productTexPrice = tex - shipTex;
    //联盟佣金比例
    var afflicateFee = aliExpressOrderList.Where(a=>a.AfflicateFeeRate.HasValue)?.FirstOrDefault().AfflicateFeeRate ?? 0;
    //联盟佣金=(产品总价-优惠金额-产品总价税费)*联盟佣金比例
    totalAfflicateFee = (productTotalPrice - discountPrice - productTexPrice) * afflicateFee;
    //交易佣金比例
    var escrowFee = aliExpressOrderList.Where(a=> a.EscrowFeeRate.HasValue).FirstOrDefault().EscrowFeeRate ?? 0;
    //交易佣金=(产品总价-优惠金额-产品总价税费)*交易佣金比例+(运费-运费税费)*运费佣金
    totalEscrowFee = (productTotalPrice - discountPrice - productTexPrice) * escrowFee + ((transportPay- shipTex) * 0.05M) ; 
  5. 2023-10-31 14:33:18, 由 周杰 关闭。
    修改了 任务状态,旧值为 "done",新值为 "closed"。
    修改了 指派给 ,旧值为 "xuruifeng",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "zhoujie"。
    修改了 关闭时间,旧值为 "0000-00-00 00:00:00",新值为 "2023-10-31 14:33:18"。
    修改了 关闭原因,旧值为 "",新值为 "done"。
所属迭代 技术研发中心 7月第3版本(2023年)
所属模块 /
相关需求 FMS:速卖通订单联盟及交易佣金公式调整
指派给 Closed 于 2023-10-31 14:33:18
任务类型 后端
任务标签 初始
开发组 多平台开发组
任务状态 已关闭
进度 100%
优先级 P1
关键词
抄送给
由谁创建 许瑞丰 于 2023-07-10 09:24:00
由谁完成 何智军 于 2023-07-16 12:46:09
由谁取消 暂无
由谁关闭 周杰 于 2023-10-31 14:33:18
关闭原因 已完成
最后编辑 周杰 于 2023-10-31 14:33:18
团队 最初预计 总计消耗 预计剩余
工时信息
最初预计 6工时
总计消耗 6工时
预计剩余 0工时
预计开始 2023-07-10
实际开始 2023-07-14
截止日期 2023-07-14