Add stock-taking enhancements and validation updates
Enhanced stock-taking functionality by introducing the `CloseStockTaking` method in `StockTakingDbContext` to manage session closures with validation. Added the `IsReadyForClose` method to `IMgStockTaking` and its implementation in `MgStockTaking`. Integrated `FruitBankDbContext` for stock updates. Improved logging in `StockSignalREndpointServer` and added a new SignalR endpoint for closing stock-taking sessions. Updated `AddStockTaking` to initialize properties for new entries. Simplified loading logic in `OrderItemDtoDbTable` by commenting out unnecessary `.ThenLoad` chains. Enhanced validation in `RefreshStockTakingItemMeasuredValuesFromPallets` and adjusted return statements in `AddOrUpdateMeasuredStockTakingItemPallet` and `UpdateStockTakingItemPallet` to fetch updated entities. These changes improve maintainability, robustness, and functionality across the codebase.
This commit is contained in:
parent
120ed09738
commit
3c479e1ad5
|
|
@ -1,4 +1,5 @@
|
|||
using Nop.Core;
|
||||
using AyCode.Core.Interfaces;
|
||||
using Nop.Core;
|
||||
|
||||
namespace Mango.Nop.Core.Dtos;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ public interface IMgStockTaking : IEntityInt, ITimeStampInfo
|
|||
{
|
||||
public DateTime StartDateTime { get; set; }
|
||||
public bool IsClosed { get; set; }
|
||||
|
||||
public bool IsReadyForClose();
|
||||
}
|
||||
|
||||
public abstract class MgStockTaking<TStockTakingItem> : MgEntityBase, IMgStockTaking where TStockTakingItem : class, IMgStockTakingItem
|
||||
|
|
@ -16,6 +18,8 @@ public abstract class MgStockTaking<TStockTakingItem> : MgEntityBase, IMgStockTa
|
|||
public DateTime StartDateTime { get; set; }
|
||||
public bool IsClosed { get; set; }
|
||||
|
||||
public abstract bool IsReadyForClose();
|
||||
|
||||
[Association(ThisKey = nameof(Id), OtherKey = nameof(IMgStockTakingItem.StockTakingId), CanBeNull = true)]
|
||||
public List<TStockTakingItem>? StockTakingItems { get; set; }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue