Enhance file, shipping, stock, and Android deployment

- Added new file metadata fields and improved shipping entities
- Refined weight validation logic in OrderItemDto
- Extended SignalR for stock taking refresh/close operations
- Improved SignalR error handling and UI feedback
- Enhanced grid UI: links, audit info, date formatting, loading panels
- Disabled AOT for WebAssembly/Android; updated Android signing config
- Updated app versioning and SQL schema comparison
- NavMenu: "Leltározás" now admin-only
This commit is contained in:
Loretta 2026-03-06 14:57:01 +01:00
commit 1b68599acc
35 changed files with 663 additions and 463 deletions

View File

@ -11,7 +11,9 @@
<PackageReference Include="MessagePack" Version="3.1.4" />
<PackageReference Include="MessagePack.Annotations" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.11" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client.Core" Version="9.0.11" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Common" Version="9.0.11" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.Json" Version="9.0.11" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="9.0.11" />
<!--<PackageReference Include="Microsoft.AspNetCore.SignalR.Core" Version="1.2.0" />-->
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.11" />
@ -39,7 +41,7 @@
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.Server.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AspNetCore.SignalR.Core">
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.11\ref\net9.0\Microsoft.AspNetCore.SignalR.Core.dll</HintPath>
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.13\ref\net9.0\Microsoft.AspNetCore.SignalR.Core.dll</HintPath>
</Reference>
<Reference Include="Mango.Nop.Core">
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath>

View File

