Commit 579975eb by 泽锋 李

fix

parent 7b86240c
......@@ -226,11 +226,11 @@ UNION ALL
{
var nos = relation.Replace("[", "").Replace("]", "").Split(',')[index];
datas = new List<dc_estimated_arrival_dto>();
if (nos!=("N/A"))
if (nos != ("N/A"))
{
foreach (var no_str in nos.Split('*'))
{
if (!no_str.Contains( "N/A"))
if (!no_str.Contains("N/A"))
{
var no_datas = no_str.Split('_');
dc_estimated_arrival_dto data = new dc_estimated_arrival_dto();
......@@ -239,7 +239,7 @@ UNION ALL
data.quantity = decimal.Parse(no_datas[2]);
datas.Add(data);
}
}
......@@ -248,7 +248,8 @@ UNION ALL
else
{
// 查询周转表
var dc_auto_turnover_data = _connection.QuerySingleOrDefault<AutoTurnOver.Models.dc_auto_turnover>(" select * from dc_auto_turnover where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ",new {
var dc_auto_turnover_data = _connection.QuerySingleOrDefault<AutoTurnOver.Models.dc_auto_turnover>(" select * from dc_auto_turnover where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ", new
{
bailun_sku = sku,
warehouse_code = warehouse_code
});
......@@ -258,17 +259,17 @@ UNION ALL
foreach (var nos in nos_list)
{
count++;
if(dc_auto_turnover_data.turnover_days< count)
if (dc_auto_turnover_data.turnover_days < count)
{
break;
}
if (nos!=( "N/A"))
if (nos != ("N/A"))
{
foreach (var no_str in nos.Split('*'))
{
try
{
if (!no_str.Contains( "N/A"))
if (!no_str.Contains("N/A"))
{
var no_datas = no_str.Split('_');
dc_estimated_arrival_dto data = new dc_estimated_arrival_dto();
......@@ -277,30 +278,30 @@ UNION ALL
data.quantity = decimal.Parse(no_datas[2]);
datas.Add(data);
}
}
catch (Exception ex)
{
}
}
}
}
}
}
}
if(datas!=null && datas.Count >= 1)
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 });
where t1.`code`=@code and t2.sku=@sku ", new { code = item.no, sku = sku });
if (temp_data != null)
{
item.storagecount = temp_data.storagecount;
......@@ -1349,27 +1350,27 @@ where id=@id
break;
}
foreach (var item in configs.GroupBy(s=>s.web_site))
foreach (var item in configs.GroupBy(s => s.web_site))
{
// 查询review
var reviews = ApiUtility.GetReview(new api_pps_review_request_dto { Site= item.Key,Type = 1,AsinList = item.Select(s=>s.asin).ToList()});
var reviews = ApiUtility.GetReview(new api_pps_review_request_dto { Site = item.Key, Type = 1, AsinList = item.Select(s => s.asin).ToList() });
foreach (var asinItem in item.AsEnumerable())
{
var tempReview = reviews.FirstOrDefault(s => s.asin == asinItem.asin) ?? new api_pps_review_response_dto.result_dto.data_dto();
_connection.Execute($@" update dc_config_fba_extend set
_connection.Execute($@" update dc_config_fba_extend set
review_count=@review_count,
review_score=@review_score,
review_reset_date = now()
where id=@id
", new
{
review_count = tempReview.totalComments,
review_score = tempReview.score,
id = asinItem.id
});
{
review_count = tempReview.totalComments,
review_score = tempReview.score,
id = asinItem.id
});
}
}
}
......@@ -1670,9 +1671,9 @@ left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code
var obj = _connection.Query<full_link_purchase_dto>(sql, parameters, buffered: false, commandTimeout: 0).AsList();
foreach (var item in obj)
{
item.history_sevenday_sales = (item.history_sevenday_sales??0).Round1();
item.history_fourteenday_sales =(item.history_fourteenday_sales??0).Round1();
item.history_thirtyday_sales = (item.history_thirtyday_sales??0).Round1();
item.history_sevenday_sales = (item.history_sevenday_sales ?? 0).Round1();
item.history_fourteenday_sales = (item.history_fourteenday_sales ?? 0).Round1();
item.history_thirtyday_sales = (item.history_thirtyday_sales ?? 0).Round1();
}
return obj;
}
......@@ -1742,6 +1743,7 @@ t1.`code` as 'order_no',
t1.transporttype,
t1.stateid,
t1.creationtime,
t1.purchasecode,
t8.sign_time,
t8.put_time,
......@@ -1967,8 +1969,12 @@ left join dc_lms_order_transfer_current_node as t8 on t1.dataid = t8.data_id and
}
if (string.IsNullOrWhiteSpace(search_data.sort))
{
search_data.sort = "( ifnull(t8.expectarrivaltime,'9999-01-01') )";
search_data.order = "asc";
}
if (!string.IsNullOrEmpty(search_data.sort) && !string.IsNullOrEmpty(search_data.order))
{
sql += " order by " + search_data.sort;
......@@ -2006,7 +2012,7 @@ left join dc_lms_order_transfer_current_node as t8 on t1.dataid = t8.data_id and
{
sql += " and t1.sku=@bailun_sku ";
countSql += " and t1.sku=@bailun_sku ";
parameters.Add("bailun_sku",search.bailun_sku);
parameters.Add("bailun_sku", search.bailun_sku);
}
if (!string.IsNullOrWhiteSpace(search.target_ware_no))
{
......
......@@ -12,6 +12,7 @@ namespace AutoTurnOver.Models
public string sku { get; set; }
public string warehouse_code { get; set; }
public string warehouse_name { get; set; }
public string purchasecode { get; set; }
public DateTime creationtime { get; set; }
public DateTime? sign_time { get; set; }
public DateTime? put_time { get; set; }
......
......@@ -626,8 +626,8 @@ namespace AutoTurnOver.Services
DataTable table = new DataTable();
string[] cols = new string[] { "产品编码", "仓库名称","仓库编码","中文信息","可用库存","调拨单在途数","箱子在途数","过去7天日均","过去14天日均","过去30天日均",
"商品来源", "采购员", "sku状态", "调拨单号",
"物流跟踪号", "物流转单号","头程方式","调拨单状态","物流渠道","物流渠道编码","物流节点状态","物流节点时间","物流异常","目标到货","预计到货"
"商品来源", "采购员", "sku状态", "对应采购单", "调拨单号",
"物流跟踪号", "物流转单号","头程方式","调拨单状态","物流渠道","物流渠道编码","物流节点状态","物流节点时间","物流异常","目标到货","预计到货","实际签收","实际签收"
};
foreach (var item in cols)
......@@ -665,6 +665,10 @@ namespace AutoTurnOver.Services
row["目标到货"] = itemData.expectarrivaltime==null ? "" : itemData.expectarrivaltime.Value.ToString("yyyy-MM-dd HH:mm:ss");
row["预计到货"] = itemData.node_expectarrivaltime==null ? "" : itemData.node_expectarrivaltime.Value.ToString("yyyy-MM-dd HH:mm:ss");
row["对应采购单"] = itemData.purchasecode;
row["实际签收"] = itemData.sign_time==null ? "" : itemData.sign_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
row["实际入库"] = itemData.put_time == null ? "" : itemData.put_time.Value.ToString("yyyy-MM-dd HH:mm:ss");
table.Rows.Add(row);
}
......
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