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

@ -694,6 +694,18 @@ namespace WCS.BLL.HardWare
WarningManager.SendWarning(warningModel);
}
var currentOutStoreMatSns = CurrentOutStoreMatSNs.ToList();
Task.Run(() =>
{
var matDetails = DbHelp.db.Queryable<InventoryDetail>()
.Where(t => currentOutStoreMatSns.Contains(t.MatSN))
.Where(t => t.IsLocked)
.ToList();
matDetails.ForEach(t => t.IsLocked = false);
DbHelp.db.Updateable(matDetails).ExecuteCommand();
});
CurrentOutStoreMatSNs.Clear();
WarningLight.CloseLight(TcpCleint);
SetCurrentMode(Mode.);

View File

@ -15,7 +15,7 @@ namespace WCS.DAL.Db
/// </summary>
public static SqlSugarScope db = new SqlSugarScope(new ConnectionConfig()
{
ConnectionString = $"Data Source={DbPath.DataDbPath};",
ConnectionString = $"Data Source={DbPath.DataDbPath};Version=3;journal_mode=WAL;",
DbType = DbType.Sqlite,//[Sqlite]安装[System.Data.SQLite];
IsAutoCloseConnection = true
}, db =>

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()

View File

@ -34,7 +34,7 @@
<Border Background="AliceBlue" Padding="0">
<Grid >
<StackPanel Margin="3" Orientation="Horizontal">
<StackPanel Margin="3" Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<StackPanel Margin="3" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock VerticalAlignment="Center"
Text="货架类型:" FontSize="22" >
</TextBlock>

View File

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:hc="https://handyorg.github.io/handycontrol"
Height="500" Width="850" WindowStyle="None" Background="{x:Null}" BorderThickness="0" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
Height="500" Width="850" WindowStyle="None" Loaded="Window_Loaded" Background="{x:Null}" BorderThickness="0" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
<hc:Window.Resources>
<ResourceDictionary>
<Style TargetType="Button" BasedOn="{StaticResource ButtonDefault}">
@ -34,6 +34,19 @@
<Border Background="AliceBlue" Padding="0">
<Grid >
<StackPanel Margin="3" Orientation="Horizontal">
<StackPanel Margin="3" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock VerticalAlignment="Center"
Text="货架类型:" FontSize="22" >
</TextBlock>
<ComboBox
IsEnabled="{Binding ShelfTypeIsEnabled}"
VerticalAlignment="Center"
DisplayMemberPath="ShelfTypeName"
ItemsSource="{Binding ShelfTypeItems}"
SelectedItem="{Binding SelectedShelfTypeItem}"
FontSize="22"
IsEditable="False"/>
</StackPanel>
<Button MinHeight="40" FontSize="18" Margin="3"
Content="&#xe613;导入" FontFamily="{StaticResource IconFont}"
Foreground="WhiteSmoke"

View File

@ -59,5 +59,10 @@ namespace 智能仓储WCS管理系统
this.DialogResult = false;
this.Close();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
viewModel.InitShelfTypeItems();
}
}
}

View File

@ -104,6 +104,9 @@
<None Update="Excel\出库单据导入模板.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Excel\出库导入模板.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Excel\物料管理导入模板.xlsx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>