Commit 0af12d89 by 泽锋 李

fix

parent 34934bc8
...@@ -1028,16 +1028,12 @@ end ...@@ -1028,16 +1028,12 @@ end
/// </summary> /// </summary>
public static List<dc_return_goods_push> ReturnGoodsPush(string platform) public static List<dc_return_goods_push> ReturnGoodsPush(string platform)
{ {
List<string> rule1 = new List<string> { "GBYKD", "JZHYBLGC", "MDBLWYT", "MXBLWYT", "BLUSGDC", "GBBMHBL", "GB4PXBL", "DEBLDG", "USGCBL", "USHWBL", "US4PXBL", "AUWYTBL", "AU4PXBL", "GBWYTUK", "GBLQST" };
if (platform == "wish") if (platform == "wish")
{ {
rule1 = new List<string> { "USGCBL", "BLUSGDC", "US4PXBL", "GB4PXBL" }; return ReturnGoodsPushWish(platform);
} }
List<string> rule1 = new List<string> { "GBYKD", "JZHYBLGC", "MDBLWYT", "MXBLWYT", "BLUSGDC", "GBBMHBL", "GB4PXBL", "DEBLDG", "USGCBL", "USHWBL", "US4PXBL", "AUWYTBL", "AU4PXBL", "GBWYTUK", "GBLQST" };
List<string> ch_rule1 = new List<string>(){ "GZBLWH", "BLGZ03"}; List<string> ch_rule1 = new List<string>(){ "GZBLWH", "BLGZ03"};
if (platform == "wish")
{
ch_rule1 = new List<string>() { "GZBLWH", "BLGZ03", "YWWH01" };
}
var conn = _connection; var conn = _connection;
var shortage_list = new List<dc_return_goods_push>(); var shortage_list = new List<dc_return_goods_push>();
...@@ -1100,7 +1096,67 @@ end ...@@ -1100,7 +1096,67 @@ end
) )
"; ";
shortage_list.AddRange(conn.Query<dc_return_goods_push>(sql, new { platform = platform,rule1 = rule1 }, commandTimeout: 0)); shortage_list.AddRange(conn.Query<dc_return_goods_push>(sql, new { platform = platform,rule1 = rule1, ch_rule1 = ch_rule1 }, commandTimeout: 0));
return shortage_list;
}
public static List<dc_return_goods_push> ReturnGoodsPushWish(string platform)
{
List<string> rule1 = new List<string> { "USGCBL", "BLUSGDC", "US4PXBL", "GB4PXBL" };
List<string> ch_rule1 = new List<string>() { "GZBLWH", "BLGZ03", "YWWH01" };
var conn = _connection;
var shortage_list = new List<dc_return_goods_push>();
// 回货速改推送
string sql = @"select
t1.id as 'shortage_push_id',
t1.bailun_sku,
t1.warehouse_code,
now() as 'push_time',
(case
when t_db.hq_type in ( '国内仓' ) then ifnull(t_stock.usable_stock,0) - ifnull(t3.quantity_unshipped,0)
else ifnull(tnc1.usable_stock,0)
end
) as 'stocks',
t2.buyer_name,
t_sp.title as 'supplier_holiday_time'
from dc_auto_shortage_push as t1
left join dc_base_sku as t2 on t1.bailun_sku = t2.bailun_sku
left join dc_mid_transit as t3 on t1.bailun_sku = t3.bailun_sku and t1.warehouse_code = t3.warehouse_code
left join dc_base_warehouse as t_db on t1.warehouse_code = t_db.warehouse_code
left join dc_base_stock as t_stock on t1.bailun_sku = t_stock.bailun_sku and t1.warehouse_code = t_stock.warehouse_code
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 (
select t1.bailun_sku,t2.area_id,sum(t1.usable_stock) as 'usable_stock' from dc_base_stock as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
where t1.warehouse_code in @rule1
-- and t1.bailun_sku_warehouse_code not in ( select bailun_sku_warehouse_code from dc_auto_shortage_push_ignore )
GROUP BY t1.bailun_sku,t2.area_id
) as tnc1 on t1.bailun_sku = tnc1.bailun_sku and t_db.area_id = tnc1.area_id
left join (
select t1.bailun_sku,t2.area_id,sum(t1.quantity_unshipped) as 'quantity_unshipped' from dc_mid_transit as t1
left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
left join dc_base_stock as t3 on t1.warehouse_code = t3.warehouse_code and t1.bailun_sku = t3.bailun_sku
where t1.quantity_unshipped>0 and t1.warehouse_code in @rule1
-- and t3.bailun_sku_warehouse_code not in ( select bailun_sku_warehouse_code from dc_auto_shortage_push_ignore )
GROUP BY t1.bailun_sku,t2.area_id
) as tnc2 on t1.bailun_sku = tnc2.bailun_sku and t_db.area_id = tnc2.area_id
left join holiday_supplier_view as t_sp on t2.suppliers_id = t_sp.supplier_id
where
t_sp.supplier_id is null and
t1.platform=@platform and t1.has_return_goods=0
and
(
case
when t_db.hq_type not in ( '国内仓' ) and t2.buyer_name in ('张莹霞','张莹霞1') then ifnull(tnc1.usable_stock,0) > 1
when t_db.hq_type not in ( '国内仓' ) then ifnull(tnc1.usable_stock,0) > 0
else ifnull(t3.quantity_unshipped,0) < ifnull(t_stock.usable_stock,0)
end
)
";
shortage_list.AddRange(conn.Query<dc_return_goods_push>(sql, new { platform = platform, rule1 = rule1 }, commandTimeout: 0));
return shortage_list; return shortage_list;
......
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