From ab2754795197aad71348ce23d0b30f7077787189 Mon Sep 17 00:00:00 2001 From: "506583276@qq.com" <506583276@qq.com> Date: Thu, 22 Jun 2023 16:39:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E7=AE=B1=E6=B7=BB=E5=8A=A0=E5=BE=85?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => QiKu}/ConsumableService.cs | 0 .../APIServices/QiKu/SealBoxService.cs | 23 ++ .../GetWareSealBoxConfigureCountResponse.cs | 13 + .../GetWareSealBoxWaitConfigureResponse.cs | 85 ++++++ .../Models/SealBox/WareNoSealBoxModel.cs | 36 +++ .../PackTask/WareHouseListViewModel.cs | 118 +++++--- .../FallWare/WareFallWareListControl.xaml | 15 +- BBWY.Client/Views/PackTask/WareHouseList.xaml | 2 +- .../SealBox/SealBoxNoConfigureControl.xaml | 271 ++++++++++++++++++ .../SealBox/SealBoxNoConfigureControl.xaml.cs | 26 ++ 10 files changed, 554 insertions(+), 35 deletions(-) rename BBWY.Client/APIServices/{ => QiKu}/ConsumableService.cs (100%) create mode 100644 BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxConfigureCountResponse.cs create mode 100644 BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxWaitConfigureResponse.cs create mode 100644 BBWY.Client/Models/SealBox/WareNoSealBoxModel.cs create mode 100644 BBWY.Client/Views/SealBox/SealBoxNoConfigureControl.xaml create mode 100644 BBWY.Client/Views/SealBox/SealBoxNoConfigureControl.xaml.cs diff --git a/BBWY.Client/APIServices/ConsumableService.cs b/BBWY.Client/APIServices/QiKu/ConsumableService.cs similarity index 100% rename from BBWY.Client/APIServices/ConsumableService.cs rename to BBWY.Client/APIServices/QiKu/ConsumableService.cs diff --git a/BBWY.Client/APIServices/QiKu/SealBoxService.cs b/BBWY.Client/APIServices/QiKu/SealBoxService.cs index c60ba381..4e9d607e 100644 --- a/BBWY.Client/APIServices/QiKu/SealBoxService.cs +++ b/BBWY.Client/APIServices/QiKu/SealBoxService.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Net.Http; using System.Text; +using System.Threading.Tasks; namespace BBWY.Client.APIServices { @@ -210,5 +211,27 @@ namespace BBWY.Client.APIServices globalContext.User.Shop.Platform, }, null, HttpMethod.Post); } + + + public ApiResponse GetWareSealBoxWaitConfigureList(string ShopName, long? TaskId, string SkuId, int? PageIndex, int? PageSize) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetWareSealBoxWaitConfigureList", + new + { + ShopName, + TaskId, + SkuId, + PageIndex, + PageSize + } + , null, HttpMethod.Post); + } + + public ApiResponse GetWareSealBoxConfigureCounts() + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetWareSealBoxConfigureCounts", + null + , null, HttpMethod.Post); + } } } diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxConfigureCountResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxConfigureCountResponse.cs new file mode 100644 index 00000000..66abf23c --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxConfigureCountResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class GetWareSealBoxConfigureCountResponse + { + public int SealBoxWaitConfigureCount { get; set; } + + public int SealBoxConfiguredCount { get; set; } + } +} diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxWaitConfigureResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxWaitConfigureResponse.cs new file mode 100644 index 00000000..aeb70a6b --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxWaitConfigureResponse.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class GetWareSealBoxWaitConfigureResponse + { + /// + /// 数量 + /// + public int TotalCount { get; set; } + + /// + /// 分箱列表 + /// + public List WaitSealBoxModels { get; set; } + } + + + + public class WareNoSealBoxData + { + + /// + /// 店铺Id + /// + public string ShopId { get; set; } + + /// + /// 店铺名称 + /// + public string ShopName { get; set; } + + + /// + /// 团队名称 + /// + public string DepartmentName { get; set; } + + /// + /// 对接人(同团队下) + /// + public List AcceptUserNames { get; set; } + + /// + /// 封箱sku列表 + /// + public List SealBoxSkus { get; set; } + + } + public class WareNoSealBoxSku + { + + /// + /// 任务Id + /// + public long TaskId { get; set; } + /// + /// 图片链接 + /// + public string Logo { get; set; } + /// + /// skuid + /// + public string SkuId { get; set; } + /// + /// sku标题 + /// + public string SkuTitle { get; set; } + /// + /// 品名 + /// + public string BrandName { get; set; } + /// + /// 货号 + /// + public string ProductNo { get; set; } + /// + /// (任务的sku产品数量) + /// + public int SkuCount { get; set; } + } + +} diff --git a/BBWY.Client/Models/SealBox/WareNoSealBoxModel.cs b/BBWY.Client/Models/SealBox/WareNoSealBoxModel.cs new file mode 100644 index 00000000..94e1dab4 --- /dev/null +++ b/BBWY.Client/Models/SealBox/WareNoSealBoxModel.cs @@ -0,0 +1,36 @@ +using BBWY.Client.Models.APIModel; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models +{ + public class WareNoSealBoxModel:NotifyObject + { + /// + /// 店铺Id + /// + public string ShopId { get; set; } + + /// + /// 店铺名称 + /// + public string ShopName { get; set; } + + + /// + /// 团队名称 + /// + public string DepartmentName { get; set; } + + /// + /// 对接人(同团队下) + /// + public string AcceptUserName { get; set; } + + /// + /// 封箱sku列表 + /// + public List SealBoxSkus { get; set; } + } +} diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 12a3c565..ee931157 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -65,11 +65,16 @@ namespace BBWY.Client.ViewModels.PackTask public ObservableCollection WaitFallWareList { get => waitFallWareList; set { Set(ref waitFallWareList, value); } } + private ObservableCollection wareNoSealBoxModels; + /// + /// 分箱列表(未配置) + /// + public ObservableCollection WareNoSealBoxModels { get => wareNoSealBoxModels; set { Set(ref wareNoSealBoxModels, value); } } private ObservableCollection waitSealBoxModels; /// - /// 分箱列表 + /// 分箱列表(已配置) /// public ObservableCollection WaitSealBoxModels { get => waitSealBoxModels; set { Set(ref waitSealBoxModels, value); } } @@ -613,10 +618,7 @@ namespace BBWY.Client.ViewModels.PackTask } else { - //App.Current.Dispatcher.BeginInvoke(new Action(() => - //{ - // new TipsWindow("查不到数据").Show(); - //})); + if (datas != null) System.Windows.MessageBox.Show(datas.Msg); } IsLoadCount(); IsLoadFallWareCount(); @@ -629,45 +631,84 @@ namespace BBWY.Client.ViewModels.PackTask var randNum = new Random().Next(81, 90); - WaitSealBoxModels = new ObservableCollection(); - var datas = sealBoxService.GetWareSealBoxList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize); - if (datas != null && datas.Data != null && datas.Success) + if(SealBoxConfigureType== SealBoxConfigureType.已配置) { - var dataModel = datas.Data; - OrderCount = dataModel.TotalCount; - foreach (var item in dataModel.WaitSealBoxModels) - { + WaitSealBoxModels = new ObservableCollection(); - App.Current.Dispatcher.BeginInvoke(new Action(() => + var datas = sealBoxService.GetWareSealBoxList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize); + if (datas != null && datas.Data != null && datas.Success) + { + var dataModel = datas.Data; + OrderCount = dataModel.TotalCount; + foreach (var item in dataModel.WaitSealBoxModels) { - WaitSealBoxModels.Add(new SealBoxModel + + App.Current.Dispatcher.BeginInvoke(new Action(() => { - AcceptUserName = string.Join("|", item.AcceptUserNames), - DepartmentName = item.DepartmentName, - SealBoxSkus = item.SealBoxSkus.Select(s => + WaitSealBoxModels.Add(new SealBoxModel { + AcceptUserName = string.Join("|", item.AcceptUserNames), + DepartmentName = item.DepartmentName, + SealBoxSkus = item.SealBoxSkus.Select(s => + { + + s.Logo = s.Logo.Replace("80x80", $"{randNum}x{randNum}"); + return s; + }).ToList(), + ShopId = item.ShopId, + ShopName = item.ShopName, + WareId = item.WareId, + WareName = item.WareName, + SealBoxId = item.SealBoxId, + }); + })); - s.Logo = s.Logo.Replace("80x80", $"{randNum}x{randNum}"); - return s; - }).ToList(), - ShopId = item.ShopId, - ShopName = item.ShopName, - WareId = item.WareId, - WareName = item.WareName, - SealBoxId = item.SealBoxId, - }); - })); - + } + } + else + { + if (datas != null) System.Windows.MessageBox.Show(datas.Msg); } } - else + if (SealBoxConfigureType == SealBoxConfigureType.待配置) { - //App.Current.Dispatcher.BeginInvoke(new Action(() => - //{ - // new TipsWindow("查不到数据").Show(); - //})); + WareNoSealBoxModels = new ObservableCollection(); + + var datas = sealBoxService.GetWareSealBoxWaitConfigureList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize); + if (datas != null && datas.Data != null && datas.Success) + { + var dataModel = datas.Data; + OrderCount = dataModel.TotalCount; + foreach (var item in dataModel.WaitSealBoxModels) + { + + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + WareNoSealBoxModels.Add(new WareNoSealBoxModel + { + AcceptUserName = string.Join("|", item.AcceptUserNames), + DepartmentName = item.DepartmentName, + SealBoxSkus = item.SealBoxSkus.Select(s => + { + + s.Logo = s.Logo.Replace("80x80", $"{randNum}x{randNum}"); + return s; + }).ToList(), + ShopId = item.ShopId, + ShopName = item.ShopName, + + }); + })); + + } + } + else + { + if (datas != null) System.Windows.MessageBox.Show(datas.Msg); + } } + IsLoadSealBoxCount(); IsLoadCount(); IsLoading = false; @@ -765,6 +806,17 @@ namespace BBWY.Client.ViewModels.PackTask IsLoading = false; }); } + + private void IsLoadSealBoxCount() + { + var res = sealBoxService.GetWareSealBoxConfigureCounts(); + if (res != null && res.Success && res.Data != null) + { + FallWareWaitConfigureCount = res.Data.SealBoxWaitConfigureCount.ToString(); + FallWareConfiguredCount = res.Data.SealBoxWaitConfigureCount.ToString(); + } + } + private void IsLoadFallWareCount() { var res = sealBoxService.GetFallWareConfigureCounts(null); diff --git a/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml b/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml index 204f1415..7e0c6619 100644 --- a/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml +++ b/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml @@ -8,6 +8,7 @@ xmlns:ctr="clr-namespace:BBWY.Client.Converters" Background="White" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:packtask ="clr-namespace:BBWY.Client.Views.PackTask" + xmlns:sealbox="clr-namespace:BBWY.Client.Views.SealBox" xmlns:fallware="clr-namespace:BBWY.Client.Views.FallWare" xmlns:cmodel="clr-namespace:BBWY.Client.Models" DataContext="{Binding WareHouseList,Source={StaticResource Locator}}" @@ -75,11 +76,23 @@ /> + + + + + + diff --git a/BBWY.Client/Views/PackTask/WareHouseList.xaml b/BBWY.Client/Views/PackTask/WareHouseList.xaml index 473e609b..e2aefe15 100644 --- a/BBWY.Client/Views/PackTask/WareHouseList.xaml +++ b/BBWY.Client/Views/PackTask/WareHouseList.xaml @@ -176,7 +176,7 @@ - + diff --git a/BBWY.Client/Views/SealBox/SealBoxNoConfigureControl.xaml b/BBWY.Client/Views/SealBox/SealBoxNoConfigureControl.xaml new file mode 100644 index 00000000..348e85bd --- /dev/null +++ b/BBWY.Client/Views/SealBox/SealBoxNoConfigureControl.xaml @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/SealBox/SealBoxNoConfigureControl.xaml.cs b/BBWY.Client/Views/SealBox/SealBoxNoConfigureControl.xaml.cs new file mode 100644 index 00000000..b716b15c --- /dev/null +++ b/BBWY.Client/Views/SealBox/SealBoxNoConfigureControl.xaml.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BBWY.Client.Views.SealBox +{ + /// + /// SealBoxNoConfigureControl.xaml 的交互逻辑 + /// + public partial class SealBoxNoConfigureControl : UserControl + { + public SealBoxNoConfigureControl() + { + InitializeComponent(); + } + } +}