Commit 41f84d37 by guanzhenshan

更新帐号余额,14点前,每小时更新一次

parent 0f87099b
......@@ -12,27 +12,27 @@ namespace Bailun.DC.DailyBorrowFee
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
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>();
});
//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();
}
// await builder.RunConsoleAsync();
//}
//static void Main(string[] args)
//{
// var _services = new Services();
static void Main(string[] args)
{
var _services = new Services();
// var start = DateTime.Now;
var start = DateTime.Now;
// start = DateTime.Parse(start.AddDays(-1).ToShortDateString());
start = DateTime.Parse(start.AddDays(-1).ToShortDateString());
// _services.Init(start);
//}
_services.Init(start);
}
}
}
......@@ -30,13 +30,13 @@ namespace Bailun.DC.DailyPlatformAccountBalance
{
var now = DateTime.Now;
if (now.Hour == 9 && now.Minute==01) //每天9点01分启动跑一次
if (now.Hour < 14 && now.Minute==01) //
{
Console.WriteLine("开始启动 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var end = DateTime.Now;
var start = DateTime.Parse("2020-01-01");
Init(start,end);
Init();
Console.WriteLine("任务运行完成 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
......@@ -57,9 +57,9 @@ namespace Bailun.DC.DailyPlatformAccountBalance
}
}
public void Init(DateTime start,DateTime end)
public void Init()
{
url += "?Currencys=GBP,AUD,USD,EUR,CNY,HKD,IDR&StartDate=" + start.ToString("yyyy-MM-dd HH:mm:ss")+ "&EndDate="+end.ToString("yyyy-MM-dd HH:mm:ss")+ "&page=1&pagesize=100000";
url += "?pagesize=100000";
var str = Common.HttpHelper.NetHelper.Request(url);
......
......@@ -24,7 +24,7 @@ namespace Bailun.DC.Services
/// <returns></returns>
public decimal NoStatisticAmount()
{
var sql = $@"select sum(t1.merchant_shipment_cost_cny) as merchant_shipment_cost_cny from dc_base_logistics t1 where t1.diff_state_type=0 and t1.company_name!='广州嘉和货运代理有限公司'";
var sql = $@"select sum(t1.merchant_shipment_cost_cny) as merchant_shipment_cost_cny from dc_base_logistics t1 where t1.diff_state_type=0 and t1.company_name!='广州嘉和货运代理有限公司' and t1.merchant_reconciliation_time>'{DateTime.Now.AddMonths(-2).ToString("yyyy-MM-dd HH:mm:ss")}'";
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