Browse Source

1

updatebug
shanji 2 years ago
parent
commit
b5c51b9ce4
  1. 12
      BBWYB.Client/Models/APIModel/Response/Order/OrderPurchaseInfoResponse.cs
  2. 18
      BBWYB.Client/Models/APIModel/Response/Order/OrderResponse.cs
  3. 8
      BBWYB.Client/Models/Order/Order.cs
  4. 2
      BBWYB.Client/Views/MainWindow.xaml
  5. 106
      BBWYB.Client/Views/Order/OrderList.xaml
  6. 44
      BBWYB.Server.Business/Order/OrderBusiness.cs
  7. 44
      BBWYB.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs
  8. 24
      BBWYB.Server.Business/Sync/OrderSyncBusiness.cs
  9. 40
      BBWYB.Server.Model/Db/Order/Order.cs
  10. 18
      BBWYB.Server.Model/Db/Order/OrderPurchaseInfo.cs
  11. 10
      BBWYB.Server.Model/Dto/Request/Order/OutStockRequest.cs
  12. 10
      BBWYB.Server.Model/Dto/Response/Order/OrderResponse.cs

12
BBWYB.Client/Models/APIModel/Response/Order/OrderPurchaseInfoResponse.cs

@ -19,5 +19,17 @@ namespace BBWYB.Client.Models
public string PurchaserName { get; set; } public string PurchaserName { get; set; }
public string WaybillNo { get; set; }
public string SourceExpressName { get; set; }
public string SourceExpressId { get; set; }
public string TargetExpressName { get; set; }
public string TargetExpressId { get; set; }
public string BelongSkuIds { get; set; }
} }
} }

18
BBWYB.Client/Models/APIModel/Response/Order/OrderResponse.cs

@ -92,15 +92,15 @@ namespace BBWYB.Client.Models
/// </summary> /// </summary>
public string PurchaseRemark { get; set; } public string PurchaseRemark { get; set; }
/// <summary> ///// <summary>
/// 运单号 ///// 运单号
/// </summary> ///// </summary>
public string WaybillNo { get; set; } //public string WaybillNo { get; set; }
/// <summary> ///// <summary>
/// 快递公司名称 ///// 快递公司名称
/// </summary> ///// </summary>
public string ExpressName { get; set; } //public string ExpressName { get; set; }
/// <summary> /// <summary>
/// 来源Sku /// 来源Sku

8
BBWYB.Client/Models/Order/Order.cs

@ -13,7 +13,6 @@ namespace BBWYB.Client.Models
} }
private OrderState orderState; private OrderState orderState;
private string waybillNo;
private string venderRemark; private string venderRemark;
public string Id { get; set; } public string Id { get; set; }
@ -105,19 +104,12 @@ namespace BBWYB.Client.Models
/// </summary> /// </summary>
public OrderState OrderState { get => orderState; set { SetProperty(ref orderState, value); } } public OrderState OrderState { get => orderState; set { SetProperty(ref orderState, value); } }
public string WaybillNo { get => waybillNo; set { SetProperty(ref waybillNo, value); } }
/// <summary> /// <summary>
/// 商家备注 /// 商家备注
/// </summary> /// </summary>
public string VenderRemark { get => venderRemark; set { SetProperty(ref venderRemark, value); } } public string VenderRemark { get => venderRemark; set { SetProperty(ref venderRemark, value); } }
/// <summary>
/// 快递公司名称
/// </summary>
public string ExpressName { get; set; }
/// <summary> /// <summary>
/// 来源Sku /// 来源Sku
/// </summary> /// </summary>

2
BBWYB.Client/Views/MainWindow.xaml

@ -24,7 +24,7 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0">
<TextBlock Text="{Binding GlobalContext.User.Name}"/> <TextBlock Text="{Binding GlobalContext.User.Name}"/>
<TextBlock Text="{Binding GlobalContext.User.Shop.ShopName}" Margin="5,0,0,0"/> <TextBlock Text="{Binding GlobalContext.User.Shop.ShopName}" Margin="5,0,0,0"/>
<TextBlock Text="v10007" Margin="5,0,0,0"/> <TextBlock Text="v10008" Margin="5,0,0,0"/>
</StackPanel> </StackPanel>
</Border> </Border>
<Grid Grid.Row="1"> <Grid Grid.Row="1">

