Aggiunta migration fabbisogni

This commit is contained in:
Samuele Locatelli
2026-04-16 17:52:58 +02:00
parent 35eab707a4
commit 39a534b727
13 changed files with 4731 additions and 16 deletions
@@ -54,7 +54,6 @@
<ItemGroup>
<Folder Include="DbModel\Engine\" />
<Folder Include="Migrations\" />
<Folder Include="Warehouse\" />
<Folder Include="Services\Supplier\" />
</ItemGroup>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,164 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EgwCoreLib.Lux.Data.Migrations
{
/// <inheritdoc />
public partial class AddMatReq_01 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OrderRowData",
table: "buy_order_row");
migrationBuilder.CreateTable(
name: "warehouse_material_req",
columns: table => new
{
MatReqID = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
OrderRowID = table.Column<int>(type: "int", nullable: false),
Inserted = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ItemID = table.Column<int>(type: "int", nullable: false),
Qty = table.Column<double>(type: "double", nullable: false),
Processed = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_warehouse_material_req", x => x.MatReqID);
table.ForeignKey(
name: "FK_warehouse_material_req_item_item_ItemID",
column: x => x.ItemID,
principalTable: "item_item",
principalColumn: "ItemID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_warehouse_material_req_sales_order_row_OrderRowID",
column: x => x.OrderRowID,
principalTable: "sales_order_row",
principalColumn: "OrderRowID",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "buy_order_row_2_mat_req",
columns: table => new
{
BuyOrderRowID = table.Column<int>(type: "int", nullable: false),
MatReqID = table.Column<int>(type: "int", nullable: false),
Qty = table.Column<double>(type: "double", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_buy_order_row_2_mat_req", x => new { x.BuyOrderRowID, x.MatReqID });
table.ForeignKey(
name: "FK_buy_order_row_2_mat_req_buy_order_row_BuyOrderRowID",
column: x => x.BuyOrderRowID,
principalTable: "buy_order_row",
principalColumn: "BuyOrderRowID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_buy_order_row_2_mat_req_warehouse_material_req_MatReqID",
column: x => x.MatReqID,
principalTable: "warehouse_material_req",
principalColumn: "MatReqID",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "sales_offer",
keyColumn: "OfferID",
keyValue: 1,
column: "ValidUntil",
value: new DateTime(2026, 5, 14, 18, 15, 21, 979, DateTimeKind.Local).AddTicks(4906));
migrationBuilder.UpdateData(
table: "sales_offer",
keyColumn: "OfferID",
keyValue: 2,
column: "ValidUntil",
value: new DateTime(2026, 5, 14, 18, 15, 21, 979, DateTimeKind.Local).AddTicks(4920));
migrationBuilder.UpdateData(
table: "sales_offer",
keyColumn: "OfferID",
keyValue: 3,
column: "ValidUntil",
value: new DateTime(2026, 5, 14, 18, 15, 21, 979, DateTimeKind.Local).AddTicks(4927));
migrationBuilder.UpdateData(
table: "sales_offer",
keyColumn: "OfferID",
keyValue: 4,
column: "ValidUntil",
value: new DateTime(2026, 5, 14, 18, 15, 21, 979, DateTimeKind.Local).AddTicks(4934));
migrationBuilder.CreateIndex(
name: "IX_buy_order_row_2_mat_req_MatReqID",
table: "buy_order_row_2_mat_req",
column: "MatReqID");
migrationBuilder.CreateIndex(
name: "IX_warehouse_material_req_ItemID",
table: "warehouse_material_req",
column: "ItemID");
migrationBuilder.CreateIndex(
name: "IX_warehouse_material_req_OrderRowID",
table: "warehouse_material_req",
column: "OrderRowID");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "buy_order_row_2_mat_req");
migrationBuilder.DropTable(
name: "warehouse_material_req");
migrationBuilder.AddColumn<string>(
name: "OrderRowData",
table: "buy_order_row",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "sales_offer",
keyColumn: "OfferID",
keyValue: 1,
column: "ValidUntil",
value: new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7042));
migrationBuilder.UpdateData(
table: "sales_offer",
keyColumn: "OfferID",
keyValue: 2,
column: "ValidUntil",
value: new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7058));
migrationBuilder.UpdateData(
table: "sales_offer",
keyColumn: "OfferID",
keyValue: 3,
column: "ValidUntil",
value: new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7064));
migrationBuilder.UpdateData(
table: "sales_offer",
keyColumn: "OfferID",
keyValue: 4,
column: "ValidUntil",
value: new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7071));
}
}
}
@@ -2219,7 +2219,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
RefNum = 1,
RefRev = 1,
RefYear = 2025,
ValidUntil = new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7042)
ValidUntil = new DateTime(2026, 5, 14, 18, 15, 21, 979, DateTimeKind.Local).AddTicks(4906)
},
new
{
@@ -2239,7 +2239,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
RefNum = 2,
RefRev = 1,
RefYear = 2025,
ValidUntil = new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7058)
ValidUntil = new DateTime(2026, 5, 14, 18, 15, 21, 979, DateTimeKind.Local).AddTicks(4920)
},
new
{
@@ -2259,7 +2259,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
RefNum = 3,
RefRev = 1,
RefYear = 2025,
ValidUntil = new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7064)
ValidUntil = new DateTime(2026, 5, 14, 18, 15, 21, 979, DateTimeKind.Local).AddTicks(4927)
},
new
{
@@ -2279,7 +2279,7 @@ namespace EgwCoreLib.Lux.Data.Migrations
RefNum = 4,
RefRev = 1,
RefYear = 2025,
ValidUntil = new DateTime(2026, 5, 14, 12, 24, 22, 268, DateTimeKind.Local).AddTicks(7071)
ValidUntil = new DateTime(2026, 5, 14, 18, 15, 21, 979, DateTimeKind.Local).AddTicks(4934)
});
});
@@ -3400,6 +3400,24 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.ToTable("buy_order");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Supplier.BuyOrderRow2MatReqModel", b =>
{
b.Property<int>("BuyOrderRowID")
.HasColumnType("int");
b.Property<int>("MatReqID")
.HasColumnType("int");
b.Property<double>("Qty")
.HasColumnType("double");
b.HasKey("BuyOrderRowID", "MatReqID");
b.HasIndex("MatReqID");
b.ToTable("buy_order_row_2_mat_req");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Supplier.BuyOrderRowModel", b =>
{
b.Property<int>("BuyOrderRowID")
@@ -3426,10 +3444,6 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Property<int>("ItemID")
.HasColumnType("int");
b.Property<string>("OrderRowData")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RowNum")
.HasColumnType("int");
@@ -3772,6 +3786,38 @@ namespace EgwCoreLib.Lux.Data.Migrations
});
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Warehouse.MatReqModel", b =>
{
b.Property<int>("MatReqID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("MatReqID"));
b.Property<DateTime>("Inserted")
.HasColumnType("datetime(6)");
b.Property<int>("ItemID")
.HasColumnType("int");
b.Property<int>("OrderRowID")
.HasColumnType("int");
b.Property<bool>("Processed")
.HasColumnType("tinyint(1)");
b.Property<double>("Qty")
.HasColumnType("double");
b.HasKey("MatReqID");
b.HasIndex("ItemID");
b.HasIndex("OrderRowID");
b.ToTable("warehouse_material_req");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Catalog.TemplateRowModel", b =>
{
b.HasOne("EgwCoreLib.Lux.Data.DbModel.Items.SellingItemModel", "SellingItemNav")
@@ -4160,6 +4206,25 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Navigation("SupplierNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Supplier.BuyOrderRow2MatReqModel", b =>
{
b.HasOne("EgwCoreLib.Lux.Data.DbModel.Supplier.BuyOrderRowModel", "BuyOrderRowNav")
.WithMany("MatReqNav")
.HasForeignKey("BuyOrderRowID")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("EgwCoreLib.Lux.Data.DbModel.Warehouse.MatReqModel", "MatReqNav")
.WithMany("BuyOrderRowNav")
.HasForeignKey("MatReqID")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("BuyOrderRowNav");
b.Navigation("MatReqNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Supplier.BuyOrderRowModel", b =>
{
b.HasOne("EgwCoreLib.Lux.Data.DbModel.Supplier.BuyOrderModel", "BuyOrderNav")
@@ -4209,6 +4274,25 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Navigation("GenClassNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Warehouse.MatReqModel", b =>
{
b.HasOne("EgwCoreLib.Lux.Data.DbModel.Items.ItemModel", "ItemNav")
.WithMany()
.HasForeignKey("ItemID")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("EgwCoreLib.Lux.Data.DbModel.Sales.OrderRowModel", "OrderRowNav")
.WithMany()
.HasForeignKey("OrderRowID")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("ItemNav");
b.Navigation("OrderRowNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Catalog.TemplateModel", b =>
{
b.Navigation("TemplateRowNav");
@@ -4266,6 +4350,11 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Navigation("BuyOrderRowNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Supplier.BuyOrderRowModel", b =>
{
b.Navigation("MatReqNav");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Supplier.SupplierModel", b =>
{
b.Navigation("QualifNav");
@@ -4282,6 +4371,11 @@ namespace EgwCoreLib.Lux.Data.Migrations
b.Navigation("JobTasks");
});
modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.Warehouse.MatReqModel", b =>
{
b.Navigation("BuyOrderRowNav");
});
#pragma warning restore 612, 618
}
}
@@ -2,6 +2,7 @@
{
public interface IMatReqRepository : IBaseRepository
{
#region Public Methods
/// <summary>
/// Inserisce un nuovo record MatReq nel database.
@@ -41,5 +42,7 @@
/// </summary>
/// <param name="entity">Record aggiornato</param>
Task<bool> UpdateAsync(MatReqModel entity);
#endregion Public Methods
}
}
}
@@ -16,7 +16,7 @@
#endregion Public Constructors
#region Public Methods
/// <inheritdoc />
public async Task<OrderModel?> CloneOfferAsync(OfferModel rec2clone)
{
@@ -0,0 +1,58 @@
namespace EgwCoreLib.Lux.Data.Warehouse
{
public interface IMatReqService
{
#region Public Methods
#if false
/// <summary>
/// Inserisce un nuovo record MatReq nel database.
/// </summary>
/// <param name="entity">Record da inserire</param>
Task<bool> AddAsync(MatReqModel entity);
/// <summary>
/// Inserisce una lista di record MatReq nel database.
/// </summary>
/// <param name="entity">Record da inserire</param>
Task<bool> AddManyAsync(List<MatReqModel> listEntity);
/// <summary>
/// Eliminazione record
/// </summary>
/// <param name="rec2del"></param>
/// <returns></returns>
Task<bool> DeleteAsync(MatReqModel model);
/// <summary>
/// Recupera un record MatReq specifico per ID.
/// </summary>
/// <param name="recId">ID dell'MatReq da recuperare</param>
Task<MatReqModel?> GetByIdAsync(int recId);
/// <summary>
/// Recupera gli MatReq filtrati per uno o pù criteri
/// </summary>
/// <param name="orderID">ID dell'Ordine Cliente di riferimento</param>
/// <param name="orderRowID">ID della Riga Ordine Cliente di riferimento</param>
/// <param name="itemID">ID dell'item ordinato</param>
/// <param name="processed">true = solo processati / false = solo aperti / null = tutti</param>
Task<List<MatReqModel>> GetFiltAsync(int? orderID, int? orderRowID, int? itemID, bool? processed);
/// <summary>
/// Aggiorna un record MatReq esistente nel database.
/// </summary>
/// <param name="entity">Record aggiornato</param>
Task<bool> UpdateAsync(MatReqModel entity);
#endif
/// <summary>
/// Genera un set di MatReq da una lista di ID di RigheOrdine
/// </summary>
/// <param name="ListOrderRow">Lista OrderRow da processare</param>
/// <returns></returns>
Task<bool> UpsertManyAsync(List<OrderRowModel> ListOrderRow);
#endregion Public Methods
}
}
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.Warehouse
{
internal class MatReqService
{
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>1.1.2604.1417</Version>
<Version>1.1.2604.1418</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
<Version>1.1.2604.1417</Version>
<Version>1.1.2604.1418</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>LUX - Web Windows MES</i>
<h4>Versione: 1.1.2604.1417</h4>
<h4>Versione: 1.1.2604.1418</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.1.2604.1417
1.1.2604.1418
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.1.2604.1417</version>
<version>1.1.2604.1418</version>
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>