Browse Source

处理冲突

AddValidOverTime
shanji 2 years ago
parent
commit
5c6fcf3ede
  1. 18
      BBWY.Client/Models/Enums.cs
  2. 2
      BBWY.Client/Models/QiKu/PackSkuConfig.cs
  3. 3
      BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs
  4. 42
      BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml
  5. 81
      BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs
  6. 2
      BBWY.Client/Views/MainWindow.xaml
  7. 32
      BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs
  8. 14
      BBWY.Server.Business/Vender/VenderBusiness.cs
  9. 2
      BBWY.Server.Model/Dto/Request/QiKu/PackSkuConfigRequest.cs
  10. 2
      BBWY.Server.Model/Dto/Request/Stock/StoreRequest.cs
  11. 4
      BBWY.Server.Model/Enums.cs

18
BBWY.Client/Models/Enums.cs

@ -275,7 +275,7 @@
/// <summary> /// <summary>
/// 标准模板 /// 标准模板
/// </summary> /// </summary>
= 0, = 0,
/// <summary> /// <summary>
/// 精简模板 /// 精简模板
/// </summary> /// </summary>
@ -294,11 +294,11 @@
public enum CertificateLabelModel public enum CertificateLabelModel
{ {
3c = 0, 3c = 0,
3c = 1, 3c = 1,
=2, = 2,
=3 = 3
} }
/// <summary> /// <summary>
/// 加急 /// 加急
/// </summary> /// </summary>
@ -388,8 +388,8 @@
public enum Need public enum Need
{ {
=0, = 0,
=1 = 1
} }
public enum PackState public enum PackState
{ {
@ -404,11 +404,11 @@
} }
/// <summary> /// <summary>
/// 京东仓库类型 1商家仓 2京东仓 /// 京东仓库类型 商家仓 = 1, 京仓 = 2, 云仓 = 3
/// </summary> /// </summary>
public enum StockType public enum StockType
{ {
= 1, = 2 = 1, = 2, = 3
} }
/// <summary> /// <summary>

2
BBWY.Client/Models/QiKu/PackSkuConfig.cs

@ -45,5 +45,7 @@ namespace BBWY.Client.Models.QiKu
public int PackCount { get => packCount; set { Set(ref packCount, value); } } public int PackCount { get => packCount; set { Set(ref packCount, value); } }
public StoreResponse Store { get => store; set { Set(ref store, value); } } public StoreResponse Store { get => store; set { Set(ref store, value); } }
public bool IsJST { get; set; }
} }
} }

3
BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs

@ -76,11 +76,12 @@ namespace BBWY.Client.ViewModels
} }
storeList = response.Data; storeList = response.Data;
} }
var w = new PackSkuSplitCountAndStoreWindow(packSkuSplitConfig.PackCount, packSkuSplitConfig.Store, storeList); var w = new PackSkuSplitCountAndStoreWindow(packSkuSplitConfig.PackCount, packSkuSplitConfig.Store, storeList, packSkuSplitConfig.IsJST);
if (w.ShowDialog() == true) if (w.ShowDialog() == true)
{ {
packSkuSplitConfig.PackCount = w.Quantity; packSkuSplitConfig.PackCount = w.Quantity;
packSkuSplitConfig.Store = w.Store; packSkuSplitConfig.Store = w.Store;
packSkuSplitConfig.IsJST = w.IsJST;
} }
} }

42
BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml

@ -5,15 +5,22 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.BatchPurchase" xmlns:local="clr-namespace:BBWY.Client.Views.BatchPurchase"
mc:Ignorable="d" mc:Ignorable="d"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
Title="PackSkuSplitCountAndStoreWindow" Height="160" Width="250" Title="PackSkuSplitCountAndStoreWindow" Height="200" Width="300"
Style="{StaticResource bwstyle}" Style="{StaticResource bwstyle}"
MinButtonVisibility="Collapsed" MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"> MaxButtonVisibility="Collapsed">
<c:BWindow.Resources>
<sys:Int32 x:Key="store_ShangJiaCang">1</sys:Int32>
<sys:Int32 x:Key="store_JingCang">2</sys:Int32>
<sys:Int32 x:Key="store_YunCang">3</sys:Int32>
</c:BWindow.Resources>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="30"/> <RowDefinition Height="30"/>
<RowDefinition/>
<RowDefinition Height="5"/> <RowDefinition Height="5"/>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition/>
@ -31,19 +38,40 @@
<TextBlock Text="装箱设置" HorizontalAlignment="Center" VerticalAlignment="Center"/> <TextBlock Text="装箱设置" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border> </Border>
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.ColumnSpan="2" HorizontalAlignment="Center">
<c:BButton Content="京仓" Width="70"
Background="{Binding StoreTypeIndex,Converter={StaticResource objConverter},ConverterParameter=2:#8080FF:#F2F2F2}"
Foreground="{Binding StoreTypeIndex,Converter={StaticResource objConverter},ConverterParameter=2:White:#4A4A4A}"
Command="{Binding SetStoreIndexCommand}" CommandParameter="{StaticResource store_JingCang}"/>
<c:BButton Content="云仓" Width="70"
Background="{Binding StoreTypeIndex,Converter={StaticResource objConverter},ConverterParameter=3:#8080FF:#F2F2F2}"
Foreground="{Binding StoreTypeIndex,Converter={StaticResource objConverter},ConverterParameter=3:White:#4A4A4A}"
Command="{Binding SetStoreIndexCommand}" CommandParameter="{StaticResource store_YunCang}"/>
<c:BButton Content="聚水潭" Width="70"
Background="{Binding IsJST,Converter={StaticResource objConverter},ConverterParameter=true:#8080FF:#F2F2F2}"
Foreground="{Binding IsJST,Converter={StaticResource objConverter},ConverterParameter=true:White:#4A4A4A}"
Command="{Binding SetJSTCommand}"/>
<c:BButton Content="商家仓" Width="70"
Background="{Binding StoreTypeIndex,Converter={StaticResource objConverter},ConverterParameter=1:#8080FF:#F2F2F2}"
Foreground="{Binding StoreTypeIndex,Converter={StaticResource objConverter},ConverterParameter=1:White:#4A4A4A}"
Command="{Binding SetStoreIndexCommand}" CommandParameter="{StaticResource store_ShangJiaCang}"/>
</StackPanel>
<TextBlock Text="件数:" HorizontalAlignment="Right" VerticalAlignment="Center" <TextBlock Text="件数:" HorizontalAlignment="Right" VerticalAlignment="Center"
Grid.Row="2"/> Grid.Row="3"/>
<c:BTextBox x:Name="txtQuantity" Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" <c:BTextBox x:Name="txtQuantity" Grid.Column="1" Grid.Row="3" VerticalAlignment="Center"
Margin="5,0,10,0"/> Margin="5,0,10,0"/>
<TextBlock Text="落仓去向:" HorizontalAlignment="Right" VerticalAlignment="Center" <TextBlock Text="落仓去向:" HorizontalAlignment="Right" VerticalAlignment="Center"
Grid.Row="3"/> Grid.Row="4"
<ComboBox x:Name="cbx_stroeList" Grid.Row="3" Grid.Column="1" Height="30" Visibility="{Binding IsJST,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<ComboBox x:Name="cbx_stroeList" Grid.Row="4" Grid.Column="1" Height="30"
Margin="5,0,10,0" Margin="5,0,10,0"
DisplayMemberPath="Name" DisplayMemberPath="Name"
VerticalContentAlignment="Center"/> VerticalContentAlignment="Center"
Visibility="{Binding IsJST,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<c:BButton x:Name="btn_save" Content="保存" Width="80" HorizontalAlignment="Right" Grid.Row="4" <c:BButton x:Name="btn_save" Content="保存" Width="80" HorizontalAlignment="Right" Grid.Row="5"
Margin="0,0,5,0" Click="btn_save_Click" Margin="0,0,5,0" Click="btn_save_Click"
Grid.Column="1"/> Grid.Column="1"/>
</Grid> </Grid>

81
BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs

