Browse Source

10137

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
9e7e60ecf5
  1. 1
      BBWY.Client/BBWY.Client.csproj
  2. 2
      BBWY.Client/GlobalContext.cs
  3. 135
      BBWY.Client/Helpers/MyPrintHelper.cs
  4. 5
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  5. 7
      BBWY.Client/Views/MainWindow.xaml.cs
  6. 2
      BBWY.Client/Views/PackTask/TaskListControl.xaml
  7. 3
      BBWY.Client/Views/PackTask/WaitPackageControl.xaml
  8. 3
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml
  9. 3
      BBWY.Client/Views/QualityTask/WaitQualityControl.xaml
  10. 1
      BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs

1
BBWY.Client/BBWY.Client.csproj

@ -35,7 +35,6 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="BarcodeLib" Version="2.4.0" /> <PackageReference Include="BarcodeLib" Version="2.4.0" />
<PackageReference Include="FreeSpire.XLS" Version="12.7.0" />
<PackageReference Include="HandyControl" Version="3.3.0" /> <PackageReference Include="HandyControl" Version="3.3.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.28" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="3.1.28" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />

2
BBWY.Client/GlobalContext.cs

@ -13,7 +13,7 @@ namespace BBWY.Client
{ {
ShopServiceGroupList = new List<string>(); ShopServiceGroupList = new List<string>();
ShopServiceGroupLowerList = new List<string>(); ShopServiceGroupLowerList = new List<string>();
ClientVersion = "10136"; ClientVersion = "10137";
} }
private User user; private User user;

135
BBWY.Client/Helpers/MyPrintHelper.cs

@ -4,7 +4,6 @@ using BBWY.Client.Models;
using BBWY.Client.Models.FallWare; using BBWY.Client.Models.FallWare;
using BBWY.Client.Models.PackTask; using BBWY.Client.Models.PackTask;
using NPOI.XSSF.UserModel; using NPOI.XSSF.UserModel;
using Spire.Xls;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
@ -625,92 +624,92 @@ namespace BBWY.Client.Helpers
/// <summary> ///// <summary>
/// 打印封箱 ///// 打印封箱
/// </summary> ///// </summary>
/// <param name="sealBoxModel"></param> ///// <param name="sealBoxModel"></param>
/// <param name="printName"></param> ///// <param name="printName"></param>
/// <param name="boxCount"></param> ///// <param name="boxCount"></param>
/// <param name="printCount"></param> ///// <param name="printCount"></param>
public static void PrintSealBoxData(SealBoxModel sealBoxModel, string printName, int boxCount, int printCount) //public static void PrintSealBoxData(SealBoxModel sealBoxModel, string printName, int boxCount, int printCount)
{ //{
// 100*180 // // 100*180
UnitConverHelper unitConverHelper = new UnitConverHelper(); // UnitConverHelper unitConverHelper = new UnitConverHelper();
var data = unitConverHelper.MmToPx(100, 180); // var data = unitConverHelper.MmToPx(100, 180);
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); // var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string printNamePath = $"{applicationPath}/printSealName.init"; // string printNamePath = $"{applicationPath}/printSealName.init";
if (File.Exists(printNamePath)) // if (File.Exists(printNamePath))
{ // {
File.Delete(printNamePath); // File.Delete(printNamePath);
} // }
File.WriteAllText(printNamePath, printName); // 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"; // var newExccel = $"{applicationPath}/Resources/ExccelModel/newsealbox.xlsx";
if (File.Exists(newExccel)) // if (File.Exists(newExccel))
{ // {
File.Delete(newExccel); // File.Delete(newExccel);
} // }
FileStream fs = new FileStream(excel, FileMode.Open, FileAccess.Read); // FileStream fs = new FileStream(excel, FileMode.Open, FileAccess.Read);
XSSFWorkbook wb = new XSSFWorkbook(fs); // XSSFWorkbook wb = new XSSFWorkbook(fs);
var sheet = wb.GetSheetAt(0); // 得到第一个sheet // var sheet = wb.GetSheetAt(0); // 得到第一个sheet
var nameCell = sheet.GetRow(0).GetCell(0); // name列,第2行 // var nameCell = sheet.GetRow(0).GetCell(0); // name列,第2行
var ageCell = sheet.GetRow(3).GetCell(0); // age列,第2行 // var ageCell = sheet.GetRow(3).GetCell(0); // age列,第2行
XSSFWorkbook wb2 = new XSSFWorkbook(); // XSSFWorkbook wb2 = new XSSFWorkbook();
sheet.CopyTo(wb2, "Sheet1", true, false); // sheet.CopyTo(wb2, "Sheet1", true, false);
var sheet2 = wb2.GetSheet("Sheet1"); // var sheet2 = wb2.GetSheet("Sheet1");
var nameCell2 = sheet2.GetRow(0).GetCell(1); // var nameCell2 = sheet2.GetRow(0).GetCell(1);
nameCell2.SetCellValue(sealBoxModel.ShopName); // nameCell2.SetCellValue(sealBoxModel.ShopName);
sheet2.GetRow(3).GetCell(1).SetCellValue(sealBoxModel.WareName); // sheet2.GetRow(3).GetCell(1).SetCellValue(sealBoxModel.WareName);
StringBuilder sb = new StringBuilder(); // StringBuilder sb = new StringBuilder();
int totalCount = 0; // int totalCount = 0;
for (int i = 0; i < sealBoxModel.SealBoxSkus.Count; i++) // for (int i = 0; i < sealBoxModel.SealBoxSkus.Count; i++)
{ // {
var title = sealBoxModel.SealBoxSkus[i].SkuTitle; // var title = sealBoxModel.SealBoxSkus[i].SkuTitle;
//if (title.Length>5) // //if (title.Length>5)
//{ // //{
// title = title.Substring(0,5); // // title = title.Substring(0,5);
//} // //}
totalCount += sealBoxModel.SealBoxSkus[i].WareHourseSkuCount; // totalCount += sealBoxModel.SealBoxSkus[i].WareHourseSkuCount;
sheet2.GetRow(i + 6).GetCell(1).SetCellValue($"名称:{title}"); // 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(2).SetCellValue($"SKU:{sealBoxModel.SealBoxSkus[i].SkuId}");
sheet2.GetRow(i + 6).GetCell(3).SetCellValue($"数量:{sealBoxModel.SealBoxSkus[i].WareHourseSkuCount}"); // sheet2.GetRow(i + 6).GetCell(3).SetCellValue($"数量:{sealBoxModel.SealBoxSkus[i].WareHourseSkuCount}");
} // }
sheet2.GetRow(25).GetCell(1).SetCellValue(totalCount); // sheet2.GetRow(25).GetCell(1).SetCellValue(totalCount);
sheet2.GetRow(28).GetCell(1).SetCellValue(boxCount); // sheet2.GetRow(28).GetCell(1).SetCellValue(boxCount);
FileStream fs1 = new FileStream(newExccel, FileMode.OpenOrCreate, FileAccess.ReadWrite); // FileStream fs1 = new FileStream(newExccel, FileMode.OpenOrCreate, FileAccess.ReadWrite);
wb2.Write(fs1); // wb2.Write(fs1);
fs1.Close(); // fs1.Close();
fs1.Dispose(); // fs1.Dispose();
Workbook workbook = new Workbook(); // 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.PaperSize = PaperSizeType.PaperA4;
wsheet.PageSetup.Orientation = PageOrientationType.Portrait; // wsheet.PageSetup.Orientation = PageOrientationType.Portrait;
wsheet.PageSetup.PrintArea = "A1:D31"; // wsheet.PageSetup.PrintArea = "A1:D31";
var print = workbook.PrintDocument; // var print = workbook.PrintDocument;
print.PrinterSettings.PrinterName = printName; // print.PrinterSettings.PrinterName = printName;
print.PrinterSettings.Copies = (short)printCount;//打印份数 // print.PrinterSettings.Copies = (short)printCount;//打印份数
print.Print(); // print.Print();
} //}
/// <summary> /// <summary>
/// 打印京东箱唛 /// 打印京东箱唛

