Commit 2321eccb by guanzhenshan

每日发生额调整尾程费算法

parent 9078e2ac
...@@ -22,13 +22,13 @@ namespace Bailun.DC.HappenAmount ...@@ -22,13 +22,13 @@ namespace Bailun.DC.HappenAmount
//static void Main(string[] args) //static void Main(string[] args)
//{ //{
// //var start = DateTime.Parse("2019-12-17"); // var start = DateTime.Parse("2019-12-01");
// //while (start.AddDays(3) < DateTime.Now) // while (start.AddDays(1) < DateTime.Now)
// //{ // {
// // new Services().Init(start, start.AddDays(1)); // new Services().Init(start, start.AddDays(1));
// // //new Bailun.DC.Services.FinanceReportServices().AddLogisticsWaitPay(start, 0); // //new Bailun.DC.Services.FinanceReportServices().AddLogisticsWaitPay(start, 0);
// // start = start.AddDays(1); // start = start.AddDays(1);
// //} // }
// //new Bailun.DC.Services.FinanceReportServices().UpdateLogisticsWaitPay(start, 0, "admin", null); // //new Bailun.DC.Services.FinanceReportServices().UpdateLogisticsWaitPay(start, 0, "admin", null);
......
...@@ -180,12 +180,12 @@ namespace Bailun.DC.HappenAmount ...@@ -180,12 +180,12 @@ namespace Bailun.DC.HappenAmount
//发生额 //发生额
sqlhappen = $@"select sum(t2.cost_tail*t1.quantity_shipped) from dc_base_oms_pick t1 sqlhappen = $@"select sum(t2.cost_tail*t1.quantity_shipped) from dc_base_oms_pick t1
join dc_base_oms_sku t2 on t1.bailun_sku = t2.bailun_sku and t1.origin_order_id = t2.origin_order_id and t2.bailun_order_status != 'Canceled' and t2.has_scalp = 0 and t2.has_delete = 0 and t2.has_innersale = 0 and t2.company_id = 1 and t2.cost_tail > 0 join dc_base_oms_sku t2 on t1.bailun_sku = t2.bailun_sku and t1.origin_order_id = t2.origin_order_id and t2.bailun_order_status != 'Canceled' and t2.has_scalp = 0 and t2.has_delete = 0 and t2.has_innersale = 0 and t2.company_id = 1 and t2.cost_tail > 0 and t2.bailun_account_id!=1690
where t1.shipping_time >= '{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.shipping_time < '{end.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.has_delete = 0 and t1.company_id = 1 and t1.shipping_status = 'TotalShipping'"; where t1.shipping_time >= '{start.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.shipping_time < '{end.ToString("yyyy-MM-dd HH:mm:ss")}' and t1.has_delete = 0 and t1.company_id = 1 and t1.shipping_status = 'TotalShipping'";
m.tl_amount_happen += cn.QueryFirstOrDefault<decimal?>(sqlhappen,null,null,2*60)??0; m.tl_amount_happen += cn.QueryFirstOrDefault<decimal?>(sqlhappen,null,null,2*60)??0;
//销售额 //销售额
sqlsales = $"select sum(cost_logistics*bailun_sku_quantity_ordered) from dc_base_oms_sku t1 where paid_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and paid_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and bailun_order_status!='Canceled' and has_scalp=0 and has_delete=0 and has_innersale=0 and company_id=1 and cost_logistics>0"; sqlsales = $"select sum(cost_logistics*bailun_sku_quantity_ordered) from dc_base_oms_sku t1 where paid_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and paid_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and bailun_order_status!='Canceled' and has_scalp=0 and has_delete=0 and has_innersale=0 and company_id=1 and cost_logistics>0 and t1.bailun_account_id!=1690";
m.tl_amount_sales += cn.QueryFirstOrDefault<decimal?>(sqlsales, null, null, 2 * 60)??0; m.tl_amount_sales += cn.QueryFirstOrDefault<decimal?>(sqlsales, null, null, 2 * 60)??0;
#endregion #endregion
......
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