Merge branch '4.80' of https://git.aycode.com/Adam/Mango.Nop.Plugins into 4.80
This commit is contained in:
commit
6425b5bde8
|
|
@ -406,6 +406,11 @@ public class FruitBankDbContext : MgDbContextBase,
|
||||||
|
|
||||||
foreach (var orderItemDto in orderDto.OrderItemDtos)
|
foreach (var orderItemDto in orderDto.OrderItemDtos)
|
||||||
{
|
{
|
||||||
|
if (orderItemDto.TrayQuantity != orderItemDto.Quantity) return null;
|
||||||
|
|
||||||
|
//orderItemDto.ProductDto!.StockQuantity -= orderItemDto.TrayQuantity;
|
||||||
|
//await ProductDtos.UpdateAsync(orderItemDto.ProductDto);
|
||||||
|
|
||||||
if (!orderItemDto.IsMeasurable) continue;
|
if (!orderItemDto.IsMeasurable) continue;
|
||||||
|
|
||||||
var gaNetWeight = CommonHelper.To<double>(orderItemDto.GenericAttributes.FirstOrDefault(x => x.Key == nameof(IMeasuringNetWeight.NetWeight))?.Value ?? "0");
|
var gaNetWeight = CommonHelper.To<double>(orderItemDto.GenericAttributes.FirstOrDefault(x => x.Key == nameof(IMeasuringNetWeight.NetWeight))?.Value ?? "0");
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ using Nop.Services.Logging;
|
||||||
|
|
||||||
namespace Nop.Plugin.Misc.FruitBankPlugin.Domains.DataLayer;
|
namespace Nop.Plugin.Misc.FruitBankPlugin.Domains.DataLayer;
|
||||||
|
|
||||||
public class MeasuringItemPalletBaseDbTable<TEntity>(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings, ILogger logger) : MgDbTableBase<TEntity>(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings, logger) where TEntity
|
public class MeasuringItemPalletBaseDbTable<TEntity>(IEventPublisher eventPublisher, INopDataProvider dataProvider, IShortTermCacheManager shortTermCacheManager, IStaticCacheManager staticCacheManager, AppSettings appSettings, ILogger logger) : MgDbTableBase<TEntity>(eventPublisher, dataProvider, shortTermCacheManager, staticCacheManager, appSettings, logger) where TEntity
|
||||||
: MgEntityBase, IMeasuringItemPalletBase
|
: MgEntityBase, IMeasuringItemPalletBase
|
||||||
{
|
{
|
||||||
protected override void OnUpdate(TEntity entity)
|
protected override void OnUpdate(TEntity entity)
|
||||||
|
|
@ -26,6 +26,10 @@ public class MeasuringItemPalletBaseDbTable<TEntity>(IEventPublisher eventPublis
|
||||||
|
|
||||||
protected virtual void BeforeInsertOrUpdate(TEntity measuringItemPalletBase)
|
protected virtual void BeforeInsertOrUpdate(TEntity measuringItemPalletBase)
|
||||||
{
|
{
|
||||||
|
measuringItemPalletBase.GrossWeight = double.Round(measuringItemPalletBase.GrossWeight, 1);
|
||||||
|
measuringItemPalletBase.TareWeight = double.Round(measuringItemPalletBase.TareWeight, 1);
|
||||||
|
measuringItemPalletBase.PalletWeight = double.Round(measuringItemPalletBase.PalletWeight, 0);
|
||||||
|
|
||||||
if (measuringItemPalletBase.IsValidSafeMeasuringValues()) return;
|
if (measuringItemPalletBase.IsValidSafeMeasuringValues()) return;
|
||||||
|
|
||||||
throw new Exception($"MeasuringItemPalletBaseDbTable->BeforeInsertOrUpdate(); Invalid measuring value(s); {measuringItemPalletBase}");
|
throw new Exception($"MeasuringItemPalletBaseDbTable->BeforeInsertOrUpdate(); Invalid measuring value(s); {measuringItemPalletBase}");
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public class OrderDtoDbTable : MgDtoDbTableBase<OrderDto, Order>
|
||||||
public Task<OrderDto> GetByIdAsync(int orderId, bool loadRelations) => GetAll(loadRelations).Where(x => x.Id == orderId).FirstOrDefaultAsync(null);
|
public Task<OrderDto> GetByIdAsync(int orderId, bool loadRelations) => GetAll(loadRelations).Where(x => x.Id == orderId).FirstOrDefaultAsync(null);
|
||||||
|
|
||||||
public IQueryable<OrderDto> GetAllByOrderStatus(OrderStatus orderStatus, bool loadRelations = true)
|
public IQueryable<OrderDto> GetAllByOrderStatus(OrderStatus orderStatus, bool loadRelations = true)
|
||||||
=> GetAll(loadRelations);//.Where(o => o.OrderStatusId == (int)orderStatus);
|
=> GetAll(loadRelations).Where(o => o.OrderStatusId == (int)orderStatus);
|
||||||
|
|
||||||
public IQueryable<OrderDto> GetAllByIds(IEnumerable<int> orderIds, bool loadRelations = true) => GetAll(loadRelations).Where(o => orderIds.Contains(o.Id));
|
public IQueryable<OrderDto> GetAllByIds(IEnumerable<int> orderIds, bool loadRelations = true) => GetAll(loadRelations).Where(o => orderIds.Contains(o.Id));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue