一些运行中卡死的问题优化修复
This commit is contained in:
1 parent
b48f320099
commit
2b21ecf62a
6 files changed
+143
-111
No files matched your search
@@ -272,12 +272,16 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
tryCount++;
|
||||
goto tryAgain;
|
||||
}
|
||||
if (jsonStr.Contains("当前操作人数太多,请稍后重试"))
|
||||
{
|
||||
}
|
||||
if (!jsonStr.Contains("\"success\":true"))
|
||||
{
|
||||
isError = true;
|
||||
string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg");
|
||||
if (!string.IsNullOrWhiteSpace(sErr) && !errMsg.Contains(sErr))
|
||||
errMsg += sErr + " ";
|
||||
page++;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -300,8 +304,8 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
{
|
||||
lstPriceAdjustInfo.Add(pInfo);
|
||||
|
||||
string url = pInfo.image.Replace("https", "http");
|
||||
var image = Image.FromStream(WebRequest.Create(url).GetResponse().GetResponseStream());
|
||||
//string url = pInfo.image.Replace("https", "http");
|
||||
//var image = Image.FromStream(WebRequest.Create(url).GetResponse().GetResponseStream());
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
@@ -310,7 +314,7 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
pInfo.supplierId,
|
||||
shop.ShopAccount, // pInfo.supplierName, // 列表里取不到,这里取shop里的
|
||||
pInfo.priceOrderSn,
|
||||
image, // skc图片
|
||||
null,//image, // skc图片
|
||||
pInfo.productId,
|
||||
pInfo.skcId,
|
||||
pInfo.productName + "\r\n" + pInfo.skuSpecs, // 商品标题+sku名称
|
||||
@@ -395,6 +399,18 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
{
|
||||
if (cancellationTokenSource != null)
|
||||
cancellationTokenSource.Cancel();
|
||||
|
||||
Task.Run(() => {
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ucGroupBoxEx2.Enabled = true;
|
||||
ucGroupBoxEx4.Enabled = true;
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
private void btnStartStockUp_Click(object sender, EventArgs e)
|
||||
@@ -546,6 +562,8 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
|
||||
private void dgvStock_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (e.RowIndex < 0 || e.ColumnIndex < 0)
|
||||
return;
|
||||
string columnName = dgvAdjust.Columns[e.ColumnIndex].Name;
|
||||
var row = dgvAdjust.Rows[e.RowIndex];
|
||||
switch (columnName)
|
||||
|
||||
Reference in new issue
Block a user