Commit aecb8f76 by 泽锋 李

新增sku查询接口

parent e87c9507
......@@ -523,5 +523,21 @@ left join dc_base_warehouse as dbw on t1.warehouse_code = dbw.warehouse_code
parameters.Add("warehouse_code", warehouse_code);
return _connection.Query<dc_base_oms_sku>(sql, parameters);
}
public static IEnumerable<product_api_dto> GetSkus(string skus)
{
return _connection.Query<product_api_dto>($@"SELECT category_simple_id as 'CategorySimpleId',
category_simple_name as 'CategorySimpleName',
buyer_name as 'Purchaser',
bailun_category_id as 'CategoryId',
bailun_category_name as 'CategoryName',
product_code as 'GoodsCode',
skums_id as 'id',
sku_image as 'Img',
sku_title_cn as 'Name',
bailun_sku as 'ProductCode'
FROM dc_base_sku
where bailun_sku in @skus", skus.Split(',').ToList());
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models
{
public class product_api_dto
{
public int ID { get; set; }
/// <summary>
/// 内部商品编码
/// </summary>
public string SkuCode { get; set; }
public string GoodsCode { get; set; }
public string ProductCode { get; set; }
public string Name { get; set; }
public string EName { get; set; }
public int? CategoryId { get; set; }
public string CategoryName { get; set; }
public int? CategorySimpleId { get; set; }
public string CategorySimpleName { get; set; }
public int? PurchaserID { get; set; }
public string Purchaser { get; set; }
public string Img { get; set; }
}
}
......@@ -218,5 +218,10 @@ namespace AutoTurnOver.Services
}
public IEnumerable<product_api_dto> GetSkus(string skus)
{
return DB.daily.GetSkus(skus);
}
}
}
......@@ -54,5 +54,31 @@ namespace AutoTurnOver.Controllers
});
}
}
public class GetSkus_dto
{
public string skus { get; set; }
}
public JsonResult GetSkus([FromBody]GetSkus_dto queryDto)
{
try
{
return new JsonResult(new
{
result = new DailyServices().GetSkus(queryDto.skus),
success = true,
statusCode=200
});
}
catch (Exception ex)
{
return new JsonResult(new
{
message = ex.Message,
success = false,
statusCode = 500
});
}
}
}
}
\ No newline at end of file
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