Commit 004a0c07 by 泽锋 李

fix

parent c65619ed
...@@ -208,6 +208,7 @@ UNION ALL ...@@ -208,6 +208,7 @@ UNION ALL
/// <returns></returns> /// <returns></returns>
public static List<dc_estimated_arrival_dto> EstimatedArrivalList(string sku, string warehouse_code, int index) public static List<dc_estimated_arrival_dto> EstimatedArrivalList(string sku, string warehouse_code, int index)
{ {
List<dc_estimated_arrival_dto> datas = new List<dc_estimated_arrival_dto>();
index -= 23; index -= 23;
var inbound_data = _connection.QueryFirstOrDefault<dc_auto_inbound>(" select * from dc_auto_inbound where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new { bailun_sku = sku, warehouse_code = warehouse_code }); var inbound_data = _connection.QueryFirstOrDefault<dc_auto_inbound>(" select * from dc_auto_inbound where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new { bailun_sku = sku, warehouse_code = warehouse_code });
if (inbound_data == null) return new List<dc_estimated_arrival_dto>(); if (inbound_data == null) return new List<dc_estimated_arrival_dto>();
...@@ -217,14 +218,14 @@ UNION ALL ...@@ -217,14 +218,14 @@ UNION ALL
var relation = inbound_data.relation; var relation = inbound_data.relation;
if (string.IsNullOrWhiteSpace(relation)) if (string.IsNullOrWhiteSpace(relation))
{ {
return new List<dc_estimated_arrival_dto>(); datas = new List<dc_estimated_arrival_dto>();
} }
else else
{ {
if (index >= 0) if (index >= 0)
{ {
var nos = relation.Replace("[", "").Replace("]", "").Split(',')[index]; var nos = relation.Replace("[", "").Replace("]", "").Split(',')[index];
var datas = new List<dc_estimated_arrival_dto>(); datas = new List<dc_estimated_arrival_dto>();
if (nos!=("N/A")) if (nos!=("N/A"))
{ {
foreach (var no_str in nos.Split('*')) foreach (var no_str in nos.Split('*'))
...@@ -242,11 +243,7 @@ UNION ALL ...@@ -242,11 +243,7 @@ UNION ALL
} }
return datas;
} }
return datas;
} }
else else
{ {
...@@ -255,7 +252,7 @@ UNION ALL ...@@ -255,7 +252,7 @@ UNION ALL
bailun_sku = sku, bailun_sku = sku,
warehouse_code = warehouse_code warehouse_code = warehouse_code
}); });
var datas = new List<dc_estimated_arrival_dto>(); datas = new List<dc_estimated_arrival_dto>();
var nos_list = relation.Replace("[", "").Replace("]", "").Split(','); var nos_list = relation.Replace("[", "").Replace("]", "").Split(',');
int count = 0; int count = 0;
foreach (var nos in nos_list) foreach (var nos in nos_list)
...@@ -291,11 +288,29 @@ UNION ALL ...@@ -291,11 +288,29 @@ UNION ALL
} }
} }
} }
return datas;
} }
} }
} }
if(datas!=null && datas.Count >= 1)
{
//匹配调拨单
foreach (var item in datas)
{
var temp_data = _connection.QueryFirstOrDefault<dc_estimated_arrival_dto>(@"select t1.transporttype,t2.storagecount,t2.transitcount,t2.deliverycount from dc_base_transfer_info as t1
left join dc_base_transfer_info_skus as t2 on t1.dataid =t2.dataid
where t1.`code`=@code and t2.sku=@sku ", new { code = item.no,sku = sku });
if (temp_data != null)
{
item.storagecount = temp_data.storagecount;
item.transitcount = temp_data.transitcount;
item.deliverycount = temp_data.deliverycount;
item.transporttype = temp_data.transporttype;
}
}
}
return datas;
} }
/// <summary> /// <summary>
......
...@@ -40,5 +40,21 @@ namespace AutoTurnOver.Models ...@@ -40,5 +40,21 @@ namespace AutoTurnOver.Models
/// </summary> /// </summary>
public decimal quantity { get; set; } public decimal quantity { get; set; }
/// <summary>
/// 原始发货数量
/// </summary>
public decimal deliverycount { get; set; }
/// <summary>
/// 已入库数量
/// </summary>
public decimal storagecount { get; set; }
/// <summary>
/// 未入库数量
/// </summary>
public decimal transitcount { get; set; }
public string transporttype { get; set; }
} }
} }
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