微店模拟接口 其他一些功能优化
This commit is contained in:
1 parent
dc6f981a34
commit
cafdbbd95d
20 files changed
+2343
-103
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
// 待发货
|
||||
|
||||
Reference in new issue
Block a user