1.智能货架退出出库后解锁

2.数据库支持多线程
3.调整出库单据导入模板
This commit is contained in:
hehaibing-1996
2025-03-14 08:34:03 +08:00
parent f8fe33c32b
commit 549a45dcf0
8 changed files with 84 additions and 4 deletions

View File

@ -6,10 +6,12 @@ using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using WCS.BLL.DbModels;
using WCS.Model;
using WCS.Model.ApiModel.Home;
using WCS.Model.ApiModel.MatBaseInfo;
using WCS.Model.ApiModel.MatInventoryDetail;
using WCS管理系统.Api;
@ -19,6 +21,46 @@ namespace 智能仓储WCS管理系统.ViewModels
public class OutInventoryImportDucumentViewModel : BindableBase
{
#region Property
private List<ShelfTypeModel> shelfTypeItems;
public List<ShelfTypeModel> ShelfTypeItems
{
get { return shelfTypeItems; }
set
{
SetProperty(ref shelfTypeItems, value);
}
}
public void InitShelfTypeItems()
{
//调用接口更新!
Task.Run(() =>
{
var body = new RequestBase()
{
UserName = LocalStatic.CurrentUser,
DeviceType = LocalFile.Config.DeviceType,
};
var Result = ApiHelp.GetDataFromHttp<PageQueryResponse<ShelfTypeModel>>(LocalFile.Config.ApiIpHost + "home/getShelfTypes", body, "POST");
if (Result != null && Result.Data != null && Result.Data.Lists.Count() > 0)
{
ShelfTypeItems = Result.Data.Lists;
SelectedShelfTypeItem = Result.Data.Lists.First();
}
});
}
private ShelfTypeModel selectedShelfTypeItem;
public ShelfTypeModel SelectedShelfTypeItem
{
get { return selectedShelfTypeItem; }
set
{
SetProperty(ref selectedShelfTypeItem, value);
}
}
private ObservableCollection<MatInventorySummaryModel> dataGridItemSource;
public ObservableCollection<MatInventorySummaryModel> DataGridItemSource
{
@ -49,9 +91,10 @@ namespace 智能仓储WCS管理系统.ViewModels
#region
Microsoft.Win32.SaveFileDialog sfd = new Microsoft.Win32.SaveFileDialog();
sfd.Filter = ".xlsx文件(*.xlsx)|*.xlsx";
sfd.FileName = "出库导入模板";
sfd.FileName = "出库单据导入模板";
sfd.Title = "请选择文件保存地址";
sfd.OverwritePrompt = true;
if (sfd.ShowDialog() != true)
{
return;
@ -65,6 +108,8 @@ namespace 智能仓储WCS管理系统.ViewModels
try
{
File.Copy(sourceFile, destinationFile, true); // true表示如果目标文件存在则覆盖它
// 设置文件的最后写入时间为当前时间
File.SetLastWriteTime(destinationFile, DateTime.Now);
Growl.Success("文件下载成功!");
}
catch (IOException ioEx)
@ -174,6 +219,8 @@ namespace 智能仓储WCS管理系统.ViewModels
{
var body = new SysOutOrderByMatCodeRequest()
{
ShelfTypeId = SelectedShelfTypeItem.Id,
ShelfTypeName = SelectedShelfTypeItem.ShelfTypeName,
OrderType = "出库",
OrderSource = "WCS前端",
ItemList = DataGridItemSource.Select(t => new MatCodeItemList()