106
BBWYB.Client/Views/Order/OrderList.xaml

@ -180,12 +180,12 @@
Foreground="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=已完成:White:#4A4A4A}" Foreground="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=已完成:White:#4A4A4A}"
Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Static cmodel:OrderState.已完成}"/> Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Static cmodel:OrderState.已完成}"/>
<c:BButton Content="已取消" Width="100" <c:BButton Content="已取消" Width="100"
Background="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=已取消:#8080FF:#F2F2F2}" Background="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=已取消:#8080FF:#F2F2fF2}"
Foreground="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=已取消:White:#4A4A4A}" Foreground="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=已取消:White:#4A4A4A}"
Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Static cmodel:OrderState.已取消}"/> Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Static cmodel:OrderState.已取消}"/>
</StackPanel> </StackPanel>
<Border x:Name="bd_statistics" Grid.RowSpan="3" HorizontalAlignment="Right" Padding="15,0" TextBlock.Foreground="{StaticResource Text.Color}"> <!--<Border x:Name="bd_statistics" Grid.RowSpan="3" HorizontalAlignment="Right" Padding="15,0" TextBlock.Foreground="{StaticResource Text.Color}">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="0.4*"/> <ColumnDefinition Width="0.4*"/>
@ -297,7 +297,7 @@
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Border> </Border>-->
<Border Grid.Row="4" Background="{StaticResource Border.Background}" <Border Grid.Row="4" Background="{StaticResource Border.Background}"
Visibility="{Binding Visibility,ElementName=listbox_order}"> Visibility="{Binding Visibility,ElementName=listbox_order}">
@ -316,7 +316,7 @@
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="351"/> <ColumnDefinition Width="351"/>
<ColumnDefinition/> <ColumnDefinition Width="210"/>
<ColumnDefinition Width="140"/> <ColumnDefinition Width="140"/>
<ColumnDefinition Width="100"/> <ColumnDefinition Width="100"/>
<ColumnDefinition/> <ColumnDefinition/>
@ -377,21 +377,13 @@
<c:BButton Style="{StaticResource LinkButton}" Content="{Binding SourceSku}" Margin="5,0,0,0" <c:BButton Style="{StaticResource LinkButton}" Content="{Binding SourceSku}" Margin="5,0,0,0"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}" Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding SourceSku}"/> CommandParameter="{Binding SourceSku}"/>
<!--<StackPanel x:Name="txt_consignee" Margin="5,0,0,0" Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="收货人:"/>
<TextBox Text="{Binding Consignee.ContactName}" Foreground="{StaticResource Text.Color}"
IsReadOnly="True" Background="Transparent" BorderThickness="0"/>
<TextBlock Text="联系电话:" Margin="5,0,0,0"/>
<TextBox Text="{Binding Consignee.Mobile}" Foreground="{StaticResource Text.Color}"
IsReadOnly="True" Background="Transparent" BorderThickness="0"/>
</StackPanel>-->
</StackPanel> </StackPanel>
<Border VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> <Border VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid> </Grid>
<Grid Grid.Row="1"> <Grid Grid.Row="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="350"/> <ColumnDefinition Width="350"/>
<ColumnDefinition/> <ColumnDefinition Width="210"/>
<ColumnDefinition Width="140"/> <ColumnDefinition Width="140"/>
<ColumnDefinition Width="100"/> <ColumnDefinition Width="100"/>
<ColumnDefinition/> <ColumnDefinition/>
@ -510,29 +502,6 @@
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ListBox.ItemTemplate>
</ListBox> </ListBox>
<!--<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"
Visibility="{Binding IsPurchased,ConverterParameter=true:Visible:Collapsed,Converter={StaticResource objConverter}}">
<TextBlock>
<Run Text="采购方式:"/>
<Run Text="{Binding OrderPurchaseInfo.PurchaseMethod}"/>
</TextBlock>
<TextBlock>
<Run Text="采购平台:"/>
<Run Text="{Binding OrderPurchaseInfo.PurchasePlatform}"/>
</TextBlock>
<TextBlock>
<Run Text="采购商家:"/>
<Run Text="{Binding OrderPurchaseInfo.PurchaserName}"/>
</TextBlock>
<TextBlock>
<Run Text="采购账号:"/>
<Run Text="{Binding OrderPurchaseInfo.PurchaseAccountName}"/>
</TextBlock>
<TextBlock>
<Run Text="订单号:"/>
<Run Text="{Binding OrderPurchaseInfo.PurchaseOrderId}"/>
</TextBlock>
</StackPanel>-->
<Border x:Name="bd_costbg" Background="#FCECEE" Grid.Column="2" Margin="0,0,1,0" <Border x:Name="bd_costbg" Background="#FCECEE" Grid.Column="2" Margin="0,0,1,0"
Visibility="{Binding IsCostException,ConverterParameter=true:Visible:Collapsed}"/> Visibility="{Binding IsCostException,ConverterParameter=true:Visible:Collapsed}"/>
@ -561,25 +530,6 @@
</Path> </Path>
</StackPanel> </StackPanel>
<!--<Path Style="{StaticResource path_question}" Width="14" Margin="5,0,0,0" Fill="{StaticResource Text.Pink}" ToolTipService.InitialShowDelay="0">
<Path.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<ListBox ItemsSource="{Binding OrderCouponList}"
Style="{StaticResource NoScrollViewListBoxStyle}" Foreground="{StaticResource Text.Color}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock>
<Run Text="{Binding CouponType}"/>
<Run Text="{Binding CouponPrice,StringFormat=¥{0}}"/>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</ToolTip>
</Path.ToolTip>
</Path>
</StackPanel>-->
<StackPanel x:Name="sp_purchaseAmount" Orientation="Horizontal"> <StackPanel x:Name="sp_purchaseAmount" Orientation="Horizontal">
<TextBlock> <TextBlock>
<Run Text="采购成本"/> <Run Text="采购成本"/>
@ -627,11 +577,11 @@
<Grid x:Name="sp_store" Grid.Column="4"> <Grid x:Name="sp_store" Grid.Column="4">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"> <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal" <!--<StackPanel Orientation="Horizontal"
Visibility="{Binding WaybillNo,ConverterParameter=#null:Collapsed:Visible,Converter={StaticResource objConverter}}"> Visibility="{Binding WaybillNo,ConverterParameter=#null:Collapsed:Visible,Converter={StaticResource objConverter}}">
<TextBlock Text="{Binding ExpressName}" TextWrapping="Wrap"/> <TextBlock Text="{Binding ExpressName}" TextWrapping="Wrap"/>
<!--{Binding ExpressName}--> --><!--{Binding ExpressName}-->
<!--{Binding WaybillNo}--> <!--{Binding WaybillNo}--><!--
<c:BButton Style="{StaticResource LinkButton}" <c:BButton Style="{StaticResource LinkButton}"
@ -639,8 +589,28 @@
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}" Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding WaybillNo}" CommandParameter="{Binding WaybillNo}"
Margin="10,0,0,0"/> Margin="10,0,0,0"/>
</StackPanel> </StackPanel>-->
<ListBox ItemsSource="{Binding OrderPurchaseInfoList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
Style="{StaticResource NoScrollViewListBoxStyle}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal"
Visibility="{Binding WaybillNo,ConverterParameter=#null:Collapsed:Visible,Converter={StaticResource objConverter}}">
<TextBlock>
<Run Text="物流状态:" Foreground="Black"/>
<Run Text="待对接" Foreground="{StaticResource Text.Link.Color}"/>
</TextBlock>
<TextBlock Margin="10,0,0,0">
<Run Text="{Binding SourceExpressName,StringFormat=\{0\}:}" Foreground="Black"/>
<Run Text="{Binding WaybillNo}"/>
</TextBlock>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock> <TextBlock>
@ -671,8 +641,7 @@
</Grid> </Grid>
<StackPanel Orientation="Vertical" Grid.Column="5" Margin="5,5,5,0"> <StackPanel Orientation="Vertical" Grid.Column="5" Margin="5,5,5,0">
<StackPanel x:Name="sp_buyerRemark" <StackPanel Visibility="{Binding BuyerRemark,ConverterParameter=#null:Collapsed:Visible,Converter={StaticResource objConverter}}">
Visibility="{Binding BuyerRemark,ConverterParameter=#null:Collapsed:Visible,Converter={StaticResource objConverter}}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="买家备注"/> <TextBlock Text="买家备注"/>
<c:BButton Content="复制" Style="{StaticResource LinkButton}" Margin="5,0,0,0" <c:BButton Content="复制" Style="{StaticResource LinkButton}" Margin="5,0,0,0"
@ -682,17 +651,16 @@
<TextBlock Text="{Binding BuyerRemark}" TextWrapping="Wrap"/> <TextBlock Text="{Binding BuyerRemark}" TextWrapping="Wrap"/>
</StackPanel> </StackPanel>
<!--<StackPanel x:Name="sp_venderRemark" Margin="0,5,0,0"> <StackPanel Visibility="{Binding PurchaseRemark,ConverterParameter=#null:Collapsed:Visible,Converter={StaticResource objConverter}}"
Margin="0,10,0,0">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="商家备注"/> <TextBlock Text="采购备注"/>
<c:BButton x:Name="btn_copyVenderRemark" Content="复制" Style="{StaticResource LinkButton}" Margin="5,0,0,0" <c:BButton Content="复制" Style="{StaticResource LinkButton}" Margin="5,0,0,0"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}" Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding VenderRemark}"/> CommandParameter="{Binding PurchaseRemark}"/>
<c:BButton Content="修改" Style="{StaticResource LinkButton}" Margin="5,0,0,0" </StackPanel>
Command="{Binding DataContext.EditVenderRemarkCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}" <TextBlock Text="{Binding PurchaseRemark}" TextWrapping="Wrap"/>
CommandParameter="{Binding }"/>
</StackPanel> </StackPanel>
</StackPanel>-->
</StackPanel> </StackPanel>
</Grid> </Grid>
<Border Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> <Border Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>