5
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); SetCloudWareBoxWindow window = new SetCloudWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask, false);
window.Show(); window.Show();
} }
if (fallware.WareType == WareType.)
{
}
} }
public PositionState PositionState { get; set; } public PositionState PositionState { get; set; }

7
BBWY.Client/Views/MainWindow.xaml.cs

@ -16,6 +16,13 @@ namespace BBWY.Client.Views
this.Width = SystemParameters.WorkArea.Size.Width * 0.8; this.Width = SystemParameters.WorkArea.Size.Width * 0.8;
this.Height = SystemParameters.WorkArea.Size.Height * 0.7; this.Height = SystemParameters.WorkArea.Size.Height * 0.7;
this.Loaded += MainWindow_Loaded; 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) private void MainWindow_Loaded(object sender, RoutedEventArgs e)

2
BBWY.Client/Views/PackTask/TaskListControl.xaml

@ -174,7 +174,7 @@
<b:InvokeCommandAction.CommandParameter> <b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}"> <MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="DataContext.Id" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1}"/> <Binding Path="DataContext.Id" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1}"/>
<Binding Path="Id"/> <Binding Path="SkuId"/>
</MultiBinding> </MultiBinding>
</b:InvokeCommandAction.CommandParameter> </b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction> </b:InvokeCommandAction>

3
BBWY.Client/Views/PackTask/WaitPackageControl.xaml

@ -193,8 +193,7 @@
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"> <b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter> <b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}"> <MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="DataContext.Id" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1}"/> <Binding Path="SkuId"/>
<Binding Path="Id"/>
</MultiBinding> </MultiBinding>
</b:InvokeCommandAction.CommandParameter> </b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction> </b:InvokeCommandAction>

3
BBWY.Client/Views/PackTask/WareHouseListControl.xaml

@ -187,8 +187,7 @@
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"> <b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter> <b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}"> <MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="DataContext.Id" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1}"/> <Binding Path="SkuId"/>
<Binding Path="Id"/>
</MultiBinding> </MultiBinding>
</b:InvokeCommandAction.CommandParameter> </b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction> </b:InvokeCommandAction>

3
BBWY.Client/Views/QualityTask/WaitQualityControl.xaml

@ -186,8 +186,7 @@
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"> <b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
<b:InvokeCommandAction.CommandParameter> <b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}"> <MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="DataContext.Id" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1}"/> <Binding Path="SkuId"/>
<Binding Path="Id"/>
</MultiBinding> </MultiBinding>
</b:InvokeCommandAction.CommandParameter> </b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction> </b:InvokeCommandAction>

1
BBWY.Client/Views/SealBox/SetSealBoxWindow.xaml.cs

@ -5,7 +5,6 @@ using BBWY.Controls;
using NPOI.HSSF.UserModel; using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel; using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel; using NPOI.XSSF.UserModel;
using Spire.Xls;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;

Loading…
Cancel
Save