更改FTP文件导入

This commit is contained in:
2026-01-28 15:04:16 +08:00
parent f65fa21760
commit b940170607
44 changed files with 2748 additions and 271 deletions

View File

@@ -11,8 +11,8 @@ using System.Windows;
namespace FATrace.WPLApp.ViewModels
{
/// <summary>
/// 工厂-领料 数据查询 VM
/// 仅展示从 Excel 导入的 FactoryMaterialWithdrawal 数据,支持简单条件与分页。
/// 工厂-原料出库 数据查询 VM
/// 仅展示从 Excel 导入的 FactoryRawOutbound 数据,支持简单条件与分页。
/// </summary>
public class FactoryMaterialWithdrawalViewModel : NavigationViewModel
{
@@ -24,7 +24,7 @@ namespace FATrace.WPLApp.ViewModels
_fsql = fsql;
_log = log;
Items = new ObservableCollection<FactoryMaterialWithdrawal>();
Items = new ObservableCollection<FactoryRawOutbound>();
SearchCommand = new DelegateCommand(async () => await SearchAsync(), () => !IsBusy)
.ObservesProperty(() => IsBusy);
@@ -79,7 +79,7 @@ namespace FATrace.WPLApp.ViewModels
#endregion
#region
public ObservableCollection<FactoryMaterialWithdrawal> Items { get; }
public ObservableCollection<FactoryRawOutbound> Items { get; }
private bool _isBusy;
public bool IsBusy { get => _isBusy; set { _isBusy = value; RaisePropertyChanged(); } }
@@ -133,11 +133,11 @@ namespace FATrace.WPLApp.ViewModels
try
{
IsBusy = true;
_log.Info("FactoryMaterialWithdrawal 查询开始");
_log.Info("FactoryRawOutbound 查询开始");
var data = await Task.Run(() =>
{
var q = _fsql.Select<FactoryMaterialWithdrawal>();
var q = _fsql.Select<FactoryRawOutbound>();
if (!string.IsNullOrWhiteSpace(Origin))
q = q.Where(a => a.Origin != null && a.Origin.Contains(Origin));
@@ -187,11 +187,11 @@ namespace FATrace.WPLApp.ViewModels
PageIndex = data.normalizedPage == 0 ? 1 : data.normalizedPage;
});
_log.Info($"FactoryMaterialWithdrawal 查询完成,记录数: {TotalCount}");
_log.Info($"FactoryRawOutbound 查询完成,记录数: {TotalCount}");
}
catch (Exception ex)
{
_log.Error($"FactoryMaterialWithdrawal 查询失败: {ex}");
_log.Error($"FactoryRawOutbound 查询失败: {ex}");
MessageBox.Show($"查询失败: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
}
finally