44
BBWYB.Server.Business/Order/OrderBusiness.cs

@ -5,6 +5,7 @@ using BBWYB.Server.Model;
using BBWYB.Server.Model.Db; using BBWYB.Server.Model.Db;
using BBWYB.Server.Model.Dto; using BBWYB.Server.Model.Dto;
using FreeSql; using FreeSql;
using Newtonsoft.Json;
using SDKAdapter; using SDKAdapter;
using SDKAdapter.OperationPlatform.Client; using SDKAdapter.OperationPlatform.Client;
using SDKAdapter.OperationPlatform.Models; using SDKAdapter.OperationPlatform.Models;
@ -84,13 +85,13 @@ namespace BBWYB.Server.Business
StartTime = o.StartTime, StartTime = o.StartTime,
VenderRemark = o.VenderRemark, VenderRemark = o.VenderRemark,
PurchaseRemark = o.PurchaseRemark, PurchaseRemark = o.PurchaseRemark,
WaybillNo = o.WaybillNo, //WaybillNo = o.WaybillNo,
SellerPreferentialAmount = o.SellerPreferentialAmount, SellerPreferentialAmount = o.SellerPreferentialAmount,
PreferentialAmount = o.PreferentialAmount, PreferentialAmount = o.PreferentialAmount,
ClientOrderId = o.ClientOrderId, ClientOrderId = o.ClientOrderId,
SourceShopName = o.SourceShopName, SourceShopName = o.SourceShopName,
SourceSku = o.SourceSku, SourceSku = o.SourceSku,
ExpressName = o.ExpressName, //ExpressName = o.ExpressName,
IsPurchased = o.IsPurchased, IsPurchased = o.IsPurchased,
BuyerAccount = o.BuyerAccount, BuyerAccount = o.BuyerAccount,
@ -160,26 +161,51 @@ namespace BBWYB.Server.Business
var dbOrder = fsql.Select<Order>(request.OrderId).ToOne(); var dbOrder = fsql.Select<Order>(request.OrderId).ToOne();
if (dbOrder == null) if (dbOrder == null)
throw new BusinessException($"订单{request.OrderId}不存在"); throw new BusinessException($"订单{request.OrderId}不存在");
if (dbOrder.OrderState != Enums.OrderState.) //if (dbOrder.OrderState != Enums.OrderState.待出库)
throw new BusinessException($"订单{request.OrderId} 只有在待出库时才允许出库"); // throw new BusinessException($"订单{request.OrderId} 只有在待出库时才允许出库");
if (!string.IsNullOrEmpty(request.TargetExpressId))
{
try
{
opPlatformClientFactory.GetClient((AdapterEnums.PlatformType)request.Platform) opPlatformClientFactory.GetClient((AdapterEnums.PlatformType)request.Platform)
.OutStock(new OP_OutStockRequest() .OutStock(new OP_OutStockRequest()
{ {
AppKey = request.AppKey, AppKey = request.AppKey,
AppSecret = request.AppSecret, AppSecret = request.AppSecret,
AppToken = request.AppToken, AppToken = request.AppToken,
ExpressId = request.ExpressId, ExpressId = request.TargetExpressId,
ExpressName = request.ExpressName, ExpressName = request.TargetExpressName,
OrderId = request.OrderId, OrderId = request.OrderId,
Platform = (AdapterEnums.PlatformType)request.Platform, Platform = (AdapterEnums.PlatformType)request.Platform,
WayBillNo = request.WayBillNo WayBillNo = request.WayBillNo
}); });
}
catch (Exception ex)
{
nLogManager.Default().Error(ex, $"OutStock Request {JsonConvert.SerializeObject(request)}");
}
}
fsql.Update<Order>(request.OrderId).Set(o => o.OrderState, Enums.OrderState.) fsql.Transaction(() =>
.Set(o => o.WaybillNo, request.WayBillNo) {
.Set(o => o.ExpressName, request.ExpressName) fsql.Update<OrderPurchaseInfo>().Where(opi => opi.PurchaseOrderId == request.PurchaseOrderId)
.Set(opi => opi.WaybillNo, request.WayBillNo)
.Set(opi => opi.SourceExpressId, request.SourceExpressId)
.Set(opi => opi.SourceExpressName, request.SourceExpressName)
.Set(opi => opi.TargetExpressId, request.TargetExpressId)
.Set(opi => opi.TargetExpressName, request.TargetExpressName)
.ExecuteAffrows(); .ExecuteAffrows();
if (dbOrder.OrderState == Enums.OrderState.)
fsql.Update<Order>(request.OrderId).Set(o => o.OrderState, Enums.OrderState.).ExecuteAffrows();
});
//fsql.Update<Order>(request.OrderId).Set(o => o.OrderState, Enums.OrderState.待收货)
// .Set(o => o.WaybillNo, request.WayBillNo)
// .Set(o => o.ExpressName, request.ExpressName)
// .ExecuteAffrows();
} }
} }
} }

