Commit aedfc7a7 by DESKTOP-732ATD8\BLT

增加功能:取数规则增加冲回金额配置

parent ff7de170
......@@ -26,4 +26,11 @@
/// </summary>
public decimal total_order { get; set; }
}
public class ReversalDto
{
public string platform { get; set; }
public string website { get; set; }
}
}
......@@ -846,13 +846,9 @@ or (is_lend=2 and cost_form=1)) and pay_time>= @start and pay_time< @end ");
}
public List<PlatformTypeMonthlyStatisticsDto> GetGetMonthProfitFeePlatformFeeSummary(GetMonthProfitPlatformDetailInput input)
{
//var redis = RedisHelper.GetList<PlatformTypeMonthlyStatisticsDto>($"{input.FeeName}_{input.Month.Replace("月份", "")}");
//if (redis.Count > 0)
//{
// return redis;
//}
var sql = BuildMonthProfitFeePlatformFeeDetailSql(input, out DynamicParameters param, false, true);
var data = SimpleCRUD.Query<PlatformTypeMonthlyStatisticsDto>(sql, param, GlobalConfig.ConnectionString_DW).ToList();
List<ReversalDto> listReversal = SimpleCRUD.Query<ReversalDto>("SELECT DISTINCT platform, website FROM order_fee_config WHERE is_reversal = 1;", null, GlobalConfig.ConnectionString_DW).ToList();
if (input.FeeName.Contains("仓储费-平台"))
{
data = data.Select(x =>
......@@ -893,21 +889,14 @@ or (is_lend=2 and cost_form=1)) and pay_time>= @start and pay_time< @end ");
{
data.Remove(data.Where(x => x.platform_type == "亚马逊" && x.website.ToLower() == "mx" && x.original_amount < 0).FirstOrDefault());
}
data = data.Select(x =>
if (listReversal?.Count > 0 && data?.Count > 0)
{
if (x.platform_type.Contains("万邑通") || x.platform_type.Contains("速卖通"))
listReversal.ForEach(l =>
{
x.original_amount = Math.Abs(x.original_amount);
x.total_amount_sales = Math.Abs(x.total_amount_sales);
}
if (x.platform_type.Contains("易可达") && x.website.Contains("其他收入"))
{
x.original_amount = Math.Abs(x.original_amount) * -1;
x.total_amount_sales = Math.Abs(x.total_amount_sales) * -1;
data.ForEach(x => { if (l.platform == x.platform_type && l.website == x.website) { x.original_amount = 0 - x.original_amount; x.total_amount_sales = 0 - x.total_amount_sales; } });
});
}
return x;
}).ToList();
//RedisHelper.Add<List<PlatformTypeMonthlyStatisticsDto>>($"{input.FeeName}_{input.Month.Replace("月份", "")}", data, new TimeSpan(1, 0, 0, 0));
return data;
}
/// <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