Commit ca1dbd70 by zhouminghui

fix

parent 63179558
......@@ -564,6 +564,7 @@ SUM(t1.amount_sales * t1.seller_order_exchange_rate * t1.quantity_shipped) AS to
return sqlText.ToString();
}
public bool UpdateMonthSalseProfit(UpdateMonthSalseProfitInput input, int userId, string userName)
{
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
......@@ -964,6 +965,11 @@ AND s2.datacenter_col like '%{input.FeeName}' ";
}
return new CommonApiResponseDto<PageResult<List<MonthReFundDto>>> { Data = result };
}
public List<MonthReFundDto> ExportMonthProfitFeeReFundDetail(GetMonthProfitPlatformDetailInput input)
{
var sql = BuildMonthProfitFeeReFundDetailSql(input, out DynamicParameters param, false, false);
return SimpleCRUD.Query<MonthReFundDto>(sql, param, GlobalConfig.ConnectionString).ToList();
}
/// <summary>
/// 根据平台汇总
/// </summary>
......
......@@ -472,6 +472,32 @@ namespace Bailun.DC.WebApi.Controllers
[HttpPost("getMonthProfitFeeReFundDetail")]
public CommonApiResponseDto<PageResult<List<MonthReFundDto>>> GetMonthProfitFeeReFundDetail(GetMonthProfitPlatformDetailInput input)
=> new FinanceService().GetMonthProfitFeeReFundDetail(input);
/// <summary>
/// 导出退款明细
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("exportMonthProfitFeeReFundDetail")]
public ActionResult ExportMonthProfitFeeReFundDetail(GetMonthProfitPlatformDetailInput input)
{
var dataList = new FinanceService().ExportMonthProfitFeeReFundDetail(input);
var colNames = new List<string> { "平台", "订单号", "站点", "卖家账号", "退款金额", "退款USD", "退款时间" };
var list = new List<string>();
foreach (var item in dataList)
{
list.Add($"{item.PlatformType}|{item.OriginOrderId}|{item.WebSite}|{item.BailunAccount}|{item.RefundRmb}|{item.RefundUsd}|{item.RefundTime}");
}
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");
}
/// <summary>
/// 按平台汇总退款信息
......
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