Commit 2badd1d8 by lizefeng

周转表查询、导出,支持品牌搜索

parent ab088c58
......@@ -128,5 +128,23 @@ namespace AutoTurnOver.DB
}
}
/// <summary>
/// 查询品牌
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public static List<string> SearchBrand(string name)
{
if (string.IsNullOrWhiteSpace(name))
{
return new List<string>();
}
else
{
var sql = " select brand as 'name' from dc_base_sku where brand like @brand_name GROUP BY brand ";
return _connection.Query<string>(sql, new { brand_name = $"%{name}%" }).AsList();
}
}
}
}
......@@ -190,6 +190,11 @@ from dc_auto_turnover as dat
whereSql += " and dat.buyer_name = " + $"'{m.buyer_name}'";
sqlCount += " and dat.buyer_name = " + $"'{m.buyer_name}'";
}
if (!string.IsNullOrWhiteSpace(m.brand_name))
{
whereSql += " and t4.brand = " + $"'{m.brand_name}'";
sqlCount += " and t4.brand = " + $"'{m.brand_name}'";
}
if (!string.IsNullOrWhiteSpace(m.product_type))
{
whereSql += " and t4.product_type = " + $"'{m.product_type}'";
......@@ -2282,6 +2287,11 @@ left join dc_auto_turnover as dat on dat.warehouse_code = ta.warehouse_code and
sql += " and dat.buyer_name = " + $"'{m.buyer_name}'";
sqlCount += " and dat.buyer_name = " + $"'{m.buyer_name}'";
}
if (!string.IsNullOrWhiteSpace(m.brand_name))
{
sql += " and t4.brand = " + $"'{m.brand_name}'";
sqlCount += " and t4.brand = " + $"'{m.brand_name}'";
}
if (!string.IsNullOrWhiteSpace(m.product_type))
{
sql += " and t4.product_type = " + $"'{m.product_type}'";
......
......@@ -647,6 +647,8 @@ namespace AutoTurnOver.Models
public bool isSum { get; set; }
[Description("sku标签")]
public string sku_label { get; set; }
[Description("品牌")]
public string brand_name { get; set; }
[Description("待调拨数量(最小)")]
public int? not_trans_count_min { get; set; }
......
......@@ -37,6 +37,10 @@ namespace AutoTurnOver.Services
{
return DB.common.SearchPurchaseUser(name);
}
public List<string> SearchBrand(string name)
{
return DB.common.SearchBrand(name);
}
public List<string> BrandList()
{
......
......@@ -119,6 +119,15 @@ namespace AutoTurnOver.Controllers
text = p.name
}));
}
public JsonResult SearchBrand(string name)
{
var list = new CommonServices().SearchBrand(name);
return new JsonResult(list.Select(p => new
{
id = p,
text = p
}));
}
public JsonResult AccountList(string name)
{
......
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