Commit 3661807f by 泽锋 李

新增缺货推送轨迹

parent d7795723
...@@ -366,7 +366,6 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code ...@@ -366,7 +366,6 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
countSql += " and t3.buyer_name = @buyer_name "; countSql += " and t3.buyer_name = @buyer_name ";
parameters.Add("buyer_name", buyer_name); parameters.Add("buyer_name", buyer_name);
} }
if (monitor_status == 1) if (monitor_status == 1)
{ {
sql += " and t7.`status`=1 "; sql += " and t7.`status`=1 ";
...@@ -377,7 +376,6 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code ...@@ -377,7 +376,6 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
sql += " and ( t7.`status`=0 or t7.`status` is null ) "; sql += " and ( t7.`status`=0 or t7.`status` is null ) ";
countSql += " and ( t7.`status`=0 or t7.`status` is null ) "; countSql += " and ( t7.`status`=0 or t7.`status` is null ) ";
} }
if (has_tort != null) if (has_tort != null)
{ {
if (has_tort == 0) if (has_tort == 0)
...@@ -440,7 +438,6 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code ...@@ -440,7 +438,6 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
} }
} }
if (!string.IsNullOrWhiteSpace(warehouse_code)) if (!string.IsNullOrWhiteSpace(warehouse_code))
{ {
sql += " and t1.warehouse_code=@warehouse_code "; sql += " and t1.warehouse_code=@warehouse_code ";
...@@ -452,7 +449,6 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code ...@@ -452,7 +449,6 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
sql += " and t1.suppliers_name =@suppliers_name "; sql += " and t1.suppliers_name =@suppliers_name ";
parameters.Add("suppliers_name", supplier_name); parameters.Add("suppliers_name", supplier_name);
} }
if (isSum) if (isSum)
{ {
total = 0; total = 0;
...@@ -488,6 +484,39 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code ...@@ -488,6 +484,39 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
return obj.AsList(); return obj.AsList();
} }
/// <summary>
/// 缺货推送记录
/// </summary>
/// <returns></returns>
public static List<dc_auto_shortage_push_route_dto> ShortagePushList(string platform,string bailun_sku, int offset, int limit, ref int total)
{
var sql = @"select t1.id, t1.platform, t1.bailun_sku,t3.warehouse_name, t1.warehouse_code, t1.push_date,t2.push_time from dc_auto_shortage_push as t1
left join dc_return_goods_push as t2 on t1.id =t2.shortage_push_id
left join dc_base_warehouse as t3 on t1.warehouse_code = t3.warehouse_code
where 1=1 ";
var countSql = " select count(1) from dc_auto_shortage_push as t1 where 1=1 ";
DynamicParameters parameters = new DynamicParameters();
if (!string.IsNullOrWhiteSpace(platform))
{
sql += " t1.platform=@platform ";
countSql += " t1.platform=@platform ";
parameters.Add("platform", platform);
}
if (!string.IsNullOrWhiteSpace(bailun_sku))
{
sql += " t1.bailun_sku=@bailun_sku ";
countSql += " t1.bailun_sku=@bailun_sku ";
parameters.Add("bailun_sku", bailun_sku);
}
sql += " order by t1.id desc ";
total = _connection.QueryFirst<int>(countSql, parameters, commandTimeout: 0);
sql += " limit " + offset + "," + limit;
var obj = _connection.Query<dc_auto_shortage_push_route_dto>(sql, parameters, buffered: false, commandTimeout: 0);
return obj.AsList();
}
public static string MapField(string sort) public static string MapField(string sort)
{ {
sort = sort.Replace("-",""); sort = sort.Replace("-","");
......
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models
{
/// <summary>
/// 缺货推送路径
/// </summary>
public class dc_auto_shortage_push_route_dto
{
public int id { get; set; }
public string platform { get; set; }
public string bailun_sku { get; set; }
public string warehouse_name { get; set; }
public string warehouse_code { get; set; }
public DateTime push_date { get; set; }
public DateTime? push_time { get; set; }
}
}
...@@ -49,6 +49,11 @@ namespace AutoTurnOver.Services ...@@ -49,6 +49,11 @@ namespace AutoTurnOver.Services
return DB.daily.RealtimeList(monitor_status, searchType, key_words, warehouse_code, supplier_name, offset, limit, ref total,warehousetype,warehousearea, isSum, order, sort, has_tort:has_tort, categoryModels: categoryModels, buyer_name:buyer_name); return DB.daily.RealtimeList(monitor_status, searchType, key_words, warehouse_code, supplier_name, offset, limit, ref total,warehousetype,warehousearea, isSum, order, sort, has_tort:has_tort, categoryModels: categoryModels, buyer_name:buyer_name);
} }
public List<dc_auto_shortage_push_route_dto> ShortagePushList(string platform, string bailun_sku, int offset, int limit, ref int total)
{
return DB.daily.ShortagePushList(platform, bailun_sku, offset, limit,ref total);
}
/// <summary> /// <summary>
/// 在途数据 /// 在途数据
......
...@@ -34,10 +34,6 @@ namespace AutoTurnOver.Services ...@@ -34,10 +34,6 @@ namespace AutoTurnOver.Services
} }
/// <summary> /// <summary>
/// 获取采购建议列表 /// 获取采购建议列表
/// </summary> /// </summary>
......
...@@ -52,8 +52,6 @@ namespace AutoTurnOver.Controllers ...@@ -52,8 +52,6 @@ namespace AutoTurnOver.Controllers
}); });
} }
/// <summary> /// <summary>
/// 实时库存 /// 实时库存
/// </summary> /// </summary>
...@@ -99,7 +97,37 @@ namespace AutoTurnOver.Controllers ...@@ -99,7 +97,37 @@ namespace AutoTurnOver.Controllers
return new JsonResult(list == null || list.Count <= 0 ? new dc_base_stock_dto() : list[0]); return new JsonResult(list == null || list.Count <= 0 ? new dc_base_stock_dto() : list[0]);
} }
/// <summary>
/// 缺货推送记录
/// </summary>
/// <param name="platform"></param>
/// <param name="bailun_sku"></param>
/// <param name="offset"></param>
/// <param name="limit"></param>
/// <param name="total"></param>
/// <returns></returns>
public JsonResult ShortagePushList(string platform, string bailun_sku, int offset, int limit)
{
try
{
var services = new DailyServices();
var total = 0;
var list = services.ShortagePushList(platform, bailun_sku, offset, limit, ref total);
return new JsonResult(new
{
rows = list,
total = total,
});
}
catch (Exception ex)
{
return new JsonResult(new
{
message = ex.Message,
stack_trace = ex.StackTrace
});
}
}
/// <summary> /// <summary>
/// 预计到货 /// 预计到货
......
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