Commit dd931f19 by lizefeng

新增商品分类汇总

parent 4333bca0
using System;
using System.Collections.Generic;
using System.Text;
namespace AutoTurnOver.Models.Report
{
public class bailun_sku_website_sales_search_dto
{
public string platform_type { get; set; }
}
public class bailun_sku_website_sales_dto
{
public string label { get; set; }
public string platform_type { get; set; }
public string website { get; set; }
public string website_show { get; set; }
public List<string> labels { get; set; }
public List<bailun_sku_website_sales_date_dto> days { get; set; }
public class bailun_sku_website_sales_date_dto
{
public int year { get; set; }
public int month { get; set; }
public int day { get; set; }
public decimal count { get; set; }
public decimal sum { get; set; }
}
}
}
...@@ -18,6 +18,7 @@ namespace AutoTurnOver.Models ...@@ -18,6 +18,7 @@ namespace AutoTurnOver.Models
public string platform_type { get; set; } public string platform_type { get; set; }
public DateTime pay_time { get; set; } public DateTime pay_time { get; set; }
public DateTime create_time { get; set; }
public string website { get; set; } public string website { get; set; }
...@@ -28,6 +29,21 @@ namespace AutoTurnOver.Models ...@@ -28,6 +29,21 @@ namespace AutoTurnOver.Models
public string bailun_sku_title_cn { get; set; } public string bailun_sku_title_cn { get; set; }
public string bailun_sku_quantity_ordered { get; set; } public decimal bailun_sku_quantity_ordered { get; set; }
/// <summary>
/// 原币种转 - 美金汇率
/// </summary>
public decimal order_to_usd_exchange_rate { get; set; }
/// <summary>
/// 销售额
/// </summary>
public decimal amount_sales { get; set; }
}
public class dc_base_oms_sku_label : dc_base_oms_sku
{
public string label { get; set; }
} }
} }
...@@ -8,6 +8,7 @@ using AutoTurnOver.Utility; ...@@ -8,6 +8,7 @@ using AutoTurnOver.Utility;
using AutoTurnOver.Models.Report; using AutoTurnOver.Models.Report;
using System.Data; using System.Data;
using AutoTurnOver.Models.ApiDto; using AutoTurnOver.Models.ApiDto;
using System.Dynamic;
namespace AutoTurnOver.Services namespace AutoTurnOver.Services
{ {
...@@ -466,6 +467,31 @@ namespace AutoTurnOver.Services ...@@ -466,6 +467,31 @@ namespace AutoTurnOver.Services
report.removeShortagePush(datas.Where(s => !err_datas.Any(e => e.warehouseCode == s.warehouse_code && s.bailun_sku == e.sku)).Select(s=>s.shortage_push_id)); report.removeShortagePush(datas.Where(s => !err_datas.Any(e => e.warehouseCode == s.warehouse_code && s.bailun_sku == e.sku)).Select(s=>s.shortage_push_id));
} }
public List<dynamic> GetSkuWebsiteSales(bailun_sku_website_sales_search_dto search_data)
{
var order_list = report.GetSkuWebsiteSales(search_data);
List<dynamic> datas = new List<dynamic>();
foreach (var item in order_list)
{
dynamic o = new ExpandoObject();
o.label = item.label;
o.platform_type = item.platform_type;
o.website = item.website_show;
foreach (var dat_item in item.days)
{
var dic = (IDictionary<string, object>)o;
dic["count_" + (dat_item.month + "-" + dat_item.day)] = Math.Round( dat_item.count,2);
dic["sum_" + (dat_item.month + "-" + dat_item.day)] = Math.Round(dat_item.sum,2);
}
datas.Add(o);
}
return datas;
}
} }
} }
...@@ -620,5 +620,24 @@ namespace AutoTurnOver.Controllers ...@@ -620,5 +620,24 @@ namespace AutoTurnOver.Controllers
memory.Position = 0; memory.Position = 0;
return File(memory, "text/csv", "出信结果.csv"); return File(memory, "text/csv", "出信结果.csv");
} }
/// <summary>
/// sku 标签报表
/// </summary>
/// <param name="platform_type"></param>
/// <returns></returns>
public JsonResult GetSkuWebsiteSales(string platform_type)
{
bailun_sku_website_sales_search_dto search_data = new bailun_sku_website_sales_search_dto {
platform_type = platform_type
};
var list = new ReportServices().GetSkuWebsiteSales(search_data);
return new JsonResult(new
{
rows = list,
total = 0,
});
}
} }
} }
\ 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