Commit 7bc82d01 by 泽锋 李

fix

parent 4b35172e
......@@ -4087,19 +4087,21 @@ where t1.is_delete=0 and t1.is_temp_data=1 and t1.is_exception=0 and t2.hq_type
foreach (var item in temp_p_datas.GroupBy(s=>s.purchase_id))
{
// 查询是否已经调拨
var exists_trans = _connection.QueryFirstOrDefault<int>(" select count(1) from dc_base_transfer_info as t_tran where t_tran.purchasecode like @purchasecode ",new { purchasecode = $"%{item.Key}%"});
if (exists_trans <= 0)
{
//var exists_trans = _connection.QueryFirstOrDefault<int>(" select count(1) from dc_base_transfer_info as t_tran where t_tran.purchasecode like @purchasecode ",new { purchasecode = $"%{item.Key}%"});
//if (exists_trans <= 0)
//{
//}
foreach (var itemSku in item.AsEnumerable())
{
itemSku.transfer_order_id = "v - "+itemSku.purchase_id;
itemSku.transfer_order_id = "v - " + itemSku.purchase_id;
// 查询历史调拨天数
var tran_days = _connection.QueryFirstOrDefault<int?>(" select transfer_delivery+transfer_bale_delivery+abroad_inbound_delivery from dc_auto_turnover where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new { bailun_sku = itemSku.bailun_sku , warehouse_code = itemSku.warehouse_code })??0;
var tran_days = _connection.QueryFirstOrDefault<int?>(" select transfer_delivery+transfer_bale_delivery+abroad_inbound_delivery from dc_auto_turnover where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new { bailun_sku = itemSku.bailun_sku, warehouse_code = itemSku.warehouse_code }) ?? 0;
itemSku.expectarrivaltime = DateTime.Now.AddDays(tran_days);
datas.Add(itemSku);
}
}
}
_connection.Execute(" TRUNCATE table dc_base_trans_expectarrivaltime_temp; ");
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