1选品数据库及库存上传相关功能 2修复部分商品详情信息特殊符号导致无法上传问题

This commit is contained in:
wule committed 2025-07-24 15:40:39 +08:00
1 parent adf75f9fc1
commit 281cf2e338
38 files changed
+1496 -440

No files matched your search

@@ -33,7 +33,6 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProductThirdSelectListManageForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.chkNoSubSa = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.btnSetSubSa = new TemuKJD.UserControls.ButtonEx();
this.cmbStatus = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
@@ -54,9 +53,12 @@
this.label3 = new System.Windows.Forms.Label();
this.txtCat = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.chkNoSubSa = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.dgvSelectProduct = new TemuKJD.UserComponent.DataGridViewEx();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colSelectId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSupplierId = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -64,6 +66,7 @@
this.colInShop = new System.Windows.Forms.DataGridViewLinkColumn();
this.colLogin = new System.Windows.Forms.DataGridViewLinkColumn();
this.colImportCookies = new System.Windows.Forms.DataGridViewLinkColumn();
this.colCopyCookies = new System.Windows.Forms.DataGridViewLinkColumn();
this.colSpuId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colSkcId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colProductSkcPic = new System.Windows.Forms.DataGridViewImageColumn();
@@ -71,13 +74,13 @@
this.colProductCat = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colExtCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDraftId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDraftId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colMdyTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSubSa = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colEditNotes = new System.Windows.Forms.DataGridViewLinkColumn();
this.ColDelete = new System.Windows.Forms.DataGridViewLinkColumn();
this.colOpResult = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -130,16 +133,6 @@
this.splitContainer1.SplitterDistance = 53;
this.splitContainer1.TabIndex = 2;
//
// chkNoSubSa
//
this.chkNoSubSa.AutoSize = true;
this.chkNoSubSa.Location = new System.Drawing.Point(1167, 17);
this.chkNoSubSa.Name = "chkNoSubSa";
this.chkNoSubSa.Size = new System.Drawing.Size(123, 21);
this.chkNoSubSa.TabIndex = 467;
this.chkNoSubSa.Text = "仅显示未分配超管";
this.chkNoSubSa.UseVisualStyleBackColor = true;
//
// btnSetSubSa
//
this.btnSetSubSa.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -348,6 +341,16 @@
this.label2.TabIndex = 426;
this.label2.Text = "类目:";
//
// chkNoSubSa
//
this.chkNoSubSa.AutoSize = true;
this.chkNoSubSa.Location = new System.Drawing.Point(1167, 17);
this.chkNoSubSa.Name = "chkNoSubSa";
this.chkNoSubSa.Size = new System.Drawing.Size(123, 21);
this.chkNoSubSa.TabIndex = 467;
this.chkNoSubSa.Text = "仅显示未分配超管";
this.chkNoSubSa.UseVisualStyleBackColor = true;
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -406,6 +409,7 @@
this.colInShop,
this.colLogin,
this.colImportCookies,
this.colCopyCookies,
this.colSpuId,
this.colSkcId,
this.colProductSkcPic,
@@ -416,6 +420,8 @@
this.colDraftId,
this.colMdyTime,
this.colSubSa,
this.colNotes,
this.colEditNotes,
this.ColDelete,
this.colOpResult});
this.dgvSelectProduct.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -425,172 +431,9 @@
this.dgvSelectProduct.RowHeadersWidth = 51;
this.dgvSelectProduct.RowTemplate.Height = 23;
this.dgvSelectProduct.Size = new System.Drawing.Size(1430, 552);
this.dgvSelectProduct.TabIndex = 188;
this.dgvSelectProduct.TabIndex = 190;
this.dgvSelectProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSelectProduct_CellContentClick);
//
// colSelect
//
this.colSelect.HeaderText = "选择";
this.colSelect.MinimumWidth = 6;
this.colSelect.Name = "colSelect";
this.colSelect.ReadOnly = true;
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelect.Width = 30;
//
// colSelectId
//
this.colSelectId.HeaderText = "认领Id";
this.colSelectId.MinimumWidth = 6;
this.colSelectId.Name = "colSelectId";
this.colSelectId.ReadOnly = true;
this.colSelectId.Visible = false;
this.colSelectId.Width = 125;
//
// colSupplierId
//
this.colSupplierId.HeaderText = "店铺Id";
this.colSupplierId.MinimumWidth = 6;
this.colSupplierId.Name = "colSupplierId";
this.colSupplierId.ReadOnly = true;
this.colSupplierId.Width = 125;
//
// colSupplierName
//
this.colSupplierName.HeaderText = "店铺名称";
this.colSupplierName.MinimumWidth = 6;
this.colSupplierName.Name = "colSupplierName";
this.colSupplierName.ReadOnly = true;
this.colSupplierName.Width = 110;
//
// colInShop
//
this.colInShop.HeaderText = "进店";
this.colInShop.MinimumWidth = 6;
this.colInShop.Name = "colInShop";
this.colInShop.ReadOnly = true;
this.colInShop.Width = 45;
//
// colLogin
//
this.colLogin.HeaderText = "登录";
this.colLogin.MinimumWidth = 6;
this.colLogin.Name = "colLogin";
this.colLogin.ReadOnly = true;
this.colLogin.Width = 45;
//
// colImportCookies
//
this.colImportCookies.HeaderText = "导入Cookies";
this.colImportCookies.Name = "colImportCookies";
this.colImportCookies.ReadOnly = true;
this.colImportCookies.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colImportCookies.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colImportCookies.Width = 85;
//
// colSpuId
//
this.colSpuId.HeaderText = "商品SPU";
this.colSpuId.MinimumWidth = 6;
this.colSpuId.Name = "colSpuId";
this.colSpuId.ReadOnly = true;
this.colSpuId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSpuId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSpuId.Width = 90;
//
// colSkcId
//
this.colSkcId.FillWeight = 150F;
this.colSkcId.HeaderText = "商品SKC";
this.colSkcId.MinimumWidth = 6;
this.colSkcId.Name = "colSkcId";
this.colSkcId.ReadOnly = true;
this.colSkcId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSkcId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSkcId.Width = 80;
//
// colProductSkcPic
//
this.colProductSkcPic.HeaderText = "Skc图片";
this.colProductSkcPic.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.colProductSkcPic.MinimumWidth = 6;
this.colProductSkcPic.Name = "colProductSkcPic";
this.colProductSkcPic.ReadOnly = true;
this.colProductSkcPic.Width = 60;
//
// colProductName
//
this.colProductName.HeaderText = "商品标题";
this.colProductName.MinimumWidth = 6;
this.colProductName.Name = "colProductName";
this.colProductName.ReadOnly = true;
this.colProductName.Width = 260;
//
// colProductCat
//
this.colProductCat.HeaderText = "商品类目";
this.colProductCat.MinimumWidth = 6;
this.colProductCat.Name = "colProductCat";
this.colProductCat.ReadOnly = true;
this.colProductCat.Width = 90;
//
// colExtCode
//
this.colExtCode.HeaderText = "商品货号";
this.colExtCode.MinimumWidth = 6;
this.colExtCode.Name = "colExtCode";
this.colExtCode.ReadOnly = true;
this.colExtCode.Width = 125;
//
// colStatus
//
this.colStatus.HeaderText = "状态";
this.colStatus.MinimumWidth = 6;
this.colStatus.Name = "colStatus";
this.colStatus.ReadOnly = true;
this.colStatus.Width = 80;
//
// colDraftId
//
this.colDraftId.HeaderText = "草稿箱Id";
this.colDraftId.MinimumWidth = 6;
this.colDraftId.Name = "colDraftId";
this.colDraftId.ReadOnly = true;
this.colDraftId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colDraftId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.colDraftId.Width = 125;
//
// colMdyTime
//
this.colMdyTime.HeaderText = "上传时间";
this.colMdyTime.MinimumWidth = 6;
this.colMdyTime.Name = "colMdyTime";
this.colMdyTime.ReadOnly = true;
this.colMdyTime.Width = 120;
//
// colSubSa
//
this.colSubSa.HeaderText = "二级超管";
this.colSubSa.Name = "colSubSa";
this.colSubSa.ReadOnly = true;
//
// ColDelete
//
this.ColDelete.HeaderText = "删除";
this.ColDelete.MinimumWidth = 6;
this.ColDelete.Name = "ColDelete";
this.ColDelete.ReadOnly = true;
this.ColDelete.Visible = false;
this.ColDelete.Width = 125;
//
// colOpResult
//
this.colOpResult.HeaderText = "操作结果";
this.colOpResult.MinimumWidth = 6;
this.colOpResult.Name = "colOpResult";
this.colOpResult.ReadOnly = true;
this.colOpResult.Width = 150;
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
@@ -614,6 +457,176 @@
this.statusBar.Size = new System.Drawing.Size(1438, 25);
this.statusBar.TabIndex = 5;
//
// colSelect
//
this.colSelect.HeaderText = "选择";
this.colSelect.Name = "colSelect";
this.colSelect.ReadOnly = true;
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelect.Width = 30;
//
// colSelectId
//
this.colSelectId.HeaderText = "认领Id";
this.colSelectId.Name = "colSelectId";
this.colSelectId.ReadOnly = true;
this.colSelectId.Visible = false;
this.colSelectId.Width = 125;
//
// colSupplierId
//
this.colSupplierId.HeaderText = "店铺Id";
this.colSupplierId.Name = "colSupplierId";
this.colSupplierId.ReadOnly = true;
this.colSupplierId.Width = 120;
//
// colSupplierName
//
this.colSupplierName.HeaderText = "店铺名称";
this.colSupplierName.Name = "colSupplierName";
this.colSupplierName.ReadOnly = true;
this.colSupplierName.Width = 110;
//
// colInShop
//
this.colInShop.HeaderText = "进店";
this.colInShop.Name = "colInShop";
this.colInShop.ReadOnly = true;
this.colInShop.Width = 38;
//
// colLogin
//
this.colLogin.HeaderText = "登录";
this.colLogin.Name = "colLogin";
this.colLogin.ReadOnly = true;
this.colLogin.Width = 38;
//
// colImportCookies
//
this.colImportCookies.HeaderText = "导入Cookies";
this.colImportCookies.Name = "colImportCookies";
this.colImportCookies.ReadOnly = true;
this.colImportCookies.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colImportCookies.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colImportCookies.Width = 85;
//
// colCopyCookies
//
this.colCopyCookies.HeaderText = "复制Cookies";
this.colCopyCookies.Name = "colCopyCookies";
this.colCopyCookies.ReadOnly = true;
this.colCopyCookies.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCopyCookies.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCopyCookies.Width = 85;
//
// colSpuId
//
this.colSpuId.HeaderText = "商品SPU";
this.colSpuId.Name = "colSpuId";
this.colSpuId.ReadOnly = true;
this.colSpuId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSpuId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSpuId.Width = 86;
//
// colSkcId
//
this.colSkcId.FillWeight = 150F;
this.colSkcId.HeaderText = "商品SKC";
this.colSkcId.Name = "colSkcId";
this.colSkcId.ReadOnly = true;
this.colSkcId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSkcId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSkcId.Width = 90;
//
// colProductSkcPic
//
this.colProductSkcPic.HeaderText = "Skc图片";
this.colProductSkcPic.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.colProductSkcPic.Name = "colProductSkcPic";
this.colProductSkcPic.ReadOnly = true;
this.colProductSkcPic.Width = 60;
//
// colProductName
//
this.colProductName.HeaderText = "商品标题";
this.colProductName.Name = "colProductName";
this.colProductName.ReadOnly = true;
this.colProductName.Width = 200;
//
// colProductCat
//
this.colProductCat.HeaderText = "商品类目";
this.colProductCat.Name = "colProductCat";
this.colProductCat.ReadOnly = true;
this.colProductCat.Width = 90;
//
// colExtCode
//
this.colExtCode.HeaderText = "商品货号";
this.colExtCode.Name = "colExtCode";
this.colExtCode.ReadOnly = true;
this.colExtCode.Width = 125;
//
// colStatus
//
this.colStatus.HeaderText = "状态";
this.colStatus.Name = "colStatus";
this.colStatus.ReadOnly = true;
this.colStatus.Width = 45;
//
// colDraftId
//
this.colDraftId.HeaderText = "草稿箱Id";
this.colDraftId.Name = "colDraftId";
this.colDraftId.ReadOnly = true;
this.colDraftId.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colDraftId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colDraftId.Width = 88;
//
// colMdyTime
//
this.colMdyTime.HeaderText = "上传时间";
this.colMdyTime.Name = "colMdyTime";
this.colMdyTime.ReadOnly = true;
this.colMdyTime.Width = 95;
//
// colSubSa
//
this.colSubSa.HeaderText = "二级超管";
this.colSubSa.Name = "colSubSa";
this.colSubSa.ReadOnly = true;
//
// colNotes
//
this.colNotes.HeaderText = "备注";
this.colNotes.Name = "colNotes";
this.colNotes.ReadOnly = true;
//
// colEditNotes
//
this.colEditNotes.HeaderText = "编辑备注";
this.colEditNotes.Name = "colEditNotes";
this.colEditNotes.ReadOnly = true;
this.colEditNotes.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colEditNotes.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colEditNotes.Width = 70;
//
// ColDelete
//
this.ColDelete.HeaderText = "删除";
this.ColDelete.Name = "ColDelete";
this.ColDelete.ReadOnly = true;
this.ColDelete.Visible = false;
this.ColDelete.Width = 125;
//
// colOpResult
//
this.colOpResult.HeaderText = "操作结果";
this.colOpResult.Name = "colOpResult";
this.colOpResult.ReadOnly = true;
this.colOpResult.Width = 150;
//
// ProductThirdSelectListManageForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -666,11 +679,11 @@
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtShopId;
private System.Windows.Forms.Label label6;
private UserComponent.DataGridViewEx dgvSelectProduct;
private System.Windows.Forms.ComboBox cmbStatus;
private System.Windows.Forms.Label label8;
private UserControls.ButtonEx btnSetSubSa;
private UserComponent.UcCheckBox chkNoSubSa;
private UserComponent.DataGridViewEx dgvSelectProduct;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colSelectId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
@@ -678,6 +691,7 @@
private System.Windows.Forms.DataGridViewLinkColumn colInShop;
private System.Windows.Forms.DataGridViewLinkColumn colLogin;
private System.Windows.Forms.DataGridViewLinkColumn colImportCookies;
private System.Windows.Forms.DataGridViewLinkColumn colCopyCookies;
private System.Windows.Forms.DataGridViewLinkColumn colSpuId;
private System.Windows.Forms.DataGridViewLinkColumn colSkcId;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
@@ -685,9 +699,11 @@
private System.Windows.Forms.DataGridViewTextBoxColumn colProductCat;
private System.Windows.Forms.DataGridViewTextBoxColumn colExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colStatus;
private System.Windows.Forms.DataGridViewTextBoxColumn colDraftId;
private System.Windows.Forms.DataGridViewLinkColumn colDraftId;
private System.Windows.Forms.DataGridViewTextBoxColumn colMdyTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSa;
private System.Windows.Forms.DataGridViewTextBoxColumn colNotes;
private System.Windows.Forms.DataGridViewLinkColumn colEditNotes;
private System.Windows.Forms.DataGridViewLinkColumn ColDelete;
private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult;
}
@@ -22,6 +22,7 @@ using System.Threading;
using TemuKJD.KJDForms.AdminForms;
using TemuKJD.KJDForms.ShopForms;
using TemuKJD.KJDForms.ProductSelectForms;
using System.Text.RegularExpressions;
namespace TemuKJD.KJDForms.ProductThirdSelectForms
{
@@ -73,6 +74,8 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
public void SearchDbProdSelect(int page)
{
shopLst.Clear();
if (InvokeRequired)
{
Invoke(new Action(() =>
@@ -98,19 +101,13 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
foreach (var prodSelect in lstAdminTemuDBProductSelect)
{
Image image = null;
try
{
if (!string.IsNullOrEmpty(prodSelect?.main_img))
{
using (Stream stream = WebRequest.Create(prodSelect.main_img.Replace("https", "http")).GetResponse().GetResponseStream())
{
image = Image.FromStream(stream);
}
}
}
catch (Exception ex)
{
}
string imgUrl = prodSelect?.main_img?.Replace("https", "http");
string rst = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out rst);
if (!string.IsNullOrEmpty(rst))
BaseMsgForm.ShowError(rst);
Invoke(new Action(() =>
{
int rowIndex = this.dgvSelectProduct.Rows.Add(
@@ -121,6 +118,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
"进店",
"登录",
"导入Cookies",
"复制Cookies",
prodSelect.spu_id,
prodSelect.skc_id,
image,//prod.main_img,
@@ -129,8 +127,10 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
prodSelect.ext_code,
prodSelect.status,
prodSelect.draft_id,
prodSelect.status == "待上传" ? "-" : prodSelect.mdy_time.ToString("yyyy/MM/dd HH:mm:ss"),
prodSelect.status == "待上传" ? "-" : prodSelect.mdy_time.ToString("yy/MM/dd HH:mm"),
prodSelect.operate_sub_sa_name == "" ? "-" : prodSelect.operate_sub_sa_name,
prodSelect.notes,
"编辑",
"删除",
"");
@@ -223,7 +223,7 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
return;
string headerText = dgvSelectProduct.Columns[e.ColumnIndex].HeaderText;
var dbId = dgvSelectProduct.Rows[e.RowIndex].Cells["colSelectId"].Value.ParseToString();
var dbProduct = lstAdminTemuDBProductSelect.FirstOrDefault(p => p.id.ToString() == dbId);
var dbSelectProduct = lstAdminTemuDBProductSelect.FirstOrDefault(p => p.id.ToString() == dbId);
var shopId = dgvSelectProduct.Rows[e.RowIndex].Cells["colSupplierId"].Value.ParseToString();
var draftId = dgvSelectProduct.Rows[e.RowIndex].Cells["colDraftId"].Value.ParseToString();
@@ -235,9 +235,9 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
//DeleteProduct(dbId);
break;
case "编辑备注":
//DbProductEditNotesForm editForm = new DbProductEditNotesForm(dbProduct);
//editForm.ShowDialog();
//dgvDbProduct.Rows[e.RowIndex].Cells["col_notes"].Value = dbProduct.notes;
ProductSelectEditNotesForm editForm = new ProductSelectEditNotesForm(dbSelectProduct, SetProductSelectNotesType.ThirdProduct);
editForm.ShowDialog();
dgvSelectProduct.Rows[e.RowIndex].Cells["colNotes"].Value = dbSelectProduct.notes;
break;
case "认领":
//Task.Run(() => { SelectProduct(new TemuDBProduct[] { dbProduct }); });
@@ -245,13 +245,13 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
case "草稿箱Id":
if (!string.IsNullOrEmpty(draftId))
{
//var shop = GetShop(shopId);
//AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
// draftId + "&from=productDraftList";
//adminLoginForm.openType = EnumOpenType.manage;
//adminLoginForm.WindowState = FormWindowState.Maximized;
//adminLoginForm.ShowDialog();
var shop = GetShop(shopId);
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
draftId + "&from=productDraftList";
adminLoginForm.openType = EnumOpenType.manage;
adminLoginForm.WindowState = FormWindowState.Maximized;
adminLoginForm.ShowDialog();
}
break;
case "进店":
@@ -283,6 +283,34 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
updateCookieForm.ShowDialog();
}
break;
case "复制Cookies":
{
var shop = GetShop(shopId);
string cookJs = "";
foreach (var shopCook in shop.Cookies.Split(';'))
{
var cookie = shopCook.Trim();
if (cookie.StartsWith("mc-pc-cookie-captcha-token="))
continue;
//if (!cookie.StartsWith("SUB_PASS_ID") && !cookie.StartsWith("_nano_fp"))
cookJs += "\r\ndocument.cookie='" + cookie.Substring(0, Math.Max(0, cookie.IndexOf("="))) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';";
}
foreach (var shopCook in shop.Cookies.Split(';'))
{
var cookie = shopCook.Trim();
if (cookie.StartsWith("mc-pc-cookie-captcha-token="))
continue;
if (!cookie.StartsWith("SUB_PASS_ID") && !cookie.StartsWith("_nano_fp"))
cookJs += "\r\ndocument.cookie='" + cookie + "; domain=.kuajingmaihuo.com;';";
else
cookJs += "\r\ndocument.cookie='" + cookie + "; domain=seller.kuajingmaihuo.com;';";
}
cookJs += "\r\nwindow.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');";
cookJs += "\r\nsetTimeout(() => { window.location.href='https://seller.kuajingmaihuo.com'; }, 200)";
Clipboard.SetDataObject(cookJs);
BaseMsgForm.ShowInfo("复制成功");
}
break;
case "":
dgvSelectProduct.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvSelectProduct.Rows[e.RowIndex].Cells["colSelect"].Value;
break;
@@ -438,8 +466,17 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
var result = "";
try
{
var prodDetailStr = GetHtml.UrlDecode(temuDBProd.product_json);
var productDetail = JsonHelper.DeserializeJsonToObject<TemuProductInfo>(prodDetailStr);
var prodDetailJson = GetHtml.UrlDecode(temuDBProd.product_json);
//‌错误原因‌:JSON反序列化时出现Bad JSON escape sequence错误,通常由字符串中包含非法转义字符或特殊字符导致。
// JSON标准要求反斜杠\后必须紧跟bfrnt/(如\n、\t等),否则会触发异常。 ‌
//‌解决方案‌:通过正则表达式替换字符串中的非法转义序列。
//string pattern = @"(\\[^bfrnt\\/'\""])"; //两个\后一个会被转义
//var prodDetailJsonReplace = Regex.Replace(prodDetailJson, pattern, "\\$1");
string pattern = @"([^\\])(\\[^bfrnt\\/'\""])";
var prodDetailJsonReplace = Regex.Replace(prodDetailJson, pattern, "$1\\$2");
string pattern2 = @"([^\\,:""{\[])(""[^,:""}\]])";//希伯来文中的引号转义在数据库中有时候会丢失,回来发现了给配上\符号
var prodDetailJsonReplace2 = Regex.Replace(prodDetailJsonReplace, pattern2, "$1\\$2");
var productDetail = JsonHelper.DeserializeJsonToObject<TemuProductInfo>(prodDetailJsonReplace2);
result = UploadProduct(shop, productDetail, temuDBProd.size_json); //将商品上传至草稿箱
if (result.Contains("登录过期"))
@@ -138,6 +138,9 @@
<metadata name="colImportCookies.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colCopyCookies.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSpuId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -165,6 +168,12 @@
<metadata name="colSubSa.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colNotes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colEditNotes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColDelete.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -223,16 +223,13 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
foreach (var prodSelect in lstTemuDBProductSelect)
{
Image image = null;
try
{
using (Stream stream = WebRequest.Create(prodSelect.main_img.Replace("https", "http")).GetResponse().GetResponseStream())
{
image = Image.FromStream(stream);
}
}
catch (Exception ex)
{
}
string imgUrl = prodSelect?.main_img?.Replace("https", "http");
string rst = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out rst);
if (!string.IsNullOrEmpty(rst))
BaseMsgForm.ShowError(rst);
Invoke(new Action(() =>
{
int rowIndex = this.dgvSelectProduct.Rows.Add(
@@ -354,9 +351,6 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
}
break;
case "编辑备注":
//DbProductEditNotesForm editForm = new DbProductEditNotesForm(dbProduct);
//editForm.ShowDialog();
//dgvDbProduct.Rows[e.RowIndex].Cells["col_notes"].Value = dbProduct.notes;
break;
case "草稿箱Id":
//if (!string.IsNullOrEmpty(draftId) && shop != null)