@ -104,8 +104,7 @@ public class OrderItemDto : MgOrderItemDto<ProductDto>, IOrderItemDto
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
[ToonDescription(BusinessRule = "get => !IsMeasurable || (ProductDto!.AverageWeight > 0 && ((AverageWeightDifference / ProductDto!.AverageWeight) * 100) < ProductDto!.AverageWeightTreshold)")]
public bool AverageWeightIsValid => !IsMeasurable ||
(ProductDto!.AverageWeight > 0 && ((AverageWeightDifference / ProductDto!.AverageWeight) * 100) < ProductDto!.AverageWeightTreshold);
public bool AverageWeightIsValid => !IsMeasurable || (ProductDto!.AverageWeight > 0 && Math.Abs((AverageWeightDifference / ProductDto!.AverageWeight) * 100) < ProductDto!.AverageWeightTreshold);
[NotColumn, NotMapped, JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
[ToonDescription(Purpose = "Status flag", BusinessRule = "get => OrderItemPallets.Count > 0 && OrderItemPallets.All(oip => oip.IsAudited)")]

View File

@ -11,9 +11,11 @@ namespace FruitBank.Common.Entities;
public class Files : MgEntityBase, IFiles
{
public string FileName { get; set; }
public string FileSubPath { get; set; }
public string FileExtension { get; set; }
public string RawText { get; set; }
public string FileHash { get; set; }
public bool IsCompressed { get; set; }
[SkipValuesOnUpdate]
public DateTime Created { get; set; }

View File

@ -1,4 +1,5 @@
using AyCode.Core.Serializers.Toons;
using AyCode.Interfaces.EntityComment;
using AyCode.Core.Serializers.Toons;
using FruitBank.Common.Interfaces;
using LinqToDB.Mapping;
using Mango.Nop.Core.Entities;
@ -8,11 +9,13 @@ namespace FruitBank.Common.Entities;
[ToonDescription("Shipping record with documents and measurement tracking", Purpose = "Represents a physical inbound delivery event (truck arrival) at the warehouse, tracking the vehicle and the overall measurement status of the shipment")]
[Table(Name = FruitBankConstClient.ShippingDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDbTableName)]
public class Shipping : MgEntityBase, IShipping
public class Shipping : MgEntityBase, IShipping, IEntityComment
{
public DateTime ShippingDate { get; set; }
public DateTime ShippingDate { get; set; } = DateTime.Now;
public string LicencePlate { get; set; }
public bool IsAllMeasured { get; set; }
public string? Comment { get; set; } = string.Empty;
public string? CargoCompany { get; set; }
public DateTime? MeasuredDate { get; set; }

View File

@ -16,7 +16,7 @@ public class ShippingDocument : MgEntityBase, IShippingDocument
public string DocumentIdNumber { get; set; }
public string PdfFileName { get; set; }
public DateTime ShippingDate { get; set; }
public DateTime ShippingDate { get; set; } = DateTime.Now;
public string Country { get; set; }
public int TotalPallets { get; set; }

View File

@ -6,6 +6,9 @@ namespace FruitBank.Common.Interfaces;
public interface IFiles: IEntityInt, ITimeStampInfo
{
public string FileName { get; set; }
public string FileSubPath { get; set; }
public string FileExtension { get; set; }
public string RawText { get; set; }
public string FileHash { get; set; }
public bool IsCompressed { get; set; }
}

View File

@ -8,6 +8,7 @@ public interface IStockSignalREndpointCommon
public Task<List<StockTaking>?> GetStockTakings(bool loadRelations);
public Task<List<StockTaking>?> GetStockTakingsByProductId(int productId);
public Task<StockTaking?> AddStockTaking(StockTaking stockTaking);
public Task<StockTakingItem?> RefreshStockTakingItem(int stockTakingItemId);
public Task<StockTaking?> UpdateStockTaking(StockTaking stockTaking);
public Task<List<StockTakingItem>?> GetStockTakingItems();
@ -19,6 +20,7 @@ public interface IStockSignalREndpointCommon
public Task<List<StockTakingItemPallet>?> GetStockTakingItemPallets();
public Task<List<StockTakingItemPallet>?> GetStockTakingItemPalletsByProductId(int productId);
public Task<StockTaking?> CloseStockTaking(int stockTakingId);
public Task<StockTakingItemPallet?> AddStockTakingItemPallet(StockTakingItemPallet stockTakingItemPallet);
public Task<StockTakingItemPallet?> UpdateStockTakingItemPallet(StockTakingItemPallet stockTakingItemPallet);
}

View File

@ -2,8 +2,16 @@
namespace FruitBank.Common.Models.SignalRs;
public class SignalRMessageToClientWithText<T>(string? message, T? content)
public class SignalRMessageToClientWithText<T>
{
public string? Message { get; set; } = message;
public T? Content { get; set; } = content;
public SignalRMessageToClientWithText()
{}
public SignalRMessageToClientWithText(string? message, T? content) : this()
{
Message = message;
Content = content;
}
public string? Message { get; set; }
public T? Content { get; set; }
}

View File

@ -92,13 +92,14 @@ public class SignalRTags : AcSignalRTags
public const int GetStockTakings = 170;
public const int AddStockTaking = 171;
public const int UpdateStockTaking = 172;
public const int CloseStockTaking = 173;
public const int GetStockTakingItems = 174;
public const int GetStockTakingItemsById = 175;
public const int GetStockTakingItemsByProductId = 176;
public const int GetStockTakingItemsByStockTakingId = 177;
public const int AddOrUpdateMeasuredStockTakingItemPallet = 178;
public const int RefreshStockTakingItem = 172;
public const int UpdateStockTaking = 173;
public const int CloseStockTaking = 174;
public const int GetStockTakingItems = 175;
public const int GetStockTakingItemsById = 176;
public const int GetStockTakingItemsByProductId = 177;
public const int GetStockTakingItemsByStockTakingId = 178;
public const int AddOrUpdateMeasuredStockTakingItemPallet = 179;
public const int AuthenticateUser = 195;

View File

@ -20,7 +20,7 @@
<Columns>
<MgGridDataColumn FieldName="Id" SortIndex="0" SortOrder="GridColumnSortOrder.Descending"
UrlLink=@(FruitBankConstClient.BaseUrl+"/Admin/Order/Edit/{Id}") />
<DxGridDataColumn FieldName="CustomerId" />
<MgGridDataColumn FieldName="CustomerId" UrlLink=@(FruitBankConstClient.BaseUrl + "/Admin/Customer/Edit/{CustomerId}") />
<DxGridDataColumn FieldName="@("Customer.Company")" Caption="Company" ReadOnly="true" />
<DxGridDataColumn FieldName="OrderStatus" />
<DxGridDataColumn FieldName="IsMeasurable" ReadOnly="true" />
@ -31,10 +31,10 @@
<DxGridDataColumn FieldName="IsAllOrderItemAvgWeightValid" ReadOnly="true" Caption="AvgWeightValid" />
<DxGridDataColumn FieldName="RevisorId" ReadOnly="true" />
<DxGridDataColumn FieldName="MeasurementOwnerId" ReadOnly="true" />
<DxGridDataColumn FieldName="DateOfReceipt" />
<DxGridDataColumn FieldName="CreatedOnUtc" ReadOnly="true" />
<MgGridDataColumn FieldName="RevisorId" ReadOnly="true" UrlLink=@(FruitBankConstClient.BaseUrl + "/Admin/Customer/Edit/{RevisorId}") />
<MgGridDataColumn FieldName="MeasurementOwnerId" ReadOnly="true" UrlLink=@(FruitBankConstClient.BaseUrl + "/Admin/Customer/Edit/{MeasurementOwnerId}") />
<DxGridDataColumn FieldName="DateOfReceipt" DisplayFormat="yyyy.MM.dd hh:mm" />
<DxGridDataColumn FieldName="CreatedOnUtc" ReadOnly="true" DisplayFormat="yyyy.MM.dd hh:mm" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<DetailRowTemplate>
@ -107,6 +107,9 @@
private async Task ReloadDataFromDb(bool forceReload = false)
{
LoadingPanelVisibility.Visible = true;
if (IsMasterGrid)
{
using (await ObjectLock.GetSemaphore<OrderDto>().UseWaitAsync())
{
if (OrderDtos == null) OrderDtos = await FruitBankSignalRClient.GetAllOrderDtos() ?? [];
@ -119,7 +122,7 @@
//if (forceReload)
Grid?.Reload();
}
LoadingPanelVisibility.Visible = false;
}

View File

@ -1,6 +1,7 @@
@using AyCode.Blazor.Components.Components.Grids
@using AyCode.Core.Helpers
@using AyCode.Utils.Extensions
@using FruitBank.Common
@using FruitBank.Common.Dtos
@using FruitBank.Common.Models
@using FruitBankHybrid.Shared.Components.Grids.GenericAttributes
@ -18,7 +19,7 @@
FilterMenuButtonDisplayMode="@(IsMasterGrid ? GridFilterMenuButtonDisplayMode.Never : GridFilterMenuButtonDisplayMode.Always)">
<Columns>
<DxGridDataColumn FieldName="Id" />
<DxGridDataColumn FieldName="OrderId" />
<MgGridDataColumn FieldName="OrderId" UrlLink=@(FruitBankConstClient.BaseUrl + "/Admin/Order/Edit/{OrderId}") />
<DxGridDataColumn FieldName="@("OrderDto.Customer.Company")" Caption="Company" ReadOnly="true" />
<DxGridDataColumn FieldName="ProductId">
<EditSettings>
@ -49,7 +50,7 @@
<DxGridDataColumn FieldName="AverageWeightDifference" ReadOnly="true" Visible="false" Caption="AvgWeightDiff" />
<DxGridDataColumn FieldName="AverageWeightIsValid" ReadOnly="true" Caption="AvgWeightValid" />
<DxGridDataColumn FieldName="IsAudited" ReadOnly="true" />
<DxGridDataColumn FieldName="@("OrderDto.CreatedOnUtc")" Caption="Rendelés ideje" ReadOnly="true" />
<DxGridDataColumn FieldName="@("OrderDto.CreatedOnUtc")" Caption="Rendelés ideje" ReadOnly="true" DisplayFormat="yyyy.MM.dd hh:mm" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<DetailRowTemplate>

View File

@ -1,5 +1,6 @@
@using AyCode.Blazor.Components.Components.Grids
@using AyCode.Utils.Extensions
@using FruitBank.Common
@using FruitBank.Common.Dtos
@using FruitBank.Common.Entities
@using FruitBank.Common.Models
@ -32,6 +33,10 @@
<DxGridDataColumn FieldName="IsMeasured" ReadOnly="true" />
<DxGridDataColumn FieldName="IsAudited" ReadOnly="true" />
<MgGridDataColumn FieldName="@nameof(OrderItemPallet.ModifierId)" ReadOnly="true" UrlLink=@(FruitBankConstClient.BaseUrl + "/Admin/Customer/Edit/{ModifierId}") />
<DxGridDataColumn FieldName="@nameof(OrderItemPallet.Modified)" ReadOnly="true" DisplayFormat="yyyy.MM.dd hh:mm" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<ToolbarTemplate>

View File

@ -179,11 +179,11 @@
var productDto = (ProductDto)e.DataItem;
if (e.Grid.IsDetailRowExpanded(e.VisibleIndex))
{
_currentOrderDtos = null;
_currentOrderDtos = productDto != null ? await GetOrderDtosFromDbAsync(productDto.Id) : [];
}
// if (e.Grid.IsDetailRowExpanded(e.VisibleIndex))
// {
// _currentOrderDtos = null;
// _currentOrderDtos = productDto != null ? await GetOrderDtosFromDbAsync(productDto.Id) : [];
// }
}
protected async Task OnActiveTabChanged(int activeTabIndex, int productId)
@ -192,11 +192,11 @@
switch (_activeTabIndex)
{
case 0:
//_currentOrderDtos = null;
case 1:
_currentOrderDtos = null;
_currentOrderDtos = await GetOrderDtosFromDbAsync(productId);
break;
case 1:
case 2:
_currentOrderItemDtos = null;
_currentOrderItemDtos = await GetOrderItemDtosFromDbAsync(productId);
break;

View File

@ -47,7 +47,7 @@
<EditSettings>
<DxComboBoxSettings Data="Shippings"
ValueFieldName="Id"
TextFieldName="ShippingDate"
TextFieldName="LicencePlate"
DropDownBodyCssClass="dd-body-class"
ListRenderMode="ListRenderMode.Entire"
SearchMode="ListSearchMode.AutoSearch"
@ -57,13 +57,14 @@
<DxListEditorColumn FieldName="@nameof(Shipping.Id)" />
<DxListEditorColumn FieldName="@nameof(Shipping.ShippingDate)" />
<DxListEditorColumn FieldName="@nameof(Shipping.LicencePlate)" />
<DxListEditorColumn FieldName="@nameof(Shipping.Comment)" />
</Columns>
</DxComboBoxSettings>
</EditSettings>
</DxGridDataColumn>
<DxGridDataColumn FieldName="DocumentIdNumber" />
<DxGridDataColumn FieldName="ShippingDate" />
<DxGridDataColumn FieldName="ShippingDate" Caption="LoadDate" />
<DxGridDataColumn FieldName="Country" />
<DxGridDataColumn FieldName="TotalPallets" />

View File

@ -1,10 +1,14 @@
@using AyCode.Utils.Extensions
@using AyCode.Blazor.Components.Components.Grids
@using AyCode.Utils.Extensions
@using FruitBank.Common
@using FruitBank.Common.Dtos
@using FruitBank.Common.Entities
@using FruitBank.Common.Models
@using FruitBankHybrid.Shared.Databases
@using FruitBankHybrid.Shared.Services.SignalRs
@inject FruitBankSignalRClient FruitBankSignalRClient
@inject LoggedInModel LoggedInModel
<MgGridBase @ref="gridOrderItemPallet" Data="ShippingItemPallets" IsMasterGrid="IsMasterGrid" AutoSaveLayoutName="GridShippingItemPallets"
PageSize="@(IsMasterGrid ? 15 : 50)" ShowFilterRow="IsMasterGrid" ShowGroupPanel="IsMasterGrid"
@ -26,6 +30,10 @@
<DxGridDataColumn FieldName="NetWeight" />
<DxGridDataColumn FieldName="IsMeasured" ReadOnly="true" />
<MgGridDataColumn FieldName="@nameof(ShippingItemPallet.ModifierId)" ReadOnly="true" UrlLink=@(FruitBankConstClient.BaseUrl + "/Admin/Customer/Edit/{ModifierId}") />
<DxGridDataColumn FieldName="@nameof(ShippingItemPallet.Modified)" ReadOnly="true" DisplayFormat="yyyy.MM.dd hh:mm" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<GroupSummary>

View File

@ -84,9 +84,10 @@
<DxGridDataColumn FieldName="IsMeasurable" ReadOnly="true" />
<DxGridDataColumn FieldName="IsMeasured" ReadOnly="true" />
<DxGridDataColumn FieldName="UnitPriceOnDocument" Caption="Bekerülési ár" />
<DxGridDataColumn FieldName="Created" ReadOnly="true" />
<DxGridDataColumn FieldName="Modified" ReadOnly="true" />
<DxGridDataColumn FieldName="Created" ReadOnly="true" Visible="false" />
<DxGridDataColumn FieldName="Modified" ReadOnly="true" Visible="false" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
@* <DataColumnCellDisplayTemplate>
@ -229,7 +230,7 @@
}
if (valueOnDocument > 0 && valueOnDocument > measuredValue) e.CssClass = "text-danger";
//else if (valueOnDocument <= measuredValue) e.CssClass = "text-success";
else if (valueOnDocument > 0 && valueOnDocument < measuredValue) e.CssClass = "text-success";
break;
}

View File

@ -48,7 +48,7 @@
<ToolbarTemplate>
@if (IsMasterGrid)
{
<MgGridToolbarTemplate Grid="Grid" OnReloadDataClick="() => ReloadDataFromDb(true)" />
<MgGridToolbarTemplate Grid="Grid" OnReloadDataClick="() => ReloadDataFromDb(true)" EnableDelete="false" EnableEdit="false" EnableNew="false" />
}
</ToolbarTemplate>
@* <GroupSummary>

View File

@ -1,4 +1,6 @@
<iframe src="https://localhost:59579/Admin/FileManager/ImageTextExtraction" title="Ai process form" width="100%" height="100%"></iframe>
@code {
@using FruitBank.Common
<iframe src="@baseUrl" title="Ai process form" width="100%" height="100%"></iframe>
@code {
public string baseUrl = FruitBankConstClient.BaseUrl + "/Admin/FileManager/ImageTextExtraction";
}

View File

@ -72,14 +72,15 @@
</table>
}
<MgLazyLoadContent @ref="_lazyContentRef"
@* <MgLazyLoadContent @ref="_lazyContentRef"
MinHeight="800px"
RootMargin="50px"
OnContentVisible="OnPdfContainerVisibleAsync"
ContainerStyle="margin-top: 30px;">
<div id="pdfContainer" style="width: 100%; height: 800px; overflow-y: auto;">
</div>
</MgLazyLoadContent>
</MgLazyLoadContent>*@
</AfterColumnsTemplate>
@* <FooterTemplate Context="ctx">
@ -110,8 +111,17 @@
private async Task OnDataItemChangedAsync(object? dataItem)
{
@if (dataItem is not ShippingDocument && dataItem is not ShippingItem) return;
if (dataItem is not ShippingDocument && dataItem is not ShippingItem) return;
ShippingDocument? shippingDocument = null;
if (dataItem is ShippingItem shippingItem) shippingDocument = shippingItem.ShippingDocument;
else shippingDocument = dataItem as ShippingDocument;
if (shippingDocument == null) return;
if (_lazyContentRef != null && shippingDocument.ShippingDocumentToFiles?.Count > 0)
{
// Store the PDF to render
_randomPdf = _pdfFiles[Random.Shared.Next(_pdfFiles.Length)];
_currentPdfToRender = $"_content/FruitBankHybrid.Shared/uploads/{_randomPdf}";
@ -122,6 +132,7 @@
await _lazyContentRef.TriggerContentVisibleAsync();
}
}
}
private async Task OnPdfContainerVisibleAsync()
{

View File

@ -23,12 +23,13 @@
<Columns>
<DxGridDataColumn FieldName="Id" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" ReadOnly="true" />
<DxGridDataColumn FieldName="ShippingDate" />
<DxGridDataColumn FieldName="LicencePlate" />
<DxGridDataColumn FieldName="IsAllMeasured" ReadOnly="true" />
<DxGridDataColumn FieldName="Created" ReadOnly="true" />
<DxGridDataColumn FieldName="Modified" ReadOnly="true" />
<DxGridDataColumn FieldName="ShippingDate" Caption="Beérkezés"/>
<DxGridDataColumn FieldName="LicencePlate" Caption="Rendszám" />
<DxGridDataColumn FieldName="Comment" Caption="Megjegyzés" ReadOnly="false" />
<DxGridDataColumn FieldName="CargoCompany" Caption="Fuvarozó" ReadOnly="false" />
<DxGridDataColumn FieldName="IsAllMeasured" Caption="Mérések kész" ReadOnly="true" />
<DxGridDataColumn FieldName="Created" Caption="Létrehozva" ReadOnly="true" />
<DxGridDataColumn FieldName="Modified" Caption="Módosítva" ReadOnly="true" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<DetailRowTemplate>

View File

@ -48,7 +48,7 @@
<ToolbarTemplate>
@if (IsMasterGrid)
{
<MgGridToolbarTemplate Grid="Grid" OnReloadDataClick="() => ReloadDataFromDb(true)" />
<MgGridToolbarTemplate Grid="Grid" OnReloadDataClick="() => ReloadDataFromDb(true)" EnableDelete="false" EnableEdit="false" EnableNew="false" />
}
</ToolbarTemplate>
</GridStockTakingItemBase>

View File

@ -12,7 +12,7 @@
@typeparam TPalletItem where TPalletItem : class, IMeasuringItemPalletBase
<DxFormLayout Context="ctxFromLayoutPallet" Data="@PalletItem" CaptionPosition="CaptionPosition.Vertical" CssClass="w-100 measuring-form-layout"
ItemUpdating="@((pair) => OnItemUpdating(pair.Key, pair.Value, PalletItem))" Enabled="IsEditable">
ItemUpdating="@((pair) => OnItemUpdating(pair.Key, pair.Value, PalletItem))" Enabled="Editable">
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" ColSpanMd="1" BeginRow="true">
<b>@(MeasuringIndex). MÉRÉS</b>
@ -21,24 +21,24 @@
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.PalletWeight)))"
Field="@nameof(ShippingItemPallet.PalletWeight)"
Enabled="@(IsEditable && IsMeasurable && ProductId > 0)" Visible="@(IsMeasurable)"
Enabled="@(Editable && IsMeasurable && ProductId > 0)" Visible="@(IsMeasurable)"
Caption="Rakl.súly(kg)" ColSpanMd="2" />
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.TareWeight)))"
Field="@nameof(ShippingItemPallet.TareWeight)"
Enabled="@(IsEditable && IsMeasurable && ProductId > 0)" Visible="@(IsMeasurable)"
Enabled="@(Editable && IsMeasurable && ProductId > 0)" Visible="@(IsMeasurable)"
Caption="Tára(kg)" ColSpanMd="2" />
@* <DxFormLayoutItem Context="ctxFromLayoutItemPallet" ColSpanMd="1" /> *@
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.TrayQuantity)))"
Field="@nameof(ShippingItemPallet.TrayQuantity)"
Enabled="@(IsEditable && ProductId > 0)"
Enabled="@(Editable && ProductId > 0)"
Caption="Rekesz/csomag" ColSpanMd="2" />
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.GrossWeight)))"
Field="@nameof(ShippingItemPallet.GrossWeight)"
Enabled="@(IsEditable && IsMeasurable && ProductId > 0)" Visible="@(IsMeasurable)"
Enabled="@(Editable && IsMeasurable && ProductId > 0)" Visible="@(IsMeasurable)"
Caption="Br.súly(kg)" ColSpanMd="2">
</DxFormLayoutItem>
@ -48,13 +48,13 @@
</DxFormLayoutItem>
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" ColSpanMd="@(HasAuditButton ? 1 : 2)">
<DxButton Enabled="@(IsEditable && BtnSaveEnabled)" Text="@(PalletItem.Id == 0 ? "Mentés" : "Módosít")" Click="() => PalletItemSaveClick()" CssClass="w-100" />
<DxButton Enabled="@(Editable && BtnSaveEnabled)" Text="@(PalletItem.Id == 0 ? "Mentés" : "Módosít")" Click="() => PalletItemSaveClick()" CssClass="w-100" />
</DxFormLayoutItem>
@if (HasAuditButton)
{
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" ColSpanMd="1">
<DxButton Enabled="@(IsEditable && OrderItemPallet!.IsMeasuredAndValid(IsMeasurable) && !OrderItemPallet.IsAudited && IsMaxTrayQuantityValid)"
<DxButton Enabled="@(Editable && OrderItemPallet!.IsMeasuredAndValid(IsMeasurable) && !OrderItemPallet.IsAudited && IsMaxTrayQuantityValid)"
Text="@(OrderItemPallet!.IsAudited ? "Jóváhagyva" : "Jóváhagy")" Click="() => PalletItemAuditedClick()" CssClass="w-100" />
</DxFormLayoutItem>
}
@ -73,15 +73,19 @@
[Parameter] public int? AddOrUpdateSignalRTag { get; set; } = null;
[Parameter] public int? MaxTrayQuantity { get; set; } = null;
[Parameter] public bool IsEditable { get; set; } = true;
[Parameter] public bool Editable { get; set; } = true;
//[Parameter] public EventCallback OnPalletItemSaveClick { get; set; }
[Parameter] public Func<TPalletItem?, Task>? OnPalletItemSaved { get; set; }
[Parameter] public Func<TPalletItem, Task>? OnPalletItemValueChanged { get; set; }
[Parameter] public Func<TPalletItem?, Task>? OnPalletItemAuditedClick { get; set; }
[Parameter] public Func<TPalletItem?, Task>? OnPalletItemAudited { get; set; }
/// <summary>
/// Before Save or Audit
/// </summary>
[Parameter] public Func<TPalletItem?, Task>? OnPalletItemSaveOrAuditClick { get; set; }
//public bool LoadingPanelVisible { get; set; } = false;
//public bool IsEditable => !HasAuditButton || (OrderItemPallet.IsAudited);
//public bool Editable => !HasAuditButton || (OrderItemPallet.IsAudited);
public bool BtnSaveEnabled { get; set; }
@ -93,7 +97,7 @@
private bool GetBtnSaveEnabled()
{
return IsEditable && PalletItem.IsValidMeasuringValues(IsMeasurable) && !PalletItem.IsMeasured && IsMaxTrayQuantityValid;
return Editable && PalletItem.IsValidMeasuringValues(IsMeasurable) && !PalletItem.IsMeasured && IsMaxTrayQuantityValid;
}
private bool IsMaxTrayQuantityValid => (!MaxTrayQuantity.HasValue || PalletItem.TrayQuantity <= MaxTrayQuantity.Value);
@ -119,6 +123,8 @@
PalletItem.ModifierId = LoggedInModel.CustomerDto?.Id;
if (OnPalletItemSaveOrAuditClick != null) await OnPalletItemSaveOrAuditClick.Invoke(PalletItem);
var responseShippingItemPallet = await FruitBankSignalRClient.PostDataAsync(AddOrUpdateSignalRTag!.Value, PalletItem);
if (responseShippingItemPallet != null) PalletItem.Id = responseShippingItemPallet.Id; //Az UpdateCollection miatt kell, hogy megtalálja mit kell kicserélni! - J.
//else _logger.Error($"Sikertelen volt a raklap adatainak mentése!");
@ -126,7 +132,7 @@
if (OnPalletItemSaved != null) await OnPalletItemSaved.Invoke(responseShippingItemPallet);
//LoadingPanelVisible = false;
StateHasChanged();
await InvokeAsync(StateHasChanged);
}
protected async Task OnItemUpdating(string fieldName, object newValue, TPalletItem palletItem)
@ -172,15 +178,17 @@
private async Task PalletItemAuditedClick()
{
if (OnPalletItemAuditedClick != null)
if (OnPalletItemAudited != null)
{
if (OrderItemPallet == null) throw new Exception($"PalletItemComponent->PalletItemAuditedClick(); OrderItemPallet == null");
if (await DialogService.ShowConfirmBoxAsync("Megerősítés", "Biztoan jóváhagyja a mérést? Jóváhagyás után a mérés nem módosítható!", MessageBoxRenderStyle.Info))
{
if (OnPalletItemSaveOrAuditClick != null) await OnPalletItemSaveOrAuditClick.Invoke(PalletItem);
OrderItemPallet.RevisorId = LoggedInModel.CustomerDto!.Id;
StateHasChanged(); //Az Audit button miatt kell a StateHasChanged(), most már van RevisorId és emiatt disabled lesz...
await InvokeAsync(StateHasChanged); //Az Audit button miatt kell a StateHasChanged(), most már van RevisorId és emiatt disabled lesz...
PalletItem.SetParentPropToNull();
@ -191,7 +199,7 @@
await DialogService.ShowMessageBoxAsync("Hiba", "Adatok mentése sikertelen volt, ellenőrizze a mérés adatait!", MessageBoxRenderStyle.Danger);
}
if (OnPalletItemAuditedClick != null) await OnPalletItemAuditedClick.Invoke(responseShippingItemPallet);
await OnPalletItemAudited.Invoke(responseShippingItemPallet);
}
}
}

