Commit 44012ca5 by guanzhenshan

解决数据仓无法根据sku去搜索的问题

parent c5854c1f
...@@ -2217,6 +2217,107 @@ namespace Bailun.DC.Services ...@@ -2217,6 +2217,107 @@ namespace Bailun.DC.Services
} }
} }
public string Analyze_PaypalIncoming(string account, DateTime start, DateTime end)
{
/*
-- paypal 分录
select type from dc_base_income_ebay_paypal
group by type;
--1、预收款 'eBay竞拍付款','移动支付','普通付款'
select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and balance_impact = '贷记' and account_name = 'aublzhao18@126.com' and type in ('eBay竞拍付款', '移动支付', '普通付款') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--2、临时冻结 '冻结余额以调查争议'
select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('冻结余额以调查争议') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--付款撤销
select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('付款撤销') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--退单
select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('退单') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--退单撤销
select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('退单撤销') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--3、争议补偿
select currency,sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('取消冻结以解决争议') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--4、已发放退款
select currency,sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('付款退款') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--5、在线发送的付款
-- 已付款项
select currency,sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('普通付款') and record_time>= '2019-08-01' and record_time<'2019-09-01' and gross<0 and balance_impact = '借记'
group by currency
;
--第三方偿付
select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('第三方偿付') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
-- 集中付款 分正数和负数,如果是正数则是其他帐号转进来的,如果是负数则是本帐号转出的
select currency,sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('集中付款') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--快速结账付款
select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('快速结账付款') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--费用
select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('费用') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--6、转账和提现
-- 币种兑换
select currency,sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('普通币种兑换') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('用户发起的币种兑换') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
--提现
select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and account_name = 'aublzhao18@126.com' and type in ('普通提现') and record_time>= '2019-08-01' and record_time<'2019-09-01'
group by currency
;
*/
var sql = "";
// 1、预收款 'eBay竞拍付款','移动支付','普通付款'
sql = $@"select currency, sum(gross) gross from dc_base_income_ebay_paypal where company_id = 1 and `status`= '已完成' and balance_impact = '贷记' and account_name = '{account}' and type in ('eBay竞拍付款', '移动支付', '普通付款') and record_time>= '{start.ToString("yyyy-MM-dd HH:MM:ss")}' and record_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}'
group by currency";
return "";
}
#endregion #endregion
......
...@@ -998,8 +998,7 @@ namespace Bailun.DC.Services ...@@ -998,8 +998,7 @@ namespace Bailun.DC.Services
} }
#endregion #endregion
#region 库龄 #region 库龄
/// <summary> /// <summary>
...@@ -1138,4 +1137,5 @@ namespace Bailun.DC.Services ...@@ -1138,4 +1137,5 @@ namespace Bailun.DC.Services
#endregion #endregion
} }
} }
...@@ -12,7 +12,7 @@ namespace Bailun.DC.Services ...@@ -12,7 +12,7 @@ namespace Bailun.DC.Services
{ {
public class OrdersServices public class OrdersServices
{ {
#region #region
/// <summary> /// <summary>
/// 平台费用流水 /// 平台费用流水
...@@ -663,7 +663,6 @@ namespace Bailun.DC.Services ...@@ -663,7 +663,6 @@ namespace Bailun.DC.Services
if (!string.IsNullOrEmpty(s)) if (!string.IsNullOrEmpty(s))
{ {
sql += " and t4.category_simple_id in (" + s + ") "; sql += " and t4.category_simple_id in (" + s + ") ";
} }
} }
} }
...@@ -796,11 +795,9 @@ namespace Bailun.DC.Services ...@@ -796,11 +795,9 @@ namespace Bailun.DC.Services
{ {
sqlparam.Add("ppaid_time_end", end.Value); sqlparam.Add("ppaid_time_end", end.Value);
} }
sqlparam.Add("itemid", itemid); sqlparam.Add("itemid", itemid);
} }
if (start.HasValue) if (start.HasValue)
......
...@@ -251,8 +251,8 @@ namespace Bailun.DC.Services ...@@ -251,8 +251,8 @@ namespace Bailun.DC.Services
if (arr.Count > 0) if (arr.Count > 0)
{ {
sql += " and t1.bailun_sku in @searchkey"; sql += " and t1.sku in ('" + string.Join("','",arr)+"')";
sqlparams.Add("searchkey", arr.ToArray()); //sqlparams.Add("searchkey", arr.ToArray());
} }
} }
...@@ -387,8 +387,8 @@ namespace Bailun.DC.Services ...@@ -387,8 +387,8 @@ namespace Bailun.DC.Services
if (arr.Count > 0) if (arr.Count > 0)
{ {
sql += " and t1.bailun_sku in @searchkey"; sql += " and t1.sku in ('" + string.Join("','", arr) + "')";
sqlparams.Add("searchkey", arr.ToArray()); //sqlparams.Add("searchkey", arr.ToArray());
} }
} }
......
...@@ -294,5 +294,6 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -294,5 +294,6 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
} }
} }
} }
\ No newline at end of file
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
{ field: 'warehousetype', title: '仓库类型', width: '100' }, { field: 'warehousetype', title: '仓库类型', width: '100' },
{ field: 'warehousename', title: '仓库名称', width: '130' }, { field: 'warehousename', title: '仓库名称', width: '130' },
{ {
field: 'sku', title: 'sku', width: '100', formatter: function (idx, data) { field: 'sku', title: 'sku', width: '150', formatter: function (idx, data) {
var str = '<p class="mules" title="' + data.sku + '">' + data.sku + '</p>'; var str = '<p class="mules" title="' + data.sku + '">' + data.sku + '</p>';
return str; return str;
} }
......
...@@ -7,22 +7,22 @@ namespace SkuWHRedundancyService ...@@ -7,22 +7,22 @@ namespace SkuWHRedundancyService
{ {
class Program class Program
{ {
static async Task Main(string[] args) //static async Task Main(string[] args)
{
Console.WriteLine("进入 仓库冗余报表");
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<Services>();
});
await builder.RunConsoleAsync();
}
//static void Main(string[] args)
//{ //{
// Console.WriteLine("进入 仓库冗余报表");
// var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
// {
// services.AddHostedService<Services>();
// });
// var service = new Services(); // await builder.RunConsoleAsync();
// service.SaveRedundancy(DateTime.Now.AddDays(-1));
//} //}
static void Main(string[] args)
{
var service = new Services();
service.SaveRedundancy(DateTime.Now.AddDays(-1));
}
} }
} }
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