任务描述
暂无
需求描述

1.1. 背景


    背景:亚马逊索赔报告历史逻辑中并无判断该货件是否找回丢失及其他异常情况,这样是导致索赔失败,或者已重复索赔情况,需要重新调研调整相关逻辑。


1.2. 验收目标


            1.优化原索赔业务逻辑上添加官方内容

            2.初始化半年数据,开发参与检验


2.   功能设计

2.1. 页面路径


财务管理---Amazon 追款


2.2.3 优化原索赔业务逻辑上添加官方内容

2.2.3.1  功能点描述:

现在逻辑是,库存调整报告对应已索赔报告,得出未索赔数量。

      -------亚马逊索赔Case产生,库存丢失没有考虑到库存找回,和库存损害没有考虑找回所产生逻辑问题。



原基础上库存调整报告,对应类型再细分调整:

1. 库存报告如果SKU 对应 Unreconciled 这列 = 0 值 ,就不匹配已索赔内容;

2. 库存报告如果SKU 有丢失情况,则需要根据再匹配是否丢失找回,如果丢失找回则不用索赔  = N ,M

3. 库存报告如果SKU 有移除情况,则需要根据再匹配是否移回,如果移回则不用索赔   = P ,Q








如下是亚马逊官方回复,及代码解释作为参考

--------------------------------------------------




验收标准
暂无
历史记录  
  1. 2022-12-28 18:04:55, 由 许瑞丰 创建。
  2. 2023-01-03 09:29:07, 由 何智军 完成。
    修改了 总计消耗,旧值为 "0",新值为 "9"。
    修改了 指派给 ,旧值为 "hezhijun",新值为 "xuruifeng"。
    修改了 实际完成,旧值为 "",新值为 "2022-12-29 15:48:00"。
    修改了 任务状态,旧值为 "wait",新值为 "done"。
    修改了 实际开始,旧值为 "0000-00-00 00:00:00",新值为 "2022-12-29 16:03:08"。
    修改了 预计剩余,旧值为 "9",新值为 "0"。
    修改了 由谁完成,旧值为 "",新值为 "hezhijun"。

    影响范围

    亚马逊索赔case是否正确生成


    提交记录

    自测报告

    1、执行索赔服务(下次索赔同步时间必须小于当前时间、报告类型必须有)

    2、查看索赔任务是否生成
    SELECT * FROM RB_Amazon_Reimburse_Record(NOLOCK)



    3、查看库存损毁、库存丢失差异是否生成

    SELECT  * FROM RB_Amazon_Reimburse_InventoryDamage(NOLOCK) 
    SELECT * FROM RB_Amazon_Reimburse_InventoryAdjustmentsLost(NOLOCK) 

    该需求调整差异生成服务,自测不继续往下继续。


    涉及相关业务表
    共享库表:

    • RB_Amazon_Reimbursement_Summary  差异服务配置表
    • RB_Amazon_Reimbursement_Detail  索赔Case表

    ERP表:


    • RB_Report_FULFILLMENT_INVENTORY_ADJUSTMENTS   物流调整报告表
    • RB_Report_REIMBURSEMENTS   索赔报告表
    •  RB_Amazon_Reimburse_Record   索赔差异任务表
    • RB_Amazon_Reimburse_InventoryAdjustmentsLost  库存丢失差异表
    • RB_Amazon_Reimburse_InventoryDamage   库存损毁差异表


    附库存损毁差异对比脚本,如下:


    DECLARE @CustomerID INT;
    DECLARE @DevIDSellerId NVARCHAR(50);
    DECLARE @StartTime DATETIME;
    DECLARE @EndTime DATETIME;
    SET @CustomerID = 1;
    SET @DevIDSellerId = N'A2LZ3VQMY1C6ZE';
    SET @StartTime = '2022-05-01';
    SET @EndTime = '2022-06-01';


    SELECT a.CustomerID,
               a.DevIDSellerId,
               a.OrderSourceID,
               a.fnsku,
               a.quantity AS 'lost_quantity'
        FROM RB_Report_FULFILLMENT_INVENTORY_ADJUSTMENTS (NOLOCK) a
        WHERE a.CustomerID = @CustomerID
              AND a.DevIDSellerId = @DevIDSellerId
              AND a.reason IN ( 'M' )
              AND a.disposition IN ( 'UNSELLABLE', 'SELLABLE' )
              AND a.[adjusted-date-utc] >= @StartTime
              AND a.[adjusted-date-utc] < @EndTime
      AND a.SKU='L18OJW24WTM607I1LFH'
        UNION ALL
        SELECT a.CustomerID,
               a.DevIDSellerId,
               a.OrderSourceID,
               a.fnsku,
               a.quantity AS 'lost_quantity'
        FROM RB_Report_FULFILLMENT_INVENTORY_ADJUSTMENTS (NOLOCK) a
        WHERE a.CustomerID = @CustomerID
              AND a.DevIDSellerId = @DevIDSellerId
              AND a.reason IN ( 'F','N' )
              AND a.disposition IN ( 'UNSELLABLE', 'SELLABLE' )
              AND a.[adjusted-date-utc] >= @StartTime
      AND a.SKU='L18OJW24WTM607I1LFH'

    WITH tb_adjustment
    AS (SELECT a.CustomerID,
               a.DevIDSellerId,
               a.OrderSourceID,
               a.fnsku,
               a.quantity AS 'damage_quantity'
        FROM RB_Report_FULFILLMENT_INVENTORY_ADJUSTMENTS (NOLOCK) a
        WHERE a.CustomerID = @CustomerID
              AND a.DevIDSellerId = @DevIDSellerId
              AND a.reason IN ( 'E' )
              AND a.disposition IN ( 'UNSELLABLE', 'SELLABLE' )
              AND a.[adjusted-date-utc] >= @StartTime
              AND a.[adjusted-date-utc] < @EndTime
        UNION ALL
    SELECT a.CustomerID,
               a.DevIDSellerId,
               a.OrderSourceID,
               a.fnsku,
               a.quantity AS 'damage_quantity'
        FROM RB_Report_FULFILLMENT_INVENTORY_ADJUSTMENTS (NOLOCK) a
        WHERE a.CustomerID = @CustomerID
              AND a.DevIDSellerId = @DevIDSellerId
              AND a.reason IN ( 'F','P','Q' )
              AND a.disposition IN ('WAREHOUSE_DAMAGED')
              AND a.[adjusted-date-utc] >= @StartTime
              AND a.[adjusted-date-utc] < @EndTime),
         temp_SellerSKU
    AS (SELECT *
        FROM
        (
            SELECT a.CustomerID,
                   a.DevIDSellerId,
                   a.OrderSourceID,
                   a.fnsku,
                   a.sku,
                   a.[adjusted-date-utc] AS 'last_adjusted_date_utc',
                   a.[transaction-item-id] AS 'last_transaction_item_id',
                   ROW_NUMBER() OVER (PARTITION BY a.CustomerID,
                                                   a.DevIDSellerId,
                                                   a.OrderSourceID,
                                                   a.fnsku
                                      ORDER BY a.[adjusted-date-utc] DESC
                                     ) rowID
            FROM RB_Report_FULFILLMENT_INVENTORY_ADJUSTMENTS (NOLOCK) a
            WHERE a.CustomerID = @CustomerID
                  AND a.DevIDSellerId = @DevIDSellerId
                  AND a.reason IN ( 'E' )
                  AND a.disposition IN ( 'UNSELLABLE', 'SELLABLE' )
                  AND a.[adjusted-date-utc] >= @StartTime
                  AND a.[adjusted-date-utc] < @EndTime
        ) t
        WHERE rowID = 1)
    SELECT a.CustomerID,
           a.StartTime,
           a.EndTime,
           a.DevIDSellerId,
           a.OrderSourceID,
           a.fnsku,
           a.damage_quantity,
           a.reimburse_date,
           a.reimburse_inventory,
           a.reimburse_quantity,
           a.inventory_difference,
           b.sku,
           b.last_adjusted_date_utc,
           b.last_transaction_item_id
    FROM
    (
        SELECT a.CustomerID,
               @StartTime 'StartTime',
               @EndTime 'EndTime',
               a.DevIDSellerId,
               a.OrderSourceID,
               a.fnsku,
               ABS(damage_quantity) AS 'damage_quantity',
               b.reimburse_date,
               -ISNULL(b.reimburse_inventory, 0) AS 'reimburse_inventory',
               -ISNULL(b.reimburse_quantity, 0) AS 'reimburse_quantity',
               ABS(damage_quantity) - ISNULL(reimburse_quantity, 0) AS 'inventory_difference'
        FROM
        (
            SELECT *
            FROM
            (
                SELECT a.CustomerID,
                       a.OrderSourceID,
                       a.DevIDSellerId,
                       a.fnsku,
                       SUM(a.damage_quantity) AS 'damage_quantity'
                FROM tb_adjustment a
                GROUP BY a.CustomerID,
                         a.OrderSourceID,
                         a.DevIDSellerId,
                         a.fnsku
            ) t
        ) a
            LEFT JOIN
            (
                SELECT a.CustomerID,
                       a.DevIDSellerId,
                       a.fnsku,
                       MAX(a.[approval-date-utc]) AS 'reimburse_date',
                       SUM(a.[quantity-reimbursed-inventory]) AS 'reimburse_inventory',
                       SUM(a.[quantity-reimbursed-total]) AS 'reimburse_quantity'
                FROM RB_Report_REIMBURSEMENTS (NOLOCK) a
                WHERE a.CustomerID = @CustomerID
                      AND a.DevIDSellerId = @DevIDSellerId
                      AND a.reason = 'Damaged_Warehouse'
                      AND a.[approval-date-utc] >= @StartTime
                GROUP BY a.CustomerID,
                         a.DevIDSellerId,
                         a.fnsku
            ) b
                ON b.CustomerID = a.CustomerID
                   AND b.DevIDSellerId = a.DevIDSellerId
                   AND b.fnsku = a.fnsku
    ) a
        LEFT JOIN temp_SellerSKU b
            ON b.CustomerID = a.CustomerID
               AND b.DevIDSellerId = a.DevIDSellerId
               AND b.OrderSourceID = a.OrderSourceID
               AND b.fnsku = a.fnsku
    WHERE inventory_difference != 0;


  3. 2023-01-10 10:32:30, 由 qihaoran 确认需求变动,最新版本为#4。
  4. 2023-02-01 13:56:39, 由 zhengqiao 关闭。
    修改了 任务状态,旧值为 "done",新值为 "closed"。
    修改了 指派给 ,旧值为 "xuruifeng",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "zhengqiao"。
    修改了 关闭时间,旧值为 "0000-00-00 00:00:00",新值为 "2023-02-01 13:56:39"。
    修改了 关闭原因,旧值为 "",新值为 "done"。
所属迭代 技术研发中心 1月第1版本(2023年)
所属模块 /
相关需求 亚马逊索赔报告新加逻辑优化
指派给 Closed 于 2023-02-01 13:56:39
任务类型 后端
任务标签 初始
开发组 多平台开发组
任务状态 已关闭
进度 100%
优先级 P2
关键词
抄送给
由谁创建 许瑞丰 于 2022-12-28 18:04:55
由谁完成 何智军 于 2022-12-29 15:48:00
由谁取消 暂无
由谁关闭 zhengqiao 于 2023-02-01 13:56:39
关闭原因 已完成
最后编辑 zhengqiao 于 2023-02-01 13:56:39
团队 最初预计 总计消耗 预计剩余
工时信息
最初预计 9工时
总计消耗 9工时
预计剩余 0工时
预计开始 2022-12-28
实际开始 2022-12-29
截止日期 2022-12-29