Browse Source

修改 编辑

集成Redis
郑勃旭 1 year ago
parent
commit
4cf1698b90
  1. 8
      WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/AppBase/CreateUpdateBaseDto/CreateUpdateBaseDto.cs
  2. 9
      WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/AppBase/FasterBaseDto/FasterAuditedEntityBaseDto.cs
  3. 10
      WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/AppBase/FasterBaseDto/FasterCreateUpdateBaseDto.cs
  4. 3
      WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/Z_Business/StoreWorkOrder/Dtos/CreateUpdateStoreWorkOrderDto.cs
  5. 3
      WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/Z_Business/StoreWorkOrder/Dtos/StoreWorkOrderDto.cs
  6. 3
      WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/Z_Business/StoreWorkOrderDetail/Dtos/CreateUpdateStoreWorkOrderDetailDto.cs
  7. 84
      WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.EntityFrameworkCore/EntityFrameworkCore/WmsDbContext.cs

8
WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/AppBase/CreateUpdateBaseDto/CreateUpdateBaseDto.cs

@ -1,8 +0,0 @@
using System;
using Volo.Abp.Application.Dtos;
namespace WinIn.FasterZ.Wms.AppBase.CreateUpdateBaseDto;
public class CreateUpdateBaseDto : EntityDto<Guid>
{
}

9
WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/AppBase/FasterBaseDto/FasterAuditedEntityBaseDto.cs

@ -0,0 +1,9 @@
using System;
using Volo.Abp.Application.Dtos;
namespace WinIn.FasterZ.Wms.AppBase.FasterBaseDto;
public class FasterAuditedEntityBaseDto : AuditedEntityDto<Guid>
{
public string ConcurrencyStamp { get; set; }
}

10
WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/AppBase/FasterBaseDto/FasterCreateUpdateBaseDto.cs

@ -0,0 +1,10 @@
using System;
namespace WinIn.FasterZ.Wms.AppBase.FasterBaseDto;
public class FasterCreateUpdateBaseDto
{
public Guid Id { get; set; }
public string ConcurrencyStamp { get; set; }
}

3
WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/Z_Business/StoreWorkOrder/Dtos/CreateUpdateStoreWorkOrderDto.cs

