Commit f6173c37 by guanzhenshan

1

parent 4633323c
...@@ -7,26 +7,26 @@ namespace Bailun.DC.MonthSaleProfit ...@@ -7,26 +7,26 @@ namespace Bailun.DC.MonthSaleProfit
{ {
class Program class Program
{ {
static async Task Main(string[] args) //static async Task Main(string[] args)
{
Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<Services>();
});
await builder.RunConsoleAsync();
}
//static void Main(string[] args)
//{ //{
// var _services = new Services(); // Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
// var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
// {
// services.AddHostedService<Services>();
// });
// var start = DateTime.Parse("2020-12-01"); // await builder.RunConsoleAsync();
// //_services.Init(start);
// _services.InitNew(start);
// //_services.InitNew4K(start);
// //_services.InitNew4K(start);
//} //}
static void Main(string[] args)
{
var _services = new Services();
var start = DateTime.Parse("2020-12-01");
//_services.Init(start);
_services.InitNew(start);
//_services.InitNew4K(start);
//_services.InitNew4K(start);
}
} }
} }
...@@ -477,6 +477,7 @@ namespace Bailun.DC.MonthSaleProfit ...@@ -477,6 +477,7 @@ namespace Bailun.DC.MonthSaleProfit
fee_refund = 0, fee_refund = 0,
fee_sales_count = 0, fee_sales_count = 0,
fee_storage = 0, fee_storage = 0,
fee_storage_incidentals=0,
cost_fuzhuang = 0, cost_fuzhuang = 0,
...@@ -621,13 +622,13 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code ...@@ -621,13 +622,13 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
var objLogistics = cn.Query<Models.mLogisticsFee>(sql,null,null,true,6*60).ToList(); var objLogistics = cn.Query<Models.mLogisticsFee>(sql,null,null,true,6*60).ToList();
//物流仓储费用 = 头程运输+直邮物流费(国内发货)+尾程物流费(国外发货)+海外仓仓储及其他费用 //物流仓储费用 = 头程运输+直邮物流费(国内发货)+尾程物流费(国外发货)+海外仓仓储+海外仓杂费
m.fee_logistics_first = objOrder.Sum(a => a.cost_first??0) + objFBA.Sum(a => a.cost_first??0); m.fee_logistics_first = objOrder.Sum(a => a.cost_first??0) + objFBA.Sum(a => a.cost_first??0);
m.fee_logistics_direct = objLogistics.Where(a => a.hq_type == "国内仓")?.Sum(b => b.cost_logistics) ?? 0; //objOrder.Sum(a => a.cost_logistics??0); m.fee_logistics_direct = objLogistics.Where(a => a.hq_type == "国内仓")?.Sum(b => b.cost_logistics) ?? 0; //objOrder.Sum(a => a.cost_logistics??0);
m.fee_logistics_tail = objLogistics.Where(a => a.hq_type != "国内仓")?.Sum(b => b.cost_logistics) ?? 0; m.fee_logistics_tail = objLogistics.Where(a => a.hq_type != "国内仓")?.Sum(b => b.cost_logistics) ?? 0;
m.fee_storage = objOrder.Sum(a => a.total_fee??0); m.fee_storage = objOrder.Sum(a => a.total_fee??0);
m.fee_logistics_storage = m.fee_logistics_first + m.fee_logistics_direct+m.fee_logistics_tail + m.fee_storage; m.fee_logistics_storage = m.fee_logistics_first + m.fee_logistics_direct+m.fee_logistics_tail + m.fee_storage+m.fee_storage_incidentals;
//付现销售费用 //付现销售费用
...@@ -688,8 +689,8 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code ...@@ -688,8 +689,8 @@ join dc_base_warehouse t3 on t1.warehouse_code=t3.warehouse_code
} }
cn.Execute("delete from dc_month_sales_profit where isedit=0 and month='" + m.month + "'"); cn.Execute("delete from dc_month_sales_profit where isedit=0 and month='" + m.month + "'");
sql = $@"insert dc_month_sales_profit (month,amount_sales,amount_sales_jingyou,amount_sales_dianzi,amount_sales_jiaju,amount_sales_meirongmj,amount_sales_fuzhuang,amount_sales_other,cost,cost_jingyou,cost_dianzi,cost_jiaju,cost_meirongmj,cost_fuzhuang,cost_other,fee_platform_and_refund,fee_platform,fee_fba,fee_refund,amount_withdraw,fee_logistics_storage,fee_logistics_first,fee_logistics_direct,fee_logistics_tail,fee_storage,fee_paycash_sales,fee_sales_count,profit_sales,rate_profit_sales,managecost_bl_xg,managecost_bl_gz,managecost_meijia,managercost_yangshan,managercost_chengpincang,managercost_xinhuilan,managercost_count,fee_finance,profit,rate_profit,incoming_other,incoming_non_operating,pay_non_operating,actual_profit,dividend,profit_balance,rate_profit_actual,createtime,lastupdateuserid,lastupdateusername,lastupdatetime,isedit,managercost_dizhi,managercost_meijiashengchan,fee_ad) values sql = $@"insert dc_month_sales_profit (month,amount_sales,amount_sales_jingyou,amount_sales_dianzi,amount_sales_jiaju,amount_sales_meirongmj,amount_sales_fuzhuang,amount_sales_other,cost,cost_jingyou,cost_dianzi,cost_jiaju,cost_meirongmj,cost_fuzhuang,cost_other,fee_platform_and_refund,fee_platform,fee_fba,fee_refund,amount_withdraw,fee_logistics_storage,fee_logistics_first,fee_logistics_direct,fee_logistics_tail,fee_storage,fee_paycash_sales,fee_sales_count,profit_sales,rate_profit_sales,managecost_bl_xg,managecost_bl_gz,managecost_meijia,managercost_yangshan,managercost_chengpincang,managercost_xinhuilan,managercost_count,fee_finance,profit,rate_profit,incoming_other,incoming_non_operating,pay_non_operating,actual_profit,dividend,profit_balance,rate_profit_actual,createtime,lastupdateuserid,lastupdateusername,lastupdatetime,isedit,managercost_dizhi,managercost_meijiashengchan,fee_ad,fee_storage_incidentals) values
('{m.month}',{m.amount_sales},{m.amount_sales_jingyou},{m.amount_sales_dianzi},{m.amount_sales_jiaju},{m.amount_sales_meirongmj},{m.amount_sales_fuzhuang},{m.amount_sales_other},{m.cost},{m.cost_jingyou},{m.cost_dianzi},{m.cost_jiaju},{m.cost_meirongmj},{m.cost_fuzhuang},{m.cost_other},{m.fee_platform_and_refund},{m.fee_platform},{m.fee_fba},{m.fee_refund},{m.amount_withdraw},{m.fee_logistics_storage},{m.fee_logistics_first},{m.fee_logistics_direct},{m.fee_logistics_tail},{m.fee_storage},{m.fee_paycash_sales},{m.fee_sales_count},{m.profit_sales},{m.rate_profit_sales},{m.managecost_bl_xg},{m.managecost_bl_gz},{m.managecost_meijia},{m.managercost_yangshan},{m.managercost_chengpincang},{m.managercost_xinhuilan},{m.managercost_count},{m.fee_finance},{m.profit},{m.rate_profit},{m.incoming_other},{m.incoming_non_operating},{m.pay_non_operating},{m.actual_profit},{m.dividend},{m.profit_balance},{m.rate_profit_actual},'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',{m.lastupdateuserid},'{m.lastupdateusername}','{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',0,{m.managercost_dizhi},{m.managercost_meijiashengchan},{m.fee_ad})"; ('{m.month}',{m.amount_sales},{m.amount_sales_jingyou},{m.amount_sales_dianzi},{m.amount_sales_jiaju},{m.amount_sales_meirongmj},{m.amount_sales_fuzhuang},{m.amount_sales_other},{m.cost},{m.cost_jingyou},{m.cost_dianzi},{m.cost_jiaju},{m.cost_meirongmj},{m.cost_fuzhuang},{m.cost_other},{m.fee_platform_and_refund},{m.fee_platform},{m.fee_fba},{m.fee_refund},{m.amount_withdraw},{m.fee_logistics_storage},{m.fee_logistics_first},{m.fee_logistics_direct},{m.fee_logistics_tail},{m.fee_storage},{m.fee_paycash_sales},{m.fee_sales_count},{m.profit_sales},{m.rate_profit_sales},{m.managecost_bl_xg},{m.managecost_bl_gz},{m.managecost_meijia},{m.managercost_yangshan},{m.managercost_chengpincang},{m.managercost_xinhuilan},{m.managercost_count},{m.fee_finance},{m.profit},{m.rate_profit},{m.incoming_other},{m.incoming_non_operating},{m.pay_non_operating},{m.actual_profit},{m.dividend},{m.profit_balance},{m.rate_profit_actual},'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',{m.lastupdateuserid},'{m.lastupdateusername}','{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',0,{m.managercost_dizhi},{m.managercost_meijiashengchan},{m.fee_ad},{m.fee_storage_incidentals})";
cn.Execute(sql); cn.Execute(sql);
} }
......
...@@ -1618,12 +1618,12 @@ namespace Bailun.DC.Services ...@@ -1618,12 +1618,12 @@ namespace Bailun.DC.Services
if (createstart.HasValue) if (createstart.HasValue)
{ {
sql += " and tb.create_time>=@createstart"; sql += " and tb.purchase_create_time>=@createstart";
sqlparam.Add("createstart", createstart.Value); sqlparam.Add("createstart", createstart.Value);
} }
if (createend.HasValue) if (createend.HasValue)
{ {
sql += " and tb.create_time<@createend"; sql += " and tb.purchase_create_time<@createend";
sqlparam.Add("createend", createend.Value.AddDays(1)); sqlparam.Add("createend", createend.Value.AddDays(1));
} }
......
...@@ -11,23 +11,23 @@ namespace Bailun.DC.SyncSkuFinanceCategory ...@@ -11,23 +11,23 @@ namespace Bailun.DC.SyncSkuFinanceCategory
/// 同步sku财务分类 /// 同步sku财务分类
/// </summary> /// </summary>
/// <param name="args"></param> /// <param name="args"></param>
static async Task Main(string[] args) //static async Task Main(string[] args)
{ //{
Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); // Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var builder = new HostBuilder().ConfigureServices((hostContext, services) => // var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{ // {
services.AddHostedService<Services>(); // services.AddHostedService<Services>();
}); // });
await builder.RunConsoleAsync(); // await builder.RunConsoleAsync();
} //}
//static void Main(string[] args) static void Main(string[] args)
//{ {
// //Console.WriteLine("Hello World!"); //Console.WriteLine("Hello World!");
// new Services().Init(); new Services().Init();
//} }
} }
} }
...@@ -8676,7 +8676,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -8676,7 +8676,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
listHead.Add(new Tuple<string, string, int>("销售利润", "profit_sales", 0)); listHead.Add(new Tuple<string, string, int>("销售利润", "profit_sales", 0));
listHead.Add(new Tuple<string, string, int>("销售毛利率", "rate_profit_sales", 0)); listHead.Add(new Tuple<string, string, int>("销售毛利率", "rate_profit_sales", 0));
listHead.Add(new Tuple<string, string, int>("财务费用", "fee_finance", 1)); listHead.Add(new Tuple<string, string, int>("财务费用", "fee_finance", 0));
listHead.Add(new Tuple<string, string, int>("管理成本合计", "managercost_count", 1)); listHead.Add(new Tuple<string, string, int>("管理成本合计", "managercost_count", 1));
//listHead.Add(new Tuple<string, string, int>("香港百伦科技有限公司", "managecost_bl_xg", 0)); //listHead.Add(new Tuple<string, string, int>("香港百伦科技有限公司", "managecost_bl_xg", 0));
listHead.Add(new Tuple<string, string, int>("广州百伦供应链科技有限公司", "managecost_bl_gz", 0)); listHead.Add(new Tuple<string, string, int>("广州百伦供应链科技有限公司", "managecost_bl_gz", 0));
......
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