记录关联商品所有sku并可以快速关联
This commit is contained in:
1 parent
66f1381950
commit
d77ec5cc2e
9 files changed
+460
-3927
No files matched your search
@@ -1387,7 +1387,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
|
||||
Thread.Sleep(100);
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
if (buyer.wpf_browser != null)
|
||||
if (buyer.wpf_browser != null && buyer.wpf_browser.IsBrowserInitialized)
|
||||
{
|
||||
var frame = buyer.wpf_browser.GetBrowser().MainFrame;
|
||||
isInitial = buyer.wpf_browser != null && buyer.wpf_browser.IsBrowserInitialized && frame.IsValid;
|
||||
|
||||
@@ -302,24 +302,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
var pddBuyerAfterSales = GetPddBuyerAfterSales(order_ids);
|
||||
|
||||
// 读取关联拍单商品
|
||||
var urlMap = BaseClass.Build29WxObjString("order/wx_get_buy_prod_map");
|
||||
var dataMap = UserLogin.GetSignaturex()
|
||||
+ "&spu_codes=" + string.Join(",", orderItems.Select(oi => GetHtml.UrlEncodeUtf8(oi.out_product_id))) + "," + string.Join(",", orderItems.Select(oi => oi.product_id));
|
||||
dataMap += "&main_user_name=" + BaseClass.MainUserName;
|
||||
var resultMap = GetHtml.PostUtf8(urlMap, dataMap);
|
||||
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
|
||||
resultMap = GetHtml.PostUtf8(urlMap, dataMap);
|
||||
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("订单读取失败 " + BaseRegex.GetStringJson(ref resultMap, "msg"));
|
||||
}));
|
||||
break;
|
||||
}
|
||||
List<WXBuyMapInfo> byuMapList = new List<WXBuyMapInfo>();
|
||||
try { byuMapList = JsonHelper.DeserializeJsonToList<WXBuyMapInfo>(JObject.Parse(resultMap)["data"].ParseToString()); } catch { }
|
||||
var buyMapList = GetBuyProdMap(orderItems);
|
||||
|
||||
var buyMapSkusList = GetBuyProdMapSkus(orderItems);
|
||||
|
||||
// 装载订单
|
||||
foreach (JObject jObj in jArr)
|
||||
@@ -347,14 +332,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// 关联拍单关系 // 危险物品禁止拍单,仅关联安全商品
|
||||
//if (!GlobalConfig.lstDangerItemWord.Any(d => (item.title).ParseToString().Contains(d)))
|
||||
{
|
||||
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
|
||||
item.BuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
|
||||
if (item.BuyMap == null)
|
||||
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
|
||||
item.BuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
|
||||
if (item.BuyMap == null)
|
||||
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
|
||||
item.BuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
|
||||
if (item.BuyMap == null)
|
||||
item.BuyMap = byuMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
|
||||
item.BuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
|
||||
}
|
||||
item.BuyMapSkus = buyMapSkusList.Where(s => s.spu_code == item.out_product_id || s.spu_code == item.product_id).OrderByDescending(s => s.mdy_time).ToList();
|
||||
|
||||
// 中转仓订单
|
||||
if (item.ItemOrder.orderItems.Count > 1)
|
||||
@@ -696,6 +682,87 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
return new List<order_pdd_buyer_after_sale>();
|
||||
}
|
||||
|
||||
public static List<WXBuyMapInfo> GetBuyProdMap(List<oms_wei_order_item_info> orderItems)
|
||||
{
|
||||
//foreach (var item in orderItems.ToList())
|
||||
//{
|
||||
// var buyMap = GlobalConfig.BuyMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
|
||||
// if (buyMap == null)
|
||||
// buyMap = GlobalConfig.BuyMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
|
||||
// if (buyMap == null)
|
||||
// buyMap = GlobalConfig.BuyMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
|
||||
// if (buyMap == null)
|
||||
// buyMap = GlobalConfig.BuyMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
|
||||
|
||||
// if (buyMap != null)
|
||||
// orderItems.Remove(item);
|
||||
//}
|
||||
if (orderItems == null || orderItems.Count == 0)
|
||||
{
|
||||
return GlobalConfig.BuyMapList.Where(m => orderItems.Any(oi => m.spu_code == oi.out_product_id || m.spu_code == oi.product_id)).ToList();
|
||||
}
|
||||
|
||||
var urlMap = BaseClass.Build29WxObjString("order/wx_get_buy_prod_map");
|
||||
var dataMap = UserLogin.GetSignaturex()
|
||||
+ "&spu_codes=" + string.Join(",", orderItems.Select(oi => GetHtml.UrlEncodeUtf8(oi.out_product_id))) + "," + string.Join(",", orderItems.Select(oi => oi.product_id));
|
||||
dataMap += "&main_user_name=" + BaseClass.MainUserName;
|
||||
var resultMap = GetHtml.PostUtf8(urlMap, dataMap);
|
||||
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
|
||||
resultMap = GetHtml.PostUtf8(urlMap, dataMap);
|
||||
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单关联读取失败 " + BaseRegex.GetStringJson(ref resultMap, "msg"), "Error", 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
var buyMapList = JsonHelper.DeserializeJsonToList<WXBuyMapInfo>(JObject.Parse(resultMap)["data"].ParseToString());
|
||||
buyMapList = buyMapList.Where(b => !GlobalConfig.BuyMapList.Any(m => m.sku_code == b.sku_code && m.spu_code == b.spu_code)).ToList();
|
||||
GlobalConfig.BuyMapList.AddRange(buyMapList);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
return GlobalConfig.BuyMapList.Where(m => orderItems.Any(oi => m.spu_code == oi.out_product_id || m.spu_code == oi.product_id)).ToList();
|
||||
}
|
||||
|
||||
public static List<WXBuyMapSkusInfo> GetBuyProdMapSkus(List<oms_wei_order_item_info> orderItems)
|
||||
{
|
||||
//orderItems.RemoveAll(oi => GlobalConfig.BuyMapSkusList.Any(m => m.spu_code == oi.out_product_id || m.spu_code == oi.product_id));
|
||||
if (orderItems == null || orderItems.Count == 0)
|
||||
{
|
||||
return GlobalConfig.BuyMapSkusList.Where(m => orderItems.Any(oi => m.spu_code == oi.out_product_id || m.spu_code == oi.product_id)).ToList();
|
||||
}
|
||||
|
||||
var url = BaseClass.Build29WxObjString("order/wx_get_buy_pord_map_skus");
|
||||
var dataMap = UserLogin.GetSignaturex()
|
||||
+ "&spu_codes=" + string.Join(",", orderItems.Select(oi => GetHtml.UrlEncodeUtf8(oi.out_product_id))) + "," + string.Join(",", orderItems.Select(oi => oi.product_id));
|
||||
dataMap += "&main_user_name=" + BaseClass.MainUserName;
|
||||
var resultSkusMap = GetHtml.PostUtf8(url, dataMap);
|
||||
if (string.IsNullOrEmpty(resultSkusMap) || !resultSkusMap.Contains("\"code\":200"))
|
||||
{
|
||||
resultSkusMap = GetHtml.PostUtf8(url, dataMap);
|
||||
}
|
||||
if (string.IsNullOrEmpty(resultSkusMap) || !resultSkusMap.Contains("\"code\":200"))
|
||||
{
|
||||
BaseMsgWindow.ShowAnimateMessage("订单关联列表读取失败 " + BaseRegex.GetStringJson(ref resultSkusMap, "msg"), "Error", 5);
|
||||
return new List<WXBuyMapSkusInfo>();
|
||||
}
|
||||
try
|
||||
{
|
||||
var buyMapSkusList = JsonHelper.DeserializeJsonToList<WXBuyMapSkusInfo>(JObject.Parse(resultSkusMap)["data"].ParseToString());
|
||||
buyMapSkusList = buyMapSkusList.Where(b => !GlobalConfig.BuyMapSkusList.Any(m => m.map_goods_id == b.map_goods_id)).ToList();
|
||||
GlobalConfig.BuyMapSkusList.AddRange(buyMapSkusList);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new List<WXBuyMapSkusInfo>();
|
||||
}
|
||||
return GlobalConfig.BuyMapSkusList.Where(m => orderItems.Any(oi => m.spu_code == oi.out_product_id || m.spu_code == oi.product_id)).ToList();
|
||||
}
|
||||
|
||||
public void GetShopWaybillExceptionOrder()
|
||||
{
|
||||
foreach (var shop in GlobalConfig.ShopLoginList)
|
||||
|
||||
@@ -77,9 +77,13 @@ namespace AllBase.Helper
|
||||
//public static string dangerItemWords = "打火机,压力罐,刀具,铡刀,充电宝,罂粟,礼炮,煤气罐,仿制枪,暖手宝,灭火器,火炮,纸炮枪,手枪,毫安,喷漆,酒精,锂电,电池,火柴,气罐,气泡弹,喷雾";
|
||||
public static string dangerItemWords = "打火机,压力罐,刀具,铡刀,充电宝,罂粟,礼炮,煤气罐,仿制枪,暖手宝,灭火器,火炮,纸炮枪,手枪,毫安,喷漆,酒精,锂电,电池,火柴,气罐,气泡弹";
|
||||
public static List<string> lstDangerItemWord { get; set; } = dangerItemWords.Split(',').ToList();
|
||||
public static BuyConfig BuyConfig { get; set; }
|
||||
|
||||
#region 界面颜色
|
||||
public static System.Drawing.Color DefaultMainColor { get; set; } = System.Drawing.Color.FromArgb(63, 126, 255);
|
||||
public static ConcurrentList<WXBuyMapInfo> BuyMapList { get; set; } = new ConcurrentList<WXBuyMapInfo>();
|
||||
public static ConcurrentList<WXBuyMapSkusInfo> BuyMapSkusList { get; set; } = new ConcurrentList<WXBuyMapSkusInfo>();
|
||||
|
||||
#region 界面颜色
|
||||
public static System.Drawing.Color DefaultMainColor { get; set; } = System.Drawing.Color.FromArgb(63, 126, 255);
|
||||
public static System.Drawing.Color DefaultMainColorLight { get; set; } = System.Drawing.Color.FromArgb(185, 215, 255);
|
||||
public static System.Drawing.Color DefaultBorderColor { get; set; } = System.Drawing.Color.FromArgb(25, 98, 200);
|
||||
|
||||
@@ -96,8 +100,6 @@ namespace AllBase.Helper
|
||||
public static System.Drawing.Color WeiXinBorderColor { get; set; } = System.Drawing.Color.FromArgb(107, 83, 147);
|
||||
#endregion
|
||||
|
||||
public static BuyConfig BuyConfig { get; set; }
|
||||
|
||||
#region 文本颜色
|
||||
public static SolidColorBrush BlackBrush = new SolidColorBrush(Color.FromArgb(255, 0, 0, 0));
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
using System;
|
||||
using AllBase.Model.Result;
|
||||
using NaiBa.Util;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -28,4 +32,36 @@ namespace AllBase.Model.DBModel
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
}
|
||||
public class WXBuyMapSkusInfo
|
||||
{
|
||||
public long id { get; set; }
|
||||
public string user_name { get; set; }
|
||||
public string spu_code { get; set; }
|
||||
public string map_url { get; set; }
|
||||
public string map_goods_name { get; set; }
|
||||
public string map_goods_id { get; set; }
|
||||
string _map_skus;
|
||||
public string map_skus
|
||||
{
|
||||
get { return _map_skus; }
|
||||
set
|
||||
{
|
||||
_map_skus = value;
|
||||
try
|
||||
{
|
||||
pdd_front_goods3_Lite = JsonHelper.DeserializeJsonToObject<pddFrontGoods3Lite>(value);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
[JsonIgnore]
|
||||
public pddFrontGoods3Lite pdd_front_goods3_Lite { get; private set; }
|
||||
/// <summary>
|
||||
/// 发货地(省,市)
|
||||
/// </summary>
|
||||
public string map_send_address { get; set; }
|
||||
public string transit_warehouse_id { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,11 @@ namespace AllBase.Model.DBModel
|
||||
get { return this.GetValue(x => x.BuyMap); }
|
||||
set { this.SetValue(x => x.BuyMap, value); }
|
||||
}
|
||||
public List<WXBuyMapSkusInfo> BuyMapSkus
|
||||
{
|
||||
get { return this.GetValue(x => x.BuyMapSkus); }
|
||||
set { this.SetValue(x => x.BuyMapSkus, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 采购按钮文字
|
||||
/// </summary>
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace AllBase.Model.Result
|
||||
|
||||
}
|
||||
|
||||
public class pddFrontGoods3List
|
||||
public class pddFrontGoods3Lite
|
||||
{
|
||||
public long? goodsId { get; set; } // 1661424397,
|
||||
public string goodsName { get; set; } // "红薏仁5斤装 红薏仁米小薏米仁农家自产新红薏米1斤2斤苡仁糙薏米",
|
||||
|
||||
@@ -7,6 +7,7 @@ using AllBase.Model.Result;
|
||||
using CefSharp;
|
||||
using CefSharp.DevTools.IO;
|
||||
using CefSharp.DevTools.Profiler;
|
||||
using CefSharp.Web;
|
||||
using CefSharp.WinForms;
|
||||
using DevComponents.WinForms.Drawing;
|
||||
|
||||
@@ -35,6 +36,7 @@ using System.Windows.Forms;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using Work._29Tools.CefTools;
|
||||
using Work._29Tools.Forms.ToolForms;
|
||||
using Work.BaseForms;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
||||
|
||||
@@ -43,7 +45,7 @@ namespace TemuKJD.ToolForms
|
||||
public partial class PddMobileBuyOrderForm : BaseGeneralForm
|
||||
{
|
||||
public oms_wei_external_procurement_log_info AbnormalTransitWarehouseOrderInfo { get; set; } = null;
|
||||
public pddFrontGoods3List pddFrontGoodsLite = new pddFrontGoods3List();
|
||||
public pddFrontGoods3Lite pddFrontGoodsLite = new pddFrontGoods3Lite();
|
||||
|
||||
public bool IsAutoBuy { get; set; } = true;
|
||||
public bool IsFormLoad { get; set; } = false;
|
||||
@@ -170,6 +172,16 @@ namespace TemuKJD.ToolForms
|
||||
txtBuyTransitWarehouse.Text = orderItem.ItemOrder.AddressStr;
|
||||
}
|
||||
}
|
||||
else if (orderItem.BuyMapSkus != null && orderItem.BuyMapSkus.Count > 0 && AbnormalTransitWarehouseOrderInfo == null) // 不能是异常重拍
|
||||
{
|
||||
panel2.Visible = true;
|
||||
cmbMapSkusProd.Items.Clear();
|
||||
cmbMapSkusProd.Items.Add("");
|
||||
foreach (var mapSku in orderItem.BuyMapSkus)
|
||||
{
|
||||
cmbMapSkusProd.Items.Add(mapSku.map_goods_name + mapSku.map_goods_id);
|
||||
}
|
||||
}
|
||||
|
||||
this.pictureBox1.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(orderItem.thumb_img);
|
||||
this.txtShopSkuId.Text = orderItem.sku_id;
|
||||
@@ -897,8 +909,9 @@ namespace TemuKJD.ToolForms
|
||||
}
|
||||
}
|
||||
|
||||
private void btnManualUpdateTransitWarehouse_Click(object sender, EventArgs e)
|
||||
private async void btnManualUpdateTransitWarehouse_Click(object sender, EventArgs e)
|
||||
{
|
||||
var sendProvince = txtSendProvince.Text.Trim();
|
||||
if (transitWarehouse == null && !cmbTransitWarehouse.Text.Trim().IsNullOrEmpty())
|
||||
{
|
||||
transitWarehouse = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransName + " " + t.TransDetailAddress == cmbTransitWarehouse.Text.Trim().ParseToString());
|
||||
@@ -910,44 +923,101 @@ namespace TemuKJD.ToolForms
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.pddFrontGoodsLite == null || this.pddFrontGoodsLite.goodsId == null)
|
||||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
var jsStr = "document.getElementById('orderGoodsBlock').getElementsByTagName('div')[0].click();";
|
||||
|
||||
var host = cefWebBrowser.GetBrowser().GetHost();
|
||||
var client = cefWebBrowser.GetDevToolsClient();
|
||||
var ts1 = client.Runtime.EvaluateAsync(jsStr, null, true, null, null, true, null, true);
|
||||
ts1.Wait(500);
|
||||
Thread.Sleep(2000);
|
||||
});
|
||||
}
|
||||
|
||||
this.Enabled = false;
|
||||
if (this.cefWebBrowser.Address.StartsWith("https://mobile.yangkeduo.com/order.html?order_sn="))
|
||||
if (!this.cefWebBrowser.Address.StartsWith("https://mobile.yangkeduo.com/order.html?order_sn=") && (this.pddFrontGoodsLite?.goodsId).ParseToString() == txtMapGoodsId.Text.Trim())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
string url;
|
||||
string upSpuCode = txtUpSpuCode.Text.Trim();
|
||||
string upSkuCode = txtUpSkuCode.Text.Trim();
|
||||
// 保存sku及商品关联信息
|
||||
var data = UserLogin.GetSignaturex()
|
||||
+ "&spu_code=" + GetHtml.UrlEncodeUtf8(txtUpSpuCode.Text.Trim())
|
||||
+ "&sku_code=" + GetHtml.UrlEncodeUtf8(txtUpSkuCode.Text.Trim())
|
||||
var data = UserLogin.GetSignaturex()
|
||||
+ "&spu_code=" + GetHtml.UrlEncodeUtf8(upSpuCode)
|
||||
+ "&sku_code=" + GetHtml.UrlEncodeUtf8(upSkuCode)
|
||||
+ "&main_user_name=" + BaseClass.MainUserName
|
||||
+ "&map_goods_name=" + txtMapGoodsName.Text.Trim()
|
||||
+ "&map_spec_name=" + txtMapSkuName.Text.Trim()
|
||||
+ "&map_goods_id=" + txtMapGoodsId.Text.Trim()
|
||||
+ "&map_sku_id=" + txtMapSkuId.Text.Trim()
|
||||
+ "&map_send_address=" + txtSendProvince.Text.Trim()
|
||||
+ "&transit_warehouse_id=" + transitWarehouse?.TransId;
|
||||
+ "&map_send_address=" + sendProvince
|
||||
+ "&transit_warehouse_id=" + transitWarehouse?.TransId;
|
||||
if (this.pddFrontGoodsLite != null && this.pddFrontGoodsLite.goodsId.ParseToString() == txtMapGoodsId.Text.Trim())
|
||||
{
|
||||
//// 保存商品关联信息
|
||||
//data += "&map_skus=" + GetHtml.UrlEncodeUtf8(JsonHelper.SerializeObject(pddFrontGoodsLite));
|
||||
//url = BaseClass.Build29WxObjString("order/wx_add_mdy_buy_prod_map_skus");
|
||||
//var skusRst = GetHtml.PostUtf8(url, data);
|
||||
//if (!skusRst.Contains("\"code\":200"))
|
||||
// skusRst = GetHtml.PostUtf8(url, data);
|
||||
// 保存商品关联信息
|
||||
data += "&map_skus=" + GetHtml.UrlEncodeUtf8(JsonHelper.SerializeObject(pddFrontGoodsLite));
|
||||
url = BaseClass.Build29WxObjString("order/wx_add_mdy_buy_prod_map_skus");
|
||||
var skusRst = await GetHtml.PostUtf8Async(url, data);
|
||||
if (!skusRst.Contains("\"code\":200"))
|
||||
skusRst = await GetHtml.PostUtf8Async(url, data);
|
||||
|
||||
//// 存完立即测试读取
|
||||
////wx_get_buy_pord_map_skus
|
||||
//var dataTest = UserLogin.GetSignaturex() + "&spu_codes=" + GetHtml.UrlEncodeUtf8(txtUpSpuCode.Text.Trim());
|
||||
//dataTest += "&main_user_name=" + BaseClass.MainUserName;
|
||||
//url = BaseClass.Build29WxObjString("order/wx_get_buy_pord_map_skus");
|
||||
//var dataTestRst = GetHtml.PostUtf8(url, dataTest);
|
||||
// 存完立即读取
|
||||
//wx_get_buy_pord_map_skus
|
||||
var dataTest = UserLogin.GetSignaturex() + "&spu_codes=" + GetHtml.UrlEncodeUtf8(upSpuCode);
|
||||
dataTest += "&main_user_name=" + BaseClass.MainUserName;
|
||||
url = BaseClass.Build29WxObjString("order/wx_get_buy_pord_map_skus");
|
||||
var resultSkusMap = await GetHtml.PostUtf8Async(url, dataTest);
|
||||
if (string.IsNullOrEmpty(resultSkusMap) || !resultSkusMap.Contains("\"code\":200"))
|
||||
{
|
||||
resultSkusMap = await GetHtml.PostUtf8Async(url, dataTest);
|
||||
}
|
||||
if (string.IsNullOrEmpty(resultSkusMap) || !resultSkusMap.Contains("\"code\":200"))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
List<WXBuyMapSkusInfo> buyMapSkuList = new List<WXBuyMapSkusInfo>();
|
||||
try
|
||||
{
|
||||
buyMapSkuList = JsonHelper.DeserializeJsonToList<WXBuyMapSkusInfo>(JObject.Parse(resultSkusMap)["data"].ParseToString());
|
||||
|
||||
GlobalConfig.BuyMapSkusList.RemoveAll(b => buyMapSkuList.Any(map => b.spu_code == map.spu_code));
|
||||
GlobalConfig.BuyMapSkusList.AddRange(buyMapSkuList);
|
||||
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
{
|
||||
if (order.IsWaitBuy)
|
||||
{
|
||||
foreach (var item in order.orderItems)
|
||||
{
|
||||
if (item.out_product_id == upSpuCode || item.product_id == upSpuCode)
|
||||
{
|
||||
item.BuyMapSkus = buyMapSkuList;
|
||||
|
||||
//if (filterOrderAction != null)
|
||||
//{
|
||||
// item.SetOrderItemTextProperty();
|
||||
// filterOrderAction(order, false);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
url = BaseClass.Build29WxObjString("order/wx_add_mdy_buy_prod_map");
|
||||
var result = GetHtml.PostUtf8(url, data);
|
||||
var result = await GetHtml.PostUtf8Async(url, data);
|
||||
if (!result.Contains("\"code\":200"))
|
||||
result = GetHtml.PostUtf8(url, data);
|
||||
result = await GetHtml.PostUtf8Async(url, data);
|
||||
if (!result.Contains("\"code\":200"))
|
||||
{
|
||||
this.Enabled = true;
|
||||
@@ -957,20 +1027,29 @@ namespace TemuKJD.ToolForms
|
||||
{
|
||||
var urlMap = BaseClass.Build29WxObjString("order/wx_get_buy_prod_map");
|
||||
var dataMap = UserLogin.GetSignaturex()
|
||||
+ "&spu_codes=" + txtUpSpuCode.Text.Trim();
|
||||
//dataMap += "&sku_codes=" + txtUpSkuCode.Text.Trim();
|
||||
dataMap += "&main_user_name=" + BaseClass.MainUserName;
|
||||
var resultMap = GetHtml.PostUtf8(urlMap, dataMap);
|
||||
+ "&spu_codes=" + upSpuCode;
|
||||
//dataMap += "&sku_codes=" + upSkuCode;
|
||||
dataMap += "&main_user_name=" + BaseClass.MainUserName;
|
||||
var resultMap = await GetHtml.PostUtf8Async(urlMap, dataMap);
|
||||
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
|
||||
resultMap = GetHtml.PostUtf8(urlMap, dataMap);
|
||||
resultMap = await GetHtml.PostUtf8Async(urlMap, dataMap);
|
||||
if (string.IsNullOrEmpty(resultMap) || !resultMap.Contains("\"code\":200"))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
List<WXBuyMapInfo> buyMapList = new List<WXBuyMapInfo>();
|
||||
try { buyMapList = JsonHelper.DeserializeJsonToList<WXBuyMapInfo>(JObject.Parse(resultMap)["data"].ParseToString()); } catch { }
|
||||
var map = buyMapList.FirstOrDefault(b => b.spu_code == txtUpSpuCode.Text.Trim() && b.sku_code == txtUpSkuCode.Text.Trim());
|
||||
try
|
||||
{
|
||||
buyMapList = JsonHelper.DeserializeJsonToList<WXBuyMapInfo>(JObject.Parse(resultMap)["data"].ParseToString());
|
||||
|
||||
GlobalConfig.BuyMapList.RemoveAll(b => buyMapList.Any(map => b.spu_code == map.spu_code && b.sku_code == map.sku_code));
|
||||
GlobalConfig.BuyMapList.AddRange(buyMapList);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
var map = buyMapList.FirstOrDefault(b => b.spu_code == upSpuCode && b.sku_code == upSkuCode);
|
||||
if (map != null)
|
||||
{
|
||||
foreach (var order in GlobalConfig.lstOrder)
|
||||
@@ -1460,5 +1539,78 @@ namespace TemuKJD.ToolForms
|
||||
ChangeAddress(null);
|
||||
});
|
||||
}
|
||||
|
||||
private void cmbMapSkusProd_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.IsFormLoad)
|
||||
{
|
||||
cmbMapSkus.Items.Clear();
|
||||
if (!string.IsNullOrEmpty(cmbMapSkusProd.Text))
|
||||
{
|
||||
cmbMapSkus.Items.Add("");
|
||||
var mapSku = orderItem.BuyMapSkus.FirstOrDefault(m => m.map_goods_name + m.map_goods_id == cmbMapSkusProd.Text);
|
||||
if (mapSku != null)
|
||||
{
|
||||
foreach(var pddsku in mapSku.pdd_front_goods3_Lite.skus)
|
||||
{
|
||||
cmbMapSkus.Items.Add(string.Join(";", pddsku.specs.Select(sp => sp.spec_value)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void cmbMapSkus_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (this.IsFormLoad)
|
||||
{
|
||||
this.pictureBox2.Image = null;
|
||||
this.pictureBox2.Tag = null;
|
||||
|
||||
var mapSkuProd = orderItem.BuyMapSkus.FirstOrDefault(s => s.map_goods_name + s.map_goods_id == cmbMapSkusProd.Text);
|
||||
if (mapSkuProd == null)
|
||||
return;
|
||||
|
||||
var mapSku = mapSkuProd.pdd_front_goods3_Lite.skus.FirstOrDefault(s => string.Join(";", s.specs.Select(sp => sp.spec_value)) == cmbMapSkus.Text);
|
||||
if (mapSku == null)
|
||||
return;
|
||||
|
||||
this.pictureBox2.Image = ImageBuild.LoadBitmapLoadBitmipImageFromUrl(mapSku.thumbUrl);
|
||||
this.pictureBox2.Tag = mapSku.thumbUrl;
|
||||
}
|
||||
}
|
||||
|
||||
private void pictureBox2_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowImgForm imgFrom = new ShowImgForm(pictureBox2.Tag.ParseToString());
|
||||
imgFrom.Show();
|
||||
}
|
||||
|
||||
private void btnAddToMap_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.IsFormLoad)
|
||||
{
|
||||
var mapSkuProd = orderItem.BuyMapSkus.FirstOrDefault(s => s.map_goods_name + s.map_goods_id == cmbMapSkusProd.Text);
|
||||
if (mapSkuProd == null)
|
||||
return;
|
||||
|
||||
var mapSku = mapSkuProd.pdd_front_goods3_Lite.skus.FirstOrDefault(s => string.Join(";", s.specs.Select(sp => sp.spec_value)) == cmbMapSkus.Text);
|
||||
if (mapSku == null)
|
||||
return;
|
||||
|
||||
this.txtMapGoodsName.Text = mapSkuProd.map_goods_name;
|
||||
this.txtMapSkuName.Text = string.Join(",", mapSku.specs.Select(sp => sp.spec_value));
|
||||
this.txtMapGoodsId.Text = mapSkuProd.map_goods_id;
|
||||
this.txtMapSkuId.Text = mapSku.skuId.ParseToString();
|
||||
txtSendProvince.Text = mapSkuProd.map_send_address;
|
||||
|
||||
this.transitWarehouse = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == mapSkuProd.transit_warehouse_id);
|
||||
if (transitWarehouse != null)
|
||||
{
|
||||
cmbTransitWarehouse.Text = transitWarehouse?.TransName + " " + transitWarehouse?.TransDetailAddress;
|
||||
txtBuyTransitWarehouse.Text = transitWarehouse?.TransDetailAddress;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+114
-10
@@ -29,7 +29,6 @@
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PddMobileBuyOrderForm));
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.pnlMask = new DevComponents.DotNetBar.PanelEx();
|
||||
this.btnJumpOrderList = new DevComponents.DotNetBar.PanelEx();
|
||||
@@ -84,6 +83,13 @@
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.txtAddress = new System.Windows.Forms.TextBox();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.pictureBox2 = new System.Windows.Forms.PictureBox();
|
||||
this.cmbMapSkus = new System.Windows.Forms.ComboBox();
|
||||
this.label31 = new System.Windows.Forms.Label();
|
||||
this.btnAddToMap = new DevComponents.DotNetBar.PanelEx();
|
||||
this.label30 = new System.Windows.Forms.Label();
|
||||
this.cmbMapSkusProd = new System.Windows.Forms.ComboBox();
|
||||
this.pnlDirectAddressAnalysis = new System.Windows.Forms.Panel();
|
||||
this.btnAnalysis = new DevComponents.DotNetBar.PanelEx();
|
||||
this.label25 = new System.Windows.Forms.Label();
|
||||
@@ -113,6 +119,8 @@
|
||||
this.splitContainer2.Panel2.SuspendLayout();
|
||||
this.splitContainer2.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
|
||||
this.pnlDirectAddressAnalysis.SuspendLayout();
|
||||
this.pnlBuy.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
@@ -146,8 +154,8 @@
|
||||
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White;
|
||||
this.splitContainer1.Panel2.Controls.Add(this.btnJumpOrderList);
|
||||
this.splitContainer1.Panel2MinSize = 0;
|
||||
this.splitContainer1.Size = new System.Drawing.Size(864, 728);
|
||||
this.splitContainer1.SplitterDistance = 700;
|
||||
this.splitContainer1.Size = new System.Drawing.Size(864, 888);
|
||||
this.splitContainer1.SplitterDistance = 860;
|
||||
this.splitContainer1.SplitterWidth = 3;
|
||||
this.splitContainer1.TabIndex = 4;
|
||||
//
|
||||
@@ -160,7 +168,7 @@
|
||||
this.pnlMask.Font = new System.Drawing.Font("微软雅黑", 50F);
|
||||
this.pnlMask.Location = new System.Drawing.Point(0, 0);
|
||||
this.pnlMask.Name = "pnlMask";
|
||||
this.pnlMask.Size = new System.Drawing.Size(864, 700);
|
||||
this.pnlMask.Size = new System.Drawing.Size(864, 860);
|
||||
this.pnlMask.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.pnlMask.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(235)))), ((int)(((byte)(255)))));
|
||||
this.pnlMask.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(235)))), ((int)(((byte)(255)))));
|
||||
@@ -727,7 +735,7 @@
|
||||
//
|
||||
this.splitContainer2.Panel2.Controls.Add(this.panel1);
|
||||
this.splitContainer2.Panel2.Controls.Add(this.splitContainer1);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(1358, 766);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(1358, 926);
|
||||
this.splitContainer2.SplitterDistance = 26;
|
||||
this.splitContainer2.TabIndex = 5;
|
||||
//
|
||||
@@ -747,6 +755,7 @@
|
||||
//
|
||||
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.panel1.Controls.Add(this.panel2);
|
||||
this.panel1.Controls.Add(this.pnlDirectAddressAnalysis);
|
||||
this.panel1.Controls.Add(this.chkUseAppBalance);
|
||||
this.panel1.Controls.Add(this.txtShopName);
|
||||
@@ -776,9 +785,95 @@
|
||||
this.panel1.Controls.Add(this.pnlMap);
|
||||
this.panel1.Location = new System.Drawing.Point(867, 3);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(487, 730);
|
||||
this.panel1.Size = new System.Drawing.Size(487, 890);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.pictureBox2);
|
||||
this.panel2.Controls.Add(this.cmbMapSkus);
|
||||
this.panel2.Controls.Add(this.label31);
|
||||
this.panel2.Controls.Add(this.btnAddToMap);
|
||||
this.panel2.Controls.Add(this.label30);
|
||||
this.panel2.Controls.Add(this.cmbMapSkusProd);
|
||||
this.panel2.Location = new System.Drawing.Point(12, 595);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(468, 84);
|
||||
this.panel2.TabIndex = 883;
|
||||
this.panel2.Visible = false;
|
||||
//
|
||||
// pictureBox2
|
||||
//
|
||||
this.pictureBox2.Anchor = System.Windows.Forms.AnchorStyles.Top;
|
||||
this.pictureBox2.Location = new System.Drawing.Point(2, 3);
|
||||
this.pictureBox2.Name = "pictureBox2";
|
||||
this.pictureBox2.Size = new System.Drawing.Size(80, 80);
|
||||
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
this.pictureBox2.TabIndex = 889;
|
||||
this.pictureBox2.TabStop = false;
|
||||
this.pictureBox2.Click += new System.EventHandler(this.pictureBox2_Click);
|
||||
//
|
||||
// cmbMapSkus
|
||||
//
|
||||
this.cmbMapSkus.FormattingEnabled = true;
|
||||
this.cmbMapSkus.Location = new System.Drawing.Point(140, 31);
|
||||
this.cmbMapSkus.Name = "cmbMapSkus";
|
||||
this.cmbMapSkus.Size = new System.Drawing.Size(325, 25);
|
||||
this.cmbMapSkus.TabIndex = 888;
|
||||
this.cmbMapSkus.SelectedIndexChanged += new System.EventHandler(this.cmbMapSkus_SelectedIndexChanged);
|
||||
//
|
||||
// label31
|
||||
//
|
||||
this.label31.AutoSize = true;
|
||||
this.label31.Location = new System.Drawing.Point(87, 35);
|
||||
this.label31.Name = "label31";
|
||||
this.label31.Size = new System.Drawing.Size(52, 17);
|
||||
this.label31.TabIndex = 887;
|
||||
this.label31.Text = "关联sku";
|
||||
//
|
||||
// btnAddToMap
|
||||
//
|
||||
this.btnAddToMap.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnAddToMap.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnAddToMap.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnAddToMap.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnAddToMap.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnAddToMap.Location = new System.Drawing.Point(368, 59);
|
||||
this.btnAddToMap.Name = "btnAddToMap";
|
||||
this.btnAddToMap.Size = new System.Drawing.Size(97, 23);
|
||||
this.btnAddToMap.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnAddToMap.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
|
||||
this.btnAddToMap.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
|
||||
this.btnAddToMap.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
|
||||
this.btnAddToMap.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
|
||||
this.btnAddToMap.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
|
||||
this.btnAddToMap.Style.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.btnAddToMap.Style.GradientAngle = 90;
|
||||
this.btnAddToMap.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnAddToMap.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(83)))), ((int)(((byte)(147)))));
|
||||
this.btnAddToMap.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(83)))), ((int)(((byte)(147)))));
|
||||
this.btnAddToMap.TabIndex = 883;
|
||||
this.btnAddToMap.Text = "选择当前sku";
|
||||
this.btnAddToMap.Click += new System.EventHandler(this.btnAddToMap_Click);
|
||||
//
|
||||
// label30
|
||||
//
|
||||
this.label30.AutoSize = true;
|
||||
this.label30.Location = new System.Drawing.Point(84, 7);
|
||||
this.label30.Name = "label30";
|
||||
this.label30.Size = new System.Drawing.Size(56, 17);
|
||||
this.label30.TabIndex = 882;
|
||||
this.label30.Text = "关联商品";
|
||||
//
|
||||
// cmbMapSkusProd
|
||||
//
|
||||
this.cmbMapSkusProd.FormattingEnabled = true;
|
||||
this.cmbMapSkusProd.Location = new System.Drawing.Point(140, 3);
|
||||
this.cmbMapSkusProd.Name = "cmbMapSkusProd";
|
||||
this.cmbMapSkusProd.Size = new System.Drawing.Size(325, 25);
|
||||
this.cmbMapSkusProd.TabIndex = 881;
|
||||
this.cmbMapSkusProd.SelectedIndexChanged += new System.EventHandler(this.cmbMapSkusProd_SelectedIndexChanged);
|
||||
//
|
||||
// pnlDirectAddressAnalysis
|
||||
//
|
||||
this.pnlDirectAddressAnalysis.Controls.Add(this.btnAnalysis);
|
||||
@@ -1037,7 +1132,7 @@
|
||||
this.pnlMap.Controls.Add(this.cmbTransitWarehouse);
|
||||
this.pnlMap.Controls.Add(this.txtMapGoodsId);
|
||||
this.pnlMap.Controls.Add(this.txtMapSkuName);
|
||||
this.pnlMap.Location = new System.Drawing.Point(12, 525);
|
||||
this.pnlMap.Location = new System.Drawing.Point(12, 685);
|
||||
this.pnlMap.Name = "pnlMap";
|
||||
this.pnlMap.Size = new System.Drawing.Size(468, 203);
|
||||
this.pnlMap.TabIndex = 871;
|
||||
@@ -1045,10 +1140,9 @@
|
||||
// PddMobileBuyOrderForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.ClientSize = new System.Drawing.Size(1360, 800);
|
||||
this.ClientSize = new System.Drawing.Size(1360, 960);
|
||||
this.Controls.Add(this.splitContainer2);
|
||||
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
//this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.IsShowMaxBox = true;
|
||||
this.Name = "PddMobileBuyOrderForm";
|
||||
this.Padding = new System.Windows.Forms.Padding(1);
|
||||
@@ -1069,6 +1163,9 @@
|
||||
this.splitContainer2.ResumeLayout(false);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
|
||||
this.pnlDirectAddressAnalysis.ResumeLayout(false);
|
||||
this.pnlDirectAddressAnalysis.PerformLayout();
|
||||
this.pnlBuy.ResumeLayout(false);
|
||||
@@ -1155,5 +1252,12 @@
|
||||
private System.Windows.Forms.Panel pnlDirectAddressAnalysis;
|
||||
private DevComponents.DotNetBar.PanelEx btnAnalysis;
|
||||
private System.Windows.Forms.Label label25;
|
||||
}
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private DevComponents.DotNetBar.PanelEx btnAddToMap;
|
||||
private System.Windows.Forms.Label label30;
|
||||
private System.Windows.Forms.ComboBox cmbMapSkusProd;
|
||||
private System.Windows.Forms.ComboBox cmbMapSkus;
|
||||
private System.Windows.Forms.Label label31;
|
||||
private System.Windows.Forms.PictureBox pictureBox2;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user