【无标题】

TASK_DWD_ORD_CHANNEL_CRM_ORDER_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_CRM_ORDER_FL_D
TASK_DWD_ORD_CHANNEL_GIFTCARD_ORDER_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_GIFTCARD_ORDER_FL_D
TASK_DWD_ORD_CHANNEL_GIFTCARD_PRODUCT_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OFFLINE_ORDER_DELIVERY_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OFFLINE_ORDER_DELIVERY_FL_D
TASK_DWD_ORD_CHANNEL_OFFLINE_ORDER_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OFFLINE_ORDER_FL_D
TASK_DWD_ORD_CHANNEL_OFFLINE_ORDER_PAYMENT_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OFFLINE_ORDER_REFUND_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OFFLINE_ORDER_REFUND_FL_D
TASK_DWD_ORD_CHANNEL_OFFLINE_ORDER_TIMELINE_FL_D
TASK_DWD_ORD_CHANNEL_OMNI_ORDER_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OMNI_YNAP_ORDER_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OMS_ORDER_DELIVERY_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OMS_ORDER_DELIVERY_FL_D
TASK_DWD_ORD_CHANNEL_OMS_ORDER_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OMS_ORDER_FL_D
TASK_DWD_ORD_CHANNEL_OMS_ORDER_PAYMENT_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OMS_ORDER_REFUND_DETAIL_FL_D
TASK_DWD_ORD_CHANNEL_OMS_ORDER_REFUND_FL_D
TASK_DWD_ORD_CHANNEL_OMS_ORDER_TIMELINE_FL_D

oms_order_delivery
pmc_purchase_order
pmc_purchase_order_item
pmc_push_ynap
pmc_replenish_ynap

/**

* Definition for singly-linked list.

* public class ListNode {

*     int val;

*     ListNode next;

*     ListNode() {}

*     ListNode(int val) { this.val = val; }

*     ListNode(int val, ListNode next) { this.val = val; this.next = next; }

* }

*/

class Solution {

    public ListNode mergeTwoLists(ListNode list1, ListNode list2) {

    }

}

dev_item_seller_list_get_topic


lmd620-标准化底表加入抖音流量信息
lmd621-订单宽表ftitle从订单带出来
lmd622-同一个子订单取update_time最大的出库单号
lmd623-订单宽表关于剔除膨胀金的字段新增cancel
lmd624-线下手工表切换,标准化加session

作业
IMPORT_ODS_JV_MANUAL_OFFLINE_SALES_WITH_SESSION_FL_D
TASK_DWD_JV_MANUAL_OFFLINE_SALES_WITH_SESSION_FL_D



SF_YNAP_ODS_MANUAL_ORDER_D

channel 问题  处理一版 本周
model  dws 关联商品域的 数据 用新表  
关联 商品和用户数据 进来

任务流建立一下

--问题处理
线下表状态映射 正向和逆向

116

pg_app_order_realtime_details 5min一次

ecc_sales_inventory_details
ecc_sales_inventory_details_copy1

ecc_inventory_details
ecc_inventory_details_copy1

ods_jv_item_inventory_rt_copy1
ods_jv_item_inventory_rt

ecc_advance_sale_details_copy1
ecc_advance_sale_details

ecc_advance_sale_details_month_copy1
ecc_advance_sale_details_month

ecc_sale_details_copy1
ecc_sale_details

ods_jv_foid_return_rt_copy1
ods_jv_foid_return_rt

lmd604-pg实时切换 (datax修改)
lmd605-ads_ynap_order_cs_orderdetail_iu_d 新加字段gift  (sql+ service 接口调整)
lmd606-ads_ord_sales_data_other_fl_d 礼品卡订单带出来jv user id (用户域sql调整 ,订单域验证数据)
lmd607-在订单底表中加入抖音流量信息  (标准化中调整)
lmd608-订单宽表ftitle从订单带出来   (标准化中调整)

任务
SF_YNAP_ADS_ORDER_D


spark-sql --hiveconf hive.cli.print.header=true --hiveconf hive.exec.dynamic.partition=true --hiveconf hive.exec.max.dynamic.partitions=3000 --hiveconf hive.exec.max.dynamic.partitions.pernode=3000 --conf spark.sql.autoBroadcastJoinThreshold=-1 --conf spark.sql.broadcastTimeout=3000 --conf spark.executor.memory=13g --conf spark.executor.memoryOverhead=2048m --conf spark.executor.cores=6 --conf spark.executor.instances=2 --conf spark.driver.memory=4g --conf spark.driver.memoryOverhead=512m --conf spark.driver.cores=1 --conf spark.sql.crossJoin.enabled=true --master yarn 
 

7.17
每天订单标准化做同步 如果进展被什么耽误了 也说出来


1 离线ecc    本周 数据灌入


 

drop table if exists dw_ads.ads_ord_model_order_detail_fl_d;
CREATE TABLE dw_ads.ads_ord_model_order_detail_fl_d
(
--     用户相关字段
    jv_user_id                       string COMMENT '用户唯一标识',

--     商品相关字段
    brand_code                       string COMMENT '品牌编号',
    brand_name                       string COMMENT '品牌名称',
    size_schema                      string COMMENT '尺寸',
    category_name                    string COMMENT 'YNAP一级品类',
    subcategory_name                 string COMMENT 'YNAP二级品类',
    sub_subcategory_name             string COMMENT 'YNAP三级品类',
    model_id                         string COMMENT 'Model id',
    variant_id                       string COMMENT 'Variant id',
    sale_season                      string COMMENT 'YNAP Season',
    gtin                             string COMMENT '商品条码',
    fouterskuid                      string COMMENT 'GTIN级别的glscode',
    batch_no                         string COMMENT '批次号',
    brand_size                       string COMMENT '品牌尺码',
    sub_channel                      string COMMENT '二级渠道',
    channel                          string COMMENT '一级渠道',
    ftitle                           string COMMENT '天猫商品名称',
    fouteriid                        string COMMENT 'Model级别Glscode',
    ynapchannel                      string COMMENT '渠道。NAP,MRP,TPP',
    napmrprichemontchannel           string COMMENT '渠道。NAP,MRP,Richemont,TTP',
    model_fabric_colour              string COMMENT 'Model级别的商品颜色',
    merchant_season                  string COMMENT '采购部门定义的商品季节',
    pid_style_clr                    string COMMENT 'Product ID',
    ynap_full_price                  double COMMENT 'YNAP原价',
    category_name_manual             string COMMENT '采购部门定义的一级品类',
    subcategory_name_manual          string COMMENT '采购部门定义的二级品类',
    sub_subcategory_name_manual      string COMMENT '采购部门定义的三级品类',
    brand_simple_name                string COMMENT '品牌简称',
    subchannel_hl_sl_alia_buccellati string COMMENT '三级渠道',
    retail_price                     double COMMENT '零售价',
    ynaprichemonttppchannel          string COMMENT '渠道。YNAP,历峰和TPP',
    category_id_new                  string COMMENT '处理后的一级品类编号',
    hard_luxury                      string COMMENT '是否是硬奢',
    hard_or_soft_luxury              string COMMENT '软硬奢分类。Hard Luxury:硬奢,Soft Luxury:软奢',
    numiid                           string COMMENT '宝贝ID',
    gender                           string COMMENT '性别',
    product_url                      string COMMENT '宝尊的商品照片',
    brand_colour                     string COMMENT '品牌颜色',
    merchant_gender                  string COMMENT '采购部门定义的性别',

--  订单相关字段

--  收货地址类
    freceivercity                    string COMMENT '收货城市',                 --主
    freceiverdistrict                string COMMENT '收货行政区',               --主
    freceiverstate                   string COMMENT '收货省份',                 --主
    freceiveraddress                 string COMMENT '收货地址',                 --主
    freceivermobile                  string COMMENT '收货人手机号',              --主
    freceivername                    string COMMENT '收货人姓名',                --主

--  时间类
    createdate                       date COMMENT '创建日期',
    fconsigntime                     timestamp COMMENT '发货时间',
    fpaytime                         timestamp COMMENT '支付时间',
    refundcreatetime                 string COMMENT '退款创建时间',
    paydate                          date COMMENT '支付日期',
    shipdate                         date COMMENT '发货时间',
    enddate                          date COMMENT '交易结束时间',
    refundapplydate                  date COMMENT '退款申请日期',
    confirm_time                     timestamp COMMENT '订单确认时间',
    storage_confirm_time             timestamp COMMENT '退货入库时间',
    collect_parcel_start_time        timestamp COMMENT '客人退货时间',
    child_order_receive_time         timestamp COMMENT '客人收货时间',
    fendtime                         timestamp COMMENT '订单结束时间',
    fcreated                         timestamp COMMENT '订单创建时间',
-- 状态类
    fstatus                          string COMMENT '订单状态',
    frefundstatus                    string COMMENT '退款状态:WAIT_SELLER_AGREE,买家已经申请退款,等待卖家同意;WAIT_BUYER_RETURN_GOODS,卖家已经同意退款,等待买家退货;WAIT_SELLER_CONFIRM_GOO',
    fgoodstatus                      string COMMENT '货品状态:BUYER_NOT_RECEIVED,买家未收到货;BUYER_RECEIVED,买家收到货;BUYER_RETURNED_GOODS,买家退货',
    refund_status                    string COMMENT '自建退款状态',
    order_status                     string COMMENT '自建订单状态',

-- 数量类
    fnum                             int COMMENT '商品数量',
    refundnum                        int COMMENT '退货数量',
    return_applied_units             int COMMENT '申请退货商品数量',
    return_units                     int COMMENT '退货件数。有商品退回',
    gross_sales_units                int COMMENT '日销售数量(发货)',
    cancelled_successed_units        int COMMENT '成功取消订单件数',
    cancelled_applied_units          int COMMENT '申请取消订单件数',
    updated_dgso_units               int COMMENT '日销售量(付款且在发货前之后一直未取消订单)',
--     金额类
    discountfee                      double COMMENT '折扣金额',
    payment                          double COMMENT '支付金额',
    totalfee                         double COMMENT '订单总金额',
    price                            double COMMENT '商品天猫价格',
    updated_dgso                     double COMMENT '日销售金额(付款且在发货前之后一直未取消订单)',
    return_applied_sales             double COMMENT '申请退货商品金额',
    gross_sales                      double COMMENT '日销售额(发货)',
    return_sales                     double COMMENT '退款金额。不区分仅退款和退货退款',
    cancelled_successed_sales        double COMMENT '成功取消订单金额',
    cancelled_applied_sales          double COMMENT '申请取消订单金额',
    frefundfee                       double COMMENT '退款金额',
    markdown_price                   double COMMENT '天猫划线价',
    basic_price                      double COMMENT '本金',
    expand_price                     double COMMENT '膨胀金',
    basic_price_refund               double COMMENT '商品行退本金不含运费=(订单本金/商品行实付金额*退款金额)*(商品行实付金额/订单实付金额)',
    expand_price_refund              double COMMENT '商品行退膨胀金不含运费=(订单膨胀金/商品行实付金额*退款金额)*(商品行实付金额/订单实付金额)',
    ynap_cost                        string COMMENT 'ynap回传的采购价',

-- 标签类
    fhasgoodreturn                   string COMMENT '是否有退货。true,退货;false,退款',
    is_member                        int COMMENT '是否是会员',
    88vip_flag                       int COMMENT '88VIP标签',
    free_order                       string COMMENT '区分0元订单标记 0元订单则为1 其他为0',
    memberid                         string comment 'memberid 会员id',
    check_jit                        int COMMENT '是否是jit商品 1是 2否',
    jit_stcok                        int COMMENT '是否现货 1是 2否',
    updated_cancel_flag              int COMMENT '订单发货前一直未取消标签。1:取消,2:未取消',

-- 编号类
    staff_flag                       string COMMENT '员工订单标签',
    frefundid                        string COMMENT '退货编号',
    ftid                             string COMMENT '母订单号',
    foid                             string COMMENT '子订单号',
    batch_code                       string COMMENT '库存批次号 PO',
    delivery_no                      string COMMENT '出库单号',
    virtual_warehouse_code           string COMMENT '仓存编号',
    nu                               string COMMENT '国内物流单号',
    logi_no                          string COMMENT '国际物流单号',


--     订单其他
    sale_platform                    string COMMENT '销售平台,TMALL/APP',
    sub_sale_platform                string COMMENT '销售子渠道',
    buyer_nick                       string COMMENT '不加密的买家名',
    freason                          string COMMENT '申请退款原因',
    ftype                            string COMMENT '是否预售。step:是,fixed:否',
    fpicpath                         string COMMENT '商品图片',
    buyer_customer_no                string COMMENT '买家客户号,TMALL是buyer_nickname_encry,APP是login_code',
    paydate_val_rate                 double COMMENT '按照支付日期匹配的汇率',
    order_type                       int COMMENT '订单类型',
    level                            int COMMENT '会员等级',
    content                          string COMMENT '评价内容',
    reply                            string COMMENT '客服答复',
    payment_mode                     string COMMENT '支付方式 微信-wechat,支付宝-alipay,银联-uniepay,积分-points'
) stored as orc;


select * from dw_ads.ads_ord_sales_data_fl_d;

desc dw_ads.ads_ord_model_order_detail_fl_d;
 


dws 整合 缺的东西 进来   dws 保证不缺东西

然后ads是应用层概念


 

http://localhost:12010/datacenter/order/cs/order_detail?date=2023-07-07&pageNo=1&pageSize=100


https://datad.fengmaoall.com:12010/datacenter/order/cs/order_detail?date=2023-07-07&pageNo=1&pageSize=100


http://172.16.3.100:12010/datacenter/order/cs/order_detail?date=2023-07-07&pageNo=1&pageSize=100

CREATE TABLE `test.ads_ord_sales_data_fl_d`(
  `sale_platform` string, 
  `buyer_nick` string, 
  `event` string, 
  `event_period` string, 
  `brand_code` string COMMENT '品牌编码', 
  `brand_name` string COMMENT '品牌名称', 
  `department` string COMMENT '买家划分类型', 
  `size_schema` string COMMENT '尺码', 
  `category_name` string COMMENT '一级类目', 
  `subcategory_name` string COMMENT '二级类目', 
  `sub_subcategory_name` string COMMENT '三级类目', 
  `model_id` string COMMENT 'spu级别', 
  `variant_id` string COMMENT 'skc级别', 
  `sale_season` string COMMENT '销售季节', 
  `gtin` string COMMENT '主键,sku级别', 
  `batch_no` string COMMENT '序列号', 
  `brand_size` string, 
  `sub_channel` string COMMENT '二级渠道(业务不常用)', 
  `channel` string COMMENT '渠道。ynap,richemont,local buy', 
  `ftitle` string, 
  `fid` string COMMENT '新金蝶订单明细表主键', 
  `fendtime` timestamp, 
  `fnum` int COMMENT '商品数量', 
  `fouteriid` string, 
  `fpicpath` string COMMENT '商品图片绝对路径', 
  `fstatus` string COMMENT '子订单状态', 
  `buyer_customer_no` string COMMENT ' 买家客户号', 
  `jv_user_id` string, 
  `fcreated` timestamp COMMENT ' 订单创建时间', 
  `freceivercity` string COMMENT ' 收货城市', 
  `freceiverdistrict` string COMMENT ' 收货行政区', 
  `freceiverstate` string COMMENT ' 收货省份', 
  `adjustfee` double COMMENT '子订单手工调整金额', 
  `discountfee` double COMMENT '子订单折扣金额(含划线价格优惠)', 
  `price` double COMMENT '商品原价', 
  `payment` double, 
  `totalfee` double COMMENT '子订单应付金额', 
  `createdate` date COMMENT '日期格式 XX-XX-XX', 
  `createtime` string COMMENT ' xx:xx:xx时间格式', 
  `freceiveraddress` string COMMENT ' 收货地址', 
  `freceivermobile` string COMMENT ' 收货人手机号', 
  `freceivername` string COMMENT ' 收货人名称', 
  `fouterskuid` string, 
  `fconsigntime` timestamp COMMENT '子订单发货时间', 
  `fpaytime` timestamp COMMENT ' 支付时间', 
  `ftradefrom` string COMMENT ' 订单内部来源 APP PC PC Other', 
  `fparentid` string COMMENT '金蝶订单主表主键', 
  `ftid` string COMMENT '原订单号', 
  `foid` string COMMENT '老明细订单号', 
  `refundcreatetime` string, 
  `fcsstatus` string COMMENT '退款客服介入状态', 
  `fgoodstatus` string COMMENT '退款货品状态', 
  `fhasgoodreturn` string, 
  `refundnum` int COMMENT '退款商品数量', 
  `frefundid` string COMMENT '新的退款明细单号', 
  `ynapchannel` string COMMENT '渠道', 
  `returnupdatetime` string, 
  `orderupdatetime` timestamp COMMENT ' 订单更新时间', 
  `freason` string COMMENT '退款原因', 
  `frefundstatus` string COMMENT '退款单状态', 
  `ftype` string COMMENT ' 订单类型 fixed  offline preOrder appother', 
  `steppaidfee` string, 
  `napmrprichemontchannel` string, 
  `refund_status` string COMMENT '目标退款单状态', 
  `order_status` string COMMENT '目标子订单正向状态', 
  `frefundfee` string, 
  `ordermodified` timestamp COMMENT ' 订单更新时间', 
  `refundmodified` string, 
  `paydate` date, 
  `shipdate` date, 
  `enddate` date, 
  `refundapplydate` date, 
  `cancel_flag` int, 
  `updated_cancel_flag` int, 
  `daily_gross_sales_ordered` double, 
  `gross_sales_order_units` int, 
  `mobile_sales` double, 
  `parent_order_flag` int, 
  `gross_sales` double, 
  `return_sales` double, 
  `return_units` int, 
  `dailybacklog` double, 
  `updated_dgso` double, 
  `return_applied_units` int, 
  `return_applied_sales` double, 
  `gross_sales_units` int, 
  `cancelled_successed_units` int, 
  `cancelled_successed_sales` double, 
  `cancelled_applied_units` int, 
  `cancelled_applied_sales` double, 
  `updated_dgso_units` int, 
  `net_sales` double, 
  `hard_or_soft_luxury` string COMMENT '软硬奢标签', 
  `stmu` int, 
  `stmns` double, 
  `numiid` string COMMENT '宝贝id', 
  `gender` string COMMENT '性别', 
  `epidemic_flag` int, 
  `paydate_val_rate` string COMMENT '汇率', 
  `model_fabric` string COMMENT '产品吊牌标识', 
  `flogisticscompany` string COMMENT '物流公司', 
  `fshippingtype` string COMMENT '发货类型', 
  `earlist_paydate` date, 
  `store_paydate` date, 
  `model_fabric_colour` string COMMENT '面料颜色', 
  `fstorecode` string COMMENT '发货仓库编码', 
  `merchant_season` string COMMENT 'merchant的季节', 
  `pid_style_clr` string COMMENT 'YNAP商品skc_id(女款)', 
  `gift_order_flag` int, 
  `ynap_full_price` double COMMENT '零售价(ynap)', 
  `net_sales_return_applied_rate_ex_vat` double, 
  `category_name_manual` string COMMENT '一级品类', 
  `subcategory_name_manual` string COMMENT '二级品类', 
  `sub_subcategory_name_manual` string COMMENT '三级品类', 
  `markdown_price` double, 
  `order_type` int, 
  `new_customer_flag` string, 
  `cancelled_applied_flag` int, 
  `brand_simple_name` string COMMENT '品牌简称', 
  `subchannel_hl_sl_alia_buccellati` string COMMENT '软硬奢渠道(业务不常用)', 
  `retail_price` double COMMENT '零售价', 
  `ynaprichemonttppchannel` string COMMENT 'YNAP/richemont/Local Buy渠道', 
  `updated_dgso_eur` double, 
  `price_eur` double, 
  `net_sales_eur` double, 
  `gross_sales_eur` double, 
  `return_sales_eur` double, 
  `mobile_sales_eur` double, 
  `dailybacklog_eur` double, 
  `return_applied_sales_eur` double, 
  `cancelled_successed_sales_eur` double, 
  `cancelled_applied_sales_eur` double, 
  `stmu_eur` double, 
  `stmns_eur` double, 
  `daily_gross_sales_ordered_eur` double, 
  `category_id_new` string COMMENT '一级类目编码', 
  `installments` string COMMENT '分期期数', 
  `fsteptradestatus` string COMMENT ' 预售支付状态', 
  `hard_luxury` string COMMENT '是否软硬奢', 
  `tid` string, 
  `88vip_flag` int COMMENT '88VIP标签', 
  `product_url` string, 
  `brand_colour` string, 
  `confirm_time` timestamp COMMENT '子订单确认时间 ', 
  `net_sales_return_applied_rate` double, 
  `fbuyermessage` string COMMENT '买家留言', 
  `merchant_gender` string COMMENT 'merchant的性别', 
  `basic_price` string, 
  `expand_price` string, 
  `basic_price_used` double, 
  `expand_price_used` double, 
  `is_member` int, 
  `level` int COMMENT '会员等级', 
  `content` string COMMENT '买家评价', 
  `reply` string COMMENT '卖家回复', 
  `fsystemsource` int, 
  `collocationinfo` string COMMENT '系列名称', 
  `service_fee` double, 
  `service_fee_eur` double, 
  `staff_flag` string, 
  `basic_price_refund` double, 
  `expand_price_refund` double, 
  `sub_sale_platform` string, 
  `basic_price_used_initial` double, 
  `expand_price_used_initial` double, 
  `basic_price_refund_initial` double, 
  `expand_price_refund_initial` double, 
  `affiliate_flag` bigint, 
  `affiliate_brand_code` string COMMENT 'Affiliate品牌类型', 
  `affiliate_ratio_type` string COMMENT 'Affiliate比率类型', 
  `affiliate_ratio` decimal(10,2) COMMENT 'Affiliate计算比例', 
  `affiliate_pay_initial` decimal(10,2) COMMENT 'Affiliate初始金额', 
  `affiliate_pay_end` decimal(10,2) COMMENT 'Affiliate变化后金额', 
  `affiliate_pay_change` decimal(10,2) COMMENT 'Affiliate变化金额', 
  `affiliate_refund` decimal(10,2) COMMENT 'Affiliate退金额', 
  `affiliate_real_amount_end` decimal(10,2) COMMENT '变化后现金金额', 
  `affiliate_is_end` bigint, 
  `rate_date` date COMMENT '发货日期大于rate_date,相关计算才乘以Brand_rate,否则乘以1', 
  `brand_rate` double COMMENT '品牌比例,手工表没有的品牌,取值为1', 
  `gross_sales_br` double, 
  `return_sales_br` double, 
  `return_applied_sales_br` double, 
  `sale_platform_old` string COMMENT '订单渠道', 
  `sub_sale_platform_old` string COMMENT '订单子渠道', 
  `rel_order_no` string, 
  `app_order_type` string, 
  `channel_code` string, 
  `payment_mode` string, 
  `child_order_receive_time` timestamp, 
  `storage_confirm_time` timestamp, 
  `collect_parcel_start_time` timestamp, 
  `type` string, 
  `key` string, 
  `gift_gtin` string, 
  `gift_flag` string, 
  `new_gift_flag` string, 
  `app_tag_name` string COMMENT '特卖标签', 
  `crm_tag_name` string COMMENT 'crm标签', 
  `free_order` string COMMENT '区分0元订单标记 0元订单则为1 其他为0', 
  `memberid` string, 
  `check_jit` int COMMENT '是否是jit商品 1是 2否', 
  `jit_stcok` int COMMENT '是否现货 1是 2否', 
  `ynap_cost` string COMMENT 'ynap回传的采购价', 
  `batch_code` string COMMENT '库存批次号 PO', 
  `delivery_no` string COMMENT '出库单号', 
  `virtual_warehouse_code` string COMMENT '仓存编号', 
  `nu` string COMMENT '国内物流单号', 
  `logi_no` string COMMENT '国际物流单号')
 

IMPORT_ODS_YNAP_OMS_TMALL_ORDER_REFUND_FL_D
IMPORT_ODS_YNAP_OMS_TMALL_ORDER_REFUND_ITEMS_FL_D
IMPORT_ODS_YNAP_OMS_TMALL_ORDER_DELIVERY_FL_D
IMPORT_ODS_YNAP_OMS_TMALL_ORDER_FL_D
IMPORT_ODS_YNAP_OMS_TMALL_ORDER_DELIVERY_ITEMS_FL_D
IMPORT_ODS_YNAP_OMS_TMALL_PAYMENT_ITEMS_FL_D
IMPORT_ODS_YNAP_OMS_TMALL_ORDER_ITEM_FL_D

IMPORT_ODS_YNAP_OMS_TMALL_ORDER_DELIVERY_FL_D

python3 /home/hadoop/workspace/bin/bi_import_query_data.py --auth-id app_oms_uat --tableQuery "select id,order_no,sharding_key_order_no,delivery_no,virtual_warehouse_code,product_quantity,delivery_status,tms_service_code,tms_service_name,tms_number,receiving_address_code,receiving_address,receiver_name,receiver_phone_number,shipping_address,consignee_name,consignee_phone_number,deleted,intercept_status,create_time,update_time,version,sort_id,partner_id,create_user_name,create_user_id,update_user_name,update_user_id,stock_number,order_remark,phone,rel_order_no,channel,user_tags,user_tag_ids,delivery_type,send_ecc,package_type from oms_tmall_order_delivery where \\\$CONDITIONS" --hive-table dw_ods.ods_ynap_oms_tmall_order_delivery_fl_d --hive-partition-key dt --hive-partition-value ${dt}

IMPORT_ODS_YNAP_OMS_TMALL_ORDER_DELIVERY_ITEMS_FL_D

python3 /home/hadoop/workspace/bin/bi_import_query_data.py --auth-id app_oms_uat --tableQuery "select id,sharding_key_order_no,delivery_no,delevery_Item_no,sku_code,product_quantity,product_name,product_img_url,item_type,stock_number,virtual_warehouse_code,delivery_line_status,push_status,deleted,order_item_state,create_time,update_time,version,sort_id,partner_id,create_user_name,create_user_id,update_user_name,update_user_id,jit_stock,package_type from oms_tmall_order_delivery_items where \\\$CONDITIONS" --hive-table dw_ods.ods_ynap_oms_tmall_order_delivery_items_fl_d --hive-partition-key dt --hive-partition-value ${dt}

IMPORT_ODS_YNAP_OMS_TMALL_ORDER_FL_D

python3 /home/hadoop/workspace/bin/bi_import_query_data.py --auth-id app_oms_uat --tableQuery "select id,sharding_key_order_no,channel_code,order_no,login_code,login_type,login_name,phone,order_amount,discount_amount,coupon_amount,payable_amount,refunded_amount,order_status,previewing_status,previewing_reason,payment_status,shipment_status,imanual_cancel_flag,invoice_code,invoice_flag,invoice_status,currency_code,delivery_type,payment_time,payment_balance_time,receiving_address_code,receiver_phone_number,receiver_name,receiving_address,receiving_address_decrypt,card_content,package_type,package_name,order_type,pay_times,order_remark,refund_remark,cs_remark,create_user_id,update_user_id,create_user_name,update_user_name,create_time,update_time,sort_id,version,deleted,order_time,freight,partner_id,sync_status,ps_user_id,shops,serial_number,sub_channel,operator,freight_refund_flag,system_source,ps_submit_flag,user_grade,points,buyer_name,id_number,buyer_phone_number,refunded_card_amount,affiliate_flag,user_tag_ids,use_card_amount,residue_amount,rel_order_no,dy_refund_flag,user_tags,utm_source,utm_content,is_douyin_notstock,good_stock,right_jit,oaid,package_time,pay_type,buyer_memo from oms_tmall_order where \\\$CONDITIONS" --hive-table dw_ods.ods_ynap_oms_tmall_order_fl_d --hive-partition-key dt --hive-partition-value ${dt}

IMPORT_ODS_YNAP_OMS_TMALL_ORDER_ITEM_FL_D

python3 /home/hadoop/workspace/bin/bi_import_query_data.py --auth-id app_oms_uat --tableQuery "select id,order_item_no,sharding_key_order_no,product_code,spu_code,model_code,product_quantity,batch_code,unit_price,product_name,product_image,order_line_type,gift_flag,promotion_code,promotion_name,gift_source_sku_code,virtual_warehouse_code,returnable_flag,product_label,order_item_status,intercept_status,aftersales_time,trading_closed_time,create_user_id,update_user_id,version,deleted,create_user_name,update_user_name,create_time,update_time,sort_id,partner_id,product_markdown_price,product_eip_price,tms_service_code,tms_service_name,tms_number,category_code,brand_name,product_size,product_colour,actually_amount,virtual_category,delivery_Item_no,sku_product_label,spu_product_label,sku_tag_label,invoice_amount,refund_amount,reserve_stock_number,freight,sale_day,tms_number_flag,check_jit,jit_stcok,omni_stock_num,asn_stock_num,oid,package_type from oms_tmall_order_item where \\\$CONDITIONS" --hive-table dw_ods.ods_ynap_oms_tmall_order_item_fl_d --hive-partition-key dt --hive-partition-value ${dt}

IMPORT_ODS_YNAP_OMS_TMALL_ORDER_REFUND_FL_D

python3 /home/hadoop/workspace/bin/bi_import_query_data.py --auth-id app_oms_uat --tableQuery "select id,order_no,sharding_key_order_no,operate_type,refund_no,total_fee,login_ada,login_user_name,order_status,refund_status,goods_status,has_good_return,refund_fee,payment,reason,refund_desc,tms_service_code,tms_service_name,tms_number,refund_version,deleted,create_time,update_time,collect_parcel_start_time,collect_parcel_end_time,images,receiving_address,receiver_name,receiver_phone_number,shipping_address,consignor_name,consignor_phone_number,partner_id,sort_id,version,create_user_name,update_user_name,create_user_id,update_user_id,batch_code,store_code,delivery_no,channel_code,refuse_reason,freight,refund_type,storage_cofirm_time,refuse_storage_reason,previewing_reason,phone,user_grade,refund_card_amount,refund_cash_amount,gift_card_service_charge,rel_order_no,rel_refund_no,refund_priority,user_tag_ids,cs_remark,user_tags,tms_number_flag,is_automatic,sync_stock,wms_times from oms_tmall_order_refund where \\\$CONDITIONS" --hive-table dw_ods.ods_ynap_oms_tmall_order_refund_fl_d --hive-partition-key dt --hive-partition-value ${dt}

