Commit 1642e8f9 by zhouminghui

fix

parent 2bcf8d22
...@@ -5,16 +5,21 @@ ...@@ -5,16 +5,21 @@
/// </summary> /// </summary>
public class PlatformTypeMonthlyStatisticsDto public class PlatformTypeMonthlyStatisticsDto
{ {
public string month { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public string platform_type { get; set; } public string platform_type { get; set; }
/// <summary> /// <summary>
/// 对应平台总销售额 /// 对应平台总销售额(计算汇率的)
/// </summary> /// </summary>
public decimal total_amount_sales { get; set; } public decimal total_amount_sales { get; set; }
/// <summary>
/// 原币
/// </summary>
public decimal original_amount { get; set; }
/// <summary> /// <summary>
/// 订单数 /// 订单数
/// </summary> /// </summary>
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models
{
public class dc_month_sales_profit_order_summary
{
public int id { get; set; }
public string month { get; set; }
/// <summary>
///
/// </summary>
public string platform_type { get; set; }
/// <summary>
/// 对应平台总销售额
/// </summary>
public decimal total_amount_sales { get; set; }
public decimal original_amount { get; set; }
/// <summary>
/// 订单数
/// </summary>
public decimal total_order { get; set; }
/// <summary>
/// 0销售额,1成本
/// </summary>
public int summary_type { get; set; }
public string financecategoryname { get; set; }
public DateTime createdate { get; set; }
}
}
...@@ -43,6 +43,16 @@ namespace Bailun.DC.Models ...@@ -43,6 +43,16 @@ namespace Bailun.DC.Models
/// 产品销售额 原币 /// 产品销售额 原币
/// </summary> /// </summary>
public decimal amount_sales { get; set; } public decimal amount_sales { get; set; }
/// <summary>
/// 产品销售额 人民币
/// </summary>
public decimal amount_sales_rmb
{
get
{
return amount_sales * seller_order_exchange_rate * quantity_shipped;
}
}
/// <summary> /// <summary>
......
...@@ -336,10 +336,10 @@ namespace Bailun.DC.WebApi.Controllers ...@@ -336,10 +336,10 @@ namespace Bailun.DC.WebApi.Controllers
/// <param name="financecategory"></param> /// <param name="financecategory"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("getPlatformTypeMonthlyStatistics")] [HttpGet("getPlatformTypeMonthlyStatistics")]
public CommonApiResponseDto<List<PlatformTypeMonthlyStatisticsDto>> GetPlatformTypeMonthlyStatistics(string month, string financecategory) public CommonApiResponseDto<List<PlatformTypeMonthlyStatisticsDto>> GetPlatformTypeMonthlyStatistics(string month, string financecategory,string isCost)
{ {
var result = new CommonApiResponseDto<List<PlatformTypeMonthlyStatisticsDto>> { Data = new List<PlatformTypeMonthlyStatisticsDto>()}; var result = new CommonApiResponseDto<List<PlatformTypeMonthlyStatisticsDto>> { Data = new List<PlatformTypeMonthlyStatisticsDto>()};
result.Data = new FinanceService().GetPlatformTypeMonthlyStatistics(month, financecategory); result.Data = new FinanceService().GetMonthSalesProfiOrderSummary(month, financecategory,isCost);
return result; return result;
} }
...@@ -364,11 +364,11 @@ namespace Bailun.DC.WebApi.Controllers ...@@ -364,11 +364,11 @@ namespace Bailun.DC.WebApi.Controllers
{ {
input.IsPages = false; input.IsPages = false;
var dataList = new FinanceService().GetMonthProfitOrderDetailPage(input).Data.Items; var dataList = new FinanceService().GetMonthProfitOrderDetailPage(input).Data.Items;
var colNames = new List<string> {"财务分类","平台类型","订单号", "SKU", "销售额","发货量","发货时间","创建时间"}; var colNames = new List<string> {"财务分类","平台类型","订单号", "SKU", "销售额(原币)", "销售额RMB", "汇率", "发货量","发货时间","创建时间"};
var list = new List<string>(); var list = new List<string>();
foreach (var item in dataList) foreach (var item in dataList)
{ {
list.Add($"{item.financecategoryname}|{item.platform_type}|{item.origin_order_id}|{item.bailun_sku}|{item.amount_sales}|{item.quantity_shipped}|{item.shipping_time.ToString("yyyy-MM-dd HH:mm:ss")}|{item.createtime.ToString("yyyy-MM-dd HH:mm:ss")}"); list.Add($"{item.financecategoryname}|{item.platform_type}|{item.origin_order_id}|{item.bailun_sku}|{item.amount_sales}|{item.amount_sales_rmb}|{item.seller_order_exchange_rate}|{item.quantity_shipped}|{item.shipping_time.ToString("yyyy-MM-dd HH:mm:ss")}|{item.createtime.ToString("yyyy-MM-dd HH:mm:ss")}");
} }
var guid = Guid.NewGuid().ToString(); var guid = Guid.NewGuid().ToString();
var filepath = _hostingEnvironment.WebRootPath + "\\Files\\Report\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\"; var filepath = _hostingEnvironment.WebRootPath + "\\Files\\Report\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\";
...@@ -508,7 +508,7 @@ namespace Bailun.DC.WebApi.Controllers ...@@ -508,7 +508,7 @@ namespace Bailun.DC.WebApi.Controllers
return File(ms, "text/csv", $"{input.Month}_月销售费用合计》费用利润表明细.csv"); return File(ms, "text/csv", $"{input.Month}_月销售费用合计》费用利润表明细.csv");
} }
[HttpGet("getReFundTest")] [HttpGet("syncMonthSalesProfit")]
public object GetReFundTest(DateTime time) public object GetReFundTest(DateTime time)
{ {
return new FinanceService().SyncMonthSalesProfit(time); return new FinanceService().SyncMonthSalesProfit(time);
...@@ -516,6 +516,10 @@ namespace Bailun.DC.WebApi.Controllers ...@@ -516,6 +516,10 @@ namespace Bailun.DC.WebApi.Controllers
//var data = Dapper.SimpleCRUD.Query<dc_month_sales_profit_orderdetail>(sql, null, Common.GlobalConfig.ConnectionString).FirstOrDefault(); //var data = Dapper.SimpleCRUD.Query<dc_month_sales_profit_orderdetail>(sql, null, Common.GlobalConfig.ConnectionString).FirstOrDefault();
//return data; //return data;
} }
[HttpGet("syncMonthSalesProfiOrderDetail")]
public object SyncMonthSalesProfiOrderDetail(DateTime date)
=>new FinanceService().SyncMonthSalesProfiOrderDetail(date);
#endregion #endregion
} }
} }
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