Seeder hataları düzeltildi.
This commit is contained in:
parent
77b040e528
commit
e024ebeafd
15 changed files with 2439 additions and 2444 deletions
|
|
@ -38,7 +38,7 @@ public class EmployeeDto : FullAuditedEntityDto<Guid>
|
|||
public Guid? EmploymentTypeId { get; set; }
|
||||
public EmploymentTypeDto EmploymentType { get; set; }
|
||||
|
||||
public Guid? JobPositionId { get; set; }
|
||||
public string? JobPositionId { get; set; }
|
||||
public JobPositionDto JobPosition { get; set; }
|
||||
|
||||
public Guid? DepartmentId { get; set; }
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ using Volo.Abp.Application.Dtos;
|
|||
|
||||
namespace Erp.Platform.Intranet;
|
||||
|
||||
public class EmploymentTypeDto : FullAuditedEntityDto<Guid>
|
||||
public class EmploymentTypeDto : FullAuditedEntityDto<string>
|
||||
{
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,17 +12,14 @@ public class ExpenseDto : FullAuditedEntityDto<Guid>
|
|||
|
||||
public string Category { get; set; }
|
||||
public decimal Amount { get; set; }
|
||||
|
||||
public string Currency { get; set; }
|
||||
|
||||
public DateTime RequestDate { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Project { get; set; }
|
||||
public string Status { get; set; }
|
||||
|
||||
public Guid? ApproverId { get; set; }
|
||||
public EmployeeDto Approver { get; set; }
|
||||
|
||||
public DateTime? ApprovalDate { get; set; }
|
||||
public string RejectionReason { get; set; }
|
||||
public string Notes { get; set; }
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ using Volo.Abp.Application.Dtos;
|
|||
|
||||
namespace Erp.Platform.Intranet;
|
||||
|
||||
public class JobPositionDto : FullAuditedEntityDto<Guid>
|
||||
public class JobPositionDto : FullAuditedEntityDto<string>
|
||||
{
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ public static class LookupQueryValues
|
|||
|
||||
public static string CountryValues =
|
||||
$"SELECT " +
|
||||
$"\"Code\" AS \"Key\", " +
|
||||
$"\"Id\" AS \"Key\", " +
|
||||
$"\"Name\" AS \"Name\" " +
|
||||
$"FROM \"{FullNameTable(TableNameEnum.Country)}\" " +
|
||||
$"WHERE \"IsDeleted\" = 'false' " +
|
||||
|
|
@ -126,7 +126,7 @@ public static class LookupQueryValues
|
|||
|
||||
public static string CityValues =
|
||||
$"SELECT " +
|
||||
$"\"Code\" AS \"Key\", " +
|
||||
$"\"Name\" AS \"Key\", " +
|
||||
$"\"Name\" AS \"Name\" " +
|
||||
$"FROM \"{FullNameTable(TableNameEnum.City)}\" " +
|
||||
$"WHERE " +
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ namespace Erp.Platform.Public;
|
|||
|
||||
public class CityDto : AuditedEntityDto<Guid>
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string PlateCode { get; set; }
|
||||
public string Country { get; set; }
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ namespace Erp.Platform.Public;
|
|||
|
||||
public class CountryDto : AuditedEntityDto<Guid>
|
||||
{
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string GroupName { get; set; }
|
||||
public string Currency { get; set; }
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -282,14 +282,14 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
await foreach (var item in JsonSerializer.DeserializeAsyncEnumerable<CountryDto>(fs, options))
|
||||
{
|
||||
if (item == null) continue;
|
||||
if (string.IsNullOrWhiteSpace(item.Code)) continue; // boş kodları atla
|
||||
if (string.IsNullOrWhiteSpace(item.Name)) continue; // boş kodları atla
|
||||
|
||||
// hem DB’de hem JSON içinde duplicate engelle
|
||||
if (!seenCodes.Add(item.Code) || existingCodes.Contains(item.Code))
|
||||
if (!seenCodes.Add(item.Name) || existingCodes.Contains(item.Name))
|
||||
continue;
|
||||
|
||||
buffer.Add(new Country(
|
||||
item.Code,
|
||||
item.Name,
|
||||
item.Name,
|
||||
item.GroupName,
|
||||
item.Currency,
|
||||
|
|
@ -325,11 +325,11 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
// 1. Mevcut kayıtları çek (tek sorguda)
|
||||
var existingCities = await dbCtx.Set<City>()
|
||||
.Select(d => new { d.Name })
|
||||
.Select(d => new { d.Country, d.Name })
|
||||
.ToListAsync();
|
||||
|
||||
var existingSet = existingCities
|
||||
.Select(d => d.Name)
|
||||
.Select(d => $"{d.Country}.{d.Name}")
|
||||
.ToHashSet();
|
||||
|
||||
var options = new JsonSerializerOptions
|
||||
|
|
@ -405,14 +405,13 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
{
|
||||
if (item == null) continue;
|
||||
|
||||
var key = $"{item.Country}:{item.Country}.{item.City}:{item.Name}:{item.Township}";
|
||||
var city = $"{item.Country}.{item.City}";
|
||||
var key = $"{item.Country}:{item.City}:{item.Name}:{item.Township}";
|
||||
if (existingSet.Contains(key)) continue;
|
||||
|
||||
buffer.Add(new District(
|
||||
Guid.NewGuid(),
|
||||
item.Country,
|
||||
city,
|
||||
item.City,
|
||||
item.Name,
|
||||
item.Township
|
||||
));
|
||||
|
|
|
|||
|
|
@ -557,12 +557,12 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
ColumnOptionJson = DefaultColumnOptionJson,
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 650, true, true, true, true, false),
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 800, 500, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
|
||||
new() { Order=1, ColCount=2, ColSpan=1, ItemType="group", Items =
|
||||
[
|
||||
new EditingFormItemDto { Order=1, DataField = "TenantId", ColSpan=1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order=1, DataField = "TenantId", ColSpan=2, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order=2, DataField = "Code", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=3, DataField = "Name", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=4, DataField = "VknTckn", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxNumberBox },
|
||||
|
|
@ -573,17 +573,17 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
new EditingFormItemDto { Order=9, DataField = "IsActive", ColSpan=1, IsRequired=false, EditorType2=EditorTypes.dxCheckBox },
|
||||
]
|
||||
},
|
||||
new() { Order=2, ColCount=1, ColSpan=1, ItemType="group", Items =
|
||||
new() { Order=2, ColCount=2, ColSpan=1, ItemType="group", Items =
|
||||
[
|
||||
new EditingFormItemDto { Order=1, DataField = "Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order=2, DataField = "City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order=3, DataField = "District", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order=4, DataField = "Township", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order=5, DataField = "Address1", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=6, DataField = "Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=7, DataField = "PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=8, DataField = "Email", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=9, DataField = "Website", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=1, DataField = "Country", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order=2, DataField = "City", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order=3, DataField = "District", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order=4, DataField = "Township", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order=5, DataField = "Address1", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextArea },
|
||||
new EditingFormItemDto { Order=6, DataField = "Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextArea },
|
||||
new EditingFormItemDto { Order=7, DataField = "Email", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=8, DataField = "Website", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=9, DataField = "PostalCode", ColSpan=1, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
]
|
||||
}
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -948,7 +948,7 @@ public class PlatformDbContext :
|
|||
b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Country)), Prefix.DbSchema);
|
||||
b.ConfigureByConvention();
|
||||
|
||||
b.Property(x => x.Id).HasMaxLength(8);
|
||||
b.Property(x => x.Id).HasMaxLength(128);
|
||||
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
|
||||
b.Property(x => x.GroupName).HasMaxLength(128);
|
||||
b.Property(x => x.TaxLabel).HasMaxLength(64);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
|||
namespace Erp.Platform.Migrations
|
||||
{
|
||||
[DbContext(typeof(PlatformDbContext))]
|
||||
[Migration("20251212092917_Initial")]
|
||||
[Migration("20251212132226_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
@ -2453,7 +2453,7 @@ namespace Erp.Platform.Migrations
|
|||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<string>("CountryId")
|
||||
.HasColumnType("nvarchar(8)");
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
|
|
@ -3376,8 +3376,8 @@ namespace Erp.Platform.Migrations
|
|||
modelBuilder.Entity("Erp.Platform.Entities.Country", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(8)
|
||||
.HasColumnType("nvarchar(8)");
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
|
|
@ -4039,7 +4039,7 @@ namespace Erp.Platform.Migrations
|
|||
name: "Sas_H_Country",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: false),
|
||||
Id = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
||||
GroupName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
||||
Currency = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: false),
|
||||
|
|
@ -4678,7 +4678,7 @@ namespace Erp.Platform.Migrations
|
|||
Country = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
||||
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
||||
PlateCode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
CountryId = table.Column<string>(type: "nvarchar(8)", nullable: true),
|
||||
CountryId = table.Column<string>(type: "nvarchar(128)", nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
|
|
@ -2450,7 +2450,7 @@ namespace Erp.Platform.Migrations
|
|||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<string>("CountryId")
|
||||
.HasColumnType("nvarchar(8)");
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
|
|
@ -3373,8 +3373,8 @@ namespace Erp.Platform.Migrations
|
|||
modelBuilder.Entity("Erp.Platform.Entities.Country", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasMaxLength(8)
|
||||
.HasColumnType("nvarchar(8)");
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
|
|
|
|||
|
|
@ -2696,7 +2696,7 @@
|
|||
"name": "İnsan Kaynakları",
|
||||
"description": "İnsan kaynakları departmanı masrafları",
|
||||
"costCenterType": "Support",
|
||||
"parentCostCenterName": null,
|
||||
"parentCostCenterName": "Genel Yönetim",
|
||||
"responsibleEmployeeCode": "EMP-001",
|
||||
"departmentName": "İdari İşler",
|
||||
"budgetedAmount": 1800000,
|
||||
|
|
@ -2826,7 +2826,7 @@
|
|||
"name": "Müşteri Hizmetleri",
|
||||
"description": "Müşteri hizmetleri masrafları",
|
||||
"costCenterType": "Service",
|
||||
"parentCostCenterName": null,
|
||||
"parentCostCenterName": "Genel Yönetim",
|
||||
"responsibleEmployeeCode": "EMP-003",
|
||||
"departmentName": "İdari İşler",
|
||||
"budgetedAmount": 1000000,
|
||||
|
|
@ -4871,7 +4871,7 @@
|
|||
"faultTypeName": "Mekanik",
|
||||
"priority": "High",
|
||||
"severity": "High",
|
||||
"title": "Motor Aşırı Titreşim",
|
||||
"name": "Motor Aşırı Titreşim",
|
||||
"description": "CNC torna tezgahında motor aşırı titreşim yapıyor. Ses seviyesi normalden yüksek ve hassas işlemlerde problem yaşanıyor.",
|
||||
"assignedTo": "Mehmet Kaya - Mekanik Ekibi",
|
||||
"status": "Açık",
|
||||
|
|
@ -4885,7 +4885,7 @@
|
|||
"faultTypeName": "Elektrik",
|
||||
"priority": "Urgent",
|
||||
"severity": "Critical",
|
||||
"title": "Elektrik Panosu Arızası",
|
||||
"name": "Elektrik Panosu Arızası",
|
||||
"description": "Kompresör elektrik panosunda kısa devre meydana geldi. Sistem tamamen durdu.",
|
||||
"assignedTo": "Ahmet Yılmaz - Elektrik Ekibi",
|
||||
"status": "Kapandı",
|
||||
|
|
@ -4901,7 +4901,7 @@
|
|||
"faultTypeName": "Performans",
|
||||
"priority": "Normal",
|
||||
"severity": "Medium",
|
||||
"title": "Kayış Gerilimi Azaldı",
|
||||
"name": "Kayış Gerilimi Azaldı",
|
||||
"description": "Konveyör kayışında gevşeme tespit edildi. Hız düşüklüğü gözlemleniyor.",
|
||||
"status": "Onarımda",
|
||||
"estimatedRepairTime": 60,
|
||||
|
|
@ -4914,7 +4914,7 @@
|
|||
"faultTypeName": "Yazılım",
|
||||
"priority": "High",
|
||||
"severity": "High",
|
||||
"title": "Program Kalibrasyon Hatası",
|
||||
"name": "Program Kalibrasyon Hatası",
|
||||
"description": "Robot kaynak pozisyonlarında sapma var. Kalibrasyon gerekiyor.",
|
||||
"assignedTo": "Sema Korkmaz - Robot Teknisyeni",
|
||||
"status": "İnceleniyor",
|
||||
|
|
@ -4928,7 +4928,7 @@
|
|||
"faultTypeName": "Hidrolik",
|
||||
"priority": "Low",
|
||||
"severity": "Low",
|
||||
"title": "Yağ Sızıntısı",
|
||||
"name": "Yağ Sızıntısı",
|
||||
"description": "Hidrolik sistem borularında hafif yağ sızıntısı tespit edildi.",
|
||||
"status": "Açık",
|
||||
"estimatedRepairTime": 45,
|
||||
|
|
|
|||
Loading…
Reference in a new issue