diff --git a/BBWY.Client/APIServices/DictionaryService.cs b/BBWY.Client/APIServices/DictionaryService.cs new file mode 100644 index 00000000..b3deba82 --- /dev/null +++ b/BBWY.Client/APIServices/DictionaryService.cs @@ -0,0 +1,27 @@ +using BBWY.Client.Models.APIModel; +using BBWY.Client.Models.APIModel.Request; +using BBWY.Common.Http; +using BBWY.Common.Models; +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Text; + +namespace BBWY.Client.APIServices +{ + public class DictionaryService : BaseApiService, IDenpendency + { + public DictionaryService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) + { + } + + + + public ApiResponse GetDictionaryByKey(string key) + { + return SendRequest(globalContext.QKApiHost, $"api/Dictionary/GetDictionaryByKey?key={key}", + null + , null, HttpMethod.Get); + } + } +} diff --git a/BBWY.Client/APIServices/LogisticsService.cs b/BBWY.Client/APIServices/LogisticsService.cs index fc6e67ff..86fc40a6 100644 --- a/BBWY.Client/APIServices/LogisticsService.cs +++ b/BBWY.Client/APIServices/LogisticsService.cs @@ -21,6 +21,10 @@ namespace BBWY.Client.APIServices }, null, HttpMethod.Post); } + /// + /// 获取仓库列表 + /// + /// public ApiResponse> GetStoreList() { return SendRequest>(globalContext.BBYWApiHost, "api/vender/GetStoreHouseList", new diff --git a/BBWY.Client/APIServices/PackTaskService.cs b/BBWY.Client/APIServices/PackTaskService.cs index 468975aa..ff06dc66 100644 --- a/BBWY.Client/APIServices/PackTaskService.cs +++ b/BBWY.Client/APIServices/PackTaskService.cs @@ -26,37 +26,33 @@ namespace BBWY.Client.APIServices - public ApiResponse GetOrderList(string skuId = null, string taskId = null, + public ApiResponse GetTaskList(string skuId = null, string taskId = null, DateTime? startTime = null, DateTime? endTime = null, - TaskState? availability = null, - int? taskStatus = null, + TaskState? TaskState = null, int pageIndex = 1, int pageSize = 10 ) { - if (taskId!=null&&!string.IsNullOrEmpty(taskId.Trim())) + if (taskId != null && !string.IsNullOrEmpty(taskId.Trim())) { - return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchNewPackTaskList", new + return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new { - - TaskId = taskId, - ShopId = globalContext.User.Shop.ShopId.ToString() + }, null, HttpMethod.Post); } - return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchNewPackTaskList", new + return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new { SkuId = skuId, TaskId = taskId, StartTime = startTime, EndTime = endTime, - Availability = availability, - TaskStatus = taskStatus, + TaskState = TaskState, PageIndex = pageIndex, PageSize = pageSize, ShopId = globalContext.User.Shop.ShopId.ToString() @@ -65,7 +61,7 @@ namespace BBWY.Client.APIServices public ApiResponse GetWareHouseList(string WayBillNo=null,string SourceExpressName=null, int? isWorry = null, string departmentName = null, string skuId = null, string taskId = null, DateTime? startTime = null, DateTime? endTime = null, - PackTaskState? TaskState = null, + TaskState? TaskState = null, string ShopName = null, int pageIndex = 1, int pageSize = 10 @@ -98,16 +94,9 @@ namespace BBWY.Client.APIServices - - public ApiResponse GetAllCount() + public ApiResponse GetTaskAllCount(string shopId=null) { - return SendRequest(globalContext.QKApiHost, $"api/PackTask/GetProductSkuCount?shopId={globalContext.User.Shop.ShopId.ToString()}", - null - , null, HttpMethod.Get); - } - public ApiResponse GetWareAllCount() - { - return SendRequest(globalContext.QKApiHost, "api/PackTask/GetProductSkuCount", + return SendRequest(globalContext.QKApiHost, $"api/PackTask/GetProductSkuCount?shopId={shopId}", null , null, HttpMethod.Get); } @@ -178,12 +167,12 @@ namespace BBWY.Client.APIServices /// /// /// - public ApiResponse SetPackTaskState(long taskId, PackTaskState packTaskState) + public ApiResponse SetPackTaskState(long taskId, TaskState taskState) { return SendRequest(globalContext.QKApiHost, "api/PackTask/SetPackTaskState", new { taskId = taskId, - TaskState= packTaskState + TaskState= taskState } , null, HttpMethod.Post); } @@ -329,16 +318,32 @@ namespace BBWY.Client.APIServices /// /// /// - public ApiResponse CompeteSealBox( List CompeteSealBoxs) + public ApiResponse CompeteSealBox( CompeteSealBox CompeteSealBoxs) { - return SendRequest(globalContext.QKApiHost, "api/PackTask/CompeteSealBox", new + return SendRequest(globalContext.QKApiHost, "api/PackTask/CompeteSealBox", CompeteSealBoxs, null, HttpMethod.Post); + } + + + + /// + /// 获取待落仓列表 + /// + /// + /// + public ApiResponse SearchWaitFallWareList(string ShopName = null, long? TaskId = null, string SkuId = null, int PageIndex = 1 + , int PageSize = 10) + { + return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchWaitFallWareList", new { - CompeteSealBoxs + ShopName, + TaskId, + SkuId, + PageIndex, + PageSize }, null, HttpMethod.Post); } - } public class CompeteSealBox @@ -346,11 +351,14 @@ namespace BBWY.Client.APIServices /// /// 任务Id /// - public long TaskId { get; set; } + public long[] TaskId { get; set; } /// /// 仓库Id /// public string WareId { get; set; } + + public int BoxCount { get; set; } + } diff --git a/BBWY.Client/APIServices/SealBoxService.cs b/BBWY.Client/APIServices/SealBoxService.cs new file mode 100644 index 00000000..7c434475 --- /dev/null +++ b/BBWY.Client/APIServices/SealBoxService.cs @@ -0,0 +1,201 @@ +using BBWY.Client.Models; +using BBWY.Client.Models.APIModel; +using BBWY.Client.Models.APIModel.Response.PackTask; +using BBWY.Client.Views.PackTask; +using BBWY.Common.Http; +using BBWY.Common.Models; +using System; +using System.Collections.Generic; +using System.Net.Http; +using System.Text; + +namespace BBWY.Client.APIServices +{ + public class SealBoxService : BaseApiService, IDenpendency + { + public SealBoxService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) + { + } + + + public ApiResponse GetSealBoxWaitConfigureList(string SkuId, string TaskId, int? PageSize = 10, int? PageIndex = 1, string SpuId = null) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetSealBoxWaitConfigureList", + new + { + ShopId = globalContext.User.Shop.ShopId.ToString(), + TaskId = TaskId, + SkuId = SkuId, + SpuId, + PageSize, + PageIndex, + } + , null, HttpMethod.Post); + } + + + public ApiResponse GetSealBoxPackStateCount() + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetSealBoxPackStateCount", + new + { + ShopId = globalContext.User.Shop.ShopId.ToString(), + } + , null, HttpMethod.Post); + } + + public ApiResponse SetSealBoxConfigured(SetSealBoxConfiguredRequest setSealBoxConfiguredRequest) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/SetSealBoxConfigured", + setSealBoxConfiguredRequest + , null, HttpMethod.Post); + } + + public ApiResponse GetSealBoxConfiguredList(PositionState PositionState, string SkuId, string TaskId, string shopId, int? PageSize = 10, int? PageIndex = 1, string SpuId = null) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetSealBoxConfiguredList", + new + { + PositionState, + ShopId = shopId, + TaskId = TaskId, + SkuId = SkuId, + SpuId, + PageSize, + PageIndex, + } + , null, HttpMethod.Post); + } + + + public ApiResponse GetUpdateSealBoxConfigured(long SealBoxId, long[] TaskIds) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetUpdateSealBoxConfigured", + new + { + SealBoxId, + TaskIds + } + , null, HttpMethod.Post); + } + + + public ApiResponse BatchUpdateSealBoxConfigured(BatchUpdateSealBoxConfiguredRequest batchUpdateSealBoxConfiguredRequest) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/BatchUpdateSealBoxConfigured", + batchUpdateSealBoxConfiguredRequest + , null, HttpMethod.Post); + } + + public ApiResponse GetWareSealBoxList(string ShopName, long? TaskId, string SkuId, int? PageIndex, int? PageSize) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetWareSealBoxList", + new + { + ShopName, + TaskId, + SkuId, + PageIndex, + PageSize + } + , null, HttpMethod.Post); + } + + + + public ApiResponse WareCompeteSealBox(long SealBoxId, int? BoxCount) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/WareCompeteSealBox", + new + { + SealBoxId, + BoxCount + } + , null, HttpMethod.Post); + } + /// + /// 仓库端获取待落仓列表 + /// + /// + /// + /// + /// + /// + /// + public ApiResponse SearchWareFallWareConfigureList(PositionState positionState, string ShopName = null, long? TaskId = null, string SkuId = null, int PageIndex = 1 + , int PageSize = 10) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/SearchWareFallWareConfigureList", + new + { + ShopName, + TaskId, + SkuId, + PageIndex, + PageSize, + positionState + } + , null, HttpMethod.Post); + } + + + /// + /// 商家端 获取待落仓列表 + /// + /// + /// + /// + /// + /// + /// + public ApiResponse SearchFallWareConfiguredList(PositionState positionState, long? TaskId = null, string SkuId = null, int PageIndex = 1 + , int PageSize = 10) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/SearchFallWareConfiguredList", + new + { + shopId = globalContext.User.Shop.ShopId.ToString(), + positionState, + TaskId, + SkuId, + PageIndex, + PageSize + } + , null, HttpMethod.Post); + } + + + + + public ApiResponse SetFallWareConfigure(long SealBoxId, string ProductTitle, string PurchaseOrder, string PrewOrder, string WaybillNo) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/SetFallWareConfigure", + new + { + SealBoxId, + ProductTitle, + PurchaseOrder, + PrewOrder, + WaybillNo + } + , null, HttpMethod.Post); + } + + + public ApiResponse GetFallWareConfigureCounts(string shopId) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetFallWareConfigureCounts?shopId={shopId}", + null + , null, HttpMethod.Post); + } + + + public ApiResponse WareCompeteFallWare(long SealBoxId) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/WareCompeteFallWare?SealBoxId={SealBoxId}", + null + , null, HttpMethod.Post); + } + + } +} diff --git a/BBWY.Client/App.xaml.cs b/BBWY.Client/App.xaml.cs index 88b79fe5..81e519b5 100644 --- a/BBWY.Client/App.xaml.cs +++ b/BBWY.Client/App.xaml.cs @@ -1,6 +1,7 @@ using BBWY.Client.Models; using BBWY.Client.ViewModels; using BBWY.Client.ViewModels.PackTask; +using BBWY.Client.ViewModels.SealBox; using BBWY.Common.Extensions; using BBWY.Common.Http; using BBWY.Common.Models; @@ -122,8 +123,10 @@ namespace BBWY.Client serviceCollection.AddTransient(); serviceCollection.AddTransient(); serviceCollection.AddTransient(); - - //serviceCollection.AddScoped(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddScoped(); #region 注册拳探SDK相关类 serviceCollection.AddSingleton(); diff --git a/BBWY.Client/BBWY.Client.csproj b/BBWY.Client/BBWY.Client.csproj index 2643c69f..6403e641 100644 --- a/BBWY.Client/BBWY.Client.csproj +++ b/BBWY.Client/BBWY.Client.csproj @@ -35,6 +35,7 @@ + diff --git a/BBWY.Client/BBWYAppSettings.json b/BBWY.Client/BBWYAppSettings.json index 34888905..f6dee4d4 100644 --- a/BBWY.Client/BBWYAppSettings.json +++ b/BBWY.Client/BBWYAppSettings.json @@ -5,5 +5,5 @@ "JOSApiHost": "", "1688ApiHost": "", "QKApiHost": "http://localhost:8080" - // "QKApiHost": "http://qiku.qiyue666.com" + //"QKApiHost": "http://qiku.qiyue666.com" } \ No newline at end of file diff --git a/BBWY.Client/Helpers/MyPrintHelper.cs b/BBWY.Client/Helpers/MyPrintHelper.cs index 6296a880..3ee35e82 100644 --- a/BBWY.Client/Helpers/MyPrintHelper.cs +++ b/BBWY.Client/Helpers/MyPrintHelper.cs @@ -1,6 +1,10 @@ using BarcodeLib; using BBWY.Client.Extensions; using BBWY.Client.Models; +using BBWY.Client.Models.FallWare; +using BBWY.Client.Models.PackTask; +using NPOI.XSSF.UserModel; +using Spire.Xls; using System; using System.Collections.Generic; using System.Drawing; @@ -195,100 +199,100 @@ namespace BBWY.Client.Helpers private static void SetCerStander(ref PrintPageEventArgs args, CertificateModel certificate, Font font) { -//#if DEBUG -// Bitmap bitmap = new Bitmap(236, 157); -// // Bitmap bitmap = new Bitmap(500, 500); -// Graphics graphics = Graphics.FromImage(bitmap); - -// var sige = graphics.VisibleClipBounds;// 宽:236 高:157 打印可视化区域 -// graphics.TranslateTransform((sige.Width - 236) / 2, 0);//设置起始位置 -// graphics.DrawRectangle(new System.Drawing.Pen(System.Drawing.Brushes.Black), 5, 5, sige.Width - 10, sige.Height - 10);//画出条码编辑区域 -// int bigJiange = 20;//合格证与品牌的高度差 -// var heightSpace = 4;//所有行间隔高度 -// if (!string.IsNullOrEmpty(certificate.ProduceDate)) -// { -// bigJiange = 10; heightSpace = 3; -// } - -// int standerSpace = 1;//执行标准之间的 -// if (certificate.IsLogo == 1)//含图标 -// { -// string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); -// string path = appPath + $"/Resources/Images/3c.png"; -// Image image = Image.FromFile(path); -// graphics.DrawImage(image, 190, 7, 28, 21); -// graphics.DrawString(certificate.FactoryNumber, font, System.Drawing.Brushes.Black, 188, 28); -// } - -// var fontBig = new Font("宋体", 14, System.Drawing.FontStyle.Regular); -// string cerName = "合格证"; -// SizeF bigSize = graphics.MeasureString(cerName, fontBig); - -// float verHeight = bigJiange + bigSize.Height; -// graphics.DrawString(cerName, fontBig, System.Drawing.Brushes.Black, new PointF((236 - bigSize.Width) / 2, 10)); - -// graphics.DrawString($"品牌: {certificate.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); -// if (!string.IsNullOrEmpty(certificate.ProductNo)) -// graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); -// var smallSize = graphics.MeasureString(certificate.Brand, font);//小字体高度 - -// verHeight += (smallSize.Height + heightSpace); -// graphics.DrawString($"品名: {certificate.BrandName}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); - -// graphics.DrawString($"材质: {certificate.Shader}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); - -// StringBuilder sb = new StringBuilder(); -// var excutes = certificate.ExcuteStander.Split(new string[] { ",", "," }, StringSplitOptions.RemoveEmptyEntries); -// int hangCount = excutes.Count() / 2 + excutes.Count() % 2;//获取行数 - -// for (int i = 0; i < excutes.Count(); i++) -// { -// if (i % 2 == 0 && i > 0)//间隔两个换行 -// { -// sb.Append("\n"); -// } -// sb.Append(excutes[i]).Append(" "); -// } -// sb.Remove(sb.Length - 3, 3); -// var rows = sb.ToString().Split('\n'); -// string excuteStander = "执行标准: "; -// smallSize = graphics.MeasureString(excuteStander, font); -// verHeight += (smallSize.Height + heightSpace); -// graphics.DrawString($"执行标准: {rows[0]}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); - -// for (int i = 1; i < rows.Count(); i++) -// { -// verHeight += (smallSize.Height + standerSpace); -// graphics.DrawString($"{rows[i]}", font, System.Drawing.Brushes.Black, new PointF(12 + smallSize.Width, verHeight)); -// } - -// if (!string.IsNullOrEmpty(certificate.ProduceDate)) -// { -// verHeight += (smallSize.Height + heightSpace) - 3; -// graphics.DrawString($"生产日期: {certificate.ProduceDate}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); -// } - -// verHeight += (smallSize.Height + heightSpace); -// RectangleF rect = new RectangleF(10, verHeight, 220, smallSize.Height * 2 + heightSpace); -// var productStr = $"生产商: {certificate.ProductShop}"; -// if (graphics.MeasureString(productStr, font).Width <= 220) -// { -// graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, 10, verHeight); -// verHeight += smallSize.Height + heightSpace; -// } -// else -// { -// graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, rect); -// verHeight += 2 * smallSize.Height + heightSpace; -// } -// var productShop = graphics.MeasureString("生产商", font); -// var adress = graphics.MeasureString("地 址", font); - -// var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace); -// graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1); - -// var applicationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); -// bitmap.Save($"{applicationPath}/{certificate.LabelModel}-{certificate.GoodsNumber}.jpg", ImageFormat.Png); + //#if DEBUG + // Bitmap bitmap = new Bitmap(236, 157); + // // Bitmap bitmap = new Bitmap(500, 500); + // Graphics graphics = Graphics.FromImage(bitmap); + + // var sige = graphics.VisibleClipBounds;// 宽:236 高:157 打印可视化区域 + // graphics.TranslateTransform((sige.Width - 236) / 2, 0);//设置起始位置 + // graphics.DrawRectangle(new System.Drawing.Pen(System.Drawing.Brushes.Black), 5, 5, sige.Width - 10, sige.Height - 10);//画出条码编辑区域 + // int bigJiange = 20;//合格证与品牌的高度差 + // var heightSpace = 4;//所有行间隔高度 + // if (!string.IsNullOrEmpty(certificate.ProduceDate)) + // { + // bigJiange = 10; heightSpace = 3; + // } + + // int standerSpace = 1;//执行标准之间的 + // if (certificate.IsLogo == 1)//含图标 + // { + // string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); + // string path = appPath + $"/Resources/Images/3c.png"; + // Image image = Image.FromFile(path); + // graphics.DrawImage(image, 190, 7, 28, 21); + // graphics.DrawString(certificate.FactoryNumber, font, System.Drawing.Brushes.Black, 188, 28); + // } + + // var fontBig = new Font("宋体", 14, System.Drawing.FontStyle.Regular); + // string cerName = "合格证"; + // SizeF bigSize = graphics.MeasureString(cerName, fontBig); + + // float verHeight = bigJiange + bigSize.Height; + // graphics.DrawString(cerName, fontBig, System.Drawing.Brushes.Black, new PointF((236 - bigSize.Width) / 2, 10)); + + // graphics.DrawString($"品牌: {certificate.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); + // if (!string.IsNullOrEmpty(certificate.ProductNo)) + // graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); + // var smallSize = graphics.MeasureString(certificate.Brand, font);//小字体高度 + + // verHeight += (smallSize.Height + heightSpace); + // graphics.DrawString($"品名: {certificate.BrandName}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); + + // graphics.DrawString($"材质: {certificate.Shader}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); + + // StringBuilder sb = new StringBuilder(); + // var excutes = certificate.ExcuteStander.Split(new string[] { ",", "," }, StringSplitOptions.RemoveEmptyEntries); + // int hangCount = excutes.Count() / 2 + excutes.Count() % 2;//获取行数 + + // for (int i = 0; i < excutes.Count(); i++) + // { + // if (i % 2 == 0 && i > 0)//间隔两个换行 + // { + // sb.Append("\n"); + // } + // sb.Append(excutes[i]).Append(" "); + // } + // sb.Remove(sb.Length - 3, 3); + // var rows = sb.ToString().Split('\n'); + // string excuteStander = "执行标准: "; + // smallSize = graphics.MeasureString(excuteStander, font); + // verHeight += (smallSize.Height + heightSpace); + // graphics.DrawString($"执行标准: {rows[0]}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); + + // for (int i = 1; i < rows.Count(); i++) + // { + // verHeight += (smallSize.Height + standerSpace); + // graphics.DrawString($"{rows[i]}", font, System.Drawing.Brushes.Black, new PointF(12 + smallSize.Width, verHeight)); + // } + + // if (!string.IsNullOrEmpty(certificate.ProduceDate)) + // { + // verHeight += (smallSize.Height + heightSpace) - 3; + // graphics.DrawString($"生产日期: {certificate.ProduceDate}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); + // } + + // verHeight += (smallSize.Height + heightSpace); + // RectangleF rect = new RectangleF(10, verHeight, 220, smallSize.Height * 2 + heightSpace); + // var productStr = $"生产商: {certificate.ProductShop}"; + // if (graphics.MeasureString(productStr, font).Width <= 220) + // { + // graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, 10, verHeight); + // verHeight += smallSize.Height + heightSpace; + // } + // else + // { + // graphics.DrawString(productStr, font, System.Drawing.Brushes.Black, rect); + // verHeight += 2 * smallSize.Height + heightSpace; + // } + // var productShop = graphics.MeasureString("生产商", font); + // var adress = graphics.MeasureString("地 址", font); + + // var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace); + // graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1); + + // var applicationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + // bitmap.Save($"{applicationPath}/{certificate.LabelModel}-{certificate.GoodsNumber}.jpg", ImageFormat.Png); int bigJiange = 20;//合格证与品牌的高度差 @@ -319,8 +323,8 @@ namespace BBWY.Client.Helpers args.Graphics.DrawString(cerName, fontBig, System.Drawing.Brushes.Black, new PointF((236 - bigSize.Width) / 2, 10)); args.Graphics.DrawString($"品牌: {certificate.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); - if(!string.IsNullOrEmpty(certificate.ProductNo)) - args.Graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); + if (!string.IsNullOrEmpty(certificate.ProductNo)) + args.Graphics.DrawString($"型号: {certificate.ProductNo}", font, System.Drawing.Brushes.Black, new PointF(122, verHeight)); var smallSize = args.Graphics.MeasureString(certificate.Brand, font);//小字体高度 verHeight += (smallSize.Height + heightSpace); @@ -375,7 +379,7 @@ namespace BBWY.Client.Helpers var productShop = args.Graphics.MeasureString("生产商", font); var adress = args.Graphics.MeasureString("地 址", font); - var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight- 2, 220, smallSize.Height * 3 + heightSpace); + var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace); args.Graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1); @@ -489,7 +493,7 @@ namespace BBWY.Client.Helpers int bigJiange = 20;//合格证与品牌的高度差 var heightSpace = 4;//所有行间隔高度 int standerSpace = 1;//执行标准之间的 - if (!string.IsNullOrEmpty(certificate.ProduceDate)) bigJiange = 10; + if (!string.IsNullOrEmpty(certificate.ProduceDate)) bigJiange = 10; var fontBig = new Font("宋体", 14, System.Drawing.FontStyle.Regular); string cerName = "合格证"; SizeF bigSize = args.Graphics.MeasureString(cerName, fontBig); @@ -548,7 +552,7 @@ namespace BBWY.Client.Helpers } if (!string.IsNullOrEmpty(certificate.ProduceDate)) { - verHeight += (smallSize.Height + heightSpace)-3; + verHeight += (smallSize.Height + heightSpace) - 3; args.Graphics.DrawString($"生产日期: {certificate.ProduceDate}", font, System.Drawing.Brushes.Black, new PointF(10, verHeight)); } verHeight += (smallSize.Height + heightSpace); @@ -568,7 +572,7 @@ namespace BBWY.Client.Helpers var productShop = args.Graphics.MeasureString("生产商", font); var adress = args.Graphics.MeasureString("地 址", font); - var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight-2, 220, smallSize.Height * 3 + heightSpace); + var rect1 = new RectangleF(10 + productShop.Width - adress.Width, verHeight - 2, 220, smallSize.Height * 3 + heightSpace); args.Graphics.DrawString($"地 址: {certificate.ProductAdress}", font, System.Drawing.Brushes.Black, rect1); @@ -593,7 +597,7 @@ namespace BBWY.Client.Helpers - public static BitmapImage GetBarcodeImage(string printStr,int width,int height) + public static BitmapImage GetBarcodeImage(string printStr, int width, int height) { Bitmap image = new Bitmap(width, height); Graphics graphics2 = Graphics.FromImage(image); @@ -603,7 +607,7 @@ namespace BBWY.Client.Helpers return bitmapToBitmapImage(image); } - static BitmapImage bitmapToBitmapImage(Bitmap bitmap) + static BitmapImage bitmapToBitmapImage(Bitmap bitmap) { using (var stream = new MemoryStream()) { @@ -620,6 +624,104 @@ namespace BBWY.Client.Helpers } + + /// + /// 打印封箱 + /// + /// + /// + /// + /// + public static void PrintSealBoxData(SealBoxModel sealBoxModel, string printName, int boxCount, int printCount) + { + // 100*180 + + UnitConverHelper unitConverHelper = new UnitConverHelper(); + + var data = unitConverHelper.MmToPx(100, 180); + var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + string printNamePath = $"{applicationPath}/printSealName.init"; + if (File.Exists(printNamePath)) + { + File.Delete(printNamePath); + } + File.WriteAllText(printNamePath, printName); + + var excel = $"{applicationPath}/Resources/ExccelModel/sealbox.xlsx"; + + var newExccel = $"{applicationPath}/Resources/ExccelModel/newsealbox.xlsx"; + if (File.Exists(newExccel)) + { + File.Delete(newExccel); + } + FileStream fs = new FileStream(excel, FileMode.Open, FileAccess.Read); + XSSFWorkbook wb = new XSSFWorkbook(fs); + var sheet = wb.GetSheetAt(0); // 得到第一个sheet + + var nameCell = sheet.GetRow(0).GetCell(0); // name列,第2行 + var ageCell = sheet.GetRow(3).GetCell(0); // age列,第2行 + + + XSSFWorkbook wb2 = new XSSFWorkbook(); + sheet.CopyTo(wb2, "Sheet1", true, false); + var sheet2 = wb2.GetSheet("Sheet1"); + var nameCell2 = sheet2.GetRow(0).GetCell(1); + nameCell2.SetCellValue(sealBoxModel.ShopName); + + sheet2.GetRow(3).GetCell(1).SetCellValue(sealBoxModel.WareName); + + StringBuilder sb = new StringBuilder(); + int totalCount = 0; + for (int i = 0; i < sealBoxModel.SealBoxSkus.Count; i++) + { + var title = sealBoxModel.SealBoxSkus[i].SkuTitle; + //if (title.Length>5) + //{ + // title = title.Substring(0,5); + //} + totalCount += sealBoxModel.SealBoxSkus[i].WareHourseSkuCount; + sheet2.GetRow(i + 6).GetCell(1).SetCellValue($"名称:{title}"); + sheet2.GetRow(i + 6).GetCell(2).SetCellValue($"SKU:{sealBoxModel.SealBoxSkus[i].SkuId}"); + sheet2.GetRow(i + 6).GetCell(3).SetCellValue($"数量:{sealBoxModel.SealBoxSkus[i].WareHourseSkuCount}"); + + } + sheet2.GetRow(25).GetCell(1).SetCellValue(totalCount); + sheet2.GetRow(28).GetCell(1).SetCellValue(boxCount); + FileStream fs1 = new FileStream(newExccel, FileMode.OpenOrCreate, FileAccess.ReadWrite); + wb2.Write(fs1); + fs1.Close(); + fs1.Dispose(); + Workbook workbook = new Workbook(); + + workbook.LoadFromFile(newExccel); + + Worksheet wsheet = workbook.Worksheets[0]; + + wsheet.PageSetup.PaperSize = PaperSizeType.PaperA4; + wsheet.PageSetup.Orientation = PageOrientationType.Portrait; + wsheet.PageSetup.PrintArea = "A1:D31"; + + + + var print = workbook.PrintDocument; + print.PrinterSettings.PrinterName = printName; + print.PrinterSettings.Copies = (short)printCount;//打印份数 + + + + print.Print(); + } + + /// + /// 打印京东箱唛 + /// + public static void PrintJDBoxWareData(JDWareBoxModel jDWareBoxModel,string printName) + { + + } + + + public static void SetDefaultPrint(string printName) { SetDefaultPrinter(printName); diff --git a/BBWY.Client/Helpers/UnitConverHelper.cs b/BBWY.Client/Helpers/UnitConverHelper.cs new file mode 100644 index 00000000..d13aea32 --- /dev/null +++ b/BBWY.Client/Helpers/UnitConverHelper.cs @@ -0,0 +1,101 @@ +using NPOI.SS.Formula.Functions; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows; + +namespace BBWY.Client.Helpers +{ + public class UnitConverHelper + { + + + int dpiX = 0; + int dpiY = 0; + + + public UnitConverHelper() + { + + GetDpi(); + } + + + private void GetDpi() + { + var hDc = GetDC(IntPtr.Zero); + + dpiX = GetDeviceCaps(hDc, LOGPIXELSX); + dpiY = GetDeviceCaps(hDc, LOGPIXELSY); + ReleaseDC(IntPtr.Zero, hDc); + } + + + + + + + /// + /// 毫米转像素(获取打印的宽和高) + /// + /// + /// + public PrintPx MmToPx(double mWidth, double mHeight) + { + if(dpiX<=0||dpiY<=0) GetDpi(); + + return new PrintPx + { + Width = mWidth * dpiX / 25.4, + Height = mHeight * dpiY / 25.4, + + }; + } + + /// + /// 像素转毫米 + /// + /// + /// + /// + public PrintPx PxToMm(double pxWidth, double pxHeight) + { + if (dpiX <= 0 || dpiY <= 0) GetDpi(); + return new PrintPx + { + Width = pxWidth * 25.4 / dpiX, + Height = pxHeight * 25.4 / dpiY, + + }; + } + + + private const int LOGPIXELSX = 88; + private const int LOGPIXELSY = 90; + + [DllImport("gdi32.dll")] + private static extern int GetDeviceCaps(IntPtr hdc, int index); + + [DllImport("user32.dll")] + private static extern IntPtr GetDC(IntPtr hWnd); + + [DllImport("user32.dll")] + private static extern int ReleaseDC(IntPtr hWnd, IntPtr hDc); + + } + + + + + + + public class PrintPx + { + + public double Width { get; set; } + + public double Height { get; set; } + } + +} diff --git a/BBWY.Client/Models/APIModel/Request/BatchUpdateSealBoxConfiguredRequest.cs b/BBWY.Client/Models/APIModel/Request/BatchUpdateSealBoxConfiguredRequest.cs new file mode 100644 index 00000000..642e94b4 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Request/BatchUpdateSealBoxConfiguredRequest.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class BatchUpdateSealBoxConfiguredRequest + { + /// + /// 判断当前的封箱任务是否 是带封箱状态 + /// + public long SealBoxId { get; set; } + + public string ShopId { get; set; } + + public IList UpdateSealBoxConfiguredDatas { get; set; } + + } + public class UpdateSealBoxConfiguredDataRequest + { + public long TaskId { get; set; } + + /// + /// sku总量任务量 + /// + public int SkuCount { get; set; } + + public IList SealBoxConfiguredWareHourseRequests { get; set; } + } + + public class SealBoxConfiguredWareHourseRequest : WareHourseData + { + /// + ///待封箱 = 0, 待落仓 = 1, 待完结 = 2 + /// + public PositionState? WareState { get; set; } + } + +} \ No newline at end of file diff --git a/BBWY.Client/Models/APIModel/Request/CerRequest.cs b/BBWY.Client/Models/APIModel/Request/CerRequest.cs index cc221097..ebd0f15c 100644 --- a/BBWY.Client/Models/APIModel/Request/CerRequest.cs +++ b/BBWY.Client/Models/APIModel/Request/CerRequest.cs @@ -68,8 +68,11 @@ namespace BBWY.Client.Models.APIModel.Request /// public string ApplyAge { get; set; } - public long GoodsNumber { get; set; } + public long? GoodsNumber { get; set; } + /// + /// + /// public string ProduceDate { get; set; } diff --git a/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs b/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs index 990f7540..de52bcb8 100644 --- a/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs +++ b/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs @@ -62,10 +62,7 @@ namespace BBWY.Client.Models.APIModel.Request /// 增量耗材 /// public string Increment1 { get; set; } - /// - /// 增量耗材 - /// - public int Increment2 { get; set; } + //条形码 合格证数据 @@ -92,11 +89,6 @@ namespace BBWY.Client.Models.APIModel.Request /// public long? BarCodeId { get; set; } - - /// - /// 合格证Id - /// - public long? CertificateId { get; set; } /// /// 合格证Id /// @@ -106,8 +98,9 @@ namespace BBWY.Client.Models.APIModel.Request /// public int? CertificatePosition { get; set; } - public Worry IsWorry { get; set; } + //public Worry IsWorry { get; set; } public string OrderId { get; set; } + public Platform Platform { get; set; } public bool NeedBar { get;set; } diff --git a/BBWY.Client/Models/APIModel/Request/SetSealBoxConfiguredRequest.cs b/BBWY.Client/Models/APIModel/Request/SetSealBoxConfiguredRequest.cs new file mode 100644 index 00000000..5c9882e9 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Request/SetSealBoxConfiguredRequest.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class SetSealBoxConfiguredRequest + { + /// + /// 店铺id + /// + public string ShopId { get; set; } + + public IList SetSealBoxConfiguredDatas { get; set; } + + } + + + public class SetSealBoxConfiguredData + { + /// + /// 任务Id + /// + public long TaskId { get; set; } + + /// + /// sku + /// + public string SkuId { get; set; } + + /// + /// sku总量任务量(校对) + /// + public int TotalCount { get; set; } + /// + /// 仓库去向 + /// + public IList WareHourseDatas { get; set; } + + } + public class WareHourseData + { + /// + /// 仓库id + /// + public string WareId { get; set; } + /// + /// 仓库名称 + /// + public string WareName { get; set; } + /// + /// 数量 + /// + public int Count { get; set; } + /// + /// 入仓类型 (京仓=0 云仓=1,商家仓=2,聚水潭=3) + /// + public WareType WareType { get; set; } + + } +} diff --git a/BBWY.Client/Models/APIModel/Response/Dictionary/GetDictionaryByKeyResponse.cs b/BBWY.Client/Models/APIModel/Response/Dictionary/GetDictionaryByKeyResponse.cs new file mode 100644 index 00000000..491c9a46 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/Dictionary/GetDictionaryByKeyResponse.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class GetDictionaryByKeyResponse + { + /// + /// 字典类型 + /// + public string Key { get; set; } + /// + /// 字典类型名称 + /// + public string KeyName { get; set; } + /// + /// 字典值列表 + /// + public IList DicValueList { get; set; } + } + + public class DicValue + { + /// + /// 字典值 + /// + public string Value { get; set; } + /// + /// 字典值标签 + /// + public string ValueName { get; set; } + } +} diff --git a/BBWY.Client/Models/APIModel/Response/FallWare/FallWareConfigureCountResponse.cs b/BBWY.Client/Models/APIModel/Response/FallWare/FallWareConfigureCountResponse.cs new file mode 100644 index 00000000..147ee7cc --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/FallWare/FallWareConfigureCountResponse.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class FallWareConfigureCountResponse + { + public int FallWareWaitConfigureCount { get; set; } + + public int FallWareConfiguredCount { get; set; } + } +} diff --git a/BBWY.Client/Models/APIModel/Response/FallWare/SearchFallWareConfiguredResponse.cs b/BBWY.Client/Models/APIModel/Response/FallWare/SearchFallWareConfiguredResponse.cs new file mode 100644 index 00000000..076a494d --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/FallWare/SearchFallWareConfiguredResponse.cs @@ -0,0 +1,13 @@ +using BBWY.Client.Models.FallWare; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class SearchFallWareConfiguredResponse + { + public IList FallWareConfiguredModels { get; set; } + public int TotalCount { get; set; } + } +} diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuCountsResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuCountsResponse.cs index e6dd9cd9..1da09f27 100644 --- a/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuCountsResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuCountsResponse.cs @@ -36,5 +36,15 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask /// 待出库数 /// public int? WaitOutbound { get; set; } + + /// + /// 待落仓 + /// + public int? WaitFallWareCount { get; set; } + + /// + /// 待完结 + /// + public string WaitCompleted { get; set; } } } diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs index 713ae946..8e1396b6 100644 --- a/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs @@ -92,16 +92,6 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask /// public string Increment1 { get; set; } - /// - /// 条形码id - /// - public long? BarcodeId { get; set; } - - /// - /// 合格证 - /// - public string CertificateId { get; set; } - /// /// 合格证位置(外部包装=0,产品包装=1) /// @@ -122,10 +112,7 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask /// 注意事项(对接备注) /// public string MarkMessage { get; set; } - /// - /// 到货情况(待收货=2,部分收货=1,已到货=0) - /// - public int Availability { get; set; } + public bool NeedBar { get; set; } diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs index a7897d6f..f76bb8b0 100644 --- a/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs @@ -40,7 +40,7 @@ namespace BBWY.Client.Models.APIModel /// /// 任务状态 /// - public PackTaskState TaskState { get; set; } + public TaskState TaskState { get; set; } /// /// 需求方团队 diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitFallWareResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitFallWareResponse.cs new file mode 100644 index 00000000..c540da6b --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitFallWareResponse.cs @@ -0,0 +1,156 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class SearchWaitFallWareResponse + { + /// + /// 数量 + /// + public int TotalCount { get; set; } + + + public IList WaitFallWareList { get; set; } + } + + + + + + + public class WaitFallWareModelResponse + { /// + /// 仓库类型 + /// + public WareType WareType { get; set; } + /// + /// 店铺Id + /// + public string ShopId { get; set; } + /// + /// 仓库Id(同一个店铺 唯一) + /// + public string WareId { get; set; } + /// + /// 店铺名称 + /// + public string ShopName { get; set; } + /// + /// 仓库名 + /// + public string WareName { get; set; } + + /// + /// 团队名称 + /// + public string DepartmentName { get; set; } + + /// + /// 对接人(同团队下) + /// + public List AcceptUserNames { get; set; } + + /// + /// 封箱sku列表 + /// + public List SealBoxSkus { get; set; } + + /// + /// 封箱的箱子数量 + /// + public int SealBoxCount { get; set; } + /// + /// 封箱id + /// + public long SealBoxId { get; set; } + /// + /// 落仓材料 + /// + public BoxConfigureData BoxConfigureData { get; set; } + /// + /// 商品数量(封箱sku任务数总和) + /// + public int ProductCount { get; set; } + } + + public class WaitFallWareModel + { + /// + /// 仓库类型 + /// + public WareType WareType { get; set; } + /// + /// 店铺Id + /// + public string ShopId { get; set; } + /// + /// 仓库Id(同一个店铺 唯一) + /// + public string WareId { get; set; } + /// + /// 店铺名称 + /// + public string ShopName { get; set; } + /// + /// 仓库名 + /// + public string WareName { get; set; } + + /// + /// 团队名称 + /// + public string DepartmentName { get; set; } + + /// + /// 对接人(同团队下) + /// + public string AcceptUserNames { get; set; } + + /// + /// 封箱sku列表 + /// + public List SealBoxSkus { get; set; } + + /// + /// 封箱的箱子数量 + /// + public int SealBoxCount { get; set; } + /// + /// 封箱id + /// + public long SealBoxId { get; set; } + /// + /// 落仓材料 + /// + public BoxConfigureData BoxConfigureData { get; set; } + /// + /// 商品数量(封箱sku任务数总和) + /// + public int ProductCount { get; set; } + } + public class BoxConfigureData + { + /// + /// 采购单号 + /// + public string PurchaseOrder { get; set; } + /// + /// 预约单号 + /// + public string PrewOrder { get; set; } + + /// + /// 运单号 + /// + public string WaybillNo { get; set; } + + /// + /// 商品名称 + /// + public string ProductTitle { get; set; } + + } + +} diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitSealBoxResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitSealBoxResponse.cs index 97988b82..bcedf94a 100644 --- a/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitSealBoxResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/PackTask/SearchWaitSealBoxResponse.cs @@ -96,5 +96,6 @@ namespace BBWY.Client.Models.APIModel /// 打包sku产品数量 /// public int SkuCount { get; set; } + } } diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxResponse.cs new file mode 100644 index 00000000..2e78c144 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/SealBox/GetWareSealBoxResponse.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class GetWareSealBoxResponse + { + /// + /// 数量 + /// + public int TotalCount { get; set; } + + /// + /// 分箱列表 + /// + public List WaitSealBoxModels { get; set; } + } + + public class WareSealBoxData + { + public long SealBoxId { get; set; } + /// + /// 店铺Id + /// + public string ShopId { get; set; } + /// + /// 仓库Id(同一个店铺 唯一) + /// + public string WareId { get; set; } + /// + /// 店铺名称 + /// + public string ShopName { get; set; } + /// + /// 仓库名 + /// + public string WareName { get; set; } + + /// + /// 团队名称 + /// + public string DepartmentName { get; set; } + + /// + /// 对接人(同团队下) + /// + public List AcceptUserNames { get; set; } + + /// + /// 封箱sku列表 + /// + public List SealBoxSkus { get; set; } + + } + + public class WareSealBoxSku + { + + public TaskState TaskState { get; set; } + /// + /// 任务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 WareHourseSkuCount { get; set; } + } +} diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/SealBoxConfiguredResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/SealBoxConfiguredResponse.cs new file mode 100644 index 00000000..34801c7d --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/SealBox/SealBoxConfiguredResponse.cs @@ -0,0 +1,17 @@ +using BBWY.Client.Models.SealBox; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class SealBoxConfiguredResponse + { + public int TotalCount { get; set; } + + public IList SealBoxConfiguredModels { get; set; } + } + + + +} diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/SealBoxPackStateCountResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/SealBoxPackStateCountResponse.cs new file mode 100644 index 00000000..6ff5c867 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/SealBox/SealBoxPackStateCountResponse.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class SealBoxPackStateCountResponse + { + /// + /// 封箱 待配置数 + /// + public int SealBoxWaitConfigureCount { get; set; } + /// + ///封箱 已配置数 + /// + public int SealBoxConfiguredCount { get; set; } + } +} diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/SealBoxWaitConfigureResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/SealBoxWaitConfigureResponse.cs new file mode 100644 index 00000000..f89ee0b2 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/SealBox/SealBoxWaitConfigureResponse.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class SealBoxWaitConfigureResponse + { + public int TotalCount { get; set; } + + public IList SealBoxWaitConfigureModels { get; set; } + + } + + +} diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/UpdateSealBoxConfiguredResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/UpdateSealBoxConfiguredResponse.cs new file mode 100644 index 00000000..7c3c1e05 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/SealBox/UpdateSealBoxConfiguredResponse.cs @@ -0,0 +1,12 @@ +using BBWY.Client.Models.SealBox; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.APIModel +{ + public class UpdateSealBoxConfiguredResponse + { + public IList UpdateSealBoxConfiguredTaskDatas { get; set; } + } +} diff --git a/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs b/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs index 64475d89..48e8f88d 100644 --- a/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs +++ b/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs @@ -120,11 +120,11 @@ namespace BBWY.Client.Models /// public Worry IsWorry { get => isWorry; set { Set(ref isWorry, value); } } - private TaskState availability; + private Availability availability; /// /// 到货情况(待收货=0,部分收货=1,已到货=2) /// - public TaskState Availability { get => availability; set { Set(ref availability, value); } } + public Availability Availability { get => availability; set { Set(ref availability, value); } } private PackType packType; /// @@ -470,7 +470,7 @@ namespace BBWY.Client.Models GoodsNumber = config.GoodsNumber; PackType = (PackType)config.PackType; BasicPack = (BasicPack)config.BasicPack; - Availability = (TaskState)config.Availability; + // Availability = (Availability)config.Availability; MarkMessage = config.MarkMessage; CertificatePosition = config.CertificatePosition == null ? CertificatePosition.无 : (CertificatePosition)config.CertificatePosition.Value; // Increment1 = config.Increment1; diff --git a/BBWY.Client/Models/Enums.cs b/BBWY.Client/Models/Enums.cs index c8c1e2e4..9e0ff3b9 100644 --- a/BBWY.Client/Models/Enums.cs +++ b/BBWY.Client/Models/Enums.cs @@ -209,22 +209,29 @@ } - ///// - ///// 快递到货情况 - ///// - public enum TaskState - { - 已到货 = 0, - 部分到货 = 1, - 未到货 = 2, - 已完成 = 3, - 全部 = 4, - 加急 = 5 - } + public enum Availability + { + 已到货 = 0, + 部分到货 = 1, + 未到货 = 2, + } + + /////// + /////// 快递到货情况 + /////// + //public enum TaskState + //{ + // 已到货 = 0, + // 部分到货 = 1, + // 未到货 = 2, + // 已完成 = 3, + // 全部 = 4, + // 加急 = 5 + //} /// /// 仓库打包任务状态 /// - public enum PackTaskState + public enum TaskState { 未到货 = 0, 部分到货 = 1, @@ -233,7 +240,9 @@ 待封箱 = 4, 待出库 = 5, 已完成 = 6, - 已取消 = 7 + 已取消 = 7, + 待落仓 = 8, + 待完结 = 9 } @@ -483,7 +492,7 @@ } /// - /// 打包配置存放区分 + /// 存放区分(任务区分) /// public enum SaveType { @@ -496,4 +505,21 @@ /// B端 = 1 } + + /// + /// 落仓状态 + /// + public enum PositionState + { + 待封箱=0, 待落仓=1,已配置待落仓=2, 待完结=3 + } + + /// + /// 封箱配置状态 + /// + public enum SealBoxConfigureType + { + 已配置=0, + 待配置=1 + } } diff --git a/BBWY.Client/Models/FallWare/CloudWareBoxModel.cs b/BBWY.Client/Models/FallWare/CloudWareBoxModel.cs new file mode 100644 index 00000000..2d515cd2 --- /dev/null +++ b/BBWY.Client/Models/FallWare/CloudWareBoxModel.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.FallWare +{ + public class CloudWareBoxModel + { + /// + /// 箱子id + /// + public long SealBoxId { get; set; } + + /// + /// 供应商名称 + /// + public string ShopName { get; set; } + + /// + /// CLPS采购单号 + /// + public string CLPSPurchaseOrder { get; set; } + + /// + /// 预约单号 + /// + public string PrewOrder { get; set; } + + /// + /// 目的城市-仓库 + /// + public string WareName { get; set; } + + /// + /// 箱子数 + /// + public int BoxCount { get; set; } + + /// + /// 商品数量 + /// + public int ProductCount { get; set; } + } +} diff --git a/BBWY.Client/Models/FallWare/FallWareConfiguredModel.cs b/BBWY.Client/Models/FallWare/FallWareConfiguredModel.cs new file mode 100644 index 00000000..8e2631d0 --- /dev/null +++ b/BBWY.Client/Models/FallWare/FallWareConfiguredModel.cs @@ -0,0 +1,60 @@ +using BBWY.Client.Models.SealBox; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.FallWare +{ + public class FallWareConfiguredModel + { /// + /// 商品名称 + /// + public string ProductTitle { get; set; } + /// + /// 采购单号 + /// + public string PurchaseOrder { get; set; } + /// + /// 预约单号 + /// + public string PrewOrder { get; set; } + + /// + /// 运单号 + /// + public string WaybillNo { get; set; } + + /// + /// 仓库类型 + /// + public WareType? WareType { get; set; } + /// + /// 封箱id + /// + public long SealBoxId { get; set; } + + /// + /// 仓库名称 + /// + public string WareName { get; set; } + + /// + /// 箱子数 + /// + public int? BoxCount { get; set; } + + /// + /// 箱子总数量 + /// + public int SealBoxTotalCount { get; set; } + + /// + /// 仓库任务列表 + /// + public IList SealBoxConfigureTasks { get; set; } + } + public class FallWareConfigureTask : SealBoxConfigureTask + { + + } +} diff --git a/BBWY.Client/Models/FallWare/FallWareWaitConfigureModel.cs b/BBWY.Client/Models/FallWare/FallWareWaitConfigureModel.cs new file mode 100644 index 00000000..4fe754a3 --- /dev/null +++ b/BBWY.Client/Models/FallWare/FallWareWaitConfigureModel.cs @@ -0,0 +1,36 @@ +using BBWY.Client.Models.SealBox; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; + +namespace BBWY.Client.Models.FallWare +{ + public class FallWareWaitConfigureModel + { + /// + /// 封箱id + /// + public long SealBoxId { get; set; } + + /// + /// 箱子总数量 + /// + public int SealBoxTotalCount { get; set; } + + /// + /// 仓库名称 + /// + public string WareName { get; set; } + + /// + /// 仓库类型 + /// + public WareType? WareType { get; set; } + + /// + /// 仓库任务列表 + /// + public ObservableCollection SealBoxConfigureTasks { get; set; } + } +} diff --git a/BBWY.Client/Models/FallWare/JDWareBoxModel.cs b/BBWY.Client/Models/FallWare/JDWareBoxModel.cs new file mode 100644 index 00000000..90ab78ce --- /dev/null +++ b/BBWY.Client/Models/FallWare/JDWareBoxModel.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models.FallWare +{ + public class JDWareBoxModel + { + + /// + /// 箱子id + /// + public long SealBoxId { get; set; } + + /// + /// 供应商名称 + /// + public string ShopName { get; set; } + /// + /// 采购单号 + /// + public string PurchaseOrder { get; set; } + /// + /// 预约单号 + /// + public string PrewOrder { get; set; } + + /// + /// 运单号 + /// + public string WaybillNo { get; set; } + + /// + /// 目的城市-仓库 + /// + public string WareName { get; set; } + + /// + /// 商品名称 + /// + public string ProductTitle { get; set; } + + /// + /// 箱子数 + /// + public int BoxCount { get; set; } + + /// + /// 商品数量 + /// + public int ProductCount { get; set; } + } +} diff --git a/BBWY.Client/Models/MappingProfile.cs b/BBWY.Client/Models/MappingProfile.cs index adfde434..79e99062 100644 --- a/BBWY.Client/Models/MappingProfile.cs +++ b/BBWY.Client/Models/MappingProfile.cs @@ -1,4 +1,5 @@ using AutoMapper; +using BBWY.Client.Models.Statistics.AfterSaleOrder; namespace BBWY.Client.Models { diff --git a/BBWY.Client/Models/Order/Order.cs b/BBWY.Client/Models/Order/Order.cs index d1a22b7e..a93c95dd 100644 --- a/BBWY.Client/Models/Order/Order.cs +++ b/BBWY.Client/Models/Order/Order.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using BBWY.Client.Models.Statistics.AfterSaleOrder; namespace BBWY.Client.Models { diff --git a/BBWY.Client/Models/PackTask/CertificateModel.cs b/BBWY.Client/Models/PackTask/CertificateModel.cs index 91c03978..90fe2664 100644 --- a/BBWY.Client/Models/PackTask/CertificateModel.cs +++ b/BBWY.Client/Models/PackTask/CertificateModel.cs @@ -82,11 +82,6 @@ namespace BBWY.Client.Models /// public string ProductNo { get => productNo; set { Set(ref productNo, value); } } - ///// - ///// 生产日期 - ///// - //public DateTime ProductDate { get; set; } - /// /// 经销商 /// diff --git a/BBWY.Client/Models/PackTask/PackTaskModel.cs b/BBWY.Client/Models/PackTask/PackTaskModel.cs index 252775e4..9d46cf3b 100644 --- a/BBWY.Client/Models/PackTask/PackTaskModel.cs +++ b/BBWY.Client/Models/PackTask/PackTaskModel.cs @@ -14,6 +14,7 @@ using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Input; +using WebSocketSharp; namespace BBWY.Client.Models { @@ -29,8 +30,8 @@ namespace BBWY.Client.Models private long id; public long Id { get => id; set { Set(ref id, value); } } - - + + public ICommand PrintBarcodeCommand { get; set; } public ICommand PrintCerCommand { get; set; } @@ -48,19 +49,20 @@ namespace BBWY.Client.Models public Action ReflashTask { get; set; } - + private void UpdateTask() { - ViewModelLocator viewModel = new ViewModelLocator(); - var publicTaskViewModel = viewModel.PublishTask; - if (publicTaskViewModel.ReflashWindow == null) - publicTaskViewModel.ReflashWindow = ReflashTask; + if (!this.OrderId.IsNullOrEmpty()) + { + System.Windows.MessageBox.Show("暂不支持修改采购组的任务"); + return; + } + - publicTaskViewModel.InitData(this); - PublishTaskWindow publish = new PublishTaskWindow(); + PublishTaskWindow publish = new PublishTaskWindow(ReflashTask, this); publish.Show(); //CreatePackTask create = new CreatePackTask(); @@ -87,66 +89,21 @@ namespace BBWY.Client.Models LookCerCommand = new RelayCommand(LookCer); SetServiceCommand = new RelayCommand(SetService); UpdateTaskCommand = new RelayCommand(UpdateTask); - QualityTaskCommand=new RelayCommand(QualityTask); + QualityTaskCommand = new RelayCommand(QualityTask); } private void QualityTask() { - QualityWindow service = new QualityWindow(); //加载数据 - ViewModelLocator viewModelLocator = new ViewModelLocator(); - var qualityViewModel = viewModelLocator.QualityTask; - - if (qualityViewModel.ReflashWindow == null) - qualityViewModel.ReflashWindow = ReflashTask; - //qualityViewModel.TaskCount = SkuCount; - // qualityViewModel.TaskId = TaskId; - qualityViewModel.OrderId = OrderId; - qualityViewModel.SkuId = SkuId; - try - { - qualityViewModel.SearchSku(this); - } - catch (Exception ex) - { - System.Windows.MessageBox.Show(ex.Message); - - } - - //qualityViewModel.LoadPackDatas(); - //qualityViewModel.SetAllFees = new Action>((feesItem, packUsers) => - //{ - // FeesItemResponse = feesItem; - // PackUser = string.Join("\r\n", packUsers); - // FeesItemResponse.DiscountAllFees = feesItem.disCount * feesItem.AllFees; - // IsShowFees = feesItem.AllFees > 0 ? true : false; - //}); + QualityWindow service = new QualityWindow(this, ReflashTask); service.Show(); } private void SetService() { - ServiceWindow service = new ServiceWindow(); - //加载数据 - ViewModelLocator viewModelLocator = (ViewModelLocator)App.Current.Resources["Locator"]; - var serviceViewModel = viewModelLocator.PackServiceList; - - serviceViewModel.PackTaskModel = this; - serviceViewModel.PackTaskList = new System.Collections.ObjectModel.ObservableCollection { this}; - serviceViewModel.FloorDragNumber = this.FloorDragNumber; - serviceViewModel.TaskCount = SkuCount; - serviceViewModel.TaskId = TaskId; - serviceViewModel.OrderId= OrderId; - serviceViewModel.SkuId =SkuId ; - serviceViewModel.PackUserName = this.PackUser?.Replace("\r\n",",")?.Replace("\n", ",")?.Replace("\r", ","); - serviceViewModel.LoadPackDatas(); - - serviceViewModel.SetAllFees = new Action(() => - { - if (ReflashTask != null) ReflashTask(); - }); + ServiceWindow service = new ServiceWindow(this, ReflashTask); service.Show(); } @@ -197,7 +154,7 @@ namespace BBWY.Client.Models return; } PrintWindow printWindow = new PrintWindow(); - + printWindow.CertificateModel = certificateModel; printWindow.LoadData(); //printWindow.Datas = LoadCerLabelModels(); @@ -215,7 +172,7 @@ namespace BBWY.Client.Models return; } - PrintWindow printWindow = new PrintWindow(); + PrintWindow printWindow = new PrintWindow(); printWindow.BarCodeModel = new BarCodeModel { Brand = BarCodeModel.Brand, @@ -229,72 +186,8 @@ namespace BBWY.Client.Models //printWindow.Datas = LoadBarLabelModels(); printWindow.Show(); } - - /* - public Dictionary LoadBarLabelModels() - { - Dictionary data = new Dictionary(); - data.Add("pinming", $"品名: {BarCodeModel.BrandName}"); - data.Add("guige", $"规格: {BarCodeModel.SkuName}"); - data.Add("pop", $"POP{BarCodeModel.SkuId}"); - switch (BarCodeModel.LabelModel) - { - case BarcodeLabelModel.barstander: - data.Add("pinpai", $"品牌: {BarCodeModel.Brand}"); - data.Add("xinghao", $"型号: {BarCodeModel.ProductNo}"); - return data; - case BarcodeLabelModel.barsimplify: - return data; - default: - break; - } - return data; - } - - public Dictionary LoadCerLabelModels() - { - Dictionary data = new Dictionary(); - data.Add("pinming", $"品名: {CertificateModel.BrandName}"); - data.Add("pinpai", $"品牌: {CertificateModel.Brand}"); - data.Add("xinghao", $"型号: {CertificateModel.ProductNo}"); - data.Add("dizhi", $"地址: {CertificateModel.ProductAdress}"); - data.Add("caizhi", $"材质: {CertificateModel.Shader}"); - data.Add("changshang", $"生产商: {CertificateModel.ProductShop}"); - - - switch (CertificateModel.IsLogo) - { - case 0://无图 - data.Add("gongchangid", $"无"); - break; - case 1://有图 - data.Add("gongchangid", $"{CertificateModel.FactoryNumber}"); - break; - default: - break; - } - - string[] excutes = CertificateModel.ExcuteStander.Split(',', StringSplitOptions.RemoveEmptyEntries); - StringBuilder sb = new StringBuilder(); - sb.Append("执行标准: "); - for (int i = 0; i < excutes.Count(); i++) - { - if (i % 2 == 0 && i > 0)//间隔两个换行 - { - sb.Append("\r\n").Append(" "); - } - sb.Append(excutes[i]).Append(" "); - } - sb.Remove(sb.Length - 3, 3); - - - data.Add("biaozhun", sb.ToString()); - - - - return data; - } - */ + + private DateTime endTime; /// @@ -331,11 +224,11 @@ namespace BBWY.Client.Models public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } } - private TaskState availability; + private Availability availability; /// /// 到货情况(待收货=0,部分收货=1,已到货=2) /// - public TaskState Availability { get => availability; set { Set(ref availability, value); } } + public Availability Availability { get => availability; set { Set(ref availability, value); } } private Worry isWorry; @@ -352,11 +245,11 @@ namespace BBWY.Client.Models public TaskStateType TaskStatus { get => taskStatus; set { Set(ref taskStatus, value); } } - private PackTaskState taskState; + private TaskState taskState; /// /// 打包仓库任务状态 /// - public PackTaskState TaskState { get => taskState; set { Set(ref taskState, value); } } + public TaskState TaskState { get => taskState; set { Set(ref taskState, value); } } private PackType packType; @@ -394,14 +287,6 @@ namespace BBWY.Client.Models /// public string Increment1 { get => increment1; set { Set(ref increment1, value); } } - - private Increment increment2; - /// - /// 增量2() - /// - public Increment Increment2 { get => increment2; set { Set(ref increment2, value); } } - - private string positionType; /// /// 落仓(本地仓=0,云仓=1,京仓=2) @@ -455,11 +340,11 @@ namespace BBWY.Client.Models public string SkuId { get => skuId; set { Set(ref skuId, value); } } - private string modelNo; - /// - /// 型号 - /// - public string ModelNo { get => modelNo; set { Set(ref modelNo, value); } } + //private string modelNo; + ///// + ///// 型号 + ///// + //public string ModelNo { get => modelNo; set { Set(ref modelNo, value); } } #endregion @@ -577,6 +462,6 @@ namespace BBWY.Client.Models /// public string GoodsNo { get => goodsNo; set { Set(ref goodsNo, value); } } - + } } diff --git a/BBWY.Client/Models/PackTask/SealBoxModel.cs b/BBWY.Client/Models/PackTask/SealBoxModel.cs index 7611a399..d9afe1e1 100644 --- a/BBWY.Client/Models/PackTask/SealBoxModel.cs +++ b/BBWY.Client/Models/PackTask/SealBoxModel.cs @@ -7,7 +7,10 @@ namespace BBWY.Client.Models.PackTask { public class SealBoxModel { - + /// + /// /封箱id + /// + public long SealBoxId { get; set; } /// /// 店铺Id /// @@ -38,6 +41,12 @@ namespace BBWY.Client.Models.PackTask /// /// 封箱sku列表 /// - public List SealBoxSkus { get; set; } + public List SealBoxSkus { get; set; } + + + /// + /// 封箱数 + /// + public int? SealBoxCount{ get; set; } } } diff --git a/BBWY.Client/Models/QualityTask/PurchaseSku.cs b/BBWY.Client/Models/QualityTask/PurchaseSku.cs index 67f253c9..1b6b01c7 100644 --- a/BBWY.Client/Models/QualityTask/PurchaseSku.cs +++ b/BBWY.Client/Models/QualityTask/PurchaseSku.cs @@ -69,5 +69,7 @@ namespace BBWY.Client.Models.QualityTask } } + + } } diff --git a/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs b/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs new file mode 100644 index 00000000..eb384976 --- /dev/null +++ b/BBWY.Client/Models/SealBox/SealBoxConfigureModel.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; + +namespace BBWY.Client.Models.SealBox +{ + public class SealBoxConfigureModel : NotifyObject + { + + + /// + /// skuid + /// + public string SkuId { get; set; } + /// + /// 任务id + /// + public long TaskId { get; set; } + /// + /// sku任务数 + /// + public int SkuCount { get; set; } + + /// + /// sku图片 + /// + public string Logo { get; set; } + + private int splitCount; + /// + /// 份数 + /// + public int SplitCount { get=>splitCount; set {Set(ref splitCount,value); } } + + private ObservableCollection wareHourseDatas = new ObservableCollection(); + /// + /// 装箱配置列表 + /// + public ObservableCollection WareHourseDatas { get => wareHourseDatas; set { Set(ref wareHourseDatas, value); } } + + } + /// + /// 封箱配置 装箱配置 + /// + public class SealBoxConfigureWareHourseModel : NotifyObject + { + private int index; + + public int Index { get => index; set { Set(ref index, value); } } + + private int count; + + public int Count { get=>count; set {Set(ref count,value); } } + + private string wareId; + + public string WareId { get => wareId; set { Set(ref wareId, value); } } + + + private string wareName; + + public string WareName { get => wareName; set { Set(ref wareName, value); } } + + + private WareType? wareType; + + public WareType? WareType { get => wareType; set { Set(ref wareType, value); } } + + /// + ///待封箱 = 0, 待落仓 = 1, 待完结 = 2 + /// + public PositionState? WareState { get; set; } + + + + } +} diff --git a/BBWY.Client/Models/SealBox/SealBoxConfiguredModel.cs b/BBWY.Client/Models/SealBox/SealBoxConfiguredModel.cs new file mode 100644 index 00000000..6ed226b0 --- /dev/null +++ b/BBWY.Client/Models/SealBox/SealBoxConfiguredModel.cs @@ -0,0 +1,60 @@ +using BBWY.Client.Models.APIModel; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; + +namespace BBWY.Client.Models.SealBox +{ + public class SealBoxConfiguredModel:NotifyObject + { + /// + /// 封箱id + /// + public long SealBoxId { get; set; } + + /// + /// 箱子总数量 + /// + public int SealBoxTotalCount { get; set; } + + /// + /// 仓库名称 + /// + public string WareName { get; set; } + + /// + /// 仓库类型 + /// + public WareType? WareType { get; set; } + + /// + /// 仓库任务列表 + /// + public ObservableCollection SealBoxConfigureTasks { get; set; } + } + public class SealBoxConfigureTask:NotifyObject + { + /// + /// skuid + /// + public string SkuId { get; set; } + /// + /// 任务id + /// + public long TaskId { get; set; } + /// + /// 仓库sku任务数 + /// + public int WareHourseCount { get; set; } + /// + /// sku名称 + /// + public string SkuName { get; set; } + /// + /// sku图片 + /// + public string Logo { get; set; } + + } +} diff --git a/BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs b/BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs new file mode 100644 index 00000000..22bd2083 --- /dev/null +++ b/BBWY.Client/Models/SealBox/SealBoxWaitConfigureModel.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models +{ + public class SealBoxWaitConfigureModel : NotifyObject + { + /// + /// skuid + /// + public string SkuId { get; set; } + /// + /// 任务id + /// + public long TaskId { get; set; } + /// + /// sku任务数 + /// + public int SkuCount { get; set; } + /// + /// sku名称 + /// + public string SkuName { get; set; } + /// + /// sku图片 + /// + public string Logo { get; set; } + /// + /// 预计完成时间 + /// + public DateTime? PreCompletedTime { get; set; } + /// + /// 任务状态 + /// + public TaskState? TaskState { get; set; } + + } +} diff --git a/BBWY.Client/Models/SealBox/UpdateSealBoxConfiguredTaskModel.cs b/BBWY.Client/Models/SealBox/UpdateSealBoxConfiguredTaskModel.cs new file mode 100644 index 00000000..bc56a9ab --- /dev/null +++ b/BBWY.Client/Models/SealBox/UpdateSealBoxConfiguredTaskModel.cs @@ -0,0 +1,43 @@ +using BBWY.Client.Models.APIModel; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; + +namespace BBWY.Client.Models.SealBox +{ + public class UpdateSealBoxConfiguredTaskModel:NotifyObject + { + public string Logo { get; set; } + + public string SkuId { get; set; } + + public long TaskId { get; set; } + /// + /// 采购数量 + /// + public int SkuCount { get; set; } + public string SkuName { get; set; } + + private int taskWareCount; + /// + /// 份数 + /// + public int TaskWareCount { get => taskWareCount; set { Set(ref taskWareCount, value); } } + + + + private ObservableCollection wareHourseDatas; + + public ObservableCollection WareHourseDatas { get => wareHourseDatas; set { Set(ref wareHourseDatas, value); } } + } + public class UpdateSealBoxWareHourseModel:WareHourseData + { + + + /// + ///待封箱 = 0, 待落仓 = 1, 待完结 = 2 + /// + public PositionState? WareState { get; set; } + } +} diff --git a/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrder.cs b/BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrder.cs similarity index 97% rename from BBWY.Client/Models/AfterSaleOrder/AfterSaleOrder.cs rename to BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrder.cs index 04785a6d..efcd93b4 100644 --- a/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrder.cs +++ b/BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrder.cs @@ -1,6 +1,6 @@ using System; -namespace BBWY.Client.Models +namespace BBWY.Client.Models.Statistics.AfterSaleOrder { public class AfterSaleOrder : NotifyObject, ICloneable { @@ -146,7 +146,7 @@ namespace BBWY.Client.Models public object Clone() { - return this.MemberwiseClone(); + return MemberwiseClone(); } } } diff --git a/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrderGroup.cs b/BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrderGroup.cs similarity index 85% rename from BBWY.Client/Models/AfterSaleOrder/AfterSaleOrderGroup.cs rename to BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrderGroup.cs index 49840022..92a26953 100644 --- a/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrderGroup.cs +++ b/BBWY.Client/Models/Statistics/AfterSaleOrder/AfterSaleOrderGroup.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace BBWY.Client.Models +namespace BBWY.Client.Models.Statistics.AfterSaleOrder { public class AfterSaleOrderGroup { diff --git a/BBWY.Client/ViewModels/BaseVM.cs b/BBWY.Client/ViewModels/BaseVM.cs index c4a8b336..a48a7b9c 100644 --- a/BBWY.Client/ViewModels/BaseVM.cs +++ b/BBWY.Client/ViewModels/BaseVM.cs @@ -26,7 +26,7 @@ namespace BBWY.Client.ViewModels { try { - Clipboard.SetText(s.ToString()); + Clipboard.SetText(s?.ToString()); } catch (Exception ex) { diff --git a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs index 28946e89..3372a4c3 100644 --- a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs +++ b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs @@ -1,6 +1,7 @@ using BBWY.Client.APIServices; using BBWY.Client.Helpers; using BBWY.Client.Models; +using BBWY.Client.Models.Statistics.AfterSaleOrder; using BBWY.Client.Views.Order; using BBWY.Common.Extensions; using BBWY.Common.Models; diff --git a/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs b/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs index fd9434b1..c1bd7658 100644 --- a/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs @@ -192,11 +192,11 @@ namespace BBWY.Client.ViewModels.PackTask public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } } - private TaskState availability; + private Availability availability; /// /// 到货情况(待收货=0,部分收货=1,已到货=2) /// - public TaskState Availability { get => availability; set { Set(ref availability, value); } } + public Availability Availability { get => availability; set { Set(ref availability, value); } } private PackType packType; @@ -220,18 +220,7 @@ namespace BBWY.Client.ViewModels.PackTask - private Increment increment1; - /// - /// 增量1() - /// - public Increment Increment1 { get => increment1; set { Set(ref increment1, value); } } - - private Increment increment2; - /// - /// 增量2() - /// - public Increment Increment2 { get => increment2; set { Set(ref increment2, value); } } private PositionType positionType; @@ -883,7 +872,6 @@ namespace BBWY.Client.ViewModels.PackTask SkuId = SkuId, CreateTime = DateTime.Now, Increment1 = increateStr, - Increment2 = (int)Increment2, CertificatePosition = (int)CertificatePosition, PackType = (int)PackType, MarkMessage = MarkMessage, @@ -987,10 +975,9 @@ namespace BBWY.Client.ViewModels.PackTask GoodsNumber = config.GoodsNumber; PackType = (PackType)config.PackType; BasicPack = (BasicPack)config.BasicPack; - Availability = (TaskState)config.Availability; + //Availability = (Availability)config.Availability; MarkMessage = config.MarkMessage; CertificatePosition = config.CertificatePosition == null ? CertificatePosition.无 : (CertificatePosition)config.CertificatePosition.Value; - // Increment1 = config.Increment1; string[] increateDatas = config.Increment1.Split(','); bool isSelected = false; diff --git a/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs b/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs index a821ab98..bc724769 100644 --- a/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs @@ -32,7 +32,7 @@ using System.Windows.Media.Imaging; namespace BBWY.Client.ViewModels.PackTask { - public class PackServiceViewModel : BaseVM, IDenpendency + public class PackServiceViewModel : BaseVM { @@ -132,7 +132,7 @@ namespace BBWY.Client.ViewModels.PackTask readonly PackTaskService packTaskService; readonly ConsumableService consumableService; readonly PackDetailService packDetailService; - readonly BatchPurchaseService batchPurchaseService; + private ObservableCollection increateList = new ObservableCollection(); public ObservableCollection IncreateList { get => increateList; set { Set(ref increateList, value); } } // @@ -179,7 +179,7 @@ namespace BBWY.Client.ViewModels.PackTask /// public ObservableCollection BasicPackServiceList { get; set; } = new ObservableCollection(); - private readonly PackServiceService packServiceService; + /// /// 加载原数据 @@ -236,14 +236,14 @@ namespace BBWY.Client.ViewModels.PackTask } - public PackServiceViewModel(PackTaskService packTaskService, ConsumableService consumableService, PackServiceService packServiceService, PackDetailService packDetailService, BatchPurchaseService batchPurchaseService)//, long taskId + public PackServiceViewModel(PackTaskService packTaskService, ConsumableService consumableService, PackDetailService packDetailService)//, long taskId { //TaskId = taskId; this.consumableService = consumableService; this.packTaskService = packTaskService; - this.packServiceService = packServiceService; + this.packDetailService = packDetailService; - this.batchPurchaseService = batchPurchaseService; + AddIncreateServiceCommand = new RelayCommand(AddIncreateService); @@ -616,7 +616,7 @@ namespace BBWY.Client.ViewModels.PackTask var res = packDetailService.SetPackTaskDetail(packTaskDetail); - if (res==null) + if (res == null) { System.Windows.MessageBox.Show("网络异常!"); return; @@ -627,18 +627,18 @@ namespace BBWY.Client.ViewModels.PackTask return; } - - // new TipsWindow("上传成功!").Show(); - var win = obj as System.Windows.Window; - if (SetAllFees != null) - SetAllFees(); - win.Close(); - + + // new TipsWindow("上传成功!").Show(); + var win = obj as System.Windows.Window; + if (ReflashWindow != null) + ReflashWindow(); + win.Close(); + } /// - /// 更新 打包员 和费用数据 + /// 刷新界面 /// - public Action SetAllFees { get; set; } + public Action ReflashWindow { get; set; } private void AddPackService() { diff --git a/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs b/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs index 6174e294..8f26bbbb 100644 --- a/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs @@ -19,7 +19,7 @@ using System.Windows.Input; namespace BBWY.Client.ViewModels.PackTask { - public class PublishTaskViewModel : BaseVM, IDenpendency + public class PublishTaskViewModel : BaseVM { #region 属性 @@ -124,11 +124,11 @@ namespace BBWY.Client.ViewModels.PackTask /// public Worry IsWorry { get => isWorry; set { Set(ref isWorry, value); } } - private TaskState availability; + private Availability availability; /// /// 到货情况(待收货=0,部分收货=1,已到货=2) /// - public TaskState Availability { get => availability; set { Set(ref availability, value); } } + public Availability Availability { get => availability; set { Set(ref availability, value); } } private PackType packType; /// @@ -322,7 +322,6 @@ namespace BBWY.Client.ViewModels.PackTask public ICommand OpenSkuDetailCommand { get; set; } public ICommand CreateTaskCommand { get; set; } - public ICommand SearchSkuCommand { get; set; } private void SetBarCode() @@ -744,16 +743,6 @@ namespace BBWY.Client.ViewModels.PackTask new TipsWindow("请设置合格证模板").Show(); return; } - try - { - createTaskModel.CertificateId = CertificateModel.Where(c => c.Id > 0).FirstOrDefault()?.Id; - } - catch - { - - - } - createTaskModel.CerId = string.Join(",", CertificateModel.Where(c => c.Id > 0).Select(c => c.Id));// } ApiResponse res = null; diff --git a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs index 6218e4b8..2bf03a4b 100644 --- a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs @@ -22,6 +22,13 @@ using HandyControl.Tools.Extension; using Newtonsoft.Json; using BBWY.Client.Models.APIModel.Response.PackTask; using BBWY.Client.Models.PackTask; +using WebSocketSharp; +using BBWY.Client.Models.APIModel; +using BBWY.Client.Views.SealBox; +using BBWY.Client.Models.SealBox; +using BBWY.Client.ViewModels.SealBox; +using BBWY.Client.Views.FallWare; +using BBWY.Client.Models.FallWare; namespace BBWY.Client.ViewModels.PackTask { @@ -31,7 +38,64 @@ namespace BBWY.Client.ViewModels.PackTask public partial class TaskListViewModel : BaseVM, IDenpendency//注入服务 { + + #region 属性绑定 + + + + + private string sealBoxWaitConfigureCount; + /// + /// 封箱 待配置数 + /// + public string SealBoxWaitConfigureCount { get => sealBoxWaitConfigureCount; set { Set(ref sealBoxWaitConfigureCount, value); } } + + private string sealBoxConfiguredCount; + /// + ///封箱 已配置数 + /// + public string SealBoxConfiguredCount { get => sealBoxConfiguredCount; set { Set(ref sealBoxConfiguredCount, value); } } + + private SealBoxConfigureType sealBoxConfigureType; + /// + /// 封箱配置状态 + /// + public SealBoxConfigureType SealBoxConfigureType { get => sealBoxConfigureType; set { Set(ref sealBoxConfigureType, value); } } + + //private SealBoxConfigureType fallWareConfigureType; + ///// + ///// 落仓配置状态 + ///// + //public SealBoxConfigureType FallWareConfigureType { get => fallWareConfigureType; set { Set(ref fallWareConfigureType, value); } } + + + private ObservableCollection sealBoxWaitConfigureList; + /// + /// 封箱待配置列表 + /// + public ObservableCollection SealBoxWaitConfigureList { get => sealBoxWaitConfigureList; set { Set(ref sealBoxWaitConfigureList, value); } } + + private ObservableCollection sealBoxConfiguredList; + /// + /// 封箱已配置列表 + /// + public ObservableCollection SealBoxConfiguredList { get => sealBoxConfiguredList; set { Set(ref sealBoxConfiguredList, value); } } + + + + private ObservableCollection fallWareWaitConfigureList; + /// + /// 落仓待配置列表 + /// + public ObservableCollection FallWareWaitConfigureList { get => fallWareWaitConfigureList; set { Set(ref fallWareWaitConfigureList, value); } } + + private ObservableCollection fallWareConfiguredList; + /// + /// 落仓已配置列表 + /// + public ObservableCollection FallWareConfiguredList { get => fallWareConfiguredList; set { Set(ref fallWareConfiguredList, value); } } + /// /// 查询时间段 /// @@ -84,33 +148,59 @@ namespace BBWY.Client.ViewModels.PackTask /// /// 未到货数量 /// - public int NoArrivedCount { get => noArrivedCount; set { Set(ref noArrivedCount, value); } } - private int noArrivedCount; - private int someArrivedCount; + public string NoArrivedCount { get => noArrivedCount; set { Set(ref noArrivedCount, value); } } + private string noArrivedCount; + private string someArrivedCount; /// /// 部分到货数量 /// - public int SomeArrivedCount { get => someArrivedCount; set { Set(ref someArrivedCount, value); } } + public string SomeArrivedCount { get => someArrivedCount; set { Set(ref someArrivedCount, value); } } - private int arrivedCount; + private string arrivedCount; /// /// 已到货数量 /// - public int ArrivedCount { get => arrivedCount; set { Set(ref arrivedCount, value); } } - //private int totalCount; - ///// - ///// 全部数量 - ///// - //public int TotalCount { get => totalCount; set { Set(ref totalCount, value); } } + public string ArrivedCount { get => arrivedCount; set { Set(ref arrivedCount, value); } } + + private bool isLoading; + public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } + + private string waitPackCount; + /// + /// 待打包任务数 + /// + public string WaitPackCount { get => waitPackCount; set { Set(ref waitPackCount, value); } } + private string waitSealBoxCount; + /// + /// 带封箱任务数 + /// + public string WaitSealBoxCount { get => waitSealBoxCount; set { Set(ref waitSealBoxCount, value); } } + private string waitFallWareCount; + /// + /// 待落仓任务数 + /// + public string WaitFallWareCount { get => waitFallWareCount; set { Set(ref waitFallWareCount, value); } } + + private string waitOutbound; + /// + /// 待出库任务数 + /// + public string WaitOutbound { get => waitOutbound; set { Set(ref waitOutbound, value); } } + + + private string waitCompleted; + /// + /// 待完成任务数 + /// + public string WaitCompleted { get => waitCompleted; set { Set(ref waitCompleted, value); } } - private bool isLoading; - public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } + private readonly SealBoxService sealBoxService; private readonly PackTaskService packTaskService; WorkProcessService workProcessService; public int? taskStatus { get; set; } @@ -125,7 +215,7 @@ namespace BBWY.Client.ViewModels.PackTask - public TaskListViewModel(PackTaskService packTaskService, GlobalContext globalContext, ProductService productService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService) + public TaskListViewModel(PackTaskService packTaskService, GlobalContext globalContext, ProductService productService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService, SealBoxService sealBoxService) { this.globalContext = globalContext; this.productService = productService; @@ -133,10 +223,17 @@ namespace BBWY.Client.ViewModels.PackTask this.workProcessService = workProcessService; this.increateServiceService = increateServiceService; this.packTaskService = packTaskService; - //TaskState = BBWY.Client.Models. TaskState.全部; PackTaskList = new ObservableCollection();//初始化数据 SetTaskStateCommand = new RelayCommand(SetTaskState); + + SetSealBoxConfigureTypeCommand = new RelayCommand(s => + { + PageIndex = 1; + SealBoxConfigureType = s; + Task.Factory.StartNew(() => SearchTaskList()); + }); + CreateTaskCommand = new RelayCommand(CreateTask); SearchTaskCommand = new RelayCommand(() => { @@ -151,44 +248,146 @@ namespace BBWY.Client.ViewModels.PackTask OpenSkuDetailCommand = new RelayCommand(OpenSkuDetail); DeletedTaskCommand = new RelayCommand(DeletedTask); + ConfiguredSealBoxCommand = new RelayCommand(ConfiguredSealBox); + UpdateSealBoxConfiguredCommand = new RelayCommand(UpdateSealBoxConfigured); + StartTime = DateTime.Now.Date; EndTime = DateTime.Now.Date; IsLoading = false; //加载数据 - SetTaskState(Models.TaskState.全部); + SetTaskState(null); + this.sealBoxService = sealBoxService; + SealBoxConfigureType = SealBoxConfigureType.已配置; + + SetFallWareConfiguredCommand = new RelayCommand(SetFallWareConfigured); + } + + private void SetFallWareConfigured(object obj) + { + var fallware = obj as FallWareConfiguredModel; + JDWareBoxModel model = new JDWareBoxModel + { + ShopName = globalContext.User.Shop.ShopName, + WareName = fallware.WareName, + SealBoxId = fallware.SealBoxId, + ProductCount = fallware.SealBoxTotalCount, + BoxCount = fallware.BoxCount.Value, + PrewOrder = fallware.PrewOrder, + ProductTitle = fallware.ProductTitle, + PurchaseOrder = fallware.PurchaseOrder, + WaybillNo = fallware.WaybillNo + }; + if (fallware.WareType== WareType.京仓) + { + + SetJDWareBoxWindow window = new SetJDWareBoxWindow(model,sealBoxService,fallware.WareType.Value,ReflashTask); + window.Show(); + } + if (fallware.WareType == WareType.云仓) + { + + SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, sealBoxService, fallware.WareType.Value, ReflashTask); + window.Show(); + } } + private void UpdateSealBoxConfigured(SealBoxConfiguredModel model) + { + var sealBoxId = model.SealBoxId; + var taskIds = model.SealBoxConfigureTasks.Select(s => s.TaskId).ToArray(); - private void DeletedTask(object obj) + var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfigured(sealBoxId, taskIds); + if (updateSealBoxConfig == null) + { + MessageBox.Show("网络异常,获取不到带封箱数据"); + return; + } + if (!updateSealBoxConfig.Success || updateSealBoxConfig.Data == null) + { + MessageBox.Show(updateSealBoxConfig.Msg); + return; + } + + + + SealBoxConfigureWindow sealBoxConfigureWindow = new SealBoxConfigureWindow(updateSealBoxConfig.Data.UpdateSealBoxConfiguredTaskDatas, ReflashTask, sealBoxId); + sealBoxConfigureWindow.Show(); + } + + private void ConfiguredSealBox() { + var waitSealBoxRes = sealBoxService.GetSealBoxWaitConfigureList(null, null, null, null, null);//获取所有待封装列表 + if (waitSealBoxRes == null) + { + MessageBox.Show("网络异常,获取不到带封箱数据"); + return; + } + if (!waitSealBoxRes.Success || waitSealBoxRes.Data == null) + { + MessageBox.Show(waitSealBoxRes.Msg); + return; + } + if (waitSealBoxRes.Data.TotalCount <= 0) + { + MessageBox.Show("已全部封箱!"); + return; + } + var taskIds = waitSealBoxRes.Data.SealBoxWaitConfigureModels.Select(w => w.TaskId).ToArray(); + + var updateSealBoxConfig = sealBoxService.GetUpdateSealBoxConfigured(0, taskIds); + if (updateSealBoxConfig == null) + { + MessageBox.Show("网络异常,获取不到带封箱数据"); + return; + } + if (!updateSealBoxConfig.Success || updateSealBoxConfig.Data == null) + { + MessageBox.Show(updateSealBoxConfig.Msg); + return; + } + SealBoxConfigureWindow sealBoxConfigureWindow = new SealBoxConfigureWindow(updateSealBoxConfig.Data.UpdateSealBoxConfiguredTaskDatas, ReflashTask, 0); + sealBoxConfigureWindow.Show(); + + + } + + private void DeletedTask(object obj) + { + var packTaskmodel = (PackTaskModel)obj; + if (!packTaskmodel.OrderId.IsNullOrEmpty()) + { + System.Windows.MessageBox.Show($"暂不支持删除采购组的任务,如要删除,请到采购列表取消订单:{packTaskmodel.OrderId}"); + return; + } MessageBoxResult result = MessageBox.Show("确定取消任务?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning); - long taskId = (long)obj; if (result != MessageBoxResult.Yes) return; - packTaskService.DeletedTask(taskId); + packTaskService.DeletedTask(packTaskmodel.TaskId); Task.Factory.StartNew(() => SearchTaskList()); } private void IsLoadCount() { - var packTaskResult = packTaskService.GetAllCount(); - if (packTaskResult != null && packTaskResult.Success) + var packTaskResult = packTaskService.GetTaskAllCount(globalContext.User.Shop.ShopId.ToString()); + if (packTaskResult != null && packTaskResult.Success && packTaskResult.Data != null) { - App.Current.Dispatcher.Invoke(() => + App.Current.Dispatcher.Invoke(new Action(() => { - ArrivedCount = packTaskResult.Data.ArrivedCount; - NoArrivedCount = packTaskResult.Data.NoArrivedCount; - SomeArrivedCount = packTaskResult.Data.SomeArrivedCount; - }); - - + ArrivedCount = packTaskResult.Data.ArrivedCount.ToString(); + NoArrivedCount = packTaskResult.Data.NoArrivedCount.ToString(); + SomeArrivedCount = packTaskResult.Data.SomeArrivedCount.ToString(); + //WorryCount = packTaskResult.Data.WorryCount.ToString(); + WaitOutbound = packTaskResult.Data.WaitOutbound?.ToString(); + WaitPackCount = packTaskResult.Data.WaitPackCount?.ToString(); + WaitSealBoxCount = packTaskResult.Data.WaitSealBox?.ToString(); + WaitFallWareCount = packTaskResult.Data.WaitFallWareCount?.ToString(); + WaitCompleted = packTaskResult.Data.WaitCompleted?.ToString(); + })); } - - } private void LoadIndex(int pageIndex) @@ -201,6 +400,23 @@ namespace BBWY.Client.ViewModels.PackTask #region 事件绑定 + /// + /// 设置落仓配置信息(上传材料) + /// + public ICommand SetFallWareConfiguredCommand { get; set; } + /// + /// 修改封箱数据 + /// + public ICommand UpdateSealBoxConfiguredCommand { get; set; } + /// + /// 配置封箱策略 + /// + public ICommand ConfiguredSealBoxCommand { get; set; } + /// + /// 待配置 /已配置 + /// + public ICommand SetSealBoxConfigureTypeCommand { get; set; } + /// /// 筛选数据 /// @@ -233,33 +449,12 @@ namespace BBWY.Client.ViewModels.PackTask public void SetTaskState(TaskState? taskState) { + PageIndex = 1; TaskState = taskState; - switch (taskState) - { - case null: - break; - case Models.TaskState.已到货: - case Models.TaskState.部分到货: //未完成的数据 - case Models.TaskState.未到货: - taskStatus = null; - TaskState = taskState; - taskStatus = 0; - break; - case Models.TaskState.全部: //所有数据 - TaskState = null; - taskStatus = null; - break; - case Models.TaskState.已完成: - TaskState = null; - taskStatus = 1; - break; - - default: - break; - } SearchTaskList(); } + private ConsumableService consumableService; private IncreateServiceService increateServiceService; @@ -269,16 +464,19 @@ namespace BBWY.Client.ViewModels.PackTask SearchTaskList(); } - + private List waitSealBoxTaskStates = new List { + Models.TaskState.待落仓, Models.TaskState.待封箱 + };//配置封箱的任务状态范围 /// /// 搜索任务列表 /// public void SearchTaskList() { + long? taskId = null; try { if (SearchTaskId != null && !string.IsNullOrEmpty(SearchTaskId.Trim())) - Convert.ToInt64(SearchTaskId); + taskId= Convert.ToInt64(SearchTaskId); } catch { @@ -288,107 +486,256 @@ namespace BBWY.Client.ViewModels.PackTask } IsLoading = true; - Task.Factory.StartNew(() => - { - try + if (TaskState == null || !waitSealBoxTaskStates.Contains(TaskState.Value)) + Task.Factory.StartNew(() => { - PackTaskList = new ObservableCollection();//初始化数据 - var datas = packTaskService.GetOrderList(SearchSkuId, SearchTaskId, StartTime, EndTime, (this.TaskState), taskStatus, - PageIndex, PageSize); - if (datas != null && datas.Data != null && datas.Success) + + try { - var dataModel = datas.Data; - OrderCount = dataModel.TotalCount; - foreach (var item in dataModel.Items) + PackTaskList = new ObservableCollection();//初始化数据 + var datas = packTaskService.GetTaskList(SearchSkuId, SearchTaskId, StartTime, EndTime, (this.TaskState), + PageIndex, PageSize); + if (datas != null && datas.Data != null && datas.Success) { - - var data = new PackTaskModel() + var dataModel = datas.Data; + OrderCount = dataModel.TotalCount; + foreach (var item in dataModel.Items) { - Brand = item.Brand, - SkuId = item.SkuId, - AcceptName = item.UserName, - Availability = (TaskState)item.Availability, - BasicPack = (BasicPack)item.BasicPack, - DepartmentName = item.DepartmentName, - CertificatePosition = (CertificatePosition)item.CertificatePosition, - - GoodsNumber = item.GoodsNumber, - Increment1 = item.Increment1, - Increment2 = (Increment)item.Increment2, - ItemList = new List() { new SkuMessage + + var data = new PackTaskModel() + { + Brand = item.Brand, + SkuId = item.SkuId, + AcceptName = item.UserName, + Availability = (Availability)item.Availability, + BasicPack = (BasicPack)item.BasicPack, + DepartmentName = item.DepartmentName, + CertificatePosition = (CertificatePosition)item.CertificatePosition, + GoodsNumber = item.GoodsNumber, + Increment1 = item.Increment1, + ItemList = new List() { new SkuMessage { BrandName = item.BrandName, GoodsNo = item.ProductItemNum, Logo= item.Logo, ShopName = item.ShopName, SkuName = item.SkuName, Id = item.SkuId } }, - MarkMessage = item.MarkMessage, - PackType = (PackType)item.PackType, - - PositionType = ((PositionType)item.PositionType).ToString(), - SkuCount = item.SkuCount, - SkuTitle = item.SkuGoodsTitle, - TaskId = item.TaskId, - TaskStatus = (TaskStateType)item.TaskStatus, - EndTime = item.CreateTime, - IsWorry = (Worry)item.IsWorry, - }; - if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) - { - data.BarCodeModel = item.BarCodeDTO; - } - if (item.cers != null) - { - data.CertificateModel = item.cers; - } - if (item.FeesItemResponse != null) - { - data.FeesItemResponse = item.FeesItemResponse; - data.FeesMoney = item.FeesItemResponse.SingleFees; - data.IsShowFees = data.FeesMoney > 0 ? true : false; - data.FeesItemResponse.DiscountSingleFees = item.FeesItemResponse.SingleFees * item.FeesItemResponse.disCount; - data.FeesItemResponse.DiscountAllFees = item.FeesItemResponse.AllFees * item.FeesItemResponse.disCount; + MarkMessage = item.MarkMessage, + PackType = (PackType)item.PackType, + + PositionType = item.PositionType, + SkuCount = item.SkuCount, + SkuTitle = item.SkuGoodsTitle, + TaskId = item.TaskId, + + EndTime = item.CreateTime, + BrandName = item.BrandName, + OrderId = item.OrderId, + TaskState = item.TaskState, + + // IsWorry = (Worry)item.IsWorry, + }; + if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) + { + data.BarCodeModel = item.BarCodeDTO; + } + if (item.Cers != null) + { + data.CertificateModel = item.Cers; + } + if (item.FeesItemResponse != null) + { + data.FeesItemResponse = item.FeesItemResponse; + data.FeesMoney = item.FeesItemResponse.SingleFees; + data.IsShowFees = data.FeesMoney > 0 ? true : false; + data.FeesItemResponse.DiscountSingleFees = item.FeesItemResponse.SingleFees * item.FeesItemResponse.disCount; + data.FeesItemResponse.DiscountAllFees = item.FeesItemResponse.AllFees * item.FeesItemResponse.disCount; + + } + else + { + data.IsShowFees = false; + } + if (item.PackUserName != null && item.PackUserName.Count() > 0) + { + data.PackUser = string.Join("\r\n", item.PackUserName); + } + + data.ReflashTask = ReflashTask; + + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + PackTaskList.Add(data); + })); } - else - { - data.IsShowFees = false; - } - if (item.PackUserName != null && item.PackUserName.Count() > 0) - { - data.PackUser = string.Join("\r\n", item.PackUserName); - } - data.ReflashTask = ReflashTask; - App.Current.Dispatcher.BeginInvoke(new Action(() => - { - PackTaskList.Add(data); - })); } + else + { + MessageBox.Show("查不到数据"); + } + IsLoadCount(); - + } + catch (Exception ex) + { + System.Windows.MessageBox.Show(ex.Message); } - else + IsLoading = false; + }); + + if (TaskState != null && waitSealBoxTaskStates.Contains(TaskState.Value))//封箱操作 + { + if (TaskState == Models.TaskState.待封箱) + Task.Factory.StartNew(() => { - MessageBox.Show("查不到数据"); + try + { + if (SealBoxConfigureType == SealBoxConfigureType.待配置) + { + SealBoxWaitConfigureList = new ObservableCollection(); + ApiResponse sealBoxWaitRes = sealBoxService.GetSealBoxWaitConfigureList(SearchSkuId, SearchTaskId, PageSize, PageIndex); + + if (sealBoxWaitRes == null) + { + System.Windows.MessageBox.Show("网络异常"); IsLoading = false; return; + } + + if (!sealBoxWaitRes.Success || sealBoxWaitRes.Data == null) + { + System.Windows.MessageBox.Show(sealBoxWaitRes.Msg); IsLoading = false; return; + } + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + OrderCount = sealBoxWaitRes.Data.TotalCount; + })); + + foreach (var item in sealBoxWaitRes.Data.SealBoxWaitConfigureModels) + { + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + SealBoxWaitConfigureList.Add(item); + })); + } + } - } - IsLoadCount(); + if (SealBoxConfigureType == SealBoxConfigureType.已配置) + { + SealBoxConfiguredList = new ObservableCollection(); + var sealBoxRes = sealBoxService.GetSealBoxConfiguredList(PositionState.待封箱, SearchSkuId, SearchTaskId, globalContext.User.Shop.ShopId.ToString(), PageSize, PageIndex); + if (sealBoxRes == null) + { + System.Windows.MessageBox.Show("网络异常"); IsLoading = false; return; + } + + if (!sealBoxRes.Success || sealBoxRes.Data == null) + { + System.Windows.MessageBox.Show(sealBoxRes.Msg); IsLoading = false; return; + } + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + OrderCount = sealBoxRes.Data.TotalCount; + })); + + foreach (var item in sealBoxRes.Data.SealBoxConfiguredModels) + { + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + SealBoxConfiguredList.Add(item); + })); + } + } + IsLoadSealBoxCount(); + IsLoadCount(); + } + catch (Exception ex) + { - } - catch (Exception ex) - { + System.Windows.MessageBox.Show(ex.Message); + } + IsLoading = false; + }); + if (TaskState == Models.TaskState.待落仓) + Task.Factory.StartNew(() => + { - } + try + { + if (SealBoxConfigureType == SealBoxConfigureType.待配置) + { + FallWareWaitConfigureList = new ObservableCollection(); + var fallWareRes = sealBoxService.SearchFallWareConfiguredList(PositionState.待落仓, taskId, SearchSkuId, PageIndex, PageSize); + + if (fallWareRes == null) + { + System.Windows.MessageBox.Show("网络异常"); IsLoading = false; return; + } + + if (!fallWareRes.Success || fallWareRes.Data == null) + { + System.Windows.MessageBox.Show(fallWareRes.Msg); IsLoading = false; return; + } + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + OrderCount = fallWareRes.Data.TotalCount; + })); + + foreach (var item in fallWareRes.Data.FallWareConfiguredModels) + { + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + FallWareWaitConfigureList.Add(item); + })); + } + } + if (SealBoxConfigureType == SealBoxConfigureType.已配置) + { + FallWareConfiguredList = new ObservableCollection(); + var fallWareRes = sealBoxService.SearchFallWareConfiguredList(PositionState.已配置待落仓, taskId, SearchSkuId, PageIndex, PageSize); + + if (fallWareRes == null) + { + System.Windows.MessageBox.Show("网络异常"); IsLoading = false; return; + } + + if (!fallWareRes.Success || fallWareRes.Data == null) + { + System.Windows.MessageBox.Show(fallWareRes.Msg); IsLoading = false; return; + } + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + OrderCount = fallWareRes.Data.TotalCount; + })); + + foreach (var item in fallWareRes.Data.FallWareConfiguredModels) + { + App.Current.Dispatcher.BeginInvoke(new Action(() => + { + FallWareConfiguredList.Add(item); + })); + } + } - IsLoading = false; - }); + IsLoadFallWareCount(); + IsLoadCount(); + + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + + } + IsLoading = false; + + }); + } @@ -396,42 +743,37 @@ namespace BBWY.Client.ViewModels.PackTask GlobalContext globalContext; ProductService productService; + private void IsLoadFallWareCount() + { + var res = sealBoxService.GetFallWareConfigureCounts(globalContext.User.Shop.ShopId.ToString()); + if (res != null && res.Success && res.Data != null) + { + SealBoxWaitConfigureCount = res.Data.FallWareWaitConfigureCount.ToString(); + SealBoxConfiguredCount = res.Data.FallWareConfiguredCount.ToString(); + } + } + private void IsLoadSealBoxCount() + { + var res = sealBoxService.GetSealBoxPackStateCount(); + if (res != null && res.Success && res.Data != null) + { + SealBoxWaitConfigureCount = res.Data.SealBoxWaitConfigureCount.ToString(); + SealBoxConfiguredCount = res.Data.SealBoxConfiguredCount.ToString(); + } - + } /// /// 展示发布任务页面 /// public void CreateTask() { - ViewModelLocator viewModel = new ViewModelLocator(); - var publicTaskViewModel = viewModel.PublishTask; - if (publicTaskViewModel.ReflashWindow == null) - publicTaskViewModel.ReflashWindow = ReflashTask; - publicTaskViewModel.InitData(); - PublishTaskWindow publish = new PublishTaskWindow(); + PublishTaskWindow publish = new PublishTaskWindow(ReflashTask); publish.Show(); - - //ViewModelLocator viewModel = new ViewModelLocator(); - - //var createViewModel = viewModel.CreateTaskView; - //if (createViewModel.ReflashWindow == null) - //{ - // createViewModel.ReflashWindow = ReflashTask; - //} - - - - - //CreatePackTask create = new CreatePackTask(); - //create.SendData(); - - //create.Show(); - } @@ -463,7 +805,9 @@ namespace BBWY.Client.ViewModels.PackTask { var paramList = (object[])param; // var orderId = paramList[0].ToString(); - var skuId = paramList[1].ToString(); + + + var skuId = paramList.Last().ToString(); var url = $"https://item.jd.com/{skuId}.html"; diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 722fc381..2159ac70 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -21,6 +21,9 @@ using NPOI.SS.Formula.Functions; using GalaSoft.MvvmLight.Messaging; using BBWY.Client.Models.APIModel; using BBWY.Client.Models.PackTask; +using BBWY.Client.Views.SealBox; +using BBWY.Client.Views.FallWare; +using BBWY.Client.Models.FallWare; namespace BBWY.Client.ViewModels.PackTask { @@ -47,6 +50,22 @@ namespace BBWY.Client.ViewModels.PackTask } } + public string fallWareWaitConfigureCount; + public string FallWareWaitConfigureCount { get => fallWareWaitConfigureCount; set { Set(ref fallWareWaitConfigureCount, value); } } + + public string fallWareConfiguredCount; + public string FallWareConfiguredCount { get => fallWareConfiguredCount; set { Set(ref fallWareConfiguredCount, value); } } + + + + private ObservableCollection waitFallWareList; + /// + /// 待落仓列表 + /// + public ObservableCollection WaitFallWareList { get => waitFallWareList; set { Set(ref waitFallWareList, value); } } + + + private ObservableCollection waitSealBoxModels; /// @@ -54,7 +73,11 @@ namespace BBWY.Client.ViewModels.PackTask /// public ObservableCollection WaitSealBoxModels { get => waitSealBoxModels; set { Set(ref waitSealBoxModels, value); } } - + private ObservableCollection packTaskList; + /// + /// 打包任务列表 + /// + public ObservableCollection PackTaskList { get => packTaskList; set { Set(ref packTaskList, value); } } /// /// 查询时间段 @@ -92,11 +115,11 @@ namespace BBWY.Client.ViewModels.PackTask private string searchSkuId; public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } } - public PackTaskState? taskState; + public TaskState? taskState; /// /// 任务状态 /// - public PackTaskState? TaskState + public TaskState? TaskState { get => taskState; private set { @@ -142,26 +165,36 @@ namespace BBWY.Client.ViewModels.PackTask private string waitPackCount; /// - /// 待打包数 + /// 待打包任务数 /// public string WaitPackCount { get => waitPackCount; set { Set(ref waitPackCount, value); } } - private string waitSealBox; + private string waitSealBoxCount; + /// + /// 带封箱任务数 + /// + public string WaitSealBoxCount { get => waitSealBoxCount; set { Set(ref waitSealBoxCount, value); } } + + + + private string waitFallWareCount; /// - /// 带封箱数 + /// 待落仓任务数 /// - public string WaitSealBox { get => waitSealBox; set { Set(ref waitSealBox, value); } } + public string WaitFallWareCount { get => waitFallWareCount; set { Set(ref waitFallWareCount, value); } } + private string waitOutbound; /// - /// 待出库数 + /// 待出库任务数 /// public string WaitOutbound { get => waitOutbound; set { Set(ref waitOutbound, value); } } - //private int totalCount; - ///// - ///// 全部数量 - ///// - //public int TotalCount { get => totalCount; set { Set(ref totalCount, value); } } + private string waitCompleted; + /// + /// 待完成任务数 + /// + public string WaitCompleted { get => waitCompleted; set { Set(ref waitCompleted, value); } } + public int PageIndex { get => pageIndex; set { Set(ref pageIndex, value); } } @@ -176,17 +209,6 @@ namespace BBWY.Client.ViewModels.PackTask private int? IsWorry { get; set; } public int? taskStatus { get; set; } - private ObservableCollection packTaskList; - /// - /// 动态数据表 - /// - public ObservableCollection PackTaskList { get => packTaskList; set { Set(ref packTaskList, value); } } - - //private ObservableCollection feesItems; - ///// - ///// 动态数据表 - ///// - //public ObservableCollection FeesItems { get => feesItems; set { Set(ref feesItems, value); } } public string searchDepartment; @@ -198,27 +220,28 @@ namespace BBWY.Client.ViewModels.PackTask } } - + private SealBoxConfigureType sealBoxConfigureType; + /// + /// 封箱配置状态 + /// + public SealBoxConfigureType SealBoxConfigureType { get => sealBoxConfigureType; set { Set(ref sealBoxConfigureType, value); } } #endregion - private readonly ProductService productService; - private readonly ConsumableService consumableService; - private readonly WorkProcessService workProcessService; + private readonly PackTaskService packTaskService; - private readonly IncreateServiceService increateServiceService; + private readonly SealBoxService sealBoxService; public GlobalContext globalContext; - public WareHouseListViewModel(PackTaskService packTaskService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService, ProductService productService, BatchPurchaseService batchPurchaseService, GlobalContext globalContext) + public WareHouseListViewModel(PackTaskService packTaskService, GlobalContext globalContext, SealBoxService sealBoxService) { this.globalContext = globalContext; - - + this.sealBoxService = sealBoxService; this.packTaskService = packTaskService; - this.consumableService = consumableService; + //Messenger.Default.Send(globalContext, "AcceptGlobalContext"); PackTaskList = new ObservableCollection();//初始化数据 - SetTaskStateCommand = new RelayCommand(SetTaskState); + SetTaskStateCommand = new RelayCommand(SetTaskState); SearchTaskCommand = new RelayCommand(() => { @@ -231,21 +254,7 @@ namespace BBWY.Client.ViewModels.PackTask }); OpenSkuDetailCommand = new RelayCommand(OpenSkuDetail); - CopyTextCommand = new RelayCommand(s => - { - try - { - if (s != null) - Clipboard.SetText(s.ToString()); - } - catch (Exception ex) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.WriteLine(ex); - Console.ResetColor(); - } - }); StartTime = DateTime.Now.Date; EndTime = DateTime.Now.Date; IsLoading = false; @@ -253,19 +262,144 @@ namespace BBWY.Client.ViewModels.PackTask //加载数据 SetTaskState(null); - this.workProcessService = workProcessService; - this.increateServiceService = increateServiceService; - this.productService = productService; - this.batchPurchaseService = batchPurchaseService; UpdateTaskStateCommand = new RelayCommand(UpdateTaskState); CompeteSealBoxCommand = new RelayCommand(CompeteSealBox); + + SetSealBoxCommand = new RelayCommand(SetSealBox); + CompeteFallWareCommand = new RelayCommand(CompeteFallWare); + SealBoxConfigureType = SealBoxConfigureType.已配置; + PositionState = PositionState.已配置待落仓; + SetSealBoxConfigureTypeCommand = new RelayCommand(s => + { + PageIndex = 1; + SealBoxConfigureType = s; + PositionState = s == SealBoxConfigureType.已配置 ? PositionState.已配置待落仓 : PositionState.待落仓; + Task.Factory.StartNew(() => SearchTaskList()); + }); + + + + LookBoxConfigureCommand = new RelayCommand(LookBoxConfigure); + + PrintBoxConfigureCommand = new RelayCommand(PrintBoxConfigure); + } + + + /// + /// todo: 打印数据 + /// + /// + private void PrintBoxConfigure(object obj) + { + var fallware = obj as WaitFallWareModel; + + JDWareBoxModel model = new JDWareBoxModel + { + ShopName = globalContext.User.Shop.ShopName, + WareName = fallware.WareName, + SealBoxId = fallware.SealBoxId, + ProductCount = fallware.ProductCount, + BoxCount = fallware.SealBoxCount, + PrewOrder = fallware.BoxConfigureData.PrewOrder, + ProductTitle = fallware.BoxConfigureData.ProductTitle, + PurchaseOrder = fallware.BoxConfigureData.PurchaseOrder, + WaybillNo = fallware.BoxConfigureData.WaybillNo + }; + if (fallware.WareType == WareType.京仓) + { + //加载模板数据 + } + if (fallware.WareType == WareType.云仓) + { + + } + //打印 + } + + private void LookBoxConfigure(object obj) + { + var fallware = obj as WaitFallWareModel; + JDWareBoxModel model = new JDWareBoxModel + { + ShopName = globalContext.User.Shop.ShopName, + WareName = fallware.WareName, + SealBoxId = fallware.SealBoxId, + ProductCount = fallware.ProductCount, + BoxCount = fallware.SealBoxCount, + PrewOrder = fallware.BoxConfigureData.PrewOrder, + ProductTitle = fallware.BoxConfigureData.ProductTitle, + PurchaseOrder = fallware.BoxConfigureData.PurchaseOrder, + WaybillNo = fallware.BoxConfigureData.WaybillNo + }; + if (fallware.WareType == WareType.京仓) + { + SetJDWareBoxWindow window = new SetJDWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask,false); + window.Show(); + } + if (fallware.WareType == WareType.云仓) + { + SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask, false); + window.Show(); + } + } + + public PositionState PositionState { get; set; } + + /// + /// 完成落仓(todo:) + /// + /// + private void CompeteFallWare(object obj) + { + + if (System.Windows.MessageBox.Show("是否完成落仓?", "提示", + MessageBoxButton.YesNo, + MessageBoxImage.Warning) != MessageBoxResult.Yes) + return; + + var model = obj as WaitFallWareModel; + var res = sealBoxService.WareCompeteFallWare(model.SealBoxId); + if (res != null&&res.Success) + { + ReflashTask();return; + } + if (res==null) + { + System.Windows.MessageBox.Show("网络异常"); + return; + } + System.Windows.MessageBox.Show(res.Msg); + } + + private void SetSealBox(object obj) + { + + var model = (SealBoxModel)obj; + if (model.SealBoxSkus.Any(s => s.TaskState == Models.TaskState.待质检 || s.TaskState == Models.TaskState.待打包)) + { + System.Windows.MessageBox.Show("无法封箱,存在未封箱的任务"); + return; + } + + SetSealBoxWindow setSealBoxWindow = new SetSealBoxWindow(model); + setSealBoxWindow.SendBoxCount = boxCount => + { + model.SealBoxCount = boxCount; + }; + setSealBoxWindow.ShowDialog(); } #region 事件绑定 + public ICommand LookBoxConfigureCommand { get; set; } + /// + /// 待配置 /已配置 + /// + public ICommand SetSealBoxConfigureTypeCommand { get; set; } + public ICommand CompeteFallWareCommand { get; set; } public ICommand CompeteSealBoxCommand { get; set; } public ICommand SetTaskStatusCommand { get; set; } @@ -274,10 +408,7 @@ namespace BBWY.Client.ViewModels.PackTask /// public ICommand OpenSkuDetailCommand { get; set; } - /// - /// 复制 - /// - public ICommand CopyTextCommand { get; set; } + /// /// 筛选数据 /// @@ -302,57 +433,74 @@ namespace BBWY.Client.ViewModels.PackTask /// public ICommand TaskPageIndexChangedCommand { get; set; } + /// + /// 设置分箱数量 + /// + public ICommand SetSealBoxCommand { get; set; } + - BatchPurchaseService batchPurchaseService; + /// + /// 打印封箱数据 + /// + public ICommand PrintBoxConfigureCommand { get; set; } - private void CompeteSealBox(object obj) + + + /// + /// 完成封箱 + /// + /// + private void CompeteSealBox(object obj) { - var objList = obj as SealBoxModel; + var model = (SealBoxModel)obj; - List CompeteSealBoxs = new List(); - string wareId = objList.WareId; - foreach (var item in objList.SealBoxSkus) + if (model.SealBoxCount == null || model.SealBoxCount.Value <= 0) { + System.Windows.MessageBox.Show("请先设置封箱数量"); + return; + } + var res = sealBoxService.WareCompeteSealBox(model.SealBoxId, model.SealBoxCount); + if (res == null) + { + System.Windows.MessageBox.Show("网络异常", ""); + return; + } - CompeteSealBoxs.Add(new APIServices.CompeteSealBox - { - WareId = wareId, - TaskId = item.TaskId, - }); - } - var res = packTaskService.CompeteSealBox(CompeteSealBoxs); - if (res != null && res.Success) + if (!res.Success || !res.Data) { - SearchTaskList(); + System.Windows.MessageBox.Show(res.Msg); + return; } - + SearchTaskList(); } private void UpdateTaskState(object obj) { - var objList = (object[])obj; - long taskId = (long)objList[0]; - var packTaskState = (PackTaskState)objList[1]; + var model = (PackTaskModel)obj; + long taskId = model.TaskId; + var packTaskState = model.TaskState; ApiResponse res = null; + + switch (packTaskState) { - case PackTaskState.未到货: - case PackTaskState.部分到货: + case Models.TaskState.未到货: + case Models.TaskState.部分到货: - if (System.Windows.MessageBox.Show("是否确认收货?","提示", + if (System.Windows.MessageBox.Show("是否确认收货?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Warning) != MessageBoxResult.Yes) return; - res = packTaskService.SetPackTaskState(taskId, PackTaskState.待质检); + res = packTaskService.SetPackTaskState(taskId, Models.TaskState.待质检); break; - case PackTaskState.待质检: + case Models.TaskState.待质检: break; - case PackTaskState.待打包: + case Models.TaskState.待打包: var packModel = PackTaskList.SingleOrDefault(p => p.TaskId == taskId); if (packModel == null || packModel.FeesItemResponse == null || packModel.FeesItemResponse.DiscountAllFees == 0) @@ -364,15 +512,17 @@ namespace BBWY.Client.ViewModels.PackTask MessageBoxButton.YesNo, MessageBoxImage.Warning) != MessageBoxResult.Yes) return; - res = packTaskService.SetPackTaskState(taskId, PackTaskState.待封箱); + res = packTaskService.SetPackTaskState(taskId, Models.TaskState.待封箱); break; - case PackTaskState.待封箱: + case Models.TaskState.待封箱: break; - case PackTaskState.待出库: + case Models.TaskState.待出库: + + break; - case PackTaskState.已完成: + case Models.TaskState.已完成: break; - case PackTaskState.已取消: + case Models.TaskState.已取消: break; default: break; @@ -397,44 +547,14 @@ namespace BBWY.Client.ViewModels.PackTask SearchTaskList(); } - public void SetTaskState(PackTaskState? taskState) + public void SetTaskState(TaskState? taskState) { + PageIndex = 1; TaskState = taskState; SearchTaskList(); } - //public void SetTaskState(TaskState? taskState) - //{ - // IsWorry = null; - // TaskState = null; - // taskStatus = null; - // switch (taskState) - // { - // case null: - // break; - // case Models.TaskState.已到货: - // case Models.TaskState.部分到货: //未完成的数据 - // case Models.TaskState.未到货: - // TaskState = taskState; - // taskStatus = 0; - // break; - // case Models.TaskState.全部: //所有数据 - - // break; - // case Models.TaskState.已完成: - - // taskStatus = 1; - // break; - // case Models.TaskState.加急: - // taskStatus = 0; - // IsWorry = 1; - // break; - // default: - // break; - // } - // SearchTaskList(); - - //} + /// @@ -453,38 +573,87 @@ namespace BBWY.Client.ViewModels.PackTask taskId = null; } + IsLoading = true; + if (TaskState == Models.TaskState.待落仓) + Task.Factory.StartNew(() => + { + + WaitFallWareList = new ObservableCollection(); + var datas = sealBoxService.SearchWareFallWareConfigureList(PositionState, 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.WaitFallWareList) + { + App.Current.Dispatcher.Invoke(new Action(() => + { + WaitFallWareList.Add(new WaitFallWareModel + { + AcceptUserNames = string.Join("|", item.AcceptUserNames), + DepartmentName = item.DepartmentName, + SealBoxSkus = item.SealBoxSkus, + ShopId = item.ShopId, + ShopName = item.ShopName, + WareId = item.WareId, + WareName = item.WareName, + SealBoxCount = item.SealBoxCount, + SealBoxId = item.SealBoxId, + BoxConfigureData = item.BoxConfigureData, + ProductCount = item.ProductCount, + WareType = item.WareType, + }); + })); + } + } + else + { + //App.Current.Dispatcher.BeginInvoke(new Action(() => + //{ + // new TipsWindow("查不到数据").Show(); + //})); + } + IsLoadCount(); + IsLoadFallWareCount(); + IsLoading = false; - - IsLoading = true; - - if (TaskState == PackTaskState.待封箱) + }); + else if (TaskState == Models.TaskState.待封箱) Task.Factory.StartNew(() => { + var randNum = new Random().Next(81, 90); WaitSealBoxModels = new ObservableCollection(); - var datas = packTaskService.SearchWaitSealBoxList(SearchShopName, taskId, SearchSkuId, PageIndex, PageSize); + + 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) { + App.Current.Dispatcher.BeginInvoke(new Action(() => { WaitSealBoxModels.Add(new SealBoxModel { - AcceptUserName = string.Join("|", item.AcceptUserNames.Select(a => a.UserName)), + AcceptUserName = string.Join("|", item.AcceptUserNames), DepartmentName = item.DepartmentName, - SealBoxSkus = item.SealBoxSkus, + 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, }); })); @@ -517,7 +686,7 @@ namespace BBWY.Client.ViewModels.PackTask var data = new PackTaskModel() { AcceptName = item.UserName, - Availability = (TaskState)item.Availability, + Availability = (Availability)item.Availability, BasicPack = (BasicPack)item.BasicPack, DepartmentName = item.DepartmentName, CertificatePosition = (CertificatePosition)item.CertificatePosition, @@ -542,8 +711,8 @@ namespace BBWY.Client.ViewModels.PackTask OrderId = item.OrderId, SkuId = item.SkuId, SkuName = item.SkuName, - FloorDragNumber=item.FloorDragNumber, - + FloorDragNumber = item.FloorDragNumber, + }; if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) @@ -589,27 +758,26 @@ namespace BBWY.Client.ViewModels.PackTask } else { - //App.Current.Dispatcher.BeginInvoke(new Action(() => - //{ - // new TipsWindow("查不到数据").Show(); - //})); } IsLoadCount(); IsLoading = false; }); - - - - - } - + private void IsLoadFallWareCount() + { + var res = sealBoxService.GetFallWareConfigureCounts(null); + if (res != null && res.Success && res.Data != null) + { + FallWareWaitConfigureCount = res.Data.FallWareWaitConfigureCount.ToString(); + FallWareConfiguredCount = res.Data.FallWareConfiguredCount.ToString(); + } + } private void IsLoadCount() { - var packTaskResult = packTaskService.GetWareAllCount(); - if (packTaskResult != null && packTaskResult.Success) + var packTaskResult = packTaskService.GetTaskAllCount(); + if (packTaskResult != null && packTaskResult.Success && packTaskResult.Data != null) { - App.Current.Dispatcher.Invoke(() => + App.Current.Dispatcher.Invoke(new Action(() => { ArrivedCount = packTaskResult.Data.ArrivedCount.ToString(); NoArrivedCount = packTaskResult.Data.NoArrivedCount.ToString(); @@ -617,8 +785,10 @@ namespace BBWY.Client.ViewModels.PackTask WorryCount = packTaskResult.Data.WorryCount.ToString(); WaitOutbound = packTaskResult.Data.WaitOutbound?.ToString(); WaitPackCount = packTaskResult.Data.WaitPackCount?.ToString(); - WaitSealBox = packTaskResult.Data.WaitSealBox?.ToString(); - }); + WaitSealBoxCount = packTaskResult.Data.WaitSealBox?.ToString(); + WaitFallWareCount = packTaskResult.Data.WaitFallWareCount?.ToString(); + WaitCompleted = packTaskResult.Data.WaitCompleted?.ToString(); + })); } } private void LoadIndex(int pageIndex) @@ -635,7 +805,7 @@ namespace BBWY.Client.ViewModels.PackTask private void OpenSkuDetail(object param) { var paramList = (object[])param; - var skuId = paramList[1].ToString(); + var skuId = paramList.Last().ToString(); var url = $"https://item.jd.com/{skuId}.html"; try { diff --git a/BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs b/BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs index f96467a2..cf13eb1f 100644 --- a/BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs +++ b/BBWY.Client/ViewModels/QiKu/PackSkuSplitConfigViewModel.cs @@ -74,7 +74,7 @@ namespace BBWY.Client.ViewModels MessageBox.Show(response.Msg, "获取仓库"); return; } - storeList = response.Data; + storeList = response.Data.Where(s=>s.Status== StockStatus.使用).ToArray(); } var w = new PackSkuSplitCountAndStoreWindow(packSkuSplitConfig.PackCount, packSkuSplitConfig.Store, storeList, packSkuSplitConfig.IsJST); if (w.ShowDialog() == true) diff --git a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs index b3b4019b..c300761e 100644 --- a/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs +++ b/BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs @@ -24,7 +24,7 @@ using WebSocketSharp; namespace BBWY.Client.ViewModels { - public class QualityViewModel : BaseVM, IDenpendency + public class QualityViewModel : BaseVM { #region 属性 @@ -197,11 +197,11 @@ namespace BBWY.Client.ViewModels /// public Worry IsWorry { get => isWorry; set { Set(ref isWorry, value); } } - private TaskState availability; + private Availability availability; /// /// 到货情况(待收货=0,部分收货=1,已到货=2) /// - public TaskState Availability { get => availability; set { Set(ref availability, value); } } + public Availability Availability { get => availability; set { Set(ref availability, value); } } private PackType packType; /// diff --git a/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs b/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs new file mode 100644 index 00000000..7a37c917 --- /dev/null +++ b/BBWY.Client/ViewModels/SealBox/SealBoxConfigureViewModel.cs @@ -0,0 +1,304 @@ +using AutoMapper.Internal; +using BBWY.Client.APIServices; +using BBWY.Client.Models; +using BBWY.Client.Models.APIModel; +using BBWY.Client.Models.QiKu; +using BBWY.Client.Models.SealBox; +using BBWY.Client.Views.BatchPurchase; +using BBWY.Controls; +using GalaSoft.MvvmLight.Command; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Windows; +using System.Windows.Input; + +namespace BBWY.Client.ViewModels.SealBox +{ + public class SealBoxConfigureViewModel : BaseVM + { + private IList storeList;//仓库列表 + private LogisticsService logisticsService; + private SealBoxService sealBoxService; + private GlobalContext globalContext; + private ObservableCollection sealBoxConfigureModelList; + + + /// + /// 分箱配置列表 + /// + public ObservableCollection SealBoxConfigureModelList { get => sealBoxConfigureModelList; set { Set(ref sealBoxConfigureModelList, value); } } + public SealBoxConfigureViewModel(LogisticsService logisticsService, SealBoxService sealBoxService, GlobalContext globalContext) + { + this.logisticsService = logisticsService; + this.sealBoxService = sealBoxService; + SetSplitCountCommand = new RelayCommand(SetSplitCount); + SetPackCountAndStoreCommand = new RelayCommand(SetPackCountAndStore); + SaveCommand = new RelayCommand(Save); + SealBoxConfigureModelList = new ObservableCollection(); + this.globalContext = globalContext; + } + + private long sealBoxId; + public long SealBoxId { get => sealBoxId; set { Set(ref sealBoxId, value); } } + + public ICommand SetSplitCountCommand { get; set; } + + public ICommand SetPackCountAndStoreCommand { get; set; } + + public ICommand SaveCommand { get; set; } + + private void SetSplitCount(SealBoxConfigureModel sealBoxConfigureModel) + { + sealBoxConfigureModel.WareHourseDatas.Where(w => w.WareState == null || w.WareState == PositionState.待封箱).ToList().ForEach( + s => sealBoxConfigureModel.WareHourseDatas.Remove(s) + + ); + var otherCount = sealBoxConfigureModel.WareHourseDatas.Count(); + if (sealBoxConfigureModel.SplitCount <= 0 || sealBoxConfigureModel.SplitCount < otherCount) + { + MessageBox.Show("份数不正确"); + return; + } + + int resetIndex = 1; + foreach (var item in sealBoxConfigureModel.WareHourseDatas) + { + item.Index = resetIndex; + resetIndex++; + } + + + + + for (var i = 1 + otherCount; i <= sealBoxConfigureModel.SplitCount; i++) + { + sealBoxConfigureModel.WareHourseDatas.Add(new SealBoxConfigureWareHourseModel() + { + Index = i, + Count = 0 + }); + } + + + + } + + + + private StoreResponse store; + private void SetPackCountAndStore(object obj) + { + + var sealBoxConfigureWareHourseModel = obj as SealBoxConfigureWareHourseModel; + if (storeList == null) + { + var response = logisticsService.GetStoreList(); + if (!response.Success) + { + MessageBox.Show(response.Msg, "获取仓库"); + return; + } + storeList = response.Data.Where(s => s.Status == StockStatus.使用).ToArray(); + } + if (store == null) + { + if (sealBoxConfigureWareHourseModel != null) + store = new StoreResponse + { + Id = sealBoxConfigureWareHourseModel.WareId, + Name = sealBoxConfigureWareHourseModel.WareName, + Type = ToStockType(sealBoxConfigureWareHourseModel.WareType), + Status = StockStatus.使用 + }; + } + + + + var w = new PackSkuSplitCountAndStoreWindow(sealBoxConfigureWareHourseModel.Count, store, storeList, sealBoxConfigureWareHourseModel.WareType == WareType.聚水潭齐越仓); + if (w.ShowDialog() == true) + { + store = w.Store; + sealBoxConfigureWareHourseModel.Count = w.Quantity; + IsJST = w.IsJST; + sealBoxConfigureWareHourseModel.WareType = w.IsJST ? WareType.聚水潭齐越仓 : ToWareType(w.Store.Type); + sealBoxConfigureWareHourseModel.WareId = w.IsJST ? "qiyuejushuitan" : w.Store.Id; + sealBoxConfigureWareHourseModel.WareName = w.IsJST ? "齐越聚水潭" : w.Store.Name; + + + + + } + } + + /// + /// 是否聚水潭 + /// + public bool IsJST { get; set; } + + private WareType ToWareType(StockType stockType) + { + switch (stockType) + { + case StockType.商家仓: + return WareType.商家仓; + break; + case StockType.京仓: + return WareType.京仓; + break; + case StockType.云仓: + return WareType.云仓; + break; + default: + break; + } + return WareType.聚水潭齐越仓; + } + + private StockType ToStockType(WareType? wareType) + { + switch (wareType) + { + case WareType.京仓: + return StockType.京仓; + break; + case WareType.云仓: + return StockType.云仓; + break; + case WareType.商家仓: + return StockType.商家仓; + break; + case WareType.聚水潭齐越仓: + break; + default: + break; + } + + return StockType.京仓; + } + + private void Save(object obj) + { + + if (SealBoxId <= 0)//设置分箱 + { + SetSealBoxConfiguredRequest setSealBoxConfiguredRequest = new SetSealBoxConfiguredRequest(); + setSealBoxConfiguredRequest.ShopId = globalContext.User.Shop.ShopId.ToString(); + IList SetSealBoxConfiguredDatas = new List(); + foreach (var sealBoxConfigureModel in SealBoxConfigureModelList) + { + ////todo: 到分箱界面判断 + //if (sealBoxConfigureModel.WareHourseDatas.Select(s => s.WareId).Distinct().Count() != sealBoxConfigureModel.WareHourseDatas.Count()) + //{ + // MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} ,分箱出现重复仓库,请重新设置!"); + // return; + //} + //判断任务数量与分箱数量总和是否相等 + if (sealBoxConfigureModel.SkuCount != sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()) + { + MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId}中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}"); + return; + } + SetSealBoxConfiguredDatas.Add(new SetSealBoxConfiguredData + { + SkuId = sealBoxConfigureModel.SkuId, + TaskId = sealBoxConfigureModel.TaskId, + TotalCount = sealBoxConfigureModel.SkuCount, + WareHourseDatas = sealBoxConfigureModel.WareHourseDatas.Select(x => new WareHourseData + { + Count = x.Count, + WareId = x.WareId, + WareName = x.WareName, + WareType = x.WareType.Value, + }).ToList(), + }); + } + setSealBoxConfiguredRequest.SetSealBoxConfiguredDatas = SetSealBoxConfiguredDatas; + var setSealBoxRes = sealBoxService.SetSealBoxConfigured(setSealBoxConfiguredRequest); + if (setSealBoxRes == null) + { + MessageBox.Show("网络异常"); + return; + } + if (!setSealBoxRes.Success || setSealBoxRes.Data == null || !setSealBoxRes.Data) + { + MessageBox.Show(setSealBoxRes.Msg); + return; + } + if (ReflashWindow != null) ReflashWindow(); + + var window = obj as BWindow; + window.Close(); + } + + + if (SealBoxId > 0)//修改分箱 + { + BatchUpdateSealBoxConfiguredRequest res = new BatchUpdateSealBoxConfiguredRequest() + { + + SealBoxId = SealBoxId, + ShopId = globalContext.User.Shop.ShopId.ToString() + }; + + IList UpdateSealBoxConfiguredDatas = new List(); + foreach (var sealBoxConfigureModel in SealBoxConfigureModelList) + { + + ////todo: 到分箱界面判断 + //if (sealBoxConfigureModel.WareHourseDatas.Select(s => s.WareId).Distinct().Count() != sealBoxConfigureModel.WareHourseDatas.Count()) + //{ + // MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} ,分箱出现重复仓库,请重新设置!"); + // return; + //} + //判断任务数量与分箱数量总和是否相等 + if (sealBoxConfigureModel.SkuCount != sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()) + { + MessageBox.Show($"任务id:{sealBoxConfigureModel.TaskId} 中,采购数量:{sealBoxConfigureModel.SkuCount} 不等于 分箱总数量:{sealBoxConfigureModel.WareHourseDatas.Select(s => s.Count).Sum()}"); + return; + } + UpdateSealBoxConfiguredDatas.Add(new UpdateSealBoxConfiguredDataRequest + { + + TaskId = sealBoxConfigureModel.TaskId, + SkuCount = sealBoxConfigureModel.SkuCount, + SealBoxConfiguredWareHourseRequests = sealBoxConfigureModel.WareHourseDatas.Select(x => new SealBoxConfiguredWareHourseRequest + { + Count = x.Count, + WareId = x.WareId, + WareName = x.WareName, + WareType = x.WareType.Value, + WareState = x.WareState, + + }).ToList(), + }); + } + res.UpdateSealBoxConfiguredDatas = UpdateSealBoxConfiguredDatas; + + + var setSealBoxRes = sealBoxService.BatchUpdateSealBoxConfigured(res); + if (setSealBoxRes == null) + { + MessageBox.Show("网络异常"); + return; + } + if (!setSealBoxRes.Success || setSealBoxRes.Data == null || !setSealBoxRes.Data) + { + MessageBox.Show(setSealBoxRes.Msg); + return; + } + if (ReflashWindow != null) ReflashWindow(); + var window = obj as BWindow; + window.Close(); + } + + } + + + + public Action ReflashWindow { get; set; } + + } +} diff --git a/BBWY.Client/ViewModels/ViewModelLocator.cs b/BBWY.Client/ViewModels/ViewModelLocator.cs index a5ebf30e..9d503d99 100644 --- a/BBWY.Client/ViewModels/ViewModelLocator.cs +++ b/BBWY.Client/ViewModels/ViewModelLocator.cs @@ -1,4 +1,6 @@ -using BBWY.Client.ViewModels.PackTask; +using BBWY.Client.Models; +using BBWY.Client.ViewModels.PackTask; +using BBWY.Client.ViewModels.SealBox; using BBWY.Client.ViewModels.TotalPackTask; using GalaSoft.MvvmLight.Ioc; using Microsoft.Extensions.DependencyInjection; @@ -326,10 +328,26 @@ namespace BBWY.Client.ViewModels } - void test() + public SealBoxConfigureViewModel SealBoxConfigureVModel { - - var packuser = (App.Current as App).ServiceProvider.GetRequiredService(); + get + { + using var s = sp.CreateScope(); + return s.ServiceProvider.GetRequiredService(); + } } + + //public ShopSealBoxListViewModel ShopSealBoxListVM + //{ + // get + // { + + // using (var s = sp.CreateScope()) + // { + // return s.ServiceProvider.GetRequiredService(); + // } + // } + //} + } } diff --git a/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs b/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs index 596f9765..2beb37e3 100644 --- a/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs +++ b/BBWY.Client/Views/BatchPurchase/PackSkuSplitCountAndStoreWindow.xaml.cs @@ -95,7 +95,18 @@ namespace BBWY.Client.Views.BatchPurchase { this.txtQuantity.Text = Quantity.ToString(); - this.cbx_stroeList.SelectedItem = this.Store; + + if (isJST) + { + //this.cbx_stroeList.Text = Store.Name; + + } + else + { + this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(s => s.Id == Store.Id); + } + + //this.cbx_stroeList.ItemsSource = storeList; //if (Store != null) // this.cbx_stroeList.SelectedItem = storeList.FirstOrDefault(s => s.Id == Store.Id); diff --git a/BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml b/BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml new file mode 100644 index 00000000..255e8c8b --- /dev/null +++ b/BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml.cs b/BBWY.Client/Views/FallWare/FallWareConfiguredControl.xaml.cs new file mode 100644 index 00000000..300c6547 --- /dev/null +++ b/BBWY.Client/Views/FallWare/FallWareConfiguredControl.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.FallWare +{ + /// + /// FallWareConfiguredControl.xaml 的交互逻辑 + /// + public partial class FallWareConfiguredControl : UserControl + { + public FallWareConfiguredControl() + { + InitializeComponent(); + } + } +} diff --git a/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml b/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml new file mode 100644 index 00000000..91578a32 --- /dev/null +++ b/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml @@ -0,0 +1,238 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml.cs b/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.xaml.cs new file mode 100644 index 00000000..7575ac19 --- /dev/null +++ b/BBWY.Client/Views/FallWare/FallWareWaitConfigureControl.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.FallWare +{ + /// + /// FallWareWaitConfigureControl.xaml 的交互逻辑 + /// + public partial class FallWareWaitConfigureControl : UserControl + { + public FallWareWaitConfigureControl() + { + InitializeComponent(); + } + } +} diff --git a/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml new file mode 100644 index 00000000..0fe85193 --- /dev/null +++ b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs new file mode 100644 index 00000000..e357fde1 --- /dev/null +++ b/BBWY.Client/Views/FallWare/SetCloudWareBoxWindow.xaml.cs @@ -0,0 +1,72 @@ +using BBWY.Client.APIServices; +using BBWY.Client.Models.FallWare; +using BBWY.Client.Models; +using BBWY.Controls; +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.Shapes; +using WebSocketSharp; + +namespace BBWY.Client.Views.FallWare +{ + /// + /// SetCloudWareBoxWindow.xaml 的交互逻辑 + /// + public partial class SetCloudWareBoxWindow : BWindow + { + public SetCloudWareBoxWindow(JDWareBoxModel model, SealBoxService sealBoxService, WareType wareType, Action reflashWindow, bool isEnabled = true) + { + if (SealBoxService == null) this.SealBoxService = sealBoxService; + WareType = wareType; + ReflashWindow = reflashWindow; + + JDWareBoxModel = model; + InitializeComponent(); + this.DataContext = JDWareBoxModel; + if (!isEnabled) + { + this.jd_box.IsEnabled = isEnabled; + this.btn_save.Visibility = Visibility.Collapsed; + } + } + public JDWareBoxModel JDWareBoxModel { get; set; } + + private SealBoxService SealBoxService { get; set; } + + private Action ReflashWindow { get; set; } + + private WareType WareType { get; set; } + private void BButton_Click(object sender, RoutedEventArgs e) + { + + if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty()) + { + MessageBox.Show("采购单号不能为空"); + return; + } + if (JDWareBoxModel.PrewOrder.IsNullOrEmpty() && WareType == WareType.京仓) + { + MessageBox.Show("预约单号不能为空"); + return; + } + var res = SealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle, JDWareBoxModel.PurchaseOrder, JDWareBoxModel.PrewOrder, JDWareBoxModel.WaybillNo); + + if (res != null && res.Success) + { + if (ReflashWindow != null) ReflashWindow(); + this.Close(); + + return; + } + if (res != null) MessageBox.Show(res.Msg); + } + } +} diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml new file mode 100644 index 00000000..960e1124 --- /dev/null +++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs new file mode 100644 index 00000000..6803449e --- /dev/null +++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs @@ -0,0 +1,75 @@ +using BBWY.Client.APIServices; +using BBWY.Client.Models; +using BBWY.Client.Models.FallWare; +using BBWY.Controls; +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.Shapes; +using WebSocketSharp; + +namespace BBWY.Client.Views.FallWare +{ + /// + /// SetJDWareBoxWindow.xaml 的交互逻辑 + /// + public partial class SetJDWareBoxWindow : BWindow + { + public SetJDWareBoxWindow(JDWareBoxModel model, SealBoxService sealBoxService,WareType wareType, Action reflashWindow,bool isEnabled = true) + { + if (SealBoxService == null) this.SealBoxService = sealBoxService; + WareType = wareType; + ReflashWindow = reflashWindow; + + JDWareBoxModel = model; + InitializeComponent(); + this.DataContext = JDWareBoxModel; + if (!isEnabled) + { + this.jd_box.IsEnabled = isEnabled; + this.btn_save.Visibility = Visibility.Collapsed; + } + + + + } + public JDWareBoxModel JDWareBoxModel { get; set; } + + private SealBoxService SealBoxService { get; set; } + + private Action ReflashWindow { get; set; } + + private WareType WareType { get; set; } + private void BButton_Click(object sender, RoutedEventArgs e) + { + + if (JDWareBoxModel.PurchaseOrder.IsNullOrEmpty()) + { + MessageBox.Show("采购单号不能为空"); + return; + } + if (JDWareBoxModel.PrewOrder.IsNullOrEmpty()&& WareType== WareType.京仓) + { + MessageBox.Show("预约单号不能为空"); + return; + } + var res = SealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle,JDWareBoxModel.PurchaseOrder,JDWareBoxModel.PrewOrder,JDWareBoxModel.WaybillNo); + + if (res!=null&&res.Success) + { + if (ReflashWindow != null) ReflashWindow(); + this.Close(); + + return; + } + if (res != null) MessageBox.Show(res.Msg); + } + } +} diff --git a/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml new file mode 100644 index 00000000..0603d262 --- /dev/null +++ b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml @@ -0,0 +1,307 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml.cs b/BBWY.Client/Views/FallWare/WaitFallWareControl.xaml.cs new file mode 100644 index 00000000..ff4a7f1f --- /dev/null +++ b/BBWY.Client/Views/FallWare/WaitFallWareControl.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.PackTask +{ + /// + /// WaitFallWareControl.xaml 的交互逻辑 + /// + public partial class WaitFallWareControl : UserControl + { + public WaitFallWareControl() + { + InitializeComponent(); + } + } +} diff --git a/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml b/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml new file mode 100644 index 00000000..204f1415 --- /dev/null +++ b/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml.cs b/BBWY.Client/Views/FallWare/WareFallWareListControl.xaml.cs new file mode 100644 index 00000000..365095e9 --- /dev/null +++ b/BBWY.Client/Views/FallWare/WareFallWareListControl.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.FallWare +{ + /// + /// WareFallWareListControl.xaml 的交互逻辑 + /// + public partial class WareFallWareListControl : UserControl + { + public WareFallWareListControl() + { + InitializeComponent(); + } + } +} diff --git a/BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs b/BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs index cfd865a1..2844739a 100644 --- a/BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs +++ b/BBWY.Client/Views/Order/EditAfterSaleOrderRefundPurchaseAmount.xaml.cs @@ -1,4 +1,4 @@ -using BBWY.Client.Models; +using BBWY.Client.Models.Statistics.AfterSaleOrder; using BBWY.Controls; using System.Windows; diff --git a/BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs b/BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs index 2ee8b953..15675dcc 100644 --- a/BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs +++ b/BBWY.Client/Views/Order/EditAfterSaleOrderSku.xaml.cs @@ -1,4 +1,4 @@ -using BBWY.Client.Models; +using BBWY.Client.Models.Statistics.AfterSaleOrder; using BBWY.Controls; namespace BBWY.Client.Views.Order diff --git a/BBWY.Client/Views/PackTask/PersonList.xaml b/BBWY.Client/Views/PackTask/PersonList.xaml deleted file mode 100644 index 0b6eb677..00000000 --- a/BBWY.Client/Views/PackTask/PersonList.xaml +++ /dev/null @@ -1,95 +0,0 @@ - - - 0 - 1 - 2 - 6 - 14 - 29 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -