微信小店地址管理
This commit is contained in:
1 parent
0c5ebf421e
commit
5ac8eb2571
29 files changed
+1489
-378
No files matched your search
@@ -125,6 +125,7 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.colRBuyerId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colRBuyerName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colRAfterSaleId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colRPddOrderSn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colROrderDate = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -765,6 +766,7 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
this.dataGridViewCheckBoxColumn2,
|
||||
this.colRBuyerId,
|
||||
this.colRBuyerName,
|
||||
this.colRAfterSaleId,
|
||||
this.colRPddOrderSn,
|
||||
this.colROrderDate,
|
||||
this.dataGridViewTextBoxColumn5,
|
||||
@@ -1281,6 +1283,13 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
this.colRBuyerName.Name = "colRBuyerName";
|
||||
this.colRBuyerName.ReadOnly = true;
|
||||
//
|
||||
// colRAfterSaleId
|
||||
//
|
||||
this.colRAfterSaleId.FillWeight = 80F;
|
||||
this.colRAfterSaleId.HeaderText = "售后单号";
|
||||
this.colRAfterSaleId.Name = "colRAfterSaleId";
|
||||
this.colRAfterSaleId.ReadOnly = true;
|
||||
//
|
||||
// colRPddOrderSn
|
||||
//
|
||||
this.colRPddOrderSn.HeaderText = "拍单订单号";
|
||||
@@ -1483,6 +1492,7 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn2;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colRBuyerId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colRBuyerName;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colRAfterSaleId;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colRPddOrderSn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colROrderDate;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
|
||||
|
||||
@@ -229,8 +229,24 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
}
|
||||
else if (order.after_sales != null)
|
||||
{
|
||||
row.Cells["colOMsg"].Value = "[退货中]" + row.Cells["colOMsg"].Value.ParseToString();
|
||||
row.Cells["colOMsg"].Style.ForeColor = Color.DeepSkyBlue;
|
||||
if (order.order_sn == "260417-009038743070257")
|
||||
{
|
||||
//after_sales_id 20093344800098 after_sales_status 12 after_sales_type 2
|
||||
}
|
||||
if (order.order_sn == "260427-536315174430257")
|
||||
{
|
||||
|
||||
}
|
||||
if(order.after_sales.after_sales_status == 12 && order.after_sales.after_sales_type == 2)
|
||||
{
|
||||
row.Cells["colOMsg"].Value = "[退货失败]" + row.Cells["colOMsg"].Value.ParseToString();
|
||||
row.Cells["colOMsg"].Style.ForeColor = Color.SlateBlue;
|
||||
}
|
||||
else
|
||||
{
|
||||
row.Cells["colOMsg"].Value = "[退货中]" + row.Cells["colOMsg"].Value.ParseToString();
|
||||
row.Cells["colOMsg"].Style.ForeColor = Color.DeepSkyBlue;
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(order.wxRefundStatus))
|
||||
{
|
||||
@@ -255,6 +271,7 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
false,
|
||||
afterSale.buyerId,
|
||||
afterSale.buyerName,
|
||||
afterSale.afterSalesId,
|
||||
afterSale.orderSn,
|
||||
afterSale.orderDate,
|
||||
"", // 图片路径,
|
||||
@@ -276,6 +293,7 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
//row.Cells["colOSelect"].Value = selectIds.Contains(buyer.buyer_id);
|
||||
row.Cells["colRBuyerId"].Value = afterSale.buyerId;
|
||||
row.Cells["colRBuyerName"].Value = afterSale.buyerName;
|
||||
row.Cells["colRAfterSaleId"].Value = afterSale.afterSalesId;
|
||||
row.Cells["colRPddOrderSn"].Value = afterSale.orderSn;
|
||||
row.Cells["colROrderDate"].Value = afterSale.orderDate;
|
||||
//row.Cells["colOImgUrl"].Value = "";
|
||||
@@ -894,8 +912,14 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
left: 0,
|
||||
behavior: 'smooth' // 可选,使滚动平滑
|
||||
});";
|
||||
var t1 = cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr);
|
||||
t1.Wait(1000);
|
||||
//var t1 = cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr);
|
||||
//t1.Wait(1000);
|
||||
var client = cefWebBrowser.GetDevToolsClient();
|
||||
if (client != null)
|
||||
{
|
||||
var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||
result.Wait(5000);
|
||||
}
|
||||
}
|
||||
Thread.Sleep(Randomx.GetId(2000, 3000));
|
||||
|
||||
@@ -924,8 +948,14 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
left: 0,
|
||||
behavior: 'smooth' // 可选,使滚动平滑
|
||||
});";
|
||||
var t1 = cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr);
|
||||
t1.Wait(1000);
|
||||
//var t1 = cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr);
|
||||
//t1.Wait(1000);
|
||||
var client = cefWebBrowser.GetDevToolsClient();
|
||||
if (client != null)
|
||||
{
|
||||
var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||
result.Wait(5000);
|
||||
}
|
||||
}
|
||||
Thread.Sleep(Randomx.GetId(2000, 3000));
|
||||
|
||||
@@ -954,8 +984,14 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
left: 0,
|
||||
behavior: 'smooth' // 可选,使滚动平滑
|
||||
});";
|
||||
var t1 = cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr);
|
||||
t1.Wait(1000);
|
||||
//var t1 = cefWebBrowser.GetMainFrame().EvaluateScriptAsync(jsStr);
|
||||
//t1.Wait(1000);
|
||||
var client = cefWebBrowser.GetDevToolsClient();
|
||||
if (client != null)
|
||||
{
|
||||
var result = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||
result.Wait(5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -1312,7 +1348,11 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
}
|
||||
|
||||
ConcurrentList<PddBuyerOrderInfoLite> tempWaitOrderLst = new ConcurrentList<PddBuyerOrderInfoLite>();
|
||||
//bool isSendOrderE57 = false;
|
||||
/// <summary>
|
||||
/// 调用e57接口更新web端订单数据信息
|
||||
/// </summary>
|
||||
/// <param name="order"></param>
|
||||
/// <param name="resetSendStatus">手动强制重置状态,一定重新发送</param>
|
||||
public void SendOrderE57(PddBuyerOrderInfoLite order, bool resetSendStatus = false)
|
||||
{
|
||||
//if (resetSendStatus == true)
|
||||
@@ -1347,27 +1387,27 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
Thread.Sleep(100);
|
||||
|
||||
// 已发货且没有运单号的属于已退货,不再发送
|
||||
if (order.order_status_prompt != "拼单成功,待发货" && order.order_status_prompt != "免拼成功,待发货" && (
|
||||
order.order_status_prompt.Contains("交易成功") ||
|
||||
//order.order_status_prompt.Contains("退款成功") ||
|
||||
//order.after_sales != null ||
|
||||
order.order_status_prompt.Contains("交易已取消") ||
|
||||
string.IsNullOrEmpty(order.tracking_number) ||
|
||||
string.IsNullOrEmpty(order.outExpressCompanyCode)))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ShowOrder(order);
|
||||
}));
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||
return;
|
||||
}
|
||||
// 外采订单已发货的订单不再尝试发货
|
||||
//if (order.sendStatus == "已发送")
|
||||
//if (order.order_status_prompt != "拼单成功,待发货" && order.order_status_prompt != "免拼成功,待发货" && (
|
||||
// order.order_status_prompt.Contains("交易成功") ||
|
||||
// order.order_status_prompt.Contains("退款成功") ||
|
||||
// order.after_sales != null ||
|
||||
// order.order_status_prompt.Contains("交易已取消") ||
|
||||
// string.IsNullOrEmpty(order.tracking_number) ||
|
||||
// string.IsNullOrEmpty(order.outExpressCompanyCode)))
|
||||
//{
|
||||
// Invoke(new Action(() =>
|
||||
// {
|
||||
// ShowOrder(order);
|
||||
// }));
|
||||
// NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||
// return;
|
||||
// 微信发货成功,外采订单已发货, orderNo:260429-064214802032823
|
||||
// 外采订单已发货, orderNo:260429-438189442672823
|
||||
if (order.sendStatus.Contains("外采订单已发货") || order.sendStatus.Contains("更新外采订单微信发货成功"))
|
||||
//}
|
||||
// 外采订单已发货的订单不再尝试发货
|
||||
// 已存在 同运单号拦截 订单已绑定外采订单 -- 原提示词
|
||||
// 微信发货成功,外采订单已发货, orderNo:260429-064214802032823 | 外采订单已发货, orderNo:260429-438189442672823 -- 新提示词
|
||||
if (order.sendStatus.Contains("外采订单已发货") || order.sendStatus.Contains("微信发货成功") ||
|
||||
order.sendStatus.Contains("已发送待发货订单") || order.sendStatus.Contains("接收成功") ||
|
||||
order.sendStatus.Contains("已发送售后订单"))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
@@ -1389,12 +1429,15 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
var dataStr = JsonHelper.SerializeObject(obj);
|
||||
string url = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/bind";
|
||||
//成功 "<ResultVo><code>0</code><msg>SUCCESS</msg><data/><totalRecords/></ResultVo>"
|
||||
//失败 已存在
|
||||
//<ResultVo><code>1505</code><msg>调用微信接口更新物流信息失败: 非法参数, 同运单号拦截 rid: 69d8ab9c-22baa3b1-67de0d95</msg><data/><totalRecords/></ResultVo>
|
||||
//失败 已存在 <ResultVo><code>1505</code><msg>调用微信接口更新物流信息失败: 非法参数, 同运单号拦截 rid: 69d8ab9c-22baa3b1-67de0d95</msg><data/><totalRecords/></ResultVo>
|
||||
var exportRst = WXHttpResponseBLL.e57PostResponse(url, dataStr, "");
|
||||
for (int i = 0; i < 5 && exportRst.Contains("操作超时"); i++)
|
||||
if (exportRst == null)
|
||||
{
|
||||
Thread.Sleep(10000);
|
||||
|
||||
}
|
||||
for (int i = 0; i < 3 && exportRst.Contains("操作超时") && resetSendStatus == false; i++)
|
||||
{
|
||||
Thread.Sleep(210000);
|
||||
WXHttpResponseBLL.e57PostResponse(url, dataStr, "");
|
||||
}
|
||||
if (exportRst.Contains("操作超时"))
|
||||
@@ -1407,7 +1450,6 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
}));
|
||||
return;
|
||||
}
|
||||
// exportRst.Contains("已存在") || exportRst.Contains("同运单号拦截") || exportRst.Contains("订单已绑定外采订单")
|
||||
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
|
||||
string msg = "";
|
||||
string data = "";
|
||||
@@ -1415,21 +1457,33 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
try
|
||||
{
|
||||
xmlDoc.LoadXml(exportRst); //<ResultVo><code>1505</code><msg>不支持的平台类型: WEISHOP</msg><data/><totalRecords/></ResultVo>
|
||||
msg = xmlDoc["ResultVo"]["msg"].InnerText;
|
||||
data = xmlDoc["ResultVo"]["data"].InnerText;
|
||||
code = xmlDoc["ResultVo"]["code"].InnerText;
|
||||
code = xmlDoc["AjaxResult"]["code"].InnerText;
|
||||
msg = xmlDoc["AjaxResult"]["msg"].InnerText;
|
||||
//data = xmlDoc["AjaxResult"]["data"].InnerText;
|
||||
|
||||
// <AjaxResult><msg>更新微信外采订单信息成功, orderNo:260430-306551232030257</msg><code>1</code></AjaxResult>
|
||||
}
|
||||
catch
|
||||
{
|
||||
msg = exportRst.ParseToString();
|
||||
}
|
||||
if (code == "0" || msg == "SUCCESS") //if (msg == "SUCCESS")
|
||||
if (code == "0" || code == "1") //if (msg == "SUCCESS") // || msg == "SUCCESS"
|
||||
{
|
||||
order.sendStatus = string.IsNullOrEmpty(data) ? msg : data;
|
||||
if (order.sendStatus == "更新微信外采订单状态成功")
|
||||
order.sendStatus = "已发送";
|
||||
if (order.sendStatus == "处理完成" || order.sendStatus == "快递公司和快递单号必须同时提供或同时为空")
|
||||
order.sendStatus = "已发送完成";
|
||||
var sendStatusTmp = string.IsNullOrEmpty(data) ? msg : data;
|
||||
order.sendStatus = sendStatusTmp;
|
||||
|
||||
if (code == "0" && !order.sendStatus.Contains("微信发货成功"))
|
||||
order.sendStatus = ("微信发货成功 " + sendStatusTmp).Trim();
|
||||
if (code == "1" && !order.sendStatus.Contains("接收成功"))
|
||||
order.sendStatus = ("接收成功 " + sendStatusTmp).Trim();
|
||||
|
||||
// 处理特殊情况 如未发货或退货订单
|
||||
//if (order.sendStatus == "处理完成" || order.sendStatus == "快递公司和快递单号必须同时提供或同时为空")
|
||||
// order.sendStatus = "已发送完成";
|
||||
if (order.order_status_prompt.Contains("待发货")) // 更新微信外采订单状态成功
|
||||
order.sendStatus = "已发送待发货订单";
|
||||
if (order.after_sales != null)
|
||||
order.sendStatus = "已发送售后订单 " + sendStatusTmp;
|
||||
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order_list", lstPddBuyerOrderInfoLite);
|
||||
}
|
||||
else
|
||||
@@ -1599,9 +1653,9 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
//失败 已存在
|
||||
//<ResultVo><code>1505</code><msg>调用微信接口更新物流信息失败: 非法参数, 同运单号拦截 rid: 69d8ab9c-22baa3b1-67de0d95</msg><data/><totalRecords/></ResultVo>
|
||||
var exportRst = WXHttpResponseBLL.e57PostResponse(url, dataStr, "");
|
||||
for (int i = 0; i < 5 && exportRst.Contains("操作超时"); i++)
|
||||
for (int i = 0; i < 3 && exportRst.Contains("操作超时"); i++)
|
||||
{
|
||||
Thread.Sleep(5000);
|
||||
Thread.Sleep(210000);
|
||||
WXHttpResponseBLL.e57PostResponse(url, dataStr, "");
|
||||
}
|
||||
|
||||
@@ -1679,8 +1733,8 @@ namespace TemuKJD.WXForms.TalkForms
|
||||
{
|
||||
if (row.Cells["colRPddOrderSn"].Value.ParseToString().Contains(txtOrderSnFilter.Text.Trim()))
|
||||
row.Visible = true;
|
||||
//else if (row.Cells["colOBuyerName"].Value.ParseToString().Contains(txtOrderSnFilter.Text.Trim()))
|
||||
// row.Visible = true;
|
||||
else if (row.Cells["colRAfterSaleId"].Value.ParseToString().Contains(txtOrderSnFilter.Text.Trim()))
|
||||
row.Visible = true;
|
||||
else
|
||||
row.Visible = false;
|
||||
}
|
||||
|
||||
@@ -183,6 +183,9 @@
|
||||
<metadata name="colRBuyerName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colRAfterSaleId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colRPddOrderSn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
||||
Reference in new issue
Block a user