Commit 5422b3a3 by mahaisong

fix:对按月、变成按日做了优化

parent 75df9592
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HJBeigeModel\bin\Debug\HJBeigeModel.dll.config
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HJBeigeModel\bin\Debug\HJBeigeModel.dll.config
......@@ -11,6 +11,5 @@ D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HJBeigeMo
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HJBeigeModel\bin\Debug\Newtonsoft.Json.xml
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HJBeigeModel\bin\Debug\zh-Hans\EntityFramework.resources.dll
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HJBeigeModel\bin\Debug\zh-Hans\EntityFramework.SqlServer.resources.dll
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HJBeigeModel\obj\Debug\HJBeigeModel.csprojResolveAssemblyReference.cache
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HJBeigeModel\obj\Debug\HJBeigeModel.dll
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HJBeigeModel\obj\Debug\HJBeigeModel.pdb
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HTCommon\bin\Debug\HTCommon.dll.config
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HTCommon\bin\Debug\HTCommon.dll.config
......@@ -72,6 +72,5 @@ D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HTCommon\
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HTCommon\bin\Debug\ServiceStack.Text.xml
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HTCommon\bin\Debug\zh-Hans\EntityFramework.resources.dll
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HTCommon\bin\Debug\zh-Hans\EntityFramework.SqlServer.resources.dll
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HTCommon\obj\Debug\HTCommon.csprojResolveAssemblyReference.cache
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HTCommon\obj\Debug\HTCommon.dll
D:\smallproject\10.Paul需求-JSON贝格ES导入本地ES\ImportLocalES\HTCommon\obj\Debug\HTCommon.pdb


......@@ -219,6 +219,7 @@ namespace TaikorES_ImportLocalES
DateTime dtitem = DateTime.Now;
long count = 0;
string crawlID = item.Value.ToString();
bool prevAddMonth = false;
try
{
//对每个爬虫,按照日期查询一遍。
......@@ -237,8 +238,19 @@ namespace TaikorES_ImportLocalES
DateTime? TodayQueryTime = Where_BeginTime;
DateTime TodayQueryDate = DateTime.Parse(Where_BeginTime.ToString("yyyy-MM-dd"));
DateTime TodayEndTime;
if ((Where_ENDTime - Where_BeginTime).TotalDays >= 31)
{
TodayEndTime = DateTime.Parse(Where_BeginTime.ToString("yyyy-MM-dd") + " 23:59:59.999").AddMonths(1);
prevAddMonth = true;
}
else
{
TodayEndTime = DateTime.Parse(Where_BeginTime.ToString("yyyy-MM-dd") + " 23:59:59.999");
DateTime TodayEndTime = DateTime.Parse(Where_BeginTime.ToString("yyyy-MM-dd") + " 23:59:59.999");
}
while (TodayEndTime <= Where_ENDTime.AddDays(1))
{
......@@ -418,13 +430,23 @@ namespace TaikorES_ImportLocalES
if((Where_ENDTime - TodayEndTime).TotalDays >= 31)
{
//当月执行完,执行下一月。
TodayQueryDate = TodayQueryDate.AddMonths(1);
TodayEndTime = TodayEndTime.AddMonths(1);
TodayQueryDate = TodayQueryDate.AddDays(1).AddMonths(1);
TodayEndTime = TodayEndTime.AddDays(1).AddMonths(1);
}
else
{
//不满足加月
TodayQueryDate = TodayQueryDate.AddDays(1);
//如果上一次是加月的情况,则TodayQueryDate单独向后移动1个月
if (prevAddMonth)
{
prevAddMonth = false;
TodayEndTime = DateTime.Parse(TodayEndTime.AddDays(1).ToString("yyyy-MM-dd"));
}
else
{
//不满足加月
TodayQueryDate = TodayQueryDate.AddDays(1);
}
TodayEndTime = TodayEndTime.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