优化web查询 新增学员数据 尝试64位软件
This commit is contained in:
1 parent
30beb00fc4
commit
caba307ed1
44 files changed
+738
-1769
No files matched your search
@@ -122,41 +122,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
dgvSelectProduct.Columns["colSkuFakeImg"].Visible = false;
|
||||
|
||||
//foreach (var selectProd in upload_draft_product_lst)
|
||||
//{
|
||||
// int rowIndex = 0;
|
||||
// this.dgvSelectProduct.Rows.Insert(rowIndex,
|
||||
// true,
|
||||
// selectProd.id,
|
||||
// selectProd.shop_id,
|
||||
// selectProd.shop_account,
|
||||
// "登录",
|
||||
// "进店",
|
||||
// BaseClass.SaLevel > 0 ? selectProd.spu_id : selectProd.spu_id.ParseToString().GetHashCode().ParseToString().Trim('-'),
|
||||
// selectProd.skc_id,
|
||||
// selectProd.main_img,
|
||||
// DataGridViewExtension.defaultBitmap,
|
||||
// "",
|
||||
// null,
|
||||
// selectProd.product_name, // 用户端显示商品原名
|
||||
// selectProd.cat_name,
|
||||
// BaseClass.SaLevel > 0 ? selectProd.ext_code : selectProd.ext_code.ParseToString().GetHashCode().ParseToString().Trim('-'),
|
||||
// selectProd.status,
|
||||
// selectProd.draft_id,
|
||||
// selectProd.notes,
|
||||
// (selectProd.user_notes + " 编辑").Trim(),
|
||||
// "删除",
|
||||
// selectProd.add_time.ToString("yy-MM-dd HH:mm:ss"),
|
||||
// "");
|
||||
|
||||
// dgvSelectProduct.Rows[rowIndex].Height = 60;
|
||||
|
||||
// int maxRowCount = 10000;
|
||||
// while (dgvSelectProduct.Rows.Count > maxRowCount)
|
||||
// {
|
||||
// dgvSelectProduct.Rows.RemoveAt(maxRowCount);
|
||||
// }
|
||||
//}
|
||||
dtpStartTime.Value = DateTime.Now.Date.AddMonths(-1);
|
||||
|
||||
//#if DEBUG
|
||||
if (BaseClass.SaLevel == 1)
|
||||
@@ -779,11 +745,19 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//this.statusBar.pgbTaskProgress.Maximum = lstTemuDBProductSelect.Count;
|
||||
//this.statusBar.UpdateProgressBar(0);
|
||||
}));
|
||||
bool istTimeOver = false;
|
||||
List<Task> tList = new List<Task>();
|
||||
foreach (JObject prod in prodObjs["productList"])
|
||||
{
|
||||
string StatusStr = "";
|
||||
int rowIndex = 0;
|
||||
var pStr = JsonHelper.SerializeObject(prod);
|
||||
var editTime = BaseClass.StampToDateTime(prod["editTime"].ParseToInt());
|
||||
if (chkProdTime.Checked && editTime < dtpStartTime.Value)
|
||||
{
|
||||
istTimeOver = true;
|
||||
break;
|
||||
}
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
decimal? minPrice = prod["skuList"]?.Min(sk => sk["price"].ParseToDecimal() / 100);
|
||||
@@ -791,7 +765,6 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
var prodId = prod["productId"].ParseToString();
|
||||
if (dgvSelectProduct.Rows.Cast<DataGridViewRow>().Any(r => r.Cells["colDraftId"].ParseToString() == prodId))
|
||||
{
|
||||
|
||||
}
|
||||
StatusStr = "其他";
|
||||
if (prod["status"].ParseToInt() == 5)
|
||||
@@ -839,8 +812,8 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
"", // 备注
|
||||
"",
|
||||
"删除",
|
||||
BaseClass.StampToDateTime(prod["lastEditDraftTime"].ParseToInt()).ToString("yy-MM-dd HH:mm"),
|
||||
"");
|
||||
editTime.ToString("yy-MM-dd HH:mm"),
|
||||
"");
|
||||
|
||||
dgvSelectProduct.Rows[rowIndex].Height = 60;
|
||||
Color color = Color.Red;
|
||||
@@ -856,37 +829,56 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
dgvSelectProduct.Rows[rowIndex].Cells["colPreSale"].Style.ForeColor = dgvSelectProduct.Rows[rowIndex].Cells["colPreSale"].Value.ParseToString().Contains("预售") ? Color.Green : Color.Blue;
|
||||
}));
|
||||
|
||||
// 获取商品链接
|
||||
if (StatusStr.ParseToString().StartsWith("在售") && chkSearchPromotionLink.Checked == true)
|
||||
{
|
||||
Task.Run(() => { });
|
||||
var PromotionRst = WXPreSale.GetPromotionLink(shop, prod["productId"].ParseToString(), page);
|
||||
Thread.Sleep(Randomx.GetId(50, 150));
|
||||
if (PromotionRst.ParseToString().Contains("\"code\":0"))
|
||||
var t = Task.Run(() =>
|
||||
{
|
||||
var shareUrl = BaseRegex.GetStringJson(ref PromotionRst, "shareUrl");
|
||||
var shortLink = BaseRegex.GetStringJson(ref PromotionRst, "shortLink");
|
||||
if (!string.IsNullOrEmpty(shareUrl))
|
||||
var PromotionRst = WXPreSale.GetPromotionLink(shop, prod["productId"].ParseToString(), page);
|
||||
Thread.Sleep(Randomx.GetId(50, 150));
|
||||
if (PromotionRst.ParseToString().Contains("\"code\":0"))
|
||||
{
|
||||
Invoke(new Action(() => {
|
||||
dgvSelectProduct.Rows[rowIndex].Cells["colPromotionLink"].Value = shareUrl;
|
||||
}));
|
||||
var shareUrl = BaseRegex.GetStringJson(ref PromotionRst, "shareUrl");
|
||||
var shortLink = BaseRegex.GetStringJson(ref PromotionRst, "shortLink");
|
||||
if (!string.IsNullOrEmpty(shareUrl))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
dgvSelectProduct.Rows[rowIndex].Cells["colPromotionLink"].Value = shareUrl;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
dgvSelectProduct.Rows[rowIndex].Cells["colPromotionLink"].Value = "链接获取失败";
|
||||
}));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoke(new Action(() => {
|
||||
dgvSelectProduct.Rows[rowIndex].Cells["colPromotionLink"].Value = "链接获取失败";
|
||||
var errMsg = BaseRegex.GetStringJsonByRegs(ref PromotionRst, PromotionRst, "errMsg", "errorMsg", "err_msg", "error_msg", "errormsg");
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
dgvSelectProduct.Rows[rowIndex].Cells["colPromotionLink"].Value = errMsg;
|
||||
}));
|
||||
}
|
||||
}
|
||||
else
|
||||
});
|
||||
tList.Add(t);
|
||||
while (tList.Count >= 5)
|
||||
{
|
||||
var errMsg = BaseRegex.GetStringJsonByRegs(ref PromotionRst, PromotionRst, "errMsg", "errorMsg", "err_msg", "error_msg", "errormsg");
|
||||
Invoke(new Action(() => {
|
||||
dgvSelectProduct.Rows[rowIndex].Cells["colPromotionLink"].Value = errMsg;
|
||||
}));
|
||||
Thread.Sleep(200);
|
||||
tList.RemoveAll(ta => ta.IsFaulted || ta.IsCanceled || ta.IsCompleted);
|
||||
}
|
||||
}
|
||||
}
|
||||
while (tList.Count > 0)
|
||||
{
|
||||
Thread.Sleep(200);
|
||||
tList.RemoveAll(ta => ta.IsFaulted || ta.IsCanceled || ta.IsCompleted);
|
||||
}
|
||||
if (istTimeOver)
|
||||
break;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -1799,7 +1791,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
});
|
||||
tList.Add(t);
|
||||
while(tList.Count > 20)
|
||||
while(tList.Count >= 20)
|
||||
{
|
||||
Thread.Sleep(200);
|
||||
tList.RemoveAll(ta => ta.IsFaulted || ta.IsCanceled || ta.IsCompleted);
|
||||
@@ -2019,7 +2011,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
});
|
||||
tList.Add(t);
|
||||
while (tList.Count > 20)
|
||||
while (tList.Count >= 20)
|
||||
{
|
||||
Thread.Sleep(200);
|
||||
tList.RemoveAll(ta => ta.IsFaulted || ta.IsCanceled || ta.IsCompleted);
|
||||
@@ -2032,6 +2024,11 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void chkProdTime_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class WXPreSale
|
||||
|
||||
Reference in new issue
Block a user