部分功能优化,选品上传卡死可以强制解锁按钮再传
This commit is contained in:
1 parent
ec170f4285
commit
5cc74f36f6
7 files changed
+452
-317
No files matched your search
@@ -27,7 +27,7 @@ namespace AllBase
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 版本ID
|
/// 版本ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static int VersionCount = 689;
|
public static int VersionCount = 691;
|
||||||
//public static int VersionCount = 613;
|
//public static int VersionCount = 613;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -75,34 +75,56 @@ namespace TemuKJD.KJDForms.AdminForms
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//var url = BaseClass.BuildObjString("product/get_product_list");
|
// 读取数据库是否有相同商品
|
||||||
//var data = "";
|
var url = BaseClass.BuildObjString("product/get_product_list");
|
||||||
|
var data = "";
|
||||||
|
|
||||||
//data = UserLogin.GetSignaturex() +
|
data = UserLogin.GetSignaturex() +
|
||||||
// "&page=" + 1 +
|
"&page=" + 1 +
|
||||||
// "&page_size=" + 1;
|
"&page_size=" + 1;
|
||||||
//data += "&search_spu=" + product?.productId;
|
data += "&search_spu=" + product?.productId;
|
||||||
////data += "&search_skc=" + product?.productSkcList?.FirstOrDefault()?.productSkcId;
|
if (BaseClass.SaLevel == 1) // 店铺非空管理状态允许查看 后台采集 和 前端采集 的所有商品
|
||||||
|
|
||||||
//int count = 0;
|
|
||||||
//html = GetHtml.PostUtf8(url, data);
|
|
||||||
//if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
|
||||||
// html = GetHtml.PostUtf8(url, data);
|
|
||||||
//if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
|
||||||
// html = GetHtml.PostUtf8(url, data);
|
|
||||||
//if (!string.IsNullOrEmpty(html) && !html.Contains("\"code\":200"))
|
|
||||||
//{
|
|
||||||
// count = BaseRegex.GetIntJson(ref html, "count");
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (count > 0 && BaseMsgForm.ShowConfirm("数据库已存在相同 Spu Id 的商品,是否覆盖?(选择否新增一条数据)").DialogResult == DialogResult.OK)
|
|
||||||
//{
|
|
||||||
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
{
|
{
|
||||||
var url = BaseClass.BuildObjString("product/add_product");
|
data += "&product_get_type=all";
|
||||||
var data = Work.UserLogin.GetSignaturex() +
|
}
|
||||||
|
//data += "&search_skc=" + product?.productSkcList?.FirstOrDefault()?.productSkcId;
|
||||||
|
|
||||||
|
int dbId = 0;
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
if (!string.IsNullOrEmpty(html) && html.Contains("\"code\":200"))
|
||||||
|
{
|
||||||
|
dbId = BaseRegex.GetIntJson(ref html, "id");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dbId > 0 && BaseMsgForm.ShowConfirm("数据库已存在相同 Spu Id 的商品,是否覆盖?(选择 取消 将新增一条数据)").DialogResult == DialogResult.OK)
|
||||||
|
{
|
||||||
|
url = BaseClass.BuildObjString("product/mdy_db_product");
|
||||||
|
data = UserLogin.GetSignaturex() +
|
||||||
|
"&db_id=" + dbId;
|
||||||
|
data += "&product_json=" + HttpUtility.UrlEncode(result, Encoding.UTF8);
|
||||||
|
data += "&size_json=" + HttpUtility.UrlEncode(sizeRst, Encoding.UTF8);
|
||||||
|
//data += "&original_json=" + HttpUtility.UrlEncode(JsonHelper.SerializeObject(clientProdInfo), Encoding.UTF8);
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
|
html = GetHtml.PostUtf8(url, data);
|
||||||
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
|
{
|
||||||
|
string msg = "选品商品更新保存失败!请检查网络连接:" + BaseRegex.GetStringJson(ref html, "msg");
|
||||||
|
OnInfoReceived(msg);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnInfoReceived("选品商品更新保存成功!" + success_err_msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
url = BaseClass.BuildObjString("product/add_product");
|
||||||
|
data = Work.UserLogin.GetSignaturex() +
|
||||||
"&spu_id=" + product?.productId +
|
"&spu_id=" + product?.productId +
|
||||||
"&skc_id=" + product?.productSkcList?.FirstOrDefault()?.productSkcId +
|
"&skc_id=" + product?.productSkcList?.FirstOrDefault()?.productSkcId +
|
||||||
"&cat_id=" + GetCat(product).catId +
|
"&cat_id=" + GetCat(product).catId +
|
||||||
@@ -119,8 +141,7 @@ namespace TemuKJD.KJDForms.AdminForms
|
|||||||
html = GetHtml.PostUtf8(url, data);
|
html = GetHtml.PostUtf8(url, data);
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
{
|
{
|
||||||
string msg = "选品商品保存失败!请检查网络连接:" +
|
string msg = "选品商品保存失败!请检查网络连接:" + BaseRegex.GetStringJson(ref html, "msg");
|
||||||
BaseRegex.GetStringJson(ref html, "msg");
|
|
||||||
OnInfoReceived(msg);
|
OnInfoReceived(msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1056,7 +1056,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
dbId = BaseRegex.GetIntJson(ref html, "id");
|
dbId = BaseRegex.GetIntJson(ref html, "id");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dbId > 0 && BaseMsgForm.ShowConfirm("数据库已存在相同ID的商品,是否覆盖?(选择否新增一条数据)").DialogResult == DialogResult.OK)
|
if (dbId > 0 && BaseMsgForm.ShowConfirm("数据库已存在相同ID的商品,是否覆盖?(选择 取消 将新增一条数据)").DialogResult == DialogResult.OK)
|
||||||
{
|
{
|
||||||
url = BaseClass.BuildObjString("product/mdy_db_product");
|
url = BaseClass.BuildObjString("product/mdy_db_product");
|
||||||
data = UserLogin.GetSignaturex() +
|
data = UserLogin.GetSignaturex() +
|
||||||
@@ -1069,12 +1069,12 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
html = GetHtml.PostUtf8(url, data);
|
html = GetHtml.PostUtf8(url, data);
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
{
|
{
|
||||||
string msg = "商品保存失败!请检查html文件:" + BaseRegex.GetStringJson(ref html, "msg");
|
string msg = "前端直采商品更新保存失败!请检查html文件:" + BaseRegex.GetStringJson(ref html, "msg");
|
||||||
BaseMsgForm.ShowError(msg);
|
BaseMsgForm.ShowError(msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BaseMsgForm.ShowInfo("选品商品保存成功!");
|
BaseMsgForm.ShowInfo("选品商品更新保存成功!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1099,7 +1099,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
html = GetHtml.PostUtf8(url, data);
|
html = GetHtml.PostUtf8(url, data);
|
||||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||||
{
|
{
|
||||||
string msg = "商品保存失败!请检查html文件:" + BaseRegex.GetStringJson(ref html, "msg");
|
string msg = "前端直采商品保存失败!请检查html文件:" + BaseRegex.GetStringJson(ref html, "msg");
|
||||||
BaseMsgForm.ShowError(msg);
|
BaseMsgForm.ShowError(msg);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
+29
@@ -40,6 +40,7 @@
|
|||||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
|
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DbProductSelectListManageForm));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DbProductSelectListManageForm));
|
||||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.btnForceEnable = new DevComponents.DotNetBar.PanelEx();
|
||||||
this.txtNotChangeMainImg = new System.Windows.Forms.TextBox();
|
this.txtNotChangeMainImg = new System.Windows.Forms.TextBox();
|
||||||
this.chkNotChangeMainImg = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
this.chkNotChangeMainImg = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||||
this.chkAiSkuAndMainImg = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
this.chkAiSkuAndMainImg = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||||
@@ -194,6 +195,7 @@
|
|||||||
//
|
//
|
||||||
// splitContainer1.Panel1
|
// splitContainer1.Panel1
|
||||||
//
|
//
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.btnForceEnable);
|
||||||
this.splitContainer1.Panel1.Controls.Add(this.txtNotChangeMainImg);
|
this.splitContainer1.Panel1.Controls.Add(this.txtNotChangeMainImg);
|
||||||
this.splitContainer1.Panel1.Controls.Add(this.chkNotChangeMainImg);
|
this.splitContainer1.Panel1.Controls.Add(this.chkNotChangeMainImg);
|
||||||
this.splitContainer1.Panel1.Controls.Add(this.chkAiSkuAndMainImg);
|
this.splitContainer1.Panel1.Controls.Add(this.chkAiSkuAndMainImg);
|
||||||
@@ -237,6 +239,32 @@
|
|||||||
this.splitContainer1.SplitterDistance = 125;
|
this.splitContainer1.SplitterDistance = 125;
|
||||||
this.splitContainer1.TabIndex = 2;
|
this.splitContainer1.TabIndex = 2;
|
||||||
//
|
//
|
||||||
|
// btnForceEnable
|
||||||
|
//
|
||||||
|
this.btnForceEnable.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.btnForceEnable.CanvasColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.btnForceEnable.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||||
|
this.btnForceEnable.DisabledBackColor = System.Drawing.Color.Empty;
|
||||||
|
this.btnForceEnable.Location = new System.Drawing.Point(1372, 70);
|
||||||
|
this.btnForceEnable.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
|
||||||
|
this.btnForceEnable.Name = "btnForceEnable";
|
||||||
|
this.btnForceEnable.Size = new System.Drawing.Size(182, 22);
|
||||||
|
this.btnForceEnable.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||||
|
this.btnForceEnable.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
|
||||||
|
this.btnForceEnable.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
|
||||||
|
this.btnForceEnable.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
|
||||||
|
this.btnForceEnable.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||||
|
this.btnForceEnable.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
|
||||||
|
this.btnForceEnable.Style.GradientAngle = 90;
|
||||||
|
this.btnForceEnable.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
|
||||||
|
this.btnForceEnable.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||||
|
this.btnForceEnable.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||||
|
this.btnForceEnable.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||||
|
this.btnForceEnable.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
|
||||||
|
this.btnForceEnable.TabIndex = 722;
|
||||||
|
this.btnForceEnable.Text = "强制解锁按钮(上传卡住时用)";
|
||||||
|
this.btnForceEnable.Click += new System.EventHandler(this.btnForceEnable_Click);
|
||||||
|
//
|
||||||
// txtNotChangeMainImg
|
// txtNotChangeMainImg
|
||||||
//
|
//
|
||||||
this.txtNotChangeMainImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
this.txtNotChangeMainImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
@@ -1965,5 +1993,6 @@
|
|||||||
private System.Windows.Forms.DataGridViewLinkColumn colEditNotes;
|
private System.Windows.Forms.DataGridViewLinkColumn colEditNotes;
|
||||||
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
|
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
|
||||||
private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult;
|
private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult;
|
||||||
|
private DevComponents.DotNetBar.PanelEx btnForceEnable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
|
|
||||||
List<string> skuRandomLetterArr = new List<string> { "~", "#", "¥", "%", "&", "*", "(", ")", "(", ")", "+", "-", "_", "=", "【", "】", "·", "|", "《", "》" };
|
List<string> skuRandomLetterArr = new List<string> { "~", "#", "¥", "%", "&", "*", "(", ")", "(", ")", "+", "-", "_", "=", "【", "】", "·", "|", "《", "》" };
|
||||||
|
|
||||||
List<TemuDBProductSelect> lstAdminTemuDBProductSelect = new List<TemuDBProductSelect>();
|
NaiBa.Util.ConcurrentList<TemuDBProductSelect> lstAdminTemuDBProductSelect = new NaiBa.Util.ConcurrentList<TemuDBProductSelect>();
|
||||||
List<ShopLoginInfo> shopLst = new List<ShopLoginInfo>();
|
List<ShopLoginInfo> shopLst = new List<ShopLoginInfo>();
|
||||||
List<TemuDBExtCodePriceInfo> lstDbPrice = new List<TemuDBExtCodePriceInfo>();
|
List<TemuDBExtCodePriceInfo> lstDbPrice = new List<TemuDBExtCodePriceInfo>();
|
||||||
List<string> lstCustomImg = new List<string>();
|
List<string> lstCustomImg = new List<string>();
|
||||||
@@ -245,6 +245,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
"");
|
"");
|
||||||
|
|
||||||
dgvSelectProduct.Rows[rowIndex].Height = 60;
|
dgvSelectProduct.Rows[rowIndex].Height = 60;
|
||||||
|
displayLoginStatusColor(dgvSelectProduct.Rows[rowIndex].Cells["colLogin"], dgvSelectProduct.Rows[rowIndex].Cells["colLogin"].Value.ParseToString());
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,9 +420,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
shopLoginForm.ShowDialog();
|
shopLoginForm.ShowDialog();
|
||||||
foreach (DataGridViewRow row in this.dgvSelectProduct.Rows)
|
foreach (DataGridViewRow row in this.dgvSelectProduct.Rows)
|
||||||
{
|
{
|
||||||
if (row.Cells["colSelectId"].Value.ParseToString() == shop.ShopId)
|
if (row.Cells["colSupplierId"].Value.ParseToString() == shop.ShopId)
|
||||||
{
|
{
|
||||||
row.Cells["colLogin"].Value = shop.LoginStatus2 == "国际版在线" ? "在线" : "登录";
|
row.Cells["colLogin"].Value = shop.LoginStatus2 == "国际版在线" ? "在线" : "登录";
|
||||||
|
displayLoginStatusColor(row.Cells["colLogin"], row.Cells["colLogin"].Value.ParseToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -540,6 +542,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
//throw new NotImplementedException();
|
//throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Task AddProd = null;
|
||||||
private void btnAdd_Click(object sender, EventArgs e)
|
private void btnAdd_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (chkCustomPic.Checked && lstCustomImg.Count <= 0)
|
if (chkCustomPic.Checked && lstCustomImg.Count <= 0)
|
||||||
@@ -557,23 +560,43 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
lstDbPrice.Clear();
|
lstDbPrice.Clear();
|
||||||
lstDbPrice.AddRange(GetServerPriceLst(extCodes));
|
lstDbPrice.AddRange(GetServerPriceLst(extCodes));
|
||||||
|
|
||||||
if (prodList.Count() > 0)
|
if (prodList.Count() == 0)
|
||||||
{
|
|
||||||
this.btnAdd.Enabled = false;
|
|
||||||
cancellationTokenSource = new CancellationTokenSource();
|
|
||||||
Task.Run(() =>
|
|
||||||
{
|
|
||||||
AddProductDraft(prodList);
|
|
||||||
Invoke(new Action(() =>
|
|
||||||
{
|
|
||||||
this.btnAdd.Enabled = true;
|
|
||||||
}));
|
|
||||||
}, cancellationTokenSource.Token);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
BaseMsgForm.ShowError("请选择要上传的商品!");
|
BaseMsgForm.ShowError("请选择要上传的商品!");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.btnAdd.Enabled = false;
|
||||||
|
cancellationTokenSource = new CancellationTokenSource();
|
||||||
|
AddProd = Task.Run(() =>
|
||||||
|
{
|
||||||
|
AddProductDraft(prodList);
|
||||||
|
//Invoke(new Action(() =>
|
||||||
|
//{
|
||||||
|
// this.btnAdd.Enabled = true;
|
||||||
|
//}));
|
||||||
|
}, cancellationTokenSource.Token);
|
||||||
|
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
if (AddProd == null || AddProd.IsCompleted || AddProd.IsCanceled || AddProd.IsFaulted)
|
||||||
|
{
|
||||||
|
Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
this.pbLoading.Visible = false;
|
||||||
|
this.btnAdd.Enabled = true;
|
||||||
|
if (AddProd != null && AddProd.IsFaulted)
|
||||||
|
{
|
||||||
|
BaseMsgForm.ShowError(AddProd?.Exception?.Message + " 错误详情为:" + AddProd?.Exception?.InnerException?.Message);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddProductDraft(TemuDBProductSelect[] prodSelect)
|
void AddProductDraft(TemuDBProductSelect[] prodSelect)
|
||||||
@@ -643,6 +666,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
foreach (var r in rows)
|
foreach (var r in rows)
|
||||||
{
|
{
|
||||||
r.Cells["colLogin"].Value = "登录";
|
r.Cells["colLogin"].Value = "登录";
|
||||||
|
displayLoginStatusColor(r.Cells["colLogin"], r.Cells["colLogin"].Value.ParseToString());
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
continue;
|
continue;
|
||||||
@@ -657,6 +681,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
foreach (var r in rows)
|
foreach (var r in rows)
|
||||||
{
|
{
|
||||||
r.Cells["colLogin"].Value = "登录";
|
r.Cells["colLogin"].Value = "登录";
|
||||||
|
displayLoginStatusColor(r.Cells["colLogin"], r.Cells["colLogin"].Value.ParseToString());
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
continue;
|
continue;
|
||||||
@@ -1482,310 +1507,324 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
|
|
||||||
int skuCount = 0;
|
int skuCount = 0;
|
||||||
//foreach (var skuInfo in skcInfo.productSkuList)
|
//foreach (var skuInfo in skcInfo.productSkuList)
|
||||||
List<TemuProductSku> skuListTmp = new List<TemuProductSku>();
|
NaiBa.Util.ConcurrentList<TemuProductSku> skuListTmp = new NaiBa.Util.ConcurrentList<TemuProductSku>();
|
||||||
skuListTmp.AddRange(skcInfo.productSkuList);
|
skuListTmp.AddRange(skcInfo.productSkuList);
|
||||||
while (skuListTmp.Count > 0)
|
int loopCount = 0;
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (cancellationTokenSource.IsCancellationRequested)
|
//throw new Exception();
|
||||||
|
while (skuListTmp.Count > 0)
|
||||||
{
|
{
|
||||||
return "{\"success\":false,\"status\":\"未上传\"," +
|
loopCount++;
|
||||||
"\"productDraftId\":\"" + prodParam.productDraftId.ParseToString() + "\"," +
|
if (cancellationTokenSource.IsCancellationRequested)
|
||||||
"\"errMsg\":\"上传停止\"}";
|
|
||||||
}
|
|
||||||
|
|
||||||
skuCount++;
|
|
||||||
if (cell != null)
|
|
||||||
{
|
|
||||||
Invoke(new Action(() =>
|
|
||||||
{
|
{
|
||||||
cell.Value = "正在生成sku " + skuCount + "/" + skcInfo.productSkuList.Count;
|
return "{\"success\":false,\"status\":\"未上传\"," +
|
||||||
}));
|
"\"productDraftId\":\"" + prodParam.productDraftId.ParseToString() + "\"," +
|
||||||
}
|
"\"errMsg\":\"上传停止\"}";
|
||||||
|
}
|
||||||
|
|
||||||
#region 按顺序抽取sku或抽取随机打乱顺序的sku
|
skuCount++;
|
||||||
int id = 0;
|
if (cell != null)
|
||||||
if (chkRandomSkuOrder.Checked)
|
{
|
||||||
id = Randomx.GetId(0, skuListTmp.Count);
|
Invoke(new Action(() =>
|
||||||
var skuInfo = skuListTmp[id];
|
{
|
||||||
if (skuInfo != null)
|
cell.Value = "正在生成sku " + skuCount + "/" + skcInfo.productSkuList.Count + " -loop:" + loopCount;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 按顺序抽取sku或抽取随机打乱顺序的sku
|
||||||
|
int id = 0;
|
||||||
|
if (chkRandomSkuOrder.Checked)
|
||||||
|
id = Randomx.GetId(0, skuListTmp.Count);
|
||||||
|
var skuInfo = skuListTmp[id];
|
||||||
skuListTmp.RemoveAt(id);
|
skuListTmp.RemoveAt(id);
|
||||||
#endregion
|
if (skuInfo == null)
|
||||||
|
continue;
|
||||||
|
#endregion
|
||||||
|
|
||||||
ProductSkuReqsItem skuItem = new ProductSkuReqsItem();
|
ProductSkuReqsItem skuItem = new ProductSkuReqsItem();
|
||||||
skuItem.currencyType = skuInfo.currencyType;
|
skuItem.currencyType = skuInfo.currencyType;
|
||||||
skuItem.extCode = skuInfo.extCode;
|
skuItem.extCode = skuInfo.extCode;
|
||||||
skuItem.productSkuAccessoriesReq = new ProductSkuAccessoriesReq()
|
skuItem.productSkuAccessoriesReq = new ProductSkuAccessoriesReq()
|
||||||
{
|
{
|
||||||
productSkuAccessories = skuInfo.productSkuSaleExtAttr.productSkuAccessories?.productSkuAccessories == null ?
|
productSkuAccessories = skuInfo.productSkuSaleExtAttr.productSkuAccessories?.productSkuAccessories == null ?
|
||||||
new List<object>() : skuInfo.productSkuSaleExtAttr.productSkuAccessories?.productSkuAccessories,
|
new List<object>() : skuInfo.productSkuSaleExtAttr.productSkuAccessories?.productSkuAccessories,
|
||||||
};
|
};
|
||||||
skuItem.productSkuId = 0;
|
skuItem.productSkuId = 0;
|
||||||
//skuItem.productSkuMultiPackReq = new ProductSkuMultiPackReq()
|
//skuItem.productSkuMultiPackReq = new ProductSkuMultiPackReq()
|
||||||
//{
|
//{
|
||||||
// skuClassification = skuInfo.productSkuMultiPack.skuClassification,
|
// skuClassification = skuInfo.productSkuMultiPack.skuClassification,
|
||||||
// numberOfPieces = skuInfo.productSkuMultiPack.numberOfPieces,
|
// numberOfPieces = skuInfo.productSkuMultiPack.numberOfPieces,
|
||||||
// pieceUnitCode = skuInfo.productSkuMultiPack.pieceUnitCode,
|
// pieceUnitCode = skuInfo.productSkuMultiPack.pieceUnitCode,
|
||||||
// productSkuNetContentReq = JsonHelper.DeserializeJsonToObject<ProductSkuNetContentReq>(
|
// productSkuNetContentReq = JsonHelper.DeserializeJsonToObject<ProductSkuNetContentReq>(
|
||||||
// JsonHelper.SerializeObject(skuInfo.productSkuMultiPack.productSkuNetContent)),
|
// JsonHelper.SerializeObject(skuInfo.productSkuMultiPack.productSkuNetContent)),
|
||||||
//};
|
//};
|
||||||
skuItem.productSkuMultiPackReq = new ProductSkuMultiPackReq2()
|
|
||||||
{
|
|
||||||
skuClassification = skuInfo.productSkuMultiPack.skuClassification,
|
|
||||||
numberOfPieces = skuInfo.productSkuMultiPack.numberOfPieces,
|
|
||||||
pieceUnitCode = skuInfo.productSkuMultiPack.pieceUnitCode,
|
|
||||||
productSkuNetContentReq = JsonHelper.DeserializeJsonToObject<ProductSkuNetContentReq>(
|
|
||||||
JsonHelper.SerializeObject(skuInfo.productSkuMultiPack.productSkuNetContent)),
|
|
||||||
mixedType = skuInfo.productSkuMultiPack.mixedType,
|
|
||||||
numberOfPiecesNew = skuInfo.productSkuMultiPack.numberOfPiecesNew,
|
|
||||||
pieceNewUnitCode = skuInfo.productSkuMultiPack.pieceNewUnitCode,
|
|
||||||
totalNetContent = JsonHelper.DeserializeJsonToObject<ProductSkuNetContentReq>(
|
|
||||||
JsonHelper.SerializeObject(skuInfo.productSkuMultiPack.totalNetContent)),
|
|
||||||
individuallyPacked = skuInfo.productSkuMultiPack.individuallyPacked,
|
|
||||||
};
|
|
||||||
if (skuItem.productSkuMultiPackReq.productSkuNetContentReq == null)
|
|
||||||
skuItem.productSkuMultiPackReq.productSkuNetContentReq = new ProductSkuNetContentReq();
|
|
||||||
if (skuItem.productSkuMultiPackReq.totalNetContent == null)
|
|
||||||
skuItem.productSkuMultiPackReq.totalNetContent = new ProductSkuNetContentReq();
|
|
||||||
// 如果母店为多件但没有指定是否独立包装,强制指定非独立包装
|
|
||||||
var packReq = skuItem.productSkuMultiPackReq as ProductSkuMultiPackReq2;
|
|
||||||
if (packReq.skuClassification > 1 && packReq.individuallyPacked == null)
|
|
||||||
{
|
|
||||||
packReq.individuallyPacked = 0;
|
|
||||||
}
|
|
||||||
if (chkChangeSizeAndNumber.Checked)
|
|
||||||
{
|
|
||||||
skuItem.productSkuMultiPackReq = new ProductSkuMultiPackReq2()
|
skuItem.productSkuMultiPackReq = new ProductSkuMultiPackReq2()
|
||||||
{
|
{
|
||||||
skuClassification = 2,
|
skuClassification = skuInfo.productSkuMultiPack.skuClassification,
|
||||||
numberOfPieces = numberOfPieces,
|
numberOfPieces = skuInfo.productSkuMultiPack.numberOfPieces,
|
||||||
pieceUnitCode = skuInfo.productSkuMultiPack.pieceUnitCode,
|
pieceUnitCode = skuInfo.productSkuMultiPack.pieceUnitCode,
|
||||||
productSkuNetContentReq = JsonHelper.DeserializeJsonToObject<ProductSkuNetContentReq>(
|
productSkuNetContentReq = JsonHelper.DeserializeJsonToObject<ProductSkuNetContentReq>(
|
||||||
JsonHelper.SerializeObject(skuInfo.productSkuMultiPack.productSkuNetContent)),
|
JsonHelper.SerializeObject(skuInfo.productSkuMultiPack.productSkuNetContent)),
|
||||||
individuallyPacked = 1,
|
mixedType = skuInfo.productSkuMultiPack.mixedType,
|
||||||
|
numberOfPiecesNew = skuInfo.productSkuMultiPack.numberOfPiecesNew,
|
||||||
|
pieceNewUnitCode = skuInfo.productSkuMultiPack.pieceNewUnitCode,
|
||||||
|
totalNetContent = JsonHelper.DeserializeJsonToObject<ProductSkuNetContentReq>(
|
||||||
|
JsonHelper.SerializeObject(skuInfo.productSkuMultiPack.totalNetContent)),
|
||||||
|
individuallyPacked = skuInfo.productSkuMultiPack.individuallyPacked,
|
||||||
};
|
};
|
||||||
}
|
if (skuItem.productSkuMultiPackReq.productSkuNetContentReq == null)
|
||||||
skuItem.productSkuNonAuditExtAttrReq = JsonHelper.DeserializeJsonToObject<ProductSkuNonAuditExtAttrReq>(
|
skuItem.productSkuMultiPackReq.productSkuNetContentReq = new ProductSkuNetContentReq();
|
||||||
JsonHelper.SerializeObject(skuInfo.productSkuNonAuditExtAttr));
|
if (skuItem.productSkuMultiPackReq.totalNetContent == null)
|
||||||
if (skuItem.productSkuNonAuditExtAttrReq == null)
|
skuItem.productSkuMultiPackReq.totalNetContent = new ProductSkuNetContentReq();
|
||||||
skuItem.productSkuNonAuditExtAttrReq = new ProductSkuNonAuditExtAttrReq();
|
// 如果母店为多件但没有指定是否独立包装,强制指定非独立包装
|
||||||
skuItem.productSkuSpecReqs = new List<ProductSkuSpecReqsItem>();
|
var packReq = skuItem.productSkuMultiPackReq as ProductSkuMultiPackReq2;
|
||||||
int groupId = 0;
|
if (packReq.skuClassification > 1 && packReq.individuallyPacked == null)
|
||||||
foreach (var skuSpecInfo in skuInfo.productSkuSpecList)
|
|
||||||
{
|
|
||||||
groupId++;
|
|
||||||
ProductSkuSpecReqsItem skuSpecItem = new ProductSkuSpecReqsItem()
|
|
||||||
{
|
{
|
||||||
groupId = groupId,
|
packReq.individuallyPacked = 0;
|
||||||
parentSpecId = skuSpecInfo.parentSpecId,
|
}
|
||||||
parentSpecName = skuSpecInfo.parentSpecName,
|
if (chkChangeSizeAndNumber.Checked)
|
||||||
specId = skuSpecInfo.specId,
|
|
||||||
specName = skuSpecInfo.specName,
|
|
||||||
vid = prodParam.productSpecPropertyReqs.FirstOrDefault(p => p.specId == skuSpecInfo.specId)?.vid, //可以不填
|
|
||||||
};
|
|
||||||
if (dbProd.product_get_type == 1) // 直采商品重新生成sku
|
|
||||||
{
|
{
|
||||||
string draftId = prodParam.productDraftId.ParseToString();
|
skuItem.productSkuMultiPackReq = new ProductSkuMultiPackReq2()
|
||||||
string parentSpecId = skuSpecItem.parentSpecId.ParseToString();
|
|
||||||
var rst = QueryOrAddSpec(shop, draftId, parentSpecId, skuSpecItem.specName);
|
|
||||||
Thread.Sleep(Randomx.GetId(50, 100));
|
|
||||||
if (rst.Contains("\"success\":true"))
|
|
||||||
{
|
{
|
||||||
long specId = BaseRegex.GetLongJson(ref rst, "specId");
|
skuClassification = 2,
|
||||||
if (specId > 0)
|
numberOfPieces = numberOfPieces,
|
||||||
|
pieceUnitCode = skuInfo.productSkuMultiPack.pieceUnitCode,
|
||||||
|
productSkuNetContentReq = JsonHelper.DeserializeJsonToObject<ProductSkuNetContentReq>(
|
||||||
|
JsonHelper.SerializeObject(skuInfo.productSkuMultiPack.productSkuNetContent)),
|
||||||
|
individuallyPacked = 1,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
skuItem.productSkuNonAuditExtAttrReq = JsonHelper.DeserializeJsonToObject<ProductSkuNonAuditExtAttrReq>(
|
||||||
|
JsonHelper.SerializeObject(skuInfo.productSkuNonAuditExtAttr));
|
||||||
|
if (skuItem.productSkuNonAuditExtAttrReq == null)
|
||||||
|
skuItem.productSkuNonAuditExtAttrReq = new ProductSkuNonAuditExtAttrReq();
|
||||||
|
skuItem.productSkuSpecReqs = new List<ProductSkuSpecReqsItem>();
|
||||||
|
int groupId = 0;
|
||||||
|
foreach (var skuSpecInfo in skuInfo.productSkuSpecList)
|
||||||
|
{
|
||||||
|
groupId++;
|
||||||
|
ProductSkuSpecReqsItem skuSpecItem = new ProductSkuSpecReqsItem()
|
||||||
|
{
|
||||||
|
groupId = groupId,
|
||||||
|
parentSpecId = skuSpecInfo.parentSpecId,
|
||||||
|
parentSpecName = skuSpecInfo.parentSpecName,
|
||||||
|
specId = skuSpecInfo.specId,
|
||||||
|
specName = skuSpecInfo.specName,
|
||||||
|
vid = prodParam.productSpecPropertyReqs.FirstOrDefault(p => p.specId == skuSpecInfo.specId)?.vid, //可以不填
|
||||||
|
};
|
||||||
|
if (dbProd.product_get_type == 1) // 直采商品重新生成sku
|
||||||
|
{
|
||||||
|
string draftId = prodParam.productDraftId.ParseToString();
|
||||||
|
string parentSpecId = skuSpecItem.parentSpecId.ParseToString();
|
||||||
|
var rst = QueryOrAddSpec(shop, draftId, parentSpecId, skuSpecItem.specName);
|
||||||
|
Thread.Sleep(Randomx.GetId(50, 100));
|
||||||
|
if (rst.Contains("\"success\":true"))
|
||||||
{
|
{
|
||||||
skuSpecItem.specId = specId;
|
long specId = BaseRegex.GetLongJson(ref rst, "specId");
|
||||||
|
if (specId > 0)
|
||||||
|
{
|
||||||
|
skuSpecItem.specId = specId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//前后缀映射
|
//前后缀映射
|
||||||
if (skuSpecInfo.parentSpecName == "颜色" && skuNameDic[skuSpecItem.specName] != skuSpecItem.specName)
|
if (skuSpecInfo.parentSpecName == "颜色" && skuNameDic[skuSpecItem.specName] != skuSpecItem.specName)
|
||||||
{
|
|
||||||
skuSpecItem.specName = skuNameDic[skuSpecItem.specName];
|
|
||||||
string draftId = prodParam.productDraftId.ParseToString();
|
|
||||||
string parentSpecId = skuSpecItem.parentSpecId.ParseToString();
|
|
||||||
var rst = QueryOrAddSpec(shop, draftId, parentSpecId, skuSpecItem.specName);
|
|
||||||
if (rst.Contains("\"success\":true"))
|
|
||||||
{
|
{
|
||||||
long specId = BaseRegex.GetLongJson(ref rst, "specId");
|
skuSpecItem.specName = skuNameDic[skuSpecItem.specName];
|
||||||
if (specId > 0)
|
string draftId = prodParam.productDraftId.ParseToString();
|
||||||
|
string parentSpecId = skuSpecItem.parentSpecId.ParseToString();
|
||||||
|
var rst = QueryOrAddSpec(shop, draftId, parentSpecId, skuSpecItem.specName);
|
||||||
|
if (rst.Contains("\"success\":true"))
|
||||||
{
|
{
|
||||||
skuSpecItem.specId = specId;
|
long specId = BaseRegex.GetLongJson(ref rst, "specId");
|
||||||
|
if (specId > 0)
|
||||||
|
{
|
||||||
|
skuSpecItem.specId = specId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Thread.Sleep(Randomx.GetId(100, 500));
|
||||||
}
|
}
|
||||||
Thread.Sleep(Randomx.GetId(100, 500));
|
skuItem.productSkuSpecReqs.Add(skuSpecItem);
|
||||||
}
|
}
|
||||||
skuItem.productSkuSpecReqs.Add(skuSpecItem);
|
skuItem.productSkuSuggestedPriceReq = JsonHelper.DeserializeJsonToObject<ProductSkuSuggestedPriceReq>(
|
||||||
}
|
JsonHelper.SerializeObject(skuInfo.productSkuSuggestedPrice));
|
||||||
skuItem.productSkuSuggestedPriceReq = JsonHelper.DeserializeJsonToObject<ProductSkuSuggestedPriceReq>(
|
// 建议售价不能为空
|
||||||
JsonHelper.SerializeObject(skuInfo.productSkuSuggestedPrice));
|
if (skuItem.productSkuSuggestedPriceReq == null)
|
||||||
// 建议售价不能为空
|
|
||||||
if (skuItem.productSkuSuggestedPriceReq == null)
|
|
||||||
{
|
|
||||||
skuItem.productSkuSuggestedPriceReq = new ProductSkuSuggestedPriceReq();
|
|
||||||
}
|
|
||||||
if (skuItem.productSkuSuggestedPriceReq.suggestedPrice == null && skuItem.productSkuSuggestedPriceReq.specialSuggestedPrice == null)
|
|
||||||
{
|
|
||||||
skuItem.productSkuSuggestedPriceReq.specialSuggestedPrice = "NA";
|
|
||||||
}
|
|
||||||
skuItem.productSkuThumbUrlI18nReqs = skuInfo.productSkuThumbUrlI18nVOList;
|
|
||||||
skuItem.productSkuUsSuggestedPriceReq = JsonHelper.DeserializeJsonToObject<ProductSkuUsSuggestedPriceReq>(
|
|
||||||
JsonHelper.SerializeObject(skuInfo.productSkuUsSuggestedPrice));
|
|
||||||
//敏感属性
|
|
||||||
skuItem.productSkuWhExtAttrReq = new ProductSkuWhExtAttrReq()
|
|
||||||
{
|
|
||||||
productSkuBarCodeReqs = skuInfo.productSkuWhExtAttr.productSkuBarCodes == null ? new List<object>() : skuInfo.productSkuWhExtAttr.productSkuBarCodes,
|
|
||||||
productSkuSensitiveAttrReq = new ProductSkuSensitiveAttrReq()
|
|
||||||
{
|
{
|
||||||
//isSensitive = skuInfo.productSkuWhExtAttr.productSkuSensitiveAttr.isSensitive,
|
skuItem.productSkuSuggestedPriceReq = new ProductSkuSuggestedPriceReq();
|
||||||
//sensitiveList = skuInfo.productSkuWhExtAttr.productSkuSensitiveAttr.sensitiveList,
|
|
||||||
isSensitive = 0,
|
|
||||||
sensitiveList = new List<object>(),
|
|
||||||
},
|
|
||||||
productSkuSensitiveLimitReq = JsonHelper.DeserializeJsonToObject<ProductSkuSensitiveLimitReq>(
|
|
||||||
JsonHelper.SerializeObject(skuInfo.productSkuWhExtAttr.productSkuSensitiveLimit)),
|
|
||||||
productSkuVolumeReq = JsonHelper.DeserializeJsonToObject<ProductSkuVolumeReq>(
|
|
||||||
JsonHelper.SerializeObject(skuInfo.productSkuWhExtAttr.productSkuVolume)),
|
|
||||||
productSkuWeightReq = JsonHelper.DeserializeJsonToObject<ProductSkuWeightReq>(
|
|
||||||
JsonHelper.SerializeObject(skuInfo.productSkuWhExtAttr.productSkuWeight)),
|
|
||||||
};
|
|
||||||
if (skuItem.productSkuWhExtAttrReq.productSkuSensitiveAttrReq.sensitiveList == null)
|
|
||||||
skuItem.productSkuWhExtAttrReq.productSkuSensitiveAttrReq.sensitiveList = new List<object>();
|
|
||||||
// 如果是液体,赋默认值1毫升(暂时注释)
|
|
||||||
//if (skuItem.productSkuWhExtAttrReq.productSkuSensitiveAttrReq.sensitiveList.Any(s => s.ParseToInt() == 140001))
|
|
||||||
//{
|
|
||||||
// if (skuItem.productSkuWhExtAttrReq.productSkuSensitiveLimitReq == null)
|
|
||||||
// {
|
|
||||||
// skuItem.productSkuWhExtAttrReq.productSkuSensitiveLimitReq = new ProductSkuSensitiveLimitReq();
|
|
||||||
// }
|
|
||||||
// if (skuItem.productSkuWhExtAttrReq.productSkuSensitiveLimitReq.maxLiquidCapacityHp == null)
|
|
||||||
// {
|
|
||||||
// skuItem.productSkuWhExtAttrReq.productSkuSensitiveLimitReq.maxLiquidCapacityHp = 1000;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (chkChangeSizeAndNumber.Checked) // 修改包装尺寸和单品数量
|
|
||||||
{
|
|
||||||
skuItem.productSkuWhExtAttrReq.productSkuVolumeReq.len = len * 10;
|
|
||||||
skuItem.productSkuWhExtAttrReq.productSkuVolumeReq.width = width * 10;
|
|
||||||
skuItem.productSkuWhExtAttrReq.productSkuVolumeReq.height = height * 10;
|
|
||||||
skuItem.productSkuWhExtAttrReq.productSkuWeightReq.value = weight * 1000;
|
|
||||||
}
|
|
||||||
skuItem.supplierPrice = skuInfo.supplierPrice;
|
|
||||||
// 按照批号原价取商品原价和加价规则并修改商品上传价格
|
|
||||||
if (chkOriginalPriceMarkUp.Checked)
|
|
||||||
{
|
|
||||||
var dbPrice = lstDbPrice.FirstOrDefault(p => p.ext_code == dbProd.ext_code);
|
|
||||||
if (dbPrice != null)
|
|
||||||
skuItem.supplierPrice = dbPrice.original_price * dbPrice.markup_times + dbPrice.extra_price;
|
|
||||||
}
|
|
||||||
if (chkAddPrice.Checked) //自定义加价
|
|
||||||
{
|
|
||||||
skuItem.supplierPrice = (skuInfo.supplierPrice * numAddPriceTimes.Value + numAddPrice.Value * 100).ParseToInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
#region 使用随机sku价格上传(第一个sku价格不变,此处有bug,平台最后的sku排列不是按照提交上去的顺序排的)
|
|
||||||
if (skuCount != 1 && chkSkuRandomPrice.Checked)
|
|
||||||
{
|
|
||||||
for (int x = 0; x < 5 && skcItem.productSkuReqs.Any(s => s.supplierPrice == skuItem.supplierPrice); x++)
|
|
||||||
{
|
|
||||||
int randomPrice = (this.numSkuRandomPrice.Value * 100).ParseToInt();
|
|
||||||
if (randomPrice < 2)
|
|
||||||
randomPrice = 2;
|
|
||||||
if (Randomx.GetId(2) == 1)
|
|
||||||
skuItem.supplierPrice = skuItem.supplierPrice.ParseToInt() + Randomx.GetId(1, randomPrice);
|
|
||||||
else
|
|
||||||
skuItem.supplierPrice = skuItem.supplierPrice.ParseToInt() - Randomx.GetId(1, randomPrice);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
if (skuItem.productSkuSuggestedPriceReq.suggestedPrice == null && skuItem.productSkuSuggestedPriceReq.specialSuggestedPrice == null)
|
||||||
else
|
{
|
||||||
{
|
skuItem.productSkuSuggestedPriceReq.specialSuggestedPrice = "NA";
|
||||||
|
}
|
||||||
|
skuItem.productSkuThumbUrlI18nReqs = skuInfo.productSkuThumbUrlI18nVOList;
|
||||||
|
skuItem.productSkuUsSuggestedPriceReq = JsonHelper.DeserializeJsonToObject<ProductSkuUsSuggestedPriceReq>(
|
||||||
|
JsonHelper.SerializeObject(skuInfo.productSkuUsSuggestedPrice));
|
||||||
|
//敏感属性
|
||||||
|
skuItem.productSkuWhExtAttrReq = new ProductSkuWhExtAttrReq()
|
||||||
|
{
|
||||||
|
productSkuBarCodeReqs = skuInfo.productSkuWhExtAttr.productSkuBarCodes == null ? new List<object>() : skuInfo.productSkuWhExtAttr.productSkuBarCodes,
|
||||||
|
productSkuSensitiveAttrReq = new ProductSkuSensitiveAttrReq()
|
||||||
|
{
|
||||||
|
//isSensitive = skuInfo.productSkuWhExtAttr.productSkuSensitiveAttr.isSensitive,
|
||||||
|
//sensitiveList = skuInfo.productSkuWhExtAttr.productSkuSensitiveAttr.sensitiveList,
|
||||||
|
isSensitive = 0,
|
||||||
|
sensitiveList = new List<object>(),
|
||||||
|
},
|
||||||
|
productSkuSensitiveLimitReq = JsonHelper.DeserializeJsonToObject<ProductSkuSensitiveLimitReq>(
|
||||||
|
JsonHelper.SerializeObject(skuInfo.productSkuWhExtAttr.productSkuSensitiveLimit)),
|
||||||
|
productSkuVolumeReq = JsonHelper.DeserializeJsonToObject<ProductSkuVolumeReq>(
|
||||||
|
JsonHelper.SerializeObject(skuInfo.productSkuWhExtAttr.productSkuVolume)),
|
||||||
|
productSkuWeightReq = JsonHelper.DeserializeJsonToObject<ProductSkuWeightReq>(
|
||||||
|
JsonHelper.SerializeObject(skuInfo.productSkuWhExtAttr.productSkuWeight)),
|
||||||
|
};
|
||||||
|
if (skuItem.productSkuWhExtAttrReq.productSkuSensitiveAttrReq.sensitiveList == null)
|
||||||
|
skuItem.productSkuWhExtAttrReq.productSkuSensitiveAttrReq.sensitiveList = new List<object>();
|
||||||
|
// 如果是液体,赋默认值1毫升(暂时注释)
|
||||||
|
//if (skuItem.productSkuWhExtAttrReq.productSkuSensitiveAttrReq.sensitiveList.Any(s => s.ParseToInt() == 140001))
|
||||||
|
//{
|
||||||
|
// if (skuItem.productSkuWhExtAttrReq.productSkuSensitiveLimitReq == null)
|
||||||
|
// {
|
||||||
|
// skuItem.productSkuWhExtAttrReq.productSkuSensitiveLimitReq = new ProductSkuSensitiveLimitReq();
|
||||||
|
// }
|
||||||
|
// if (skuItem.productSkuWhExtAttrReq.productSkuSensitiveLimitReq.maxLiquidCapacityHp == null)
|
||||||
|
// {
|
||||||
|
// skuItem.productSkuWhExtAttrReq.productSkuSensitiveLimitReq.maxLiquidCapacityHp = 1000;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
}
|
if (chkChangeSizeAndNumber.Checked) // 修改包装尺寸和单品数量
|
||||||
#endregion
|
{
|
||||||
|
skuItem.productSkuWhExtAttrReq.productSkuVolumeReq.len = len * 10;
|
||||||
|
skuItem.productSkuWhExtAttrReq.productSkuVolumeReq.width = width * 10;
|
||||||
|
skuItem.productSkuWhExtAttrReq.productSkuVolumeReq.height = height * 10;
|
||||||
|
skuItem.productSkuWhExtAttrReq.productSkuWeightReq.value = weight * 1000;
|
||||||
|
}
|
||||||
|
skuItem.supplierPrice = skuInfo.supplierPrice;
|
||||||
|
// 按照批号原价取商品原价和加价规则并修改商品上传价格
|
||||||
|
if (chkOriginalPriceMarkUp.Checked)
|
||||||
|
{
|
||||||
|
var dbPrice = lstDbPrice.FirstOrDefault(p => p.ext_code == dbProd.ext_code);
|
||||||
|
if (dbPrice != null)
|
||||||
|
skuItem.supplierPrice = dbPrice.original_price * dbPrice.markup_times + dbPrice.extra_price;
|
||||||
|
}
|
||||||
|
if (chkAddPrice.Checked) //自定义加价
|
||||||
|
{
|
||||||
|
skuItem.supplierPrice = (skuInfo.supplierPrice * numAddPriceTimes.Value + numAddPrice.Value * 100).ParseToInt();
|
||||||
|
}
|
||||||
|
|
||||||
skuItem.thumbUrl = skuInfo.thumbUrl;
|
#region 使用随机sku价格上传(第一个sku价格不变,此处有bug,平台最后的sku排列不是按照提交上去的顺序排的)
|
||||||
// 自定义sku图
|
if (skuCount != 1 && chkSkuRandomPrice.Checked)
|
||||||
if (chkCustomPic.Checked)
|
{
|
||||||
{
|
for (int x = 0; x < 5 && skcItem.productSkuReqs.Any(s => s.supplierPrice == skuItem.supplierPrice); x++)
|
||||||
var skuCopy = JsonHelper.DeserializeJsonToObject<ProductSkuReqsItem>(JsonHelper.SerializeObject(skuItem));
|
{
|
||||||
realSkuItems.Add(skuCopy);
|
int randomPrice = (this.numSkuRandomPrice.Value * 100).ParseToInt();
|
||||||
|
if (randomPrice < 2)
|
||||||
|
randomPrice = 2;
|
||||||
|
if (Randomx.GetId(2) == 1)
|
||||||
|
skuItem.supplierPrice = skuItem.supplierPrice.ParseToInt() + Randomx.GetId(1, randomPrice);
|
||||||
|
else
|
||||||
|
skuItem.supplierPrice = skuItem.supplierPrice.ParseToInt() - Randomx.GetId(1, randomPrice);
|
||||||
|
|
||||||
var imgUrlRst = GetCustomImg(shop, prodParam.productDraftId.ParseToString());
|
}
|
||||||
if (imgUrlRst.Contains("\"success\":false"))
|
}
|
||||||
return imgUrlRst;
|
|
||||||
skuItem.thumbUrl = imgUrlRst;
|
|
||||||
Thread.Sleep(Randomx.GetId(50, 100));
|
|
||||||
}
|
|
||||||
//自定义ai图(ai图sku)
|
|
||||||
if (chkAiSkuAndMainImg.Checked)
|
|
||||||
{
|
|
||||||
var skuCopy = JsonHelper.DeserializeJsonToObject<ProductSkuReqsItem>(JsonHelper.SerializeObject(skuItem));
|
|
||||||
realSkuItems.Add(skuCopy);
|
|
||||||
|
|
||||||
AiSkuImgInfo aiSkuImgInfo = null;
|
|
||||||
// 把每次随出来的图片暂存起来,相同颜色规格的sku直接获取图片地址即可
|
|
||||||
if (aiImgInfoDic.Keys.Contains(skuInfo.productSkuSpecList[0].specId.ParseToString()))
|
|
||||||
aiSkuImgInfo = aiImgInfoDic[skuInfo.productSkuSpecList[0].specId.ParseToString()];
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string productId = prodInfo.productId.ParseToString();
|
|
||||||
string specId = skuInfo.productSkuSpecList[0].specId.ParseToString();
|
|
||||||
var aiSkuImgLst = DouBaoImgCefForm.GetSkuImgList(productId, specId, 3, true); // 随机获取3张sku的ai图片
|
|
||||||
if (aiSkuImgLst.Count > 0)
|
|
||||||
{
|
|
||||||
aiImgInfoList.AddRange(aiSkuImgLst);
|
|
||||||
|
|
||||||
int index = Randomx.GetId(aiSkuImgLst.Count + 1);
|
|
||||||
if (index == aiSkuImgLst.Count)
|
|
||||||
{
|
|
||||||
aiSkuImgInfo = new AiSkuImgInfo()
|
|
||||||
{
|
|
||||||
product_id = prodInfo.productId.ParseToString(),
|
|
||||||
spec_id = skuInfo.productSkuSpecList[0].specId.ParseToString(),
|
|
||||||
spec_name = skuInfo.productSkuSpecList[0].specName,
|
|
||||||
img_url = skuInfo.thumbUrl,
|
|
||||||
original_img_url = skuInfo.thumbUrl,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
aiSkuImgInfo = aiSkuImgLst[index];
|
|
||||||
aiImgInfoDic[skuInfo.productSkuSpecList[0].specId.ParseToString()] = aiSkuImgInfo;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
if (aiSkuImgInfo != null)
|
skuItem.thumbUrl = skuInfo.thumbUrl;
|
||||||
|
// 自定义sku图
|
||||||
|
if (chkCustomPic.Checked)
|
||||||
{
|
{
|
||||||
var imgUrlRst = aiSkuImgInfo.img_url;
|
var skuCopy = JsonHelper.DeserializeJsonToObject<ProductSkuReqsItem>(JsonHelper.SerializeObject(skuItem));
|
||||||
if (string.IsNullOrWhiteSpace(imgUrlRst))
|
realSkuItems.Add(skuCopy);
|
||||||
{
|
|
||||||
imgUrlRst = UploadAiSkuImg(shop, prodParam.productDraftId.ParseToString(), aiSkuImgInfo.img_base64, aiSkuImgInfo.img_md5);
|
|
||||||
if (imgUrlRst.Contains("\"success\":false"))
|
|
||||||
return imgUrlRst;
|
|
||||||
aiSkuImgInfo.img_url = imgUrlRst;
|
|
||||||
|
|
||||||
var url = BaseClass.BuildObjString("product/mdy_base64_img_url");
|
var imgUrlRst = GetCustomImg(shop, prodParam.productDraftId.ParseToString());
|
||||||
var data = UserLogin.GetSignaturex() +
|
if (imgUrlRst.Contains("\"success\":false"))
|
||||||
"&db_id=" + aiSkuImgInfo.img_base64_db_id;
|
return imgUrlRst;
|
||||||
data += "&img_url=" + imgUrlRst;
|
|
||||||
var rst = GetHtml.PostUtf8(url, data);
|
|
||||||
}
|
|
||||||
skuItem.thumbUrl = imgUrlRst;
|
skuItem.thumbUrl = imgUrlRst;
|
||||||
if(aiSkuImgInfo.img_base64_db_id > 0)
|
|
||||||
{
|
|
||||||
// 使用次数+1
|
|
||||||
aiSkuImgInfo.is_use = true;
|
|
||||||
}
|
|
||||||
Thread.Sleep(Randomx.GetId(50, 100));
|
Thread.Sleep(Randomx.GetId(50, 100));
|
||||||
}
|
}
|
||||||
}
|
//自定义ai图(ai图sku)
|
||||||
|
if (chkAiSkuAndMainImg.Checked)
|
||||||
|
{
|
||||||
|
var skuCopy = JsonHelper.DeserializeJsonToObject<ProductSkuReqsItem>(JsonHelper.SerializeObject(skuItem));
|
||||||
|
realSkuItems.Add(skuCopy);
|
||||||
|
|
||||||
skcItem.productSkuReqs.Add(skuItem);
|
AiSkuImgInfo aiSkuImgInfo = null;
|
||||||
|
// 把每次随出来的图片暂存起来,相同颜色规格的sku直接获取图片地址即可
|
||||||
|
if (aiImgInfoDic.Keys.Contains(skuInfo.productSkuSpecList[0].specId.ParseToString()))
|
||||||
|
aiSkuImgInfo = aiImgInfoDic[skuInfo.productSkuSpecList[0].specId.ParseToString()];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string productId = prodInfo.productId.ParseToString();
|
||||||
|
string specId = skuInfo.productSkuSpecList[0].specId.ParseToString();
|
||||||
|
var aiSkuImgLst = DouBaoImgCefForm.GetSkuImgList(productId, specId, 3, true); // 随机获取3张sku的ai图片
|
||||||
|
if (aiSkuImgLst.Count > 0)
|
||||||
|
{
|
||||||
|
aiImgInfoList.AddRange(aiSkuImgLst);
|
||||||
|
|
||||||
|
int index = Randomx.GetId(aiSkuImgLst.Count + 1);
|
||||||
|
if (index == aiSkuImgLst.Count)
|
||||||
|
{
|
||||||
|
aiSkuImgInfo = new AiSkuImgInfo()
|
||||||
|
{
|
||||||
|
product_id = prodInfo.productId.ParseToString(),
|
||||||
|
spec_id = skuInfo.productSkuSpecList[0].specId.ParseToString(),
|
||||||
|
spec_name = skuInfo.productSkuSpecList[0].specName,
|
||||||
|
img_url = skuInfo.thumbUrl,
|
||||||
|
original_img_url = skuInfo.thumbUrl,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aiSkuImgInfo = aiSkuImgLst[index];
|
||||||
|
aiImgInfoDic[skuInfo.productSkuSpecList[0].specId.ParseToString()] = aiSkuImgInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aiSkuImgInfo != null)
|
||||||
|
{
|
||||||
|
var imgUrlRst = aiSkuImgInfo.img_url;
|
||||||
|
if (string.IsNullOrWhiteSpace(imgUrlRst))
|
||||||
|
{
|
||||||
|
imgUrlRst = UploadAiSkuImg(shop, prodParam.productDraftId.ParseToString(), aiSkuImgInfo.img_base64, aiSkuImgInfo.img_md5);
|
||||||
|
if (imgUrlRst.Contains("\"success\":false"))
|
||||||
|
return imgUrlRst;
|
||||||
|
aiSkuImgInfo.img_url = imgUrlRst;
|
||||||
|
|
||||||
|
var url = BaseClass.BuildObjString("product/mdy_base64_img_url");
|
||||||
|
var data = UserLogin.GetSignaturex() +
|
||||||
|
"&db_id=" + aiSkuImgInfo.img_base64_db_id;
|
||||||
|
data += "&img_url=" + imgUrlRst;
|
||||||
|
var rst = GetHtml.PostUtf8(url, data);
|
||||||
|
}
|
||||||
|
skuItem.thumbUrl = imgUrlRst;
|
||||||
|
if (aiSkuImgInfo.img_base64_db_id > 0)
|
||||||
|
{
|
||||||
|
// 使用次数+1
|
||||||
|
aiSkuImgInfo.is_use = true;
|
||||||
|
}
|
||||||
|
Thread.Sleep(Randomx.GetId(50, 100));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
skcItem.productSkuReqs.Add(skuItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return "{\"success\":false,\"status\":\"未上传\"," +
|
||||||
|
"\"productDraftId\":\"" + prodParam.productDraftId.ParseToString() + "\"," +
|
||||||
|
"\"errMsg\":\"sku生成失败," + ex?.Message + "\"}";
|
||||||
|
}
|
||||||
|
|
||||||
prodParam.productSkcReqs.Add(skcItem);
|
prodParam.productSkcReqs.Add(skcItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2583,16 +2622,19 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
|||||||
string imgName = "\\图片" + Randomx.GetId(1000, 9999) + ".jpg";
|
string imgName = "\\图片" + Randomx.GetId(1000, 9999) + ".jpg";
|
||||||
sImgPath += imgName;
|
sImgPath += imgName;
|
||||||
// 使用MemoryStream创建图片对象
|
// 使用MemoryStream创建图片对象
|
||||||
byte[] imageBytes = Convert.FromBase64String(imgBase64);
|
byte[] imageBytes = Convert.FromBase64String(imgBase64); try
|
||||||
using (MemoryStream ms = new MemoryStream(imageBytes))
|
|
||||||
{
|
{
|
||||||
Image image = Image.FromStream(ms);
|
using (MemoryStream ms = new MemoryStream(imageBytes))
|
||||||
// 保存图片到文件系统
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
|
Image image = Image.FromStream(ms);
|
||||||
|
// 保存图片到文件系统
|
||||||
|
|
||||||
image.Save(sImgPath, System.Drawing.Imaging.ImageFormat.Jpeg);
|
image.Save(sImgPath, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||||
}
|
}
|
||||||
catch (Exception ex) { return "存图失败 " + ex.Message; }
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return "存图失败 " + ex.Message;
|
||||||
}
|
}
|
||||||
var uploadImgRst = UploadImage(shop, productDraftId, sImgPath, signature);
|
var uploadImgRst = UploadImage(shop, productDraftId, sImgPath, signature);
|
||||||
var imgUrl = BaseRegex.GetStringJson(ref uploadImgRst, "url");
|
var imgUrl = BaseRegex.GetStringJson(ref uploadImgRst, "url");
|
||||||
@@ -3212,6 +3254,18 @@ Content-Disposition: form-data; name=""sign""
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void displayLoginStatusColor(DataGridViewCell cell, string loginStatus = "在线")
|
||||||
|
{
|
||||||
|
bool canUse = loginStatus == "在线";
|
||||||
|
if (cell is DataGridViewLinkCell)
|
||||||
|
{
|
||||||
|
(cell as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red;
|
||||||
|
(cell as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red;
|
||||||
|
(cell as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed;
|
||||||
|
(cell as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static int CountChineseCharacters(string text)
|
public static int CountChineseCharacters(string text)
|
||||||
{
|
{
|
||||||
// 使用正则表达式匹配中文字符
|
// 使用正则表达式匹配中文字符
|
||||||
@@ -3219,5 +3273,18 @@ Content-Disposition: form-data; name=""sign""
|
|||||||
MatchCollection matches = Regex.Matches(text, pattern);
|
MatchCollection matches = Regex.Matches(text, pattern);
|
||||||
return matches.Count;
|
return matches.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void btnForceEnable_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(BaseMsgForm.ShowConfirm("确定解锁吗?可能造成性能损耗或重复上传。").DialogResult == DialogResult.OK)
|
||||||
|
{
|
||||||
|
//if (AddProd != null)
|
||||||
|
//AddProd.Dispose();
|
||||||
|
//AddProd.Wait(1000);
|
||||||
|
//if (cancellationTokenSource != null)
|
||||||
|
// cancellationTokenSource.Cancel();
|
||||||
|
this.btnAdd.Enabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
|||||||
|
|
||||||
List<string> skuRandomLetterArr = new List<string> { "~", "#", "¥", "%", "&", "*", "(", ")", "(", ")", "+", "-", "_", "=", "【", "】", "·", "|", "《", "》" };
|
List<string> skuRandomLetterArr = new List<string> { "~", "#", "¥", "%", "&", "*", "(", ")", "(", ")", "+", "-", "_", "=", "【", "】", "·", "|", "《", "》" };
|
||||||
|
|
||||||
List<TemuDBProductSelect> lstAdminTemuDBProductSelect = new List<TemuDBProductSelect>();
|
NaiBa.Util.ConcurrentList<TemuDBProductSelect> lstAdminTemuDBProductSelect = new NaiBa.Util.ConcurrentList<TemuDBProductSelect>();
|
||||||
List<ShopLoginInfo> shopLst = new List<ShopLoginInfo>();
|
List<ShopLoginInfo> shopLst = new List<ShopLoginInfo>();
|
||||||
|
|
||||||
public ProductThirdSelectListManageForm()
|
public ProductThirdSelectListManageForm()
|
||||||
@@ -173,6 +173,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
|||||||
"");
|
"");
|
||||||
|
|
||||||
dgvSelectProduct.Rows[rowIndex].Height = 60;
|
dgvSelectProduct.Rows[rowIndex].Height = 60;
|
||||||
|
displayLoginStatusColor(dgvSelectProduct.Rows[rowIndex].Cells["colLogin"], dgvSelectProduct.Rows[rowIndex].Cells["colLogin"].Value.ParseToString());
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,9 +406,10 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
|||||||
shopLoginForm.ShowDialog();
|
shopLoginForm.ShowDialog();
|
||||||
foreach (DataGridViewRow row in this.dgvSelectProduct.Rows)
|
foreach (DataGridViewRow row in this.dgvSelectProduct.Rows)
|
||||||
{
|
{
|
||||||
if (row.Cells["colSelectId"].Value.ParseToString() == shop.ShopId)
|
if (row.Cells["colSupplierId"].Value.ParseToString() == shop.ShopId)
|
||||||
{
|
{
|
||||||
row.Cells["colLogin"].Value = shop.LoginStatus2 == "国际版在线" ? "在线" : "登录";
|
row.Cells["colLogin"].Value = shop.LoginStatus2 == "国际版在线" ? "在线" : "登录";
|
||||||
|
displayLoginStatusColor(row.Cells["colLogin"], row.Cells["colLogin"].Value.ParseToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -620,6 +622,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
|||||||
Invoke(new Action(() =>
|
Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
row.Cells["colOpResult"].Value = "店铺" + shop.LoginStatus;
|
row.Cells["colOpResult"].Value = "店铺" + shop.LoginStatus;
|
||||||
|
displayLoginStatusColor(row.Cells["colLogin"], row.Cells["colLogin"].Value.ParseToString());
|
||||||
}));
|
}));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -629,6 +632,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
|||||||
Invoke(new Action(() =>
|
Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
row.Cells["colOpResult"].Value = "店铺" + shop.LoginStatus2;
|
row.Cells["colOpResult"].Value = "店铺" + shop.LoginStatus2;
|
||||||
|
displayLoginStatusColor(row.Cells["colLogin"], row.Cells["colLogin"].Value.ParseToString());
|
||||||
}));
|
}));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1976,5 +1980,17 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
|||||||
if (cancellationTokenSource != null)
|
if (cancellationTokenSource != null)
|
||||||
cancellationTokenSource.Cancel();
|
cancellationTokenSource.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void displayLoginStatusColor(DataGridViewCell cell, string loginStatus = "在线")
|
||||||
|
{
|
||||||
|
bool canUse = loginStatus == "在线";
|
||||||
|
if (cell is DataGridViewLinkCell)
|
||||||
|
{
|
||||||
|
(cell as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Green : Color.Red;
|
||||||
|
(cell as DataGridViewLinkCell).LinkColor = canUse ? Color.Green : Color.Red;
|
||||||
|
(cell as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightGreen : Color.OrangeRed;
|
||||||
|
(cell as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkGreen : Color.DarkRed;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,6 +76,8 @@ namespace TemuKJD.ToolForms
|
|||||||
|
|
||||||
var prodInfo = JsonHelper.DeserializeJsonToObject<TemuDetailProductInfo>(dbProd.product_json);
|
var prodInfo = JsonHelper.DeserializeJsonToObject<TemuDetailProductInfo>(dbProd.product_json);
|
||||||
var ucImgChangeList = new List<UcSkuImgItem>();
|
var ucImgChangeList = new List<UcSkuImgItem>();
|
||||||
|
this.TitleText = "豆包生成SKU图 主店ID:" + prodInfo.supplierId.ParseToString() + " SKC:" + prodInfo.productSkcList.FirstOrDefault()?.productSkcId +
|
||||||
|
" SKU:" + prodInfo.productId + " 名称:" + prodInfo.productName;
|
||||||
foreach(var sku in prodInfo.productSkcList[0].productSkuList)
|
foreach(var sku in prodInfo.productSkcList[0].productSkuList)
|
||||||
{
|
{
|
||||||
var imgUrl = sku.thumbUrl.Replace("https://", "http://");
|
var imgUrl = sku.thumbUrl.Replace("https://", "http://");
|
||||||
|
|||||||
Reference in new issue
Block a user