@ -1,8 +1,10 @@
using BBWY.Client.Models; using BBWY.Client.Models;
using BBWY.Controls; using BBWY.Controls;
using GalaSoft.MvvmLight.Command;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows; using System.Windows;
using System.Windows.Input;
namespace BBWY.Client.Views.BatchPurchase namespace BBWY.Client.Views.BatchPurchase
{ {
@ -14,26 +16,91 @@ namespace BBWY.Client.Views.BatchPurchase
public int Quantity { get; set; } public int Quantity { get; set; }
public StoreResponse Store { get; set; } public StoreResponse Store { get; set; }
public int StoreTypeIndex
{
get => storeTypeIndex;
set
{
if (Set(ref storeTypeIndex, value))
{
OnStoreIndexChanged();
if (value > 0)
IsJST = false;
}
}
}
public bool IsJST
{
get => isJST;
set
{
if (Set(ref isJST, value))
{
OnStoreIndexChanged();
if (value)
StoreTypeIndex = 0;
}
}
}
public ICommand SetStoreIndexCommand { get; set; }
public ICommand SetJSTCommand { get; set; }
private IList<StoreResponse> storeList; private IList<StoreResponse> storeList;
public PackSkuSplitCountAndStoreWindow(int quantity, StoreResponse store, IList<StoreResponse> storeList) private int storeTypeIndex;
private bool isJST;
public PackSkuSplitCountAndStoreWindow(int quantity, StoreResponse store, IList<StoreResponse> storeList, bool isJST)
{ {
InitializeComponent(); InitializeComponent();
this.DataContext = this;
this.Quantity = quantity; this.Quantity = quantity;
this.Store = store; this.Store = store;
this.storeList = storeList; this.storeList = storeList;
this.IsJST = isJST;
if (!isJST)
{
StoreTypeIndex = store == null ? 1 : (int)store.Type;
}
SetStoreIndexCommand = new RelayCommand<int>(SetStoreIndex);
SetJSTCommand = new RelayCommand(() => this.IsJST = true);
this.Loaded += PackSkuSplitCountAndStoreWindow_Loaded; this.Loaded += PackSkuSplitCountAndStoreWindow_Loaded;
} }
private void SetStoreIndex(int index)
{
StoreTypeIndex = index;
}
private void OnStoreIndexChanged()
{
if (IsJST)
{
this.cbx_stroeList.ItemsSource = null;
this.cbx_stroeList.SelectedItem = null;
this.Store = null;
}
else
{
var type = (StockType)StoreTypeIndex;
this.cbx_stroeList.ItemsSource = storeList.Where(s => s.Type == type);
this.cbx_stroeList.SelectedItem = null;
}
}
private void PackSkuSplitCountAndStoreWindow_Loaded(object sender, System.Windows.RoutedEventArgs e) private void PackSkuSplitCountAndStoreWindow_Loaded(object sender, System.Windows.RoutedEventArgs e)
{ {
this.txtQuantity.Text = Quantity.ToString(); this.txtQuantity.Text = Quantity.ToString();
this.cbx_stroeList.ItemsSource = storeList;
if (Store != null) this.cbx_stroeList.SelectedItem = this.Store;
this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(s => s.Id == Store.Id); //this.cbx_stroeList.ItemsSource = storeList;
else //if (Store != null)
this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(); // this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(s => s.Id == Store.Id);
//else
// this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault();
} }
private void btn_save_Click(object sender, System.Windows.RoutedEventArgs e) private void btn_save_Click(object sender, System.Windows.RoutedEventArgs e)
@ -48,7 +115,7 @@ namespace BBWY.Client.Views.BatchPurchase
MessageBox.Show("件数不正确", "提示"); MessageBox.Show("件数不正确", "提示");
return; return;
} }
if (cbx_stroeList.SelectedItem == null) if (!IsJST && cbx_stroeList.SelectedItem == null)
{ {
MessageBox.Show("请选择一个仓库", "提示"); MessageBox.Show("请选择一个仓库", "提示");
return; return;

2
BBWY.Client/Views/MainWindow.xaml

@ -26,7 +26,7 @@
<!--<TextBlock Text="{Binding GlobalContext.User.TeamName}" Margin="5,0,0,0"/> <!--<TextBlock Text="{Binding GlobalContext.User.TeamName}" Margin="5,0,0,0"/>
<TextBlock Text="{Binding GlobalContext.User.Shop.Platform}" Margin="5,0,0,0"/>--> <TextBlock Text="{Binding GlobalContext.User.Shop.Platform}" Margin="5,0,0,0"/>-->
<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="v10108" Margin="5,0,0,0"/> <TextBlock Text="v10109" Margin="5,0,0,0"/>
</StackPanel> </StackPanel>
</Border> </Border>
<Grid Grid.Row="1"> <Grid Grid.Row="1">

32
BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs

@ -346,9 +346,10 @@ namespace BBWY.Server.Business
markMessage = skuPackConfig.RemarkMessage, markMessage = skuPackConfig.RemarkMessage,
wareHourses = skuPackConfig.PackSkuSplitConfigList.Select(x => new wareHourses = skuPackConfig.PackSkuSplitConfigList.Select(x => new
{ {
wareId = x.Store.Id, wareId = x.IsJST ? "qiyuejushuitan" : x.Store.Id,
wareName = x.Store.Name, wareName = x.IsJST ? "齐越聚水潭" : x.Store.Name,
count = x.PackCount count = x.PackCount,
wareType = x.IsJST ? 3 : GetQiKuWareType(x.Store.Type)
}) })
}); });
} }
@ -447,6 +448,17 @@ namespace BBWY.Server.Business
}; };
} }
private int GetQiKuWareType(Enums.StockType stockType)
{
if (stockType == Enums.StockType.)
return 0;
if (stockType == Enums.StockType.)
return 1;
if (stockType == Enums.StockType.)
return 2;
return 0;
}
public PurchaseOrderV2ListResponse GetPurchaseOrderList(SearchPurchaseOrderV2Request request) public PurchaseOrderV2ListResponse GetPurchaseOrderList(SearchPurchaseOrderV2Request request)
{ {
if (request.EndDate != null) if (request.EndDate != null)
@ -533,8 +545,8 @@ namespace BBWY.Server.Business
var order = fsql.Select<PurchaseOrderV2>().Where(p => p.Id == request.OrderId).ToOne(); var order = fsql.Select<PurchaseOrderV2>().Where(p => p.Id == request.OrderId).ToOne();
fsql.Update<PurchaseOrderV2>(order) fsql.Update<PurchaseOrderV2>(order)
.Set(a => a.OrderState, payOrderResponse.PurchaseOrderState) .Set(a => a.OrderState, payOrderResponse.PurchaseOrderState)
.ExecuteAffrows(); .ExecuteAffrows();
} }
return new PayPurchaseOrderResponse() return new PayPurchaseOrderResponse()
@ -569,7 +581,7 @@ namespace BBWY.Server.Business
{ {
nLogManager.GetLogger($"取消打包任务-{request.OrderId}").Error(ex, JsonConvert.SerializeObject(request)); nLogManager.GetLogger($"取消打包任务-{request.OrderId}").Error(ex, JsonConvert.SerializeObject(request));
} }
} }
@ -587,8 +599,8 @@ namespace BBWY.Server.Business
var order = fsql.Select<PurchaseOrderV2>().Where(p => p.Id == request.OrderId).ToOne(); var order = fsql.Select<PurchaseOrderV2>().Where(p => p.Id == request.OrderId).ToOne();
fsql.Update<PurchaseOrderV2>(order) fsql.Update<PurchaseOrderV2>(order)
.Set(a => a.OrderState, request.PurchaseOrderState) .Set(a => a.OrderState, request.PurchaseOrderState)
.ExecuteAffrows(); .ExecuteAffrows();
return new UpdatePackStateResponse(); return new UpdatePackStateResponse();
} }
@ -596,8 +608,8 @@ namespace BBWY.Server.Business
{ {
var order = fsql.Select<PurchaseOrderV2>().Where(p => p.Id == request.OrderId).ToOne(); var order = fsql.Select<PurchaseOrderV2>().Where(p => p.Id == request.OrderId).ToOne();
fsql.Update<PurchaseOrderV2>(order) fsql.Update<PurchaseOrderV2>(order)
.Set(a => a.PackState, request.PackState) .Set(a => a.PackState, request.PackState)
.ExecuteAffrows(); .ExecuteAffrows();
return new UpdatePackStateResponse(); return new UpdatePackStateResponse();
} }
} }

