Commit 71f71116 by lizefeng

刷新 订单 items 映射表

parent 5e956d1c
......@@ -341,7 +341,7 @@ where 1=1 ";
{
sql = @"
select
t1.*,t2.warehouse_name,t3.sku_title_cn as 'sku_name',t4.create_time,t3.buyer_name,
t1.*,(case when t2.hq_type='fba仓' then bailun_account else t2.warehouse_name end) as 'warehouse_name',t3.sku_title_cn as 'sku_name',t4.create_time,t3.buyer_name,
(t5.quantity_safe_inventory) as 'quantity_safe_inventory', -- 安全库存
(t5.daily_weighted_sales) as 'daily_weighted_sales', -- 日均加权
......
......@@ -192,7 +192,8 @@ t1.logistics_method_name,
( case when t7.`status`=0 or t7.`status` is null then '监控中' else '停止监控' end ) as 'monitor_status',
(case when t6.`status`=1 then '停售' else '在售' end) as 'sku_status',
(t2.quantity_transfer+t2.quantity_purchase) as 'quantity_ontheway', -- 总在途
t8.buy_ontheway_detail
t8.buy_ontheway_detail,
t9.items
from dc_base_oms_sku_outofstock as t1
left join dc_mid_transit as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
......@@ -202,6 +203,7 @@ left join dc_base_stock as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_auto_config_sku_warehouse as t7 on t1.bailun_sku = t7.bailun_sku and t1.warehouse_code = t7.warehouse_code
left join buy_ontheway_detail as t8 on t1.bailun_sku = t8.bailun_sku and t1.warehouse_code_extend = t8.warehouse_code
left join dc_base_oms_bailun_no_map_items as t9 on t1.bailun_order_id = t9.bailun_order_id
where 1=1
";
}
......@@ -623,6 +625,24 @@ end
{
try
{
_connection.Execute(@" -- 刷新 订单items映射表
set session transaction isolation level read uncommitted;
start transaction;
-- 清空视图表的数据
Truncate table dc_base_oms_bailun_no_map_items_temp;
INSERT into dc_base_oms_bailun_no_map_items_temp(`bailun_order_id`,`items`) (
select t1.bailun_order_id,GROUP_CONCAT(DISTINCT t1.item_id) as 'items' from dc_base_oms_platform_sku as t1
where t1.create_time>'2019-03-01 12:00:00' and t1.bailun_order_status = 'Handling' and t1.has_delete=0 and t1.has_scalp=0 and t1.bailun_interception_status not in ('Success','Part') and t1.platform_type!='FBA'
GROUP BY t1.bailun_order_id
);
alter table dc_base_oms_bailun_no_map_items rename dc_base_oms_bailun_no_map_itemsTemp;
alter table dc_base_oms_bailun_no_map_items_temp rename dc_base_oms_bailun_no_map_items;
alter table dc_base_oms_bailun_no_map_itemsTemp rename dc_base_oms_bailun_no_map_items_temp;
truncate table dc_base_oms_bailun_no_map_items_temp; ", commandTimeout: 0);
_connection.Execute(@" -- 刷新缺货明细表
set session transaction isolation level read uncommitted;
start transaction;
......
......@@ -203,6 +203,11 @@ namespace AutoTurnOver.Models.Report
public int crm_message_count { get; set; }
public int crm_message_reply_count { get; set; }
public int aims_message_reply_count { get; set; }
/// <summary>
/// 订单中所有的items
/// </summary>
public string items { get; set; }
}
public class quantity_out_stock_detail_search_dto
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment