活动报名 官方大促报名逻辑

This commit is contained in:
wule_5900x committed 2025-08-12 01:46:55 +08:00
1 parent 738ec76bf1
commit 800ccb857d
4 files changed
+28 -5

No files matched your search

+2 -2
View File
@@ -27,8 +27,8 @@ namespace AllBase
/// <summary>
/// 版本ID
/// </summary>
public static int VersionCount = 520;
//public static int VersionCount = 520;
public static int VersionCount = 521;
//public static int VersionCount = 521;
/// <summary>
/// 版本号
@@ -44,6 +44,8 @@ namespace AllBase.Model.Param.SalesManage
///
/// </summary>
public List<ActSkcListItem> skcList { get; set; }
public List<long> sessionIds { get; set; } = new List<long>();
}
public class TemuActivityParam
@@ -14,6 +14,18 @@ namespace AllBase.Model.Result
public int? suggestActivityStock { get; set; }
public string productName { get; set; }
public List<TemuActivitySkcInfo> skcList { get; set; }
public object isHotProduct { get; set; }
public List<object> enrollSessionIdList { get; set; }
public string currency { get; set; }
public object refuseActivityLimit { get; set; }
public int? isHighPriceProduct { get; set; }
public int? hasAdTrafficSupport { get; set; }
public object privilegeSuggestActivityStock { get; set; }
public TemuActivityProductExtVOItem activityProductExtVO { get; set; }
public object adCouponClaimable { get; set; }
public object salesStock { get; set; }
public List<long> suggestEnrollSessionIdList { get; set; }
public object estimatedIncrease { get; set; }
}
public class TemuActivitySkcInfo
@@ -32,4 +44,10 @@ namespace AllBase.Model.Result
public string currenty { get; set; }
public Dictionary<object, object> properties { get; set; }
}
public class TemuActivityProductExtVOItem
{
public List<object> hasSameStyleSkuIdList { get; set; }
public int? highPriceTag { get; set; }
}
}
@@ -318,6 +318,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms
if (jsonRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5)
{
tryCount++;
Thread.Sleep(Randomx.GetId(3000, 5000));
goto tryAgain;
}
@@ -429,7 +430,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms
{
sActivityTime = BaseClass.StampToDateTime((int)(actInfo.startTime.ParseToLong() / 1000)).ToString("yyyy/MM/dd HH:mm:ss") + "~" +
BaseClass.StampToDateTime((int)(actInfo.endTime.ParseToLong() / 1000)).ToString("yyyy/MM/dd HH:mm:ss") + "(" +
actInfo.durationDays + "天)";
(actInfo.durationDays > 0 ? actInfo.durationDays + "天" : "长期") + ")";
}
string sActivityRemaining = "-";
TimeSpan timeRemaining = BaseClass.StampToDateTime((int)(actInfo.enrollDeadLine.ParseToLong() / 1000)) - DateTime.Now;
@@ -576,9 +577,10 @@ namespace TemuKJD.KJDForms.SalesCenterForms
}));
continue;
}
if (jsonRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5)
if ((jsonRst.Contains("当前操作人数太多,请稍后重试") || jsonRst.Contains("too quickly")) && tryCount < 5)
{
tryCount++;
Thread.Sleep(Randomx.GetId(3000, 5000));
goto tryAgain;
}
if (!jsonRst.Contains("\"success\":true"))
@@ -927,8 +929,8 @@ namespace TemuKJD.KJDForms.SalesCenterForms
// 相同的是主活动,不需要activityThematicId就可以报名。
if (activity.activityThematicId != activity.activityType)
activityParam.activityThematicId = activity.activityThematicId;
activityParam.productList = new List<ActProductListItem>();
activityParam.productList = new List<ActProductListItem>();
foreach (var prod in prodLst)
{
int discount = this.GetNearDiscount(activity.discount.ParseToInt());
@@ -969,6 +971,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms
activityProditem.productId = prod.productId;
activityProditem.activityStock = inventory;
activityProditem.skcList = new List<ActSkcListItem>();
activityProditem.sessionIds = prod.suggestEnrollSessionIdList;
ActSkcListItem actSkcListItem = new ActSkcListItem();
actSkcListItem.skcId = prod.skcList.FirstOrDefault()?.skcId;