Commit e235fb5a by 泽锋 李

fix

parent 34028785
......@@ -20,7 +20,7 @@ namespace AutoGeneratePurchaseAdvise
try
{
PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")));
//PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")));
//PurchaseAdviseServices.Generate(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 12:00:00")));
//PurchaseAdviseServices.GenerateTemp(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 13:13:00")));
......
......@@ -368,14 +368,11 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
// 刷新商品moq汇总数据
_connection.Execute(@" -- 刷新 刷新商品moq汇总数据
set session transaction isolation level read uncommitted;
start transaction;
-- 清空视图表的数据
Truncate table dc_aims_goods_moq_temp;
INSERT into dc_aims_goods_moq_temp(`product_inner_code`,`suppliers_id`,`warehouse_code`,`sum_quantity_init_advise`,`max_moq`
,`sum_history_fourteenday_sales`,`sku_count`,`sku_codes`)
,`sum_history_fourteenday_sales`,`sku_count`,`sku_codes`,`u_id`)
(
SELECT
`t6`.`product_inner_code` AS `product_inner_code`,
......@@ -386,7 +383,8 @@ INSERT into dc_aims_goods_moq_temp(`product_inner_code`,`suppliers_id`,`warehous
max( `t6`.`moq` ) AS `max_moq`,
sum( `t1`.`history_fourteenday_sales` ) AS `sum_history_fourteenday_sales`,
count( 1 ) AS `sku_count`,
group_concat( `t6`.`bailun_sku` SEPARATOR ',' ) AS `sku_codes`
group_concat( `t6`.`bailun_sku` SEPARATOR ',' ) AS `sku_codes`,
CONCAT(`t6`.`product_inner_code`,`t6`.`suppliers_id`,`t1`.`warehouse_code`) as 'u_id'
FROM
(((
`dc_auto_turnover` `t1`
......@@ -402,7 +400,7 @@ INSERT into dc_aims_goods_moq_temp(`product_inner_code`,`suppliers_id`,`warehous
)))
WHERE
((
`t1`.`gmt_modified` >= @time )
`t1`.`gmt_modified` >= '2021-01-20' )
AND ((
`t5`.`status` = 0
)
......@@ -425,8 +423,14 @@ INSERT into dc_aims_goods_moq_temp(`product_inner_code`,`suppliers_id`,`warehous
alter table dc_aims_goods_moq rename dc_aims_goods_moqTemp;
alter table dc_aims_goods_moq_temp rename dc_aims_goods_moq;
alter table dc_aims_goods_moqTemp rename dc_aims_goods_moq_temp;
truncate table dc_aims_goods_moq_temp; ",new { time = date }, commandTimeout: 0);
truncate table dc_aims_goods_moq_temp; ", new { time = date }, commandTimeout: 0);
_connection.Execute(@" update dc_auto_turnover as t1,
dc_base_sku as t2
set t1.adv_uid = CONCAT(t2.product_inner_code,t2.suppliers_id,t1.warehouse_code)
where t1.bailun_sku = t2.bailun_sku and t1.gmt_modified>=@btime
",new { btime = date },commandTimeout:0);
//RedundancyDeduction("QYBLZZ", "GZBLWH");
//RedundancyDeduction("GZBLWH", "QYBLZZ");
......@@ -487,15 +491,15 @@ tr_task.remarks as 'replace_logistics_remarks',
t9.quantity_transfer_order as 'quantity_transfer_order',
t9.quantity_transfer_temp_schedule as 'quantity_transfer_temp_schedule',
t9.quantity_transfer_temporary_storage as 'quantity_transfer_temporary_storage'
from dc_auto_turnover as t1
from (select * from dc_auto_turnover where gmt_modified>=@btime ) as t1
left join dc_auto_sales as t2 on t1.bailun_sku = t2.bailun_sku and t1.warehouse_code = t2.warehouse_code
left join dc_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
left join dc_base_sku as t6 on t1.bailun_sku = t6.bailun_sku
left join dc_aims_goods_moq as t7 on t6.product_inner_code = t7.product_inner_code and t1.warehouse_code = t7.warehouse_code and t6.suppliers_id = t7.suppliers_id
left join dc_aims_goods_moq as t7 on t1.adv_uid = t7.u_id
left join dc_auto_jit_tag as t8 on t1.tag_id = t8.id
left join dc_auto_replace_logistics_task as tr_task on t1.auto_replace_logistics_task_id = tr_task.id
left join dc_mid_transit as t9 on t1.bailun_sku = t9.bailun_sku and t1.warehouse_code = t9.warehouse_code
where t1.gmt_modified>=@btime
where 1=1
and t6.`status`=2
-- and (t1.history_fourteenday_sales>0 or t1.quantity_out_stock>0 )
and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0
......
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