|
@@ -594,31 +594,31 @@ namespace TEAMModelBI.Controllers.Census
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if(statsInfo.upTime > 0 && !isnew) {
|
|
|
|
- long timedis = 20 * 60 * 1000;//20分钟
|
|
|
|
- if (now - statsInfo.upTime < timedis)
|
|
|
|
- isnew = true;
|
|
|
|
- }
|
|
|
|
- if (statsInfo.upTime == 0 && isnew)
|
|
|
|
- statsInfo.upTime = now;
|
|
|
|
- if (statsInfo.upTime == 0 && isnew)
|
|
|
|
- statsInfo.upTime = DateTimeOffset.UtcNow.Add(new TimeSpan(-1, 0, 0, 0)).ToUnixTimeMilliseconds();
|
|
|
|
- if (!isnew)
|
|
|
|
- {
|
|
|
|
- //Function 处理Function 更新或者新增
|
|
|
|
- //_ = _httpTrigger.RequestHttpTrigger(new { schoolId = $"{school.id}"}, _option.Location, "stats-sc-info");
|
|
|
|
-
|
|
|
|
- //异步方法处理 同步更新
|
|
|
|
- statsInfo = await SchoolStatsWay.GetSingleSc(cosmosClient, school.id);
|
|
|
|
-
|
|
|
|
- statsInfo.upTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
|
- if (isExist)
|
|
|
|
- statsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<StatsInfo>(statsInfo, statsInfo.id, new PartitionKey("Stats"));
|
|
|
|
- else
|
|
|
|
- statsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<StatsInfo>(statsInfo, new PartitionKey("Stats"));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return Ok(new { state = RespondCode.Ok, statsInfo });
|
|
|
|
|
|
+ //if(statsInfo.upTime > 0 && !isnew) {
|
|
|
|
+ // long timedis = 20 * 60 * 1000;//20分钟
|
|
|
|
+ // if (now - statsInfo.upTime < timedis)
|
|
|
|
+ // isnew = true;
|
|
|
|
+ //}
|
|
|
|
+ //if (statsInfo.upTime == 0 && isnew)
|
|
|
|
+ // statsInfo.upTime = now;
|
|
|
|
+ //if (statsInfo.upTime == 0 && isnew)
|
|
|
|
+ // statsInfo.upTime = DateTimeOffset.UtcNow.Add(new TimeSpan(-1, 0, 0, 0)).ToUnixTimeMilliseconds();
|
|
|
|
+ //if (!isnew)
|
|
|
|
+ //{
|
|
|
|
+ // //Function 处理Function 更新或者新增
|
|
|
|
+ // //_ = _httpTrigger.RequestHttpTrigger(new { schoolId = $"{school.id}"}, _option.Location, "stats-sc-info");
|
|
|
|
+
|
|
|
|
+ // //异步方法处理 同步更新
|
|
|
|
+ // statsInfo = await SchoolStatsWay.GetSingleSc(cosmosClient, school.id);
|
|
|
|
+
|
|
|
|
+ // statsInfo.upTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
|
|
|
+ // if (isExist)
|
|
|
|
+ // statsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<StatsInfo>(statsInfo, statsInfo.id, new PartitionKey("Stats"));
|
|
|
|
+ // else
|
|
|
|
+ // statsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<StatsInfo>(statsInfo, new PartitionKey("Stats"));
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ return Ok(new { state = RespondCode.Ok, scStats });
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
{
|
|
{
|