View File

@ -12,17 +12,26 @@
@using FruitBankHybrid.Shared.Services.SignalRs
@using Mango.Nop.Core.Entities
<DxLoadingPanel @bind-Visible="LoadingPanelVisible"
IsContentBlocked="true"
ApplyBackgroundShading="true"
IndicatorAreaVisible="true"
IsContentVisible="true"
IndicatorAnimationType="WaitIndicatorAnimationType.Spin"
Text="Adatok szinkronizálása folyamatban...">
<DxFormLayout CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
<DxFormLayoutItem Caption="Termék:" ColSpanMd="2">
@* CaptionCssClass="@(SelectedProductDto?.IsMeasured == true ? "text-success" : "")"> *@
<DxComboBox Data="@_stockTakings"
<DxComboBox @ref="cbStockTakings"
Data="@_stockTakings"
TextFieldName="@nameof(StockTaking.StartDateTime)"
CssClass="cw-480"
DropDownBodyCssClass="dd-body-class"
Context="ctxProduct"
InputId="cbProduct"
Value="@SelectedStockTaking"
ValueChanged="@(async (StockTaking stockTaking) => await StockTakingComboValueChanged(stockTaking))">
ValueChanged="@(async (StockTaking stockTaking) => await StockTakingComboValueChanged(stockTaking, null))">
</DxComboBox>
</DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="4">
@ -32,18 +41,24 @@
CssClass="cw-480"
DropDownBodyCssClass="dd-body-class"
Context="ctxProduct2"
InputId="cbProduct2">
InputId="cbProduct2"
SearchMode="ListSearchMode.AutoSearch"
SearchFilterCondition="ListSearchFilterCondition.Contains"
SearchTextParseMode="ListSearchTextParseMode.Default"
ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
DropDownTriggerMode="DropDownTriggerMode.Click"
@ref="cbStockTakingItems">
</DxComboBox>
</DxFormLayoutItem>
@* TextFieldName="StockTakingItem.Product.Name" *@
<DxFormLayoutItem ColSpanMd="1">
<DxButton Text="Új" Enabled="@(_stockTakings.All(x => x.IsClosed))" Click="() => NewStockTakingClick()"></DxButton>
<DxButton Text="Új" Enabled="@(!_btnDisabled && _stockTakings.All(x => x.IsClosed))" Click="() => NewStockTakingClick()"></DxButton>
</DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="1">
<DxButton Text="Módosít" Enabled="@(SelectedStockTaking?.IsClosed ?? false)" Click="() => UpdateStockTakingClick()"></DxButton>
@* <DxFormLayoutItem ColSpanMd="1">
<DxButton Text="Módosít" Enabled="@((SelectedStockTaking?.IsClosed ?? false) && false)" Click="() => UpdateStockTakingClick()"></DxButton>
</DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="1">
<DxButton Text="Lezárás" Enabled="@(SelectedStockTaking?.IsReadyForClose() ?? false)" Click="() => StockTakingCloseClick()"></DxButton>
*@ <DxFormLayoutItem ColSpanMd="1">
<DxButton Text="Lezárás" Enabled="@(!_btnDisabled && (!SelectedStockTaking?.IsClosed ?? false) && (SelectedStockTaking?.IsReadyForClose() ?? false))" Click="() => StockTakingCloseClick(SelectedStockTaking!.Id)"></DxButton>
</DxFormLayoutItem>
</DxFormLayout>
@ -60,8 +75,15 @@
var a = $"Várható rekesz: {SelectedStockTakingItem.TotalOriginalQuantity} ({SelectedStockTakingItem.OriginalStockQuantity} + {SelectedStockTakingItem.InProcessOrdersQuantity}), Várható net.súly: {SelectedStockTakingItem.OriginalNetWeight} kg.";
<span>@a</span>
}
@if (SelectedStockTakingItem.IsInvalid)
{
<div class="text-danger" style="margin-top: 15px">A várható mennyiség nem lehet negatív! A hibás adatok javítása után nyomja meg a "Frissítés" gombot.</div>
<DxButton Text="Frissítés" Click="() => RefreshErrorItemClick(SelectedStockTakingItem)"></DxButton>
}
</div>
<DxFormLayout Data="@SelectedStockTakingItem" CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
<DxFormLayout Data="@SelectedStockTakingItem" CaptionPosition="CaptionPosition.Vertical" CssClass="w-100" Enabled="@((!SelectedStockTaking?.IsClosed ?? false))">
<DxFormLayoutItem Context="ctxShippingItemFromLayoutItem" ColSpanMd="12">
@for (var index = 0; index < (SelectedStockTakingItem?.StockTakingItemPallets?.Count ?? 0); index++)
{
@ -70,6 +92,7 @@
<PalletItemComponent IsMeasurable="@SelectedStockTakingItem!.IsMeasurable"
MeasuringIndex="@localI"
Editable="@(!SelectedStockTaking?.IsClosed ?? false)"
PalletItem="@currentShippingItemPallet"
ProductId="@SelectedStockTakingItem.Product!.Id"
AddOrUpdateSignalRTag="SignalRTags.AddOrUpdateMeasuredStockTakingItemPallet"
@ -94,6 +117,7 @@
</DxFormLayout>
}
</div>
</DxLoadingPanel>
@code
{
@ -102,6 +126,12 @@
[Inject] public required IDialogService DialogService { get; set; } = null!;
[Inject] public required FruitBankSignalRClient FruitBankSignalRClient { get; set; }
bool _btnDisabled = false;
bool LoadingPanelVisible = false;
DxComboBox<StockTaking, StockTaking> cbStockTakings;
DxComboBox<StockTakingItem, StockTakingItem> cbStockTakingItems;
List<StockTaking> _stockTakings { get; set; } = [];
List<StockTakingItem> _stockTakingItems { get; set; } = [];
List<StockTakingItemPallet> _stockTakingItemPallets { get; set; } = [];
@ -115,55 +145,100 @@
public async Task ReloadDataFromDb(bool forceReload)
{
LoadingPanelVisibility.Visible = true;
LoadingPanelVisible = true;
_stockTakings = await FruitBankSignalRClient.GetStockTakings(false) ?? [];
await StockTakingComboValueChanged(_stockTakings.FirstOrDefault());
await StockTakingComboValueChanged(_stockTakings.FirstOrDefault(), null);
LoadingPanelVisibility.Visible = false;
LoadingPanelVisible = false;
}
private async Task RefreshErrorItemClick(StockTakingItem errorTakingItem)
{
var stockTakingItem = await FruitBankSignalRClient.RefreshStockTakingItem(errorTakingItem.Id);
if (stockTakingItem == null)
{
await DialogService.ShowMessageBoxAsync("Hiba", "Adatok frissése sikertelen volt!", MessageBoxRenderStyle.Danger);
return;
}
await StockTakingComboValueChanged(SelectedStockTaking, stockTakingItem.Id);
if (stockTakingItem.IsInvalid)
await DialogService.ShowMessageBoxAsync("Figyelem", "A termék továbbra is hibás!", MessageBoxRenderStyle.Warning);
}
private async Task NewStockTakingClick()
{
var stockTaking = new StockTaking();
stockTaking.StartDateTime = DateTime.Now;
stockTaking.Creator = LoggedInModel.CustomerDto!.Id;
_btnDisabled = true;
try
{
LoadingPanelVisible = true;
var stockTaking = new StockTaking
{
StartDateTime = DateTime.Now,
Creator = LoggedInModel.CustomerDto!.Id
};
var resultStockTakings = await FruitBankSignalRClient.AddStockTaking(stockTaking);
if (resultStockTakings == null) return;
if (resultStockTakings == null)
{
await DialogService.ShowMessageBoxAsync("Hiba", "Új leltár létrehozása sikertelen volt!", MessageBoxRenderStyle.Danger);
return;
}
_stockTakings.UpdateCollection(resultStockTakings, false);
await StockTakingComboValueChanged(_stockTakings.FirstOrDefault(x => x.Id == stockTaking.Id));
await StockTakingComboValueChanged(_stockTakings.FirstOrDefault(x => x.Id == resultStockTakings.Id), null);
}
private async Task UpdateStockTakingClick()
finally
{
// var resultStockTaking = await FruitBankSignalRClient.AddStockTaking(stockTaking);
// if (resultStockTaking == null) return;
// _stockTakings.Add(resultStockTaking);
StateHasChanged();
_btnDisabled = false;
LoadingPanelVisible = false;
}
private async Task StockTakingCloseClick()
//cbStockTakings.Reload();
await InvokeAsync(StateHasChanged);
}
private async Task StockTakingCloseClick(int stockTakingId)
{
// var resultStockTaking = await FruitBankSignalRClient.AddStockTaking(stockTaking);
// if (resultStockTaking == null) return;
_btnDisabled = true;
// _stockTakings.Add(resultStockTaking);
StateHasChanged();
try
{
LoadingPanelVisible = true;
var resultStockTaking = await FruitBankSignalRClient.CloseStockTaking(stockTakingId);
if (resultStockTaking == null)
{
await DialogService.ShowMessageBoxAsync("Hiba", "A leltár lezárása sikertelen volt, ellenőrizze a leltár adatait!", MessageBoxRenderStyle.Danger);
return;
}
private async Task StockTakingComboValueChanged(StockTaking? newValue)
_stockTakings.UpdateCollection(resultStockTaking, false);
await StockTakingComboValueChanged(_stockTakings.FirstOrDefault(x => x.Id == resultStockTaking.Id), null);
}
finally
{
_btnDisabled = false;
LoadingPanelVisible = false;
}
await InvokeAsync(StateHasChanged);
}
private async Task StockTakingComboValueChanged(StockTaking? newValue, int? selectedStockTakingItemId)
{
SelectedStockTaking = newValue;
SelectedStockTaking?.StockTakingItems = await FruitBankSignalRClient.GetStockTakingItemsByStockTakingId(SelectedStockTaking.Id);
PrepareStockTakingItems(SelectedStockTaking);
SelectedStockTakingItem = _stockTakingItems.FirstOrDefault();
SelectedStockTakingItem = selectedStockTakingItemId.HasValue ? _stockTakingItems.FirstOrDefault(x => x.Id == selectedStockTakingItemId.Value) : _stockTakingItems.FirstOrDefault();
StateHasChanged();
await InvokeAsync(StateHasChanged);
}
private void PrepareStockTakingItems(StockTaking? stockTaking)
@ -191,19 +266,22 @@
}
}
private Task OnStockTakingItemPalletValueChanged(StockTakingItemPallet stockTakingItemPallet, StockTakingItem stockTakingItem)
private async Task OnStockTakingItemPalletValueChanged(StockTakingItemPallet stockTakingItemPallet, StockTakingItem stockTakingItem)
{
// MeasuringValuesHelper.SetShippingItemTotalMeasuringValues(stockTakingItem);
// BtnSaveEnabled = stockTakingItem.IsValidMeasuringValues() && stockTakingItemPallet.IsValidMeasuringValues(stockTakingItem.IsMeasurable);
StateHasChanged();
return Task.CompletedTask;
//cbStockTakingItems.Reload();
await InvokeAsync(StateHasChanged);
//return Task.CompletedTask;
}
private async Task OnStockTakingItemPalletSaved(StockTakingItemPallet? responseStockTakingItemPallet)
{
if (responseStockTakingItemPallet != null)
{
//responseStockTakingItemPallet.IsMeasured = true;
responseStockTakingItemPallet.StockTakingItem = SelectedStockTakingItem;
SelectedStockTakingItem!.MeasuredStockQuantity = responseStockTakingItemPallet.TrayQuantity;
@ -216,7 +294,10 @@
}
else await DialogService.ShowMessageBoxAsync("Hiba", "Adatok mentése sikertelen volt, ellenőrizze a mérés adatait!", MessageBoxRenderStyle.Danger);
//cbStockTakingItems.Reload();
await InvokeAsync(StateHasChanged);
await cbStockTakingItems.FocusAsync();
}
}

