Commit 34028785 by 泽锋 李

fix

parent 588d1a84
...@@ -20,7 +20,7 @@ namespace AutoGeneratePurchaseAdvise ...@@ -20,7 +20,7 @@ namespace AutoGeneratePurchaseAdvise
try 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.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"))); //PurchaseAdviseServices.GenerateTemp(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd 13:13:00")));
...@@ -46,7 +46,8 @@ namespace AutoGeneratePurchaseAdvise ...@@ -46,7 +46,8 @@ namespace AutoGeneratePurchaseAdvise
} }
catch (Exception ex) catch (Exception ex)
{ {
throw; Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
} }
var builder = new HostBuilder().ConfigureServices((hostContext, services) => var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
......
...@@ -431,8 +431,9 @@ truncate table dc_aims_goods_moq_temp; ",new { time = date }, commandTimeout ...@@ -431,8 +431,9 @@ truncate table dc_aims_goods_moq_temp; ",new { time = date }, commandTimeout
//RedundancyDeduction("GZBLWH", "QYBLZZ"); //RedundancyDeduction("GZBLWH", "QYBLZZ");
Console.WriteLine("开始出建议");
// 生成采购建议 (只补缺货的不管) // 生成采购建议 (只补缺货的不管)
var datas1 = _connection.Query<dc_auto_purchase_advise_detailed>(@"select * from ( var datas1 = MyMySqlConnection._connection.Query<dc_auto_purchase_advise_detailed>(@"select * from (
select select
t1.bailun_sku, t1.bailun_sku,
t1.warehouse_code as 'source_warehouse_code', t1.warehouse_code as 'source_warehouse_code',
...@@ -505,7 +506,7 @@ and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0 ...@@ -505,7 +506,7 @@ and ( t5.`status`=0 or t5.`status` is null ) and t7.sum_quantity_init_advise>0
) -- 非jit 或者 jit 备货 ) -- 非jit 或者 jit 备货
) as t1 where t1.quantity_final_advise>0 ) as t1 where t1.quantity_final_advise>0
", new { main_id = mainID, btime = date }, commandTimeout: 0).ToList(); ", new { main_id = mainID, btime = date }, commandTimeout: 0).ToList();
Console.WriteLine("开始出建议 完");
foreach (var item in datas1) foreach (var item in datas1)
{ {
_connection.Insert(item); _connection.Insert(item);
...@@ -533,7 +534,7 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware ...@@ -533,7 +534,7 @@ and t1.quantity_init_advise>=0 and ( t3.buyer_name in ('张莹霞1') and t1.ware
// 调整因为舍弃小数导致的moq不足 // 调整因为舍弃小数导致的moq不足
var datas = _connection.Query<dc_auto_purchase_advise_detailed>(" select * from dc_auto_purchase_advise_detailed where main_id=@main_id ", new { main_id = mainID }, commandTimeout: 0).AsList(); var datas = MyMySqlConnection._connection.Query<dc_auto_purchase_advise_detailed>(" select * from dc_auto_purchase_advise_detailed where main_id=@main_id ", new { main_id = mainID }, commandTimeout: 0).AsList();
if (datas != null && datas.Count > 0) if (datas != null && datas.Count > 0)
{ {
foreach (var itemGoods in datas.GroupBy(s => new { s.suppliers_id, s.product_inner_code, s.warehouse_code })) foreach (var itemGoods in datas.GroupBy(s => new { s.suppliers_id, s.product_inner_code, s.warehouse_code }))
...@@ -609,7 +610,7 @@ set t1.`fixed_unit_price` = t3.unit_price, ...@@ -609,7 +610,7 @@ set t1.`fixed_unit_price` = t3.unit_price,
", new { advId }); ", new { advId });
// 周转期的预测销量需要自行计算 // 周转期的预测销量需要自行计算
var datas = _connection.Query<dc_auto_purchase_advise_detailed>(" select * from dc_auto_purchase_advise_detailed where main_id=@main_id ", new { main_id = advId }, commandTimeout: 0).AsList(); var datas = MyMySqlConnection._connection.Query<dc_auto_purchase_advise_detailed>(" select * from dc_auto_purchase_advise_detailed where main_id=@main_id ", new { main_id = advId }, commandTimeout: 0).AsList();
if (datas != null) if (datas != null)
{ {
foreach (var item in datas) foreach (var item in datas)
......
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