Commit 2569ea7a by zhouminghui

fix

parent 8c16fa2e
......@@ -10,7 +10,7 @@ namespace Bailun.DC.Models.WebApiModels
public string WebSite { get; set; }
public string Orderno { get; set; }
public string DataTime { get; set; }
public string AmountVal { get; set; }
public decimal? AmountVal { get; set; }
public string FeeType { get; set; }
public string Subjectcode { get; set; }
......
......@@ -739,7 +739,6 @@ SUM(t1.amount_sales * t1.seller_order_exchange_rate * t1.quantity_shipped) AS to
item.Amount = -(item.Amount);
item.AmountRmb = -(item.AmountRmb);
}
}
}
data.Select(x =>
......@@ -827,6 +826,15 @@ or (is_lend=2 and cost_form=1)) and pay_time>= @start and pay_time< @end ");
int total = 0;
var obj = cn.Page<MonthPlatformProfitDto>(input.PageIndex, input.PageNumber, sql, ref total, param);
var data = obj.ToList();
data = data.Select(x =>
{
if (x.PlatForm.Contains("万邑通"))
{
x.AmountVal = Math.Abs(x.AmountVal.Value);
x.AmountValRmb = Math.Abs(x.AmountValRmb.Value);
}
return x;
}).ToList();
//if (data.Count > 0)
//{
// var sumSql = BuildMonthProfitFeePlatformFeeDetailSql(input, out DynamicParameters paramSum, false, true);
......@@ -853,6 +861,15 @@ or (is_lend=2 and cost_form=1)) and pay_time>= @start and pay_time< @end ");
//}
var sql = BuildMonthProfitFeePlatformFeeDetailSql(input, out DynamicParameters param, false, true);
var data = SimpleCRUD.Query<PlatformTypeMonthlyStatisticsDto>(sql, param, GlobalConfig.ConnectionString_DW).ToList();
data = data.Select(x =>
{
if (x.platform_type.Contains("万邑通"))
{
x.original_amount = Math.Abs(x.original_amount);
x.total_amount_sales = Math.Abs(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;
}
......@@ -938,6 +955,15 @@ ON s2.id = s1.order_fee_config_id WHERE s1.month = @month ");
{
var sql = BuildMonthProfitFeePlatformFeeDetailSql(input, out DynamicParameters parameters, false, false);
var data = SimpleCRUD.Query<MonthPlatformProfitDto>(sql, parameters, GlobalConfig.ConnectionString_DW).ToList();
data = data.Select(x =>
{
if (x.PlatForm.Contains("万邑通"))
{
x.AmountVal = Math.Abs(x.AmountVal.Value);
x.AmountValRmb = Math.Abs(x.AmountValRmb.Value);
}
return x;
}).ToList();
return data;
}
public decimal SyncMonthProfitFeePlatformFeeSummary(GetMonthProfitPlatformDetailInput input)
......@@ -1249,11 +1275,11 @@ AND financecategoryname LIKE '{financecategory.Replace("产品", "")}%' ";
// .Where(m => m.AmountValRmb != null).Sum(x => x.AmountValRmb.Value), 2)) * (-1);
//其中:歌戈儿收入
var operating = GetMonthProfitFeeManagementCostDetail(time, "其中:歌戈儿收入").Data;
oldData.incoming_gogirl = Math.Round(operating.Count == 0 ? 0 : operating.Last().AmountRmb.Value, 2);
oldData.incoming_gogirl = Math.Abs(Math.Round(operating.Count == 0 ? 0 : operating.Last().AmountRmb.Value, 2));
//其中:其他收入
var among_other = GetMonthProfitFeeManagementCostDetail(time, "其中:其他收入").Data;
oldData.among_other_income = Math.Round(among_other.Count == 0 ? 0 : among_other.Last().AmountRmb.Value, 2);
oldData.among_other_income = Math.Abs(Math.Round(among_other.Count == 0 ? 0 : among_other.Last().AmountRmb.Value, 2));
//管理成本
var bl_xg = GetMonthProfitFeeManagementCostDetail(time, "香港百伦科技有限公司").Data;
var bl_gz = GetMonthProfitFeeManagementCostDetail(time, "广州百伦供应链科技有限公司").Data;
......@@ -1298,6 +1324,8 @@ AND financecategoryname LIKE '{financecategory.Replace("产品", "")}%' ";
oldData.actual_profit = Math.Round(oldData.profit + Math.Abs(oldData.incoming_other) + Math.Abs(oldData.incoming_non_operating) + Math.Abs(oldData.pay_non_operating), 2);
//净利润》实际利润/总销售额
oldData.rate_profit_actual = Math.Round(oldData.actual_profit / Math.Abs(oldData.amount_sales), 2);
//财务费用
oldData.fee_finance = Math.Abs(oldData.fee_finance * (-1));
//保存
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
......
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