View File

@ -16,7 +16,7 @@ using Microsoft.AspNetCore.Components;
namespace FruitBankHybrid.Shared.Layout;
public partial class MainLayout : LayoutComponentBase
public partial class MainLayout : LayoutComponentBase, IDisposable
{
[Inject] public required IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
[Inject] public required NavigationManager NavManager { get; set; }
@ -70,10 +70,12 @@ public partial class MainLayout : LayoutComponentBase
{
if (messageTag != SignalRTags.NotificationReceived || !LoggedInModel.IsLoggedIn) return;
try
{
var notificationMessage = responseDataMessage?.GetResponseData<SignalRMessageToClientWithText<OrderDto>>();
if (notificationMessage == null)
{
_logger.Error($"notificationMessage == null");
_logger.Error($"MainLayout.SignalRClientOnMessageReceived; notificationMessage == null; messageTag: {messageTag}");
return;
}
@ -93,7 +95,7 @@ public partial class MainLayout : LayoutComponentBase
if (!hasPermission) return;
_logger.Debug($"NotificationMessage received. {toastMessage}");
_logger.Debug($"MainLayout.SignalRClientOnMessageReceived; NotificationMessage received. {toastMessage}");
await InvokeAsync(() =>
{
@ -101,13 +103,25 @@ public partial class MainLayout : LayoutComponentBase
StateHasChanged();
});
}
catch (Exception ex)
{
_logger.Error($"MainLayout.SignalRClientOnMessageReceived ERROR; messageTag: {messageTag}", ex);
}
}
private async void OnLogoutClick()
{
try
{
await LoggedInModel.LogOutAsync();
RefreshMainLayout();
NavManager.NavigateTo("/Login");
}
catch (Exception e)
{
_logger.Error($"OnLogoutClick error");
}
}
public void RefreshMainLayout()
{

View File

@ -37,7 +37,7 @@
</NavLink>
</div>
@if (LoggedInModel.IsDeveloper)
@if (LoggedInModel.IsAdministrator)
{
<div class="nav-item px-3">
<NavLink class="nav-link" href="StockTaking" title="Leltározás">

View File

@ -159,7 +159,8 @@
var isValid = selectedOrderItemDto.IsValidMeasuringValues();
var isValidAndMeasured = isValid && selectedOrderItemDto.IsMeasuredAndValid(); // && selectedOrderItemDto.;
if (isValidAndMeasured) cssClass = "text-success";
if (isValid && !selectedOrderItemDto.AverageWeightIsValid) cssClass = "text-warning";
else if (isValidAndMeasured) cssClass = "text-success";
else if (isValid) cssClass = string.Empty;
var displayText = $"{selectedOrderItemDto.ProductName} - [{trayQuantity}/{selectedOrderItemDto.Quantity} rekesz, {(selectedOrderItemDto.IsMeasurable ? "net.súly: " + selectedOrderItemDto.NetWeight + "kg." : "nem mérendő!")}]";
@ -175,7 +176,8 @@
{
var selectedOrderItem = (OrderItemDto)(context.DataItem);
<DxFormLayout Context="ctxFormLayout" Data="@selectedOrderItem" CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
<DxFormLayout Context="ctxFormLayout" Data="@selectedOrderItem" CaptionPosition="CaptionPosition.Vertical"
CssClass="w-100">
<DxFormLayoutItem Context="ctxFormLayoutItem" ColSpanMd="12">
@for (var index = 0; index < (selectedOrderItem?.OrderItemPallets?.Count ?? 0); index++)
{
@ -184,14 +186,15 @@
<PalletItemComponent IsMeasurable="@selectedOrderItem.IsMeasurable"
MeasuringIndex="@localI"
IsEditable="@(!currentOrderItemPallet.IsAudited && !(SelectedOrder?.IsComplete ?? false))"
Editable="@(_enablePalletItems && !currentOrderItemPallet.IsAudited && !(SelectedOrder?.IsComplete ?? false))"
PalletItem="@currentOrderItemPallet"
ProductId="@selectedOrderItem.ProductId"
MaxTrayQuantity="@selectedOrderItem.Quantity"
AddOrUpdateSignalRTag="SignalRTags.AddOrUpdateMeasuredOrderItemPallet"
OnPalletItemSaveOrAuditClick="pallet => OnOrderItemSaveOrAuditClick(pallet, selectedOrderItem)"
OnPalletItemSaved="pallet => OnOrderItemPalletSaved(pallet, selectedOrderItem)"
OnPalletItemValueChanged="pallet => OnOrderItemPalletValueChanged(pallet, selectedOrderItem)"
OnPalletItemAuditedClick="pallet => OnPalletItemAuditedClick(pallet, selectedOrderItem)">
OnPalletItemAudited="pallet => OnOrderItemAudited(pallet, selectedOrderItem)">
</PalletItemComponent>
}
</DxFormLayoutItem>

View File

@ -17,9 +17,10 @@ using Nop.Core.Domain.Orders;
namespace FruitBankHybrid.Shared.Pages
{
public partial class MeasuringOut : ComponentBase
public partial class MeasuringOut : ComponentBase, IDisposable
{
private readonly Lock _lock = new Lock();
[Inject] public required IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
[Inject] public required FruitBankSignalRClient FruitBankSignalRClient { get; set; }
[Inject] public required NavigationManager NavManager{ get; set; }
@ -29,6 +30,7 @@ namespace FruitBankHybrid.Shared.Pages
private LoggerClient _logger = null!;
private string _errorText;
private bool _enablePalletItems = true;
private int _lastDaysCount = 1;
public bool HasMeasuringAccess;
public bool LoadingPanelVisible { get; set; } = true;
@ -59,8 +61,10 @@ namespace FruitBankHybrid.Shared.Pages
if (messageTag != SignalRTags.SendOrderItemDeleted && messageTag != SignalRTags.SendOrderChanged && messageTag != SignalRTags.SendOrderItemChanged &&
messageTag != SignalRTags.SendOrderItemPalletChanged && messageTag != SignalRTags.SendProductChanged) return;
_logger.DebugConditional($"SignalRClientOnMessageReceived received. {responseDataMessage}");
_logger.DebugConditional($"MeasuringOut.SignalRClientOnMessageReceived received. {responseDataMessage}");
try
{
OrderDto? orderDto;
OrderItem? orderItem;
OrderItemDto? orderItemDto;
@ -151,7 +155,12 @@ namespace FruitBankHybrid.Shared.Pages
return;
}
_logger.Error($"SignalRClientOnMessageReceived message == null");
_logger.Error($"MeasuringOut.SignalRClientOnMessageReceived message == null; messageTag: {messageTag}");
}
catch (Exception ex)
{
_logger.Error($"MeasuringOut.SignalRClientOnMessageReceived ERROR; messageTag: {messageTag}", ex);
}
}
private async Task RefreshOrdersFromDb(DateTime dateTime, int lastDaysCount)
@ -241,12 +250,25 @@ namespace FruitBankHybrid.Shared.Pages
return Task.CompletedTask;
}
private async Task OnPalletItemAuditedClick(OrderItemPallet? orderItemPallet, OrderItemDto selectedOrderItemDto)
private async Task OnOrderItemAudited(OrderItemPallet? orderItemPallet, OrderItemDto selectedOrderItemDto)
{
if (orderItemPallet == null) return;
_enablePalletItems = false;
await InvokeAsync(StateHasChanged);
await OnOrderItemPalletSaved(orderItemPallet, selectedOrderItemDto);
}
private async Task OnOrderItemSaveOrAuditClick(OrderItemPallet? orderItemPallet, OrderItemDto selectedOrderItemDto)
{
if (orderItemPallet != null)
{
_enablePalletItems = false;
await InvokeAsync(StateHasChanged);
}
}
private async Task OnOrderItemPalletSaved(OrderItemPallet? orderItemPallet, OrderItemDto selectedOrderItemDto)
{
if (orderItemPallet != null)
@ -258,7 +280,8 @@ namespace FruitBankHybrid.Shared.Pages
}
else await DialogService.ShowMessageBoxAsync("Hiba", "Adatok mentése sikertelen volt, ellenőrizze a mérés adatait!", MessageBoxRenderStyle.Danger);
StateHasChanged();
_enablePalletItems = true;
await InvokeAsync(StateHasChanged);
}
private Task AddNewPalletItemClick(OrderItemDto selectedOrderItemDto)
@ -359,5 +382,10 @@ namespace FruitBankHybrid.Shared.Pages
orderDto.GenericAttributes.UpdateBaseEntityCollection(genericAttributes, false);
}
}
public void Dispose()
{
FruitBankSignalRClient.OnMessageReceived -= SignalRClientOnMessageReceived;
}
}
}

