From 566a2089b88dd4b25cd3c635e539ae732c13b98c Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Mon, 22 May 2023 20:21:04 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=90=BD=E4=BB=93=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BBWY.Client/Models/Enums.cs | 18 ++--- BBWY.Client/Models/QiKu/PackSkuConfig.cs | 2 + .../QiKu/PackSkuSplitConfigViewModel.cs | 3 +- .../PackSkuSplitCountAndStoreWindow.xaml | 38 +++++++-- .../PackSkuSplitCountAndStoreWindow.xaml.cs | 81 +++++++++++++++++-- BBWY.Server.Business/Vender/VenderBusiness.cs | 14 +++- BBWY.Server.Model/Enums.cs | 4 +- 7 files changed, 131 insertions(+), 29 deletions(-) diff --git a/BBWY.Client/Models/Enums.cs b/BBWY.Client/Models/Enums.cs index 433dc415..c707ceb3 100644 --- a/BBWY.Client/Models/Enums.cs +++ b/BBWY.Client/Models/Enums.cs @@ -275,7 +275,7 @@ /// /// 标准模板 /// - 标准模板= 0, + 标准模板 = 0, /// /// 精简模板 /// @@ -294,11 +294,11 @@ public enum CertificateLabelModel { 标准无3c = 0, - 标准有3c = 1, - 无型号=2, - 适用年龄=3 + 标准有3c = 1, + 无型号 = 2, + 适用年龄 = 3 } - + /// /// 加急 /// @@ -388,8 +388,8 @@ public enum Need { - 不需要=0, - 需要=1 + 不需要 = 0, + 需要 = 1 } public enum PackState { @@ -404,11 +404,11 @@ } /// - /// 京东仓库类型 1商家仓 2京东仓 + /// 京东仓库类型 商家仓 = 1, 京仓 = 2, 云仓 = 3 /// public enum StockType { - 商家仓 = 1, 京仓 = 2 + 商家仓 = 1, 京仓 = 2, 云仓 = 3 } /// diff --git a/BBWY.Client/Models/QiKu/PackSkuConfig.cs b/BBWY.Client/Models/QiKu/PackSkuConfig.cs index 619a3757..51041662 100644 --- a/BBWY.Client/Models/QiKu/PackSkuConfig.cs +++ b/BBWY.Client/Models/QiKu/PackSkuConfig.cs @@ -40,5 +40,7 @@ namespace BBWY.Client.Models.QiKu public int PackCount { get => packCount; set { Set(ref packCount, value); } } public StoreResponse Store { get => store; set { Set(ref store, value); } } + + public bool IsJST { get; set; } } } diff --git a/BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs b/BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs index 324ef251..f96467a2 100644 --- a/BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs +++ b/BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs @@ -76,11 +76,12 @@ namespace BBWY.Client.ViewModels } 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) { packSkuSplitConfig.PackCount = w.Quantity; packSkuSplitConfig.Store = w.Store; + packSkuSplitConfig.IsJST = w.IsJST; } } diff --git a/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml b/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml index 8ada0b01..e9bc7a4a 100644 --- a/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml +++ b/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml @@ -5,15 +5,22 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:BBWY.Client.Views.BatchPurchase" mc:Ignorable="d" + xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" xmlns:b="http://schemas.microsoft.com/xaml/behaviors" - Title="PackSkuSplitCountAndStoreWindow" Height="160" Width="250" + Title="PackSkuSplitCountAndStoreWindow" Height="200" Width="300" Style="{StaticResource bwstyle}" MinButtonVisibility="Collapsed" MaxButtonVisibility="Collapsed"> + + 1 + 2 + 3 + + @@ -31,19 +38,38 @@ + + + + + + + - + - + - diff --git a/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs b/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs index b00651f8..596f9765 100644 --- a/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs +++ b/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs @@ -1,8 +1,10 @@ using BBWY.Client.Models; using BBWY.Controls; +using GalaSoft.MvvmLight.Command; using System.Collections.Generic; using System.Linq; using System.Windows; +using System.Windows.Input; namespace BBWY.Client.Views.BatchPurchase { @@ -14,26 +16,91 @@ namespace BBWY.Client.Views.BatchPurchase public int Quantity { 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 storeList; - public PackSkuSplitCountAndStoreWindow(int quantity, StoreResponse store, IList storeList) + private int storeTypeIndex; + private bool isJST; + + public PackSkuSplitCountAndStoreWindow(int quantity, StoreResponse store, IList storeList, bool isJST) { InitializeComponent(); + this.DataContext = this; this.Quantity = quantity; this.Store = store; this.storeList = storeList; + this.IsJST = isJST; + if (!isJST) + { + StoreTypeIndex = store == null ? 1 : (int)store.Type; + } + + SetStoreIndexCommand = new RelayCommand(SetStoreIndex); + SetJSTCommand = new RelayCommand(() => this.IsJST = true); 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) { this.txtQuantity.Text = Quantity.ToString(); - this.cbx_stroeList.ItemsSource = storeList; - if (Store != null) - this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(s => s.Id == Store.Id); - else - this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(); + + this.cbx_stroeList.SelectedItem = this.Store; + //this.cbx_stroeList.ItemsSource = storeList; + //if (Store != null) + // 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) @@ -48,7 +115,7 @@ namespace BBWY.Client.Views.BatchPurchase MessageBox.Show("件数不正确", "提示"); return; } - if (cbx_stroeList.SelectedItem == null) + if (!IsJST && cbx_stroeList.SelectedItem == null) { MessageBox.Show("请选择一个仓库", "提示"); return; diff --git a/BBWY.Server.Business/Vender/VenderBusiness.cs b/BBWY.Server.Business/Vender/VenderBusiness.cs index 0da2601e..4aa6960d 100644 --- a/BBWY.Server.Business/Vender/VenderBusiness.cs +++ b/BBWY.Server.Business/Vender/VenderBusiness.cs @@ -344,15 +344,21 @@ namespace BBWY.Server.Business foreach (var storeHouseJToken in response.Data) { var seq_num = storeHouseJToken.Value("seq_num"); - storeHouseList.Add(new Storehouse() + var storeHouse = new Storehouse() { Id = seq_num, Name = storeHouseJToken.Value("name"), Platform = request.Platform, CreateTime = DateTime.Now, - Status = (Enums.StockStatus)storeHouseJToken.Value("use_flag"), - Type = (Enums.StockType)storeHouseJToken.Value("type") - }); + Status = (Enums.StockStatus)storeHouseJToken.Value("use_flag") + //Type = type + }; + storeHouseList.Add(storeHouse); + + var type = (Enums.StockType)storeHouseJToken.Value("type"); + if (storeHouse.Name.Contains("云仓")) + type = Enums.StockType.云仓; + storeHouse.Type = type; } return storeHouseList; } diff --git a/BBWY.Server.Model/Enums.cs b/BBWY.Server.Model/Enums.cs index 41e71598..917b567c 100644 --- a/BBWY.Server.Model/Enums.cs +++ b/BBWY.Server.Model/Enums.cs @@ -208,11 +208,11 @@ } /// - /// 京东仓库类型 1商家仓 2京东仓 + /// 京东仓库类型 商家仓 = 1, 京仓 = 2, 云仓 = 3 /// public enum StockType { - 商家仓 = 1, 京仓 = 2 + 商家仓 = 1, 京仓 = 2, 云仓 = 3 } /// From ca57163bc5e65aa91fa8c439f682f9f7eb7fed99 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Mon, 22 May 2023 20:38:26 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=B8=8B=E5=8D=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5=E9=BD=90=E5=BA=93=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E7=B1=BB=E5=9E=8B=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PackSkuSplitCountAndStoreWindow.xaml | 12 ++++--- .../BatchPurchase/BatchPurchaseBusiness.cs | 32 +++++++++++++------ .../Dto/Request/QiKu/PackSkuConfigRequest.cs | 2 ++ .../Dto/Request/Stock/StoreRequest.cs | 2 ++ 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml b/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml index e9bc7a4a..f8db9edd 100644 --- a/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml +++ b/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml @@ -42,11 +42,11 @@ + Command="{Binding SetStoreIndexCommand}" CommandParameter="{StaticResource store_JingCang}"/> + Command="{Binding SetStoreIndexCommand}" CommandParameter="{StaticResource store_YunCang}"/> + Command="{Binding SetStoreIndexCommand}" CommandParameter="{StaticResource store_ShangJiaCang}"/> + Grid.Row="4" + Visibility="{Binding IsJST,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}"/> + VerticalContentAlignment="Center" + Visibility="{Binding IsJST,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}"/> new { - wareId = x.Store.Id, - wareName = x.Store.Name, - count = x.PackCount + wareId = x.IsJST ? "qiyuejushuitan" : x.Store.Id, + wareName = x.IsJST ? "齐越聚水潭" : x.Store.Name, + count = x.PackCount, + wareType = x.IsJST ? 3 : GetQiKuWareType(x.Store.Type) }) }); } @@ -430,6 +431,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) { if (request.EndDate != null) @@ -516,8 +528,8 @@ namespace BBWY.Server.Business var order = fsql.Select().Where(p => p.Id == request.OrderId).ToOne(); fsql.Update(order) - .Set(a => a.OrderState, payOrderResponse.PurchaseOrderState) - .ExecuteAffrows(); + .Set(a => a.OrderState, payOrderResponse.PurchaseOrderState) + .ExecuteAffrows(); } return new PayPurchaseOrderResponse() @@ -552,7 +564,7 @@ namespace BBWY.Server.Business { nLogManager.GetLogger($"取消打包任务-{request.OrderId}").Error(ex, JsonConvert.SerializeObject(request)); } - + } @@ -570,8 +582,8 @@ namespace BBWY.Server.Business var order = fsql.Select().Where(p => p.Id == request.OrderId).ToOne(); fsql.Update(order) - .Set(a => a.OrderState, request.PurchaseOrderState) - .ExecuteAffrows(); + .Set(a => a.OrderState, request.PurchaseOrderState) + .ExecuteAffrows(); return new UpdatePackStateResponse(); } @@ -579,8 +591,8 @@ namespace BBWY.Server.Business { var order = fsql.Select().Where(p => p.Id == request.OrderId).ToOne(); fsql.Update(order) - .Set(a => a.PackState, request.PackState) - .ExecuteAffrows(); + .Set(a => a.PackState, request.PackState) + .ExecuteAffrows(); return new UpdatePackStateResponse(); } } diff --git a/BBWY.Server.Model/Dto/Request/QiKu/PackSkuConfigRequest.cs b/BBWY.Server.Model/Dto/Request/QiKu/PackSkuConfigRequest.cs index 6c3e9256..5b10c605 100644 --- a/BBWY.Server.Model/Dto/Request/QiKu/PackSkuConfigRequest.cs +++ b/BBWY.Server.Model/Dto/Request/QiKu/PackSkuConfigRequest.cs @@ -30,5 +30,7 @@ namespace BBWY.Server.Model.Dto public int PackCount { get; set; } public StoreRequest Store { get; set; } + + public bool IsJST { get; set; } } } diff --git a/BBWY.Server.Model/Dto/Request/Stock/StoreRequest.cs b/BBWY.Server.Model/Dto/Request/Stock/StoreRequest.cs index 91b053b4..62589032 100644 --- a/BBWY.Server.Model/Dto/Request/Stock/StoreRequest.cs +++ b/BBWY.Server.Model/Dto/Request/Stock/StoreRequest.cs @@ -5,5 +5,7 @@ public string Id { get; set; } public string Name { get; set; } + + public Enums.StockType Type { get; set; } } } From 1d3f404c41b31935181bb25aee3ed6d82cbaa7e8 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Mon, 22 May 2023 20:40:17 +0800 Subject: [PATCH 3/3] 10109 --- BBWY.Client/Views/MainWindow.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BBWY.Client/Views/MainWindow.xaml b/BBWY.Client/Views/MainWindow.xaml index ad6b9b1e..437663eb 100644 --- a/BBWY.Client/Views/MainWindow.xaml +++ b/BBWY.Client/Views/MainWindow.xaml @@ -26,7 +26,7 @@ - +