Commit 2b95aec2 by guanzhenshan

平台sku销量接口增加百伦SKU

parent 3a68fdbe
......@@ -71,7 +71,6 @@ namespace Bailun.DC.DailyPurchaseSellStock
//昨日库存
sql = $@"select t1.bailun_sku,t1.warehouse_code,t2.warehouse_name,sum(t1.usable_stock+t1.occupy_stock) count,sum((t1.usable_stock+t1.occupy_stock)*t1.unit_price) as amount from dc_daily_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code
where t1.record_time='{day.AddDays(-1).ToString("yyyy-MM-dd")}' group by t1.bailun_sku,t1.warehouse_code";
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.Sku
{
public class dc_base_sku_mapping
{
public string bailun_sku { get; set; }
public string platform_sku { get; set; }
public int count { get; set; }
}
}
......@@ -266,5 +266,27 @@ namespace Bailun.DC.Services
}
}
/// <summary>
/// 获取平台SKU的百伦SKU
/// </summary>
/// <param name="platformsku">平台SKU列表</param>
/// <returns></returns>
public List<dc_base_sku_mapping> GetBailunSkuByPlatformSku(List<string> platformsku)
{
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
var sql = $"select t1.bailun_sku,t1.platform_sku,t1.count from dc_base_sku_mapping t1 where t1.platform_sku in ('{string.Join("','", platformsku)}')";
return cn.Query<dc_base_sku_mapping>(sql).AsList();
}
}
}
}
......@@ -135,6 +135,8 @@ namespace Bailun.DC.Web.Controllers
var total = 0;
var obj = new Services.OrdersServices().ListOrderPlatformSku(page, pagesize, start, end,platform,companyid, ref total);
var listBailunSku = new Services.SkuInfoServices().GetBailunSkuByPlatformSku(obj.Select(a => a.platform_sku).ToList());
var list = obj.Select(a => new {
a.origin_order_id, //平台订单号
......@@ -145,7 +147,8 @@ namespace Bailun.DC.Web.Controllers
a.platform_sku_quantity_ordered, //销售数量
a.platform_sku_unit_price, //单价
a.item_id, //itemid
a.platform_sku //平台sku
a.platform_sku, //平台sku
bailunskus=listBailunSku.Select(b=>b.platform_sku==a.platform_sku).ToList()
});
return Json(new
......
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