44
BBWYB.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs

@ -8,6 +8,7 @@ using FreeSql;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using SDKAdapter; using SDKAdapter;
using SDKAdapter.OperationPlatform.Models;
using SDKAdapter.PurchasePlatform.Client; using SDKAdapter.PurchasePlatform.Client;
using SDKAdapter.PurchasePlatform.Models; using SDKAdapter.PurchasePlatform.Models;
using System.Text; using System.Text;
@ -273,7 +274,8 @@ namespace BBWYB.Server.Business
PurchaseOrderId = createOrderResponse.OrderId, PurchaseOrderId = createOrderResponse.OrderId,
PurchasePlatform = cargoParamGroup.PurchasePlatform, PurchasePlatform = cargoParamGroup.PurchasePlatform,
PurchaserName = cargoParamGroup.PurchaserName, PurchaserName = cargoParamGroup.PurchaserName,
ShopId = request.ShopId ShopId = request.ShopId,
BelongSkuIds = string.Join(",", belongSkuGroups.Select(bsg => bsg.Key))
}; };
insertOrderPurchaseInfos.Add(orderPurchaserInfo); insertOrderPurchaseInfos.Add(orderPurchaserInfo);
#endregion #endregion
@ -313,6 +315,7 @@ namespace BBWYB.Server.Business
updateOrderCost?.ExecuteAffrows(); updateOrderCost?.ExecuteAffrows();
insertOrderCost?.ExecuteAffrows(); insertOrderCost?.ExecuteAffrows();
fsql.Update<Order>(request.OrderId).SetIf(dbOrder.OrderState == Enums.OrderState., o => o.OrderState, Model.Enums.OrderState.) fsql.Update<Order>(request.OrderId).SetIf(dbOrder.OrderState == Enums.OrderState., o => o.OrderState, Model.Enums.OrderState.)
.SetIf(!string.IsNullOrEmpty(request.Remark), o => o.PurchaseRemark, request.Remark)
.Set(o => o.IsPurchased, true) .Set(o => o.IsPurchased, true)
.ExecuteAffrows(); .ExecuteAffrows();
}); });
@ -431,40 +434,43 @@ namespace BBWYB.Server.Business
#region 物流公司翻译 #region 物流公司翻译
currentProgress = "物流公司翻译"; currentProgress = "物流公司翻译";
//logisticsCompanyId = ConvertLogisticsCompanyId(wayBillNoResponse.LogisticsCompanyName, logisticsCompanyList, shop.Platform);
var convertExpressCompany = expressCompanyNameConverter.Converter(wayBillNoResponse.ExpressName, OP_QueryExpressCompanyResponse convertExpressCompany = null;
try
{
convertExpressCompany = expressCompanyNameConverter.Converter(wayBillNoResponse.ExpressName,
(AdapterEnums.PlatformType)callbackPlatform, (AdapterEnums.PlatformType)callbackPlatform,
(AdapterEnums.PlatformType)shop.PlatformId, (AdapterEnums.PlatformType)shop.PlatformId,
expressCompanyList); expressCompanyList);
if (convertExpressCompany != null)
expressCompanyInfo = JsonConvert.SerializeObject(convertExpressCompany); expressCompanyInfo = JsonConvert.SerializeObject(convertExpressCompany);
#endregion }
catch
{
throw;
}
finally
{
#region 店铺平台订单出库 #region 店铺平台订单出库
currentProgress = "店铺平台订单出库"; currentProgress = "店铺平台订单出库";
//outStockRequest = new OutStockRequest()
//{
// AppKey = shop.AppKey,
// AppSecret = shop.AppSecret,
// AppToken = shop.AppToken,
// OrderId = orderPurchaseInfo.OrderId,
// Platform = shop.PlatformId,
// WayBillNo = wayBillNoResponse.WayBillNo,
// LogisticsId = logisticsCompanyId, //物流公司Id
// SaveResponseLog = true
//};
//orderBusiness.OutStock(outStockRequest);
orderBusiness.OutStock(new OutStockRequest() orderBusiness.OutStock(new OutStockRequest()
{ {
AppKey = shop.AppKey, AppKey = shop.AppKey,
AppSecret = shop.AppSecret, AppSecret = shop.AppSecret,
AppToken = shop.AppToken, AppToken = shop.AppToken,
OrderId = orderId, OrderId = orderId,
ExpressId = convertExpressCompany.ExpressId, //物流公司Id TargetExpressId = convertExpressCompany?.ExpressId ?? string.Empty, //物流公司Id
ExpressName = convertExpressCompany.ExpressName, //物流公司名称 TargetExpressName = convertExpressCompany?.ExpressName ?? string.Empty, //物流公司名称
SourceExpressId = wayBillNoResponse.ExpressId,
SourceExpressName = wayBillNoResponse.ExpressName,
PurchaseOrderId = purchaseOrderId,
Platform = shop.PlatformId, Platform = shop.PlatformId,
WayBillNo = wayBillNoResponse.WayBillNo WayBillNo = wayBillNoResponse.WayBillNo
}); });
#endregion #endregion
}
#endregion
nLogManager.Default().Info($"DeliveryCallback 回调平台{callbackPlatform},订单号{orderId},采购单号{purchaseOrderId},执行进度[{currentProgress}],采购单物流信息:{wayBillNoResponseInfo},店铺平台物流公司列表:{expressCompanyListInfo},翻译后的物流公司:{expressCompanyInfo}"); nLogManager.Default().Info($"DeliveryCallback 回调平台{callbackPlatform},订单号{orderId},采购单号{purchaseOrderId},执行进度[{currentProgress}],采购单物流信息:{wayBillNoResponseInfo},店铺平台物流公司列表:{expressCompanyListInfo},翻译后的物流公司:{expressCompanyInfo}");
} }

