From 9e7e60ecf5c90a0a9be2cdc39a182917032cebdb Mon Sep 17 00:00:00 2001 From: "506583276@qq.com" <506583276@qq.com> Date: Thu, 29 Jun 2023 09:36:01 +0800 Subject: [PATCH] 10137 --- BBWY.Client/BBWY.Client.csproj | 1 - BBWY.Client/GlobalContext.cs | 2 +- BBWY.Client/Helpers/MyPrintHelper.cs | 135 +++++++++--------- .../PackTask/WareHouseListViewModel.cs | 5 + BBWY.Client/Views/MainWindow.xaml.cs | 7 + .../Views/PackTask/TaskListControl.xaml | 2 +- .../Views/PackTask/WaitPackageControl.xaml | 3 +- .../Views/PackTask/WareHouseListControl.xaml | 3 +- .../Views/QualityTask/WaitQualityControl.xaml | 3 +- .../Views/SealBox/SetSealBoxWindow.xaml.cs | 1 - 10 files changed, 84 insertions(+), 78 deletions(-) diff --git a/BBWY.Client/BBWY.Client.csproj b/BBWY.Client/BBWY.Client.csproj index 6403e641..2643c69f 100644 --- a/BBWY.Client/BBWY.Client.csproj +++ b/BBWY.Client/BBWY.Client.csproj @@ -35,7 +35,6 @@ - diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs index 70d77d50..870daa9f 100644 --- a/BBWY.Client/GlobalContext.cs +++ b/BBWY.Client/GlobalContext.cs @@ -13,7 +13,7 @@ namespace BBWY.Client { ShopServiceGroupList = new List(); ShopServiceGroupLowerList = new List(); - ClientVersion = "10136"; + ClientVersion = "10137"; } private User user; diff --git a/BBWY.Client/Helpers/MyPrintHelper.cs b/BBWY.Client/Helpers/MyPrintHelper.cs index 87b145b8..d9fbd559 100644 --- a/BBWY.Client/Helpers/MyPrintHelper.cs +++ b/BBWY.Client/Helpers/MyPrintHelper.cs @@ -4,7 +4,6 @@ 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; @@ -625,92 +624,92 @@ namespace BBWY.Client.Helpers - /// - /// 打印封箱 - /// - /// - /// - /// - /// - public static void PrintSealBoxData(SealBoxModel sealBoxModel, string printName, int boxCount, int printCount) - { - // 100*180 + ///// + ///// 打印封箱 + ///// + ///// + ///// + ///// + ///// + //public static void PrintSealBoxData(SealBoxModel sealBoxModel, string printName, int boxCount, int printCount) + //{ + // // 100*180 - UnitConverHelper unitConverHelper = new UnitConverHelper(); + // 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 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 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 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行 + // 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); + // 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); + // 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}"); + // 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(); + // } + // 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); + // workbook.LoadFromFile(newExccel); - Worksheet wsheet = workbook.Worksheets[0]; + // Worksheet wsheet = workbook.Worksheets[0]; - wsheet.PageSetup.PaperSize = PaperSizeType.PaperA4; - wsheet.PageSetup.Orientation = PageOrientationType.Portrait; - wsheet.PageSetup.PrintArea = "A1:D31"; + // 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;//打印份数 + // var print = workbook.PrintDocument; + // print.PrinterSettings.PrinterName = printName; + // print.PrinterSettings.Copies = (short)printCount;//打印份数 - print.Print(); - } + // print.Print(); + //} /// /// 打印京东箱唛 diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 39b80534..56b8a77c 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -422,6 +422,11 @@ namespace BBWY.Client.ViewModels.PackTask SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask, false); window.Show(); } + + if (fallware.WareType == WareType.聚水潭齐越仓) + { + + } } public PositionState PositionState { get; set; } diff --git a/BBWY.Client/Views/MainWindow.xaml.cs b/BBWY.Client/Views/MainWindow.xaml.cs index 4034f9df..976e9a6c 100644 --- a/BBWY.Client/Views/MainWindow.xaml.cs +++ b/BBWY.Client/Views/MainWindow.xaml.cs @@ -16,6 +16,13 @@ namespace BBWY.Client.Views this.Width = SystemParameters.WorkArea.Size.Width * 0.8; this.Height = SystemParameters.WorkArea.Size.Height * 0.7; this.Loaded += MainWindow_Loaded; + + this.Closed += MainWindow_Closed; + } + + private void MainWindow_Closed(object sender, EventArgs e) + { + Environment.Exit(0); } private void MainWindow_Loaded(object sender, RoutedEventArgs e) diff --git a/BBWY.Client/Views/PackTask/TaskListControl.xaml b/BBWY.Client/Views/PackTask/TaskListControl.xaml index 58ec5b1a..e53546c1 100644 --- a/BBWY.Client/Views/PackTask/TaskListControl.xaml +++ b/BBWY.Client/Views/PackTask/TaskListControl.xaml @@ -174,7 +174,7 @@ - + diff --git a/BBWY.Client/Views/PackTask/WaitPackageControl.xaml b/BBWY.Client/Views/PackTask/WaitPackageControl.xaml index 4a3a835c..3e1f824f 100644 --- a/BBWY.Client/Views/PackTask/WaitPackageControl.xaml +++ b/BBWY.Client/Views/PackTask/WaitPackageControl.xaml @@ -193,8 +193,7 @@ - - + diff --git a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml index b4843534..de5ed308 100644 --- a/BBWY.Client/Views/PackTask/WareHouseListControl.xaml +++ b/BBWY.Client/Views/PackTask/WareHouseListControl.xaml @@ -187,8 +187,7 @@ - - + diff --git a/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml b/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml index d0d09319..62c0a5af 100644 --- a/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml +++ b/BBWY.Client/Views/QualityTask/WaitQualityControl.xaml @@ -186,8 +186,7 @@ - - + diff --git a/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs b/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs index a8bacb40..f3a04100 100644 --- a/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs +++ b/BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs @@ -5,7 +5,6 @@ using BBWY.Controls; using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; -using Spire.Xls; using System; using System.Collections.Generic; using System.Diagnostics;