Commit 31d79246 by guanzhenshan
parents 512e36b5 f676c5d8
......@@ -9,11 +9,11 @@ namespace Bailun.DC.Models.Dtos.Finance
/// <summary>
/// 金额
/// </summary>
public decimal Amount { get; set; }
public decimal? Amount { get; set; }
/// <summary>
/// 人民币
/// </summary>
public decimal AmountRmb { get; set; }
public decimal? AmountRmb { get; set; }
/// <summary>
/// 公司
/// </summary>
......@@ -42,6 +42,7 @@ namespace Bailun.DC.Models.Dtos.Finance
/// 付款时间
/// </summary>
public string PayTime { get; set; }
public DateTime? pay_time { get; set; }
/// <summary>
/// 费用类型
/// </summary>
......@@ -51,5 +52,13 @@ namespace Bailun.DC.Models.Dtos.Finance
/// </summary>
public string Accounting { get; set; }
public string CostReason { get; set; }
public string CostRemark { get; set; }
public int cost_form { get; set; }
public int? is_lend { get; set; }
public int? lend_balance { get; set; }
}
}
using Bailun.DC.Models.Common.Page;
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.WebApiModels
{
public class GetMonthProfitPlatformDetailInput : PageRequest
{
public string Month { get; set; }
public string FeeName { get; set; }
public string PlatformType { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.WebApiModels
{
public class MonthPlatformProfitDto
{
public string PlatForm { get; set; }
public string WebSite { get; set; }
public string Orderno { get; set; }
public string DataTime { get; set; }
public string AmountVal { get; set; }
public string FeeType { get; set; }
public string Subjectcode { get; set; }
public string ProjectCode { get; set; }
public string FinanceCategory { get; set; }
public string DatacenterCol { get; set; }
public string Currency { get; set; }
public string ExchangeRate { get; set; }
public string AmountValRmb { get; set; }
public string Month { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models.WebApiModels
{
public class MonthReFundDto
{
public string PlatformType { get; set; }
public string BailunAccount { get; set; }
public string WebSite { get; set; }
public string OriginOrderId { get; set; }
public string RefundRmb { get; set; }
public string RefundUsd { get; set; }
public string RefundTime { get; set; }
}
public class MonthReFundSummary
{
public string Platform { get; set; }
public decimal? RefundRmb { get; set; }
public decimal? RefundUsd { get; set; }
public int? Totals { get; set; }
}
}
using Bailun.DC.Models.Common;
using Bailun.DC.Models;
using Bailun.DC.Models.Common;
using Bailun.DC.Models.Common.Page;
using Bailun.DC.Models.Dtos.Finance;
using Bailun.DC.Models.WebApiModels;
using Bailun.DC.Services.WebApiService;
......@@ -392,6 +394,105 @@ namespace Bailun.DC.WebApi.Controllers
return new CommonApiResponseDto<string>() { IsSuccess = false, Data = e.Message };
}
}
/// <summary>
/// 月销售利润表获取管理成本明细
/// </summary>
/// <param name="month"></param>
/// <param name="feeName"></param>
/// <returns></returns>
[HttpGet("getMonthProfitFeeManagementCostDetail")]
public CommonApiResponseDto<List<FinanceDetailsDto>> GetMonthProfitFeeManagementCostDetail(string month,string feeName)
=> new FinanceService().GetMonthProfitFeeManagementCostDetail(month, feeName);
/// <summary>
/// 月销售利润平台费用明细
/// </summary>
/// <param name="month"></param>
/// <param name="feeName"></param>
/// <returns></returns>
[HttpPost("getMonthProfitFeePlatformFeeDetail")]
public CommonApiResponseDto<PageResult<List<MonthPlatformProfitDto>>> GetMonthProfitFeePlatformFeeDetail(GetMonthProfitPlatformDetailInput input)
=> new FinanceService().GetMonthProfitFeePlatformFeeDetail(input);
/// <summary>
/// 导出月销售利润平台费用明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("exportMonthProfitFeePlatformFeeDetail")]
public ActionResult ExportMonthProfitFeePlatformFeeDetail(GetMonthProfitPlatformDetailInput input)
{
var dataList = new FinanceService().ExportMonthProfitFeePlatformFeeDetail(input);
var colNames = new List<string> { "平台", "站点", "账单时间", "单号", "币种", "原币金额", "汇率", "RMB金额", "费用字段说明", "财务分类归集说明", "数据中心费用类型", "会计科目编码"
, "项目编码" };
var list = new List<string>();
foreach (var item in dataList)
{
list.Add($@"{item.PlatForm}|{item.WebSite}|{item.DataTime}|{item.Orderno}|
{item.Currency}|{item.AmountVal}|{item.ExchangeRate}|{item.AmountValRmb}{item.FeeType}|
{item.FinanceCategory}|{item.DatacenterCol}|{item.Subjectcode}|{item.ProjectCode}");
}
var guid = Guid.NewGuid().ToString();
var filepath = _hostingEnvironment.WebRootPath + "\\Files\\Report\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\";
ToCSV(list, colNames, guid, filepath);
var ms = new System.IO.MemoryStream();
using (var f = new System.IO.FileStream(filepath + guid + ".csv", System.IO.FileMode.Open))
{
f.CopyTo(ms);
}
ms.Position = 0;
return File(ms, "text/csv", $"{input.Month}_{input.FeeName}月销售利润表明细.csv");
}
/// <summary>
/// 退款明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("getMonthProfitFeeReFundDetail")]
public CommonApiResponseDto<PageResult<List<MonthReFundDto>>> GetMonthProfitFeeReFundDetail(GetMonthProfitPlatformDetailInput input)
=> new FinanceService().GetMonthProfitFeeReFundDetail(input);
/// <summary>
/// 按平台汇总退款信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("getMonthProfitPlatformPlatformSummary")]
public CommonApiResponseDto<List<MonthReFundSummary>> GetMonthProfitPlatformPlatformSummary(GetMonthProfitPlatformDetailInput input)
=> new FinanceService().GetMonthProfitPlatformPlatformSummary(input);
/// <summary>
/// 销售费用合计》销售利润
/// </summary>
/// <param name="month"></param>
/// <returns></returns>
[HttpPost("getMonthSalesProfitDetail")]
public object GetMonthSalesProfitDetail(MonthProfitOrderDetailPageInputDto input)
=> new FinanceService().GetMonthSalesProfitDetail(input);
/// <summary>
/// 导出销售费用合计》销售利润
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("exportMonthSalesProfitDetail")]
public ActionResult ExportMonthSalesProfitDetail(MonthProfitOrderDetailPageInputDto input)
{
var dataList = new FinanceService().GetMonthSalesProfitDetail(input,false);
var colNames = new List<string> { "财务分类", "平台类型", "订单号", "SKU", "销售利润", "发货量", "发货时间", "创建时间"};
var list = new List<string>();
foreach (var item in dataList.Data.Data)
{
list.Add($@"{item.financecategoryname}|{item.platform_type}|{item.origin_order_id}|{item.bailun_sku}|
{item.sale_profit}|{item.quantity_shipped}|{item.shipping_time}|{item.createtime}");
}
var guid = Guid.NewGuid().ToString();
var filepath = _hostingEnvironment.WebRootPath + "\\Files\\Report\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\";
ToCSV(list, colNames, guid, filepath);
var ms = new System.IO.MemoryStream();
using (var f = new System.IO.FileStream(filepath + guid + ".csv", System.IO.FileMode.Open))
{
f.CopyTo(ms);
}
ms.Position = 0;
return File(ms, "text/csv", $"{input.Month}_月销售费用合计》费用利润表明细.csv");
}
#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