@ -1,4 +1,5 @@
using System;
using WinIn.FasterZ.Wms.AppBase.CreateUpdateBaseDto;
namespace WinIn.FasterZ.Wms.Z_Business.StoreWorkOrder.Dtos;
@ -9,7 +10,7 @@ using WinIn.FasterZ.Wms.Z_Business.StoreWorkOrderDetail;
using WinIn.FasterZ.Wms.Z_Business.StoreWorkOrderDetail.Dtos;
[Serializable]
public class CreateUpdateStoreWorkOrderDto
public class CreateUpdateStoreWorkOrderDto: CreateUpdateBaseDto
{
public DateTime ActiveDate { get; set; }

3
WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/Z_Business/StoreWorkOrder/Dtos/StoreWorkOrderDto.cs

@ -1,5 +1,6 @@
using System;
using Volo.Abp.Application.Dtos;
using WinIn.FasterZ.Wms.AppBase.FasterBaseDto;
using WinIn.FasterZ.Wms.Z_Business.StoreWorkOrderDetail.Dtos;
namespace WinIn.FasterZ.Wms.Z_Business.StoreWorkOrder.Dtos;
@ -10,7 +11,7 @@ using WinIn.FasterZ.Wms.Permissions;
using WinIn.FasterZ.Wms.Z_Business.StoreWorkOrderDetail;
[Serializable]
public class StoreWorkOrderDto : AuditedEntityDto<Guid>
public class StoreWorkOrderDto : FasterAuditedEntityBaseDto<Guid>
{
public DateTime ActiveDate { get; set; }

3
WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.Application.Contracts/Z_Business/StoreWorkOrderDetail/Dtos/CreateUpdateStoreWorkOrderDetailDto.cs

@ -3,10 +3,11 @@ using WinIn.FasterZ.Wms.Z_Business.StoreWorkOrder.Dtos;
namespace WinIn.FasterZ.Wms.Z_Business.StoreWorkOrderDetail.Dtos;
using WinIn.FasterZ.Wms.AppBase.CreateUpdateBaseDto;
using WinIn.FasterZ.Wms.Permissions;
[Serializable]
public class CreateUpdateStoreWorkOrderDetailDto
public class CreateUpdateStoreWorkOrderDetailDto: CreateUpdateBaseDto
{
public DateTime EffectiveDate { get; set; }

84
WinIn.FasterZ.Wms.Be/WinIn.FasterZ.Wms/WinIn.FasterZ.Wms/src/WinIn.FasterZ.Wms.EntityFrameworkCore/EntityFrameworkCore/WmsDbContext.cs

@ -1,3 +1,7 @@
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
@ -970,14 +974,14 @@ namespace WinIn.FasterZ.Wms.EntityFrameworkCore
///
/// </summary>
public DbSet<AuthMenu> AuthMenus { get; set; }
/// <summary>
///
/// </summary>
public DbSet<StoreTransferNote> StoreTransferNotes { get; set; }
/// <summary>
///
/// </summary>
public DbSet<StoreTransferNoteDetail> StoreTransferNoteDetails { get; set; }
/// <summary>
///
/// </summary>
public DbSet<StoreTransferNote> StoreTransferNotes { get; set; }
/// <summary>
///
/// </summary>
public DbSet<StoreTransferNoteDetail> StoreTransferNoteDetails { get; set; }
public WmsDbContext(DbContextOptions<WmsDbContext> options)
: base(options)
@ -2106,7 +2110,7 @@ namespace WinIn.FasterZ.Wms.EntityFrameworkCore
});
builder.Entity<StoreCountNote>(b =>
{
@ -3188,24 +3192,58 @@ namespace WinIn.FasterZ.Wms.EntityFrameworkCore
});
builder.Entity<StoreTransferNote>(b =>
{
b.ToTable(WmsConsts.DbTablePrefix + "Store_TransferNote", WmsConsts.DbSchema, table => table.HasComment(""));
b.ConfigureByConvention();
builder.Entity<StoreTransferNote>(b =>
{
b.ToTable(WmsConsts.DbTablePrefix + "Store_TransferNote", WmsConsts.DbSchema, table => table.HasComment(""));
b.ConfigureByConvention();
/* Configure more properties here */
});
/* Configure more properties here */
});
builder.Entity<StoreTransferNoteDetail>(b =>
{
b.ToTable(WmsConsts.DbTablePrefix + "Store_TransferNoteDetail", WmsConsts.DbSchema, table => table.HasComment(""));
b.ConfigureByConvention();
builder.Entity<StoreTransferNoteDetail>(b =>
{
b.ToTable(WmsConsts.DbTablePrefix + "Store_TransferNoteDetail", WmsConsts.DbSchema, table => table.HasComment(""));
b.ConfigureByConvention();
/* Configure more properties here */
});
/* Configure more properties here */
});
}
public override int SaveChanges()
{
this.ChangeTracker.DetectChanges();
var modity = this.ChangeTracker.Entries().Where(x => x.State == EntityState.Modified || x.State == EntityState.Added).Select(x => x.Entity).ToList();
foreach (var item in modity)
{
item?.GetType().GetProperty("ConcurrencyStamp")?.SetValue(item, Guid.NewGuid().ToString());
}
return base.SaveChanges();
}
public override Task<int> SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = new CancellationToken())
{
this.ChangeTracker.DetectChanges();
var modity = this.ChangeTracker.Entries().Where(x => x.State == EntityState.Modified || x.State == EntityState.Added).Select(x => x.Entity).ToList();
foreach (var item in modity)
{
item?.GetType().GetProperty("ConcurrencyStamp")?.SetValue(item, Guid.NewGuid().ToString());
}
return base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken);
}
public override Task<int> SaveChangesOnDbContextAsync(bool acceptAllChangesOnSuccess,
CancellationToken cancellationToken = new CancellationToken())
{
this.ChangeTracker.DetectChanges();
var modity = this.ChangeTracker.Entries().Where(x => x.State == EntityState.Modified || x.State == EntityState.Added).Select(x => x.Entity).ToList();
foreach (var item in modity)
{
item?.GetType().GetProperty("ConcurrencyStamp")?.SetValue(item, Guid.NewGuid().ToString());
}
return base.SaveChangesOnDbContextAsync(acceptAllChangesOnSuccess, cancellationToken);
}
}
}

Loading…
Cancel
Save