IMPORT_ODS_YNAP_OMS_TMALL_ORDER_REFUND_ITEMS_FL_D


python3 /home/hadoop/workspace/bin/bi_import_query_data.py --auth-id app_oms_uat --tableQuery "select id,order_no,sharding_key_order_no,refund_no,sku_code,product_name,product_img_url,quantity,store_code,batch_code,original_price,deleted,refund_item_status,create_time,update_time,actually_amount,gift_source_sku_code,gift_flag,sku_type,promotion_code,promotion_name,brand_name,product_attr,product_markdown_price,product_eip_price,partner_id,sort_id,version,create_user_name,update_user_name,create_user_id,update_user_id,delivery_Item_no,order_item_status,refund_fee,spu_code from oms_tmall_order_refund_items where \\\$CONDITIONS" --hive-table dw_ods.ods_ynap_oms_tmall_order_refund_items_fl_d --hive-partition-key dt --hive-partition-value ${dt}

IMPORT_ODS_YNAP_OMS_TMALL_PAYMENT_ITEMS_FL_D

python3 /home/hadoop/workspace/bin/bi_import_query_data.py --auth-id app_oms_uat --tableQuery "select id,order_no,sharding_key_order_no,refund_no,sku_code,product_name,product_img_url,quantity,store_code,batch_code,original_price,deleted,refund_item_status,create_time,update_time,actually_amount,gift_source_sku_code,gift_flag,sku_type,promotion_code,promotion_name,brand_name,product_attr,product_markdown_price,product_eip_price,partner_id,sort_id,version,create_user_name,update_user_name,create_user_id,update_user_id,delivery_Item_no,order_item_status,refund_fee,spu_code from oms_tmall_order_refund_items where \\\$CONDITIONS" --hive-table dw_ods.ods_ynap_oms_tmall_order_refund_items_fl_d --hive-partition-key dt --hive-partition-value ${dt}

IMPORT_ODS_APP_OMS_TMALL_SYNC_TIME_FL_D
python3 /home/hadoop/workspace/bin/bi_import_query_data.py --auth-id app_oms_uat --tableQuery "select id,order_no,sku,virtual_warehouse_code,child_order_delivery_time,child_order_receive_time,child_order_success_time,child_order_cancel_time,child_order_refund_time,child_order_refund_parcel_time,child_order_refund_backmoney_time,refund_type,create_time,update_time,version,partner_id,sort_id,deleted,create_user_name,update_user_name,create_user_id,update_user_id,order_item_id from oms_tmall_sync_time where \\\$CONDITIONS" --hive-table dw_dwd.dwd_order_oms_tmall_sync_time_fl_d

jdbc:mysql://rm-uf6id1jb7mit5b452.mysql.rds.aliyuncs.com:3306/order_realtime?tinyInt1isBit=false
zhongtai_code
FP4fuzJHRI

统计 ecc api实时切换的 范围


id 124   130     ods_jv_foid_return_rt  ods_jv_foid_return_rt_copy1


 

临时支持 shannon shipment num   omni  delivery time 表结构更新

膨胀金沟通

11张表出 对应ecc api切换内容

oms order log 临时修复

标准化 表结构  开发 处理问题
 

python3 /home/hadoop/workspace/bin/bi_import_query_data.py --auth-id app_db_oms --tableQuery "select id,order_no,delivery_no,refund_no,user_id,user_ip,user_name,event_type,data_type,remark,version,deleted,sort_id,partner_id,create_user_name,create_time,create_user_id,update_user_name,update_time,update_user_id,\`desc\`,images from oms.oms_order_log where \\\$CONDITIONS" --hive-table dw_ods.ods_app_oms_order_log_fl_d --hive-partition-key dt --hive-partition-value ${dt}

python3 /home/hadoop/workspace/bin/bi_import_query_data.py --auth-id app_db_oms --tableQuery "select id,order_no,delivery_no,refund_no,user_id,user_ip,user_name,event_type,data_type,remark,version,deleted,sort_id,partner_id,create_user_name,create_time,create_user_id,update_user_name,update_time,update_user_id,desc,images from oms.oms_order_log where \\\$CONDITIONS" --hive-table dw_ods.ods_app_oms_order_log_fl_d --hive-partition-key dt --hive-partition-value 20230704

select str_to_date(ee.order_consign_time, '%Y-%m-%d %H:%i:%s') as FCONSIGNTIME,       now()                                                  TimeStamp,       aa.oid fid,       '' fadvanceStatus,       '' falipayno,       aa.attribute fattribute,       aa.buyer_nick fbuyernick,       aa.created fcreated,       '' fcsstatus,       aa.good_status fgoodstatus,       if(aa.has_good_return, 1, 0)                         as fhasgoodreturn,       aa.modified fmodified,       aa.num fnum,       '' fnumiid,       aa.oid foid,       aa.operation_contraint foperationcontraint,       aa.order_status forderstatus,       aa.outer_id fouterid,       aa.payment fpayment,       aa.price fprice,       aa.reason freason,       aa.refund_fee frefundfee,       aa.refund_id frefundid,       aa.refund_phase frefundphase,       aa.refund_version frefundversion,       aa.seller_nick fsellernick,       aa.sku fsku,       aa.status fstatus,       aa.tid ftid,       aa.title ftitle,       '' fplatformid,       '' fplatformshopid,       aa.created fcreatetime,       aa.last_update_time flastupdatetime,       aa.total_fee ftotalfee,       '' fsaleReturnsId,       '' fsaleReturnsNumber,       '' frefundProcessStatus,       '' fsyncFlag,       '' fsyncMessage,       '' fversion,       aa.sid fsid,       '' ftenantid,       '' fisReject,       '' fagRefundFlag,       '' fagRefundMessage,       '' fagRefundFailCount,       aa.company_name fcompanyName,       '' fgoodReturnTime,       concat(aa.oid, '')                                 as OIDfrom order_realtime.tb_refund_topic_api_realtime as aa         inner join (select bb.oid FOID, max(bb.modified)  as max_modify_time                     from order_realtime.tb_refund_topic_api_realtime as bb                     where bb.oid in (select  oid FOID                                       from order_realtime.tb_refund_topic_api_realtime                                       where created >= concat(CURRENT_DATE - interval 1 month, ' 00:00:00')                                       group by FOID)                     group by bb.oid) cc on aa.modified = cc.max_modify_time and aa.oid = cc.FOID         left join order_realtime.tb_order_api_fullinfo_realtime ee on aa.refund_id = ee.order_refund_idwhere aa.created >= concat(CURRENT_DATE - interval 1 month, ' 00:00:00')

