淘宝买手拍单 订单补发包裹。

This commit is contained in:
wule committed 2026-10-05 18:23:15 +08:00
1 parent d18460c83f
commit c11dda0341
13 files changed
+753 -188

No files matched your search

@@ -95,7 +95,8 @@
Height="20" Height="20"
BorderBrush="{StaticResource pageColorBrush}" BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1" BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" /> Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtShopGoodsNameVal}" />
</wpf:TitleContent> </wpf:TitleContent>
<wpf:TitleContent <wpf:TitleContent
Title="店铺规格:" Title="店铺规格:"
@@ -106,7 +107,8 @@
Height="20" Height="20"
BorderBrush="{StaticResource pageColorBrush}" BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1" BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" /> Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtShopSpecNameVal}" />
</wpf:TitleContent> </wpf:TitleContent>
<wpf:TitleContent <wpf:TitleContent
Title="店铺商品ID:" Title="店铺商品ID:"
@@ -117,7 +119,8 @@
Height="20" Height="20"
BorderBrush="{StaticResource pageColorBrush}" BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1" BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" /> Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtShopGoodsIdVal}" />
</wpf:TitleContent> </wpf:TitleContent>
<wpf:TitleContent <wpf:TitleContent
Title="店铺SKUID:" Title="店铺SKUID:"
@@ -128,7 +131,8 @@
Height="20" Height="20"
BorderBrush="{StaticResource pageColorBrush}" BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1" BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" /> Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtShopSkuIdVal}" />
</wpf:TitleContent> </wpf:TitleContent>
<wpf:TitleContent <wpf:TitleContent
Title="平台商品编码:" Title="平台商品编码:"
@@ -139,7 +143,8 @@
Height="20" Height="20"
BorderBrush="{StaticResource pageColorBrush}" BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1" BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" /> Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtSpuCodeVal}" />
</wpf:TitleContent> </wpf:TitleContent>
<wpf:TitleContent <wpf:TitleContent
Title="平台SKU编码:" Title="平台SKU编码:"
@@ -150,7 +155,8 @@
Height="20" Height="20"
BorderBrush="{StaticResource pageColorBrush}" BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1" BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" /> Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtSkuCodeVal}" />
</wpf:TitleContent> </wpf:TitleContent>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -170,7 +176,8 @@
FontSize="15" FontSize="15"
FontWeight="bold" FontWeight="bold"
Foreground="Red" Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" /> Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtShopOrderItemCntVal}" />
</wpf:TitleContent> </wpf:TitleContent>
<wpf:TitleContent <wpf:TitleContent
Title="  总价:" Title="  总价:"
@@ -185,138 +192,171 @@
FontSize="15" FontSize="15"
FontWeight="bold" FontWeight="bold"
Foreground="Red" Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" /> Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtShopOrderItemPriceVal}" />
</wpf:TitleContent> </wpf:TitleContent>
</Grid> </Grid>
<TextBlock <wpf:SpacingStackPanel
Margin="0,4,0,0" Grid.Row="0"
FontSize="14" Margin="0"
FontWeight="Bold"> Orientation="Vertical"
买手拍单信息: VerticalSpacing="4"
</TextBlock> Visibility="{Binding BuyInfoVisivility}">
<wpf:TitleContent <TextBlock
Title="商品标题:" Margin="0,4,0,0"
TitleHorizontalAlignment="Right" FontSize="14"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}"> FontWeight="Bold">
<TextBox 买手拍单信息:
x:Name="txtBuyGoodsName" </TextBlock>
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuyGoodsNameVal}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="规格名称:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuySkuName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuySkuNameVal}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单商品ID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyGoodsId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuyGoodsIdVal}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单SKUID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuySkuId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuySkuIdVal}" />
</wpf:TitleContent>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.04*" />
<ColumnDefinition Width="0.96*" />
</Grid.ColumnDefinitions>
<wpf:TitleContent <wpf:TitleContent
Title="拍单数量:" Title="商品标题:"
Grid.Column="0"
TitleHorizontalAlignment="Right" TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}"> TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox <TextBox
x:Name="txtBuyCnt" x:Name="txtBuyGoodsName"
Height="22" Height="20"
BorderBrush="{StaticResource pageColorBrush}" BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1" BorderThickness="1"
FontSize="15"
FontWeight="bold"
Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuyCntVal}" /> Text="{Binding txtBuyGoodsNameVal}" />
</wpf:TitleContent> </wpf:TitleContent>
<wpf:TitleContent <wpf:TitleContent
Title="拍单总价:" Title="规格名称:"
Grid.Column="1" TitleHorizontalAlignment="Right"
Margin="10,0,0,0" TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
TitleHorizontalAlignment="Right">
<TextBox <TextBox
x:Name="txtBuyPrice" x:Name="txtBuySkuName"
Height="22" Height="20"
BorderBrush="{StaticResource pageColorBrush}" BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1" BorderThickness="1"
FontSize="15"
FontWeight="bold"
Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuyPriceVal}" /> Text="{Binding txtBuySkuNameVal}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单商品ID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyGoodsId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuyGoodsIdVal}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单SKUID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuySkuId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuySkuIdVal}" />
</wpf:TitleContent>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.04*" />
<ColumnDefinition Width="0.96*" />
</Grid.ColumnDefinitions>
<wpf:TitleContent
Title="拍单数量:"
Grid.Column="0"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyCnt"
Height="22"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
FontSize="15"
FontWeight="bold"
Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuyCntVal}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单总价:"
Grid.Column="1"
Margin="10,0,0,0"
TitleHorizontalAlignment="Right">
<TextBox
x:Name="txtBuyPrice"
Height="22"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
FontSize="15"
FontWeight="bold"
Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuyPriceVal}" />
</wpf:TitleContent>
</Grid>
<wpf:TitleContent
Title="拍单订单号:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyOrderId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuyOrderIdVal}" />
</wpf:TitleContent> </wpf:TitleContent>
</Grid>
<wpf:TitleContent
Title="拍单订单号:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyOrderId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuyOrderIdVal}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="溯源码:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtSourceCode"
Height="20"
Background="#DDDDDD"
BorderBrush="#999999"
IsEnabled="False"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtSourceCodeVal}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="溯源码:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtSourceCode"
Height="20"
Background="#DDDDDD"
BorderBrush="#999999"
IsEnabled="False"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtSourceCodeVal}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单订单号:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyTransitWarehouse"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}"
Text="{Binding txtBuyTransitWarehouseVal}" />
</wpf:TitleContent>
<Grid>
<Button
x:Name="btnReMap"
Grid.Column="1"
Height="20"
MinWidth="48"
Margin="0"
Padding="4,0"
HorizontalAlignment="Left"
Command="{Binding ReMapCommand}"
Content="重新关联商品"
FontSize="12"
Style="{StaticResource BaseButtonLightStyle}" />
</Grid>
</wpf:SpacingStackPanel>
</wpf:SpacingStackPanel> </wpf:SpacingStackPanel>
<wpf:SpacingStackPanel <wpf:SpacingStackPanel
Grid.Row="2" Grid.Row="2"
Margin="4" Margin="4"
Orientation="Vertical" Orientation="Vertical"
VerticalSpacing="4"> VerticalSpacing="4"
Visibility="{Binding MapInfoVisivility}">
<TextBlock <TextBlock
Margin="0,4,0,0" Margin="0,4,0,0"
FontSize="14" FontSize="14"
@@ -407,11 +447,31 @@
x:Name="cmbTransitWarehouse" x:Name="cmbTransitWarehouse"
Height="22" Height="22"
SelectedIndex="0" SelectedIndex="0"
SelectedValue="{Binding cmbTransitWarehouseVal}"
SelectionChanged="cmbTransitWarehouse_SelectionChanged" SelectionChanged="cmbTransitWarehouse_SelectionChanged"
Style="{StaticResource RoundedComboBox}"> Style="{StaticResource RoundedComboBox}">
<ComboBoxItem Content="仓库地址" /> <!--<ComboBoxItem Content="仓库地址" />-->
</ComboBox> </ComboBox>
</wpf:TitleContent> </wpf:TitleContent>
<wpf:TitleContent
Title=""
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<Button
x:Name="btnManualUpdateTransitWarehouse"
Grid.Column="1"
Height="20"
MinWidth="48"
Margin="0"
Padding="4,0"
HorizontalAlignment="Right"
Command="{Binding UpdateTransitWarehouseCommand}"
Content="确认商品关联"
FontSize="12"
Style="{StaticResource BasePageButtonStyle}" />
</wpf:TitleContent>
</wpf:SpacingStackPanel> </wpf:SpacingStackPanel>
</Grid> </Grid>
</Grid> </Grid>
@@ -31,6 +31,11 @@ public partial class TaobaoBuyOrderCtrl : UserControl
{ {
InitializeComponent(); InitializeComponent();
foreach (var warehouse in TransitWarehouseData.TransitWarehouseList)
{
this.cmbTransitWarehouse.Items.Add(warehouse.TransName + " " + warehouse.TransDetailAddress);
}
ViewModel = new TaobaoBuyOrderViewModel(buyerInfo, orderItemInfo); ViewModel = new TaobaoBuyOrderViewModel(buyerInfo, orderItemInfo);
ViewModel.BrowserCreated += ViewModel_BrowserCreated; ViewModel.BrowserCreated += ViewModel_BrowserCreated;
ViewModel.RequestClose += ViewModel_RequestClose; ViewModel.RequestClose += ViewModel_RequestClose;
@@ -1,3 +1,4 @@
using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.CefHelper; using _29WxOrderWpf.CefHelper;
using _29WxOrderWpf.Commands; using _29WxOrderWpf.Commands;
using _29WxOrderWpf.ViewModels; using _29WxOrderWpf.ViewModels;
@@ -14,6 +15,7 @@ using Newtonsoft.Json.Linq;
using Org.BouncyCastle.Asn1.Ocsp; using Org.BouncyCastle.Asn1.Ocsp;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing;
using System.Linq; using System.Linq;
using System.Security.Policy; using System.Security.Policy;
using System.Text; using System.Text;
@@ -25,6 +27,7 @@ using TemuKJD.ToolForms;
using Work; using Work;
using Work._29Tools.BLL; using Work._29Tools.BLL;
using Work._29Tools.CefTools; using Work._29Tools.CefTools;
using Work.BaseForms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel; using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
using static WPFCommon.Interop.InteropValues; using static WPFCommon.Interop.InteropValues;
@@ -56,11 +59,38 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
private oms_wei_order_item_info orderItem = null; private oms_wei_order_item_info orderItem = null;
WXBuyMapSkusInfo buymapSkuInfo = null; WXBuyMapSkusInfo buymapSkuInfo = null;
WXBuyMapInfo buyMapInfo = null; WXBuyMapInfo buyMapInfo = null;
pddFrontGoods3Lite pddFrontGoodsLite = null;
/// <summary>
/// 直发direct 中转transit
/// </summary>
public string BuyType { get; set; } = "transit";
public TransitWarehouseParam transitWarehouse { get; set; }
/// <summary>
/// 异常重拍的原中转仓订单信息
/// </summary>
public oms_wei_external_procurement_log_info AbnormalTransitWarehouseOrderInfo { get; set; } = null;
private string currentUrl = ""; private string currentUrl = "";
private volatile bool _isWindowLoaded = false; private volatile bool _isWindowLoaded = false;
#region 界面绑定属性 #region 界面绑定属性
public bool Enabled
{
get { return this.GetValue(x => x.Enabled); }
set { this.SetValue(x => x.Enabled, value); }
}
public Visibility BuyInfoVisivility
{
get { return this.GetValue(x => x.BuyInfoVisivility); }
set { this.SetValue(x => x.BuyInfoVisivility, value); }
}
public Visibility MapInfoVisivility
{
get { return this.GetValue(x => x.MapInfoVisivility); }
set { this.SetValue(x => x.MapInfoVisivility, value); }
}
/// <summary>用户名</summary> /// <summary>用户名</summary>
public string UserName public string UserName
{ {
@@ -82,6 +112,48 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
set { this.SetValue(x => x.Address, value); } set { this.SetValue(x => x.Address, value); }
} }
public string txtShopGoodsNameVal
{
get { return this.GetValue(x => x.txtShopGoodsNameVal); }
set { this.SetValue(x => x.txtShopGoodsNameVal, value); }
}
public string txtShopSpecNameVal
{
get { return this.GetValue(x => x.txtShopSpecNameVal); }
set { this.SetValue(x => x.txtShopSpecNameVal, value); }
}
public string txtShopGoodsIdVal
{
get { return this.GetValue(x => x.txtShopGoodsIdVal); }
set { this.SetValue(x => x.txtShopGoodsIdVal, value); }
}
public string txtShopSkuIdVal
{
get { return this.GetValue(x => x.txtShopSkuIdVal); }
set { this.SetValue(x => x.txtShopSkuIdVal, value); }
}
public string txtSpuCodeVal
{
get { return this.GetValue(x => x.txtSpuCodeVal); }
set { this.SetValue(x => x.txtSpuCodeVal, value); }
}
public string txtSkuCodeVal
{
get { return this.GetValue(x => x.txtSkuCodeVal); }
set { this.SetValue(x => x.txtSkuCodeVal, value); }
}
public string txtShopOrderItemCntVal
{
get { return this.GetValue(x => x.txtShopOrderItemCntVal); }
set { this.SetValue(x => x.txtShopOrderItemCntVal, value); }
}
public string txtShopOrderItemPriceVal
{
get { return this.GetValue(x => x.txtShopOrderItemPriceVal); }
set { this.SetValue(x => x.txtShopOrderItemPriceVal, value); }
}
/// <summary>拍单商品Id</summary> /// <summary>拍单商品Id</summary>
public string txtBuyGoodsIdVal public string txtBuyGoodsIdVal
{ {
@@ -118,6 +190,24 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
get { return this.GetValue(x => x.txtBuyPriceVal); } get { return this.GetValue(x => x.txtBuyPriceVal); }
set { this.SetValue(x => x.txtBuyPriceVal, value); } set { this.SetValue(x => x.txtBuyPriceVal, value); }
} }
public string txtBuyOrderIdVal
{
get { return this.GetValue(x => x.txtBuyOrderIdVal); }
set { this.SetValue(x => x.txtBuyOrderIdVal, value); }
}
public string txtSourceCodeVal
{
get { return this.GetValue(x => x.txtSourceCodeVal); }
set { this.SetValue(x => x.txtSourceCodeVal, value); }
}
/// <summary>
/// 中专仓地址
/// </summary>
public string txtBuyTransitWarehouseVal
{
get { return this.GetValue(x => x.txtBuyTransitWarehouseVal); }
set { this.SetValue(x => x.txtBuyTransitWarehouseVal, value); }
}
/// <summary>关联商品名称</summary> /// <summary>关联商品名称</summary>
public string txtMapGoodsNameVal public string txtMapGoodsNameVal
@@ -164,6 +254,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
public ICommand CopyUserNameCommand { get; } public ICommand CopyUserNameCommand { get; }
public ICommand CopyPasswordCommand { get; } public ICommand CopyPasswordCommand { get; }
public ICommand UpdateTransitWarehouseCommand { get; }
#endregion #endregion
public TaobaoBuyOrderViewModel(BuyerLoginInfo buyerInfo, oms_wei_order_item_info orderItemInfo) public TaobaoBuyOrderViewModel(BuyerLoginInfo buyerInfo, oms_wei_order_item_info orderItemInfo)
@@ -180,6 +272,28 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
StopCommand = new DelegateCommand(StopButton); StopCommand = new DelegateCommand(StopButton);
CopyUserNameCommand = new DelegateCommand(CopyUserName); CopyUserNameCommand = new DelegateCommand(CopyUserName);
CopyPasswordCommand = new DelegateCommand(CopyPassword); CopyPasswordCommand = new DelegateCommand(CopyPassword);
UpdateTransitWarehouseCommand = new DelegateCommand(UpdateTransitWarehouse);
this.txtShopSkuIdVal = orderItem.sku_id;
this.txtShopGoodsIdVal = orderItem.product_id;
this.txtSpuCodeVal = orderItem.out_product_id.IsNullOrEmpty() ? orderItem.product_id : orderItem.out_product_id;
this.txtSkuCodeVal = orderItem.out_sku_id.IsNullOrEmpty() ? orderItem.sku_attr_str : orderItem.out_sku_id;
this.txtShopGoodsNameVal = orderItem.title;
this.txtShopSpecNameVal = orderItem.sku_attr_str;
this.txtShopOrderItemCntVal = orderItem.sku_cnt.ParseToString();
this.txtShopOrderItemPriceVal = (orderItem.real_price * 0.01m + orderItem.ItemOrder?.postage_price * 0.01m / orderItem.ItemOrder?.orderItems?.Count).ParseToString();
this.buyMapInfo = orderItem.TbBuyMap;
if (buyMapInfo != null)
{
BuyInfoVisivility = Visibility.Visible;
MapInfoVisivility = Visibility.Collapsed;
}
else
{
BuyInfoVisivility = Visibility.Collapsed;
MapInfoVisivility = Visibility.Visible;
}
} }
/// <summary> /// <summary>
@@ -191,7 +305,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (CloseAfterSecond > 0) if (CloseAfterSecond > 0)
{ {
Task.Run(() => _ = Task.Run(() =>
{ {
Thread.Sleep(1000 * CloseAfterSecond); Thread.Sleep(1000 * CloseAfterSecond);
if (_isWindowLoaded) if (_isWindowLoaded)
@@ -204,7 +318,50 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
} }
}); });
} }
await AutoLogin();
if (buyMapInfo != null)
{
this.txtMapGoodsNameVal = buyMapInfo.map_goods_name;
this.txtMapSkuNameVal = buyMapInfo.map_spec_name;
this.txtMapGoodsIdVal = buyMapInfo.map_goods_id;
this.txtMapSkuIdVal = buyMapInfo.map_sku_id;
this.txtSendProvinceVal = buyMapInfo.map_send_address;
this.transitWarehouse = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == buyMapInfo.transit_warehouse_id);
// 异常单重新拍单
if (AbnormalTransitWarehouseOrderInfo != null)
{
transitWarehouse = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == AbnormalTransitWarehouseOrderInfo.platform);
}
if (transitWarehouse != null && this.BuyType == "transit")
{
cmbTransitWarehouseVal = transitWarehouse?.TransName + " " + transitWarehouse?.TransDetailAddress;
txtBuyTransitWarehouseVal = transitWarehouse?.TransDetailAddress;
}
else
{
txtBuyTransitWarehouseVal = orderItem.ItemOrder.AddressStr;
}
}
var transit = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransDetailAddress == txtBuyTransitWarehouseVal);
if (AbnormalTransitWarehouseOrderInfo != null)
{
txtSourceCodeVal = AbnormalTransitWarehouseOrderInfo.random_code;
}
else if (buyMapInfo != null && transit != null)
{
var sourceCodeRst = GetSourceCode(transit);
if (sourceCodeRst.Contains("失败"))
{
CefWebBrowser.Visibility = Visibility.Collapsed;
BaseMsgWindow.ShowError(sourceCodeRst);
return;
}
}
await AutoSearchGoods();
} }
/// <summary> /// <summary>
@@ -218,7 +375,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
/// <summary> /// <summary>
/// 自动登录店铺后台 /// 自动登录店铺后台
/// </summary> /// </summary>
private async Task AutoLogin() private async Task AutoSearchGoods()
{ {
if (buyer == null) if (buyer == null)
return; return;
@@ -490,7 +647,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
this.buymapSkuInfo = new WXBuyMapSkusInfo() this.buymapSkuInfo = new WXBuyMapSkusInfo()
{ {
source_platform = "tb", platform = "tb",
map_goods_id = BaseRegex.GetStringJson(ref loaderData, "itemId"), map_goods_id = BaseRegex.GetStringJson(ref loaderData, "itemId"),
map_goods_name = BaseRegex.GetStringJson(ref goodsItemStr, "title"), map_goods_name = BaseRegex.GetStringJson(ref goodsItemStr, "title"),
map_url = "929536442189", map_url = "929536442189",
@@ -534,8 +691,6 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
var oneGoodsPrice = sku.oldGroupPrice.ParseToInt(); var oneGoodsPrice = sku.oldGroupPrice.ParseToInt();
var buyCnt = orderItem.sku_cnt; var buyCnt = orderItem.sku_cnt;
var buyPrice = oneGoodsPrice * buyCnt; var buyPrice = oneGoodsPrice * buyCnt;
var orderSn = "";
// 自动填写关联信息界面 // 自动填写关联信息界面
this.txtMapGoodsIdVal = goodsId.ParseToString(); this.txtMapGoodsIdVal = goodsId.ParseToString();
@@ -586,6 +741,214 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (this.currentUrl != buyerLoginUrl) if (this.currentUrl != buyerLoginUrl)
this.CefWebBrowser?.Load(buyerLoginUrl); this.CefWebBrowser?.Load(buyerLoginUrl);
} }
private string GetSourceCode(TransitWarehouseParam transit)
{
JObject body = new JObject();
body["province"] = transit.province_name;
body["city"] = transit.city_name;
body["warehouseCode"] = transit.TransId;
body["matchType"] = 1;
var url = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/getRandomTraceCode";
var dataStr = JsonHelper.SerializeObject(body);
var sourceCodeRst = HttpResponseWXBLL.e57PostResponse(url, dataStr, "");
var randomCode = BaseRegex.GetStringXml(ref sourceCodeRst, "randomCode");
if (!string.IsNullOrEmpty(randomCode))
{
txtSourceCodeVal = randomCode;
return randomCode;
}
else
{
return "获取失败,请关闭拍单窗口重试 " + BaseRegex.GetStringXml(ref sourceCodeRst, "msg", sourceCodeRst);
}
}
private async void UpdateTransitWarehouse()
{
var sendProvince = txtSendProvinceVal;
if (transitWarehouse == null && !cmbTransitWarehouseVal.IsNullOrEmpty())
{
transitWarehouse = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransName + " " + t.TransDetailAddress == cmbTransitWarehouseVal.ParseToString());
}
if (transitWarehouse == null)
{
BaseMsgWindow.ShowError("仓库不能为空");
return;
}
this.pddFrontGoodsLite = JsonHelper.DeserializeJsonToObject<pddFrontGoods3Lite>(buymapSkuInfo?.map_skus);
// 通过map反查商品,淘宝暂时不需要
//if ((this.pddFrontGoodsLite?.goodsId).IsNullOrZero() || (this.pddFrontGoodsLite?.mallId).IsNullOrZero())
//{
// 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);
// for (int i = 0; i < 80; i++)
// {
// if (!(this.pddFrontGoodsLite?.mallId).IsNullOrZero())
// break;
// Thread.Sleep(100);
// }
// });
//}
this.Enabled = false;
if (!this.CefWebBrowser.Address.StartsWith("https://mobile.yangkeduo.com/order.html?order_sn=") && (this.pddFrontGoodsLite?.goodsId).ParseToString() == txtMapGoodsIdVal.Trim())
{
}
string url;
string upSpuCode = txtSpuCodeVal.Trim();
string upSkuCode = txtSkuCodeVal.Trim();
// 保存sku及商品关联信息
var data = UserLogin.GetSignaturex()
+ "&spu_code=" + GetHtml.UrlEncodeUtf8(upSpuCode)
+ "&sku_code=" + GetHtml.UrlEncodeUtf8(upSkuCode)
+ "&main_user_name=" + BaseClass.MainUserName
+ "&map_goods_name=" + txtMapGoodsNameVal.Trim()
+ "&map_spec_name=" + txtMapSkuNameVal.Trim()
+ "&map_goods_id=" + txtMapGoodsIdVal.Trim()
+ "&map_sku_id=" + txtMapSkuIdVal.Trim()
+ "&map_send_address=" + sendProvince
+ "&transit_warehouse_id=" + transitWarehouse?.TransId;
// 关联平台为淘宝
data += "&platform=tb";
if (!(this.pddFrontGoodsLite?.mallId).IsNullOrZero() && this.pddFrontGoodsLite.goodsId.ParseToString() == txtMapGoodsIdVal.Trim())
{
// 保存商品关联信息
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(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.PddBuyMapSkus = buyMapSkuList.Where(s => s.platform == "pdd").ToList();
item.TbBuyMapSkus = buyMapSkuList.Where(s => s.platform == "tb").ToList();
//if (filterOrderAction != null)
//{
// item.SetOrderItemTextProperty();
// filterOrderAction(order, false);
//}
}
}
}
}
}
catch
{
}
}
}
url = BaseClass.Build29WxObjString("order/wx_add_mdy_buy_prod_map");
var result = await GetHtml.PostUtf8Async(url, data);
if (!result.Contains("\"code\":200"))
result = await GetHtml.PostUtf8Async(url, data);
if (!result.Contains("\"code\":200"))
{
this.Enabled = true;
BaseMsgWindow.ShowError("保存失败" + BaseRegex.GetStringJson(ref result, "msg") + ",请稍后重试");
}
else
{
var urlMap = BaseClass.Build29WxObjString("order/wx_get_buy_prod_map");
var dataMap = UserLogin.GetSignaturex()
+ "&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 = 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());
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 tbBuyMap = buyMapList.FirstOrDefault(b => b.spu_code == upSpuCode && b.sku_code == upSkuCode && b.platform == "tb");
if (tbBuyMap != null)
{
foreach (var order in GlobalConfig.lstOrder)
{
if (order.IsWaitBuy)
{
foreach (var item in order.orderItems)
{
if ((item.out_product_id == tbBuyMap.spu_code && item.out_sku_id == tbBuyMap.sku_code) ||
(item.out_product_id == tbBuyMap.spu_code && item.sku_attr_str == tbBuyMap.sku_code) ||
(item.product_id == tbBuyMap.spu_code && item.out_sku_id == tbBuyMap.sku_code) ||
(item.product_id == tbBuyMap.spu_code && item.sku_attr_str == tbBuyMap.sku_code))
{
item.TbBuyMap = tbBuyMap;
item.SetOrderItemTextProperty();
MainWindow.Instance.orderListCtrl.FilterOneOrder(order, false);
}
}
}
}
}
}
BaseMsgWindow.ShowInfo("保存成功!");
if (_isWindowLoaded)
{
Application.Current?.Dispatcher.Invoke(new Action(() =>
{
if (_isWindowLoaded)
RequestClose?.Invoke();
}));
}
}
}
} }
public class TaoBaoSku2Info public class TaoBaoSku2Info
@@ -349,15 +349,32 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 关联拍单关系 // 危险物品禁止拍单,仅关联安全商品 // 关联拍单关系 // 危险物品禁止拍单,仅关联安全商品
//if (!GlobalConfig.lstDangerItemWord.Any(d => (item.title).ParseToString().Contains(d))) //if (!GlobalConfig.lstDangerItemWord.Any(d => (item.title).ParseToString().Contains(d)))
{ {
item.PddBuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id); var pddBuyMapLst = buyMapList.Where(m => m.platform == "pdd").ToList();
item.PddBuyMap = pddBuyMapLst.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
if (item.PddBuyMap == null) if (item.PddBuyMap == null)
item.PddBuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id); item.PddBuyMap = pddBuyMapLst.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
if (item.PddBuyMap == null) if (item.PddBuyMap == null)
item.PddBuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id); item.PddBuyMap = pddBuyMapLst.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
if (item.PddBuyMap == null) if (item.PddBuyMap == null)
item.PddBuyMap = buyMapList.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id); item.PddBuyMap = pddBuyMapLst.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
} }
item.PddBuyMapSkus = buyMapSkusList.Where(s => s.spu_code == item.out_product_id || s.spu_code == item.product_id).OrderByDescending(s => s.mdy_time).ToList(); item.PddBuyMapSkus = buyMapSkusList.Where(s => s.spu_code == item.out_product_id || s.spu_code == item.product_id).OrderByDescending(s => s.mdy_time)
.Where(s => s.platform == "pdd").ToList();
{
var tbBuyMapLst = buyMapList.Where(m => m.platform == "tb").ToList();
item.TbBuyMap = tbBuyMapLst.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.out_product_id);
if (item.TbBuyMap == null)
item.TbBuyMap = tbBuyMapLst.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.out_product_id);
if (item.TbBuyMap == null)
item.TbBuyMap = tbBuyMapLst.FirstOrDefault(b => b.sku_code == item.out_sku_id && b.spu_code == item.product_id);
if (item.TbBuyMap == null)
item.TbBuyMap = tbBuyMapLst.FirstOrDefault(b => b.sku_code == item.sku_attr_str && b.spu_code == item.product_id);
}
item.TbBuyMapSkus = buyMapSkusList.Where(s => s.spu_code == item.out_product_id || s.spu_code == item.product_id).OrderByDescending(s => s.mdy_time)
.Where(s => s.platform == "tb").ToList();
// 中转仓订单 // 中转仓订单
if (item.ItemOrder.orderItems.Count > 1) if (item.ItemOrder.orderItems.Count > 1)
@@ -846,6 +863,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
var buyMapList = JsonHelper.DeserializeJsonToList<WXBuyMapInfo>(JObject.Parse(resultMap)["data"].ParseToString()); 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(); 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); GlobalConfig.BuyMapList.AddRange(buyMapList);
if (buyMapList.Count > 0)
{
}
} }
catch catch
{ {
@@ -1484,7 +1484,8 @@
HorizontalAlignment="Center" HorizontalAlignment="Center"
d:Visibility="Visible" d:Visibility="Visible"
Click="btnChangeWaybill_Click" Click="btnChangeWaybill_Click"
Content="修改物流" Content="补发/修改物流"
FontSize="11"
Style="{StaticResource BasePageButtonLightStyle}" Style="{StaticResource BasePageButtonLightStyle}"
Visibility="{Binding ItemOrder.IsShowChangeWaybillBtn, Converter={StaticResource VisibleToVisibilityConverter}}" /> Visibility="{Binding ItemOrder.IsShowChangeWaybillBtn, Converter={StaticResource VisibleToVisibilityConverter}}" />
<Button <Button
@@ -524,7 +524,11 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
public static void TbBuyOrder(oms_wei_order_item_info orderItem, bool isAbnormalOrder, bool isAutoBuy) public static void TbBuyOrder(oms_wei_order_item_info orderItem, bool isAbnormalOrder, bool isAutoBuy)
{ {
TaobaoBuyOrderCtrl taobaoBuyView = new TaobaoBuyOrderCtrl(GlobalConfig.CurrentTaobaoBuyer, orderItem); TaobaoBuyOrderCtrl taobaoBuyView = new TaobaoBuyOrderCtrl(GlobalConfig.CurrentTaobaoBuyer, orderItem);
taobaoBuyView.ViewModel.InitUrl = "https://s.taobao.com/search?"; //https://item.taobao.com/item.htm?id=756295486950&skuId=5216824841295
if (orderItem.TbBuyMap != null)
taobaoBuyView.ViewModel.InitUrl = "https://item.taobao.com/item.htm?id=" + orderItem.TbBuyMap.map_goods_id + "&skuId=" + orderItem.TbBuyMap.map_sku_id;
else
taobaoBuyView.ViewModel.InitUrl = "https://s.taobao.com/search?";
new DialogWindow() new DialogWindow()
{ {
Title = "淘宝买手登录", Title = "淘宝买手登录",
@@ -1781,7 +1785,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{ {
if (DataContext is oms_wei_order_item_info orderItem && orderItem.ItemOrder != null) if (DataContext is oms_wei_order_item_info orderItem && orderItem.ItemOrder != null)
{ {
ChangeWaybillView changeWaybillView = new ChangeWaybillView(orderItem.ItemOrder); ChangeWaybillView changeWaybillView = new ChangeWaybillView(orderItem);
new DialogWindow() new DialogWindow()
{ {
Title = "修改订单物流", Title = "修改订单物流",
@@ -8,6 +8,7 @@ using NaiBa.Util.Extension;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -26,16 +27,22 @@ namespace _29WxOrderWpf.ViewModels
/// </summary> /// </summary>
public class ChangeWaybillViewModel : PropertyNotifyObject public class ChangeWaybillViewModel : PropertyNotifyObject
{ {
public oms_wei_order_info Order public oms_wei_order_item_info OrderItem
{ {
get { return this.GetValue(x => x.Order); } get { return this.GetValue(x => x.OrderItem); }
set { this.SetValue(x => x.Order, value); } set { this.SetValue(x => x.OrderItem, value); }
} }
public string WaybillId public string WaybillId
{ {
get { return this.GetValue(x => x.WaybillId); } get { return this.GetValue(x => x.WaybillId); }
set { this.SetValue(x => x.WaybillId, value); } set { this.SetValue(x => x.WaybillId, value); }
} }
public string CompensationWaybillId
{
get { return this.GetValue(x => x.CompensationWaybillId); }
set { this.SetValue(x => x.CompensationWaybillId, value); }
}
public bool IsChangeingWaybill public bool IsChangeingWaybill
{ {
get { return this.GetValue(x => x.IsChangeingWaybill); } get { return this.GetValue(x => x.IsChangeingWaybill); }
@@ -55,16 +62,18 @@ namespace _29WxOrderWpf.ViewModels
#region 命令 #region 命令
public ICommand ChangeWaybillCommand { get; } public ICommand ChangeWaybillCommand { get; }
public ICommand SendCompensationDeliveryCommand { get; }
#endregion #endregion
private volatile bool _isWindowLoaded = false; private volatile bool _isWindowLoaded = false;
public ChangeWaybillViewModel(oms_wei_order_info _order) public ChangeWaybillViewModel(oms_wei_order_item_info _orderItem)
{ {
Order = _order; OrderItem = _orderItem;
//IsChangeingWaybill = true; //IsChangeingWaybill = true;
ChangeWaybillCommand = new DelegateCommand(ChangeWaybill); ChangeWaybillCommand = new DelegateCommand(ChangeWaybill);
SendCompensationDeliveryCommand = new DelegateCommand(SendCompensationDelivery);
} }
/// <summary> /// <summary>
@@ -85,8 +94,8 @@ namespace _29WxOrderWpf.ViewModels
public void ChangeWaybill() public void ChangeWaybill()
{ {
ChangeWaybillSuccess = false; ChangeWaybillSuccess = false;
string orderId = Order.order_id; string orderId = OrderItem.order_id;
ShopLoginInfo shop = Order.Shop; ShopLoginInfo shop = OrderItem?.ItemOrder?.Shop;
Task.Run(async () => Task.Run(async () =>
{ {
// 查询订单是否在代发货中,如果代发需要取消代发 // 查询订单是否在代发货中,如果代发需要取消代发
@@ -99,7 +108,7 @@ namespace _29WxOrderWpf.ViewModels
if (apiSearchDropship.Contains("ds_order_id_list") && !apiSearchDropship.Contains("\"ds_order_id_list\":[]")) if (apiSearchDropship.Contains("ds_order_id_list") && !apiSearchDropship.Contains("\"ds_order_id_list\":[]"))
{ {
var dsOrderId = JsonHelper.JObjectParse(apiSearchDropship)["ds_order_id_list"].FirstOrDefault().ParseToString(); var dsOrderId = JsonHelper.JObjectParse(apiSearchDropship)["ds_order_id_list"].FirstOrDefault().ParseToString();
var apiCancelDropship = await new WxApiBLL().WxApiDropshipCancel(shop, Order, dsOrderId); var apiCancelDropship = await new WxApiBLL().WxApiDropshipCancel(shop, OrderItem?.ItemOrder, dsOrderId);
if (!apiCancelDropship.Contains("\"errcode\":0")) if (!apiCancelDropship.Contains("\"errcode\":0"))
{ {
@@ -125,6 +134,7 @@ namespace _29WxOrderWpf.ViewModels
// 待发货暂不处理 // 待发货暂不处理
//{"orderId":"3736580679658008320","deliveryProduct":{"deliveryId":"YUNDA","waybillId":"313023381086999","isAllProduct":true,"deliverType":1}} //{"orderId":"3736580679658008320","deliveryProduct":{"deliveryId":"YUNDA","waybillId":"313023381086999","isAllProduct":true,"deliverType":1}}
//{"code":0,"errcode":0,"errmsg":"ok"} //{"code":0,"errcode":0,"errmsg":"ok"}
rst = WxSimOrderSendBLL.orderSendOut(shop, orderId, WaybillId); rst = WxSimOrderSendBLL.orderSendOut(shop, orderId, WaybillId);
if (!rst.Contains("\"code\":0")) if (!rst.Contains("\"code\":0"))
{ {
@@ -136,10 +146,10 @@ namespace _29WxOrderWpf.ViewModels
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark"); var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
var data = UserLogin.GetSignaturex(); var data = UserLogin.GetSignaturex();
if (!Order.soft_remark.ParseToString().Contains("已修改物流")) if (OrderItem?.ItemOrder != null && !(OrderItem?.ItemOrder?.soft_remark).ParseToString().Contains("已修改物流"))
Order.soft_remark = ("已修改物流 " + Order.soft_remark).Trim(); OrderItem.ItemOrder.soft_remark = ("已修改物流 " + OrderItem.ItemOrder.soft_remark).Trim();
data += "&order_id=" + Order.order_id; data += "&order_id=" + OrderItem?.ItemOrder?.order_id;
data += "&soft_remark=" + Order.soft_remark; data += "&soft_remark=" + OrderItem?.ItemOrder?.soft_remark;
var html = GetHtml.PostUtf8(url, data); var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data); html = GetHtml.PostUtf8(url, data);
@@ -154,6 +164,7 @@ namespace _29WxOrderWpf.ViewModels
} }
else else
{ {
//{"orderId":"3736580679658008320","changeInfo":[{"old":{"deliveryId":"YUNDA","waybillId":"313023381086999","productInfos":[{"productId":"10000875072190","skuId":"15516018429","productCnt":1}]},"new":{"deliveryId":"OTHER","waybillId":"772064082455686","productInfos":[{"productId":"10000875072190","skuId":"15516018429","productCnt":1}]}}]} //{"orderId":"3736580679658008320","changeInfo":[{"old":{"deliveryId":"YUNDA","waybillId":"313023381086999","productInfos":[{"productId":"10000875072190","skuId":"15516018429","productCnt":1}]},"new":{"deliveryId":"OTHER","waybillId":"772064082455686","productInfos":[{"productId":"10000875072190","skuId":"15516018429","productCnt":1}]}}]}
//{"code":0,"errcode":0,"errmsg":""} //{"code":0,"errcode":0,"errmsg":""}
var orderExpressInfoObj = JsonHelper.JObjectParse(rst)["orderDetail"]["expressInfo"]; var orderExpressInfoObj = JsonHelper.JObjectParse(rst)["orderDetail"]["expressInfo"];
@@ -196,10 +207,10 @@ namespace _29WxOrderWpf.ViewModels
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark"); var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
var data = UserLogin.GetSignaturex(); var data = UserLogin.GetSignaturex();
if (!Order.soft_remark.ParseToString().Contains("已修改物流")) if (OrderItem?.ItemOrder != null && !OrderItem.ItemOrder.soft_remark.ParseToString().Contains("已修改物流"))
Order.soft_remark = ("已修改物流 " + Order.soft_remark).Trim(); OrderItem.ItemOrder.soft_remark = ("已修改物流 " + OrderItem.ItemOrder.soft_remark).Trim();
data += "&order_id=" + Order.order_id; data += "&order_id=" + OrderItem?.ItemOrder?.order_id;
data += "&soft_remark=" + Order.soft_remark; data += "&soft_remark=" + OrderItem?.ItemOrder?.soft_remark;
var html = GetHtml.PostUtf8(url, data); var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data); html = GetHtml.PostUtf8(url, data);
@@ -214,5 +225,41 @@ namespace _29WxOrderWpf.ViewModels
} }
}); });
} }
public void SendCompensationDelivery()
{
var orderId = OrderItem.order_id;
var shop = OrderItem?.ItemOrder?.Shop;
// 模拟接口补发
//rst = WxSimOrderSendBLL.orderCompensationDelivery(shop, orderId, "ZTO", WaybillId, OrderItem.product_id, OrderItem.sku_id, OrderItem.sku_cnt.ParseToInt());
var rst = WxSimOrderSendBLL.orderCompensationDelivery(shop, orderId, "OTHER", CompensationWaybillId, OrderItem.product_id, OrderItem.sku_id, OrderItem.sku_cnt.ParseToInt());
var url = BaseClass.Build29WxObjString("order/wx_update_erp_soft_remark");
var data = UserLogin.GetSignaturex();
if (OrderItem?.ItemOrder != null && !OrderItem.ItemOrder.soft_remark.ParseToString().Contains("已补发包裹"))
OrderItem.ItemOrder.soft_remark = ("已补发包裹 " + OrderItem.ItemOrder.soft_remark).Trim();
data += "&order_id=" + OrderItem?.ItemOrder?.order_id;
data += "&soft_remark=" + OrderItem?.ItemOrder?.soft_remark;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (!rst.Contains("\"code\":0"))
{
var error = BaseRegex.GetStringJsonByRegs(ref rst, rst, "err_msg", "error_msg", "errMsg", "errorMsg", "msg");
IsChangeingWaybill = false;
BaseMsgWindow.ShowError("订单补发失败 " + error);
return;
}
Application.Current?.Dispatcher.Invoke(new Action(() =>
{
ChangeWaybillSuccess = true;
IsChangeingWaybill = false;
BaseMsgWindow.ShowInfo("订单补发成功");
RequestClose?.Invoke();
}));
}
} }
} }
+79 -30
View File
@@ -7,19 +7,55 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="ChangeWaybillCtrl" x:Name="ChangeWaybillCtrl"
Width="450" Width="450"
Height="300" Height="350"
d:DesignHeight="300" d:DesignHeight="350"
d:DesignWidth="450" d:DesignWidth="450"
Loaded="ChangeWaybillView_Loaded" Loaded="ChangeWaybillView_Loaded"
mc:Ignorable="d"> mc:Ignorable="d">
<Grid Background="White"> <Grid Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Image
x:Name="imgLoading"
Width="20"
Height="20"
Margin="0,30,30,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
IsEnabled="False"
Source="{StaticResource imgLoadingPic}"
Visibility="{Binding IsChangeingWaybill, Converter={StaticResource visibleToVisibilityConverter}}">
<Image.RenderTransform>
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
</Image.RenderTransform>
<Image.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
RepeatBehavior="Forever"
Storyboard.TargetName="imgLoading"
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
From="360"
To="0"
Duration="0:0:3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
<StackPanel Margin="24,24,24,0"> <StackPanel Margin="24,24,24,0">
<TextBlock <TextBlock
Margin="0,0,0,20" Margin="0,0,0,10"
HorizontalAlignment="Center" HorizontalAlignment="Center"
FontSize="15" FontSize="15"
Foreground="#333333" Foreground="#333333"
Text="更改订单运单号" /> Text="更改运单号" />
<StackPanel> <StackPanel>
<TextBlock <TextBlock
@@ -45,39 +81,52 @@
Command="{Binding ChangeWaybillCommand}" Command="{Binding ChangeWaybillCommand}"
Content="确定更改" Content="确定更改"
Style="{StaticResource BasePageButtonStyle}" /> Style="{StaticResource BasePageButtonStyle}" />
<Image </WrapPanel>
x:Name="imgLoading" </StackPanel>
Width="20" </StackPanel>
Height="20"
IsEnabled="False" <StackPanel Grid.Row="1" Margin="24,24,24,0">
Source="{StaticResource imgLoadingPic}" <TextBlock
Visibility="{Binding IsChangeingWaybill, Converter={StaticResource visibleToVisibilityConverter}}"> Margin="0,0,0,10"
<Image.RenderTransform> HorizontalAlignment="Center"
<RotateTransform Angle="45" CenterX="10" CenterY="10" /> FontSize="15"
</Image.RenderTransform> Foreground="#333333"
<Image.Triggers> Text="订单补寄" />
<EventTrigger RoutedEvent="Image.Loaded">
<BeginStoryboard> <StackPanel>
<Storyboard> <TextBlock
<DoubleAnimation Margin="0,0,0,8"
RepeatBehavior="Forever" Foreground="#555555"
Storyboard.TargetName="imgLoading" Text="填写补寄运单号:" />
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" <TextBox
From="360" x:Name="txtCompensationWaybillId"
To="0" Height="38"
Duration="0:0:3" /> VerticalContentAlignment="Center"
</Storyboard> d:Text="1111"
</BeginStoryboard> BorderBrush="#D0D0D0"
</EventTrigger> BorderThickness="1"
</Image.Triggers> FontSize="18"
</Image> Text="{Binding CompensationWaybillId, UpdateSourceTrigger=PropertyChanged}"
VerticalScrollBarVisibility="Auto" />
<WrapPanel Margin="0,10,0,0" FlowDirection="RightToLeft">
<Button
Width="64"
Height="26"
Margin="0,0,10,0"
HorizontalAlignment="Right"
Command="{Binding SendCompensationDeliveryCommand}"
Content="确定补寄"
Style="{StaticResource BasePageButtonStyle}" />
</WrapPanel> </WrapPanel>
<TextBlock <TextBlock
d:Text="textBlock" d:Text="textBlock"
Foreground="Red"
Text="" Text=""
TextWrapping="Wrap" /> TextWrapping="Wrap" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</Grid> </Grid>
</UserControl> </UserControl>
+3 -3
View File
@@ -28,11 +28,11 @@ public partial class ChangeWaybillView : UserControl
/// </summary> /// </summary>
public ChangeWaybillViewModel ViewModel { get; } public ChangeWaybillViewModel ViewModel { get; }
public ChangeWaybillView(oms_wei_order_info _order) public ChangeWaybillView(oms_wei_order_item_info _orderItem)
{ {
InitializeComponent(); InitializeComponent();
ViewModel = new ChangeWaybillViewModel(_order); ViewModel = new ChangeWaybillViewModel(_orderItem);
ViewModel.RequestClose += ViewModel_RequestClose; ViewModel.RequestClose += ViewModel_RequestClose;
DataContext = ViewModel; DataContext = ViewModel;
} }
@@ -53,7 +53,7 @@ public partial class ChangeWaybillView : UserControl
if (this.IsLoaded && parentWindow != null) if (this.IsLoaded && parentWindow != null)
parentWindow.Close(); parentWindow.Close();
MainWindow.Instance.orderListCtrl.FilterOneOrder(ViewModel.Order); MainWindow.Instance.orderListCtrl.FilterOneOrder(ViewModel.OrderItem?.ItemOrder);
} }
private void Button_Click(object sender, RoutedEventArgs e) private void Button_Click(object sender, RoutedEventArgs e)
+2 -2
View File
@@ -32,7 +32,7 @@ namespace AllBase.Model.DBModel
public string transit_warehouse_id { get; set; } public string transit_warehouse_id { get; set; }
public DateTime add_time { get; set; } public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; } public DateTime mdy_time { get; set; }
public string source_platform { get; set; } = "pdd"; public string platform { get; set; } = "pdd";
} }
public class WXBuyMapSkusInfo : PropertyNotifyObject public class WXBuyMapSkusInfo : PropertyNotifyObject
{ {
@@ -87,6 +87,6 @@ namespace AllBase.Model.DBModel
public string transit_warehouse_id { get; set; } public string transit_warehouse_id { get; set; }
public DateTime add_time { get; set; } public DateTime add_time { get; set; }
public DateTime mdy_time { get; set; } public DateTime mdy_time { get; set; }
public string source_platform { get; set; } = "pdd"; public string platform { get; set; } = "pdd";
} }
} }
@@ -63,10 +63,7 @@ namespace AllBase.Model.DBModel
public List<WXBuyMapSkusInfo> TbBuyMapSkus public List<WXBuyMapSkusInfo> TbBuyMapSkus
{ {
get { return this.GetValue(x => x.TbBuyMapSkus); } get { return this.GetValue(x => x.TbBuyMapSkus); }
set set { this.SetValue(x => x.TbBuyMapSkus, value); }
{
this.SetValue(x => x.TbBuyMapSkus, value);
}
} }
/// <summary> /// <summary>
+18
View File
@@ -40,5 +40,23 @@ namespace Work._29Tools.BLL
var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere); var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, refere);
return result; return result;
} }
/// <summary>
/// 补发货接口
/// </summary>
/// <param name="shop"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public static string orderCompensationDelivery(ShopLoginInfo shop, string orderId, string deliveryId, string waybillId, string productId, string skuId, int productCnt)
{
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeorder/ship/cgi/compensationDelivery?token=&lang=zh_CN";
string referer = "https://store.weixin.qq.com/shop/order/list";
//string body = @"{""orderId"":""3736582240830642176"",""reason"":1,""deliveryProductInfo"":[{""deliveryId"":""EMS"",""waybillId"":""9822445565261"",""productInfos"":[{""productId"":""10000697373414"",""skuId"":""11709320615"",""productCnt"":1}]}]}";
string body = @"{""orderId"":""" + orderId + @""",""reason"":1,""deliveryProductInfo"":[{""deliveryId"":""" + deliveryId +
@""",""waybillId"":""" + waybillId + @""",""productInfos"":[{""productId"":""" + productId + @""",""skuId"":""" + skuId +
@""",""productCnt"":" + productCnt + @"}]}]}";
var result = HttpResponseWXBLL.WeiXinPostResponse(shop, url, body, referer);
return result;
}
} }
} }
+3 -3
View File
@@ -1118,8 +1118,8 @@ namespace TemuKJD.ToolForms
{ {
if (item.out_product_id == upSpuCode || item.product_id == upSpuCode) if (item.out_product_id == upSpuCode || item.product_id == upSpuCode)
{ {
item.PddBuyMapSkus = buyMapSkuList.Where(s => s.source_platform == "pdd").ToList(); item.PddBuyMapSkus = buyMapSkuList.Where(s => s.platform == "pdd").ToList();
item.PddBuyMapSkus = buyMapSkuList.Where(s => s.source_platform == "pdd").ToList(); item.TbBuyMapSkus = buyMapSkuList.Where(s => s.platform == "tb").ToList();
//if (filterOrderAction != null) //if (filterOrderAction != null)
//{ //{
@@ -1171,7 +1171,7 @@ namespace TemuKJD.ToolForms
catch catch
{ {
} }
var pddBuyMap = buyMapList.FirstOrDefault(b => b.spu_code == upSpuCode && b.sku_code == upSkuCode && b.source_platform == "pdd"); var pddBuyMap = buyMapList.FirstOrDefault(b => b.spu_code == upSpuCode && b.sku_code == upSkuCode && b.platform == "pdd");
if (pddBuyMap != null) if (pddBuyMap != null)
{ {
foreach (var order in GlobalConfig.lstOrder) foreach (var order in GlobalConfig.lstOrder)