14
BBWY.Server.Business/Vender/VenderBusiness.cs

@ -344,15 +344,21 @@ namespace BBWY.Server.Business
foreach (var storeHouseJToken in response.Data) foreach (var storeHouseJToken in response.Data)
{ {
var seq_num = storeHouseJToken.Value<string>("seq_num"); var seq_num = storeHouseJToken.Value<string>("seq_num");
storeHouseList.Add(new Storehouse() var storeHouse = new Storehouse()
{ {
Id = seq_num, Id = seq_num,
Name = storeHouseJToken.Value<string>("name"), Name = storeHouseJToken.Value<string>("name"),
Platform = request.Platform, Platform = request.Platform,
CreateTime = DateTime.Now, CreateTime = DateTime.Now,
Status = (Enums.StockStatus)storeHouseJToken.Value<int>("use_flag"), Status = (Enums.StockStatus)storeHouseJToken.Value<int>("use_flag")
Type = (Enums.StockType)storeHouseJToken.Value<int>("type") //Type = type
}); };
storeHouseList.Add(storeHouse);
var type = (Enums.StockType)storeHouseJToken.Value<int>("type");
if (storeHouse.Name.Contains("云仓"))
type = Enums.StockType.;
storeHouse.Type = type;
} }
return storeHouseList; return storeHouseList;
} }

2
BBWY.Server.Model/Dto/Request/QiKu/PackSkuConfigRequest.cs

@ -33,5 +33,7 @@ namespace BBWY.Server.Model.Dto
public int PackCount { get; set; } public int PackCount { get; set; }
public StoreRequest Store { get; set; } public StoreRequest Store { get; set; }
public bool IsJST { get; set; }
} }
} }

2
BBWY.Server.Model/Dto/Request/Stock/StoreRequest.cs

@ -5,5 +5,7 @@
public string Id { get; set; } public string Id { get; set; }
public string Name { get; set; } public string Name { get; set; }
public Enums.StockType Type { get; set; }
} }
} }

4
BBWY.Server.Model/Enums.cs

@ -208,11 +208,11 @@
} }
/// <summary> /// <summary>
/// 京东仓库类型 1商家仓 2京东仓 /// 京东仓库类型 商家仓 = 1, 京仓 = 2, 云仓 = 3
/// </summary> /// </summary>
public enum StockType public enum StockType
{ {
= 1, = 2 = 1, = 2, = 3
} }
/// <summary> /// <summary>

Loading…
Cancel
Save