diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index 604cab6..c515f7b 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -27,7 +27,7 @@ namespace AllBase /// /// 版本ID /// - public static int VersionCount = 996; + public static int VersionCount = 999; //public static int VersionCount = 613; /// diff --git a/AllBase/Model/Config/WxShopMainStatistics.cs b/AllBase/Model/Config/WxShopMainStatistics.cs index 00e8df6..c4641fc 100644 --- a/AllBase/Model/Config/WxShopMainStatistics.cs +++ b/AllBase/Model/Config/WxShopMainStatistics.cs @@ -86,6 +86,10 @@ namespace AllBase.Model.Config /// public WxShopSaleStatisticsInfo WxShopSaleInfoToday { get; set; } = new WxShopSaleStatisticsInfo(); /// + /// 主页昨日店铺经营信息 + /// + public WxShopSaleStatisticsInfo WxShopSaleInfo1Day { get; set; } = new WxShopSaleStatisticsInfo(); + /// /// 主页近7日店铺经营信息 /// public WxShopSaleStatisticsInfo WxShopSaleInfo7Day { get; set; } = new WxShopSaleStatisticsInfo(); diff --git a/AllBase/Model/Result/ShopLoginInfo.cs b/AllBase/Model/Result/ShopLoginInfo.cs index 1eb157a..08a1d57 100644 --- a/AllBase/Model/Result/ShopLoginInfo.cs +++ b/AllBase/Model/Result/ShopLoginInfo.cs @@ -199,6 +199,8 @@ namespace AllBase.Model.Result public string ad_login_status { get; set; } public DateTime? jit_expire_time { get; set; } + + public string CurrentProdId { get; set; } } public class AuthInfo diff --git a/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs b/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs index 0f04388..9153719 100644 --- a/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs +++ b/KJDService/KJD_WebService/BLL/BXX/BXXShopManage.cs @@ -46,7 +46,9 @@ namespace KJD_Web.BLL.BXX obj1["client_id"] = "ad502ec19e0c49ab9df14f83494e153c"; obj1["client_secret"] = "bd52aba51737d03fc073711d386b3b0779d010ad"; obj1["market_id"] = 84862; - obj1["redirect_uri"] = "http%3A%2F%2Fpo.e57.cn%2Flogin%3Fsource%3Dpdd_code"; + //https://fuwu.pinduoduo.com/service-market/auth?response_type=code&client_id=ad502ec19e0c49ab9df14f83494e153c&redirect_uri=http%3A%2F%2Fpo.e57.cn%2Flogin%3Fsource%3Dpdd_code_pixiu + //obj1["redirect_uri"] = "http%3A%2F%2Fpo.e57.cn%2Flogin%3Fsource%3Dpdd_code"; + obj1["redirect_uri"] = "http%3A%2F%2Fpo.e57.cn%2Flogin%3Fsource%3Dpdd_code_pixiu"; obj1["is_current"] = false; jArr.Add(obj1); diff --git a/TEMUKJD/BLL/Pdd/PddApiHelper.cs b/TEMUKJD/BLL/Pdd/PddApiHelper.cs index 5f5875c..ff68c59 100644 --- a/TEMUKJD/BLL/Pdd/PddApiHelper.cs +++ b/TEMUKJD/BLL/Pdd/PddApiHelper.cs @@ -78,23 +78,6 @@ namespace TemuKJD.BLL.PddApi }; } - //public static List> LstAuthInfos { get; set; } - //public static void GetPddLocalTokens() - //{ - // if (BaseClass.MainPath == "binxixi") - // { - // LstAuthInfos = NaiBa.Util.Helper.ConfigHelper.LoadConfig>>("pdd_shop_api_auth_info_lists"); - // if (LstAuthInfos == null) - // LstAuthInfos = new List>(); - // foreach (var shop in GlobalConfig.ShopLoginList) - // { - // shop.ApiAuthInfoList = LstAuthInfos.FirstOrDefault(l => l.FirstOrDefault()?.ShopId == shop.ShopId); - // if (shop.ApiAuthInfoList == null) - // shop.ApiAuthInfoList = new List(); - // } - // } - //} - public static void GetShopClientInfo(List shops = null) { if (BaseClass.MainPath == "binxixi") diff --git a/TEMUKJD/Helper/CustomJsDialogHandler.cs b/TEMUKJD/Helper/CustomJsDialogHandler.cs new file mode 100644 index 0000000..889496e --- /dev/null +++ b/TEMUKJD/Helper/CustomJsDialogHandler.cs @@ -0,0 +1,35 @@ +using CefSharp; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TemuKJD.Helper +{ + /// + /// 屏蔽alert弹窗 + /// + public class CustomJsDialogHandler : IJsDialogHandler + { + public bool OnBeforeUnloadDialog(IWebBrowser chromiumWebBrowser, IBrowser browser, string messageText, bool isReload, IJsDialogCallback callback) + { + return true; + } + + public void OnDialogClosed(IWebBrowser chromiumWebBrowser, IBrowser browser) + { + } + + public bool OnJSDialog(IWebBrowser chromiumWebBrowser, IBrowser browser, string originUrl, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage) + { + //suppressMessage = true; + callback.Continue(true); + return true; + } + + public void OnResetDialogState(IWebBrowser chromiumWebBrowser, IBrowser browser) + { + } + } +} diff --git a/TEMUKJD/KJD.csproj b/TEMUKJD/KJD.csproj index 7b6d41e..cb6f7aa 100644 --- a/TEMUKJD/KJD.csproj +++ b/TEMUKJD/KJD.csproj @@ -146,6 +146,7 @@ + Form diff --git a/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs b/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs index 77289b0..135e64d 100644 --- a/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs +++ b/TEMUKJD/KJDForms/ShopForms/ShopListForm.cs @@ -50,7 +50,7 @@ namespace TemuKJD.KJDForms.ShopForms { // 获取服务端店铺 var serverShopList = ShopListForm.GetServerShop(); - GlobalConfig.ShopLoginList.RemoveAll(s => serverShopList.Any(s1 => s1.LoginName == s.LoginName && s1.ShopId == s.ShopId)); + GlobalConfig.ShopLoginList.RemoveAll(s => serverShopList.Any(ss => ss.LoginName == s.LoginName && ss.ShopId == s.ShopId)); foreach (var serverShop in serverShopList) { diff --git a/TEMUKJD/PDDForms/ProductForms/ActivityForms/PDDAddActivityForm.Designer.cs b/TEMUKJD/PDDForms/ProductForms/ActivityForms/PDDAddActivityForm.Designer.cs index 2fbfc53..60bb4c0 100644 --- a/TEMUKJD/PDDForms/ProductForms/ActivityForms/PDDAddActivityForm.Designer.cs +++ b/TEMUKJD/PDDForms/ProductForms/ActivityForms/PDDAddActivityForm.Designer.cs @@ -136,6 +136,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms this.btnClear = new DevComponents.DotNetBar.PanelEx(); this.panelEx1 = new DevComponents.DotNetBar.PanelEx(); this.panel1 = new System.Windows.Forms.Panel(); + this.chkLowPrice = new TemuKJD.UserComponent.UcCheckBox(this.components); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -191,6 +192,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms | System.Windows.Forms.AnchorStyles.Right))); this.ucGroupBoxEx2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.ucGroupBoxEx2.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND; + this.ucGroupBoxEx2.Controls.Add(this.chkLowPrice); this.ucGroupBoxEx2.Controls.Add(this.label6); this.ucGroupBoxEx2.Controls.Add(this.txtMultiCnt); this.ucGroupBoxEx2.Controls.Add(this.label5); @@ -1516,6 +1518,18 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms this.panel1.TabIndex = 189; this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint); // + // chkLowPrice + // + this.chkLowPrice.AutoSize = true; + this.chkLowPrice.Checked = true; + this.chkLowPrice.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkLowPrice.Location = new System.Drawing.Point(662, 90); + this.chkLowPrice.Name = "chkLowPrice"; + this.chkLowPrice.Size = new System.Drawing.Size(71, 21); + this.chkLowPrice.TabIndex = 914; + this.chkLowPrice.Text = "低价sku"; + this.chkLowPrice.UseVisualStyleBackColor = true; + // // PDDAddActivityForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -1663,5 +1677,6 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms private System.Windows.Forms.TextBox txtSleepTime; private System.Windows.Forms.Label label6; private System.Windows.Forms.TextBox txtMultiCnt; + private UserComponent.UcCheckBox chkLowPrice; } } \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ProductForms/ActivityForms/PDDAddActivityForm.cs b/TEMUKJD/PDDForms/ProductForms/ActivityForms/PDDAddActivityForm.cs index 877755b..894fedb 100644 --- a/TEMUKJD/PDDForms/ProductForms/ActivityForms/PDDAddActivityForm.cs +++ b/TEMUKJD/PDDForms/ProductForms/ActivityForms/PDDAddActivityForm.cs @@ -504,7 +504,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms } PDDActivitySubmitParam actSubmitParam = new PDDActivitySubmitParam(); - actSubmitParam.activity_id = pddActivitiPriceInfo.activity_id; + actSubmitParam.activity_id = 21365; actSubmitParam.enroll_source_ctx.enroll_type = 3; actSubmitParam.enroll_source_ctx.scene_full_coverage = "mmsActBatchEnrollV1"; actSubmitParam.enroll_source_ctx.source_type = "MMSActicon"; @@ -3051,6 +3051,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms //var skuParam = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(skuGetRstInfo)); var skuParam = new sku_param(); skuParam.sku_id = skuGetRstInfo.skuId; + skuParam.out_sku_sn = skuGetRstInfo.outSkuSn; skuParam.thumb_url = skuGetRstInfo.skuThumbUrl; skuParam.quantity_delta = skuGetRstInfo.skuQuantity; skuParam.spec = new List(); @@ -3175,6 +3176,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms } } } + prodParamLst.RemoveAll(p => goodsIds.Contains(p.goods_id)); goodsIds = new List(); // 编辑部分sku价格不可报价商品 @@ -3205,6 +3207,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms }); } } + var mdyQuantityRst = increase_prod_stock_quantity(shop, prodQuantity); for (int i = 0; i < 5 && !mdyQuantityRst.Contains("\"success\":true"); i++) { @@ -3242,6 +3245,62 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms rowOperateLst = rowOperateLst.Where(r => prodParamLst.Any(p => p.goods_id == r.Cells["colSpuId"].Value.ParseToLong())).ToList(); } + if (chkLowPrice.Checked) + { + var goodsIds = new List(); + foreach (var prodParam in prodParamLst) + { + var rws = rowOperateLst.Where(r => prodParam.goods_id == r.Cells["colSpuId"].Value.ParseToLong()).ToList(); + Invoke(new Action(() => + { + foreach (var rw in rws) rw.Cells["colOpResult"].Value += " 正在设置低价Sku"; + })); + + var lowPrice = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().Min(s => s.multi_price); + var skuTmp = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().FirstOrDefault(s => s.multi_price == lowPrice); + var skuTmpLst = prodParam.skus.Where(s => s.spec[0].spec_id == skuTmp.spec[0].spec_id && s.multi_price == lowPrice).ToList(); + + PddEditProdStockQuantity prodQuantity = new PddEditProdStockQuantity(); + prodQuantity.data = new List(); + foreach (var sku in skuTmpLst) + { + prodQuantity.data.Add(new quantityData() + { + beforeQuantity = sku.quantity_delta, + goodsId = prodParam.goods_id, + quantity = -sku.quantity_delta + 1, + skuId = sku.sku_id, + }); + + var prodInfo = lstActListProdInfo.FirstOrDefault(a => a.goods_id == prodParam.goods_id).productInfo; + var skuInfo = prodInfo.detail.sku.FirstOrDefault(s => s.out_sku_sn == sku.out_sku_sn); + if (skuInfo != null) + sku.multi_price = skuInfo.multi_price; + } + + var mdyQuantityRst = increase_prod_stock_quantity(shop, prodQuantity); + for (int i = 0; i < 5 && !mdyQuantityRst.Contains("\"success\":true"); i++) + { + Thread.Sleep(Randomx.GetId(500, 1500)); + mdyQuantityRst = increase_prod_stock_quantity(shop, prodQuantity); + } + if (!mdyQuantityRst.Contains("\"success\":true")) + { + goodsIds.Add(prodParam.goods_id); + var error = BaseRegex.GetStringJson(ref mdyQuantityRst, "error_msg"); + if (string.IsNullOrEmpty(error)) + error = mdyQuantityRst; + + Invoke(new Action(() => + { + foreach (var rw in rws) + rw.Cells["colOpResult"].Value = rw.Cells["colOpResult"].Value.ParseToString().Replace("正在优化商品以报名活动", "商品优化失败 " + error); + })); + continue; + } + } + } + string activityRsts = SignActivity(shop, prodParamLst, sign22347, sign20981, sign21365, sign15996, sign23513, sign23730, sign23456); failList = JsonHelper.DeserializeJsonToList(activityRsts); foreach (var prodParam in prodParamLst) diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs index ccfd99b..d59a893 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdListForm.Designer.cs @@ -772,7 +772,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms "", "是", "否"}); - this.cmbPddRelation.Location = new System.Drawing.Point(743, 5); + this.cmbPddRelation.Location = new System.Drawing.Point(743, 7); this.cmbPddRelation.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbPddRelation.Name = "cmbPddRelation"; this.cmbPddRelation.Size = new System.Drawing.Size(47, 25); @@ -827,7 +827,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms // this.cmbCat2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.cmbCat2.FormattingEnabled = true; - this.cmbCat2.Location = new System.Drawing.Point(278, 77); + this.cmbCat2.Location = new System.Drawing.Point(278, 75); this.cmbCat2.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbCat2.Name = "cmbCat2"; this.cmbCat2.Size = new System.Drawing.Size(46, 25); @@ -912,7 +912,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms "机会商品", "以图搜品", "外部数据"}); - this.cmbSourceType.Location = new System.Drawing.Point(278, 42); + this.cmbSourceType.Location = new System.Drawing.Point(278, 40); this.cmbSourceType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbSourceType.Name = "cmbSourceType"; this.cmbSourceType.Size = new System.Drawing.Size(46, 25); @@ -958,7 +958,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms "", "是", "否"}); - this.cmbWxCat.Location = new System.Drawing.Point(622, 7); + this.cmbWxCat.Location = new System.Drawing.Point(622, 5); this.cmbWxCat.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbWxCat.Name = "cmbWxCat"; this.cmbWxCat.Size = new System.Drawing.Size(47, 25); @@ -980,7 +980,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.cmbSort.Items.AddRange(new object[] { "入库时间", "认领总数"}); - this.cmbSort.Location = new System.Drawing.Point(381, 42); + this.cmbSort.Location = new System.Drawing.Point(381, 40); this.cmbSort.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbSort.Name = "cmbSort"; this.cmbSort.Size = new System.Drawing.Size(46, 25); @@ -1056,7 +1056,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms // this.cmbGroupFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.cmbGroupFilter.FormattingEnabled = true; - this.cmbGroupFilter.Location = new System.Drawing.Point(175, 42); + this.cmbGroupFilter.Location = new System.Drawing.Point(175, 40); this.cmbGroupFilter.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbGroupFilter.Name = "cmbGroupFilter"; this.cmbGroupFilter.Size = new System.Drawing.Size(46, 25); @@ -1071,7 +1071,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms "是", "否", "导出未拉回"}); - this.cmbExportToOutServer.Location = new System.Drawing.Point(622, 42); + this.cmbExportToOutServer.Location = new System.Drawing.Point(622, 40); this.cmbExportToOutServer.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbExportToOutServer.Name = "cmbExportToOutServer"; this.cmbExportToOutServer.Size = new System.Drawing.Size(47, 25); @@ -1107,7 +1107,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms "安全商品", "违规商品", "未校验"}); - this.cmbWxSafe.Location = new System.Drawing.Point(501, 42); + this.cmbWxSafe.Location = new System.Drawing.Point(501, 40); this.cmbWxSafe.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbWxSafe.Name = "cmbWxSafe"; this.cmbWxSafe.Size = new System.Drawing.Size(47, 25); @@ -1149,7 +1149,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms // this.cmbCat1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.cmbCat1.FormattingEnabled = true; - this.cmbCat1.Location = new System.Drawing.Point(175, 77); + this.cmbCat1.Location = new System.Drawing.Point(175, 75); this.cmbCat1.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbCat1.Name = "cmbCat1"; this.cmbCat1.Size = new System.Drawing.Size(46, 25); @@ -1171,7 +1171,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms // this.cmbCat3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.cmbCat3.FormattingEnabled = true; - this.cmbCat3.Location = new System.Drawing.Point(381, 77); + this.cmbCat3.Location = new System.Drawing.Point(381, 75); this.cmbCat3.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbCat3.Name = "cmbCat3"; this.cmbCat3.Size = new System.Drawing.Size(46, 25); @@ -1268,7 +1268,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms "是", "否", "修复回传未拉回"}); - this.cmbHasReturn.Location = new System.Drawing.Point(743, 42); + this.cmbHasReturn.Location = new System.Drawing.Point(743, 40); this.cmbHasReturn.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbHasReturn.Name = "cmbHasReturn"; this.cmbHasReturn.Size = new System.Drawing.Size(47, 25); diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs index 192deb8..ae30847 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs @@ -332,6 +332,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.btnSeachPicUp.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnSeachPicUp.TabIndex = 845; this.btnSeachPicUp.Text = "以图搜款"; + this.btnSeachPicUp.Visible = false; this.btnSeachPicUp.Click += new System.EventHandler(this.btnSeachPicUp_Click); // // txtMultiPcsSku4 diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs index 7e1bcae..6be7d43 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs @@ -2073,6 +2073,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms { new_sku_lst.Add(JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(baseSkuParamLst.LastOrDefault()))); } + var maxMultiPcsSkuBasePrice = baseSkuParamLst.Max(s => s.multi_price); foreach (var sku in new_sku_lst) { if (sku.spec.Count > 0 && sku.spec[0].parent_id == newSpec.parent_id) @@ -2085,7 +2086,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms } sku.thumb_url = multiPcsSku.thumb_url; sku.thumb_url_file_id = null; - sku.multi_price = (baseSkuParamLst.Max(s => s.multi_price) * txtMultiPcsSku4.Text.ParseToDecimal()).ParseToInt(); + sku.multi_price = (maxMultiPcsSkuBasePrice * txtMultiPcsSku4.Text.ParseToDecimal()).ParseToInt(); sku.price = sku.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt(); sku.quantity_delta = 0; baseSkuParamLst.Add(sku); @@ -6842,24 +6843,31 @@ Content-Type: image/jpeg pddApi.Data["size_spec_id"] = prodRstObj["size_spec_id"]; string skuStr = ""; - for (int i = 0; i < prodRstObj["sku_list"].Count(); i++) + if (1 == 1) { - var skuObj = JObject.Parse(JsonHelper.SerializeObject(prodRstObj["sku_list"][i])); - skuObj["sku_properties"] = skuObj["sku_property_list"]; - skuObj["quantity"] = 0; - string spec = ""; - foreach (var specObj in skuObj["spec"]) + for (int i = 0; i < prodRstObj["sku_list"].Count(); i++) { - spec += "," + specObj["spec_id"].ParseToString(); + var skuObj = JObject.Parse(JsonHelper.SerializeObject(prodRstObj["sku_list"][i])); + skuObj["sku_properties"] = skuObj["sku_property_list"]; + skuObj["quantity"] = 0; + string spec = ""; + foreach (var specObj in skuObj["spec"]) + { + spec += "," + specObj["spec_id"].ParseToString(); + } + spec = spec.Trim(','); + skuObj["spec_id_list"] = "[" + spec + "]"; + skuObj.Remove("sku_property_list"); + //skuObj.Remove("sku_properties"); + skuObj.Remove("spec"); + skuStr += JsonHelper.SerializeObject(skuObj) + ","; } - spec = spec.Trim(','); - skuObj["spec_id_list"] = "[" + spec + "]"; - skuObj.Remove("sku_property_list"); - //skuObj.Remove("sku_properties"); - skuObj.Remove("spec"); - skuStr += JsonHelper.SerializeObject(skuObj) + ","; + skuStr = skuStr.Trim(','); + } + else + { + } - skuStr = skuStr.Trim(','); pddApi.Data["sku_list"] = "[" + skuStr + "]"; pddApi.Data["sku_type"] = prodRstObj["sku_type"]; @@ -7415,10 +7423,20 @@ Content-Type: image/jpeg if (!string.IsNullOrEmpty(prodInfo.detail.goods_desc)) pddApi.Data["goods_desc"] = prodInfo.detail.goods_desc; pddApi.Data["goods_name"] = prodInfo.detail.goods_name; + // 标题打乱 if (chkDisturbGoodsName.Checked) { pddApi.Data["goods_name"] = new string(("精品家用好物很好的产品" + prodInfo.detail.goods_name).ToArray().OrderBy(x => Randomx.GetId(999999)).Take(30).ToArray()); } + if (chkEndWords.Checked) + { + var goods_name = prodInfo.detail.goods_name + txtEndWords.Text.Trim(); + while (goods_name.Length > 30) + { + goods_name = goods_name.Substring(1); + } + pddApi.Data["goods_name"] = goods_name; + } Invoke(new Action(() => { @@ -7805,9 +7823,9 @@ Content-Type: image/jpeg //skuInfo.multi_price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt(); //skuInfo.price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt(); - if (marketPrice < skuInfo.price + 1000) + if (marketPrice < skuInfo.price * 2) { - marketPrice = skuInfo.price.ParseToInt() + 1000; + marketPrice = skuInfo.price.ParseToInt() * 2; //pddApi.Data["market_price"] = marketPrice; } @@ -7816,17 +7834,15 @@ Content-Type: image/jpeg } #endregion - // 报活动加价 + #region 报活动加价 if (chkActivity.Checked) { marketPrice = marketPriceFake; addPriceSkuInfoLst = addPriceFakeSkuInfoLst; } + #endregion - // 市场价 - pddApi.Data["market_price"] = marketPrice; - - // 生成属性规格id + #region 生成属性规格id if (dbProd.product_get_type_text == "厂商直采") { PddApi PddGoodsSpecGetApi = new PddApi(shop); @@ -7900,7 +7916,100 @@ Content-Type: image/jpeg } } } + #endregion + + spec_item multiPcsSkuSpec = null; // multiPcsSkuSpec + if (chkMultiPcsSku.Checked) + { + #region // 添加一个多件sku + //申请skuSpec + var multiPcsSku = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(addPriceSkuInfoLst.OrderByDescending(s => s.multi_price).FirstOrDefault())); + int min = txtMultiPcsSku1.Text.Trim().ParseToInt(); + int max = txtMultiPcsSku2.Text.Trim().ParseToInt() + 1; + if (max <= min) + max = min + 1; + var oldSpec = multiPcsSku.spec[0]; + if (skuFakeSpecNameDic1.Values.Contains(oldSpec.spec_name)) + oldSpec.spec_name = skuFakeSpecNameDic1.FirstOrDefault(s => s.Value == oldSpec.spec_name).Key; + multiPcsSku.spec[0].spec_name = oldSpec.spec_name + Randomx.GetId(min, max) + txtMultiPcsSku3.Text.Trim(); + multiPcsSkuSpec = multiPcsSku.spec[0]; + + if (1 == 1) + { + PddApi PddGoodsSpecIdGetApi = new PddApi(shop); + PddGoodsSpecIdGetApi.Data["parent_spec_id"] = multiPcsSkuSpec.parent_id; + PddGoodsSpecIdGetApi.Data["spec_name"] = multiPcsSkuSpec.spec_name; + var PddGoodsSpecIdGetApiRst = PddGoodsSpecIdGetApi.PddGoodsSpecIdGet(); + if (!PddGoodsSpecIdGetApiRst.Contains("\"goods_spec_id_get_response\"")) + { + var errMsg = BaseRegex.GetStringJson(ref PddGoodsSpecIdGetApiRst, "error_msg"); + if (string.IsNullOrEmpty(errMsg)) + errMsg = PddGoodsSpecIdGetApiRst; + return "设置多件Sku失败 " + errMsg; + } + multiPcsSkuSpec.spec_id = BaseRegex.GetLongJson(ref PddGoodsSpecIdGetApiRst, "spec_id"); + + List first_spec_lst = new List(); + List second_spec_lst = new List(); + List new_sku_lst = new List(); + foreach (var sku in addPriceSkuInfoLst) + { + if (sku.spec.Count > 0) + { + if (sku.spec[0].parent_id != multiPcsSkuSpec.parent_id && !first_spec_lst.Any(s => s.spec_id == sku.spec[0].spec_id)) + { + first_spec_lst.Add(sku.spec[0]); + new_sku_lst.Add(JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(sku))); + } + } + if (sku.spec.Count > 1) + { + if (sku.spec[1].parent_id != multiPcsSkuSpec.parent_id && !second_spec_lst.Any(s => s.spec_id == sku.spec[1].spec_id)) + { + second_spec_lst.Add(sku.spec[1]); + new_sku_lst.Add(JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(sku))); + } + } + } + if (new_sku_lst.Count == 0) + { + new_sku_lst.Add(JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(addPriceSkuInfoLst.LastOrDefault()))); + } + var maxMultiPcsSkuBasePrice = addPriceSkuInfoLst.Max(s => s.multi_price); + foreach (var sku in new_sku_lst) + { + if (sku.spec.Count > 0 && sku.spec[0].parent_id == multiPcsSkuSpec.parent_id) + { + sku.spec[0] = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(multiPcsSkuSpec)); + } + else if (sku.spec.Count > 1 && sku.spec[1].parent_id == multiPcsSkuSpec.parent_id) + { + sku.spec[1] = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(multiPcsSkuSpec)); + } + sku.thumb_url = multiPcsSku.thumb_url; + sku.thumb_url_file_id = null; + sku.multi_price = (maxMultiPcsSkuBasePrice * txtMultiPcsSku4.Text.ParseToDecimal()).ParseToInt(); + sku.price = sku.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt(); + sku.quantity_delta = 0; + sku.quantity = 0; + addPriceSkuInfoLst.Add(sku); + + if (marketPrice < sku.price * 2) + { + marketPrice = sku.price.ParseToInt() * 2; + //pddApi.Data["market_price"] = marketPrice; + } + } + } + #endregion + } + + #region 市场价 + pddApi.Data["market_price"] = marketPrice; + #endregion + + #region 拼接sku,计算最高价格和最低价格 var skuApiString = ""; long? minPrice = 99999999; long? maxPrice = 0; @@ -7914,12 +8023,7 @@ Content-Type: image/jpeg cell.Value = "正在拼接Sku " + (i + 1) + "/" + addPriceSkuInfoLst.Count; })); - string spec = ""; - for (int j = 0; j < addPriceSkuInfoLst[i].spec.Count; j++) - { - spec += "," + addPriceSkuInfoLst[i].spec[j].spec_id; - } - spec = spec.Trim(','); + string spec = string.Join(",", addPriceSkuInfoLst[i].spec.Select(s => s.spec_id)); string thumb_url = ""; if (!chkActivity.Checked && skuImgDic.ContainsKey(addPriceSkuInfoLst[i].thumb_url)) // 高价加商品每个sku规格写在图片上,各不相同 @@ -7935,6 +8039,8 @@ Content-Type: image/jpeg { //skuFakeSpecNameDic1 var text1 = skuFakeSpecNameDic1.FirstOrDefault(s => s.Value == addPriceSkuInfoLst[i].spec[0].spec_name).Key; + if (string.IsNullOrEmpty(text1)) + text1 = addPriceSkuInfoLst[i].spec[0].spec_name; var text2 = skuFakeSpecNameDic2.FirstOrDefault(s => s.Value == addPriceSkuInfoLst[i].spec[1].spec_name).Key.Replace("无规格", "").Replace("默认规格", ""); //if (dbProd.cat_name.Contains("鞋")) // text1 = "阿迪代工" + text1; @@ -7967,18 +8073,21 @@ Content-Type: image/jpeg skuImgDic[addPriceSkuInfoLst[i].thumb_url] = thumb_url; } - int weight = addPriceSkuInfoLst[i].weight.IsNullOrZero() ? 1000 : addPriceSkuInfoLst[i].weight.ParseToInt(); + int weight = addPriceSkuInfoLst[i].weight.IsNullOrZero() ? 1000 : addPriceSkuInfoLst[i].weight.ParseToInt(); + + if (addPriceSkuInfoLst[i].multi_price > maxPrice) + maxPrice = addPriceSkuInfoLst[i].multi_price; + if (addPriceSkuInfoLst[i].multi_price < minPrice) + minPrice = addPriceSkuInfoLst[i].multi_price; skuApiString += ",{\"is_onsale\":" + addPriceSkuInfoLst[i].is_onsale + ",\"limit_quantity\":" + addPriceSkuInfoLst[i].limit_quantity + ",\"price\":\"" + addPriceSkuInfoLst[i].price + "\",\"weight\":" + weight + ",\"multi_price\":\"" + addPriceSkuInfoLst[i].multi_price + "\",\"thumb_url\":\"" + thumb_url + "\",\"out_sku_sn\":\"" + addPriceSkuInfoLst[i].out_sku_sn + "\",\"quantity\":" + addPriceSkuInfoLst[i].quantity + ",\"spec_id_list\":\"[" + spec + "]\"}"; - if (addPriceSkuInfoLst[i].multi_price > maxPrice) - maxPrice = addPriceSkuInfoLst[i].multi_price; - if (addPriceSkuInfoLst[i].multi_price < minPrice) - minPrice = addPriceSkuInfoLst[i].multi_price; + } pddApi.Data["sku_list"] = "[" + skuApiString.Trim(',') + "]"; + #endregion // 计算转换列表内是否有符合条件的转换商品 var addPriceSkuInfoMinPrice = addPriceSkuInfoLst.Min(s => s.price); @@ -9099,9 +9208,11 @@ Content-Type: image/jpeg Invoke(new Action(() => { if (row.Index >= 0) - { row.Cells["colOpResult"].Value = "店铺掉线"; - } + + var rw = dgvShop.Rows.Cast().FirstOrDefault(r => r.Cells["colShopId"].Value.ParseToString() == shop.ShopId); + if (rw != null) + row.Cells["colSelect"].Value = false; })); continue; } @@ -9110,8 +9221,22 @@ Content-Type: image/jpeg //GetToken(shop); // 上传商品 - result = CefUploadProduct(shop, kjdDbProd, prod, row.Cells["colOpResult"], startTime); - Thread.Sleep(10000); + InitShopCef(shop); + bool finish = false; + var t = Task.Run(() => + { + result = CefUploadProduct(shop, kjdDbProd, prod, row.Cells["colOpResult"], startTime); + finish = true; + }); + while(!finish) + { + Thread.Sleep(1000); + } + Invoke(new Action(() => + { + this.panel2.SendToBack(); + })); + Thread.Sleep(Randomx.GetId(60000, 90000)); Invoke(new Action(() => { @@ -9227,22 +9352,23 @@ Content-Type: image/jpeg })); } - //Dictionary dicShopCef = new Dictionary(); - string CefUploadProduct(ShopLoginInfo shop, KJDDBProduct dbProd, TemuDBProductSelect selectProd, DataGridViewCell cell, DateTime startTime) + void InitShopCef(ShopLoginInfo shop) { - Thread.Sleep(3000); - var cookieLst = JsonHelper.DeserializeJsonToList(shop.Cookies); - if (cookieLst == null) - cookieLst = new List(); - - var cefWebBrowser = shop.Chat; - // 初始化cef + var cefWebBrowser = shop.Chat; + if (cefWebBrowser != null) + { + Invoke(new Action(() => + { + panel2.Controls.Remove(cefWebBrowser); + cefWebBrowser.Dispose(); + })); + } + cefWebBrowser = null; if (cefWebBrowser == null) { Invoke(new Action(() => { - panel2.BringToFront(); cefWebBrowser = NaiBa.CefHelper.CEFBrowser.CreateChromiumWebBrowser("https://mms.pinduoduo.com/home", false); shop.Chat = cefWebBrowser; cefWebBrowser.Tag = shop; @@ -9250,9 +9376,9 @@ Content-Type: image/jpeg resourceRequestHandler.ResourceLoadCompleteEvent += RequestHandler_ResourceLoadComplete; resourceRequestHandler.BeforeResourceLoadEvent += RequestHandler_BeforeResourceLoad; cefWebBrowser.RequestHandler = new CustomRequestHandler(resourceRequestHandler); - var lifeSapnHandler = new LifeSpanHandlerLocal(PopWindowType.SelfWindow); - cefWebBrowser.LifeSpanHandler = lifeSapnHandler; + cefWebBrowser.LifeSpanHandler = new LifeSpanHandlerLocal(PopWindowType.SelfWindow); cefWebBrowser.KeyboardHandler = new KeyboardHandler(); + cefWebBrowser.JsDialogHandler = new CustomJsDialogHandler(); cefWebBrowser.FrameLoadEnd += CefWebBrowser_FrameLoadEnd; cefWebBrowser.AddressChanged += CefWebBrowser_AddressChanged; cefWebBrowser.LoadError += CefWebBrowser_LoadError; @@ -9260,29 +9386,113 @@ Content-Type: image/jpeg panel2.Controls.Add(cefWebBrowser); })); } - else - { - Invoke(new Action(() => - { - panel2.BringToFront(); - })); - } while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid) - Thread.Sleep(20); + Thread.Sleep(1); + + var cookieLst = JsonHelper.DeserializeJsonToList(shop.Cookies); + if (cookieLst == null) + cookieLst = new List(); + //NaiBa.CefHelper.CEFBrowser.SetCookieAsync(JsonHelper.SerializeObject(cookieLst), cefWebBrowser.GetCookieManager(null)); + foreach (var cook in cookieLst) + { + var t = NaiBa.CefHelper.CEFBrowser.SetCookieAsync(cook.Domain, cook.Name + "=" + cook.Value + ";", cefWebBrowser.GetCookieManager(null)); + //t.Wait(5000); + } + } + + //Dictionary dicShopCef = new Dictionary(); + string CefUploadProduct(ShopLoginInfo shop, KJDDBProduct dbProd, TemuDBProductSelect selectProd, DataGridViewCell cell, DateTime startTime) + { + shop.CurrentProdId = ""; + #region 将聚水潭产品数据格式进行转换成pdd格式统一上传,匹配加密的spuCode和skuCoke + if (dbProd.product_get_type_text == "厂商直采" && dbProd.sku_secret_json != null && dbProd.sku_secret_json.Contains("goodsId")) + { + try + { + string convertRst = ""; + var pProd = new PDDProdFormConverter().JstPddProdToPddConvert(out convertRst, dbProd); + if (!string.IsNullOrEmpty(convertRst)) + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"源商品查询错误 " + convertRst + "\"}"; + } + catch (Exception ex) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"源商品格式转换错误 " + ex.Message + "\"}"; + } + } + #endregion + + PDDProductInfo prodInfo = null; + try + { + prodInfo = JsonHelper.DeserializeJsonToObject(dbProd.product_json); + } + catch (Exception ex) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品格式转换错误 " + ex.Message + "\"}"; + } + + // 获取映射关系 + List relationLst = new List(); + { + var url = BaseClass.BuildPDDObjString("product/get_relation"); + var data = UserLogin.GetSignaturex(); + data += "&up_spu_id=" + selectProd.spu_id; + data += "&index=" + Math.Abs((selectProd.spu_id).GetHashCode()) % 128; + var result = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(result) || !result.Contains("\"code\":200")) + result = GetHtml.PostUtf8(url, data); + if (result.Contains("\"data\":[]")) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"转换数据获取失败\"}"; + } + try + { + var jStr = JsonHelper.SerializeObject(JsonHelper.JObjectParse(result)["data"]); + relationLst = JsonHelper.DeserializeJsonToList(jStr); + } + catch (Exception ex) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"转换数据获取失败" + ex.Message + "\"}"; + } + } + + + Thread.Sleep(3000); + var cefWebBrowser = shop.Chat; + if (cefWebBrowser == null) + InitShopCef(shop); - // 设置cookie Invoke(new Action(() => { - NaiBa.CefHelper.CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null)); - NaiBa.CefHelper.CEFBrowser.SetCookieAsync(JsonHelper.SerializeObject(cookieLst), cefWebBrowser.GetCookieManager(null)); + panel2.BringToFront(); + cefWebBrowser.BringToFront(); })); Thread.Sleep(Randomx.GetId(1000, 1500)); + // 设置cookie + NaiBa.CefHelper.CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null)); + var cookieLst = JsonHelper.DeserializeJsonToList(shop.Cookies); + if (cookieLst == null) + cookieLst = new List(); + //NaiBa.CefHelper.CEFBrowser.SetCookieAsync(JsonHelper.SerializeObject(cookieLst), cefWebBrowser.GetCookieManager(null)); + foreach (var cook in cookieLst) + { + var t = NaiBa.CefHelper.CEFBrowser.SetCookieAsync(cook.Domain, cook.Name + "=" + cook.Value + ";", cefWebBrowser.GetCookieManager(null)); + //t.Wait(5000); + } + // 加载机会商品页面 cefWebBrowser.Load("https://mms.pinduoduo.com/goods/goods_list/chance?sourcePage=goodsListTopButton"); - while (!cefWebBrowser.GetMainFrame().IsValid || cefWebBrowser.IsLoading) + while (cefWebBrowser.IsLoading || !cefWebBrowser.GetMainFrame().IsValid) Thread.Sleep(500); - Thread.Sleep(Randomx.GetId(5000, 7000)); + Thread.Sleep(Randomx.GetId(3000, 5000)); + + var host = cefWebBrowser.GetBrowser().GetHost(); + var client = cefWebBrowser.GetDevToolsClient(); + if (host == null || client == null) + { + return "设置图片失败 以图搜款网页打开失败"; + } // 点击图片搜索图标 var jsStr1 = @"(function() { var spans = document.getElementsByTagName('span'); @@ -9294,8 +9504,8 @@ Content-Type: image/jpeg } } })();"; - var response1 = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr1); - response1.Wait(1000); + var ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true); + ts1.Wait(5000); Thread.Sleep(Randomx.GetId(1500, 3000)); // ctrl + v 复制图片 @@ -9312,38 +9522,111 @@ Content-Type: image/jpeg } Invoke(new Action(() => { Clipboard.SetImage(bitMap); })); - var host = cefWebBrowser.GetBrowser().GetHost(); host.SendKeyEvent(new CefSharp.KeyEvent() { WindowsKeyCode = 86, Type = KeyEventType.RawKeyDown, Modifiers = CefEventFlags.ControlDown }); - Thread.Sleep(Randomx.GetId(5000, 7000)); + Thread.Sleep(Randomx.GetId(4000, 6000)); - while (txtAlpha.Text == "99") - { - Thread.Sleep(500); - } // 点击搜索按钮 - var jsStr2 = @"(function() { var spans = document.getElementsByTagName('span'); - for (i = 0; i < spans.length; i++) { - var span = spans[i]; - if (span.innerHTML.indexOf('查询') >= 0 && span.parentElement.parentElement.innerHTML.indexOf('上传图片搜同款') >= 0) { - //span.parentElement.parentElement.parentElement.click(); - span.click(); - break; + var jsStr2 = @"(function() { + var spanElements = document.getElementsByTagName('span'); + for (i = 0; i < spanElements.length; i++) { + var spanElement = spanElements[i]; + if (spanElement.innerHTML.indexOf('查询') >= 0 && spanElement.parentElement.parentElement.innerHTML.indexOf('上传图片搜同款') >= 0) { + var rect = spanElement.getBoundingClientRect(); + spanElement.click(); + return rect.left + ',' + rect.top; } } + return ''; })();"; - var response2 = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr2); - response2.Wait(1000); - Thread.Sleep(Randomx.GetId(7000, 10000)); - while(txtAlpha.Text == "99") + var ts2 = client.Runtime.EvaluateAsync(jsStr2, null, true, null, null, true, null, true); + ts2.Wait(5000); + if ((ts2.Result?.Result?.Value).ParseToString().IsNullOrEmpty()) { - Thread.Sleep(500); + return "设置图片失败 图片脚本搜索失败"; } - Invoke(new Action(() => + Thread.Sleep(Randomx.GetId(7000, 10000)); + + // 点击发布同款 + var jsStr3 = @"(function() { + var spanElements = document.getElementsByTagName('span'); + for (i = " + Randomx.GetId(0, 14) + @"; i < spanElements.length; i++) { + var spanElement = spanElements[i]; + if (spanElement.innerHTML.indexOf('发布同款') >= 0) { + var rect = spanElement.getBoundingClientRect(); + spanElement.click(); + return rect.left + ',' + rect.top; + } + } + return ''; + })();"; + + var ts3 = client.Runtime.EvaluateAsync(jsStr3, null, true, null, null, true, null, true); + ts3.Wait(5000); + if ((ts3.Result?.Result?.Value).ParseToString().IsNullOrEmpty()) { - panel2.SendToBack(); - })); - return ""; + return "设置图片失败 商品发布失败"; + } + Thread.Sleep(Randomx.GetId(7000, 10000)); + + + host.SendMouseClickEvent(50, 50, MouseButtonType.Left, false, 1, CefEventFlags.None); + Thread.Sleep(Randomx.GetId(100, 300)); + host.SendMouseClickEvent(50, 50, MouseButtonType.Left, true, 1, CefEventFlags.None); + Thread.Sleep(Randomx.GetId(1000, 2000)); + // 点击知道了 + var jsStr4 = @"(function() { + var spanElements = document.getElementsByTagName('span'); + for (i = 0; i < spanElements.length; i++) { + var spanElement = spanElements[i]; + if (spanElement.innerHTML.indexOf('知道了') >= 0) { + var rect = spanElement.getBoundingClientRect(); + spanElement.click(); + return rect.left + ',' + rect.top; + } + } + return '0,0'; + })();"; + + var ts4 = client.Runtime.EvaluateAsync(jsStr4, null, true, null, null, true, null, true); + Thread.Sleep(Randomx.GetId(7000, 10000)); + + for (int i = 0; i < 100; i++) + { + Thread.Sleep(1000); + if (!shop.CurrentProdId.IsNullOrEmpty()) + { + break; + } + } + + if (shop.CurrentProdId.IsNullOrEmpty()) + { + return "机会商品提交失败"; + } + + Thread.Sleep(Randomx.GetId(10000, 15000)); + // 搜索商品是否已上架 + var pddApi = new PddApi(shop); + pddApi.Data["goods_id"] = shop.CurrentProdId; + var rst = pddApi.PddGoodsDetailGet(); + if (rst.Contains("商品不存在")) + { + Thread.Sleep(15000); + pddApi = new PddApi(shop); + pddApi.Data["goods_id"] = shop.CurrentProdId; + rst = pddApi.PddGoodsDetailGet(); + } + if (rst.Contains("商品不存在")) + { + Thread.Sleep(15000); + return "商品提交失败"; + } + var prodRstObj = JsonHelper.JObjectParse(rst)["goods_detail_get_response"] as JObject; + + var editRst = ChangeAndUpdateChanceProd(shop, prodRstObj, dbProd, prodInfo, relationLst, cell); + + return editRst; } private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request) @@ -9357,8 +9640,22 @@ Content-Type: image/jpeg } return false; } + private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request) { + if (url.Contains("https://mms.pinduoduo.com/glide/v2/mms/edit/commit/submit")) + { + var postData1 = postData; + var responseData1 = responseData; + var shop = (sender as ChromiumWebBrowser).Tag as ShopLoginInfo; + Task.Run(() => + { + if (shop != null) + { + shop.CurrentProdId = BaseRegex.GetStringJson(ref postData1, "goods_id"); + } + }); + } } private void CefWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e) { @@ -9370,6 +9667,643 @@ Content-Type: image/jpeg { } + string ChangeAndUpdateChanceProd(ShopLoginInfo shop, JObject prodRstObj, KJDDBProduct dbProd, PDDProductInfo prodInfo, List relationLst, DataGridViewCell cell) + { + try + { + var pddApi = new PddApi(shop); + var goods_id = prodRstObj["goods_id"].ParseToString(); + pddApi.Data["auto_fill_spu_property"] = false; + pddApi.Data["bad_fruit_claim"] = prodRstObj["bad_fruit_claim"]; + pddApi.Data["buy_limit"] = prodRstObj["buy_limit"]; + pddApi.Data["carousel_gallery"] = JsonHelper.SerializeObject(prodRstObj["carousel_gallery_list"]); + pddApi.Data["cat_id"] = prodRstObj["cat_id"]; + pddApi.Data["cost_template_id"] = prodRstObj["cost_template_id"].ToString(); + pddApi.Data["country_id"] = prodRstObj["country_id"]; + pddApi.Data["customer_num"] = prodRstObj["customer_num"]; + pddApi.Data["customs"] = prodRstObj["customs"]; + pddApi.Data["delivery_one_day"] = prodRstObj["delivery_one_day"]; + pddApi.Data["delivery_type"] = prodRstObj["delivery_type"]; + pddApi.Data["detail_gallery"] = JsonHelper.SerializeObject(prodRstObj["detail_gallery_list"]); + pddApi.Data["elec_goods_attributes"] = prodRstObj["elec_goods_attributes"]; + pddApi.Data["goods_desc"] = prodRstObj["goods_desc"].ParseToString(); + pddApi.Data["goods_id"] = prodRstObj["goods_id"]; + pddApi.Data["goods_name"] = prodRstObj["goods_name"].ParseToString(); + + string goods_properties = ""; + for (int i = 0; i < prodRstObj["goods_property_list"].Count(); i++) + { + var propObj = JObject.Parse(JsonHelper.SerializeObject(prodRstObj["goods_property_list"][i])); + propObj["value"] = propObj["vvalue"]; + propObj["value_unit"] = propObj["punit"]; + propObj.Remove("vvalue"); + propObj.Remove("punit"); + goods_properties += JsonHelper.SerializeObject(propObj) + ","; + } + pddApi.Data["goods_properties"] = "[" + goods_properties.Trim(',') + "]"; + + pddApi.Data["goods_trade_attr"] = prodRstObj["goods_trade_attr"]; + pddApi.Data["goods_travel_attr"] = prodRstObj["goods_travel_attr"]; + pddApi.Data["goods_type"] = prodRstObj["goods_type"]; + //pddApi.Data["ignore_edit_warn"] = false; + pddApi.Data["image_url"] = prodRstObj["image_url"]; + pddApi.Data["invoice_status"] = prodRstObj["invoice_status"]; + pddApi.Data["is_customs"] = prodRstObj["is_customs"].ParseToInt() == 1; + pddApi.Data["is_folt"] = prodRstObj["is_folt"].ParseToInt() == 1; //是否支持假一赔十,false-不支持,true-支持 + pddApi.Data["is_group_pre_sale"] = prodRstObj["is_group_pre_sale"]; + pddApi.Data["is_pre_sale"] = prodRstObj["is_pre_sale"].ParseToInt() == 1; + pddApi.Data["is_refundable"] = prodRstObj["is_refundable"].ParseToInt() == 1; + pddApi.Data["is_sku_pre_sale"] = prodRstObj["is_sku_pre_sale"]; + pddApi.Data["lack_of_weight_claim"] = prodRstObj["lack_of_weight_claim"]; + pddApi.Data["local_service_id_list"] = prodRstObj["local_service_id_list"]; + //if (!prodRstObj["mai_jia_zi_ti"].IsJTokenNullOrEmpty()) + // pddApi.Data["mai_jia_zi_ti"] = prodRstObj["mai_jia_zi_ti"]; + pddApi.Data["market_price"] = prodRstObj["market_price"]; + //pddApi.Data["operate_type"] = 0; // 是否提交草稿,默认提交 0:提交,1:保存 + pddApi.Data["order_limit"] = prodRstObj["order_limit"]; + pddApi.Data["origin_country_id"] = prodRstObj["origin_country_id"]; + pddApi.Data["out_goods_id"] = prodRstObj["out_goods_id"]; + pddApi.Data["out_source_goods_id"] = prodRstObj["out_source_goods_id"]; + pddApi.Data["out_source_type"] = prodRstObj["out_source_type"]; + pddApi.Data["oversea_goods"] = prodRstObj["oversea_goods"]; + pddApi.Data["oversea_type"] = prodRstObj["oversea_type"]; + pddApi.Data["pre_sale_time"] = prodRstObj["pre_sale_time"]; + pddApi.Data["privacy_delivery"] = prodRstObj["privacy_delivery"]; + pddApi.Data["quan_guo_lian_bao"] = prodRstObj["quan_guo_lian_bao"]; + pddApi.Data["second_hand"] = prodRstObj["second_hand"].ParseToInt() == 1; + //if (!prodRstObj["shang_men_an_zhuang"].IsJTokenNullOrEmpty()) + // pddApi.Data["shang_men_an_zhuang"] = prodRstObj["shang_men_an_zhuang"]; + pddApi.Data["shipment_limit_second"] = prodRstObj["shipment_limit_second"]; + pddApi.Data["shop_group_id"] = prodRstObj["shop_group_id"]; + if (!prodRstObj["size_spec_id"].IsJTokenNullOrEmpty()) + pddApi.Data["size_spec_id"] = prodRstObj["size_spec_id"]; + + + pddApi.Data["sku_type"] = prodRstObj["sku_type"]; + //if (!prodRstObj["song_huo_an_zhuang"].IsJTokenNullOrEmpty()) + // pddApi.Data["song_huo_an_zhuang"] = prodRstObj["song_huo_an_zhuang"]; + //if (!prodRstObj["song_huo_ru_hu"].IsJTokenNullOrEmpty()) + // pddApi.Data["song_huo_ru_hu"] = prodRstObj["song_huo_ru_hu"]; + //pddApi.Data["sync_goods_operate"] = 1; // 提交后上架状态,0:上架,1:保持原样 + if (prodRstObj["tiny_name"].ParseToString().Length > 8) + pddApi.Data["tiny_name"] = prodRstObj["tiny_name"].ParseToString(); + pddApi.Data["two_pieces_discount"] = prodRstObj["two_pieces_discount"]; + pddApi.Data["warehouse"] = prodRstObj["warehouse"]; + pddApi.Data["warm_tips"] = prodRstObj["warm_tips"]; + pddApi.Data["zhi_huan_bu_xiu"] = prodRstObj["zhi_huan_bu_xiu"]; + // 医疗器械 不填 + //pddApi.Data["medical_device_certificate_gallery"] = ""; + //pddApi.Data["medical_device_confirm"] = ""; + + + #region 厂商直采获取推单运费模板,计算运费加价。 + //Invoke(new Action(() => + //{ + // if (cell != null) + // cell.Value = "正在选取运费模板"; + //})); + Invoke(new Action(() => + { + if (cell != null) + cell.Value = "正在计算加价"; + })); + + var shippingTemplateJson = ""; + var shipPrice = 0; + + if (dbProd.product_get_type_text == "厂商直采" && dbProd.wx_cat_leaf != null) + { + var urlShipping = BaseClass.BuildWXObjString("product/wx_get_shipping_template"); + var dataShipping = Work.UserLogin.GetSignaturex() + + "&coid=" + dbProd.skc_id; + var htmlShipping = GetHtml.PostUtf8(urlShipping, dataShipping); + if (string.IsNullOrEmpty(htmlShipping) || !htmlShipping.Contains("\"code\":200")) + htmlShipping = GetHtml.PostUtf8(urlShipping, dataShipping); + if (string.IsNullOrEmpty(htmlShipping) || !htmlShipping.Contains("\"code\":200")) + { + } + else + { + if (htmlShipping.Contains("\"data\":\"\"")) + { + } + else + { + try + { + shippingTemplateJson = JsonHelper.SerializeObject(JsonHelper.JObjectParse(htmlShipping)["data"]); + } + catch + { + + } + } + } + + if (string.IsNullOrEmpty(shippingTemplateJson)) + { + // 获取运费模板 + var urlShip = BaseClass.BuildWXObjString("product/e57_get_freight_template"); + var dataShip = Work.UserLogin.GetSignaturex() + "&coid=" + dbProd.skc_id; + var shipRst = GetHtml.PostUtf8(urlShip, dataShip); + if (string.IsNullOrEmpty(shipRst) || !shipRst.Contains("\"code\":0")) + shipRst = GetHtml.PostUtf8(urlShip, dataShip); + if (!shipRst.Contains("\"code\":0")) + { + var errMsg = BaseRegex.GetStringJson(ref shipRst, "msg"); + if (string.IsNullOrEmpty(errMsg)) + errMsg = shipRst; + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"运费模板获取失败 " + errMsg + "\"}"; + } + try + { + //[{"id":"204","warehouseNum":"15016108","freightType":0,"provinces":"香港特别行政区,台湾省,澳门特别行政区","freightPrice":9999900,"createBy":"vmslin","createTime":"2026-01-30T16:45:03+08:00","updateBy":"vmslin","updateTime":"2026-01-30T16:45:03+08:00"},{"id":"205","warehouseNum":"15016108","freightType":3,"provinces":"海南省,新疆维吾尔自治区,西藏自治区,内蒙古自治区","freightPrice":1530,"createBy":"vmslin","createTime":"2026-01-30T16:45:51+08:00","updateBy":"vmslin","updateTime":"2026-01-30T16:45:51+08:00"},{"id":"206","warehouseNum":"15016108","freightType":1,"provinces":"北京市,上海市","freightPrice":410,"createBy":"vmslin","createTime":"2026-01-30T16:46:04+08:00","updateBy":"vmslin","updateTime":"2026-01-30T16:46:04+08:00"},{"id":"207","warehouseNum":"15016108","freightType":1,"provinces":"安徽省,重庆市,福建省,广东省,甘肃省,广西壮族自治区,贵州省,河北省,湖北省,黑龙江省,河南省,湖南省,吉林省,江苏省,江西省,辽宁省,宁夏回族自治区,青海省,四川省,山东省,山西省,陕西省,天津市,云南省,浙江省","freightPrice":310,"createBy":"vmslin","createTime":"2026-01-30T16:46:17+08:00","updateBy":"vmslin","updateTime":"2026-01-30T16:46:17+08:00"}] + shippingTemplateJson = JsonHelper.SerializeObject(JsonHelper.JObjectParse(shipRst)["data"]); + if (shipRst.Contains("\"code\":0") && !string.IsNullOrEmpty(shippingTemplateJson)) + { + urlShipping = BaseClass.BuildWXObjString("product/wx_add_mdy_shipping_template"); + dataShipping = Work.UserLogin.GetSignaturex() + + "&coid=" + dbProd.skc_id + + "&shipping_template_json=" + shippingTemplateJson; + htmlShipping = GetHtml.PostUtf8(urlShipping, dataShipping); + if (string.IsNullOrEmpty(htmlShipping) || !htmlShipping.Contains("\"code\":200")) + htmlShipping = GetHtml.PostUtf8(urlShipping, dataShipping); + } + } + catch (Exception ex) + { + } + } + + if (!string.IsNullOrEmpty(shippingTemplateJson)) + { + try + { + int count = 0; + var shipObjs = JArray.Parse(shippingTemplateJson); + foreach (var shipObj in shipObjs) + { + var provincesStr = shipObj["provinces"].ParseToString(); + if (provincesStr.Split(',').Length > count) + { + count = provincesStr.Split(',').Length; + shipPrice = shipObj["freightPrice"].ParseToInt(); + } + } + } + catch (Exception ex) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"运费模板获取失败 " + ex.Message + "\"}"; + } + } + if (shipPrice <= 0) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"运费模板获取失败 未获取到\"}"; + } + } + #endregion + + #region 获取sku替换图 + string fakeImgUrl; + Image fakeImg = null; + if (chkActivity.Checked) + { + var url = BaseClass.BuildObjString("product/get_sku_replace_img_list_random"); + var data = ""; + data = UserLogin.GetSignaturex() + + "&page=" + 1 + + "&page_size=" + 1; + data += "&in_img_type=混淆图"; + var html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + { + } + else + { + try + { + JObject jObj = JObject.Parse(html); + fakeImgUrl = jObj["data"].FirstOrDefault().ParseToString(); + + string getImgError = ""; + if (!fakeImgUrl.Contains("wst.wxapp.tc.qq.com")) + fakeImgUrl = fakeImgUrl.Replace("https://", "http://"); + fakeImg = GetHtml.GetUrlImg(fakeImgUrl, out getImgError); + } + catch + { + + } + } + } + #endregion + + #region 生成一组高倍率加价后的sku + List addPriceFakeSkuInfoLst = new List(); + Dictionary skuFakeSpecNameDic1 = new Dictionary(); + Dictionary skuFakeSpecNameDic2 = new Dictionary(); + int marketPriceFake = prodInfo.detail.market_price.ParseToInt(); + { + var maxPrice1 = 0; + foreach (var sku in prodInfo.detail.sku) + { + var skuInfo = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(sku)); + skuInfo.is_onsale = skuInfo.is_onsale != null ? skuInfo.is_onsale : 1; + skuInfo.limit_quantity = 999; // 只入参999 + + // 厂商直采的上家缺货则保持缺货。 + if (skuInfo.quantity != 0) + skuInfo.quantity = txtStockNum.Text.Trim().ParseToInt(); + + var new_multi_price = sku.multi_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt(); + // 使用货号价格做基础价 + if (chkUseExtCodePrice.Checked && dbProd.ext_code_price > 0) + { + new_multi_price = dbProd.ext_code_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt(); + } + + skuInfo.multi_price = (new_multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(); + //skuInfo.price = (sku.price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(); + if (isAddMorePriceFirst) // 先加后乘 + skuInfo.multi_price = ((new_multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt(); + skuInfo.price = skuInfo.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt(); + + if (marketPriceFake < skuInfo.price + 1000) + { + marketPriceFake = skuInfo.price.ParseToInt() + 1000; + //pddApi.Data["market_price"] = marketPriceFake; + } + + //skuInfo.spec[0].spec_name = "黑色" + Randomx.GetId(1000); + //if (Randomx.GetId(3) == 1) + // skuInfo.spec[0].spec_name = "白色" + Randomx.GetId(1000); + //if (Randomx.GetId(3) == 2) + // skuInfo.spec[0].spec_name = "蓝色" + Randomx.GetId(1000); + + //if (skuInfo.spec.Count > 1) + // skuInfo.spec[1].spec_name = "" + (Math.Abs(skuInfo.spec[1].spec_name.GetHashCode()) % 251 + 50) + "个 人买过 " + + // (Math.Abs(BaseClass.GetMd5(skuInfo.spec[1].spec_name).GetHashCode()) % 9001 + 3000) + "件" + skuInfo.spec[1].spec_name; + //else + // skuInfo.spec[0].spec_name = "" + (Math.Abs(skuInfo.spec[0].spec_name.GetHashCode()) % 251 + 50) + "个 人买过 " + + // (Math.Abs(BaseClass.GetMd5(skuInfo.spec[0].spec_name).GetHashCode()) % 9001 + 3000) + "件" + skuInfo.spec[0].spec_name; + + if (skuInfo.spec.Count == 1) + { + if (skuInfo.spec[0].parent_name != "规格") + skuInfo.spec.Add(new spec_item() { parent_name = "规格", spec_name = "默认规格" }); + else + skuInfo.spec.Add(new spec_item() { parent_name = "款式", spec_name = "默认款式" }); + } + + if (skuInfo.spec.Count > 0) + { + if (skuFakeSpecNameDic1.Keys.Contains(skuInfo.spec[0].spec_name)) + skuInfo.spec[0].spec_name = skuFakeSpecNameDic1[skuInfo.spec[0].spec_name]; + else + { + skuFakeSpecNameDic1[skuInfo.spec[0].spec_name] = skuInfo.spec[0].parent_name + (skuFakeSpecNameDic1.Keys.Count + 1); + //skuFakeSpecNameDic1[skuInfo.spec[0].spec_name] = skuInfo.spec[0].parent_name + (skuFakeSpecNameDic1.Keys.Count + 1) + " 请您下单"; + //skuFakeSpecNameDic1[skuInfo.spec[0].spec_name] = /*skuInfo.spec[0].parent_name*/ "A00" + (skuFakeSpecNameDic1.Keys.Count + 1) + " 专柜品质 先生请下单"; + skuInfo.spec[0].spec_name = skuFakeSpecNameDic1[skuInfo.spec[0].spec_name]; + } + } + if (skuInfo.spec.Count > 1) + { + if (skuFakeSpecNameDic2.Keys.Contains(skuInfo.spec[1].spec_name)) + skuInfo.spec[1].spec_name = skuFakeSpecNameDic2[skuInfo.spec[1].spec_name]; + else + { + skuFakeSpecNameDic2[skuInfo.spec[1].spec_name] = "" + Randomx.GetId(50, 301) + "个 人买过 " + Randomx.GetId(3000, 12001) + "件 " + + skuInfo.spec[1].parent_name + (skuFakeSpecNameDic2.Keys.Count + 1); + //skuFakeSpecNameDic2[skuInfo.spec[1].spec_name] = "" + Randomx.GetId(300, 601) + "个 人买了 " + Randomx.GetId(3000, 12001) + "件 "; + skuInfo.spec[1].spec_name = skuFakeSpecNameDic2[skuInfo.spec[1].spec_name]; + } + } + + if (maxPrice1 < skuInfo.multi_price) + maxPrice1 = skuInfo.multi_price.ParseToInt(); + + addPriceFakeSkuInfoLst.Add(skuInfo); + + //break; + } + + //foreach (var sk in addPriceFakeSkuInfoLst) + //{ + // sk.multi_price = maxPrice1; + // sk.price = maxPrice1 + 100; + //} + } + #endregion + + #region 生成一组正常加价后的sku + List addPriceSkuInfoLst = new List(); + int marketPrice = prodInfo.detail.market_price.ParseToInt(); + { + foreach (var sku in prodInfo.detail.sku) + { + var skuInfo = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(sku)); + skuInfo.is_onsale = skuInfo.is_onsale != null ? skuInfo.is_onsale : 1; + skuInfo.limit_quantity = 999; // 只入参999 + + // 厂商直采的上家缺货则保持缺货。 + if (skuInfo.quantity != 0) + skuInfo.quantity = txtStockNum.Text.Trim().ParseToInt(); + + var new_multi_price = sku.multi_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt(); + // 使用货号价格做基础价 + if (chkUseExtCodePrice.Checked && dbProd.ext_code_price > 0) + { + new_multi_price = dbProd.ext_code_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt(); + } + + skuInfo.multi_price = (new_multi_price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(); + //skuInfo.price = (sku.price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(); + if (isAddMorePriceFirst) // 先加后乘 + skuInfo.multi_price = ((new_multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimes.Text.Trim().ParseToDecimal()).ParseToInt(); + skuInfo.price = skuInfo.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt(); + + // 阶梯式加价,如果命中则按阶梯式加价进行 + if (isStepAddPrice) + { + foreach (var addPrice in lstAddPriceRule) + { + if (new_multi_price > addPrice.MoreThanPrice * 100 && new_multi_price <= addPrice.LessThanPrice * 100) + { + if (isAddMorePriceFirst) // 先加后乘 + skuInfo.multi_price = ((new_multi_price + addPrice.AddMorePrice * 100) * addPrice.AddPriceTimes).ParseToInt(); + else + skuInfo.multi_price = (new_multi_price * addPrice.AddPriceTimes + addPrice.AddMorePrice * 100).ParseToInt(); + skuInfo.price = skuInfo.multi_price + Math.Max(100, addPrice.SinglePriceAdd * 100).ParseToInt(); ; + break; + } + } + } + // 聚水潭商品 加邮费×倍率 放前面 + //skuInfo.multi_price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt(); + //skuInfo.price += (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt(); + + if (marketPrice < skuInfo.price + 1000) + { + marketPrice = skuInfo.price.ParseToInt() + 1000; + //pddApi.Data["market_price"] = marketPrice; + } + + addPriceSkuInfoLst.Add(skuInfo); + } + } + #endregion + + #region 报活动加价 + if (chkActivity.Checked) + { + marketPrice = marketPriceFake; + addPriceSkuInfoLst = addPriceFakeSkuInfoLst; + } + #endregion + + #region 市场价 + pddApi.Data["market_price"] = marketPrice; + #endregion + + #region 生成属性规格id + if (dbProd.product_get_type_text == "厂商直采") + { + PddApi PddGoodsSpecGetApi = new PddApi(shop); + PddGoodsSpecGetApi.Data["cat_id"] = prodInfo.detail.cat_id; + var PddGoodsSpecGetApiRst = PddGoodsSpecGetApi.PddGoodsSpecGet(); + if (!PddGoodsSpecGetApiRst.Contains("\"goods_spec_get_response\"")) + { + var errMsg = BaseRegex.GetStringJson(ref PddGoodsSpecGetApiRst, "error_msg"); + if (string.IsNullOrEmpty(errMsg)) + errMsg = PddGoodsSpecGetApiRst; + return "初始化Sku属性失败 " + errMsg; + } + + Dictionary specNameDic = new Dictionary(); + foreach (var jObj in JsonHelper.JObjectParse(PddGoodsSpecGetApiRst)["goods_spec_get_response"]["goods_spec_list"]) + { + string specStr = JsonHelper.SerializeObject(jObj); + var parent_spec_id = BaseRegex.GetLongJson(ref specStr, "parent_spec_id"); + var parent_spec_name = BaseRegex.GetStringJson(ref specStr, "parent_spec_name"); + specNameDic[parent_spec_id] = parent_spec_name; + } + + Dictionary specNameIdMapDic = new Dictionary(); + + for (int i = 0; i < addPriceSkuInfoLst.Count; i++) + { + Invoke(new Action(() => + { + if (cell != null) + cell.Value = "正在生成Sku规格 " + (i + 1) + "/" + addPriceSkuInfoLst.Count; + })); + + for (int j = 0; j < addPriceSkuInfoLst[i].spec.Count; j++) + { + var specInfo = addPriceSkuInfoLst[i].spec[j]; + long parent_id = 0; + try + { + parent_id = specNameDic.FirstOrDefault(s => s.Value == specInfo.parent_name).Key; + } + catch + { + } + if (parent_id == 0) + { + parent_id = specNameDic.ToList()[j].Key; + specInfo.parent_name = specNameDic.ToList()[j].Value; + } + specInfo.parent_id = parent_id; + + if (specNameIdMapDic.Keys.Contains(specInfo.spec_name + specInfo.parent_name)) + { + specInfo.spec_id = specNameIdMapDic[specInfo.spec_name + specInfo.parent_name]; + } + else + { + PddApi PddGoodsSpecIdGetApi = new PddApi(shop); + PddGoodsSpecIdGetApi.Data["parent_spec_id"] = parent_id; + PddGoodsSpecIdGetApi.Data["spec_name"] = specInfo.spec_name; + var PddGoodsSpecIdGetApiRst = PddGoodsSpecIdGetApi.PddGoodsSpecIdGet(); + if (!PddGoodsSpecIdGetApiRst.Contains("\"goods_spec_id_get_response\"")) + { + var errMsg = BaseRegex.GetStringJson(ref PddGoodsSpecIdGetApiRst, "error_msg"); + if (string.IsNullOrEmpty(errMsg)) + errMsg = PddGoodsSpecIdGetApiRst; + return "Sku属性生成失败 " + errMsg; + } + specInfo.spec_id = BaseRegex.GetLongJson(ref PddGoodsSpecIdGetApiRst, "spec_id"); + specNameIdMapDic[specInfo.spec_name + specInfo.parent_name] = specInfo.spec_id; + } + } + } + } + #endregion + + #region 拼接sku,计算最高价格和最低价格 + var skuApiString = ""; + long? minPrice = 99999999; + long? maxPrice = 0; + Dictionary skuImgDic = new Dictionary(); + // 拼接sku,计算最高价格和最低价格 + for (int i = 0; i < addPriceSkuInfoLst.Count; i++) + { + Invoke(new Action(() => + { + if (cell != null) + cell.Value = "正在拼接Sku " + (i + 1) + "/" + addPriceSkuInfoLst.Count; + })); + + string spec = string.Join(",", addPriceSkuInfoLst[i].spec.Select(s => s.spec_id)); + + string thumb_url = ""; + if (!chkActivity.Checked && skuImgDic.ContainsKey(addPriceSkuInfoLst[i].thumb_url)) // 高价加商品每个sku规格写在图片上,各不相同 + { + thumb_url = skuImgDic[addPriceSkuInfoLst[i].thumb_url]; + } + else + { + string errMsg = ""; + var imgBase64 = ""; + float alpha = Math.Min(100, Math.Max(1, txtAlpha.Text.ParseToInt())) / 100f; + if (chkActivity.Checked) + { + //skuFakeSpecNameDic1 + var text1 = skuFakeSpecNameDic1.FirstOrDefault(s => s.Value == addPriceSkuInfoLst[i].spec[0].spec_name).Key; + var text2 = skuFakeSpecNameDic2.FirstOrDefault(s => s.Value == addPriceSkuInfoLst[i].spec[1].spec_name).Key.Replace("无规格", "").Replace("默认规格", ""); + //if (dbProd.cat_name.Contains("鞋")) + // text1 = "阿迪代工" + text1; + //if (text1.Length + text2.Length <= 6) + // text1 = "专柜产品" + text1; + //if (text1.Length + text2.Length <= 6) + // text2 = "专柜品质 " + text2; // 专柜正品 + //imgBase64 = PddGetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, fakeImg, pbUpgradeVersion.Image, alpha, "到手 " + text1 + " " + text2); + imgBase64 = PddGetActivitySkuImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, fakeImg, pbUpgradeVersion.Image, alpha, text1 + " " + text2, pddUploadRule); + //imgBase64 = PddGetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, fakeImg, pbUpgradeVersion.Image, alpha); + } + else + imgBase64 = PddGetActivitySkuImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url); + if (!string.IsNullOrEmpty(errMsg)) + { + return "初始化Sku图片错误 " + errMsg; + } + + var pddUpImgApi = new PddApi(shop); + pddUpImgApi.Data["image"] = "data:image/jpeg;base64," + imgBase64; + var pddUpImgApiRst = pddUpImgApi.PddGoodsImageUpload(); + if (!pddUpImgApiRst.Contains("\"goods_image_upload_response\"")) + { + errMsg = BaseRegex.GetStringJson(ref pddUpImgApiRst, "error_msg"); + if (string.IsNullOrEmpty(errMsg)) + errMsg = pddUpImgApiRst; + return "生成Sku图片错误 " + errMsg; + } + thumb_url = BaseRegex.GetStringJson(ref pddUpImgApiRst, "image_url"); + skuImgDic[addPriceSkuInfoLst[i].thumb_url] = thumb_url; + } + + int weight = addPriceSkuInfoLst[i].weight.IsNullOrZero() ? 1000 : addPriceSkuInfoLst[i].weight.ParseToInt(); + + if (addPriceSkuInfoLst[i].multi_price > maxPrice) + maxPrice = addPriceSkuInfoLst[i].multi_price; + if (addPriceSkuInfoLst[i].multi_price < minPrice) + minPrice = addPriceSkuInfoLst[i].multi_price; + + skuApiString += ",{\"is_onsale\":" + addPriceSkuInfoLst[i].is_onsale + ",\"limit_quantity\":" + addPriceSkuInfoLst[i].limit_quantity + + ",\"price\":\"" + addPriceSkuInfoLst[i].price + "\",\"weight\":" + weight + ",\"multi_price\":\"" + addPriceSkuInfoLst[i].multi_price + + "\",\"thumb_url\":\"" + thumb_url + "\",\"out_sku_sn\":\"" + addPriceSkuInfoLst[i].out_sku_sn + + "\",\"quantity\":" + addPriceSkuInfoLst[i].quantity + ",\"spec_id_list\":\"[" + spec + "]\"}"; + + } + pddApi.Data["sku_list"] = "[" + skuApiString.Trim(',') + "]"; + if (marketPrice > maxPrice * 5) + marketPrice = (maxPrice * 5).ParseToInt() - 1; + pddApi.Data["market_price"] = marketPrice; + #endregion + + // 计算转换列表内是否有符合条件的转换商品 + var addPriceSkuInfoMinPrice = addPriceSkuInfoLst.Min(s => s.price); + var addPriceSkuInfoMaxPrice = addPriceSkuInfoLst.Max(s => s.price); + var relationData = relationLst? + .OrderBy(r => r.price_min.ParseToInt()) + .FirstOrDefault(r => r.price_min.ParseToInt() * 1.08m > addPriceSkuInfoMinPrice && r.price_max.ParseToInt() * 1.08m > addPriceSkuInfoMaxPrice); + if (relationData == null) + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"转换数据获取价格失败\"}"; + + string skuStr = ""; + if (1 == 1) + { + for (int i = 0; i < prodRstObj["sku_list"].Count(); i++) + { + var skuObj = JObject.Parse(JsonHelper.SerializeObject(prodRstObj["sku_list"][i])); + skuObj["sku_properties"] = skuObj["sku_property_list"]; + skuObj["quantity"] = 0; + string spec = ""; + foreach (var specObj in skuObj["spec"]) + { + spec += "," + specObj["spec_id"].ParseToString(); + } + spec = spec.Trim(','); + skuObj["spec_id_list"] = "[" + spec + "]"; + skuObj.Remove("sku_property_list"); + //skuObj.Remove("sku_properties"); + skuObj.Remove("spec"); + skuStr += JsonHelper.SerializeObject(skuObj) + ","; + } + skuStr = skuStr.Trim(','); + } + else + { + + } + pddApi.Data["sku_list"] = "[" + skuStr + "]"; + + + + foreach (var key in pddApi.Data.Select(d => d.Key).ToList()) + { + if (pddApi.Data[key].IsNullOrEmpty()) + { + pddApi.Data.Remove(key); + } + }; + + var rst = pddApi.PddGoodsInformationUpdate(); + + if (!rst.Contains("\"is_success\":true")) + { + var error = (BaseRegex.GetStringJson(ref rst, "error_msg") + " " + BaseRegex.GetStringJson(ref rst, "sub_msg")).Trim(); + if (string.IsNullOrWhiteSpace(error)) + error = rst; + return "{\"success\":false,\"goods_id\":" + goods_id + ",\"status\":\"已上传\",\"msg\":\"商品上传修改失败 " + error + "\"}"; + } + + if (!string.IsNullOrEmpty(goods_id)) + { + var pddRelationApi = new PddApi(shop); + int sourceType = 8; + if (relationData.from_site == "vd") + sourceType = 8; + var relationRst = pddRelationApi.Relation2603(goods_id.ParseToLong(), relationData.goods_id, relationData.price_min.ParseToInt(), relationData.price_max.ParseToInt(), 0, sourceType); + if (!relationRst.Contains("\"is_success\":true")) + relationRst = pddRelationApi.Relation2603(goods_id.ParseToLong(), relationData.goods_id, relationData.price_min.ParseToInt(), relationData.price_max.ParseToInt(), 0, sourceType); + if (!relationRst.Contains("\"is_success\":true")) + relationRst = pddRelationApi.Relation2603(goods_id.ParseToLong(), relationData.goods_id, relationData.price_min.ParseToInt(), relationData.price_max.ParseToInt(), 0, sourceType); + if (!relationRst.Contains("\"is_success\":true")) + { + return "{\"success\":true,\"goods_id\":" + goods_id + ",\"status\":\"已上传但转换异常\",\"msg\":\"上传成功\"}"; + } + } + return "{\"success\":true,\"goods_id\":" + goods_id + ",\"status\":\"已上传\",\"msg\":\"上传成功\"}"; + } + catch (Exception ex) + { + return "{\"success\":false,\"error_msg\"\"接口转换商品失败 " + ex.Message + "\"}"; + } + } + void GetToken(ShopLoginInfo shop) { diff --git a/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.cs b/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.cs index a3c548e..3e771b7 100644 --- a/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.cs +++ b/TEMUKJD/PDDForms/ShopForms/PDDShopListForm.cs @@ -38,19 +38,13 @@ namespace TemuKJD.PDDForms.ShopForms #region 服务端店铺管理 public static void UpdateShop() { - // 获取本地店铺和服务端店铺。将服务端相关信息与本地店铺合并后暂时存在内存中(不保存敏感信息)。 - // GlobalConfig.ShopLoginList = new ConcurrentList(); // 获取服务端店铺 var serverShopList = PDDShopListForm.GetServerShop(); - //var localShopList = new ConcurrentList(); - //localShopList.AddRange(serverShopList); - GlobalConfig.ShopLoginList.RemoveAll(s => !serverShopList.Any(ss => ss.LoginName == s.LoginName && ss.ShopId == ss.ShopId)); + GlobalConfig.ShopLoginList.RemoveAll(s => !serverShopList.Any(ss => ss.UserName == s.UserName && ss.ShopId == s.ShopId)); foreach (var serverShop in serverShopList) { - var localShop = serverShopList.FirstOrDefault(s => s.LoginName == serverShop.LoginName && s.ShopId == serverShop.ShopId); - if (localShop == null) - GlobalConfig.ShopLoginList.Add(serverShop); - else + var localShop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.LoginName == serverShop.LoginName && s.ShopId == serverShop.ShopId); + if (localShop != null) { localShop.ShopAccount = serverShop.ShopAccount; localShop.LoginName = serverShop.LoginName; @@ -77,11 +71,13 @@ namespace TemuKJD.PDDForms.ShopForms localShop.AntiContents = serverShop.AntiContents; localShop.AddProductRemaining = serverShop.AddProductRemaining; localShop.OperateSubSaName = serverShop.OperateSubSaName; - if (localShop.TrialUploadCount < 0) - localShop.TrialUploadCount = 0; + localShop.TrialUploadCount = Math.Max(0, serverShop.TrialUploadCount); + } + else + { + GlobalConfig.ShopLoginList.Add(serverShop); } } - //PddApiHelper.GetPddLocalTokens(); PddApiHelper.GetShopClientInfo(); } @@ -865,10 +861,11 @@ namespace TemuKJD.PDDForms.ShopForms if (currentPddClient != null) { PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop); - //shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + PddApi.clientId_pi_xiu_guan_jia + "&redirect_uri=" + GetHtml.UrlEncodeUtf8("http://po.e57.cn/login") + "?source=pdd_code&response_type=code"; + //shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + PddApi.clientId_pi_xiu_guan_jia + "&redirect_uri=" + GetHtml.UrlEncodeUtf8("http://po.e57.cn/login?source=pdd_code") + "&response_type=code"; //shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=48e76c60853d47d8a4e2e631b6db26b5&redirect_uri=http%3A%2F%2Fxtjpd.jiaotian.vip%2Fpdd_token.html&response_type=code" shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + currentPddClient.client_id + "&redirect_uri=" + currentPddClient.redirect_uri + "&response_type=code"; + //shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + PddApi.clientId_pi_xiu_guan_jia + "&redirect_uri=" + GetHtml.UrlEncodeUtf8("http://po.e57.cn/login?source=pdd_code_pixiu") + "&response_type=code"; shopLoginForm.openType = EnumOpenType.manage; shopLoginForm.AuthClientId = currentPddClient.client_id; shopLoginForm.SaveComplete += shopLoginForm_SaveComplete; diff --git a/TEMUKJD/StartUp.cs b/TEMUKJD/StartUp.cs index a4090d6..67c9df7 100644 --- a/TEMUKJD/StartUp.cs +++ b/TEMUKJD/StartUp.cs @@ -89,7 +89,6 @@ namespace TemuKJD ShopListForm.UpdateShop(); PddApiHelper.GetPddClientInfo(); PddApiHelper.GetShopClientInfo(); - //PddApiHelper.GetPddLocalTokens(); IsShopInit = true; })); diff --git a/TEMUKJD/WXForms/ProductForms/WXUserProdListForm.Designer.cs b/TEMUKJD/WXForms/ProductForms/WXUserProdListForm.Designer.cs index fa314c7..8fe73a0 100644 --- a/TEMUKJD/WXForms/ProductForms/WXUserProdListForm.Designer.cs +++ b/TEMUKJD/WXForms/ProductForms/WXUserProdListForm.Designer.cs @@ -420,7 +420,7 @@ namespace TemuKJD.WXForms.ProductForms this.cmbCat3.DropDownWidth = 1; this.cmbCat3.FormattingEnabled = true; this.cmbCat3.IntegralHeight = false; - this.cmbCat3.Location = new System.Drawing.Point(718, 7); + this.cmbCat3.Location = new System.Drawing.Point(718, 5); this.cmbCat3.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbCat3.Name = "cmbCat3"; this.cmbCat3.Size = new System.Drawing.Size(146, 25); @@ -448,7 +448,7 @@ namespace TemuKJD.WXForms.ProductForms this.cmbCat2.DropDownWidth = 1; this.cmbCat2.FormattingEnabled = true; this.cmbCat2.IntegralHeight = false; - this.cmbCat2.Location = new System.Drawing.Point(515, 7); + this.cmbCat2.Location = new System.Drawing.Point(515, 5); this.cmbCat2.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbCat2.Name = "cmbCat2"; this.cmbCat2.Size = new System.Drawing.Size(146, 25); @@ -476,7 +476,7 @@ namespace TemuKJD.WXForms.ProductForms this.cmbCat1.DropDownWidth = 1; this.cmbCat1.FormattingEnabled = true; this.cmbCat1.IntegralHeight = false; - this.cmbCat1.Location = new System.Drawing.Point(293, 5); + this.cmbCat1.Location = new System.Drawing.Point(293, 7); this.cmbCat1.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbCat1.Name = "cmbCat1"; this.cmbCat1.Size = new System.Drawing.Size(146, 25); @@ -536,7 +536,7 @@ namespace TemuKJD.WXForms.ProductForms "安全+未校验", "安全商品", "未校验"}); - this.cmbWxSafe.Location = new System.Drawing.Point(71, 40); + this.cmbWxSafe.Location = new System.Drawing.Point(71, 42); this.cmbWxSafe.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbWxSafe.Name = "cmbWxSafe"; this.cmbWxSafe.Size = new System.Drawing.Size(146, 25); @@ -559,7 +559,7 @@ namespace TemuKJD.WXForms.ProductForms // this.cmbGroupFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.cmbGroupFilter.FormattingEnabled = true; - this.cmbGroupFilter.Location = new System.Drawing.Point(938, 7); + this.cmbGroupFilter.Location = new System.Drawing.Point(938, 5); this.cmbGroupFilter.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbGroupFilter.Name = "cmbGroupFilter"; this.cmbGroupFilter.Size = new System.Drawing.Size(146, 25); @@ -580,7 +580,7 @@ namespace TemuKJD.WXForms.ProductForms "机会商品", "以图搜品", "外部数据"}); - this.cmbSourceType.Location = new System.Drawing.Point(718, 42); + this.cmbSourceType.Location = new System.Drawing.Point(718, 40); this.cmbSourceType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbSourceType.Name = "cmbSourceType"; this.cmbSourceType.Size = new System.Drawing.Size(146, 25); @@ -610,7 +610,7 @@ namespace TemuKJD.WXForms.ProductForms "", "是", "否"}); - this.cmbRelation.Location = new System.Drawing.Point(938, 42); + this.cmbRelation.Location = new System.Drawing.Point(938, 40); this.cmbRelation.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3); this.cmbRelation.Name = "cmbRelation"; this.cmbRelation.Size = new System.Drawing.Size(146, 25); diff --git a/TEMUKJD/WXForms/ShopForms/WXShopListForm.cs b/TEMUKJD/WXForms/ShopForms/WXShopListForm.cs index 69217d0..d8f9f44 100644 --- a/TEMUKJD/WXForms/ShopForms/WXShopListForm.cs +++ b/TEMUKJD/WXForms/ShopForms/WXShopListForm.cs @@ -32,19 +32,13 @@ namespace TemuKJD.WXForms.ShopForms #region 服务端店铺管理 public static void UpdateShop() { - // 获取本地店铺和服务端店铺。将服务端相关信息与本地店铺合并后暂时存在内存中(不保存敏感信息)。 - GlobalConfig.ShopLoginList = new ConcurrentList(); // 获取服务端店铺 var serverShopList = WXShopListForm.GetServerShop(); - var localShopList = new ConcurrentList(); - localShopList.AddRange(serverShopList); - foreach (var localShop in localShopList) + GlobalConfig.ShopLoginList.RemoveAll(s => serverShopList.Any(ss => ss.LoginName == s.LoginName && ss.ShopId == s.ShopId)); + foreach (var serverShop in serverShopList) { - if (GlobalConfig.ShopLoginList.Any(s => s.LoginName == localShop.LoginName && s.ShopId == localShop.ShopId)) - continue; - - var serverShop = serverShopList.FirstOrDefault(s => s.LoginName == localShop.LoginName && s.ShopId == localShop.ShopId); - if (serverShop != null) + var localShop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.LoginName == serverShop.LoginName && s.ShopId == serverShop.ShopId); + if (localShop != null) { localShop.ShopAccount = serverShop.ShopAccount; localShop.LoginName = serverShop.LoginName; @@ -68,9 +62,11 @@ namespace TemuKJD.WXForms.ShopForms localShop.AntiContents = serverShop.AntiContents; localShop.AddProductRemaining = serverShop.AddProductRemaining; localShop.OperateSubSaName = serverShop.OperateSubSaName; - if (localShop.TrialUploadCount < 0) - localShop.TrialUploadCount = 0; - GlobalConfig.ShopLoginList.Add(localShop); + localShop.TrialUploadCount = Math.Max(0, serverShop.TrialUploadCount); + } + else + { + GlobalConfig.ShopLoginList.Add(serverShop); } } } diff --git a/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.Designer.cs b/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.Designer.cs index ffef0d3..e50c082 100644 --- a/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.Designer.cs +++ b/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.Designer.cs @@ -86,6 +86,12 @@ namespace TemuKJD.WXForms.ShopForms this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx(); this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); + this.label20 = new System.Windows.Forms.Label(); + this.lblPay1 = new System.Windows.Forms.Label(); + this.label21 = new System.Windows.Forms.Label(); + this.lblPayCnt1 = new System.Windows.Forms.Label(); + this.label22 = new System.Windows.Forms.Label(); + this.lblPayRefund1 = new System.Windows.Forms.Label(); this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.colLoginStatus = new System.Windows.Forms.DataGridViewLinkColumn(); this.colDetail = new System.Windows.Forms.DataGridViewLinkColumn(); @@ -97,12 +103,15 @@ namespace TemuKJD.WXForms.ShopForms this.colOnSaleProductNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colScore = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colPayCnt = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colPayCnt1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colPayCnt7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colPayCnt30 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colPay = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colPay1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colPay7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colPay30 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colRefund = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colRefund1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colRefund7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colRefund30 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colOrderNum = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -147,7 +156,7 @@ namespace TemuKJD.WXForms.ShopForms // this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); this.splitContainer1.Panel2.Margin = new System.Windows.Forms.Padding(4); - this.splitContainer1.Size = new System.Drawing.Size(1446, 450); + this.splitContainer1.Size = new System.Drawing.Size(1235, 597); this.splitContainer1.SplitterDistance = 140; this.splitContainer1.TabIndex = 35; // @@ -166,7 +175,7 @@ namespace TemuKJD.WXForms.ShopForms this.ucGroupBoxEx3.Controls.Add(this.pnlFliter); this.ucGroupBoxEx3.Controls.Add(this.btnSetColumn); this.ucGroupBoxEx3.Controls.Add(this.btnGetNotGet); - this.ucGroupBoxEx3.Location = new System.Drawing.Point(1213, 2); + this.ucGroupBoxEx3.Location = new System.Drawing.Point(1002, 2); this.ucGroupBoxEx3.Name = "ucGroupBoxEx3"; this.ucGroupBoxEx3.Size = new System.Drawing.Size(230, 140); this.ucGroupBoxEx3.TabIndex = 668; @@ -350,7 +359,7 @@ namespace TemuKJD.WXForms.ShopForms this.ucGroupBoxEx1.Controls.Add(this.tableLayoutPanel1); this.ucGroupBoxEx1.Location = new System.Drawing.Point(2, 2); this.ucGroupBoxEx1.Name = "ucGroupBoxEx1"; - this.ucGroupBoxEx1.Size = new System.Drawing.Size(1211, 140); + this.ucGroupBoxEx1.Size = new System.Drawing.Size(1000, 140); this.ucGroupBoxEx1.TabIndex = 667; this.ucGroupBoxEx1.TabStop = false; this.ucGroupBoxEx1.Text = "统计汇总"; @@ -360,50 +369,57 @@ namespace TemuKJD.WXForms.ShopForms this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tableLayoutPanel1.ColumnCount = 9; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11005F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11005F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11005F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11005F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11005F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11005F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11227F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.1137F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.1137F)); - this.tableLayoutPanel1.Controls.Add(this.label17, 4, 2); - this.tableLayoutPanel1.Controls.Add(this.label16, 8, 0); - this.tableLayoutPanel1.Controls.Add(this.label15, 7, 0); - this.tableLayoutPanel1.Controls.Add(this.lblPayRefund30, 8, 1); - this.tableLayoutPanel1.Controls.Add(this.lblPayRefund7, 7, 1); - this.tableLayoutPanel1.Controls.Add(this.lblPayRefund, 6, 1); - this.tableLayoutPanel1.Controls.Add(this.label13, 6, 0); - this.tableLayoutPanel1.Controls.Add(this.lblOrderNum, 0, 3); - this.tableLayoutPanel1.Controls.Add(this.lblPayCnt30, 2, 1); - this.tableLayoutPanel1.Controls.Add(this.label12, 5, 0); - this.tableLayoutPanel1.Controls.Add(this.lblPayCnt7, 1, 1); - this.tableLayoutPanel1.Controls.Add(this.label2, 1, 0); + this.tableLayoutPanel1.ColumnCount = 10; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 9.999151F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 9.99915F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 9.99915F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 9.99915F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 9.99915F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 9.99915F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.00115F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.00244F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.00244F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 9.999105F)); + this.tableLayoutPanel1.Controls.Add(this.lblPayRefund1, 9, 1); + this.tableLayoutPanel1.Controls.Add(this.label22, 9, 0); + this.tableLayoutPanel1.Controls.Add(this.lblPayCnt1, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.label21, 1, 0); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.lblPayCnt, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.lblPay30, 5, 1); - this.tableLayoutPanel1.Controls.Add(this.label10, 4, 0); - this.tableLayoutPanel1.Controls.Add(this.lblPay7, 4, 1); - this.tableLayoutPanel1.Controls.Add(this.label9, 3, 0); - this.tableLayoutPanel1.Controls.Add(this.lblPay, 3, 1); - this.tableLayoutPanel1.Controls.Add(this.label11, 2, 0); - this.tableLayoutPanel1.Controls.Add(this.lblAvailableAmount, 5, 3); - this.tableLayoutPanel1.Controls.Add(this.label7, 5, 2); - this.tableLayoutPanel1.Controls.Add(this.label5, 3, 2); - this.tableLayoutPanel1.Controls.Add(this.lblPunish, 3, 3); - this.tableLayoutPanel1.Controls.Add(this.lblAfterSaleAll, 2, 3); - this.tableLayoutPanel1.Controls.Add(this.label4, 2, 2); - this.tableLayoutPanel1.Controls.Add(this.lblWaybillError, 1, 3); - this.tableLayoutPanel1.Controls.Add(this.label3, 1, 2); - this.tableLayoutPanel1.Controls.Add(this.label14, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.label8, 6, 2); - this.tableLayoutPanel1.Controls.Add(this.lblPendingAmount, 6, 3); - this.tableLayoutPanel1.Controls.Add(this.lblDepositBalance, 7, 3); - this.tableLayoutPanel1.Controls.Add(this.label6, 7, 2); - this.tableLayoutPanel1.Controls.Add(this.lblTotalAmount, 4, 3); + this.tableLayoutPanel1.Controls.Add(this.label6, 9, 2); + this.tableLayoutPanel1.Controls.Add(this.lblDepositBalance, 9, 3); + this.tableLayoutPanel1.Controls.Add(this.label8, 8, 2); + this.tableLayoutPanel1.Controls.Add(this.lblPendingAmount, 8, 3); + this.tableLayoutPanel1.Controls.Add(this.label7, 7, 2); + this.tableLayoutPanel1.Controls.Add(this.lblAvailableAmount, 7, 3); + this.tableLayoutPanel1.Controls.Add(this.label17, 6, 2); + this.tableLayoutPanel1.Controls.Add(this.lblTotalAmount, 6, 3); + this.tableLayoutPanel1.Controls.Add(this.label5, 5, 2); + this.tableLayoutPanel1.Controls.Add(this.lblPunish, 5, 3); + this.tableLayoutPanel1.Controls.Add(this.label4, 4, 2); + this.tableLayoutPanel1.Controls.Add(this.lblAfterSaleAll, 4, 3); + this.tableLayoutPanel1.Controls.Add(this.label3, 3, 2); + this.tableLayoutPanel1.Controls.Add(this.lblWaybillError, 3, 3); + this.tableLayoutPanel1.Controls.Add(this.lblOrderNum, 2, 3); + this.tableLayoutPanel1.Controls.Add(this.label14, 2, 2); + this.tableLayoutPanel1.Controls.Add(this.label16, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.lblPayRefund30, 1, 3); + this.tableLayoutPanel1.Controls.Add(this.label15, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.lblPayRefund7, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.label12, 7, 0); + this.tableLayoutPanel1.Controls.Add(this.lblPay30, 7, 1); + this.tableLayoutPanel1.Controls.Add(this.label10, 6, 0); + this.tableLayoutPanel1.Controls.Add(this.lblPay7, 6, 1); + this.tableLayoutPanel1.Controls.Add(this.label20, 5, 0); + this.tableLayoutPanel1.Controls.Add(this.lblPay1, 5, 1); + this.tableLayoutPanel1.Controls.Add(this.label9, 4, 0); + this.tableLayoutPanel1.Controls.Add(this.lblPay, 4, 1); + this.tableLayoutPanel1.Controls.Add(this.label11, 3, 0); + this.tableLayoutPanel1.Controls.Add(this.lblPayCnt30, 3, 1); + this.tableLayoutPanel1.Controls.Add(this.label2, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.lblPayCnt7, 2, 1); + this.tableLayoutPanel1.Controls.Add(this.label13, 8, 0); + this.tableLayoutPanel1.Controls.Add(this.lblPayRefund, 8, 1); this.tableLayoutPanel1.Location = new System.Drawing.Point(31, 19); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 4; @@ -411,7 +427,7 @@ namespace TemuKJD.WXForms.ShopForms this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(1168, 115); + this.tableLayoutPanel1.Size = new System.Drawing.Size(957, 115); this.tableLayoutPanel1.TabIndex = 435; // // label17 @@ -419,7 +435,7 @@ namespace TemuKJD.WXForms.ShopForms this.label17.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label17.AutoSize = true; this.label17.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label17.Location = new System.Drawing.Point(519, 60); + this.label17.Location = new System.Drawing.Point(573, 60); this.label17.Name = "label17"; this.label17.Size = new System.Drawing.Size(80, 17); this.label17.TabIndex = 25; @@ -430,9 +446,9 @@ namespace TemuKJD.WXForms.ShopForms this.label16.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label16.AutoSize = true; this.label16.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label16.Location = new System.Drawing.Point(1035, 3); + this.label16.Location = new System.Drawing.Point(98, 57); this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(94, 17); + this.label16.Size = new System.Drawing.Size(82, 23); this.label16.TabIndex = 24; this.label16.Text = "近30日退款金额"; // @@ -441,7 +457,7 @@ namespace TemuKJD.WXForms.ShopForms this.label15.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label15.AutoSize = true; this.label15.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label15.Location = new System.Drawing.Point(906, 3); + this.label15.Location = new System.Drawing.Point(3, 60); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(87, 17); this.label15.TabIndex = 23; @@ -452,7 +468,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblPayRefund30.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPayRefund30.AutoSize = true; this.lblPayRefund30.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblPayRefund30.Location = new System.Drawing.Point(1035, 30); + this.lblPayRefund30.Location = new System.Drawing.Point(98, 87); this.lblPayRefund30.Name = "lblPayRefund30"; this.lblPayRefund30.Size = new System.Drawing.Size(18, 20); this.lblPayRefund30.TabIndex = 21; @@ -463,7 +479,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblPayRefund7.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPayRefund7.AutoSize = true; this.lblPayRefund7.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblPayRefund7.Location = new System.Drawing.Point(906, 30); + this.lblPayRefund7.Location = new System.Drawing.Point(3, 87); this.lblPayRefund7.Name = "lblPayRefund7"; this.lblPayRefund7.Size = new System.Drawing.Size(18, 20); this.lblPayRefund7.TabIndex = 20; @@ -474,7 +490,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblPayRefund.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPayRefund.AutoSize = true; this.lblPayRefund.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblPayRefund.Location = new System.Drawing.Point(777, 30); + this.lblPayRefund.Location = new System.Drawing.Point(763, 30); this.lblPayRefund.Name = "lblPayRefund"; this.lblPayRefund.Size = new System.Drawing.Size(18, 20); this.lblPayRefund.TabIndex = 19; @@ -485,7 +501,7 @@ namespace TemuKJD.WXForms.ShopForms this.label13.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label13.AutoSize = true; this.label13.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label13.Location = new System.Drawing.Point(777, 3); + this.label13.Location = new System.Drawing.Point(763, 3); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(80, 17); this.label13.TabIndex = 15; @@ -496,7 +512,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblOrderNum.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblOrderNum.AutoSize = true; this.lblOrderNum.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblOrderNum.Location = new System.Drawing.Point(3, 87); + this.lblOrderNum.Location = new System.Drawing.Point(193, 87); this.lblOrderNum.Name = "lblOrderNum"; this.lblOrderNum.Size = new System.Drawing.Size(18, 20); this.lblOrderNum.TabIndex = 22; @@ -507,7 +523,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblPayCnt30.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPayCnt30.AutoSize = true; this.lblPayCnt30.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblPayCnt30.Location = new System.Drawing.Point(261, 30); + this.lblPayCnt30.Location = new System.Drawing.Point(288, 30); this.lblPayCnt30.Name = "lblPayCnt30"; this.lblPayCnt30.Size = new System.Drawing.Size(18, 20); this.lblPayCnt30.TabIndex = 16; @@ -518,9 +534,9 @@ namespace TemuKJD.WXForms.ShopForms this.label12.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label12.AutoSize = true; this.label12.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label12.Location = new System.Drawing.Point(648, 3); + this.label12.Location = new System.Drawing.Point(668, 0); this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(94, 17); + this.label12.Size = new System.Drawing.Size(82, 23); this.label12.TabIndex = 8; this.label12.Text = "近30日成交金额"; // @@ -529,7 +545,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblPayCnt7.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPayCnt7.AutoSize = true; this.lblPayCnt7.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblPayCnt7.Location = new System.Drawing.Point(132, 30); + this.lblPayCnt7.Location = new System.Drawing.Point(193, 30); this.lblPayCnt7.Name = "lblPayCnt7"; this.lblPayCnt7.Size = new System.Drawing.Size(18, 20); this.lblPayCnt7.TabIndex = 15; @@ -540,7 +556,7 @@ namespace TemuKJD.WXForms.ShopForms this.label2.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label2.AutoSize = true; this.label2.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label2.Location = new System.Drawing.Point(132, 3); + this.label2.Location = new System.Drawing.Point(193, 3); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(63, 17); this.label2.TabIndex = 7; @@ -573,7 +589,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblPay30.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPay30.AutoSize = true; this.lblPay30.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblPay30.Location = new System.Drawing.Point(648, 30); + this.lblPay30.Location = new System.Drawing.Point(668, 30); this.lblPay30.Name = "lblPay30"; this.lblPay30.Size = new System.Drawing.Size(18, 20); this.lblPay30.TabIndex = 18; @@ -584,7 +600,7 @@ namespace TemuKJD.WXForms.ShopForms this.label10.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label10.AutoSize = true; this.label10.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label10.Location = new System.Drawing.Point(519, 3); + this.label10.Location = new System.Drawing.Point(573, 3); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(87, 17); this.label10.TabIndex = 13; @@ -595,7 +611,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblPay7.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPay7.AutoSize = true; this.lblPay7.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblPay7.Location = new System.Drawing.Point(519, 30); + this.lblPay7.Location = new System.Drawing.Point(573, 30); this.lblPay7.Name = "lblPay7"; this.lblPay7.Size = new System.Drawing.Size(18, 20); this.lblPay7.TabIndex = 17; @@ -606,7 +622,7 @@ namespace TemuKJD.WXForms.ShopForms this.label9.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label9.AutoSize = true; this.label9.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label9.Location = new System.Drawing.Point(390, 3); + this.label9.Location = new System.Drawing.Point(383, 3); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(80, 17); this.label9.TabIndex = 14; @@ -617,7 +633,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblPay.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPay.AutoSize = true; this.lblPay.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblPay.Location = new System.Drawing.Point(390, 30); + this.lblPay.Location = new System.Drawing.Point(383, 30); this.lblPay.Name = "lblPay"; this.lblPay.Size = new System.Drawing.Size(18, 20); this.lblPay.TabIndex = 16; @@ -628,7 +644,7 @@ namespace TemuKJD.WXForms.ShopForms this.label11.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label11.AutoSize = true; this.label11.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label11.Location = new System.Drawing.Point(261, 3); + this.label11.Location = new System.Drawing.Point(288, 3); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(70, 17); this.label11.TabIndex = 14; @@ -639,7 +655,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblAvailableAmount.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblAvailableAmount.AutoSize = true; this.lblAvailableAmount.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblAvailableAmount.Location = new System.Drawing.Point(648, 87); + this.lblAvailableAmount.Location = new System.Drawing.Point(668, 87); this.lblAvailableAmount.Name = "lblAvailableAmount"; this.lblAvailableAmount.Size = new System.Drawing.Size(18, 20); this.lblAvailableAmount.TabIndex = 15; @@ -650,9 +666,9 @@ namespace TemuKJD.WXForms.ShopForms this.label7.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label7.AutoSize = true; this.label7.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label7.Location = new System.Drawing.Point(648, 60); + this.label7.Location = new System.Drawing.Point(668, 57); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(92, 17); + this.label7.Size = new System.Drawing.Size(80, 23); this.label7.TabIndex = 12; this.label7.Text = "可提现金额总和"; // @@ -661,7 +677,7 @@ namespace TemuKJD.WXForms.ShopForms this.label5.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label5.AutoSize = true; this.label5.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label5.Location = new System.Drawing.Point(390, 60); + this.label5.Location = new System.Drawing.Point(478, 60); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(56, 17); this.label5.TabIndex = 10; @@ -672,7 +688,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblPunish.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPunish.AutoSize = true; this.lblPunish.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblPunish.Location = new System.Drawing.Point(390, 87); + this.lblPunish.Location = new System.Drawing.Point(478, 87); this.lblPunish.Name = "lblPunish"; this.lblPunish.Size = new System.Drawing.Size(18, 20); this.lblPunish.TabIndex = 15; @@ -683,7 +699,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblAfterSaleAll.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblAfterSaleAll.AutoSize = true; this.lblAfterSaleAll.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblAfterSaleAll.Location = new System.Drawing.Point(261, 87); + this.lblAfterSaleAll.Location = new System.Drawing.Point(383, 87); this.lblAfterSaleAll.Name = "lblAfterSaleAll"; this.lblAfterSaleAll.Size = new System.Drawing.Size(18, 20); this.lblAfterSaleAll.TabIndex = 15; @@ -694,7 +710,7 @@ namespace TemuKJD.WXForms.ShopForms this.label4.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label4.AutoSize = true; this.label4.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label4.Location = new System.Drawing.Point(261, 60); + this.label4.Location = new System.Drawing.Point(383, 60); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(32, 17); this.label4.TabIndex = 9; @@ -705,7 +721,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblWaybillError.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblWaybillError.AutoSize = true; this.lblWaybillError.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblWaybillError.Location = new System.Drawing.Point(132, 87); + this.lblWaybillError.Location = new System.Drawing.Point(288, 87); this.lblWaybillError.Name = "lblWaybillError"; this.lblWaybillError.Size = new System.Drawing.Size(18, 20); this.lblWaybillError.TabIndex = 15; @@ -716,7 +732,7 @@ namespace TemuKJD.WXForms.ShopForms this.label3.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label3.AutoSize = true; this.label3.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label3.Location = new System.Drawing.Point(132, 60); + this.label3.Location = new System.Drawing.Point(288, 60); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(56, 17); this.label3.TabIndex = 8; @@ -727,7 +743,7 @@ namespace TemuKJD.WXForms.ShopForms this.label14.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label14.AutoSize = true; this.label14.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label14.Location = new System.Drawing.Point(3, 60); + this.label14.Location = new System.Drawing.Point(193, 60); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(44, 17); this.label14.TabIndex = 20; @@ -738,9 +754,9 @@ namespace TemuKJD.WXForms.ShopForms this.label8.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label8.AutoSize = true; this.label8.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label8.Location = new System.Drawing.Point(777, 60); + this.label8.Location = new System.Drawing.Point(763, 57); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(92, 17); + this.label8.Size = new System.Drawing.Size(80, 23); this.label8.TabIndex = 13; this.label8.Text = "待结算金额总和"; // @@ -749,7 +765,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblPendingAmount.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblPendingAmount.AutoSize = true; this.lblPendingAmount.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblPendingAmount.Location = new System.Drawing.Point(777, 87); + this.lblPendingAmount.Location = new System.Drawing.Point(763, 87); this.lblPendingAmount.Name = "lblPendingAmount"; this.lblPendingAmount.Size = new System.Drawing.Size(18, 20); this.lblPendingAmount.TabIndex = 15; @@ -760,7 +776,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblDepositBalance.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblDepositBalance.AutoSize = true; this.lblDepositBalance.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblDepositBalance.Location = new System.Drawing.Point(906, 87); + this.lblDepositBalance.Location = new System.Drawing.Point(858, 87); this.lblDepositBalance.Name = "lblDepositBalance"; this.lblDepositBalance.Size = new System.Drawing.Size(18, 20); this.lblDepositBalance.TabIndex = 15; @@ -771,7 +787,7 @@ namespace TemuKJD.WXForms.ShopForms this.label6.Anchor = System.Windows.Forms.AnchorStyles.Left; this.label6.AutoSize = true; this.label6.ForeColor = System.Drawing.SystemColors.ControlDarkDark; - this.label6.Location = new System.Drawing.Point(906, 60); + this.label6.Location = new System.Drawing.Point(858, 60); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(92, 17); this.label6.TabIndex = 11; @@ -782,7 +798,7 @@ namespace TemuKJD.WXForms.ShopForms this.lblTotalAmount.Anchor = System.Windows.Forms.AnchorStyles.Left; this.lblTotalAmount.AutoSize = true; this.lblTotalAmount.Font = new System.Drawing.Font("微软雅黑", 11F); - this.lblTotalAmount.Location = new System.Drawing.Point(519, 87); + this.lblTotalAmount.Location = new System.Drawing.Point(573, 87); this.lblTotalAmount.Name = "lblTotalAmount"; this.lblTotalAmount.Size = new System.Drawing.Size(18, 20); this.lblTotalAmount.TabIndex = 26; @@ -808,15 +824,15 @@ namespace TemuKJD.WXForms.ShopForms // splitContainer2.Panel2 // this.splitContainer2.Panel2.Controls.Add(this.statusBar); - this.splitContainer2.Size = new System.Drawing.Size(1446, 306); - this.splitContainer2.SplitterDistance = 276; + this.splitContainer2.Size = new System.Drawing.Size(1235, 453); + this.splitContainer2.SplitterDistance = 423; this.splitContainer2.TabIndex = 0; // // 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(698, 113); + this.pbLoading.Location = new System.Drawing.Point(592, 186); this.pbLoading.Name = "pbLoading"; this.pbLoading.Size = new System.Drawing.Size(50, 50); this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -833,18 +849,18 @@ namespace TemuKJD.WXForms.ShopForms this.panel1.Controls.Add(this.flowLayoutPanel1); this.panel1.Location = new System.Drawing.Point(98, 65); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1250, 134); + this.panel1.Size = new System.Drawing.Size(1039, 154); this.panel1.TabIndex = 9; this.panel1.Visible = false; // // btnClose // - this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnClose.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnClose.Cursor = System.Windows.Forms.Cursors.Hand; this.btnClose.DisabledBackColor = System.Drawing.Color.Empty; this.btnClose.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnClose.Location = new System.Drawing.Point(1161, 98); + this.btnClose.Location = new System.Drawing.Point(950, 118); this.btnClose.Name = "btnClose"; this.btnClose.Size = new System.Drawing.Size(58, 23); this.btnClose.Style.Alignment = System.Drawing.StringAlignment.Center; @@ -864,11 +880,12 @@ namespace TemuKJD.WXForms.ShopForms // // flowLayoutPanel1 // - this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.flowLayoutPanel1.Location = new System.Drawing.Point(24, 17); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(1195, 75); + this.flowLayoutPanel1.Size = new System.Drawing.Size(984, 95); this.flowLayoutPanel1.TabIndex = 8; // // dgvShop @@ -901,12 +918,15 @@ namespace TemuKJD.WXForms.ShopForms this.colOnSaleProductNumber, this.colScore, this.colPayCnt, + this.colPayCnt1, this.colPayCnt7, this.colPayCnt30, this.colPay, + this.colPay1, this.colPay7, this.colPay30, this.colRefund, + this.colRefund1, this.colRefund7, this.colRefund30, this.colOrderNum, @@ -919,11 +939,12 @@ namespace TemuKJD.WXForms.ShopForms this.colDepositBalance}); this.dgvShop.Dock = System.Windows.Forms.DockStyle.Fill; this.dgvShop.Location = new System.Drawing.Point(4, 0); + this.dgvShop.MultiSelectCheckBox = true; this.dgvShop.Name = "dgvShop"; this.dgvShop.ReadOnly = true; this.dgvShop.RowHeadersWidth = 36; this.dgvShop.RowTemplate.Height = 23; - this.dgvShop.Size = new System.Drawing.Size(1438, 276); + this.dgvShop.Size = new System.Drawing.Size(1227, 423); this.dgvShop.TabIndex = 5; this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick); // @@ -935,9 +956,75 @@ namespace TemuKJD.WXForms.ShopForms this.statusBar.Location = new System.Drawing.Point(0, 0); this.statusBar.Margin = new System.Windows.Forms.Padding(0); this.statusBar.Name = "statusBar"; - this.statusBar.Size = new System.Drawing.Size(1446, 26); + this.statusBar.Size = new System.Drawing.Size(1235, 26); this.statusBar.TabIndex = 1; // + // label20 + // + this.label20.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.label20.AutoSize = true; + this.label20.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.label20.Location = new System.Drawing.Point(478, 3); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(80, 17); + this.label20.TabIndex = 14; + this.label20.Text = "昨日成交金额"; + // + // lblPay1 + // + this.lblPay1.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblPay1.AutoSize = true; + this.lblPay1.Font = new System.Drawing.Font("微软雅黑", 11F); + this.lblPay1.Location = new System.Drawing.Point(478, 30); + this.lblPay1.Name = "lblPay1"; + this.lblPay1.Size = new System.Drawing.Size(18, 20); + this.lblPay1.TabIndex = 18; + this.lblPay1.Text = "0"; + // + // label21 + // + this.label21.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.label21.AutoSize = true; + this.label21.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.label21.Location = new System.Drawing.Point(98, 3); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(56, 17); + this.label21.TabIndex = 15; + this.label21.Text = "昨日订单"; + // + // lblPayCnt1 + // + this.lblPayCnt1.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblPayCnt1.AutoSize = true; + this.lblPayCnt1.Font = new System.Drawing.Font("微软雅黑", 11F); + this.lblPayCnt1.Location = new System.Drawing.Point(98, 30); + this.lblPayCnt1.Name = "lblPayCnt1"; + this.lblPayCnt1.Size = new System.Drawing.Size(18, 20); + this.lblPayCnt1.TabIndex = 16; + this.lblPayCnt1.Text = "0"; + // + // label22 + // + this.label22.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.label22.AutoSize = true; + this.label22.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.label22.Location = new System.Drawing.Point(858, 3); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(80, 17); + this.label22.TabIndex = 16; + this.label22.Text = "昨日退款金额"; + // + // lblPayRefund1 + // + this.lblPayRefund1.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblPayRefund1.AutoSize = true; + this.lblPayRefund1.Font = new System.Drawing.Font("微软雅黑", 11F); + this.lblPayRefund1.Location = new System.Drawing.Point(858, 30); + this.lblPayRefund1.Name = "lblPayRefund1"; + this.lblPayRefund1.Size = new System.Drawing.Size(18, 20); + this.lblPayRefund1.TabIndex = 20; + this.lblPayRefund1.Text = "0"; + // // colSelect // this.colSelect.FillWeight = 22F; @@ -1011,7 +1098,7 @@ namespace TemuKJD.WXForms.ShopForms this.colOnSaleProductNumber.HeaderText = "在售商品"; this.colOnSaleProductNumber.Name = "colOnSaleProductNumber"; this.colOnSaleProductNumber.ReadOnly = true; - this.colOnSaleProductNumber.Width = 68; + this.colOnSaleProductNumber.Width = 62; // // colScore // @@ -1019,7 +1106,7 @@ namespace TemuKJD.WXForms.ShopForms this.colScore.HeaderText = "体验分"; this.colScore.Name = "colScore"; this.colScore.ReadOnly = true; - this.colScore.Width = 54; + this.colScore.Width = 50; // // colPayCnt // @@ -1029,13 +1116,21 @@ namespace TemuKJD.WXForms.ShopForms this.colPayCnt.ReadOnly = true; this.colPayCnt.Width = 62; // + // colPayCnt1 + // + this.colPayCnt1.FillWeight = 60F; + this.colPayCnt1.HeaderText = "昨日订单"; + this.colPayCnt1.Name = "colPayCnt1"; + this.colPayCnt1.ReadOnly = true; + this.colPayCnt1.Width = 62; + // // colPayCnt7 // this.colPayCnt7.FillWeight = 60F; this.colPayCnt7.HeaderText = "7日订单"; this.colPayCnt7.Name = "colPayCnt7"; this.colPayCnt7.ReadOnly = true; - this.colPayCnt7.Width = 62; + this.colPayCnt7.Width = 57; // // colPayCnt30 // @@ -1047,52 +1142,66 @@ namespace TemuKJD.WXForms.ShopForms // // colPay // - this.colPay.HeaderText = "今日成交金额"; + this.colPay.HeaderText = "今日成交额"; this.colPay.Name = "colPay"; this.colPay.ReadOnly = true; - this.colPay.Width = 86; + this.colPay.Width = 75; + // + // colPay1 + // + this.colPay1.HeaderText = "昨日成交额"; + this.colPay1.Name = "colPay1"; + this.colPay1.ReadOnly = true; + this.colPay1.Width = 75; // // colPay7 // - this.colPay7.HeaderText = "7日成交金额"; + this.colPay7.HeaderText = "7日成交额"; this.colPay7.Name = "colPay7"; this.colPay7.ReadOnly = true; - this.colPay7.Width = 86; + this.colPay7.Width = 72; // // colPay30 // - this.colPay30.HeaderText = "30日成交金额"; + this.colPay30.HeaderText = "30日成交额"; this.colPay30.Name = "colPay30"; this.colPay30.ReadOnly = true; - this.colPay30.Width = 88; + this.colPay30.Width = 78; // // colRefund // - this.colRefund.HeaderText = "今日退款金额"; + this.colRefund.HeaderText = "今日退款额"; this.colRefund.Name = "colRefund"; this.colRefund.ReadOnly = true; - this.colRefund.Width = 86; + this.colRefund.Width = 75; + // + // colRefund1 + // + this.colRefund1.HeaderText = "昨日退款额"; + this.colRefund1.Name = "colRefund1"; + this.colRefund1.ReadOnly = true; + this.colRefund1.Width = 75; // // colRefund7 // - this.colRefund7.HeaderText = "7日退款金额"; + this.colRefund7.HeaderText = "7日退款额"; this.colRefund7.Name = "colRefund7"; this.colRefund7.ReadOnly = true; - this.colRefund7.Width = 86; + this.colRefund7.Width = 72; // // colRefund30 // - this.colRefund30.HeaderText = "30日退款金额"; + this.colRefund30.HeaderText = "30日退款额"; this.colRefund30.Name = "colRefund30"; this.colRefund30.ReadOnly = true; - this.colRefund30.Width = 88; + this.colRefund30.Width = 78; // // colOrderNum // this.colOrderNum.HeaderText = "待发货"; this.colOrderNum.Name = "colOrderNum"; this.colOrderNum.ReadOnly = true; - this.colOrderNum.Width = 54; + this.colOrderNum.Width = 50; // // colShipErr // @@ -1148,9 +1257,10 @@ namespace TemuKJD.WXForms.ShopForms // WxShopStatisticsForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; - this.ClientSize = new System.Drawing.Size(1446, 450); + this.ClientSize = new System.Drawing.Size(1235, 597); this.Controls.Add(this.splitContainer1); this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.KeyPreview = true; this.Name = "WxShopStatisticsForm"; this.Text = "WxShopStatisticsForm"; this.Load += new System.EventHandler(this.WxShopStatisticsForm_Load); @@ -1231,6 +1341,12 @@ namespace TemuKJD.WXForms.ShopForms private System.Windows.Forms.Label label18; private System.Windows.Forms.TextBox txtFilterShopName; private System.Windows.Forms.Label label19; + private System.Windows.Forms.Label lblPay1; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label lblPayCnt1; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.Label lblPayRefund1; + private System.Windows.Forms.Label label22; private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect; private System.Windows.Forms.DataGridViewLinkColumn colLoginStatus; private System.Windows.Forms.DataGridViewLinkColumn colDetail; @@ -1242,12 +1358,15 @@ namespace TemuKJD.WXForms.ShopForms private System.Windows.Forms.DataGridViewTextBoxColumn colOnSaleProductNumber; private System.Windows.Forms.DataGridViewTextBoxColumn colScore; private System.Windows.Forms.DataGridViewTextBoxColumn colPayCnt; + private System.Windows.Forms.DataGridViewTextBoxColumn colPayCnt1; private System.Windows.Forms.DataGridViewTextBoxColumn colPayCnt7; private System.Windows.Forms.DataGridViewTextBoxColumn colPayCnt30; private System.Windows.Forms.DataGridViewTextBoxColumn colPay; + private System.Windows.Forms.DataGridViewTextBoxColumn colPay1; private System.Windows.Forms.DataGridViewTextBoxColumn colPay7; private System.Windows.Forms.DataGridViewTextBoxColumn colPay30; private System.Windows.Forms.DataGridViewTextBoxColumn colRefund; + private System.Windows.Forms.DataGridViewTextBoxColumn colRefund1; private System.Windows.Forms.DataGridViewTextBoxColumn colRefund7; private System.Windows.Forms.DataGridViewTextBoxColumn colRefund30; private System.Windows.Forms.DataGridViewTextBoxColumn colOrderNum; diff --git a/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.cs b/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.cs index 7c179bd..576b6aa 100644 --- a/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.cs +++ b/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.cs @@ -26,6 +26,7 @@ namespace TemuKJD.WXForms.ShopForms { bool isInit = false; public List lstShopStatisticsInfo = new List(); + public List lstHideColumns = new List(); public WxShopStatisticsForm() { InitializeComponent(); @@ -35,8 +36,15 @@ namespace TemuKJD.WXForms.ShopForms { this.dgvShop.AddSelectorColumn("colSelect"); - foreach(DataGridViewColumn column in dgvShop.Columns) + + lstHideColumns = NaiBa.Util.Helper.ConfigHelper.LoadConfig>("wx_shop_sale_statistics_hide_columns"); + if (lstHideColumns == null) + lstHideColumns = new List(); + foreach (DataGridViewColumn column in dgvShop.Columns) { + if (lstHideColumns.Contains(column.HeaderText)) + column.Visible = false; + if (!string.IsNullOrEmpty(column.HeaderText) && column.HeaderText != "店铺登录号码" && column.HeaderText != "详情") { var chk = new UcCheckBox() { Name = "chk" + column.Name, Tag = column.Name, Text = column.HeaderText, Checked = column.Visible, }; @@ -56,6 +64,15 @@ namespace TemuKJD.WXForms.ShopForms if (chk != null) { dgvShop.Columns[chk.Tag.ParseToString()].Visible = chk.Checked; + if (!chk.Checked) + { + lstHideColumns.Add(chk.Text); + } + else + { + lstHideColumns.Remove(chk.Text); + } + NaiBa.Util.Helper.ConfigHelper.SaveConfig>("wx_shop_sale_statistics_hide_columns", lstHideColumns); } } @@ -182,12 +199,15 @@ namespace TemuKJD.WXForms.ShopForms Invoke(new Action(() => { this.lblPayCnt.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfoToday.pay_order_cnt.ParseToLong()).ToString(); + this.lblPayCnt1.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfo1Day.pay_order_cnt.ParseToLong()).ToString(); this.lblPayCnt7.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfo7Day.pay_order_cnt.ParseToLong()).ToString(); this.lblPayCnt30.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfo30Day.pay_order_cnt.ParseToLong()).ToString(); this.lblPay.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfoToday.pay_gmv.ParseToDecimal() * 0.01m).ToString("f2"); + this.lblPay1.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfo1Day.pay_gmv.ParseToDecimal() * 0.01m).ToString("f2"); this.lblPay7.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfo7Day.pay_gmv.ParseToDecimal() * 0.01m).ToString("f2"); this.lblPay30.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfo30Day.pay_gmv.ParseToDecimal() * 0.01m).ToString("f2"); this.lblPayRefund.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfoToday.pay_refund_gmv.ParseToLong() * 0.01m).ToString(); + this.lblPayRefund1.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfo1Day.pay_refund_gmv.ParseToLong() * 0.01m).ToString(); this.lblPayRefund7.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfo7Day.pay_refund_gmv.ParseToLong() * 0.01m).ToString(); this.lblPayRefund30.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopSaleInfo30Day.pay_refund_gmv.ParseToLong() * 0.01m).ToString(); this.lblOrderNum.Text = this.lstShopStatisticsInfo.Sum(s => s.WxShopMainInfo.orderNumRet?.num.ParseToInt()).ToString(); @@ -259,12 +279,15 @@ namespace TemuKJD.WXForms.ShopForms statistics.ProdCount.ParseToNullableInt(), // 在售商品 statistics.curScoreValue.ParseToNullableDecimal(), // 店铺体验分 statistics.WxShopSaleInfoToday.pay_order_cnt, // 今日订单 + statistics.WxShopSaleInfo1Day.pay_order_cnt, // 昨日订单 statistics.WxShopSaleInfo7Day.pay_order_cnt, // 7日订单 statistics.WxShopSaleInfo30Day.pay_order_cnt, // 30日订单 statistics.WxShopSaleInfoToday.pay_gmv, // 今日成交金额 + statistics.WxShopSaleInfo1Day.pay_gmv, // 昨日成交金额 statistics.WxShopSaleInfo7Day.pay_gmv, // 7日成交金额 statistics.WxShopSaleInfo30Day.pay_gmv, // 30日成交金额 statistics.WxShopSaleInfoToday.pay_refund_gmv, // 今日退款金额 + statistics.WxShopSaleInfo1Day.pay_refund_gmv, // 昨日退款金额 statistics.WxShopSaleInfo7Day.pay_refund_gmv, // 7日退款金额 statistics.WxShopSaleInfo30Day.pay_refund_gmv, // 30日退款金额 statistics.WxShopMainInfo.orderNumRet?.num, // 待发货 @@ -299,12 +322,15 @@ namespace TemuKJD.WXForms.ShopForms row.Cells["colOnSaleProductNumber"].Value = statistics.ProdCount.ParseToNullableInt(); // 商品数量 row.Cells["colScore"].Value = statistics.curScoreValue.ParseToNullableDecimal(); // 店铺体验分 row.Cells["colPayCnt"].Value = statistics.WxShopSaleInfoToday.pay_order_cnt; // 今日订单 + row.Cells["colPayCnt1"].Value = statistics.WxShopSaleInfo1Day.pay_order_cnt; // 昨日订单 row.Cells["colPayCnt7"].Value = statistics.WxShopSaleInfo7Day.pay_order_cnt; // 7日订单 row.Cells["colPayCnt30"].Value = statistics.WxShopSaleInfo30Day.pay_order_cnt; // 30日订单 row.Cells["colPay"].Value = statistics.WxShopSaleInfoToday.pay_gmv.ParseToNullableLong() * 0.01m; // 今日成交金额 + row.Cells["colPay1"].Value = statistics.WxShopSaleInfo1Day.pay_gmv.ParseToNullableLong() * 0.01m; // 昨日成交金额 row.Cells["colPay7"].Value = statistics.WxShopSaleInfo7Day.pay_gmv.ParseToNullableLong() * 0.01m; // 7日成交金额 row.Cells["colPay30"].Value = statistics.WxShopSaleInfo30Day.pay_gmv.ParseToNullableLong() * 0.01m; // 30日成交金额 row.Cells["colRefund"].Value = statistics.WxShopSaleInfoToday.pay_refund_gmv.ParseToNullableLong() * 0.01m; // 今日退款金额 + row.Cells["colRefund1"].Value = statistics.WxShopSaleInfo1Day.pay_refund_gmv.ParseToNullableLong() * 0.01m; // 昨日退款金额 row.Cells["colRefund7"].Value = statistics.WxShopSaleInfo7Day.pay_refund_gmv.ParseToNullableLong() * 0.01m; // 7日退款金额 row.Cells["colRefund30"].Value = statistics.WxShopSaleInfo30Day.pay_refund_gmv.ParseToNullableLong() * 0.01m; // 30日退款金额 row.Cells["colOrderNum"].Value = statistics.WxShopMainInfo.orderNumRet?.num; // 待发货 @@ -321,7 +347,8 @@ namespace TemuKJD.WXForms.ShopForms private void GetShopStatistics(ShopLoginInfo shop, WxShopSaleStatisticsGroup statistics) { - if (statistics == null || statistics.WxShopMainInfo == null || statistics.WxShopSaleInfoToday == null || statistics.WxShopSaleInfo7Day == null || statistics.WxShopSaleInfo30Day == null) + if (statistics == null || statistics.WxShopMainInfo == null || + statistics.WxShopSaleInfoToday == null || statistics.WxShopSaleInfo1Day == null || statistics.WxShopSaleInfo7Day == null || statistics.WxShopSaleInfo30Day == null) return; if (statistics.lastRefreshDate != DateTime.Now.Date && shop.LoginStatus == "登录成功") @@ -440,6 +467,40 @@ namespace TemuKJD.WXForms.ShopForms } } + if (statistics.WxShopSaleInfo1Day.LastRefreshDate != DateTime.Now.Date && shop.LoginStatus == "登录成功") + { + try + { + string html = GetShopSaleInfoList(shop, + BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now.Date.AddDays(-1)), + BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now.Date) - 1); + System.Threading.Thread.Sleep(Randomx.GetId(50, 100)); + if (html.Contains("\"code\":0")) + { + var saleStr = JsonHelper.SerializeObject(JsonHelper.JObjectParse(html)["total"]); + statistics.WxShopSaleInfo1Day = JsonHelper.DeserializeJsonToObject(saleStr); + statistics.WxShopSaleInfo1Day.LastRefreshDate = DateTime.Now.Date; + } + else + { + string errStr = BaseRegex.GetStringJson(ref html, "errorMsg"); + if (string.IsNullOrEmpty(errStr)) + errStr = BaseRegex.GetStringJson(ref html, "error_msg"); + if (string.IsNullOrEmpty(errStr)) + errStr = html; + WXShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false); + statistics.err_msg = errStr; + return; + } + } + catch (Exception ex) + { + System.Threading.Thread.Sleep(Randomx.GetId(50, 100)); + statistics.err_msg = ex.Message; + return; + } + } + if (statistics.WxShopSaleInfo7Day.LastRefreshDate != DateTime.Now.Date && shop.LoginStatus == "登录成功") { try @@ -689,6 +750,7 @@ namespace TemuKJD.WXForms.ShopForms { statistics.WxShopMainInfo.LastRefreshDate = DateTime.MinValue; statistics.WxShopSaleInfoToday.LastRefreshDate = DateTime.MinValue; + statistics.WxShopSaleInfo1Day.LastRefreshDate = DateTime.MinValue; statistics.WxShopSaleInfo7Day.LastRefreshDate = DateTime.MinValue; statistics.WxShopSaleInfo30Day.LastRefreshDate = DateTime.MinValue; } diff --git a/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.resx b/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.resx index 03223e8..b540f51 100644 --- a/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.resx +++ b/TEMUKJD/WXForms/ShopForms/WxShopStatisticsForm.resx @@ -150,6 +150,9 @@ True + + True + True @@ -159,6 +162,9 @@ True + + True + True @@ -168,6 +174,9 @@ True + + True + True