Commit 8a6107fd by guanzhenshan

完成管理成本的发生额计算

parent 3267da18
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="FeeUrl" value="http://api.fee.bailuntec.com/purchase/other/cost/api/manageCostList" />
<add key="cwUrl" value="http://cw.bailuntec.com/api/api/GetRepayPlanDetails"/>
</appSettings>
</configuration>
\ No newline at end of file
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Bailun.DC.Common\Bailun.DC.Common.csproj" /> <ProjectReference Include="..\Bailun.DC.Common\Bailun.DC.Common.csproj" />
<ProjectReference Include="..\Bailun.DC.Models\Bailun.DC.Models.csproj" /> <ProjectReference Include="..\Bailun.DC.Models\Bailun.DC.Models.csproj" />
<ProjectReference Include="..\Bailun.DC.Services\Bailun.DC.Services.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using Bailun.DC.Models;
using System.Linq;
namespace Bailun.DC.HappenAmount namespace Bailun.DC.HappenAmount
{ {
...@@ -9,7 +11,86 @@ namespace Bailun.DC.HappenAmount ...@@ -9,7 +11,86 @@ namespace Bailun.DC.HappenAmount
public void Init(DateTime start,DateTime end) public void Init(DateTime start,DateTime end)
{ {
var m = new dc_daily_happen_amount() {
day = DateTime.Parse(start.ToShortDateString()),
ac_amount_happen = 0,
ac_amount_pay = 0,
ac_amount_sales = 0,
hl_amount_happen = 0,
hl_amount_pay = 0,
hl_amount_sales = 0,
ss_amount_happen = 0,
ss_amount_pay = 0,
ss_amount_sales = 0,
tl_amount_happen = 0,
tl_amount_pay = 0,
tl_amount_sales=0,
tos_amount_happen = 0,
tos_amount_pay = 0,
tos_amount_sales = 0,
createtime = DateTime.Now,
};
var sqlpay = "";
var sqlhappen = "";
var sqlsales = "";
#region 管理成本
var url = "http://api.fee.bailuntec.com/purchase/other/cost/api/manageCostList?o=0";
var cwurl = "http://cw.bailuntec.com/api/api/GetRepayPlanDetails?";
url += "&startDate=" + start.ToString("yyyy-MM-dd") + "&endDate=" + end.ToString("yyyy-MM-dd");
cwurl += "BeginRepayTime=" + start.ToString("yyyy-MM-dd") + "&EndRepayTime=" + end.ToString("yyyy-MM-dd");
//利息支出
var listInterest = new Bailun.DC.Services.FinanceReportServices().ListInterestExpense(cwurl);
//管理成本
var list = new Bailun.DC.Services.FinanceReportServices().ListOtherCost(url);
var listFeeType = new List<string> { "推广费", "税费", "平台费用", "服务费", "其他" };
if (list.Count > 0)
{
m.hl_amount_pay += list.Sum(a => a.amountRmb);
m.hl_amount_happen += list.Sum(a => a.amountRmb);
var objtemp = list.Where(a => a.companyValue == 5 || a.companyValue == 2).Where(b => listFeeType.Contains(b.feeSuperType));
if (objtemp.Count() > 0)
{
m.hl_amount_sales = objtemp.Sum(a => a.amountRmb);
}
}
if (listInterest.Count > 0)
{
m.hl_amount_pay += listInterest.Sum(a => a.RepayInterestRMB);
m.hl_amount_happen += listInterest.Sum(a => a.RepayInterestRMB);
}
#endregion
#region 头程物流
#endregion
//尾程物流
//一级供应商
//二级供应商
} }
} }
......
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models
{
/// <summary>
/// 每日发生额
/// </summary>
public class dc_daily_happen_amount
{
/// <summary>
///
/// </summary>
public int id { get; set; }
/// <summary>
/// 统计日期
/// </summary>
public DateTime day { get; set; }
/// <summary>
/// 管理成本付款额
/// </summary>
public decimal ac_amount_pay { get; set; }
/// <summary>
/// 管理成本发生额
/// </summary>
public decimal ac_amount_happen { get; set; }
/// <summary>
/// 管理成本销售额
/// </summary>
public decimal ac_amount_sales { get; set; }
/// <summary>
/// 头程物流付款额
/// </summary>
public decimal hl_amount_pay { get; set; }
/// <summary>
/// 头程物流发生额
/// </summary>
public decimal hl_amount_happen { get; set; }
/// <summary>
/// 头程物流销售额
/// </summary>
public decimal hl_amount_sales { get; set; }
/// <summary>
/// 尾程物流付款额
/// </summary>
public decimal tl_amount_pay { get; set; }
/// <summary>
/// 尾程物流发生额
/// </summary>
public decimal tl_amount_happen { get; set; }
/// <summary>
/// 尾程物流销售额
/// </summary>
public decimal tl_amount_sales { get; set; }
/// <summary>
/// 一级供应商付款额
/// </summary>
public decimal tos_amount_pay { get; set; }
/// <summary>
/// 一级供应商发生额
/// </summary>
public decimal tos_amount_happen { get; set; }
/// <summary>
/// 一级供应商销售额
/// </summary>
public decimal tos_amount_sales { get; set; }
/// <summary>
/// 二级供应商付款额
/// </summary>
public decimal ss_amount_pay { get; set; }
/// <summary>
/// 二级供应商发生额
/// </summary>
public decimal ss_amount_happen { get; set; }
/// <summary>
/// 二级供应商销售额
/// </summary>
public decimal ss_amount_sales { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime createtime { get; set; }
}
}
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