24
BBWYB.Server.Business/Sync/OrderSyncBusiness.cs

@ -92,7 +92,7 @@ namespace BBWYB.Server.Business.Sync
Id = qtOrder.OrderId, Id = qtOrder.OrderId,
BuyerRemark = qtOrder.BuyerRemark, BuyerRemark = qtOrder.BuyerRemark,
EndTime = qtOrder.EndTime, EndTime = qtOrder.EndTime,
ExpressName = qtOrder.DeliveryResponse.ExpressName, //ExpressName = qtOrder.DeliveryResponse.ExpressName,
FreightPrice = qtOrder.FreightAmount, FreightPrice = qtOrder.FreightAmount,
ModifyTime = qtOrder.ModifyTime, ModifyTime = qtOrder.ModifyTime,
IsPurchased = false, IsPurchased = false,
@ -103,12 +103,12 @@ namespace BBWYB.Server.Business.Sync
PayType = qtOrder.PayType, PayType = qtOrder.PayType,
Platform = Enums.Platform., Platform = Enums.Platform.,
PreferentialAmount = qtOrder.PreferentialAmount, PreferentialAmount = qtOrder.PreferentialAmount,
PurchaseRemark = String.Empty, //PurchaseRemark = String.Empty,
ShopId = shopId, ShopId = shopId,
SellerPreferentialAmount = qtOrder.SellerPreferentialAmount, SellerPreferentialAmount = qtOrder.SellerPreferentialAmount,
StartTime = qtOrder.StartTime, StartTime = qtOrder.StartTime,
VenderRemark = qtOrder.VenderRemark, VenderRemark = qtOrder.VenderRemark,
WaybillNo = qtOrder.DeliveryResponse.WayBillNo, //WaybillNo = qtOrder.DeliveryResponse.WayBillNo,
OrderState = orderState, OrderState = orderState,
ClientOrderId = qtOrder.ClientOrderId, ClientOrderId = qtOrder.ClientOrderId,
BuyerAccount = qtOrder.UserAccount BuyerAccount = qtOrder.UserAccount
@ -166,8 +166,8 @@ namespace BBWYB.Server.Business.Sync
else else
{ {
var updateOrderState = false; var updateOrderState = false;
var updateWaybillNo = false; //var updateWaybillNo = false;
var updateExpressName = false; //var updateExpressName = false;
var updateModifyTime = false; var updateModifyTime = false;
var updateBuyerRemark = false; var updateBuyerRemark = false;
var updateVenderRemark = false; var updateVenderRemark = false;
@ -175,10 +175,10 @@ namespace BBWYB.Server.Business.Sync
if (dbOrder.OrderState != orderState) if (dbOrder.OrderState != orderState)
updateOrderState = true; updateOrderState = true;
if (dbOrder.WaybillNo != qtOrder.DeliveryResponse.WayBillNo) //if (dbOrder.WaybillNo != qtOrder.DeliveryResponse.WayBillNo)
updateWaybillNo = true; // updateWaybillNo = true;
if (dbOrder.ExpressName != qtOrder.DeliveryResponse.ExpressName) //if (dbOrder.ExpressName != qtOrder.DeliveryResponse.ExpressName)
updateExpressName = true; // updateExpressName = true;
if (dbOrder.ModifyTime != qtOrder.ModifyTime) if (dbOrder.ModifyTime != qtOrder.ModifyTime)
updateModifyTime = true; updateModifyTime = true;
if (dbOrder.BuyerRemark != qtOrder.BuyerRemark) if (dbOrder.BuyerRemark != qtOrder.BuyerRemark)
@ -188,11 +188,11 @@ namespace BBWYB.Server.Business.Sync
if (dbOrder.BuyerAccount != qtOrder.UserAccount) if (dbOrder.BuyerAccount != qtOrder.UserAccount)
updateBuyerAccount = true; updateBuyerAccount = true;
if (updateOrderState || updateWaybillNo || updateModifyTime || updateBuyerRemark || updateVenderRemark || updateBuyerAccount) if (updateOrderState || updateModifyTime || updateBuyerRemark || updateVenderRemark || updateBuyerAccount)
{ {
var update = fsql.Update<Model.Db.Order>(dbOrder.Id).SetIf(updateOrderState, o => o.OrderState == orderState) var update = fsql.Update<Model.Db.Order>(dbOrder.Id).SetIf(updateOrderState, o => o.OrderState == orderState)
.SetIf(updateWaybillNo, o => o.WaybillNo, qtOrder.DeliveryResponse.WayBillNo) //.SetIf(updateWaybillNo, o => o.WaybillNo, qtOrder.DeliveryResponse.WayBillNo)
.SetIf(updateExpressName, o => o.ExpressName, qtOrder.DeliveryResponse.ExpressName) //.SetIf(updateExpressName, o => o.ExpressName, qtOrder.DeliveryResponse.ExpressName)
.SetIf(updateModifyTime, o => o.ModifyTime, qtOrder.ModifyTime) .SetIf(updateModifyTime, o => o.ModifyTime, qtOrder.ModifyTime)
.SetIf(updateBuyerRemark, o => o.BuyerRemark, qtOrder.BuyerRemark) .SetIf(updateBuyerRemark, o => o.BuyerRemark, qtOrder.BuyerRemark)
.SetIf(updateVenderRemark, o => o.VenderRemark, qtOrder.VenderRemark) .SetIf(updateVenderRemark, o => o.VenderRemark, qtOrder.VenderRemark)

40
BBWYB.Server.Model/Db/Order/Order.cs

@ -123,17 +123,17 @@ namespace BBWYB.Server.Model.Db
[Column(StringLength = 500)] [Column(StringLength = 500)]
public string VenderRemark { get; set; } public string VenderRemark { get; set; }
/// <summary> ///// <summary>
/// 运单号 ///// 运单号
/// </summary> ///// </summary>
[Column(StringLength = 100)] //[Column(StringLength = 100)]
public string WaybillNo { get; set; } //public string WaybillNo { get; set; }
/// <summary> ///// <summary>
/// 快递公司名称 ///// 快递公司名称
/// </summary> ///// </summary>
[Column(StringLength = 100)] //[Column(StringLength = 100)]
public string ExpressName { get; set; } //public string ExpressName { get; set; }
/// <summary> /// <summary>
/// 来源Sku /// 来源Sku
@ -223,26 +223,6 @@ namespace BBWYB.Server.Model.Db
public string Town { get; set; } public string Town { get; set; }
#endregion #endregion
#region 采购信息
[Column(IsIgnore = true)]
public string PurchaseAccountId { get; set; }
[Column(IsIgnore = true)]
public string PurchaseAccountName { get; set; }
[Column(IsIgnore = true)]
public Enums.PurchaseMethod? PurchaseMethod { get; set; }
[Column(IsIgnore = true)]
public string PurchaseOrderId { get; set; }
[Column(IsIgnore = true)]
public Enums.Platform? PurchasePlatform { get; set; }
[Column(IsIgnore = true)]
public string PurchaserName { get; set; }
#endregion
} }
} }

