temu客户端上传功能 2.拼多多商品提取问题修复(25%)
This commit is contained in:
1 parent
2bb124e2d7
commit
62465769fe
13 files changed
+402
-210
No files matched your search
@@ -109,7 +109,7 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
SetForm(dbPriceMarkUpForm.Value);
|
||||
break;
|
||||
case "认领待上传":
|
||||
dbProductSelectListManageForm.Value.IsClientJit = false;
|
||||
dbProductSelectListManageForm.Value.ClientMode = DbProductSelectListManageForm.EnumClientMode.Admin;
|
||||
SetForm(dbProductSelectListManageForm.Value);
|
||||
break;
|
||||
case "库存上传":
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace TemuKJD.KJDForms.JITForms
|
||||
SetForm(dbProductListForm.Value);
|
||||
break;
|
||||
case "JIT商品上传":
|
||||
dDbProductSelectListManageForm.Value.IsClientJit = true;
|
||||
dDbProductSelectListManageForm.Value.ClientMode = DbProductSelectListManageForm.EnumClientMode.ClientJit;
|
||||
SetForm(dDbProductSelectListManageForm.Value);
|
||||
break;
|
||||
case "JIT商品核价":
|
||||
|
||||
+16
-8
@@ -35,8 +35,10 @@
|
||||
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("加入发货台");
|
||||
System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("设置进货价");
|
||||
System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("商品认领");
|
||||
System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("库存上传");
|
||||
System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("商品管理", new System.Windows.Forms.TreeNode[] {
|
||||
System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("库存记录");
|
||||
System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("商品上传");
|
||||
System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("库存上传");
|
||||
System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("商品管理", new System.Windows.Forms.TreeNode[] {
|
||||
treeNode1,
|
||||
treeNode2,
|
||||
treeNode3,
|
||||
@@ -44,7 +46,9 @@
|
||||
treeNode5,
|
||||
treeNode6,
|
||||
treeNode7,
|
||||
treeNode8});
|
||||
treeNode8,
|
||||
treeNode9,
|
||||
treeNode10});
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
@@ -149,12 +153,16 @@
|
||||
treeNode6.Text = "设置进货价";
|
||||
treeNode7.Name = "商品认领";
|
||||
treeNode7.Text = "商品认领";
|
||||
treeNode8.Name = "库存上传";
|
||||
treeNode8.Text = "库存上传";
|
||||
treeNode9.Name = "商品管理";
|
||||
treeNode9.Text = "商品管理";
|
||||
treeNode8.Name = "库存记录";
|
||||
treeNode8.Text = "库存记录";
|
||||
treeNode9.Name = "商品上传";
|
||||
treeNode9.Text = "商品上传";
|
||||
treeNode10.Name = "库存上传";
|
||||
treeNode10.Text = "库存上传";
|
||||
treeNode11.Name = "商品管理";
|
||||
treeNode11.Text = "商品管理";
|
||||
this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
|
||||
treeNode9});
|
||||
treeNode11});
|
||||
this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
|
||||
this.tv.Size = new System.Drawing.Size(140, 521);
|
||||
this.tv.TabIndex = 1;
|
||||
|
||||
@@ -29,6 +29,9 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
public Lazy<TemuAdsForm> temuAdsForm = new Lazy<TemuAdsForm>();
|
||||
public Lazy<JoinDeliveryForm> joinDeliveryFrom = new Lazy<JoinDeliveryForm>();
|
||||
|
||||
public Lazy<DbProductSelectListManageForm> productSelectListManageForm = new Lazy<DbProductSelectListManageForm>();
|
||||
public Lazy<ProductThirdSelectListManageForm> productThirdSelectListManageForm = new Lazy<ProductThirdSelectListManageForm>();
|
||||
|
||||
public ProductForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -75,40 +78,49 @@ namespace TemuKJD.KJDForms.ProductForms
|
||||
|
||||
//如果是一级菜单,不做任何动作
|
||||
if (e.Node.Parent == null) return;
|
||||
new Thread(() =>
|
||||
//new Thread(() =>
|
||||
//{
|
||||
//Thread.Sleep(200);
|
||||
//Invoke(new Action(() =>
|
||||
//{
|
||||
switch (e.Node.Name)
|
||||
{
|
||||
Thread.Sleep(200);
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
switch (e.Node.Name)
|
||||
{
|
||||
case "备货管理":
|
||||
SetForm(saleStockUpForm.Value);
|
||||
break;
|
||||
case "调价管理":
|
||||
SetForm(priceManageForm.Value);
|
||||
break;
|
||||
case "活动报名":
|
||||
SetForm(marketingActivityForm.Value);
|
||||
break;
|
||||
case "推广直通车":
|
||||
SetForm(temuAdsForm.Value);
|
||||
break;
|
||||
case "加入发货台":
|
||||
SetForm(joinDeliveryFrom.Value);
|
||||
break;
|
||||
case "设置进货价":
|
||||
SetForm(purchasePriceForm.Value);
|
||||
break;
|
||||
case "商品认领":
|
||||
SetForm(userSelectDbProductForm.Value);
|
||||
break;
|
||||
case "库存上传":
|
||||
SetForm(userSelectThirdProductForm.Value);
|
||||
break;
|
||||
}
|
||||
}));
|
||||
}).Start();
|
||||
case "备货管理":
|
||||
SetForm(saleStockUpForm.Value);
|
||||
break;
|
||||
case "调价管理":
|
||||
SetForm(priceManageForm.Value);
|
||||
break;
|
||||
case "活动报名":
|
||||
SetForm(marketingActivityForm.Value);
|
||||
break;
|
||||
case "推广直通车":
|
||||
SetForm(temuAdsForm.Value);
|
||||
break;
|
||||
case "加入发货台":
|
||||
SetForm(joinDeliveryFrom.Value);
|
||||
break;
|
||||
case "设置进货价":
|
||||
SetForm(purchasePriceForm.Value);
|
||||
break;
|
||||
case "商品认领":
|
||||
SetForm(userSelectDbProductForm.Value);
|
||||
break;
|
||||
case "库存记录":
|
||||
SetForm(userSelectThirdProductForm.Value);
|
||||
break;
|
||||
|
||||
case "商品上传":
|
||||
productSelectListManageForm.Value.ClientMode = DbProductSelectListManageForm.EnumClientMode.Client;
|
||||
SetForm(productSelectListManageForm.Value);
|
||||
break;
|
||||
case "库存上传":
|
||||
productThirdSelectListManageForm.Value.ClientMode = ProductThirdSelectListManageForm.EnumClientMode.Client;
|
||||
SetForm(productThirdSelectListManageForm.Value);
|
||||
break;
|
||||
}
|
||||
//}));
|
||||
//}).Start();
|
||||
}
|
||||
|
||||
public void SetTvSelect(string name)
|
||||
|
||||
@@ -34,7 +34,14 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
{
|
||||
public partial class DbProductSelectListManageForm : LRBaseForm
|
||||
{
|
||||
public bool IsClientJit { get; set; } = false;
|
||||
public enum EnumClientMode
|
||||
{
|
||||
Admin,
|
||||
Client,
|
||||
ClientJit,
|
||||
}
|
||||
|
||||
public EnumClientMode ClientMode { get; set; } = EnumClientMode.Admin;
|
||||
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
|
||||
|
||||
List<string> skuRandomLetterArr = new List<string> { "~", "#", "¥", "%", "&", "*", "(", ")", "(", ")", "+", "-", "_", "=", "【", "】", "·", "|", "《", "》" };
|
||||
@@ -154,7 +161,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
//ucSplitPage1.cmbPageSize.Items.Remove("1000");
|
||||
}
|
||||
|
||||
if (BaseClass.SaLevel == 1 && !IsClientJit)
|
||||
if (BaseClass.SaLevel == 1 && ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
dgvSelectProduct.Columns["colSubSaNick"].Visible = true;
|
||||
chkShowDel.Visible = true;
|
||||
@@ -168,7 +175,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
//chkSkuRandomPrice.Checked = true;
|
||||
}
|
||||
|
||||
if (IsClientJit)
|
||||
if (ClientMode != EnumClientMode.Admin)
|
||||
{
|
||||
chkShowDel.Visible = true;
|
||||
btnReFission.Visible = true;
|
||||
@@ -210,7 +217,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsClientJit)
|
||||
if (ClientMode == EnumClientMode.ClientJit)
|
||||
{
|
||||
foreach (DataGridViewRow row in dgvSelectProduct.Rows)
|
||||
{
|
||||
@@ -330,7 +337,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
|
||||
dgvSelectProduct.Rows[rowIndex].Height = 60;
|
||||
displayLoginStatusColor(dgvSelectProduct.Rows[rowIndex].Cells["colLogin"], dgvSelectProduct.Rows[rowIndex].Cells["colLogin"].Value.ParseToString());
|
||||
if (IsClientJit)
|
||||
if (ClientMode == EnumClientMode.ClientJit)
|
||||
{
|
||||
var clientShop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == prodSelect.shop_id);
|
||||
if (clientShop == null || clientShop.jit_expire_time.IsNullOrEmpty() || clientShop.jit_expire_time < DateTime.Now.Date)
|
||||
@@ -358,6 +365,9 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
pageCount = 1;
|
||||
|
||||
var url = BaseClass.BuildObjString("product/admin_get_user_select_product_list");
|
||||
if (ClientMode != EnumClientMode.Admin)
|
||||
url = BaseClass.BuildObjString("product/get_user_select_product_list");
|
||||
|
||||
var data = "";
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
@@ -378,8 +388,13 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
data += "&operate_sub_sa_name=" + BaseClass.UserName;
|
||||
if (chkNoSubSa.Checked)
|
||||
data += "&no_sub_sa=true";
|
||||
if (IsClientJit)
|
||||
if (ClientMode == EnumClientMode.ClientJit)
|
||||
data += "&is_client_jit=true";
|
||||
if (ClientMode != EnumClientMode.Admin)
|
||||
{
|
||||
string shopIds = string.Join(",", GlobalConfig.ShopLoginList.Where(s => !s.ShopId.IsNullOrEmpty()).Select(s => s.ShopId).Distinct()) ?? "default";
|
||||
data += "&shop_ids=" + shopIds;
|
||||
}
|
||||
}));
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
@@ -440,7 +455,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
var shopId = dgvSelectProduct.Rows[e.RowIndex].Cells["colSupplierId"].Value.ParseToString();
|
||||
var draftId = dgvSelectProduct.Rows[e.RowIndex].Cells["colDraftId"].Value.ParseToString();
|
||||
|
||||
if (IsClientJit)
|
||||
if (ClientMode == EnumClientMode.ClientJit)
|
||||
{
|
||||
var clientShop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
||||
if (clientShop == null || clientShop.jit_expire_time.IsNullOrEmpty() || clientShop.jit_expire_time < DateTime.Now.Date)
|
||||
@@ -463,7 +478,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
break;
|
||||
case "编辑备注":
|
||||
DbProductSelectEditNotesForm editForm = new DbProductSelectEditNotesForm(dbSelectProduct);
|
||||
editForm.IsClientJit = this.IsClientJit;
|
||||
editForm.IsClientJit = (ClientMode == EnumClientMode.ClientJit);
|
||||
editForm.ShowDialog();
|
||||
dgvSelectProduct.Rows[e.RowIndex].Cells["colNotes"].Value = dbSelectProduct.notes;
|
||||
dgvSelectProduct.Rows[e.RowIndex].Cells["colUserNotes"].Value = dbSelectProduct.user_notes;
|
||||
@@ -483,7 +498,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
// 查看map映射列表
|
||||
var url = BaseClass.BuildObjString("product/get_select_prod_db_id_map_draft_id_list");
|
||||
var data = UserLogin.GetSignaturex() + "&select_db_id=" + dbId;
|
||||
if (IsClientJit)
|
||||
if (ClientMode == EnumClientMode.ClientJit)
|
||||
data += "&is_client_jit=true";
|
||||
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
@@ -522,7 +537,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
|
||||
if (flag)
|
||||
{
|
||||
if (!IsClientJit)
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
var shop = GetShop(shopId);
|
||||
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
|
||||
@@ -550,7 +565,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
case "进店":
|
||||
{
|
||||
var shop = GetShop(shopId);
|
||||
if (!IsClientJit)
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product/draft";
|
||||
@@ -574,7 +589,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
{
|
||||
var shop = GetShop(shopId);
|
||||
// 登录店铺
|
||||
if (!IsClientJit)
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop);
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
@@ -673,7 +688,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
var url = BaseClass.BuildObjString("product/del_select_product");
|
||||
var data = UserLogin.GetSignaturex() +
|
||||
"&db_id=" + dbId;
|
||||
if (IsClientJit)
|
||||
if (ClientMode == EnumClientMode.ClientJit)
|
||||
data += "&is_client_jit=true";
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
@@ -696,11 +711,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
ShopLoginInfo GetShop(string shopId)
|
||||
{
|
||||
ShopLoginInfo shop;
|
||||
if (IsClientJit)
|
||||
{
|
||||
shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
||||
}
|
||||
else
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
shop = shopLst.FirstOrDefault(s => s.ShopId == shopId);
|
||||
if (shop == null)
|
||||
@@ -708,6 +719,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
shop = AdminGetServerShop(shopId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
||||
}
|
||||
if (shop == null)
|
||||
{
|
||||
shop = new ShopLoginInfo() { ShopId = shopId };
|
||||
@@ -867,7 +882,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
var empty_data = UserLogin.GetSignaturex() +
|
||||
"&db_id=" + prod.id +
|
||||
"&status=已清除";
|
||||
if (IsClientJit)
|
||||
if (ClientMode == EnumClientMode.ClientJit)
|
||||
empty_data += "&is_client_jit=true";
|
||||
GetHtml.PostUtf8(empty_url, empty_data);
|
||||
}
|
||||
@@ -890,7 +905,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
|
||||
if (result.Contains("登录过期") || result.Contains("Invalid Login State"))
|
||||
{
|
||||
if (!IsClientJit)
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
AdminShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false);
|
||||
else
|
||||
ShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false);
|
||||
@@ -929,7 +944,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
|
||||
"&up_spu_id=" + prod.spu_id +
|
||||
"&shop_id=" + prod.shop_id +
|
||||
"&status=" + prod.status;
|
||||
if (IsClientJit)
|
||||
if (ClientMode == EnumClientMode.ClientJit)
|
||||
data += "&is_client_jit=true";
|
||||
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
@@ -3375,7 +3390,7 @@ Content-Disposition: form-data; name=""sign""
|
||||
var empty_data = UserLogin.GetSignaturex() +
|
||||
"&db_id=" + prod.id +
|
||||
"&status=已清除";
|
||||
if (IsClientJit)
|
||||
if (ClientMode == EnumClientMode.ClientJit)
|
||||
empty_data += "&is_client_jit=true";
|
||||
GetHtml.PostUtf8(empty_url, empty_data);
|
||||
}
|
||||
@@ -3397,7 +3412,7 @@ Content-Disposition: form-data; name=""sign""
|
||||
var data = UserLogin.GetSignaturex() +
|
||||
"&db_id=" + prod.id;
|
||||
data += "&fission_product_name=" + GetHtml.UrlEncodeUtf8(fissionProductName.Trim());
|
||||
if (IsClientJit)
|
||||
if (ClientMode == EnumClientMode.ClientJit)
|
||||
data += "&is_client_jit=true";
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
@@ -3641,7 +3656,7 @@ Content-Disposition: form-data; name=""sign""
|
||||
case "已上传商品ID":
|
||||
{
|
||||
var shop = GetShop(shopId);
|
||||
if (!IsClientJit)
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
|
||||
|
||||
+12
-12
@@ -110,7 +110,7 @@
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.txtProdName = new System.Windows.Forms.TextBox();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.lblUserNotes = new System.Windows.Forms.Label();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.pbLoading = new System.Windows.Forms.PictureBox();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
@@ -1035,7 +1035,7 @@
|
||||
this.tableLayoutPanel1.Controls.Add(this.label3, 10, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label4, 12, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.txtProdName, 11, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label12, 18, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.lblUserNotes, 18, 0);
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(2, 0);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
@@ -1254,16 +1254,16 @@
|
||||
this.txtProdName.Size = new System.Drawing.Size(61, 23);
|
||||
this.txtProdName.TabIndex = 427;
|
||||
//
|
||||
// label12
|
||||
// lblUserNotes
|
||||
//
|
||||
this.label12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label12.AutoSize = true;
|
||||
this.label12.Location = new System.Drawing.Point(952, 12);
|
||||
this.label12.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(56, 17);
|
||||
this.label12.TabIndex = 460;
|
||||
this.label12.Text = "用户备注";
|
||||
this.lblUserNotes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lblUserNotes.AutoSize = true;
|
||||
this.lblUserNotes.Location = new System.Drawing.Point(952, 12);
|
||||
this.lblUserNotes.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.lblUserNotes.Name = "lblUserNotes";
|
||||
this.lblUserNotes.Size = new System.Drawing.Size(56, 17);
|
||||
this.lblUserNotes.TabIndex = 460;
|
||||
this.lblUserNotes.Text = "用户备注";
|
||||
//
|
||||
// splitContainer2
|
||||
//
|
||||
@@ -1809,7 +1809,7 @@
|
||||
private System.Windows.Forms.NumericUpDown numSkuRandomPrice;
|
||||
private System.Windows.Forms.Label label11;
|
||||
private UserComponent.UcCheckBox chkUploadProd;
|
||||
private System.Windows.Forms.Label label12;
|
||||
private System.Windows.Forms.Label lblUserNotes;
|
||||
private System.Windows.Forms.Label label13;
|
||||
private System.Windows.Forms.ComboBox cmbUserNotes;
|
||||
private System.Windows.Forms.ComboBox cmbNotes;
|
||||
|
||||
@@ -36,6 +36,15 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
/// </summary>
|
||||
public partial class ProductThirdSelectListManageForm : LRBaseForm
|
||||
{
|
||||
public enum EnumClientMode
|
||||
{
|
||||
Admin,
|
||||
Client,
|
||||
ClientJit,
|
||||
}
|
||||
|
||||
public EnumClientMode ClientMode { get; set; } = EnumClientMode.Admin;
|
||||
|
||||
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
|
||||
|
||||
List<string> skuRandomLetterArr = new List<string> { "~", "#", "¥", "%", "&", "*", "(", ")", "(", ")", "+", "-", "_", "=", "【", "】", "·", "|", "《", "》" };
|
||||
@@ -80,6 +89,34 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
ucSplitPage1.IsShowPageSize = true; // 可调整分页
|
||||
tableLayoutPanel1.Width -= 86;
|
||||
}
|
||||
|
||||
if (ClientMode != EnumClientMode.Admin)
|
||||
{
|
||||
chkShowDel.Visible = true;
|
||||
pbFissionSetting.Visible = true;
|
||||
btnReFission.Visible = true;
|
||||
cmbUserNotes.Visible = false;
|
||||
lblUserNotes.Visible = false;
|
||||
colUserNotes.Visible = false;
|
||||
ucSplitPage1.IsShowPageSize = true;
|
||||
var columnStyles = tableLayoutPanel1.ColumnStyles.Cast<ColumnStyle>().ToList();
|
||||
columnStyles[columnStyles.Count - 1].SizeType = SizeType.Absolute;
|
||||
columnStyles[columnStyles.Count - 1].Width = 0;
|
||||
columnStyles[columnStyles.Count - 2].SizeType = SizeType.Absolute;
|
||||
columnStyles[columnStyles.Count - 2].Width = 0;
|
||||
int colsWidth = 0;
|
||||
foreach (DataGridViewColumn col in dgvSelectProduct.Columns)
|
||||
{
|
||||
if (col.Visible)
|
||||
{
|
||||
colsWidth += col.Width;
|
||||
}
|
||||
}
|
||||
if (dgvSelectProduct.Width - colsWidth - dgvSelectProduct.RowHeadersWidth > 0)
|
||||
{
|
||||
colOpResult.Width += dgvSelectProduct.Width - colsWidth - dgvSelectProduct.RowHeadersWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool isFirst = true;
|
||||
@@ -249,6 +286,9 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
pageCount = 1;
|
||||
|
||||
var url = BaseClass.BuildObjString("product_third/admin_get_user_select_product_list");
|
||||
if (ClientMode != EnumClientMode.Admin)
|
||||
url = BaseClass.BuildObjString("product_third/get_user_select_product_list");
|
||||
|
||||
var data = "";
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
@@ -269,6 +309,11 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
data += "&operate_sub_sa_name=" + BaseClass.UserName;
|
||||
if (chkNoSubSa.Checked)
|
||||
data += "&no_sub_sa=true";
|
||||
if (ClientMode != EnumClientMode.Admin)
|
||||
{
|
||||
string shopIds = string.Join(",", GlobalConfig.ShopLoginList.Where(s => !s.ShopId.IsNullOrEmpty()).Select(s => s.ShopId).Distinct()) ?? "default";
|
||||
data += "&shop_ids=" + shopIds;
|
||||
}
|
||||
}));
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
@@ -405,35 +450,70 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
if (flag)
|
||||
{
|
||||
var shop = GetShop(shopId);
|
||||
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
|
||||
adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" +
|
||||
draftId + "&from=productDraftList";
|
||||
adminLoginForm.openType = EnumOpenType.manage;
|
||||
adminLoginForm.WindowState = FormWindowState.Maximized;
|
||||
adminLoginForm.ShowDialog();
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
|
||||
adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" +
|
||||
draftId + "&from=productDraftList";
|
||||
adminLoginForm.openType = EnumOpenType.manage;
|
||||
adminLoginForm.WindowState = FormWindowState.Maximized;
|
||||
adminLoginForm.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopLoginForm loginForm = new ShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
|
||||
loginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" +
|
||||
draftId + "&from=productDraftList";
|
||||
loginForm.openType = EnumOpenType.manage;
|
||||
loginForm.WindowState = FormWindowState.Maximized;
|
||||
loginForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "进店":
|
||||
{
|
||||
var shop = GetShop(shopId);
|
||||
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product/draft";
|
||||
adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/draft";
|
||||
adminLoginForm.openType = EnumOpenType.manage;
|
||||
adminLoginForm.WindowState = FormWindowState.Maximized;
|
||||
adminLoginForm.ShowDialog();
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product/draft";
|
||||
adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/draft";
|
||||
adminLoginForm.openType = EnumOpenType.manage;
|
||||
adminLoginForm.WindowState = FormWindowState.Maximized;
|
||||
adminLoginForm.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopLoginForm loginForm = new ShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product/draft";
|
||||
loginForm.InitUrl = "https://agentseller.temu.com/goods/draft";
|
||||
loginForm.openType = EnumOpenType.manage;
|
||||
loginForm.WindowState = FormWindowState.Maximized;
|
||||
loginForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "登录":
|
||||
{
|
||||
var shop = GetShop(shopId);
|
||||
// 登录店铺
|
||||
AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop);
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
shopLoginForm.SaveComplete += ShopLoginForm_SaveComplete;
|
||||
shopLoginForm.ShowDialog();
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
AdminShopLoginForm shopLoginForm = new AdminShopLoginForm(shop);
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
shopLoginForm.SaveComplete += ShopLoginForm_SaveComplete;
|
||||
shopLoginForm.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopLoginForm shopLoginForm = new ShopLoginForm(shop);
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
shopLoginForm.SaveComplete += ShopLoginForm_SaveComplete;
|
||||
shopLoginForm.ShowDialog();
|
||||
}
|
||||
foreach (DataGridViewRow row in this.dgvSelectProduct.Rows)
|
||||
{
|
||||
if (row.Cells["colSupplierId"].Value.ParseToString() == shop.ShopId)
|
||||
@@ -552,17 +632,25 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
|
||||
ShopLoginInfo GetShop(string shopId)
|
||||
{
|
||||
var shop = shopLst.FirstOrDefault(s => s.ShopId == shopId);
|
||||
if (shop == null)
|
||||
ShopLoginInfo shop;
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
shop = GetServerShopById(shopId);
|
||||
shop = shopLst.FirstOrDefault(s => s.ShopId == shopId);
|
||||
if (shop == null)
|
||||
{
|
||||
shop = new ShopLoginInfo() { ShopId = shopId };
|
||||
shop.LoginStatus = "不存在";
|
||||
shop = GetServerShopById(shopId);
|
||||
}
|
||||
shopLst.Add(shop);
|
||||
}
|
||||
else
|
||||
{
|
||||
shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
||||
}
|
||||
if (shop == null)
|
||||
{
|
||||
shop = new ShopLoginInfo() { ShopId = shopId };
|
||||
shop.LoginStatus = "不存在";
|
||||
}
|
||||
shopLst.Add(shop);
|
||||
return shop;
|
||||
}
|
||||
|
||||
@@ -732,7 +820,10 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
|
||||
if (result.Contains("登录过期") || result.Contains("Invalid Login State"))
|
||||
{
|
||||
AdminShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false);
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
AdminShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false);
|
||||
else
|
||||
ShopListForm.Instance.CheckShopLogin(shopLst.Where(s => s.LoginName == shop.LoginName).ToArray(), false);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -2041,13 +2132,26 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms
|
||||
case "已上传商品ID":
|
||||
{
|
||||
var shop = GetShop(shopId);
|
||||
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
|
||||
adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" +
|
||||
draftId + "&from=productDraftList";
|
||||
adminLoginForm.openType = EnumOpenType.manage;
|
||||
adminLoginForm.WindowState = FormWindowState.Maximized;
|
||||
adminLoginForm.ShowDialog();
|
||||
if (ClientMode == EnumClientMode.Admin)
|
||||
{
|
||||
AdminShopLoginForm adminLoginForm = new AdminShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
|
||||
adminLoginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" +
|
||||
draftId + "&from=productDraftList";
|
||||
adminLoginForm.openType = EnumOpenType.manage;
|
||||
adminLoginForm.WindowState = FormWindowState.Maximized;
|
||||
adminLoginForm.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopLoginForm loginForm = new ShopLoginForm(shop);
|
||||
//adminLoginForm.InitUrl = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?productDraftId=" +
|
||||
loginForm.InitUrl = "https://agentseller.temu.com/goods/edit?productDraftId=" +
|
||||
draftId + "&from=productDraftList";
|
||||
loginForm.openType = EnumOpenType.manage;
|
||||
loginForm.WindowState = FormWindowState.Maximized;
|
||||
loginForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user