insert overwrite table dw_dwd.dwd_finance_reconciliation_order_item_fl_d partition (dt='${dt}')
select
    order_channel -- 订单渠道    天猫/抖音/APP
    ,order_finance_type -- 订单对账逻辑种类    APP普通订单/礼品卡订单/抖音订单
    ,'正单' as order_refund_type -- 正退单标识    正单/退单
    ,order_no -- 订单号
    ,order_item_no -- 子订单号
    ,delivery_no -- 出库单号
    ,tms_number --物流编号
    ,refund_no -- 退单号
    ,refund_operate_type -- 退单操作类型
    ,product_code -- gtin
    ,product_name -- 商品名称
    ,order_type -- 订单类型
    ,order_status -- 订单状态
    ,order_item_status -- 订单商品行状态
    ,refund_item_status -- 商品退单状态
    ,delivery_status -- 物流状态
    ,delivery_line_status -- 商品行物流状态
    ,pay_time -- 付款时间
    ,delivery_time -- 发货时间
    ,receive_time -- 签收时间
    ,success_time -- 完成时间
    ,refund_time -- 退单完成时间
    ,finish_time -- 完结,数据推送时间
    -- 订单级
    ,order_original_amount -- 订单-应付金额(不含运费)
    ,order_actually_amount -- 订单-实付金额(不含运费)
    ,order_freight -- 订单-运费
    ,order_origin_amount -- 订单-礼品卡本金
    ,order_send_amount -- 订单-礼品卡膨胀金
    -- 订单商品级
    ,order_item_original_amount -- 订单商品-应付金额(不含运费)
    ,order_item_actually_amount -- 订单商品-实付金额(不含运费)
    ,coalesce(round(case when order_record_cnt=order_record_index then order_freight-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_freight end) over(partition by order_no),0) else order_item_freight end,2),0) as order_item_freight -- 订单商品-运费
    ,order_item_quantity -- 订单商品-数量
    ,coalesce(round(case when order_record_cnt=order_record_index then order_origin_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_origin_amount end) over(partition by order_no),0) else order_item_origin_amount end,2),0) as order_item_origin_amount -- 订单商品-礼品卡本金
    ,coalesce(round(case when order_record_cnt=order_record_index then order_send_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_send_amount end) over(partition by order_no),0) else order_item_send_amount end,2),0) as order_item_send_amount -- 订单商品-礼品卡膨胀金
    ,is_end -- 是否终态:APP-正向单,已发货
    ,order_item_amount_apportion_rate
    ,order_item_amount_apportion_rate_normal
    ,order_item_amount_apportion_rate_refund
    ,current_timestamp() as update_time     -- 更新时间
    ,order_item_amount_apportion_rate_residue
    ,order_deductible_amount -- 平台权益金(订单级)
    ,coalesce(round(case when order_record_cnt=order_record_index then order_deductible_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_deductible_amount end) over(partition by order_no),0) else order_item_deductible_amount end,2),0) as order_item_deductible_amount -- 平台权益金(商品级)
    ,'整单发货前取消-正向' as data_type
    ,order_actually_amount-order_origin_amount-order_send_amount-order_affiliate_amount-order_gift_amount-order_capital_amount as order_residue_amount -- 订单-现金(不含运费)
    ,(order_item_actually_amount
        - coalesce(round(case when order_record_cnt=order_record_index then order_origin_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_origin_amount end) over(partition by order_no),0) else order_item_origin_amount end,2),0)
        - coalesce(round(case when order_record_cnt=order_record_index then order_send_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_send_amount end) over(partition by order_no),0) else order_item_send_amount end,2),0)
        - coalesce(round(case when order_record_cnt=order_record_index then order_affiliate_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_affiliate_amount end) over(partition by order_no),0) else order_item_affiliate_amount end,2),0)
        - coalesce(round(case when order_record_cnt=order_record_index then order_gift_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_gift_amount end) over(partition by order_no),0) else order_item_gift_amount end,2),0)
        - coalesce(round(case when order_record_cnt=order_record_index then order_capital_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_capital_amount end) over(partition by order_no),0) else order_item_capital_amount end,2),0)
    ) as order_item_residue_amount -- 订单商品-现金(不含运费)=(订单商品实付-订单商品礼品卡本金-订单商品礼品卡膨胀金-订单商品佣金卡金额)
    ,-1 as use_gift_card
    ,-1 as use_afiiliate_card
    ,order_affiliate_amount
    ,coalesce(round(case when order_record_cnt=order_record_index then order_affiliate_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_affiliate_amount end) over(partition by order_no),0) else order_item_affiliate_amount end,2),0) as order_item_affiliate_amount -- 订单商品-佣金卡-使用金额
    ,order_gift_amount
    ,order_capital_amount
    ,coalesce(round(case when order_record_cnt=order_record_index then order_gift_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_gift_amount end) over(partition by order_no),0) else order_item_gift_amount end,2),0) as order_item_gift_amount
    ,coalesce(round(case when order_record_cnt=order_record_index then order_capital_amount-coalesce(sum(case when order_record_cnt!=order_record_index then order_item_capital_amount end) over(partition by order_no),0) else order_item_capital_amount end,2),0) as order_item_capital_amount
    ,item_promotion_amount
    ,item_discount_rate
    ,0 as order_item_send_amount_freight   --膨胀金所含运费
    ,0 as order_item_gift_amount_freight   --赠送金所含运费
from (
    select
        t1.order_channel -- 订单渠道    天猫/抖音/APP
        ,t1.order_finance_type -- 订单对账逻辑种类    APP普通订单/礼品卡订单/抖音订单
        ,t1.order_no -- 订单号
        ,t1.order_item_no -- 子订单号
        ,t1.delivery_no -- 出库单号
        ,t1.tms_number --物流编号
        ,t1.refund_no -- 退单号
        ,t1.refund_operate_type -- 退单操作类型
        ,t1.product_code -- gtin
        ,t1.product_name -- 商品名称
        ,t1.order_type -- 订单类型
        ,t1.order_status -- 订单状态
        ,t1.order_item_status -- 订单商品行状态
        ,t1.refund_item_status -- 商品退单状态
        ,t1.delivery_status -- 物流状态
        ,t1.delivery_line_status -- 物流状态
        ,t1.pay_time -- 付款时间
        ,t1.delivery_time -- 发货时间
        ,t1.receive_time -- 签收时间
        ,t1.success_time -- 完成时间
        ,t1.refund_time -- 退单完成时间
        ,(case
            -- 有退款 退单号不为空,有付款 付款时间不为空
            when t1.refund_no is not null and t1.pay_time is not null  then t1.order_giftcard_finish_time
        end) as finish_time -- 订单完成时间
        -- 订单级  --TODO
        ,round(sum(t1.item_original_amount) over(partition by t1.order_no),2) as order_original_amount -- 订单-应付金额(不含运费)
        ,round(sum(t1.item_actually_amount-t1.item_refund_actually_amount) over(partition by t1.order_no),2) as order_actually_amount -- 订单-实付金额(不含运费)
        -- 整单发货前取消无运费
        ,0 as order_freight -- 订单-运费
        ,round(t1.order_origin_amount-t1.order_refund_origin_amount,2) as order_origin_amount -- 订单-礼品卡本金
        ,round(t1.order_send_amount-t1.order_refund_send_amount,2) as order_send_amount -- 订单-礼品卡膨胀金
        ,round(t1.order_affiliate_amount-t1.order_refund_affiliate_amount,2) as order_affiliate_amount -- 订单-礼品卡膨胀金
        ,round(t1.order_gift_amount-t1.order_refund_gift_amount,2) as order_gift_amount -- 订单-直接赠送金额
        ,round(t1.order_capital_amount-t1.order_refund_capital_amount,2) as order_capital_amount -- 订单-订单触发金额
        ,round((case when t1.order_finance_type='DOUYIN_ORDER' then t1.order_deductible_amount else 0 end),2) as order_deductible_amount -- 订单-平台权益金
        -- 订单商品级 --TODO
        ,round(t1.item_original_amount,2) as order_item_original_amount -- 订单商品-应付金额(不含运费)
        ,round(t1.item_actually_amount-t1.item_refund_actually_amount,2) as order_item_actually_amount -- 订单商品-实付金额(不含运费)
        -- 整单发货前取消无运费
        ,0 as order_item_freight -- 订单商品-运费
        ,t1.item_quantity as order_item_quantity -- 订单商品-数量
        ,round((t1.order_origin_amount-t1.order_refund_origin_amount)*t2.order_item_amount_apportion_rate,2) as order_item_origin_amount -- 订单商品-礼品卡本金
        ,round((t1.order_send_amount-t1.order_refund_send_amount)*t2.order_item_amount_apportion_rate,2) as order_item_send_amount -- 订单商品-礼品卡膨胀金
        ,round((t1.order_affiliate_amount-t1.order_refund_affiliate_amount)*t2.order_item_amount_apportion_rate,2) as order_item_affiliate_amount -- 订单商品-佣金卡金额
        ,round((t1.order_gift_amount-t1.order_refund_gift_amount)*t2.order_item_amount_apportion_rate,2) as order_item_gift_amount -- 订单商品-直接赠送
        ,round((t1.order_capital_amount-t1.order_refund_capital_amount)*t2.order_item_amount_apportion_rate,2) as order_item_capital_amount -- 订单商品-订单触发
        ,round((case when t1.order_finance_type='DOUYIN_ORDER' then t1.order_deductible_amount else 0 end)*t2.order_item_amount_apportion_rate,2) as order_item_deductible_amount -- 订单商品-平台权益金
        -- 剩余分摊比率计算:商品实付/SUM(商品实付) -- 二次分摊比率
        ,null as order_item_amount_apportion_rate_residue
        ,0 as item_promotion_amount
        ,round((case when t1.item_markdown_price is NULL or t1.item_markdown_price =0.0 then t1.item_unit_price else t1.item_markdown_price end)/t1.item_unit_price, 4) as item_discount_rate
        -- 是否终态
        ,(case
            -- 有退款 退单号不为空,有付款 付款时间不为空
            when t1.refund_no is not null and t1.pay_time is not null  and t1.delivery_no is not null then 1
            else 0
        end) as is_end -- 是否终态:APP-正向单,已发货
        ,t2.order_item_amount_apportion_rate as order_item_amount_apportion_rate
        ,t3.order_item_amount_apportion_rate as order_item_amount_apportion_rate_normal
        ,t4.order_item_amount_apportion_rate as order_item_amount_apportion_rate_refund
        ,t2.order_record_cnt
        ,t2.order_record_index
    from dw_tmp.tmp_finance_reconciliation_order_item_fl_d_01_source t1
    left join dw_tmp.tmp_finance_reconciliation_order_item_fl_d_02_normal t2
        on t1.order_no=t2.order_no and t1.order_item_no=t2.order_item_no
    left join dw_tmp.tmp_finance_reconciliation_order_item_fl_d_04_other t3
        on t1.order_no=t3.order_no and t1.order_item_no=t3.order_item_no
    left join dw_tmp.tmp_finance_reconciliation_order_item_fl_d_03_refund t4
        on t1.order_no=t4.order_no and t1.order_item_no=t4.order_item_no
    left join (select order_no from dw_tmp.tmp_finance_reconciliation_order_item_fl_d_04_other group by order_no) t5
        on t1.order_no=t5.order_no
    where t1.order_finance_type in ('APP_ORDER','APP_ORDER_GIFTCARD','DOUYIN_ORDER') and t1.order_delivery_cancel = 1
) t
;

CREATE TABLE tb_refund_topic_api_realtime_test (
  refund_id varchar(255) DEFAULT NULL,
  tid varchar(255) DEFAULT NULL,
  oid varchar(255) DEFAULT NULL,
  total_fee double DEFAULT NULL,
  buyer_nick varchar(255) DEFAULT NULL,
  seller_nick varchar(255) DEFAULT NULL,
  created datetime DEFAULT NULL,
  modified datetime DEFAULT NULL,
  order_status varchar(255) DEFAULT NULL,
  status varchar(255) DEFAULT NULL,
  good_status varchar(255) DEFAULT NULL,
  has_good_return tinyint(1) DEFAULT NULL,
  refund_fee double DEFAULT NULL,
  payment double DEFAULT NULL,
  reason varchar(255) DEFAULT NULL,
  desc varchar(255) DEFAULT NULL,
  title text,
  price double DEFAULT NULL,
  num bigint(20) DEFAULT NULL,
  company_name varchar(255) DEFAULT NULL,
  sid varchar(255) DEFAULT NULL,
  refund_phase varchar(255) DEFAULT NULL,
  refund_version bigint(20) DEFAULT NULL,
  sku text,
  attribute text,
  outer_id varchar(255) DEFAULT NULL,
  operation_contraint varchar(255) DEFAULT NULL,
  buyer_open_uid varchar(255) DEFAULT NULL,
  last_update_time datetime DEFAULT NULL,
  advance_status int DEFAULT NULL,
  alipay_no varchar(255) NOT NULL,
  cs_status int DEFAULT NULL,
  num_iid varchar(255) NOT NULL,
  good_return_time datetime DEFAULT NULL,
  keyword varchar(255) NOT NULL,
  PRIMARY KEY (keyword)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

lmd555-hub params 新增商品卡
lmd556- omni delivery time修复重复数据
lmd567-ads_ord_omni_shipment_num_fl_d表开发
lmd568-oms order log 接入 增量

同步的作业和流

作业
IMPORT_ODS_APP_OMS_ORDER_LOG_FL_D
TASK_DWD_APP_OMS_ORDER_LOG_FL_D
TASK_ADS_ORD_OMNI_SHIPMENT_NUM_FL_D


SF_YNAP_ODS_APP_OMS_D
SF_YNAP_DWD_APP_OMS_D
SF_ADS_ORD_OMNI_SHIPMENT_NUM_FL_D


 

fplatformid 平台id                                                 1
fplatformshopid 店铺id                                             aaf08dbafc46482f928d25a65337a5c4
fsaleReturnsId 售后申请单id                         case when   frefundid  = '34071180688780331' then 169107944542489fb3571f9dd1d1256c else null    创建时间 2019-10-15 15:19:37
fsaleReturnsNumber 售后申请单编号                  case when   frefundid  = '34071180688780331' then BHSR191015000003 else null
frefundProcessStatus                             case when   frefundid  = '34071180688780331' then 2 else 1
fsyncFlag 同步时标记退款是否成功,0-失败,1-成功
fsyncMessage 同步时标记退款失败信息
fversion 版本号
ftenantid 租户ID                                                 0
fisReject 是否拒签,0:否,1:是
fagRefundFlag AG退款是否成功 0-失败,1-成功
fagRefundMessage AG退款失败原因                                 null
fagRefundFailCount AG退款失败次数                                 0

http://172.19.79.213:9527/index.html#/datax/job/jobInfo
累计要加的 

-----------------------------------------------------------------------------------------------------------
125 
pg_ods_jv_item_inventory_rt
t_ec_tbgoods      


-----------------------------------------------------------------------------------------------------------
124 
pg_ods_jv_foid_return_rt
t_sd_tbrefund         对比 order_realtime.tb_refund_api_realtime order_realtime.tb_refund_topic_api_realtime   少字段


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

123
pg_app_and_tmall_realtime

jst_tb_order_summary + app表 不影响


-----------------------------------------------------------------------------------------------------------
122
pg_ecc_sale_inventory

用到 
ecc_sale_details   
ecc_sales_inventory_details(t_ec_tbsku   t_ec_tbgoods )


-----------------------------------------------------------------------------------------------------------
121
pg_ecc_sale_details

用到 
t_sd_tbsoentry  
t_sd_tbsobill


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

120
pg_ecc_sales_inventory_details

用到 
t_ec_tbsku 
t_ec_tbgoods 


-----------------------------------------------------------------------------------------------------------
119
pg_ecc_inventory_advance_sale_detail

用到
ecc_inventory_details
ecc_advance_sale_details_month


-----------------------------------------------------------------------------------------------------------
118
pg_ecc_inventory_details

用到
t_ec_tbsku
t_ec_tbgoods


-----------------------------------------------------------------------------------------------------------
117
pg_ecc_advance_sale_details_month

用到
t_sd_tbsoentry
t_sd_tbsobill


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

116
pg_app_order_realtime_details
不影响   没用ecc表        


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


115
lmd503-实时预售相关的SQL逻辑迁移到中台pg-pg_data_ecc_advance_sale_details
ecc_advance_sale_details


用到
t_sd_tbsoentry
t_sd_tbsobill

是否海外发货 加一个字段  asn gtin 是否海外po


crm_gender     从262表拿gender匹配

新的标准化 要加的字段

国内物流单号 
国际物流单号 新的标准化
出库编号  仓库编号     

历史 eip
是否是珠宝 (不一定是硬奢)

APP活动时间  (paytime  可能某天2-3点或者 5-7点 只要确认 yes or no就可以)


 

varchar\([0-9]\)
varchar\([0-9][0-9]\)
varchar\([0-9][0-9][0-9]\)
varchar\([0-9][0-9][0-9][0-9]\)

SF_DWD_APP_TRADE_CENTER
    SF__ADS_JV_MANUAL_ORDER_LINKHAITAO_COMMISSION_RATE_FL_D
    SF_ADS_PDT_USER_CART
 

${oss_envir}/${sql_branch}/


foid改造 涉及流
SF_YNAP_ODS_APP_OMS_D
SF_YNAP_ODS_ECC_D

SF_YNAP_DWD_APP_OMS_D
SF_YNAP_DWD_ECC_D

SF_DWD_ORD_REBUILD
SF_ADS_ORD_PRE_REBUILD
SF_ADS_ORD_REBUILD
 

10:53订单标准化事项:
1、douyin数据对接:订单、退单、商品、订单支付、物流、营销        


5、tmall api 补充模型字段                    看下模型表里面 api少了哪些数据接进来
 

SF_DWD_APP_TRADE_CENTER
    SF__ADS_JV_MANUAL_ORDER_LINKHAITAO_COMMISSION_RATE_FL_D
    SF_ADS_PDT_USER_CART

SF_YNAP_DWD_APP_D
    SF_YNAP_DWS_CRM
    SF_YNAP_DWD_APP_CURL_D

SF_YNAP_DWD_PRODUCT_APP_D
    SF_ADS_PDT_ESTIMATED_30DAY_MARKDOWN_PRICE_COMPARISON_IU_D
    SF_ADS_ORD_SALES_DATA_SIMPLE_FL_D
    SF_YNAP_BRAND_DATA_REPORT
    SF_APP_PRODUCT_VIRTUAL_CATEGORY_FL_D
    SF_YNAP_ADS_PRICE_CONTRAST
    SF_YNAP_DWD_TAG_USER_LAYER
    SF_YNAP_ADS_APP
    SF_YNAP_DIM_PRODUCT_N
    SF_YNAP_DWD_TAG_USER_MARKETING
    SF_DWD_PDT_PRODUCT_ONE_SIX_CROWD_TYPE_PRICE_FL_D
    SF_YNAP_ADS_MARKDOWN_CONTRAST
    SF_ADS_STK_REBUILD
    SF_YNAP_DIM_PRODUCT
    SF_DWD_PDT_IDMAPPING_REBUILD

SF_YNAP_ODS_APP_OMS_D
    SF_YNAP_DWD_APP_OMS_D
    SF_YNAP_ADS_ORDER_PAYMENT

SF_YNAP_DWD_APP_OMS_D
    SF_YNAP_ADS_STOCK_D
    SF_ADS_ORDER_GIFT_CARD_CHECK_RESULT_FL_D
    SF_ADS_ORD_OMNI_DELIVERY_TIME_FL_D
    SF_ADS_ORD_SALES_DATA_SIMPLE_FL_D
    SF_DWD_ORD_REBUILD
    SF_YNAP_DWD_USR_REBUILD
    SF_DWS_APP_OMS_ORDER_SYNC_MONITOR_TIME_FL_D
    SF_FINANCE_RECONCILIATION
    SF_YNAP_GIFT_TOTAL_ITEM_D
    SF_ADS_APP_STK_TOTAL_SALES_AND_RETURN_TIMERANGE_FL_D
    SF_YNAP_MANUAL_OMS_REFLUSH
    SF_YNAP_DWD_ORDER_N_D
    SF_YNAP_ADS_ORDER_D
    SF_DWM_OMS_UNIPAY_DATA_DTL_H5_MERCHANTS_FL_D_SPARK

SF_DWD_APP_PROMO_RULE_ORDER_RECORD_FL_D
    无
 

python3 /home/hadoop/workspace/ynap-bigdata-etl/dw_base_check.py \
--table 'dw_dwd.dwd_jv_ecc_t_sd_tbsoentry_fl_d,dw_dwd.dwd_jv_api_t_sd_tbsoentry_fl_d' \
--is_dt 'false,false' --dt 'null,null' \
--id_column \
'
foid:foid
' \
--check_column \
'

fadjustfee         :fadjustfee          ,
fbuyerrate         :fbuyerrate          ,
fcid               :fcid                ,
fconsigntime       :fconsigntime        ,
fdiscountfee       :fdiscountfee        ,
fendtime           :fendtime            ,
finvoiceno         :finvoiceno          ,
fisoversold        :fisoversold         ,
fitemmealid        :fitemmealid         ,
fitemmealname      :fitemmealname       ,
flogisticscompany  :flogisticscompany   ,
fmodified          :fmodified           ,
fnum               :fnum                ,
fnumiid            :fnumiid             ,
foid               :foid                ,
forderfrom         :forderfrom          ,
fouteriid          :fouteriid           ,
fouterskuid        :fouterskuid         ,
fpayment           :fpayment            ,
fpicpath           :fpicpath            ,
fprice             :fprice              ,
frefundid          :frefundid           ,
frefundstatus      :frefundstatus       ,
fsellernick        :fsellernick         ,
fsellerrate        :fsellerrate         ,
fsellertype        :fsellertype         ,
fshippingtype      :fshippingtype       ,
fskuid             :fskuid              ,
fstatus            :fstatus             ,
ftimeoutactiontime :ftimeoutactiontime  ,
ftitle             :ftitle              ,
ftotalfee          :ftotalfee           ,
fstorecode         :fstorecode         
                          
                                  
' \
--is_run='false'


SF_YNAP_DWD_ORDER_N_D 留存

重构替换表


SF_YNAP_DWM_OMS_N_D                    SF_ADS_ORD


dw_dwm.dwm_jv_item_daily_sales_n_fl_d                   dw_dws.dws_ord_sales_daily_statistics_fl_d
dw_dwm.dwm_jv_item_presell_fl_d                         dw_ads.ads_ord_sales_presell_fl_d
dw_dwm.dwm_jv_item_sales_data_gift_only_n_fl_d          dw_ads.ads_ord_sales_data_gift_only_fl_d
dw_dwm.dwm_jv_item_sales_data_dtl_n_fl_d_new            dw_ads.ads_ord_sales_data_fl_d
dw_dwm.dwm_jv_item_sales_data_dtl_other_fl_d            dw_ads.ads_ord_sales_data_other_fl_d


jdbc:mysql://rm-uf6id1jb7mit5b452.mysql.rds.aliyuncs.com:3306/order_realtime?tinyInt1isBit=false
zhongtai_code
FP4fuzJHRI

你可能感兴趣的:(算法)