18
BBWYB.Server.Model/Db/Order/OrderPurchaseInfo.cs

@ -34,6 +34,24 @@ namespace BBWYB.Server.Model.Db
public string PurchaserName { get; set; } public string PurchaserName { get; set; }
public long? ShopId { get; set; } public long? ShopId { get; set; }
[Column(StringLength = 100)]
public string WaybillNo { get; set; }
[Column(StringLength = 100)]
public string SourceExpressName { get; set; }
[Column(StringLength = 100)]
public string SourceExpressId { get; set; }
[Column(StringLength = 100)]
public string TargetExpressName { get; set; }
[Column(StringLength = 100)]
public string TargetExpressId { get; set; }
[Column(StringLength = 500)]
public string BelongSkuIds { get; set; }
} }
} }

10
BBWYB.Server.Model/Dto/Request/Order/OutStockRequest.cs

@ -4,10 +4,16 @@
{ {
public string OrderId { get; set; } public string OrderId { get; set; }
public string PurchaseOrderId { get; set; }
public string WayBillNo { get; set; } public string WayBillNo { get; set; }
public string ExpressId { get; set; } public string SourceExpressId { get; set; }
public string SourceExpressName { get; set; }
public string TargetExpressId { get; set; }
public string ExpressName { get; set; } public string TargetExpressName { get; set; }
} }
} }

10
BBWYB.Server.Model/Dto/Response/Order/OrderResponse.cs

@ -94,16 +94,6 @@
/// </summary> /// </summary>
public string PurchaseRemark { get; set; } public string PurchaseRemark { get; set; }
/// <summary>
/// 运单号
/// </summary>
public string WaybillNo { get; set; }
/// <summary>
/// 快递公司名称
/// </summary>
public string ExpressName { get; set; }
/// <summary> /// <summary>
/// 来源Sku /// 来源Sku
/// </summary> /// </summary>

Loading…
Cancel
Save