微店模拟接口 其他一些功能优化

This commit is contained in:
wule_5900x committed 2026-04-12 11:12:27 +08:00
1 parent dc6f981a34
commit cafdbbd95d
20 files changed
+2343 -103

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TemuKJD.BLL.VDian
{
public class MappingVDianApiBLL
{
public static string GetFormattedImgFileName(string oldName)
{
if (oldName == null)
return "";
var imgStr = oldName;
if (imgStr.EndsWith(".src"))
imgStr = imgStr.Substring(0, imgStr.Length - 4);
if (imgStr.Contains("@"))
imgStr = imgStr.Substring(0, imgStr.LastIndexOf("@")); //omsproductionimg.yangkeduo.com/images/2017-12-06/c5286b86a0ef6a982dcabbdf517a7d55.jpeg@750w_1l_50Q.src
if (imgStr.Contains("?") && !imgStr.ToLower().EndsWith(".jpg") && !imgStr.ToLower().EndsWith(".jpeg") && !imgStr.ToLower().EndsWith(".bmp")
&& !imgStr.ToLower().EndsWith(".png") && !imgStr.ToLower().EndsWith(".ss2") && !imgStr.ToLower().EndsWith(".gif"))
imgStr = imgStr.Substring(0, imgStr.LastIndexOf("?"));
if (!imgStr.StartsWith("http"))
imgStr = "https://" + imgStr.TrimStart('/');
if (!imgStr.ToLower().EndsWith(".jpg") && !imgStr.ToLower().EndsWith(".jpeg") && !imgStr.ToLower().EndsWith(".png") && !imgStr.ToLower().EndsWith(".bmp")
&& !imgStr.ToLower().EndsWith(".ss2") && !imgStr.ToLower().EndsWith(".gif"))
{
if (imgStr.Contains("gw.alicdn.com"))
return imgStr;
return "";
}
return imgStr;
}
}
}
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -129,6 +129,8 @@
<Compile Include="BLL\PDDProdFormConverter.cs" />
<Compile Include="BLL\ProductSelectBLL.cs" />
<Compile Include="BLL\Tools\DownloadBLL.cs" />
<Compile Include="BLL\VDian\MappingVDianApiBLL.cs" />
<Compile Include="BLL\VDian\MappingVDianBLL.cs" />
<Compile Include="BLL\WxApiBLL.cs" />
<Compile Include="BLL\YkdHttpResponseBLL.cs" />
<Compile Include="BLL\WXHttpResponseBLL.cs" />
@@ -1793,9 +1795,7 @@
<Name>Work</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="WeiDianForms\" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.2">
<Visible>False</Visible>
@@ -379,7 +379,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
List<string> fileNameLst = new List<string>();
string tempImgPath = Path.GetTempPath().Trim('\\') + "\\" + Randomx.GetWordNumber(8).ToLower();
string tempImgPath = Path.GetTempPath().Trim('\\') + "\\" + Randomx.GetWordWithNumber(8).ToLower();
if (!Directory.Exists(tempImgPath))
Directory.CreateDirectory(tempImgPath);
var imgUrlLst = this.txtImgUrl.Text.Split(new string[] { "\r", "\n", ";", " " }, StringSplitOptions.RemoveEmptyEntries);
@@ -30,15 +30,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnSelectNotGetDetail = new DevComponents.DotNetBar.PanelEx();
this.cmbFilterType = new System.Windows.Forms.ComboBox();
this.btnFilter = new DevComponents.DotNetBar.PanelEx();
this.txtFilter = new System.Windows.Forms.TextBox();
@@ -105,7 +106,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.chk = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.btnSelectNotGetDetail = new DevComponents.DotNetBar.PanelEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -197,17 +197,42 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucGroupBoxEx1.TabStop = false;
this.ucGroupBoxEx1.Text = "操作";
//
// btnSelectNotGetDetail
//
this.btnSelectNotGetDetail.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSelectNotGetDetail.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSelectNotGetDetail.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSelectNotGetDetail.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSelectNotGetDetail.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSelectNotGetDetail.Location = new System.Drawing.Point(1125, 30);
this.btnSelectNotGetDetail.Name = "btnSelectNotGetDetail";
this.btnSelectNotGetDetail.Size = new System.Drawing.Size(153, 25);
this.btnSelectNotGetDetail.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSelectNotGetDetail.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSelectNotGetDetail.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSelectNotGetDetail.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnSelectNotGetDetail.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnSelectNotGetDetail.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnSelectNotGetDetail.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnSelectNotGetDetail.Style.GradientAngle = 90;
this.btnSelectNotGetDetail.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSelectNotGetDetail.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSelectNotGetDetail.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSelectNotGetDetail.TabIndex = 790;
this.btnSelectNotGetDetail.Text = "一键勾选未采集详情商品";
this.btnSelectNotGetDetail.Click += new System.EventHandler(this.btnSelectNotGetDetail_Click);
//
// cmbFilterType
//
this.cmbFilterType.FormattingEnabled = true;
this.cmbFilterType.Items.AddRange(new object[] {
"过滤所有字段",
"过滤标题+SKU",
"过滤标题"});
this.cmbFilterType.Location = new System.Drawing.Point(987, 58);
this.cmbFilterType.Name = "cmbFilterType";
this.cmbFilterType.Size = new System.Drawing.Size(102, 25);
this.cmbFilterType.Size = new System.Drawing.Size(108, 25);
this.cmbFilterType.TabIndex = 1012;
this.cmbFilterType.Text = "过滤所有字段";
this.cmbFilterType.Text = "过滤标题+SKU";
//
// btnFilter
//
@@ -217,7 +242,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnFilter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnFilter.Location = new System.Drawing.Point(987, 30);
this.btnFilter.Name = "btnFilter";
this.btnFilter.Size = new System.Drawing.Size(102, 25);
this.btnFilter.Size = new System.Drawing.Size(108, 25);
this.btnFilter.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnFilter.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnFilter.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
@@ -761,19 +786,19 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle15.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle15;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvShop.AutoRowNumber = true;
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle16.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle16.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle16.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle16;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
@@ -894,20 +919,20 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.dgvChanceProduct.AllowUserToAddRows = false;
this.dgvChanceProduct.AllowUserToDeleteRows = false;
dataGridViewCellStyle17.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvChanceProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle17;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvChanceProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
this.dgvChanceProduct.AutoRowNumber = true;
this.dgvChanceProduct.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvChanceProduct.BackgroundColor = System.Drawing.Color.White;
this.dgvChanceProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle18.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle18.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle18.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle18.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvChanceProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvChanceProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.dgvChanceProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvChanceProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCheck,
@@ -966,8 +991,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colGoodsName
//
dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colGoodsName.DefaultCellStyle = dataGridViewCellStyle19;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colGoodsName.DefaultCellStyle = dataGridViewCellStyle5;
this.colGoodsName.FillWeight = 120F;
this.colGoodsName.HeaderText = "商品名称";
this.colGoodsName.Name = "colGoodsName";
@@ -988,8 +1013,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colPrice
//
dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colPrice.DefaultCellStyle = dataGridViewCellStyle20;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colPrice.DefaultCellStyle = dataGridViewCellStyle6;
this.colPrice.FillWeight = 70F;
this.colPrice.HeaderText = "价格";
this.colPrice.Name = "colPrice";
@@ -1004,8 +1029,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colMsg
//
dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colMsg.DefaultCellStyle = dataGridViewCellStyle21;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colMsg.DefaultCellStyle = dataGridViewCellStyle7;
this.colMsg.FillWeight = 200F;
this.colMsg.HeaderText = "操作结果";
this.colMsg.Name = "colMsg";
@@ -1051,31 +1076,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucSplitPage1.TotalPage = 1;
this.ucSplitPage1.PageChange += new System.Action<object>(this.ucSplitPage1_PageChange);
//
// btnSelectNotGetDetail
//
this.btnSelectNotGetDetail.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSelectNotGetDetail.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSelectNotGetDetail.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSelectNotGetDetail.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSelectNotGetDetail.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSelectNotGetDetail.Location = new System.Drawing.Point(1125, 30);
this.btnSelectNotGetDetail.Name = "btnSelectNotGetDetail";
this.btnSelectNotGetDetail.Size = new System.Drawing.Size(153, 25);
this.btnSelectNotGetDetail.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSelectNotGetDetail.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSelectNotGetDetail.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSelectNotGetDetail.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnSelectNotGetDetail.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnSelectNotGetDetail.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnSelectNotGetDetail.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnSelectNotGetDetail.Style.GradientAngle = 90;
this.btnSelectNotGetDetail.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSelectNotGetDetail.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSelectNotGetDetail.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSelectNotGetDetail.TabIndex = 790;
this.btnSelectNotGetDetail.Text = "一键勾选未采集详情商品";
this.btnSelectNotGetDetail.Click += new System.EventHandler(this.btnSelectNotGetDetail_Click);
//
// PDDGetChanceProdForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1026,23 +1026,79 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void btnFilter_Click(object sender, EventArgs e)
{
var filters = txtFilter.Text.Trim().Split(new string[] { ",", ",", " ", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
var filters = txtFilter.Text.Trim().Split(new string[] { ",", ",", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
// 含敏感词商品
List<ChanceProductResult> filterChanceProdLst = null;
List<ChanceProductResult> filterChanceProdLst = new List<ChanceProductResult>();
if (cmbFilterType.Text.Trim() == "过滤标题")
filterChanceProdLst = lstChanceProductResult.Where(p => filters
.Any(f => (p?.dbProduct?.product_name).ParseToString().Contains(f) || (p?.keywords).ParseToString().Contains(f))).ToList();
{
foreach(var chance in lstChanceProductResult)
{
if (filters.Any(f => chance.keywords.Contains(f)))
filterChanceProdLst.Add(chance);
if (filters.Any(f => (chance?.dbProduct?.product_name).ParseToString().Contains(f)))
filterChanceProdLst.Add(chance);
var prodInfo = JsonHelper.DeserializeJsonToObjectNullable<PDDProductInfo>(chance?.dbProduct?.product_json);
if (prodInfo == null)
continue;
try
{
if (filters.Any(f => prodInfo.detail.tiny_name.ParseToString().Contains(f)))
filterChanceProdLst.Add(chance);
if (filters.Any(f => prodInfo.detail.goods_desc.ParseToString().Contains(f)))
filterChanceProdLst.Add(chance);
if (filters.Any(f => prodInfo.detail.share_desc.ParseToString().Contains(f)))
filterChanceProdLst.Add(chance);
}
catch
{
}
}
}
else
filterChanceProdLst = lstChanceProductResult.Where(p => filters.Any(f => JsonHelper.SerializeObject(p).Contains(f))).ToList();
{
foreach (var chance in lstChanceProductResult)
{
if (filters.Any(f => chance.keywords.Contains(f)))
filterChanceProdLst.Add(chance);
if (filters.Any(f => (chance?.dbProduct?.product_name).ParseToString().Contains(f)))
filterChanceProdLst.Add(chance);
var prodInfo = JsonHelper.DeserializeJsonToObjectNullable<PDDProductInfo>(chance?.dbProduct?.product_json);
if (prodInfo == null)
continue;
try
{
if (filters.Any(f => prodInfo.detail.tiny_name.ParseToString().Contains(f)))
filterChanceProdLst.Add(chance);
if (filters.Any(f => prodInfo.detail.goods_desc.ParseToString().Contains(f)))
filterChanceProdLst.Add(chance);
if (filters.Any(f => prodInfo.detail.share_desc.ParseToString().Contains(f)))
filterChanceProdLst.Add(chance);
foreach (var skuInfo in prodInfo.detail.sku)
{
foreach(var specInfo in skuInfo.spec)
{
if (filters.Any(f => specInfo.spec_name.ParseToString().Contains(f)))
filterChanceProdLst.Add(chance);
}
}
}
catch
{
}
}
}
foreach (var chanceProd in filterChanceProdLst)
{
var row = dgvChanceProduct.Rows.Cast<DataGridViewRow>().ToList().FirstOrDefault(r => r.Cells["colChanceId"].Value.ParseToString() == chanceProd.chance_id);
lstChanceProductResult.Remove(chanceProd);
dgvChanceProduct.Rows.Remove(row);
var row = dgvChanceProduct.Rows.Cast<DataGridViewRow>().ToList().FirstOrDefault(r => r.Cells["colChanceId"].Value.ParseToString() == chanceProd.chance_id);
if (row != null)
dgvChanceProduct.Rows.Remove(row);
}
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_chance_product_list_" + MainForm.ProcessCount, lstChanceProductResult);
//NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_chance_product_list_" + MainForm.ProcessCount, lstChanceProductResult);
}
private void btnSelectNotGetDetail_Click(object sender, EventArgs e)
@@ -1988,7 +1988,7 @@ namespace TemuKJD.WXForms.ProductForms
//-------------------------------------------------------------------------------------------------------------------------------------
// ai识别类目暂存主图位置
int imgId = 0;
string tempImgPath = Path.GetTempPath().Trim('\\') + "\\" + Randomx.GetWordNumber(8).ToLower();
string tempImgPath = Path.GetTempPath().Trim('\\') + "\\" + Randomx.GetWordWithNumber(8).ToLower();
List<string> tempImgFullPathLst = new List<string>();
//-------------------------------------------------------------------------------------------------------------------------------------
// 生成ai识别类目所需图片
@@ -3391,7 +3391,7 @@ namespace TemuKJD.WXForms.ProductForms
}
}
}
if (!prodInfo.detail.sku.Any(s => s.quantity.ParseToInt() > 0))
if (dbProd.product_get_type_text == "厂商直采" && !prodInfo.detail.sku.Any(s => s.quantity.ParseToInt() > 0))
{
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"源商品库存为0\"}";
}
@@ -3440,7 +3440,8 @@ namespace TemuKJD.WXForms.ProductForms
skuParam.skuKey.productKey.outProductId = upProdParam.product.info.spuCode;
// 库存
skuParam.productSkuInfo.stockInfo = new stockInfoParam() { stockNum = defaultAddPriceRule.StockNum };
if (skuInfo.quantity.ParseToInt() == 0)
// 厂商直采上家库存为0则按0上架
if (dbProd.product_get_type_text == "厂商直采" && skuInfo.quantity.ParseToInt() == 0)
skuParam.productSkuInfo.stockInfo.stockNum = 0;
skuParam.productSkuInfo.saleParam = new List<saleParamParam>();
foreach (var specInfo in skuInfo.spec)
@@ -3961,7 +3962,7 @@ namespace TemuKJD.WXForms.ProductForms
// 提交免审修改(实际生效接口)
var listingAuditFreeRst = WXUpload.listingAuditFree(shop, productJson, upProdParam.product.productKey.productId, time1, time2);
string tempBlobPath = Path.GetTempPath().Trim('\\') + "\\" + Randomx.GetWordNumber(8).ToLower();
string tempBlobPath = Path.GetTempPath().Trim('\\') + "\\" + Randomx.GetWordWithNumber(8).ToLower();
if (!Directory.Exists(tempBlobPath))
Directory.CreateDirectory(tempBlobPath);
string blobFullPath = tempBlobPath + "\\blob"; // C:\Users\Administrator\AppData\Local\Temp\3mer3k21\blob
+13 -11
View File
@@ -61,6 +61,7 @@ namespace TemuKJD.WXForms.TalkForms
dtpEndTime.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
dgvBuyer.AddSelectorColumn("colSelect");
InitCef();
lstPddBuyerOrderInfoLite = NaiBa.Util.Helper.ConfigHelper.LoadConfig<ConcurrentList<PddBuyerOrderInfoLite>> ("pdd_buyer_order");
if (lstPddBuyerOrderInfoLite == null)
@@ -267,6 +268,11 @@ namespace TemuKJD.WXForms.TalkForms
order = this.lstPddBuyerOrderInfoLite.FirstOrDefault(or => or.order_sn == o.order_sn);
if (JsonHelper.SerializeObject(order) != JsonHelper.SerializeObject(o))
{
if(order.order_status_prompt.Contains("待发货") && !o.order_status_prompt.Contains("待发货"))
{
order.sendStatus = "";
}
//order = JsonHelper.DeserializeJsonToObject<PddBuyerOrderInfoLite>(JsonHelper.SerializeObject(o));
order.activity_type = o.activity_type;
order.discount_amount = o.discount_amount;
@@ -490,16 +496,9 @@ namespace TemuKJD.WXForms.TalkForms
try
{
if (cefWebBrowser == null)
while (cefWebBrowser == null || !cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid)
{
Invoke(new Action(() =>
{
InitCef();
}));
while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid)
{
Thread.Sleep(1);
}
Thread.Sleep(1);
}
CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null));
@@ -875,7 +874,7 @@ namespace TemuKJD.WXForms.TalkForms
case "发送":
Task.Run(() =>
{
SendOrderE57(order);
SendOrderE57(order, true);
});
break;
case "图片":
@@ -891,8 +890,11 @@ namespace TemuKJD.WXForms.TalkForms
}
}
public void SendOrderE57(PddBuyerOrderInfoLite order)
public void SendOrderE57(PddBuyerOrderInfoLite order, bool resetSendStatus = false)
{
if (resetSendStatus)
order.sendStatus = "";
if (order.sendStatus == "已发送")
{
return;
+21 -3
View File
@@ -86,6 +86,7 @@ namespace TemuKJD.WXForms.TalkForms
this.btnPrev = new DevComponents.DotNetBar.PanelEx();
this.txtAddress = new System.Windows.Forms.TextBox();
this.pnlTalk = new System.Windows.Forms.Panel();
this.textBox1 = new System.Windows.Forms.TextBox();
this.lblAutoReplyStatus = new System.Windows.Forms.Label();
this.chkShowAutoReplyNum = new System.Windows.Forms.CheckBox();
this.chkShowShopStatistics = new System.Windows.Forms.CheckBox();
@@ -136,7 +137,7 @@ namespace TemuKJD.WXForms.TalkForms
// lblVersionName
//
this.lblVersionName.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblVersionName.Location = new System.Drawing.Point(32229, 33);
this.lblVersionName.Location = new System.Drawing.Point(32767, 33);
//
// panel3
//
@@ -951,6 +952,7 @@ namespace TemuKJD.WXForms.TalkForms
//
// pnlTalk
//
this.pnlTalk.Controls.Add(this.textBox1);
this.pnlTalk.Controls.Add(this.lblAutoReplyStatus);
this.pnlTalk.Controls.Add(this.chkShowAutoReplyNum);
this.pnlTalk.Controls.Add(this.chkShowShopStatistics);
@@ -962,16 +964,31 @@ namespace TemuKJD.WXForms.TalkForms
this.pnlTalk.Size = new System.Drawing.Size(985, 544);
this.pnlTalk.TabIndex = 1;
//
// textBox1
//
this.textBox1.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.textBox1.Location = new System.Drawing.Point(356, 61);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textBox1.Size = new System.Drawing.Size(555, 422);
this.textBox1.TabIndex = 208;
this.textBox1.Visible = false;
//
// lblAutoReplyStatus
//
this.lblAutoReplyStatus.AutoSize = true;
this.lblAutoReplyStatus.Dock = System.Windows.Forms.DockStyle.Bottom;
this.lblAutoReplyStatus.Location = new System.Drawing.Point(0, 527);
this.lblAutoReplyStatus.Name = "lblAutoReplyStatus";
this.lblAutoReplyStatus.Size = new System.Drawing.Size(43, 17);
this.lblAutoReplyStatus.Size = new System.Drawing.Size(116, 17);
this.lblAutoReplyStatus.TabIndex = 207;
this.lblAutoReplyStatus.Text = "label5";
this.lblAutoReplyStatus.Text = "lblAutoReplyStatus";
this.lblAutoReplyStatus.Visible = false;
this.lblAutoReplyStatus.Click += new System.EventHandler(this.lblAutoReplyStatus_Click);
this.lblAutoReplyStatus.DoubleClick += new System.EventHandler(this.lblAutoReplyStatus_DoubleClick);
//
// chkShowAutoReplyNum
//
@@ -1242,5 +1259,6 @@ namespace TemuKJD.WXForms.TalkForms
private System.Windows.Forms.Label lblProgress;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.Label lblAutoReplyStatus;
private System.Windows.Forms.TextBox textBox1;
}
}
+43 -3
View File
@@ -242,7 +242,12 @@ namespace TemuKJD.WXForms.TalkForms
if (chkIsAutoReply.Checked && 1==1)
{
Invoke(new Action(() => { lblAutoReplyStatus.Visible = true; lblAutoReplyStatus.Text = "自动回复中... " + DateTime.Now.ToString("HH:mm:ss"); }));
Invoke(new Action(() =>
{
lblAutoReplyStatus.Visible = true;
lblAutoReplyStatus.Text = "自动回复中... 待回复数:" +
lstAutoReplayParam.Select(rp => rp.nickName).Distinct().ToList().Count + "条 " + DateTime.Now.ToString("HH:mm:ss");
}));
if (lstAutoReplayParam.Count > 0)
{
@@ -281,7 +286,11 @@ namespace TemuKJD.WXForms.TalkForms
if (response1.Result.Result.ParseToString() != "success")
{
Thread.Sleep(Randomx.GetId(500, 1000));
Invoke(new Action(() => { lblAutoReplyStatus.Text = "当前用户获取失败,尝试获取全部用户 " + DateTime.Now.ToString("HH:mm:ss"); }));
Invoke(new Action(() =>
{
lblAutoReplyStatus.Text = "当前用户获取失败,尝试获取全部用户 待回复数:" +
lstAutoReplayParam.Select(rp => rp.nickName).Distinct().ToList().Count + "条 " + DateTime.Now.ToString("HH:mm:ss");
}));
var jsStr2 = @"function clickAllUser() {
var users = document.getElementsByClassName('tab-list-item');
for (i=0; i<users.length; i++) {
@@ -354,7 +363,11 @@ namespace TemuKJD.WXForms.TalkForms
row.Cells["colAutoReplyCount"].Value = AutoReplyCount;
}));
}
Invoke(new Action(() => { lblAutoReplyStatus.Text = autoReplayParam.shopId + " 已尝试发送自动回复 " + DateTime.Now.ToString("HH:mm:ss"); }));
Invoke(new Action(() =>
{
lblAutoReplyStatus.Text = autoReplayParam.shopId + " 已尝试发送自动回复 待回复数:" +
lstAutoReplayParam.Select(rp => rp.nickName).Distinct().ToList().Count + "条 " + DateTime.Now.ToString("HH:mm:ss");
}));
Thread.Sleep(Randomx.GetId(500, 600));
}
}
@@ -377,6 +390,32 @@ namespace TemuKJD.WXForms.TalkForms
//_1688AddressForm.Show();
}
private void lblAutoReplyStatus_Click(object sender, EventArgs e)
{
}
int isDbClick = 0;
private void lblAutoReplyStatus_DoubleClick(object sender, EventArgs e)
{
isDbClick++;
Task.Run(() =>
{
Thread.Sleep(5000);
if (isDbClick > 0)
isDbClick--;
});
if (textBox1.Visible == true)
textBox1.Visible = false;
if (isDbClick > 3)
{
isDbClick = 0;
textBox1.Visible = true;
textBox1.Text = JsonHelper.SerializeObject(lstAutoReplayParam);
}
}
void InitOrderForm()
{
@@ -1850,6 +1889,7 @@ namespace TemuKJD.WXForms.TalkForms
//订单编号###亲,您的这笔订单已核实,请问是遇到什么问题了呢?
//退款成功###亲,您的退款已办理成功,欢迎下次光临哦!";
//https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/list/cgi/orderSearch?token=&lang=zh_CN
//https://store.weixin.qq.com/shop/order/list
// 待发货