Commit 49e541b3 by lizefeng

创建采购建议时,广州03 可找广州01借用库存

parent 9d43af10
...@@ -44,6 +44,8 @@ namespace AutoTurnOver.DB ...@@ -44,6 +44,8 @@ namespace AutoTurnOver.DB
RedundancyDeduction("GZBLWH", "QYBLZZ"); RedundancyDeduction("GZBLWH", "QYBLZZ");
RedundancyDeduction("GZBLWH", "BLGZ03");
// 生成采购建议 (只补缺货的不管) // 生成采购建议 (只补缺货的不管)
_connection.Execute(@" _connection.Execute(@"
INSERT into dc_auto_purchase_advise_detailed(`bailun_sku`,`warehouse_code`,`quantity_init_advise`,`quantity_final_advise`, INSERT into dc_auto_purchase_advise_detailed(`bailun_sku`,`warehouse_code`,`quantity_init_advise`,`quantity_final_advise`,
...@@ -303,13 +305,12 @@ where t2.`status`=2 and t1.bailun_sku = t2.bailun_sku and quantity_final_advise= ...@@ -303,13 +305,12 @@ where t2.`status`=2 and t1.bailun_sku = t2.bailun_sku and quantity_final_advise=
/// </summary> /// </summary>
public static void RedundancyDeduction(string warehouse_code_form, string warehouse_code_to) public static void RedundancyDeduction(string warehouse_code_form, string warehouse_code_to)
{ {
// 把广州01出了建议数的找出来
var gzblwh_turnover_list = _connection.Query<Models.dc_auto_turnover>(@" var gzblwh_turnover_list = _connection.Query<Models.dc_auto_turnover>(@"
select t1.* from dc_auto_turnover as t1 select t1.* from dc_auto_turnover as t1
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_auto_config_sku_warehouse as t5 on t1.bailun_sku = t5.bailun_sku and t1.warehouse_code = t5.warehouse_code
where ( t5.`status`=0 or t5.`status` is null ) and t1.quantity_begin_advise>0 and t1.warehouse_code=@warehouse_code_to where ( t5.`status`=0 or t5.`status` is null ) and t1.quantity_begin_advise>0 and t1.warehouse_code=@warehouse_code_to
", new { warehouse_code_to }, commandTimeout: 0); ", new { warehouse_code_to }, commandTimeout: 0);
// 看看清远03是不是有冗余的库存
if (gzblwh_turnover_list != null && gzblwh_turnover_list.Count() >= 1) if (gzblwh_turnover_list != null && gzblwh_turnover_list.Count() >= 1)
{ {
foreach (var item in gzblwh_turnover_list) foreach (var item in gzblwh_turnover_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