diff --git a/AllBase/AllBase.csproj b/AllBase/AllBase.csproj
index a5db25e..a57de6c 100644
--- a/AllBase/AllBase.csproj
+++ b/AllBase/AllBase.csproj
@@ -232,6 +232,7 @@
+
diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs
index bf6b49c..75a4d44 100644
--- a/AllBase/BaseClass.cs
+++ b/AllBase/BaseClass.cs
@@ -27,7 +27,7 @@ namespace AllBase
///
/// 版本ID
///
- public static int VersionCount = 667;
+ public static int VersionCount = 669;
//public static int VersionCount = 613;
///
diff --git a/AllBase/Model/Result/TemuDetailProductInfo.cs b/AllBase/Model/Result/TemuDetailProductInfo.cs
index dcf3cfb..e104afe 100644
--- a/AllBase/Model/Result/TemuDetailProductInfo.cs
+++ b/AllBase/Model/Result/TemuDetailProductInfo.cs
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace AllBase.Model.Result
{
///
- /// temu商品获取
+ /// temu后台商品详情获取
///
public class TemuDetailProductInfo
{
diff --git a/AllBase/Model/Result/TemuResult/TemuWebClientProductInfo.cs b/AllBase/Model/Result/TemuResult/TemuWebClientProductInfo.cs
new file mode 100644
index 0000000..be4e159
--- /dev/null
+++ b/AllBase/Model/Result/TemuResult/TemuWebClientProductInfo.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AllBase.Model.Result.TemuResult
+{
+ public class TemuWebClientProductInfo
+ {
+ }
+}
diff --git a/AllBase/Model/Result/TemuStockInfo.cs b/AllBase/Model/Result/TemuStockInfo.cs
index 5b4e55a..f3611d2 100644
--- a/AllBase/Model/Result/TemuStockInfo.cs
+++ b/AllBase/Model/Result/TemuStockInfo.cs
@@ -52,6 +52,23 @@ namespace AllBase.Model.Result
/// 是否取消待创建备货单
///
public bool isCancel { get; set; } = false;
+
+
+ ///
+ /// sku列表信息
+ ///
+ public List skuQuantityDetailList { get; set; } = new List();
+ ///
+ /// sku总计
+ ///
+ public SkuQuantityInfo skuQuantityTotalInfo { get; set; }
+ ///
+ /// 备货单创建时间
+ ///
+ public long? purchaseTime { get; set; }
+
+ public bool? isCanJoinDeliverPlatform { get; set; } // false,
+ public string joinDeliverPlatformReason { get; set; } // "当前备货单已加入发货台,无需重复操作",
}
///
@@ -188,6 +205,10 @@ namespace AllBase.Model.Result
/// 申报价格 CNY 分
///
public int? supplierPrice { get; set; }
+ ///
+ /// (加入发货台时的)备货件数
+ ///
+ public int? purchaseQuantity { get; set; }
/////
///// 仓内可用库存
/////
diff --git a/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs b/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs
index 2d5cc2a..e40caf9 100644
--- a/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs
+++ b/KJDService/KJD_WebService/BLL/KJD/ShopManage.cs
@@ -94,7 +94,7 @@ namespace KJD_Web.BLL
}
else
{
- sql = "SELECT s.* FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
+ sql = "SELECT s.*,c.add_product_remaining add_remaining,c.add_product_month add_month FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
sql += where; // where 子句
@@ -124,8 +124,8 @@ namespace KJD_Web.BLL
notes = row["notes"].ToString(),
login_status = row["login_status"].ToString(),
login_status2 = row["login_status2"].ToString(),
- add_product_remaining = row["add_product_remaining"].ParseToInt(),
- add_product_month = row["add_product_month"].ParseToInt(),
+ add_product_remaining = row["add_remaining"].ParseToInt(),
+ add_product_month = row["add_month"].ParseToInt(),
operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(),
ad_cookie = row["ad_cookie"].ParseToString(),
ad_login_status = row["ad_login_status"].ParseToString(),
@@ -271,7 +271,7 @@ namespace KJD_Web.BLL
}
else
{
- sql = "SELECT s.* FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
+ sql = "SELECT s.*,c.add_product_remaining add_remaining,c.add_product_month add_month FROM kjd.shop s LEFT JOIN kjd.shop_add_prod_count c ON s.shop_id=c.shop_id WHERE 1=1";
sql += where; // where 子句
@@ -301,8 +301,8 @@ namespace KJD_Web.BLL
notes = row["notes"].ToString(),
login_status = row["login_status"].ToString(),
login_status2 = row["login_status2"].ToString(),
- add_product_remaining = row["add_product_remaining"].ParseToInt(),
- add_product_month = row["add_product_month"].ParseToInt(),
+ add_product_remaining = row["add_remaining"].ParseToInt(),
+ add_product_month = row["add_month"].ParseToInt(),
operate_sub_sa_name = row["operate_sub_sa_name"].ParseToString(),
ad_cookie = row["ad_cookie"].ParseToString(),
ad_login_status = row["ad_login_status"].ParseToString(),
diff --git a/TEMUKJD/KJDForms/AdminForms/AdminForm.cs b/TEMUKJD/KJDForms/AdminForms/AdminForm.cs
index 71c0e21..c8ec3e0 100644
--- a/TEMUKJD/KJDForms/AdminForms/AdminForm.cs
+++ b/TEMUKJD/KJDForms/AdminForms/AdminForm.cs
@@ -52,9 +52,7 @@ namespace TemuKJD.KJDForms.AdminForms
hideName.Remove("认领待上传");
hideName.Remove("库存上传");
hideName.Remove("商品核价");
-#if DEBUG
hideName.Remove("加入发货台");
-#endif
}
if (BaseClass.SaLevel==2)
{
@@ -62,9 +60,7 @@ namespace TemuKJD.KJDForms.AdminForms
hideName.Remove("认领待上传");
hideName.Remove("库存上传");
hideName.Remove("商品核价");
-#if DEBUG
hideName.Remove("加入发货台");
-#endif
}
}
diff --git a/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs b/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs
index 65772bd..0cc55f5 100644
--- a/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs
+++ b/TEMUKJD/KJDForms/AdminForms/AdminProductPriceCheckForm.Designer.cs
@@ -30,13 +30,13 @@ namespace TemuKJD.KJDForms.AdminForms
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnResetExtCode = new DevComponents.DotNetBar.PanelEx();
@@ -62,6 +62,7 @@ namespace TemuKJD.KJDForms.AdminForms
this.btnSearchPrice2 = new DevComponents.DotNetBar.PanelEx();
this.label15 = new System.Windows.Forms.Label();
this.btnRestoreProdName = new DevComponents.DotNetBar.PanelEx();
+ this.txtSkcId = new System.Windows.Forms.TextBox();
this.chkSearchAllShop = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.btnEmpty = new DevComponents.DotNetBar.PanelEx();
this.btnSearchPrice = new DevComponents.DotNetBar.PanelEx();
@@ -134,7 +135,6 @@ namespace TemuKJD.KJDForms.AdminForms
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
- this.txtSkcId = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -619,6 +619,13 @@ namespace TemuKJD.KJDForms.AdminForms
this.btnRestoreProdName.Text = "批量还原标题";
this.btnRestoreProdName.Click += new System.EventHandler(this.btnRestoreProdName_Click);
//
+ // txtSkcId
+ //
+ this.txtSkcId.Location = new System.Drawing.Point(446, 14);
+ this.txtSkcId.Name = "txtSkcId";
+ this.txtSkcId.Size = new System.Drawing.Size(251, 23);
+ this.txtSkcId.TabIndex = 733;
+ //
// chkSearchAllShop
//
this.chkSearchAllShop.AutoSize = true;
@@ -1034,18 +1041,18 @@ namespace TemuKJD.KJDForms.AdminForms
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
- dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
- this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
+ dataGridViewCellStyle8.BackColor = System.Drawing.Color.WhiteSmoke;
+ this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8;
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
+ dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control;
+ dataGridViewCellStyle9.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText;
+ dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+ dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle9;
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
@@ -1256,18 +1263,18 @@ namespace TemuKJD.KJDForms.AdminForms
//
this.dgvPriceCheck.AllowUserToAddRows = false;
this.dgvPriceCheck.AllowUserToDeleteRows = false;
- dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
- this.dgvPriceCheck.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
+ dataGridViewCellStyle10.BackColor = System.Drawing.Color.WhiteSmoke;
+ this.dgvPriceCheck.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10;
this.dgvPriceCheck.BackgroundColor = System.Drawing.Color.White;
this.dgvPriceCheck.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.dgvPriceCheck.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
+ dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control;
+ dataGridViewCellStyle11.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+ dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText;
+ dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+ dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.dgvPriceCheck.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11;
this.dgvPriceCheck.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvPriceCheck.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCheck,
@@ -1381,8 +1388,8 @@ namespace TemuKJD.KJDForms.AdminForms
//
// colProdName
//
- dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.colProdName.DefaultCellStyle = dataGridViewCellStyle5;
+ dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.colProdName.DefaultCellStyle = dataGridViewCellStyle12;
this.colProdName.HeaderText = "标题";
this.colProdName.Name = "colProdName";
this.colProdName.ReadOnly = true;
@@ -1390,8 +1397,8 @@ namespace TemuKJD.KJDForms.AdminForms
//
// colSkuName
//
- dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.colSkuName.DefaultCellStyle = dataGridViewCellStyle6;
+ dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.colSkuName.DefaultCellStyle = dataGridViewCellStyle13;
this.colSkuName.HeaderText = "规格名称";
this.colSkuName.Name = "colSkuName";
this.colSkuName.ReadOnly = true;
@@ -1441,8 +1448,8 @@ namespace TemuKJD.KJDForms.AdminForms
//
// colCreatTime
//
- dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.colCreatTime.DefaultCellStyle = dataGridViewCellStyle7;
+ dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.colCreatTime.DefaultCellStyle = dataGridViewCellStyle14;
this.colCreatTime.HeaderText = "创建时间";
this.colCreatTime.Name = "colCreatTime";
this.colCreatTime.ReadOnly = true;
@@ -1525,13 +1532,6 @@ namespace TemuKJD.KJDForms.AdminForms
this.statusBar.Size = new System.Drawing.Size(1064, 26);
this.statusBar.TabIndex = 2;
//
- // txtSkcId
- //
- this.txtSkcId.Location = new System.Drawing.Point(446, 14);
- this.txtSkcId.Name = "txtSkcId";
- this.txtSkcId.Size = new System.Drawing.Size(251, 23);
- this.txtSkcId.TabIndex = 733;
- //
// AdminProductPriceCheckForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
diff --git a/TEMUKJD/KJDForms/AdminForms/ShopBrowserObject.cs b/TEMUKJD/KJDForms/AdminForms/ShopBrowserObject.cs
index 30c48ef..8a1bca0 100644
--- a/TEMUKJD/KJDForms/AdminForms/ShopBrowserObject.cs
+++ b/TEMUKJD/KJDForms/AdminForms/ShopBrowserObject.cs
@@ -75,34 +75,63 @@ namespace TemuKJD.KJDForms.AdminForms
}
}
- var url = BaseClass.BuildObjString("product/add_product");
- var data = Work.UserLogin.GetSignaturex() +
- "&spu_id=" + product?.productId +
- "&skc_id=" + product?.productSkcList?.FirstOrDefault()?.productSkcId +
- "&cat_id=" + GetCat(product).catId +
- "&cat_name=" + HttpUtility.UrlEncode(GetCat(product).catName, Encoding.UTF8) +
- "&ext_code=" + HttpUtility.UrlEncode(product?.productSkcList?.FirstOrDefault()?.extCode, Encoding.UTF8) +
- "&product_name=" + HttpUtility.UrlEncode(product?.productName, Encoding.UTF8) +
- "&product_json=" + HttpUtility.UrlEncode(result, Encoding.UTF8) +
- "&size_json=" + HttpUtility.UrlEncode(sizeRst, Encoding.UTF8) +
- "&main_img=" + HttpUtility.UrlEncode(product?.carouselImageUrls?.FirstOrDefault(), 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"))
- html = GetHtml.PostUtf8(url, data);
- if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
+ //var url = BaseClass.BuildObjString("product/get_product_list");
+ //var data = "";
+
+ //data = UserLogin.GetSignaturex() +
+ // "&page=" + 1 +
+ // "&page_size=" + 1;
+ //data += "&search_spu=" + product?.productId;
+ ////data += "&search_skc=" + product?.productSkcList?.FirstOrDefault()?.productSkcId;
+
+ //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
{
- string msg = "选品商品保存失败!请检查网络连接:" +
- BaseRegex.GetStringJson(ref html, "msg");
- OnInfoReceived(msg);
- }
- else
- {
- OnInfoReceived("选品商品保存成功!" + success_err_msg);
+ var url = BaseClass.BuildObjString("product/add_product");
+ var data = Work.UserLogin.GetSignaturex() +
+ "&spu_id=" + product?.productId +
+ "&skc_id=" + product?.productSkcList?.FirstOrDefault()?.productSkcId +
+ "&cat_id=" + GetCat(product).catId +
+ "&cat_name=" + HttpUtility.UrlEncode(GetCat(product).catName, Encoding.UTF8) +
+ "&ext_code=" + HttpUtility.UrlEncode(product?.productSkcList?.FirstOrDefault()?.extCode, Encoding.UTF8) +
+ "&product_name=" + HttpUtility.UrlEncode(product?.productName, Encoding.UTF8) +
+ "&product_json=" + HttpUtility.UrlEncode(result, Encoding.UTF8) +
+ "&size_json=" + HttpUtility.UrlEncode(sizeRst, Encoding.UTF8) +
+ "&main_img=" + HttpUtility.UrlEncode(product?.carouselImageUrls?.FirstOrDefault(), 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"))
+ 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);
+ }
}
+
+
//// 创建 SaveFileDialog 的实例
//SaveFileDialog saveFileDialog = new SaveFileDialog();
diff --git a/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.Designer.cs b/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.Designer.cs
index 1641823..f529d48 100644
--- a/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.Designer.cs
+++ b/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.Designer.cs
@@ -35,12 +35,12 @@ namespace TemuKJD.KJDForms.ProductForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx3 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnStart = new DevComponents.DotNetBar.PanelEx();
this.txtRetryInterval = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
- this.btnStop = new DevComponents.DotNetBar.PanelEx();
this.btnSearch = new DevComponents.DotNetBar.PanelEx();
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnEmpty = new DevComponents.DotNetBar.PanelEx();
@@ -56,6 +56,17 @@ namespace TemuKJD.KJDForms.ProductForms
this.chkSearchAllShop = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.pbShopLoading = new System.Windows.Forms.PictureBox();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
+ this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+ this.colUser = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.colLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn();
+ this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+ this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.pnlMsg = new DevComponents.DotNetBar.PanelEx();
+ this.lblMsg = new System.Windows.Forms.Label();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.dgvStock = new TemuKJD.UserComponent.DataGridViewEx();
this.colUpId = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -70,31 +81,14 @@ namespace TemuKJD.KJDForms.ProductForms
this.colProdSkc = new System.Windows.Forms.DataGridViewLinkColumn();
this.colProdName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colPrcie = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colFrom = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colFromFake = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colInCartNumber7d = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colTodaySaleVolume = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colLastSevenDaysSaleVolume = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colSalesInventoryNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colWaitReceiveNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colQualityScore = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colQualityRate = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colQualityCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colNeedStockUp = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.colStockUpNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.colCreateTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
- this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
- this.colUser = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn();
- this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
- this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.btnStop = new DevComponents.DotNetBar.PanelEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -111,6 +105,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbShopLoading)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).BeginInit();
+ this.pnlMsg.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvStock)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit();
@@ -135,7 +130,7 @@ namespace TemuKJD.KJDForms.ProductForms
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer3);
- this.splitContainer1.Size = new System.Drawing.Size(1314, 455);
+ this.splitContainer1.Size = new System.Drawing.Size(1478, 616);
this.splitContainer1.SplitterDistance = 120;
this.splitContainer1.TabIndex = 11;
//
@@ -147,13 +142,10 @@ namespace TemuKJD.KJDForms.ProductForms
this.ucGroupBoxEx3.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx3.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx3.Controls.Add(this.btnStart);
- this.ucGroupBoxEx3.Controls.Add(this.txtRetryInterval);
- this.ucGroupBoxEx3.Controls.Add(this.label1);
- this.ucGroupBoxEx3.Controls.Add(this.btnStop);
this.ucGroupBoxEx3.Controls.Add(this.btnSearch);
this.ucGroupBoxEx3.Location = new System.Drawing.Point(282, 2);
this.ucGroupBoxEx3.Name = "ucGroupBoxEx3";
- this.ucGroupBoxEx3.Size = new System.Drawing.Size(1030, 120);
+ this.ucGroupBoxEx3.Size = new System.Drawing.Size(1194, 120);
this.ucGroupBoxEx3.TabIndex = 666;
this.ucGroupBoxEx3.TabStop = false;
this.ucGroupBoxEx3.Text = "待发货商品操作";
@@ -165,7 +157,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnStart.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnStart.DisabledBackColor = System.Drawing.Color.Empty;
this.btnStart.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnStart.Location = new System.Drawing.Point(760, 25);
+ this.btnStart.Location = new System.Drawing.Point(1049, 25);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(117, 23);
this.btnStart.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -181,13 +173,14 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnStart.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnStart.TabIndex = 439;
this.btnStart.Text = "循环加入发货台";
+ this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
//
// txtRetryInterval
//
this.txtRetryInterval.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.txtRetryInterval.Location = new System.Drawing.Point(685, 25);
+ this.txtRetryInterval.Location = new System.Drawing.Point(253, -1);
this.txtRetryInterval.Name = "txtRetryInterval";
- this.txtRetryInterval.Size = new System.Drawing.Size(69, 23);
+ this.txtRetryInterval.Size = new System.Drawing.Size(47, 23);
this.txtRetryInterval.TabIndex = 431;
this.txtRetryInterval.Text = "5";
//
@@ -195,36 +188,12 @@ namespace TemuKJD.KJDForms.ProductForms
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(611, 28);
+ this.label1.Location = new System.Drawing.Point(179, 2);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(76, 17);
this.label1.TabIndex = 432;
this.label1.Text = "重试间隔(秒)";
//
- // btnStop
- //
- this.btnStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btnStop.CanvasColor = System.Drawing.SystemColors.Control;
- this.btnStop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
- this.btnStop.DisabledBackColor = System.Drawing.Color.Empty;
- this.btnStop.Location = new System.Drawing.Point(883, 25);
- this.btnStop.Name = "btnStop";
- this.btnStop.Size = new System.Drawing.Size(117, 23);
- this.btnStop.Style.Alignment = System.Drawing.StringAlignment.Center;
- this.btnStop.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
- this.btnStop.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
- this.btnStop.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
- this.btnStop.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- this.btnStop.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
- this.btnStop.Style.GradientAngle = 90;
- this.btnStop.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
- this.btnStop.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
- this.btnStop.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- this.btnStop.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
- this.btnStop.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
- this.btnStop.TabIndex = 668;
- this.btnStop.Text = "停止操作";
- //
// btnSearch
//
this.btnSearch.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -382,8 +351,8 @@ namespace TemuKJD.KJDForms.ProductForms
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.splitContainer4);
- this.splitContainer3.Size = new System.Drawing.Size(1314, 331);
- this.splitContainer3.SplitterDistance = 301;
+ this.splitContainer3.Size = new System.Drawing.Size(1478, 492);
+ this.splitContainer3.SplitterDistance = 462;
this.splitContainer3.TabIndex = 1;
//
// splitContainer2
@@ -402,10 +371,11 @@ namespace TemuKJD.KJDForms.ProductForms
//
// splitContainer2.Panel2
//
+ this.splitContainer2.Panel2.Controls.Add(this.pnlMsg);
this.splitContainer2.Panel2.Controls.Add(this.pbLoading);
this.splitContainer2.Panel2.Controls.Add(this.dgvStock);
this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0);
- this.splitContainer2.Size = new System.Drawing.Size(1314, 301);
+ this.splitContainer2.Size = new System.Drawing.Size(1478, 462);
this.splitContainer2.SplitterDistance = 280;
this.splitContainer2.TabIndex = 0;
//
@@ -426,7 +396,7 @@ namespace TemuKJD.KJDForms.ProductForms
//
this.pbShopLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pbShopLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
- this.pbShopLoading.Location = new System.Drawing.Point(115, 125);
+ this.pbShopLoading.Location = new System.Drawing.Point(115, 206);
this.pbShopLoading.Name = "pbShopLoading";
this.pbShopLoading.Size = new System.Drawing.Size(50, 50);
this.pbShopLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -467,14 +437,115 @@ namespace TemuKJD.KJDForms.ProductForms
this.dgvShop.ReadOnly = true;
this.dgvShop.RowHeadersWidth = 25;
this.dgvShop.RowTemplate.Height = 23;
- this.dgvShop.Size = new System.Drawing.Size(276, 301);
+ this.dgvShop.Size = new System.Drawing.Size(276, 462);
this.dgvShop.TabIndex = 6;
+ this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
+ //
+ // 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 = 28;
+ //
+ // colUser
+ //
+ this.colUser.HeaderText = "用户账户";
+ this.colUser.Name = "colUser";
+ this.colUser.ReadOnly = true;
+ this.colUser.Visible = false;
+ //
+ // colLoginName
+ //
+ this.colLoginName.HeaderText = "店铺登录名";
+ this.colLoginName.Name = "colLoginName";
+ this.colLoginName.ReadOnly = true;
+ this.colLoginName.Visible = false;
+ //
+ // colShopId
+ //
+ this.colShopId.HeaderText = "店铺Id";
+ this.colShopId.Name = "colShopId";
+ this.colShopId.ReadOnly = true;
+ this.colShopId.Visible = false;
+ this.colShopId.Width = 55;
+ //
+ // colShopName
+ //
+ this.colShopName.HeaderText = "店铺名称";
+ this.colShopName.Name = "colShopName";
+ this.colShopName.ReadOnly = true;
+ this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+ this.colShopName.Width = 70;
+ //
+ // colShopNotes
+ //
+ this.colShopNotes.HeaderText = "分组";
+ this.colShopNotes.Name = "colShopNotes";
+ this.colShopNotes.ReadOnly = true;
+ this.colShopNotes.Width = 70;
+ //
+ // colLoginStatus
+ //
+ this.colLoginStatus.HeaderText = "状态";
+ this.colLoginStatus.Name = "colLoginStatus";
+ this.colLoginStatus.ReadOnly = true;
+ this.colLoginStatus.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+ this.colLoginStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+ this.colLoginStatus.Width = 38;
+ //
+ // colCanUse
+ //
+ this.colCanUse.HeaderText = "可用";
+ this.colCanUse.Name = "colCanUse";
+ this.colCanUse.ReadOnly = true;
+ this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+ this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+ this.colCanUse.Visible = false;
+ this.colCanUse.Width = 28;
+ //
+ // colMessage
+ //
+ this.colMessage.HeaderText = "消息";
+ this.colMessage.Name = "colMessage";
+ this.colMessage.ReadOnly = true;
+ //
+ // pnlMsg
+ //
+ this.pnlMsg.Anchor = System.Windows.Forms.AnchorStyles.Top;
+ this.pnlMsg.CanvasColor = System.Drawing.SystemColors.Control;
+ this.pnlMsg.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+ this.pnlMsg.Controls.Add(this.lblMsg);
+ this.pnlMsg.DisabledBackColor = System.Drawing.Color.Empty;
+ this.pnlMsg.Location = new System.Drawing.Point(397, 127);
+ this.pnlMsg.Name = "pnlMsg";
+ this.pnlMsg.Size = new System.Drawing.Size(401, 110);
+ this.pnlMsg.Style.Alignment = System.Drawing.StringAlignment.Center;
+ this.pnlMsg.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
+ this.pnlMsg.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255)))));
+ this.pnlMsg.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
+ this.pnlMsg.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
+ this.pnlMsg.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
+ this.pnlMsg.Style.GradientAngle = 90;
+ this.pnlMsg.TabIndex = 500;
+ this.pnlMsg.Visible = false;
+ //
+ // lblMsg
+ //
+ this.lblMsg.ForeColor = System.Drawing.SystemColors.HotTrack;
+ this.lblMsg.Location = new System.Drawing.Point(29, 20);
+ this.lblMsg.Name = "lblMsg";
+ this.lblMsg.Size = new System.Drawing.Size(345, 69);
+ this.lblMsg.TabIndex = 0;
+ this.lblMsg.Text = "消息tip";
//
// pbLoading
//
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
- this.pbLoading.Location = new System.Drawing.Point(490, 125);
+ this.pbLoading.Location = new System.Drawing.Point(572, 206);
this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50);
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -512,25 +583,17 @@ namespace TemuKJD.KJDForms.ProductForms
this.colProdSkc,
this.colProdName,
this.colPrcie,
- this.colFrom,
- this.colFromFake,
- this.colInCartNumber7d,
- this.colTodaySaleVolume,
- this.colLastSevenDaysSaleVolume,
- this.colSalesInventoryNum,
- this.colWaitReceiveNum,
- this.colQualityScore,
- this.colQualityRate,
- this.colQualityCount,
- this.colNeedStockUp,
+ this.colStockUpNum,
+ this.colCreateTime,
this.colMsg});
this.dgvStock.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvStock.Location = new System.Drawing.Point(0, 0);
this.dgvStock.Name = "dgvStock";
this.dgvStock.ReadOnly = true;
this.dgvStock.RowTemplate.Height = 23;
- this.dgvStock.Size = new System.Drawing.Size(1026, 301);
+ this.dgvStock.Size = new System.Drawing.Size(1190, 462);
this.dgvStock.TabIndex = 189;
+ this.dgvStock.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvStock_CellContentClick);
//
// colUpId
//
@@ -622,104 +685,36 @@ namespace TemuKJD.KJDForms.ProductForms
this.colProdName.HeaderText = "标题";
this.colProdName.Name = "colProdName";
this.colProdName.ReadOnly = true;
- this.colProdName.Width = 180;
+ this.colProdName.Width = 150;
//
// colPrcie
//
- this.colPrcie.HeaderText = "价格";
+ this.colPrcie.HeaderText = "申报价格";
this.colPrcie.Name = "colPrcie";
this.colPrcie.ReadOnly = true;
- this.colPrcie.Visible = false;
+ this.colPrcie.Width = 80;
//
- // colFrom
+ // colStockUpNum
//
- this.colFrom.HeaderText = "来源";
- this.colFrom.Name = "colFrom";
- this.colFrom.ReadOnly = true;
- this.colFrom.Visible = false;
+ this.colStockUpNum.HeaderText = "备货件数";
+ this.colStockUpNum.Name = "colStockUpNum";
+ this.colStockUpNum.ReadOnly = true;
+ this.colStockUpNum.Width = 70;
//
- // colFromFake
+ // colCreateTime
//
- this.colFromFake.HeaderText = "来源";
- this.colFromFake.Name = "colFromFake";
- this.colFromFake.ReadOnly = true;
- this.colFromFake.Visible = false;
- //
- // colInCartNumber7d
- //
- this.colInCartNumber7d.HeaderText = "近七日加购";
- this.colInCartNumber7d.Name = "colInCartNumber7d";
- this.colInCartNumber7d.ReadOnly = true;
- this.colInCartNumber7d.Visible = false;
- this.colInCartNumber7d.Width = 75;
- //
- // colTodaySaleVolume
- //
- this.colTodaySaleVolume.HeaderText = "今日销量";
- this.colTodaySaleVolume.Name = "colTodaySaleVolume";
- this.colTodaySaleVolume.ReadOnly = true;
- this.colTodaySaleVolume.Visible = false;
- this.colTodaySaleVolume.Width = 70;
- //
- // colLastSevenDaysSaleVolume
- //
- this.colLastSevenDaysSaleVolume.HeaderText = "七日销量";
- this.colLastSevenDaysSaleVolume.Name = "colLastSevenDaysSaleVolume";
- this.colLastSevenDaysSaleVolume.ReadOnly = true;
- this.colLastSevenDaysSaleVolume.Visible = false;
- this.colLastSevenDaysSaleVolume.Width = 70;
- //
- // colSalesInventoryNum
- //
- this.colSalesInventoryNum.HeaderText = "仓库可用库存";
- this.colSalesInventoryNum.Name = "colSalesInventoryNum";
- this.colSalesInventoryNum.ReadOnly = true;
- this.colSalesInventoryNum.Visible = false;
- this.colSalesInventoryNum.Width = 90;
- //
- // colWaitReceiveNum
- //
- this.colWaitReceiveNum.HeaderText = "已发货库存";
- this.colWaitReceiveNum.Name = "colWaitReceiveNum";
- this.colWaitReceiveNum.ReadOnly = true;
- this.colWaitReceiveNum.Visible = false;
- this.colWaitReceiveNum.Width = 75;
- //
- // colQualityScore
- //
- this.colQualityScore.HeaderText = "品质分";
- this.colQualityScore.Name = "colQualityScore";
- this.colQualityScore.ReadOnly = true;
- this.colQualityScore.Width = 50;
- //
- // colQualityRate
- //
- this.colQualityRate.HeaderText = "售后率";
- this.colQualityRate.Name = "colQualityRate";
- this.colQualityRate.ReadOnly = true;
- this.colQualityRate.Width = 50;
- //
- // colQualityCount
- //
- this.colQualityCount.HeaderText = "售后数";
- this.colQualityCount.Name = "colQualityCount";
- this.colQualityCount.ReadOnly = true;
- this.colQualityCount.Width = 50;
- //
- // colNeedStockUp
- //
- this.colNeedStockUp.HeaderText = "是否需备货";
- this.colNeedStockUp.Name = "colNeedStockUp";
- this.colNeedStockUp.ReadOnly = true;
- this.colNeedStockUp.Visible = false;
- this.colNeedStockUp.Width = 75;
+ dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.colCreateTime.DefaultCellStyle = dataGridViewCellStyle6;
+ this.colCreateTime.HeaderText = "备货单创建时间";
+ this.colCreateTime.Name = "colCreateTime";
+ this.colCreateTime.ReadOnly = true;
//
// colMsg
//
- this.colMsg.HeaderText = "状态";
+ this.colMsg.HeaderText = "操作信息";
this.colMsg.Name = "colMsg";
this.colMsg.ReadOnly = true;
- this.colMsg.Width = 400;
+ this.colMsg.Width = 300;
//
// splitContainer4
//
@@ -736,8 +731,11 @@ namespace TemuKJD.KJDForms.ProductForms
// splitContainer4.Panel2
//
this.splitContainer4.Panel2.Controls.Add(this.btnClear);
- this.splitContainer4.Size = new System.Drawing.Size(1314, 26);
- this.splitContainer4.SplitterDistance = 1036;
+ this.splitContainer4.Panel2.Controls.Add(this.txtRetryInterval);
+ this.splitContainer4.Panel2.Controls.Add(this.btnStop);
+ this.splitContainer4.Panel2.Controls.Add(this.label1);
+ this.splitContainer4.Size = new System.Drawing.Size(1478, 26);
+ this.splitContainer4.SplitterDistance = 1049;
this.splitContainer4.TabIndex = 3;
//
// statusBar
@@ -772,7 +770,7 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnClear.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnClear.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClear.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- this.btnClear.Location = new System.Drawing.Point(180, 1);
+ this.btnClear.Location = new System.Drawing.Point(3, 0);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(90, 21);
this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -791,82 +789,36 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnClear.Text = "清空结果";
this.btnClear.Visible = false;
//
- // colSelect
+ // btnStop
//
- 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 = 28;
- //
- // colUser
- //
- this.colUser.HeaderText = "用户账户";
- this.colUser.Name = "colUser";
- this.colUser.ReadOnly = true;
- this.colUser.Visible = false;
- //
- // colLoginName
- //
- this.colLoginName.HeaderText = "店铺登录名";
- this.colLoginName.Name = "colLoginName";
- this.colLoginName.ReadOnly = true;
- this.colLoginName.Visible = false;
- //
- // colShopId
- //
- this.colShopId.HeaderText = "店铺Id";
- this.colShopId.Name = "colShopId";
- this.colShopId.ReadOnly = true;
- this.colShopId.Visible = false;
- this.colShopId.Width = 55;
- //
- // colShopName
- //
- this.colShopName.HeaderText = "店铺名称";
- this.colShopName.Name = "colShopName";
- this.colShopName.ReadOnly = true;
- this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
- this.colShopName.Width = 70;
- //
- // colShopNotes
- //
- this.colShopNotes.HeaderText = "分组";
- this.colShopNotes.Name = "colShopNotes";
- this.colShopNotes.ReadOnly = true;
- this.colShopNotes.Width = 70;
- //
- // colLoginStatus
- //
- this.colLoginStatus.HeaderText = "状态";
- this.colLoginStatus.Name = "colLoginStatus";
- this.colLoginStatus.ReadOnly = true;
- this.colLoginStatus.Resizable = System.Windows.Forms.DataGridViewTriState.True;
- this.colLoginStatus.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
- this.colLoginStatus.Width = 38;
- //
- // colCanUse
- //
- this.colCanUse.HeaderText = "可用";
- this.colCanUse.Name = "colCanUse";
- this.colCanUse.ReadOnly = true;
- this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True;
- this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
- this.colCanUse.Visible = false;
- this.colCanUse.Width = 28;
- //
- // colMessage
- //
- this.colMessage.HeaderText = "消息";
- this.colMessage.Name = "colMessage";
- this.colMessage.ReadOnly = true;
+ this.btnStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnStop.CanvasColor = System.Drawing.SystemColors.Control;
+ this.btnStop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
+ this.btnStop.DisabledBackColor = System.Drawing.Color.Empty;
+ this.btnStop.Location = new System.Drawing.Point(304, 0);
+ this.btnStop.Name = "btnStop";
+ this.btnStop.Size = new System.Drawing.Size(117, 21);
+ this.btnStop.Style.Alignment = System.Drawing.StringAlignment.Center;
+ this.btnStop.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
+ this.btnStop.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
+ this.btnStop.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
+ this.btnStop.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
+ this.btnStop.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
+ this.btnStop.Style.GradientAngle = 90;
+ this.btnStop.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
+ this.btnStop.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
+ this.btnStop.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
+ this.btnStop.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
+ this.btnStop.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
+ this.btnStop.TabIndex = 668;
+ this.btnStop.Text = "停止当前操作";
+ this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
//
// JoinDeliveryFrom
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
- this.ClientSize = new System.Drawing.Size(1314, 455);
+ this.ClientSize = new System.Drawing.Size(1478, 616);
this.Controls.Add(this.splitContainer1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "JoinDeliveryFrom";
@@ -878,7 +830,6 @@ namespace TemuKJD.KJDForms.ProductForms
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.ucGroupBoxEx3.ResumeLayout(false);
- this.ucGroupBoxEx3.PerformLayout();
this.ucGroupBoxEx1.ResumeLayout(false);
this.ucGroupBoxEx1.PerformLayout();
this.splitContainer3.Panel1.ResumeLayout(false);
@@ -892,10 +843,12 @@ namespace TemuKJD.KJDForms.ProductForms
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pbShopLoading)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).EndInit();
+ this.pnlMsg.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvStock)).EndInit();
this.splitContainer4.Panel1.ResumeLayout(false);
this.splitContainer4.Panel2.ResumeLayout(false);
+ this.splitContainer4.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit();
this.splitContainer4.ResumeLayout(false);
this.ResumeLayout(false);
@@ -931,6 +884,15 @@ namespace TemuKJD.KJDForms.ProductForms
private DevComponents.DotNetBar.PanelEx btnStart;
private DevComponents.DotNetBar.PanelEx btnStop;
private UserComponent.DataGridViewEx dgvStock;
+ private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colUser;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colLoginName;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colShopName;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes;
+ private System.Windows.Forms.DataGridViewLinkColumn colLoginStatus;
+ private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
private System.Windows.Forms.DataGridViewLinkColumn colUpId;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
@@ -943,26 +905,10 @@ namespace TemuKJD.KJDForms.ProductForms
private System.Windows.Forms.DataGridViewLinkColumn colProdSkc;
private System.Windows.Forms.DataGridViewTextBoxColumn colProdName;
private System.Windows.Forms.DataGridViewTextBoxColumn colPrcie;
- private System.Windows.Forms.DataGridViewTextBoxColumn colFrom;
- private System.Windows.Forms.DataGridViewTextBoxColumn colFromFake;
- private System.Windows.Forms.DataGridViewTextBoxColumn colInCartNumber7d;
- private System.Windows.Forms.DataGridViewTextBoxColumn colTodaySaleVolume;
- private System.Windows.Forms.DataGridViewTextBoxColumn colLastSevenDaysSaleVolume;
- private System.Windows.Forms.DataGridViewTextBoxColumn colSalesInventoryNum;
- private System.Windows.Forms.DataGridViewTextBoxColumn colWaitReceiveNum;
- private System.Windows.Forms.DataGridViewTextBoxColumn colQualityScore;
- private System.Windows.Forms.DataGridViewTextBoxColumn colQualityRate;
- private System.Windows.Forms.DataGridViewTextBoxColumn colQualityCount;
- private System.Windows.Forms.DataGridViewTextBoxColumn colNeedStockUp;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colStockUpNum;
+ private System.Windows.Forms.DataGridViewTextBoxColumn colCreateTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colMsg;
- private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
- private System.Windows.Forms.DataGridViewTextBoxColumn colUser;
- private System.Windows.Forms.DataGridViewTextBoxColumn colLoginName;
- private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
- private System.Windows.Forms.DataGridViewTextBoxColumn colShopName;
- private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes;
- private System.Windows.Forms.DataGridViewLinkColumn colLoginStatus;
- private System.Windows.Forms.DataGridViewCheckBoxColumn colCanUse;
- private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
+ private DevComponents.DotNetBar.PanelEx pnlMsg;
+ private System.Windows.Forms.Label lblMsg;
}
}
\ No newline at end of file
diff --git a/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.cs b/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.cs
index ecafb08..1d37a96 100644
--- a/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.cs
+++ b/TEMUKJD/KJDForms/ProductForms/JoinDeliveryFrom.cs
@@ -18,6 +18,7 @@ using TemuKJD.BLL;
using TemuKJD.Extension;
using TemuKJD.KJDForms.AdminForms;
using TemuKJD.KJDForms.ShopForms;
+using TemuKJD.ToolForms;
using Work;
namespace TemuKJD.KJDForms.ProductForms
@@ -45,7 +46,10 @@ namespace TemuKJD.KJDForms.ProductForms
dgvStock.AddSelectorColumn("colCheck");
dgvStock.AddImgColumn("colProductSkcPic", "colImgUrl");
- joinDeliveryConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig("join_delivery_config");
+ if (IsAdmin)
+ joinDeliveryConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig("admin_join_delivery_config");
+ else
+ joinDeliveryConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig("join_delivery_config");
if (joinDeliveryConfig == null)
joinDeliveryConfig = new JoinDeliveryConfig();
this.txtNotes.Text = joinDeliveryConfig.SearchNotes;
@@ -69,7 +73,10 @@ namespace TemuKJD.KJDForms.ProductForms
joinDeliveryConfig.RetryInterval = Math.Max(1, this.txtRetryInterval.Text.Trim().ParseToInt());
joinDeliveryConfig.SearchAllShop = this.chkSearchAllShop.Checked;
- NaiBa.Util.Helper.ConfigHelper.SaveConfig("join_delivery_config", joinDeliveryConfig);
+ if (IsAdmin)
+ NaiBa.Util.Helper.ConfigHelper.SaveConfig("admin_join_delivery_config", joinDeliveryConfig);
+ else
+ NaiBa.Util.Helper.ConfigHelper.SaveConfig("join_delivery_config", joinDeliveryConfig);
}
private void JoinDeliveryFrom_VisibleChanged(object sender, EventArgs e)
@@ -80,6 +87,10 @@ namespace TemuKJD.KJDForms.ProductForms
{
SearchShop(this.ucSplitPage1.CurrentPage);
}
+ else
+ {
+ RefreshShop();
+ }
}
}
@@ -192,12 +203,91 @@ namespace TemuKJD.KJDForms.ProductForms
private void btnRefreshShop_Click(object sender, EventArgs e)
{
- if (this.ucSplitPage1.CurrentPage != 1)
- this.ucSplitPage1.CurrentPage = 1;
+ if (IsAdmin)
+ {
+ if (this.ucSplitPage1.CurrentPage != 1)
+ this.ucSplitPage1.CurrentPage = 1;
+ else
+ SearchShop(1);
+ }
else
- SearchShop(1);
+ {
+ RefreshShop();
+ }
}
+ private void RefreshShop()
+ {
+ // 店铺Id
+ var selectIds = dgvShop.Rows.Cast().Where(row
+ => row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
+
+ var shopLst = GlobalConfig.ShopLoginList.ToList();
+ if (!string.IsNullOrWhiteSpace(txtShopId.Text))
+ {
+ shopLst = shopLst.Where(s => txtShopId.Text.Contains(s.ShopId)).ToList();
+ }
+ if (!string.IsNullOrWhiteSpace(txtShopName.Text))
+ {
+ shopLst = shopLst.Where(s => txtShopName.Text.Contains(s.ShopAccount)).ToList();
+ }
+ if (!string.IsNullOrWhiteSpace(txtNotes.Text))
+ {
+ shopLst = shopLst.Where(s => txtNotes.Text.Contains(s.Notes)).ToList();
+ }
+
+ // 获取被删除的店铺
+ List dgvRowList = dgvShop.Rows.Cast().Where(row
+ => !shopLst.Any(s => s.ShopId == row.Cells["colShopId"]?.Value?.ToString())).ToList();
+ // 更新被删除的店铺列表
+ foreach (var row in dgvRowList)
+ {
+ dgvShop.Rows.Remove(row);
+ }
+ // 绑定其他店铺(含新导入的店铺)
+ foreach (ShopLoginInfo shopEntity in shopLst)
+ {
+ if (!string.IsNullOrEmpty(shopEntity.ShopId))
+ BindShop(shopEntity, selectIds);
+ }
+ }
+
+ private void BindShop(ShopLoginInfo shopEntity, List selectShopId = null)
+ {
+ if (shopEntity == null)
+ return;
+ if (selectShopId == null)
+ selectShopId = new List();
+
+ bool canUse = shopEntity.LoginStatus2 == "国际版在线";
+ var row = dgvShop.Rows.Cast().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopId);
+ if (row == null)
+ {
+ int id = this.dgvShop.Rows.Add(
+ selectShopId.Contains(shopEntity.ShopId) && canUse,
+ shopEntity.UserName,
+ shopEntity.LoginName,
+ shopEntity.ShopId,
+ shopEntity.ShopAccount,
+ shopEntity.Notes,
+ canUse ? "在线" : "掉线",
+ canUse,
+ string.Empty
+ );
+ displayShopStatus(shopEntity);
+ }
+ else
+ {
+ row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopId) && canUse;
+ row.Cells["colLoginName"].Value = shopEntity.LoginName;
+ row.Cells["colShopName"].Value = shopEntity.ShopAccount;
+ row.Cells["colShopNotes"].Value = shopEntity.Notes;
+ row.Cells["colLoginStatus"].Value = canUse ? "在线" : "掉线";
+ displayShopStatus(shopEntity);
+ }
+ }
+
+
private void btnEmpty_Click(object sender, EventArgs e)
{
txtNotes.Text = txtShopId.Text = txtShopName.Text = "";
@@ -213,19 +303,19 @@ namespace TemuKJD.KJDForms.ProductForms
return;
}
- var columns = this.dgvStock.Columns.Cast();
- foreach (var col in columns)
- {
- if (col.Name == "colParentStockId" || col.Name == "colStockId")
- {
- col.Visible = true;
- }
- if (col.Name == "colTodaySaleVolume" || col.Name == "colLastSevenDaysSaleVolume" || col.Name == "colInCartNumber7d" || col.Name == "colSalesInventoryNum"
- || col.Name == "colWaitReceiveNum" || col.Name == "colNeedStockUp" || col.Name == "colQualityScore")
- {
- col.Visible = false;
- }
- }
+ //var columns = this.dgvStock.Columns.Cast();
+ //foreach (var col in columns)
+ //{
+ // if (col.Name == "colParentStockId" || col.Name == "colStockId")
+ // {
+ // col.Visible = true;
+ // }
+ // if (col.Name == "colTodaySaleVolume" || col.Name == "colLastSevenDaysSaleVolume" || col.Name == "colInCartNumber7d" || col.Name == "colSalesInventoryNum"
+ // || col.Name == "colWaitReceiveNum" || col.Name == "colNeedStockUp" || col.Name == "colQualityScore")
+ // {
+ // col.Visible = false;
+ // }
+ //}
lstStockInfo.Clear();
dgvStock.Rows.Clear();
@@ -271,23 +361,23 @@ namespace TemuKJD.KJDForms.ProductForms
continue;
#region 检测登录
- if (shop.LoginStatus != "登录成功")
+ if (shop.LoginStatus2 != "国际版在线")
{
continue;
}
- if(IsAdmin)
+ if (IsAdmin)
{
AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
}
else
- {
+ {
ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false);
}
- if (shop.LoginStatus != "登录成功")
+ if (shop.LoginStatus2 != "国际版在线")
{
Invoke(new Action(() =>
{
- var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopLoginName"].Value.ToString() == shop.LoginName);
+ var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colLoginName"].Value.ToString() == shop.LoginName);
foreach (var row in rows)
{
row.Cells["colMessage"].Value = "店铺掉线";
@@ -312,6 +402,7 @@ namespace TemuKJD.KJDForms.ProductForms
int totalPage = 1;
int pageSize = 20;
bool isError = false;
+ string errorMsg = "";
while (page <= totalPage)
{
if (cancellationTokenSource.IsCancellationRequested)
@@ -319,17 +410,18 @@ namespace TemuKJD.KJDForms.ProductForms
Thread.Sleep(100 + Randomx.GetId(200));
string jsonStr = GetShopStockList2(shop, page, pageSize);
- if (jsonStr.Contains("指定的值含有无效的控制字符"))
- {
- BaseMsgForm.ShowError("店铺" + shop.LoginName + " " + shop.ShopId + "已掉线");
- isError = true;
- break;
- }
- if (!jsonStr.Contains("\"success\":true"))
- jsonStr = GetShopStockList2(shop, page, pageSize);
if (!jsonStr.Contains("\"success\":true"))
{
isError = true;
+ var errMsg = BaseRegex.GetStringJson(ref jsonStr, "error_msg");
+ if (string.IsNullOrEmpty(errMsg))
+ errMsg = BaseRegex.GetStringJson(ref jsonStr, "errorMsg");
+ if (string.IsNullOrEmpty(errMsg))
+ errMsg = jsonStr;
+ if (!errorMsg.Contains(errMsg))
+ {
+ errorMsg += " " + errMsg;
+ }
}
if (jsonStr.Contains("\"success\":true"))
@@ -360,20 +452,15 @@ namespace TemuKJD.KJDForms.ProductForms
sInfo.supplierName,
sInfo.subPurchaseOrderSn,
sInfo.originalPurchaseOrderSn,
- sInfo.productSkcPicture.Replace("https", "http"),
+ sInfo.productSkcPicture.Replace("https", "http").Replace("img.kwcdn.com", "img.cdnfe.com"),
DataGridViewExtension.defaultBitmap,
sInfo.productId,
sInfo.productSkcId,
- sInfo.productName,
- "",
- "",
- "",
- "",
- "",
- "",
- 0.0,
- "",
- ""
+ sInfo.productName, // 标题
+ sInfo.skuQuantityDetailList.Min(s => s.supplierPrice) * 0.01 + "~" + sInfo.skuQuantityDetailList.Max(s => s.supplierPrice) * 0.01,
+ sInfo.skuQuantityTotalInfo.purchasePrice,
+ BaseClass.StampToDateTime((sInfo.purchaseTime.ParseToLong() * 0.001).ParseToInt()).ToString("yyyy/MM/dd HH:mm:ss"),
+ string.IsNullOrEmpty(sInfo.joinDeliverPlatformReason) ? "" : sInfo.joinDeliverPlatformReason
);
dgvStock.Rows[rowId].Height = 60;
@@ -402,7 +489,7 @@ namespace TemuKJD.KJDForms.ProductForms
{
foreach (var row in rows)
{
- row.Cells["colMessage"].Value = "查询失败";
+ row.Cells["colMessage"].Value = "查询失败" + errorMsg;
}
}
}));
@@ -433,12 +520,319 @@ namespace TemuKJD.KJDForms.ProductForms
page = Math.Max(page, 1);
string url = "https://agentseller.temu.com/mms/venom/api/supplier/purchase/manager/querySubOrderList";
string body;
- body = @"{""pageNo"":" + page + @",""pageSize"":" + pageSize + @",""urgencyType"":0,""isCustomGoods"":false,""statusList"":[1]," +
+ body = @"{""pageNo"":" + page + @",""pageSize"":" + pageSize + @",""urgencyType"":0,""isCustomGoods"":false,""statusList"":[1]," +
@"""oneDimensionSort"":{""firstOrderByParam"":""expectLatestDeliverTime"",""firstOrderByDesc"":0}}";
string refere = "https://agentseller.temu.com/stock/fully-mgt/order-manage";
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
}
+
+ private string JoinDeliveryOrderPlatform(ShopLoginInfo shop, List subPurchaseOrderSnLst)
+ {
+ string url = "https://agentseller.temu.com/mms/venom/api/supplier/purchase/manager/batchJoinDeliveryOrderPlatformV2";
+ string body;
+ body = "{\"joinDeliveryPlatformRequestList\":[";
+ //body += "{\"subPurchaseOrderSn\":\"WB251028608265\"},{\"subPurchaseOrderSn\":\"WB251028208967\"},{\"subPurchaseOrderSn\":\"WB251028438327\"}";
+ foreach (var sn in subPurchaseOrderSnLst)
+ {
+ body += "{\"subPurchaseOrderSn\":\"" + sn + "\"},";
+ }
+ body = body.TrimEnd(',');
+ body += "]}";
+ string refere = "https://agentseller.temu.com/stock/fully-mgt/order-manage";
+
+ return HttpResponseBLL.PostResponse2(shop, url, body, refere);
+ }
+
+ private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if (e.ColumnIndex < 0 || e.RowIndex < 0)
+ return;
+ string headerText = dgvShop.Columns[e.ColumnIndex].HeaderText;
+ string loginName = dgvShop.Rows[e.RowIndex].Cells["colLoginName"].Value.ParseToString();
+ string accountId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToString();
+ ShopLoginInfo shop = null;
+ if (IsAdmin)
+ shop = lstAdminShopInfo.FirstOrDefault(v => v.LoginName == loginName && v.ShopId == accountId);
+ else
+ shop = GlobalConfig.ShopLoginList.FirstOrDefault(v => v.LoginName == loginName && v.ShopId == accountId);
+
+ switch (headerText)
+ {
+ case "登录":
+ case "状态":
+ if (IsAdmin)
+ {
+ 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();
+ }
+ break;
+ default:
+ dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value;
+ break;
+ }
+ }
+ private void shopLoginForm_SaveComplete(object obj)
+ {
+ var shop = obj as ShopLoginInfo;
+ if (shop == null)
+ return;
+
+ displayShopStatus(shop);
+ }
+
+ private void dgvStock_CellContentClick(object sender, DataGridViewCellEventArgs e)
+ {
+ if (e.ColumnIndex < 0 || e.RowIndex < 0)
+ return;
+ string headerText = dgvStock.Columns[e.ColumnIndex].HeaderText;
+ string prodId = dgvStock.Rows[e.RowIndex].Cells["colProductId"].Value.ParseToString();
+ string accountId = dgvStock.Rows[e.RowIndex].Cells["colSupplierId"].Value.ParseToString();
+
+ switch (headerText)
+ {
+ case "Skc图片":
+ string url = dgvStock.Rows[e.RowIndex].Cells["colImgUrl"].Value.ParseToString().Replace("img.kwcdn.com", "img.cdnfe.com");
+ url = url.IndexOf("?") < 0 ? url : url.Substring(0, url.IndexOf("?"));
+ ShowImgForm imgFrom = new ShowImgForm(url);
+ imgFrom.ShowDialog();
+ break;
+ case "":
+ dgvStock.Rows[e.RowIndex].Cells["colCheck"].Value = !(bool)dgvStock.Rows[e.RowIndex].Cells["colCheck"].Value;
+ break;
+ default:
+ break;
+ }
+ }
+
+ private void btnStart_Click(object sender, EventArgs e)
+ {
+ cancellationTokenSource = new CancellationTokenSource();
+ ucGroupBoxEx3.Enabled = false;
+ var hideDateTime = DateTime.Now;
+ Task.Run(() =>
+ {
+ int count = 1;
+ while (cancellationTokenSource != null && !cancellationTokenSource.IsCancellationRequested)
+ {
+ Invoke(new Action(() =>
+ {
+ if(DateTime.Now > hideDateTime)
+ this.pnlMsg.Visible = false;
+ this.statusBar.lblTaskStatus.Text = "正在循环加入发货台,第 " + count + " 次...";
+ count++;
+ }));
+
+ var subPurchaseOrderSnLst = dgvStock.Rows.Cast().Where(row
+ => row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colStockId"]?.Value.ToString()).ToList();
+ var subPurchaseOrderLst = lstStockInfo.Where(o => subPurchaseOrderSnLst.Contains(o.subPurchaseOrderSn)).ToList();
+ var canNotJoinDeliverOrderLst = subPurchaseOrderLst.Where(p=>p.isCanJoinDeliverPlatform == false).ToList();
+ Invoke(new Action(() =>
+ {
+ foreach (var order in canNotJoinDeliverOrderLst)
+ {
+ subPurchaseOrderLst.Remove(order);
+ var row = dgvStock.Rows.Cast().FirstOrDefault(r => r.Cells["colStockId"].Value.ParseToString() == order.subPurchaseOrderSn);
+ if (row != null)
+ {
+ row.Cells["colMsg"].Value = order.joinDeliverPlatformReason;
+ row.Cells["colCheck"].Value = false;
+ if (order.joinDeliverPlatformReason == "当前备货单已加入发货台,无需重复操作" ||
+ order.joinDeliverPlatformReason == "当前备货单已创建发货单,无需重复操作")
+ {
+ row.Cells["colMsg"].Style.ForeColor = Color.Green;
+ }
+ else
+ {
+ row.Cells["colMsg"].Style.ForeColor = Color.Red;
+ }
+ }
+ }
+ }));
+ if (subPurchaseOrderLst.Count == 0)
+ {
+ Invoke(new Action(() =>
+ {
+ hideDateTime = DateTime.Now.AddSeconds(5);
+ this.pnlMsg.Visible = true;
+ this.lblMsg.Text = "请选择待加入发货台备货单!";
+ }));
+ }
+ List shopLst = new List();
+ var shopIdLst = dgvStock.Rows.Cast().Where(row
+ => row.Cells["colCheck"]?.Value.ParseToBool() == true).Select(r => r.Cells["colSupplierId"]?.Value.ToString()).Distinct().ToList();
+ if (IsAdmin)
+ {
+ shopLst = this.lstAdminShopInfo.Where(s => shopIdLst.Contains(s.ShopId)).ToList();
+ }
+ else
+ {
+ shopLst = GlobalConfig.ShopLoginList.Where(s => shopIdLst.Contains(s.ShopId)).ToList();
+ }
+ if (subPurchaseOrderSnLst.Count > 0 && shopLst.Count == 0)
+ {
+ Invoke(new Action(() =>
+ {
+ this.pnlMsg.Visible = true;
+ this.lblMsg.Text = "选择发货单对应的店铺不存在!";
+ }));
+ }
+
+ if (shopLst.Count > 0 && subPurchaseOrderLst.Count > 0)
+ {
+ List taskLst = new List();
+ var shopLstRandom = shopLst.OrderBy(x => Guid.NewGuid()).Take(5); // 每次随机取5个店铺尝试
+ foreach (var shop in shopLst)
+ {
+ var t = Task.Run(() =>
+ {
+ var shopTmp = shop;
+ var orderSubIds = subPurchaseOrderLst
+ .Where(o => shopTmp.ShopId.Contains(o.supplierId.ParseToString()))
+ .Select(o => o.subPurchaseOrderSn).Distinct().ToList();
+ var rows = dgvStock.Rows.Cast().Where(r => orderSubIds.Contains(r.Cells["colStockId"]?.Value.ToString()));
+
+ if (shop.LoginStatus2 != "国际版在线")
+ {
+ Invoke(new Action(() =>
+ {
+ foreach (var row in rows)
+ {
+ row.Cells["colMsg"].Value = "店铺掉线";
+ row.Cells["colMsg"].Style.ForeColor = Color.Red;
+ }
+ }));
+ Thread.Sleep(Math.Max(1000, txtRetryInterval.Text.ParseToInt() * 1000));
+ return;
+ }
+
+ //取最大100个商品,因为后台分页最大100每页
+ orderSubIds = orderSubIds.Take(100).ToList();
+ rows = dgvStock.Rows.Cast().Where(r => orderSubIds.Contains(r.Cells["colStockId"]?.Value.ToString()));
+
+ var joinRst = JoinDeliveryOrderPlatform(shop, orderSubIds);
+ if (!joinRst.Contains("\"success\":true"))
+ {
+ string errMsg = "";
+ if (IsAdmin)
+ {
+ AdminShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
+ }
+ else
+ {
+ ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false);
+ }
+ if (shop.LoginStatus2 != "国际版在线")
+ {
+ errMsg = "店铺掉线";
+ }
+ else
+ {
+ errMsg = BaseRegex.GetStringJson(ref joinRst, "error_msg");
+ if (string.IsNullOrEmpty(errMsg))
+ errMsg = BaseRegex.GetStringJson(ref joinRst, "errorMsg");
+ if (string.IsNullOrEmpty(errMsg))
+ errMsg = joinRst;
+ }
+ Invoke(new Action(() =>
+ {
+ foreach (var row in rows)
+ {
+ row.Cells["colMsg"].Value = errMsg;
+ row.Cells["colMsg"].Style.ForeColor = Color.Red;
+ }
+ }));
+ Thread.Sleep(Math.Max(1000, txtRetryInterval.Text.ParseToInt() * 1000));
+ return;
+ }
+
+ if (joinRst.Contains("\"success\":true"))
+ {
+ var jArr = new JArray();
+ try
+ {
+ var jObj = JObject.Parse(joinRst);
+ JoinDeliveryInfo joinDeliveryInfo = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(jObj["result"]));
+ if (joinDeliveryInfo.successInfoList.Count > 0)
+ {
+ // 成功不返回列表,失败才返回
+ }
+ Invoke(new Action(() =>
+ {
+ foreach (var row in rows)
+ {
+ var errInfo = joinDeliveryInfo.errorInfoList.FirstOrDefault(err => err.id == row.Cells["colStockId"].Value.ParseToString());
+ if (errInfo != null)
+ {
+ row.Cells["colMsg"].Value = errInfo.errorMsg;
+ row.Cells["colMsg"].Style.ForeColor = Color.Red;
+ if (!errInfo.errorMsg.Contains("商家备货火爆"))
+ {
+ row.Cells["colCheck"].Value = false;
+ }
+ if (errInfo.errorMsg == "当前备货单已加入发货台,无需重复操作" ||
+ errInfo.errorMsg == "当前备货单已创建发货单,无需重复操作")
+ {
+ row.Cells["colMsg"].Style.ForeColor = Color.Green;
+ }
+ }
+ else
+ {
+ row.Cells["colMsg"].Value = "备货单加入发货台成功";
+ row.Cells["colMsg"].Style.ForeColor = Color.Green;
+ row.Cells["colCheck"].Value = false;
+ }
+ }
+
+ }));
+ }
+ catch (Exception ex)
+ {
+ Invoke(new Action(() =>
+ {
+ foreach (var row in rows)
+ {
+ row.Cells["colMsg"].Value = ex.Message;
+ row.Cells["colMsg"].Style.ForeColor = Color.Red;
+ }
+ }));
+ }
+ }
+ });
+ taskLst.Add(t);
+ }
+ Task.WaitAll(taskLst.ToArray());
+ }
+ Thread.Sleep(Math.Max(1000, txtRetryInterval.Text.ParseToInt() * 1000));
+ }
+ Invoke(new Action(() =>
+ {
+ ucGroupBoxEx3.Enabled = true;
+ string sRst = "加入发货台已完成!";
+ if (cancellationTokenSource.IsCancellationRequested)
+ sRst = "已取消循环加入发货台!";
+
+ BaseMsgForm.ShowInfo(sRst);
+ this.statusBar.lblTaskStatus.Text = sRst;
+ this.pnlMsg.Visible = false;
+ }));
+ }, cancellationTokenSource.Token);
+ }
+
+ private void btnStop_Click(object sender, EventArgs e)
+ {
+ if (cancellationTokenSource != null)
+ cancellationTokenSource.Cancel();
+ }
}
public class JoinDeliveryConfig
@@ -449,7 +843,21 @@ namespace TemuKJD.KJDForms.ProductForms
///
/// 重试加入发货台的时间间隔
///
- public int RetryInterval { get; set; } = 1;
+ public int RetryInterval { get; set; } = 5;
public bool SearchAllShop { get; set; } = true;
}
+
+ public class JoinDeliveryInfo
+ {
+ public bool? isSuccess { get; set; }
+ public List errorInfoList { get; set; }
+ public List