|
|
@@ -6,7 +6,7 @@ namespace molilian.core
|
|
|
{
|
|
|
public partial class JdUnionPlus
|
|
|
{
|
|
|
- public async Task<List<DateTime>> querySpreadEffectData(DateTime query_date, CancellationToken cancellationToken = default)
|
|
|
+ public async Task<List<DateTime>> querySpreadEffectData(DateTime startDate, DateTime endDate, CancellationToken cancellationToken = default)
|
|
|
{
|
|
|
List<DateTime> changed_dates = new List<DateTime>();
|
|
|
|
|
|
@@ -25,8 +25,8 @@ namespace molilian.core
|
|
|
funName = "querySpreadEffectData",
|
|
|
param = new
|
|
|
{
|
|
|
- startDate = query_date.AddMonths(-1).ToString("yyyy-MM-dd"),
|
|
|
- endDate = query_date.ToString("yyyy-MM-dd"),
|
|
|
+ startDate = startDate.ToString("yyyy-MM-dd"),
|
|
|
+ endDate = endDate.ToString("yyyy-MM-dd"),
|
|
|
mediaId = "",
|
|
|
proCont = "",
|
|
|
promotionId = "",
|
|
|
@@ -52,13 +52,19 @@ namespace molilian.core
|
|
|
client.UserAgent = useragent;
|
|
|
client.AddHeaders("Cookie", cookies);
|
|
|
client.Post($"body={data}");
|
|
|
+ DateTime stime = DateTime.Now;
|
|
|
var response = await client.RequestAsync(url, "POST", cancellationToken);
|
|
|
+ TimeSpan ts2 = stime - DateTime.Now;
|
|
|
+ string xx = ts2.TotalSeconds.ToString();
|
|
|
|
|
|
string body = response.Body();
|
|
|
var root = body.Convert2JsonElement();
|
|
|
int code = root.Read<int>("code");
|
|
|
string message = root.Read<string>("message");
|
|
|
hasNext = root.Read<bool>("hasNext", false);
|
|
|
+ pageNo++;
|
|
|
+
|
|
|
+
|
|
|
if (code == 200 && "success".Equals(message))
|
|
|
{
|
|
|
var list = root.ElementRead("result").ElementRead("spreadReportInfoChatList");
|
|
|
@@ -94,7 +100,7 @@ namespace molilian.core
|
|
|
{
|
|
|
update.Add("report_date", report_date.Date)
|
|
|
.Add("create_time", DateTime.Now)
|
|
|
- .Create();
|
|
|
+ .Create(DBContext.InsertType.REPLACE);
|
|
|
}
|
|
|
else
|
|
|
{
|