From 85ed4137d256da0701b8ee693371347667ea3caa Mon Sep 17 00:00:00 2001 From: wule Date: Tue, 5 Aug 2025 18:54:19 +0800 Subject: [PATCH] =?UTF-8?q?1=E5=BA=97=E9=93=BA=E6=8A=98=E6=89=A3=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E9=80=BB=E8=BE=91=202=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E9=80=89=E5=93=81=E4=B8=8A=E8=B4=A7=E8=AE=B0=E5=BD=95=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E6=8F=90=E4=BA=A4=E7=9A=84draft=5Fid=E4=BB=A5?= =?UTF-8?q?=E5=A4=87=E5=90=8E=E7=BB=AD=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AllBase/BaseClass.cs | 4 +- AllBase/Model/Result/TemuActivityInfo.cs | 2 +- .../KJD_WebService/BLL/ProductManage.cs | 7 +- .../KJD_WebService/BLL/ProductThirdManage.cs | 7 +- TEMUKJD/KJD.csproj | 9 + .../DbProductSelectListManageForm.cs | 4 +- .../ProductThirdSelectListManageForm.cs | 4 +- .../MarketingActivityForm.Designer.cs | 286 +++++++++++++-- .../SalesCenterForms/MarketingActivityForm.cs | 332 ++++++++++++++---- .../UcActivityDiscountCtrl.Designer.cs | 96 +++++ .../UcActivityDiscountCtrl.cs | 93 +++++ .../UcActivityDiscountCtrl.resx | 120 +++++++ TEMUKJD/UserControls/UcSplitPage.Designer.cs | 1 - 13 files changed, 861 insertions(+), 104 deletions(-) create mode 100644 TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.Designer.cs create mode 100644 TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.cs create mode 100644 TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.resx diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index c9d4be3..a3347ca 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -27,8 +27,8 @@ namespace AllBase /// /// 版本ID /// - public static int VersionCount = 398; - //public static int VersionCount = 398; + public static int VersionCount = 500; + //public static int VersionCount = 500; /// /// 版本号 diff --git a/AllBase/Model/Result/TemuActivityInfo.cs b/AllBase/Model/Result/TemuActivityInfo.cs index 7b5f748..5707c77 100644 --- a/AllBase/Model/Result/TemuActivityInfo.cs +++ b/AllBase/Model/Result/TemuActivityInfo.cs @@ -43,7 +43,7 @@ namespace AllBase.Model.Result public long? endTime { get; set; } public List activityLabelList { get; set; } public string activityThematicName { get; set; } - public string discount { get; set; } = "-"; + public string discount { get; set; } = ""; } public class TemuActivitySiteInfo diff --git a/KJDService/KJD_WebService/BLL/ProductManage.cs b/KJDService/KJD_WebService/BLL/ProductManage.cs index 42d5a70..d97b272 100644 --- a/KJDService/KJD_WebService/BLL/ProductManage.cs +++ b/KJDService/KJD_WebService/BLL/ProductManage.cs @@ -389,12 +389,17 @@ namespace KJD_Web.BLL var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); var draft_id = RegexUtils.GetStringQuery(ref inputData, "draft_id")?.Replace("'", "\\'"); + var up_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_spu_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); var add_times = RegexUtils.GetStringQuery(ref inputData, "add_times")?.Replace("'", "\\'"); string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; MysqlUtils mySql = new MysqlUtils(conn); - string sql = "update kjd.product_select set"; + string sql = ""; + if (!string.IsNullOrEmpty(up_spu_id) && !string.IsNullOrEmpty(draft_id)) + sql += "insert into kjd.spu_map (draft_id,from_spu_id,shop_id) values(" + draft_id + "," + up_spu_id + ",'" + shop_id + "');"; + sql += "update kjd.product_select set"; if (draft_id != null) sql += " draft_id='" + draft_id + "',"; if (status != null) diff --git a/KJDService/KJD_WebService/BLL/ProductThirdManage.cs b/KJDService/KJD_WebService/BLL/ProductThirdManage.cs index 2e1209c..ef74900 100644 --- a/KJDService/KJD_WebService/BLL/ProductThirdManage.cs +++ b/KJDService/KJD_WebService/BLL/ProductThirdManage.cs @@ -352,12 +352,17 @@ namespace KJD_Web.BLL var id = RegexUtils.GetStringQuery(ref inputData, "db_id")?.Replace("'", "\\'"); var draft_id = RegexUtils.GetStringQuery(ref inputData, "draft_id")?.Replace("'", "\\'"); + var up_spu_id = RegexUtils.GetStringQuery(ref inputData, "up_spu_id")?.Replace("'", "\\'"); + var shop_id = RegexUtils.GetStringQuery(ref inputData, "shop_id")?.Replace("'", "\\'"); var status = RegexUtils.GetStringQuery(ref inputData, "status")?.Replace("'", "\\'"); var add_times = RegexUtils.GetStringQuery(ref inputData, "add_times")?.Replace("'", "\\'"); string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString; MysqlUtils mySql = new MysqlUtils(conn); - string sql = "update kjd.third_product_select set"; + string sql = ""; + if (!string.IsNullOrEmpty(up_spu_id) && !string.IsNullOrEmpty(draft_id)) + sql += "insert into kjd.spu_map (draft_id,from_spu_id,shop_id) values(" + draft_id + "," + up_spu_id + ",'" + shop_id + "');"; + sql += "update kjd.third_product_select set"; if (draft_id != null) sql += " draft_id='" + draft_id + "',"; if (status != null) diff --git a/TEMUKJD/KJD.csproj b/TEMUKJD/KJD.csproj index b07395a..407fdc2 100644 --- a/TEMUKJD/KJD.csproj +++ b/TEMUKJD/KJD.csproj @@ -445,6 +445,12 @@ SeckillingAndLimitedSalesShopForm.cs + + UserControl + + + UcActivityDiscountCtrl.cs + Form @@ -999,6 +1005,9 @@ SeckillingAndLimitedSalesShopForm.cs + + UcActivityDiscountCtrl.cs + FreightTemplateForm.cs Designer diff --git a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs index e5f5216..632f972 100644 --- a/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs +++ b/TEMUKJD/KJDForms/ProductSelectForms/DbProductSelectListManageForm.cs @@ -612,7 +612,9 @@ namespace TemuKJD.KJDForms.ProductSelectForms var url = BaseClass.BuildObjString("product/mdy_user_select_product_status"); var data = UserLogin.GetSignaturex() + "&db_id=" + prod.id + - "&draft_id=" + productDraftId + + "&draft_id=" + productDraftId + // draft_id即商品spuid + "&up_spu_id=" + prod.spu_id + + "&shop_id=" + prod.shop_id + "&status=已上传"; var html = GetHtml.PostUtf8(url, data); diff --git a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs index 8b5ab7c..8f9ee16 100644 --- a/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs +++ b/TEMUKJD/KJDForms/ProductThirdSelectForms/ProductThirdSelectListManageForm.cs @@ -628,7 +628,9 @@ namespace TemuKJD.KJDForms.ProductThirdSelectForms var url = BaseClass.BuildObjString("product_third/mdy_user_select_product_status"); var data = UserLogin.GetSignaturex() + "&db_id=" + prod.id + - "&draft_id=" + productDraftId + + "&draft_id=" + productDraftId + // draft_id即商品spuid + "&up_spu_id=" + prod.spu_id + + "&shop_id=" + prod.shop_id + "&status=已上传"; var html = GetHtml.PostUtf8(url, data); diff --git a/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.Designer.cs b/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.Designer.cs index f7dde55..a8cc2f2 100644 --- a/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.Designer.cs +++ b/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.Designer.cs @@ -44,6 +44,23 @@ namespace TemuKJD.KJDForms.SalesCenterForms this.panelEx1 = new DevComponents.DotNetBar.PanelEx(); this.btnClear = new DevComponents.DotNetBar.PanelEx(); this.ucGroupBoxEx3 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.actDiscount80 = new TemuKJD.KJDForms.SalesCenterForms.UcActivityDiscountCtrl(); + this.object_6dcc57fe_428d_475c_90c2_d99d71a7014f = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.ucCheckBox2 = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.ucCheckBox3 = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.actDiscount85 = new TemuKJD.KJDForms.SalesCenterForms.UcActivityDiscountCtrl(); + this.object_5db00808_c6be_4ffa_a702_9b91e2208933 = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.ucCheckBox1 = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.actDiscount70 = new TemuKJD.KJDForms.SalesCenterForms.UcActivityDiscountCtrl(); + this.chkDiscount6 = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.actDiscount60 = new TemuKJD.KJDForms.SalesCenterForms.UcActivityDiscountCtrl(); + this.panelEx2 = new DevComponents.DotNetBar.PanelEx(); + this.chkFullShop = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.chkNoSaleProd = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.panel1 = new System.Windows.Forms.Panel(); + this.label2 = new System.Windows.Forms.Label(); + this.numNoSaleDays = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); this.btnRefreshShop = new DevComponents.DotNetBar.PanelEx(); this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); @@ -80,8 +97,6 @@ namespace TemuKJD.KJDForms.SalesCenterForms this.colInventory = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); - this.chkFullShop = new TemuKJD.UserComponent.UcCheckBox(this.components); - this.chkNoSaleProd = new TemuKJD.UserComponent.UcCheckBox(this.components); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -102,6 +117,12 @@ namespace TemuKJD.KJDForms.SalesCenterForms this.splitContainer4.Panel1.SuspendLayout(); this.splitContainer4.Panel2.SuspendLayout(); this.splitContainer4.SuspendLayout(); + this.ucGroupBoxEx3.SuspendLayout(); + this.actDiscount80.SuspendLayout(); + this.actDiscount85.SuspendLayout(); + this.actDiscount70.SuspendLayout(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numNoSaleDays)).BeginInit(); this.ucGroupBoxEx1.SuspendLayout(); this.ucGroupBoxEx2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvShop)).BeginInit(); @@ -262,6 +283,14 @@ namespace TemuKJD.KJDForms.SalesCenterForms | System.Windows.Forms.AnchorStyles.Right))); 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.actDiscount80); + this.ucGroupBoxEx3.Controls.Add(this.actDiscount85); + this.ucGroupBoxEx3.Controls.Add(this.actDiscount70); + this.ucGroupBoxEx3.Controls.Add(this.actDiscount60); + this.ucGroupBoxEx3.Controls.Add(this.panelEx2); + this.ucGroupBoxEx3.Controls.Add(this.chkFullShop); + this.ucGroupBoxEx3.Controls.Add(this.chkNoSaleProd); + this.ucGroupBoxEx3.Controls.Add(this.panel1); this.ucGroupBoxEx3.Location = new System.Drawing.Point(272, 2); this.ucGroupBoxEx3.Name = "ucGroupBoxEx3"; this.ucGroupBoxEx3.Size = new System.Drawing.Size(704, 120); @@ -269,6 +298,211 @@ namespace TemuKJD.KJDForms.SalesCenterForms this.ucGroupBoxEx3.TabStop = false; this.ucGroupBoxEx3.Text = "活动设置"; // + // actDiscount80 + // + this.actDiscount80.AutoSize = true; + this.actDiscount80.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.actDiscount80.Controls.Add(this.object_6dcc57fe_428d_475c_90c2_d99d71a7014f); + this.actDiscount80.Controls.Add(this.ucCheckBox2); + this.actDiscount80.Controls.Add(this.ucCheckBox3); + this.actDiscount80.Discount = 80; + this.actDiscount80.Inventory = 10; + this.actDiscount80.IsDefaultInventory = false; + this.actDiscount80.Location = new System.Drawing.Point(15, 82); + this.actDiscount80.Name = "actDiscount80"; + this.actDiscount80.Size = new System.Drawing.Size(249, 21); + this.actDiscount80.TabIndex = 715; + // + // object_6dcc57fe_428d_475c_90c2_d99d71a7014f + // + this.object_6dcc57fe_428d_475c_90c2_d99d71a7014f.AutoSize = true; + this.object_6dcc57fe_428d_475c_90c2_d99d71a7014f.Location = new System.Drawing.Point(198, 2); + this.object_6dcc57fe_428d_475c_90c2_d99d71a7014f.Margin = new System.Windows.Forms.Padding(0); + this.object_6dcc57fe_428d_475c_90c2_d99d71a7014f.Name = "object_6dcc57fe_428d_475c_90c2_d99d71a7014f"; + this.object_6dcc57fe_428d_475c_90c2_d99d71a7014f.Size = new System.Drawing.Size(48, 16); + this.object_6dcc57fe_428d_475c_90c2_d99d71a7014f.TabIndex = 706; + this.object_6dcc57fe_428d_475c_90c2_d99d71a7014f.Text = "默认"; + this.object_6dcc57fe_428d_475c_90c2_d99d71a7014f.UseVisualStyleBackColor = true; + // + // ucCheckBox2 + // + this.ucCheckBox2.AutoSize = true; + this.ucCheckBox2.Location = new System.Drawing.Point(198, 2); + this.ucCheckBox2.Name = "ucCheckBox2"; + this.ucCheckBox2.Size = new System.Drawing.Size(48, 16); + this.ucCheckBox2.TabIndex = 706; + this.ucCheckBox2.Text = "默认"; + this.ucCheckBox2.UseVisualStyleBackColor = true; + // + // ucCheckBox3 + // + this.ucCheckBox3.AutoSize = true; + this.ucCheckBox3.Location = new System.Drawing.Point(198, 2); + this.ucCheckBox3.Name = "ucCheckBox3"; + this.ucCheckBox3.Size = new System.Drawing.Size(48, 16); + this.ucCheckBox3.TabIndex = 706; + this.ucCheckBox3.Text = "默认"; + this.ucCheckBox3.UseVisualStyleBackColor = true; + // + // actDiscount85 + // + this.actDiscount85.AutoSize = true; + this.actDiscount85.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.actDiscount85.Controls.Add(this.object_5db00808_c6be_4ffa_a702_9b91e2208933); + this.actDiscount85.Controls.Add(this.ucCheckBox1); + this.actDiscount85.Discount = 85; + this.actDiscount85.Inventory = 10; + this.actDiscount85.IsDefaultInventory = false; + this.actDiscount85.Location = new System.Drawing.Point(288, 82); + this.actDiscount85.Name = "actDiscount85"; + this.actDiscount85.Size = new System.Drawing.Size(249, 21); + this.actDiscount85.TabIndex = 711; + // + // object_5db00808_c6be_4ffa_a702_9b91e2208933 + // + this.object_5db00808_c6be_4ffa_a702_9b91e2208933.AutoSize = true; + this.object_5db00808_c6be_4ffa_a702_9b91e2208933.Location = new System.Drawing.Point(198, 2); + this.object_5db00808_c6be_4ffa_a702_9b91e2208933.Name = "object_5db00808_c6be_4ffa_a702_9b91e2208933"; + this.object_5db00808_c6be_4ffa_a702_9b91e2208933.Size = new System.Drawing.Size(48, 16); + this.object_5db00808_c6be_4ffa_a702_9b91e2208933.TabIndex = 706; + this.object_5db00808_c6be_4ffa_a702_9b91e2208933.Text = "默认"; + this.object_5db00808_c6be_4ffa_a702_9b91e2208933.UseVisualStyleBackColor = true; + // + // ucCheckBox1 + // + this.ucCheckBox1.AutoSize = true; + this.ucCheckBox1.Location = new System.Drawing.Point(198, 2); + this.ucCheckBox1.Name = "ucCheckBox1"; + this.ucCheckBox1.Size = new System.Drawing.Size(48, 16); + this.ucCheckBox1.TabIndex = 706; + this.ucCheckBox1.Text = "默认"; + this.ucCheckBox1.UseVisualStyleBackColor = true; + // + // actDiscount70 + // + this.actDiscount70.AutoSize = true; + this.actDiscount70.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.actDiscount70.Controls.Add(this.chkDiscount6); + this.actDiscount70.Discount = 70; + this.actDiscount70.Inventory = 10; + this.actDiscount70.IsDefaultInventory = false; + this.actDiscount70.Location = new System.Drawing.Point(288, 54); + this.actDiscount70.Name = "actDiscount70"; + this.actDiscount70.Size = new System.Drawing.Size(249, 21); + this.actDiscount70.TabIndex = 710; + // + // chkDiscount6 + // + this.chkDiscount6.AutoSize = true; + this.chkDiscount6.Location = new System.Drawing.Point(198, 2); + this.chkDiscount6.Name = "chkDiscount6"; + this.chkDiscount6.Size = new System.Drawing.Size(48, 16); + this.chkDiscount6.TabIndex = 706; + this.chkDiscount6.Text = "默认"; + this.chkDiscount6.UseVisualStyleBackColor = true; + // + // actDiscount60 + // + this.actDiscount60.AutoSize = true; + this.actDiscount60.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.actDiscount60.Discount = 60; + this.actDiscount60.Inventory = 10; + this.actDiscount60.IsDefaultInventory = false; + this.actDiscount60.Location = new System.Drawing.Point(15, 54); + this.actDiscount60.Name = "actDiscount60"; + this.actDiscount60.Size = new System.Drawing.Size(246, 21); + this.actDiscount60.TabIndex = 709; + // + // panelEx2 + // + this.panelEx2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.panelEx2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; + this.panelEx2.Cursor = System.Windows.Forms.Cursors.Hand; + this.panelEx2.DisabledBackColor = System.Drawing.Color.Empty; + this.panelEx2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.panelEx2.Location = new System.Drawing.Point(619, 32); + this.panelEx2.Name = "panelEx2"; + this.panelEx2.Size = new System.Drawing.Size(70, 23); + this.panelEx2.Style.Alignment = System.Drawing.StringAlignment.Center; + this.panelEx2.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.panelEx2.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); + this.panelEx2.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; + this.panelEx2.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash; + this.panelEx2.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None; + this.panelEx2.Style.ForeColor.Color = System.Drawing.Color.White; + this.panelEx2.Style.GradientAngle = 90; + this.panelEx2.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center; + this.panelEx2.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.panelEx2.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); + this.panelEx2.TabIndex = 701; + this.panelEx2.Text = "报名活动"; + this.panelEx2.Click += new System.EventHandler(this.btnSignActivity_Click); + // + // chkFullShop + // + this.chkFullShop.AutoSize = true; + this.chkFullShop.Checked = true; + this.chkFullShop.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkFullShop.Location = new System.Drawing.Point(18, 27); + this.chkFullShop.Name = "chkFullShop"; + this.chkFullShop.Size = new System.Drawing.Size(96, 16); + this.chkFullShop.TabIndex = 684; + this.chkFullShop.Text = "报名全店活动"; + this.chkFullShop.UseVisualStyleBackColor = true; + this.chkFullShop.CheckedChanged += new System.EventHandler(this.chkFullShop_CheckedChanged); + // + // chkNoSaleProd + // + this.chkNoSaleProd.AutoSize = true; + this.chkNoSaleProd.Location = new System.Drawing.Point(120, 27); + this.chkNoSaleProd.Name = "chkNoSaleProd"; + this.chkNoSaleProd.Size = new System.Drawing.Size(96, 16); + this.chkNoSaleProd.TabIndex = 685; + this.chkNoSaleProd.Text = "算法报名活动"; + this.chkNoSaleProd.UseVisualStyleBackColor = true; + this.chkNoSaleProd.CheckedChanged += new System.EventHandler(this.chkNoSaleProd_CheckedChanged); + // + // panel1 + // + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.numNoSaleDays); + this.panel1.Controls.Add(this.label1); + this.panel1.Location = new System.Drawing.Point(223, 24); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(311, 24); + this.panel1.TabIndex = 722; + this.panel1.Visible = false; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(156, 5); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(101, 12); + this.label2.TabIndex = 725; + this.label2.Text = "天,且未出单商品"; + // + // numNoSaleDays + // + this.numNoSaleDays.Location = new System.Drawing.Point(110, 1); + this.numNoSaleDays.Name = "numNoSaleDays"; + this.numNoSaleDays.Size = new System.Drawing.Size(40, 21); + this.numNoSaleDays.TabIndex = 724; + this.numNoSaleDays.Value = new decimal(new int[] { + 30, + 0, + 0, + 0}); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 5); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(101, 12); + this.label1.TabIndex = 723; + this.label1.Text = "设置加站时间超过"; + // // ucGroupBoxEx1 // this.ucGroupBoxEx1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -682,28 +916,6 @@ namespace TemuKJD.KJDForms.SalesCenterForms this.statusBar.Size = new System.Drawing.Size(700, 26); this.statusBar.TabIndex = 2; // - // chkFullShop - // - this.chkFullShop.AutoSize = true; - this.chkFullShop.Location = new System.Drawing.Point(18, 22); - this.chkFullShop.Name = "chkFullShop"; - this.chkFullShop.Size = new System.Drawing.Size(96, 16); - this.chkFullShop.TabIndex = 684; - this.chkFullShop.Text = "报名全店活动"; - this.chkFullShop.UseVisualStyleBackColor = true; - this.chkFullShop.CheckedChanged += new System.EventHandler(this.chkFullShop_CheckedChanged); - // - // chkNoSaleProd - // - this.chkNoSaleProd.AutoSize = true; - this.chkNoSaleProd.Location = new System.Drawing.Point(18, 44); - this.chkNoSaleProd.Name = "chkNoSaleProd"; - this.chkNoSaleProd.Size = new System.Drawing.Size(96, 16); - this.chkNoSaleProd.TabIndex = 685; - this.chkNoSaleProd.Text = "算法报名活动"; - this.chkNoSaleProd.UseVisualStyleBackColor = true; - this.chkNoSaleProd.CheckedChanged += new System.EventHandler(this.chkNoSaleProd_CheckedChanged); - // // MarketingActivityForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -734,6 +946,17 @@ namespace TemuKJD.KJDForms.SalesCenterForms this.splitContainer4.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit(); this.splitContainer4.ResumeLayout(false); + this.ucGroupBoxEx3.ResumeLayout(false); + this.ucGroupBoxEx3.PerformLayout(); + this.actDiscount80.ResumeLayout(false); + this.actDiscount80.PerformLayout(); + this.actDiscount85.ResumeLayout(false); + this.actDiscount85.PerformLayout(); + this.actDiscount70.ResumeLayout(false); + this.actDiscount70.PerformLayout(); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numNoSaleDays)).EndInit(); this.ucGroupBoxEx1.ResumeLayout(false); this.ucGroupBoxEx2.ResumeLayout(false); this.ucGroupBoxEx2.PerformLayout(); @@ -792,5 +1015,20 @@ namespace TemuKJD.KJDForms.SalesCenterForms private System.Windows.Forms.DataGridViewTextBoxColumn colDiscount; private System.Windows.Forms.DataGridViewTextBoxColumn colActivityMsg; private UserComponent.UcCheckBox chkGetDiscount; + private DevComponents.DotNetBar.PanelEx panelEx2; + private UcActivityDiscountCtrl actDiscount85; + private UserComponent.UcCheckBox object_5db00808_c6be_4ffa_a702_9b91e2208933; + private UserComponent.UcCheckBox ucCheckBox1; + private UcActivityDiscountCtrl actDiscount70; + private UserComponent.UcCheckBox chkDiscount6; + private UcActivityDiscountCtrl actDiscount60; + private UcActivityDiscountCtrl actDiscount80; + private UserComponent.UcCheckBox object_6dcc57fe_428d_475c_90c2_d99d71a7014f; + private UserComponent.UcCheckBox ucCheckBox2; + private UserComponent.UcCheckBox ucCheckBox3; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.NumericUpDown numNoSaleDays; + private System.Windows.Forms.Label label1; } } \ No newline at end of file diff --git a/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.cs b/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.cs index 54a2238..6eff8d4 100644 --- a/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.cs +++ b/TEMUKJD/KJDForms/SalesCenterForms/MarketingActivityForm.cs @@ -25,6 +25,8 @@ namespace TemuKJD.KJDForms.SalesCenterForms public CancellationTokenSource cancellationTokenSource { get; set; } = null; public List lstActivityThematic { get; set; } = new List(); public List lstShopIdSelect = new List(); + public List lstDiscount = new List() { 60, 70, 80, 85 }; + public Dictionary> dicNoSaleProd = new Dictionary>(); public MarketingActivityForm() { @@ -200,11 +202,23 @@ namespace TemuKJD.KJDForms.SalesCenterForms private void chkFullShop_CheckedChanged(object sender, EventArgs e) { - + if (chkFullShop.Checked) + chkNoSaleProd.Checked = false; + else + chkNoSaleProd.Checked = true; } private void chkNoSaleProd_CheckedChanged(object sender, EventArgs e) { - + if (chkNoSaleProd.Checked) + { + chkFullShop.Checked = false; + panel1.Visible = true; + } + else + { + chkFullShop.Checked = true; + panel1.Visible = false; + } } private void btnSearchActivity_Click(object sender, EventArgs e) @@ -257,27 +271,8 @@ namespace TemuKJD.KJDForms.SalesCenterForms continue; #region 检测登录 - if (shop.LoginStatus2 != "国际版在线") - { + if (!CheckLogin(shop)) continue; - } - if (ShopListForm.Instance == null) - ShopListForm.Instance = new ShopListForm(); - ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false); - if (shop.LoginStatus2 != "国际版在线") - { - Invoke(new Action(() => - { - var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopLoginName"].Value.ToString() == shop.LoginName); - foreach (var row in rows) - { - row.Cells["colMessage"].Value = "店铺掉线"; - row.Cells["colLoginStatus"].Value = "国际版未登录"; - row.Cells["colCanUse"].Value = false; - } - })); - continue; - } #endregion Invoke(new Action(() => @@ -301,8 +296,8 @@ namespace TemuKJD.KJDForms.SalesCenterForms int tryCount = 0; tryAgain: Thread.Sleep(100 + Randomx.GetId(200)); - string jsonStr = GetActivityList(shop); - if (jsonStr.Contains("指定的值含有无效的控制字符")) + string jsonRst = GetActivityList(shop); + if (jsonRst.Contains("指定的值含有无效的控制字符")) { Invoke(new Action(() => { @@ -318,28 +313,28 @@ namespace TemuKJD.KJDForms.SalesCenterForms isError = true; break; } - if (jsonStr.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) + if (jsonRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) { tryCount++; goto tryAgain; } - if (!jsonStr.Contains("\"success\":true")) + if (!jsonRst.Contains("\"success\":true")) { isError = true; - string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg"); + string sErr = BaseRegex.GetStringJson(ref jsonRst, "errorMsg"); if (!string.IsNullOrWhiteSpace(sErr) && !errMsg.Contains(sErr)) errMsg += sErr + " "; page++; continue; } - if (jsonStr.Contains("\"success\":true")) + if (jsonRst.Contains("\"success\":true")) { var jArr = new JArray(); try { - var jObj = JObject.Parse(jsonStr); + var jObj = JObject.Parse(jsonRst); jArr = jObj["result"]?["activityList"] as JArray; if (jArr == null) jArr = new JArray(); @@ -356,12 +351,13 @@ namespace TemuKJD.KJDForms.SalesCenterForms { lstActivityThematic.Add(pInfo); string name = pInfo.activityThematicName; - pInfo.discount = BaseRegex.GetMatchRegexString(ref name, "(\\d{1,3}折)"); - pInfo.discount = string.IsNullOrWhiteSpace(pInfo.discount) ? "-" : pInfo.discount; + pInfo.discount = BaseRegex.GetMatchRegexString(ref name, "(\\d{1,3}折)").ParseToString(); + pInfo.discount = pInfo.discount.Replace("折", ""); + pInfo.discount = string.IsNullOrWhiteSpace(pInfo.discount) ? "" : pInfo.discount; } } - int total = BaseRegex.GetStringJson(ref jsonStr, "total").ParseToInt(); + int total = BaseRegex.GetStringJson(ref jsonRst, "total").ParseToInt(); totalPage = Math.Ceiling(total / 10.0).ParseToInt(); } page++; @@ -390,17 +386,29 @@ namespace TemuKJD.KJDForms.SalesCenterForms foreach (var actInfo in lstActivityThematic) { + string sActivityTime = BaseClass.StampToDateTime((int)(actInfo.startTime.ParseToLong() / 1000)).ToString("yyyy/MM/dd HH:mm:ss") + "~" + + BaseClass.StampToDateTime((int)(actInfo.endTime.ParseToLong() / 1000)).ToString("yyyy/MM/dd HH:mm:ss") + "(" + + actInfo.durationDays + "天)"; + string sActivityRemaining = ""; + TimeSpan timeRemaining = BaseClass.StampToDateTime((int)(actInfo.enrollDeadLine.ParseToLong() / 1000)) - DateTime.Now; + if (timeRemaining.Days >= 1) + sActivityRemaining = timeRemaining.Days + "天后截止"; + else if (timeRemaining.Hours >= 1) + sActivityRemaining = timeRemaining.Hours + "小时后截止"; + else if (timeRemaining.Minutes >= 1) + sActivityRemaining = timeRemaining.Minutes + "分钟后截止"; + else + sActivityRemaining = timeRemaining.Seconds + "秒后截止"; + Invoke(new Action(() => { int rowId = this.dgvActivity.Rows.Add( false, actInfo.activityThematicId, actInfo.activityThematicName, - BaseClass.StampToDateTime((int)(actInfo.startTime.ParseToLong() / 1000)).ToString("yyyy/MM/dd HH:mm:ss") + "~" + - BaseClass.StampToDateTime((int)(actInfo.endTime.ParseToLong() / 1000)).ToString("yyyy/MM/dd HH:mm:ss") + "(" + - actInfo.durationDays + "天)", - (BaseClass.StampToDateTime((int)(actInfo.enrollDeadLine.ParseToLong() / 1000)) - DateTime.Now).Days + "天后截止", - actInfo.discount + sActivityTime, + sActivityRemaining, + string.IsNullOrEmpty(actInfo.discount)? "-" : actInfo.discount.TrimEnd('0') + "折" ); dgvActivity.Rows[rowId].Height = 40; @@ -459,7 +467,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms if (actRow == null) continue; - if (!string.IsNullOrWhiteSpace(actInfo.discount) && actInfo.discount != "-") + if (!string.IsNullOrWhiteSpace(actInfo.discount)) { this.Invoke(new Action(() => { @@ -493,35 +501,18 @@ namespace TemuKJD.KJDForms.SalesCenterForms })); #region 检测登录 - if (shop.LoginStatus2 != "国际版在线") - { - continue; - } - if (ShopListForm.Instance == null) - ShopListForm.Instance = new ShopListForm(); if (shop.LastRefreshDate == "") - ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false); - if (shop.LoginStatus2 != "国际版在线") { - Invoke(new Action(() => - { - var shopRows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopLoginName"].Value.ToString() == shop.LoginName); - foreach (var r in shopRows) - { - r.Cells["colMessage"].Value = "店铺掉线"; - r.Cells["colLoginStatus"].Value = "国际版未登录"; - r.Cells["colCanUse"].Value = false; - } - })); - continue; - } + if (!CheckLogin(shop)) + continue; + } #endregion int tryCount = 0; tryAgain: Thread.Sleep(100 + Randomx.GetId(200)); - string jsonStr = GetActivityMatch(shop, actInfo.activityThematicId.ParseToLong()); - if (jsonStr.Contains("指定的值含有无效的控制字符")) + string jsonRst = GetActivityMatch(shop, actInfo.activityThematicId.ParseToLong()); + if (jsonRst.Contains("指定的值含有无效的控制字符")) { Invoke(new Action(() => { @@ -535,26 +526,26 @@ namespace TemuKJD.KJDForms.SalesCenterForms })); continue; } - if (jsonStr.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) + if (jsonRst.Contains("当前操作人数太多,请稍后重试") && tryCount < 5) { tryCount++; goto tryAgain; } - if (jsonStr.Contains("当前操作人数太多,请稍后重试")) + if (jsonRst.Contains("当前操作人数太多,请稍后重试")) { } - if (!jsonStr.Contains("\"success\":true")) + if (!jsonRst.Contains("\"success\":true")) { //isError = true; - //string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg"); + //string sErr = BaseRegex.GetStringJson(ref jsonRst, "errorMsg"); //if (!string.IsNullOrWhiteSpace(sErr) && !errMsg.Contains(sErr)) // errMsg += sErr + " "; //page++; - string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg"); + string sErr = BaseRegex.GetStringJson(ref jsonRst, "errorMsg"); if (string.IsNullOrEmpty(sErr)) - sErr = BaseRegex.GetStringJson(ref jsonStr, "err_msg"); + sErr = BaseRegex.GetStringJson(ref jsonRst, "err_msg"); if (string.IsNullOrEmpty(sErr)) - sErr = jsonStr; + sErr = jsonRst; Invoke(new Action(() => { actRow.Cells["colActivityMsg"].Value = sErr; @@ -563,12 +554,12 @@ namespace TemuKJD.KJDForms.SalesCenterForms continue; } - if (jsonStr.Contains("\"success\":true")) + if (jsonRst.Contains("\"success\":true")) { var jArr = new JArray(); try { - var jObj = JObject.Parse(jsonStr); + var jObj = JObject.Parse(jsonRst); jArr = jObj["result"]?["matchList"] as JArray; if (jArr == null) jArr = new JArray(); @@ -590,10 +581,10 @@ namespace TemuKJD.KJDForms.SalesCenterForms var suggestActivityPrice = skuObj["suggestActivityPrice"].ParseToInt(); var dailyPrice = skuObj["dailyPrice"].ParseToInt(); var discount = suggestActivityPrice * 100.0 / dailyPrice; - actInfo.discount = Math.Round(discount) + "折"; + actInfo.discount = Math.Round(discount) + ""; Invoke(new Action(() => { - actRow.Cells["colDiscount"].Value = actInfo.discount; + actRow.Cells["colDiscount"].Value = string.IsNullOrEmpty(actInfo.discount) ? "-" : actInfo.discount.TrimEnd('0') + "折"; actRow.Cells["colActivityMsg"].Value = "折扣查询成功"; shopRow.Cells["colMessage"].Value = ""; })); @@ -602,7 +593,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); } } } - if(string.IsNullOrEmpty(actInfo.discount) || !actInfo.discount.Contains("折")) + if(string.IsNullOrEmpty(actInfo.discount)) { this.Invoke(new Action(() => { @@ -612,6 +603,186 @@ namespace TemuKJD.KJDForms.SalesCenterForms } } + int GetNearDiscount(int discount) + { + if (lstDiscount.Count <= 0) + return 100; + if (discount < lstDiscount.First()) + return lstDiscount.First(); + if (discount >= lstDiscount.Last()) + return lstDiscount.Last(); + for (int i = 0; i < lstDiscount.Count - 2; i++) + { + if (discount >= lstDiscount[i] && discount < lstDiscount[i + 1]) + return lstDiscount[i]; + } + return lstDiscount.Last(); + } + + private void btnSignActivity_Click(object sender, EventArgs e) + { + var lstShopId = dgvShop.Rows.Cast().Where(row + => row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList(); + if (lstShopId.Count == 0) + { + BaseMsgForm.ShowInfo("请选择店铺!"); + return; + } + + var lstActivityId = dgvActivity.Rows.Cast().Where(row + => row.Cells["colCheckActivity"]?.Value.ParseToBool() == true).Select(r => r.Cells["colActivityId"]?.Value.ToString()).ToList(); + if (lstActivityId.Count == 0) + { + BaseMsgForm.ShowInfo("请选择活动!"); + return; + } + + #region 重置控件数据 + dgvProduct.Rows.Clear(); + var shopRows = this.dgvShop.Rows.Cast(); + foreach (var r in shopRows) + { + r.Cells["colMessage"].Value = ""; + } + ucGroupBoxEx2.Enabled = false; + ucGroupBoxEx3.Enabled = false; + cancellationTokenSource = new CancellationTokenSource(); + lstShopIdSelect.Clear(); + lstShopIdSelect.AddRange(lstShopId); + #endregion + + Task.Run(() => + { + if (chkNoSaleProd.Checked) + GetNoSaleProd(); + + SignActivity(); + + Invoke(new Action(() => + { + ucGroupBoxEx2.Enabled = true; + ucGroupBoxEx3.Enabled = true; + string sRst = "查询结束!"; + if (cancellationTokenSource.IsCancellationRequested) + sRst = "已取消查询!"; + + BaseMsgForm.ShowInfo(sRst); + this.statusBar.lblTaskStatus.Text = sRst; + })); + },cancellationTokenSource.Token); + } + + public void GetNoSaleProd() + { + int i = 0; + foreach (var shopId in lstShopIdSelect) + { + this.Invoke(new Action(() => + { + this.statusBar.lblTaskStatus.Text = "正在查询无销量商品..."; + this.statusBar.pgbTaskProgress.Maximum = lstShopIdSelect.Count; + this.statusBar.UpdateProgressBar(i + 1); + i++; + })); + + if (cancellationTokenSource.IsCancellationRequested) + break; + + var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId); + if (shop == null) + continue; + var shopRow = this.dgvShop.Rows.Cast() + .FirstOrDefault(r => r.Cells["colShopId"].Value.ParseToString() == shop.ShopId); + if (shopRow == null) + continue; + + if (!CheckLogin(shop)) + continue; + + this.dicNoSaleProd[shop.ShopId] = new List(); + int page = 0; + int totalPage = 1; + while (page < totalPage) + { + page++; + string jsonRst = GetNoSaleProd(shop, numNoSaleDays.Value.ParseToInt(), page); + + if (!jsonRst.Contains("\"success\":true")) + { + string sErr = BaseRegex.GetStringJson(ref jsonRst, "errorMsg"); + if (string.IsNullOrEmpty(sErr)) + sErr = BaseRegex.GetStringJson(ref jsonRst, "err_msg"); + if (string.IsNullOrEmpty(sErr)) + sErr = jsonRst; + Invoke(new Action(() => + { + shopRow.Cells["colMessage"].Value = sErr; + })); + break; + } + + var jArr = new JArray(); + try + { + var jObj = JObject.Parse(jsonRst); + jArr = jObj["result"]["subOrderList"] as JArray; + if (jArr == null) + jArr = new JArray(); + + foreach (var item in jArr) + { + string sItem = item.ToString(); + SubOrderInfo sInfo = JsonHelper.DeserializeJsonToObject(sItem); // 反序列化得到类 + if (sInfo != null) + { + this.dicNoSaleProd[shop.ShopId].Add(sInfo); + } + } + } + catch (Exception ex) + { + BaseMsgForm.ShowError(ex.Message); + } + + int total = BaseRegex.GetStringJson(ref jsonRst, "total").ParseToInt(); + totalPage = Math.Ceiling(total / 40.0).ParseToInt(); + } + } + } + + public void SignActivity() + { + foreach (var shopId in lstShopIdSelect) + { + + } + } + + public bool CheckLogin(ShopLoginInfo shop) + { + if (shop.LoginStatus2 != "国际版在线") + { + return false; + } + if (ShopListForm.Instance == null) ShopListForm.Instance = new ShopListForm(); + ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false); + if (shop.LoginStatus2 != "国际版在线") + { + Invoke(new Action(() => + { + var rows = this.dgvShop.Rows.Cast().Where(r => r.Cells["colShopLoginName"].Value.ToString() == shop.LoginName); + foreach (var row in rows) + { + row.Cells["colMessage"].Value = "店铺掉线"; + row.Cells["colLoginStatus"].Value = "国际版未登录"; + row.Cells["colCanUse"].Value = false; + } + })); + return false; + } + return true; + } + /// /// 获取活动列表 /// @@ -639,5 +810,22 @@ namespace TemuKJD.KJDForms.SalesCenterForms string refere = "https://agentseller.temu.com/activity/marketing-activity/detail-new?type=13&thematicId=" + thematicId; return KJDHttpResponse.PostResponse2(shop, url, body, refere); } + + /// + /// + /// + /// + /// 加入站点天数 + /// + /// + private string GetNoSaleProd(ShopLoginInfo shop, int onSalesDays, int page=1) + { + string url = "https://agentseller.temu.com/mms/venom/api/supplier/sales/management/listWarehouse"; + string body; + body = @"{""pageNo"":" + page + @",""pageSize"":40,""isLack"":0,""selectStatusList"":[12],""priceAdjustRecentDays"":7, +""thirtyDaysSaleVolumMax"":0,""onSalesDurationOfflineGte"":" + onSalesDays + "}"; + string refere = "https://agentseller.temu.com/stock/fully-mgt/sale-manage/main"; + return KJDHttpResponse.PostResponse2(shop, url, body, refere); + } } } diff --git a/TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.Designer.cs b/TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.Designer.cs new file mode 100644 index 0000000..0440863 --- /dev/null +++ b/TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.Designer.cs @@ -0,0 +1,96 @@ + +namespace TemuKJD.KJDForms.SalesCenterForms +{ + partial class UcActivityDiscountCtrl + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.numInventory = new System.Windows.Forms.NumericUpDown(); + this.chkDefaultInventory = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.label1 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.numInventory)).BeginInit(); + this.SuspendLayout(); + // + // numInventory + // + this.numInventory.Location = new System.Drawing.Point(127, 0); + this.numInventory.Margin = new System.Windows.Forms.Padding(0); + this.numInventory.Name = "numInventory"; + this.numInventory.Size = new System.Drawing.Size(65, 21); + this.numInventory.TabIndex = 707; + this.numInventory.Value = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.numInventory.ValueChanged += new System.EventHandler(this.numInventory_ValueChanged); + // + // chkDiscount6 + // + this.chkDefaultInventory.AutoSize = true; + this.chkDefaultInventory.Location = new System.Drawing.Point(198, 2); + this.chkDefaultInventory.Margin = new System.Windows.Forms.Padding(0); + this.chkDefaultInventory.Name = "chkDiscount6"; + this.chkDefaultInventory.Size = new System.Drawing.Size(48, 16); + this.chkDefaultInventory.TabIndex = 706; + this.chkDefaultInventory.Text = "默认"; + this.chkDefaultInventory.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(0, 4); + this.label1.Margin = new System.Windows.Forms.Padding(0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(125, 12); + this.label1.TabIndex = 705; + this.label1.Text = "设置 6折报名活动库存"; + // + // UcActivityDiscountCtrl + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.AutoSize = true; + this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.Controls.Add(this.numInventory); + this.Controls.Add(this.chkDefaultInventory); + this.Controls.Add(this.label1); + this.Name = "UcActivityDiscountCtrl"; + this.Size = new System.Drawing.Size(246, 21); + ((System.ComponentModel.ISupportInitialize)(this.numInventory)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.NumericUpDown numInventory; + private UserComponent.UcCheckBox chkDefaultInventory; + private System.Windows.Forms.Label label1; + } +} diff --git a/TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.cs b/TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.cs new file mode 100644 index 0000000..5f80398 --- /dev/null +++ b/TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.cs @@ -0,0 +1,93 @@ +using NaiBa.Util.Extension; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TemuKJD.KJDForms.SalesCenterForms +{ + public partial class UcActivityDiscountCtrl : UserControl + { + public UcActivityDiscountCtrl() + { + InitializeComponent(); + this.Load += UcActivityDiscountCtrl_Load; + } + + private void UcActivityDiscountCtrl_Load(object sender, EventArgs e) + { + this.label1.Text = "设置" + discount.ToString().Trim('0').PadLeft(2, ' ') + "折报名活动库存"; + } + + private int discount = 90; + /// + /// 折扣数值 + /// + [Description("折扣数值"), Category("UserProperty")] + public int Discount + { + get + { + return discount; + } + set + { + if (discount != value) + { + discount = value; + this.label1.Text = "设置" + discount.ToString().Trim('0').PadLeft(2, ' ') + "折报名活动库存"; + this.Invalidate(); + } + } + } + + private int inventory = 10; + /// + /// 活动库存 + /// + [Description("活动库存"), Category("UserProperty")] + public int Inventory + { + get + { + return inventory; + } + set + { + if (inventory != value) + { + inventory = value; + this.numInventory.Value = inventory; + this.Invalidate(); + } + } + } + + [Description("默认库存"), Category("UserProperty")] + public bool IsDefaultInventory + { + get + { + return this.chkDefaultInventory.Checked; + } + set + { + if (this.chkDefaultInventory.Checked != value) + { + this.chkDefaultInventory.Checked = value; + this.Invalidate(); + } + } + } + + private void numInventory_ValueChanged(object sender, EventArgs e) + { + this.inventory = numInventory.Value.ParseToInt(); + } + } +} diff --git a/TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.resx b/TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TEMUKJD/KJDForms/SalesCenterForms/UcActivityDiscountCtrl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TEMUKJD/UserControls/UcSplitPage.Designer.cs b/TEMUKJD/UserControls/UcSplitPage.Designer.cs index 825901e..4b8db49 100644 --- a/TEMUKJD/UserControls/UcSplitPage.Designer.cs +++ b/TEMUKJD/UserControls/UcSplitPage.Designer.cs @@ -219,7 +219,6 @@ namespace TemuKJD.UserControls // // UcSplitPage // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.Controls.Add(this.flowLayoutPanel2); this.Controls.Add(this.flowLayoutPanel1);