View File

@ -10,12 +10,6 @@
<div style="margin-top: 30px;">
<DxLoadingPanel @bind-Visible="LoadingPanelVisibility.Visible"
IsContentBlocked="true"
ApplyBackgroundShading="true"
IndicatorAreaVisible="false"
Text="Adatok szinkronizálása folyamatban...">
<DxTabs RenderMode="TabsRenderMode.OnDemand">
<DxTabPage Text="Leltározás">
<StockTakingTemplate></StockTakingTemplate>
@ -31,6 +25,4 @@
}
</DxTabPage>
</DxTabs>
</DxLoadingPanel>
</div>

View File

@ -292,6 +292,7 @@ namespace FruitBankHybrid.Shared.Services.SignalRs
}
public Task<StockTaking?> AddStockTaking(StockTaking stockTaking) => PostDataAsync(SignalRTags.AddStockTaking, stockTaking);
public Task<StockTakingItem?> RefreshStockTakingItem(int stockTakingItemId) => GetByIdAsync<StockTakingItem>(SignalRTags.RefreshStockTakingItem, stockTakingItemId);
public Task<StockTaking?> UpdateStockTaking(StockTaking stockTaking) => PostDataAsync(SignalRTags.UpdateStockTaking, stockTaking);
@ -326,6 +327,10 @@ namespace FruitBankHybrid.Shared.Services.SignalRs
throw new NotImplementedException();
}
public Task<StockTaking?> CloseStockTaking(int stockTakingId)
=> PostDataAsync<int, StockTaking?>(SignalRTags.CloseStockTaking, stockTakingId);
public async Task<StockTakingItemPallet?> AddStockTakingItemPallet(StockTakingItemPallet stockTakingItemPallet)
{
throw new NotImplementedException();

View File

@ -7,7 +7,7 @@
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
<RunAOTCompilation>true</RunAOTCompilation>
<RunAOTCompilation>false</RunAOTCompilation>
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
</PropertyGroup>

View File

@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<!--<PublishTrimmed>true</PublishTrimmed>-->
<RunAOTCompilation>true</RunAOTCompilation>
<RunAOTCompilation>false</RunAOTCompilation>
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
</PropertyGroup>

View File

@ -19,10 +19,10 @@
<ApplicationId>com.mango.fruitbank</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationDisplayVersion>1.0.1</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<RunAOTCompilation>true</RunAOTCompilation>
<RunAOTCompilation>false</RunAOTCompilation>
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
@ -42,6 +42,7 @@
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<HoursBetweenUpdateChecks>24</HoursBetweenUpdateChecks>
<WindowsPackageType>MSIX</WindowsPackageType>
<AndroidSigningKeyStore>fruitbank.keystore</AndroidSigningKeyStore>
</PropertyGroup>
@ -62,12 +63,19 @@
<AndroidUseAapt2>True</AndroidUseAapt2>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<DebugSymbols>True</DebugSymbols>
<AndroidKeyStore>true</AndroidKeyStore>
<AndroidSigningKeyStore>fruitbank.keystore</AndroidSigningKeyStore>
<AndroidSigningKeyAlias>fruitbank</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>Asdasd123456</AndroidSigningKeyPass>
<AndroidSigningStorePass>Asdasd123456</AndroidSigningStorePass>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net10.0-android|AnyCPU'">
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidUseAapt2>True</AndroidUseAapt2>
<AndroidPackageFormat>apk</AndroidPackageFormat>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<AndroidKeyStore>True</AndroidKeyStore>
</PropertyGroup>
<ItemGroup>

View File

@ -6,7 +6,7 @@
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.1.0" />
<mp:PhoneIdentity PhoneProductId="10836226-17FE-45AD-8C96-8DB8D4D78222" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

Binary file not shown.

View File

@ -3,12 +3,12 @@
<Version>10</Version>
<SourceModelProvider>
<ConnectionBasedModelProvider>
<ConnectionString>Data Source=195.26.231.218;Initial Catalog=FruitBank_DEV;Integrated Security=False;Persist Security Info=False;User ID=sa;Pooling=False;Trust Server Certificate=True</ConnectionString>
<ConnectionString>Data Source=195.26.231.218;Initial Catalog=FruitBank_DEV;Integrated Security=False;Persist Security Info=False;User ID=sa;Pooling=False;Multiple Active Result Sets=False;Trust Server Certificate=True</ConnectionString>
</ConnectionBasedModelProvider>
</SourceModelProvider>
<TargetModelProvider>
<ConnectionBasedModelProvider>
<ConnectionString>Data Source=195.26.231.218;Initial Catalog=FruitBank_PROD;Integrated Security=False;Persist Security Info=False;User ID=sa;Pooling=False;Trust Server Certificate=True</ConnectionString>
<ConnectionString>Data Source=195.26.231.218;Initial Catalog=FruitBank_PROD;Integrated Security=False;Persist Security Info=False;User ID=sa;Pooling=False;Multiple Active Result Sets=False;Trust Server Certificate=True</ConnectionString>
</ConnectionBasedModelProvider>
</TargetModelProvider>
<SchemaCompareSettingsService>
@ -1105,5 +1105,13 @@
<Name>dbo</Name>
<Name>DF_fbShipping_IsAllMeasured</Name>
</SelectedItem>
<SelectedItem Type="Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlTable, Microsoft.Data.Tools.Schema.Sql, Version=170.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91">
<Name>dbo</Name>
<Name>tmp_guestsAddressesToDelete</Name>
</SelectedItem>
<SelectedItem Type="Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlTable, Microsoft.Data.Tools.Schema.Sql, Version=170.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91">
<Name>dbo</Name>
<Name>tmp_guestsToDelete</Name>
</SelectedItem>
</ExcludedTargetElements>
</SchemaComparison>