_connection.Execute(" update dc_auto_turnover set auto_replace_logistics_task_id=@auto_replace_logistics_task_id where id=@id ",new{id=item.auto_id,auto_replace_logistics_task_id=task_id});
t1.quantity_init_advise as 'quantity_init_advise', -- 原始采购建议数量 new
t1.quantity_init_advise as 'quantity_init_advise', -- 原始采购建议数量 new
(
(
case
case
when t1.is_mother_sku =1 then t1.quantity_final_advise -- 母sku 直接下
when t6.buyer_name in ('张莹霞') then ( case when t1.quantity_init_advise>0 then greatest(t1.quantity_init_advise,t6.moq) else 0 end) -- (张莹霞的sku取moq下单)
when t6.buyer_name in ('张莹霞') then ( case when t1.quantity_init_advise>0 then greatest(t1.quantity_init_advise,t6.moq) else 0 end) -- (张莹霞的sku取moq下单)
when t7.sum_quantity_init_advise>=t7.max_moq then t1.quantity_init_advise-- 如果商品的下单总量达到moq了,就直接下单
when t7.sum_quantity_init_advise>=t7.max_moq then t1.quantity_init_advise-- 如果商品的下单总量达到moq了,就直接下单
when t7.sku_count=1 then t7.max_moq -- 如果该商品只有一个sku需要下单,则直接下一个moq
when t7.sku_count=1 then t7.max_moq -- 如果该商品只有一个sku需要下单,则直接下一个moq
...
@@ -638,6 +641,8 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
...
@@ -638,6 +641,8 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
//先清洗一波子母sku
//先清洗一波子母sku
if(mother_datas!=null&&mother_datas.Count>=1)
if(mother_datas!=null&&mother_datas.Count>=1)
{
{
// 再查询需要监控库容的母sku
// 再查询需要监控库容的母sku
varmother_storage_capacity_configs=_connection.Query<dc_base_storage_capacity_config>(" select * from dc_base_storage_capacity_config where bailun_sku_warehouse_code in @bailun_sku_warehouse_codes ",new
varmother_storage_capacity_configs=_connection.Query<dc_base_storage_capacity_config>(" select * from dc_base_storage_capacity_config where bailun_sku_warehouse_code in @bailun_sku_warehouse_codes ",new
{
{
...
@@ -649,6 +654,7 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
...
@@ -649,6 +654,7 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
if(mother_datas!=null&&mother_datas.Count>=1)
if(mother_datas!=null&&mother_datas.Count>=1)
{
{
// 查询母sku锁包含的子sku全部清除
// 查询母sku锁包含的子sku全部清除
varmaps=_connection.Query<dc_base_mother_sku_map>(" select * from dc_base_mother_sku_map where mother_sku_warehouse_code in @mother_sku_warehouse_codes ",new
varmaps=_connection.Query<dc_base_mother_sku_map>(" select * from dc_base_mother_sku_map where mother_sku_warehouse_code in @mother_sku_warehouse_codes ",new
{
{
...
@@ -661,6 +667,12 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
...
@@ -661,6 +667,12 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware