Browse Source

更新寄售库存实体

master
wanggang 1 year ago
parent
commit
31d3d07938
  1. 72
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  2. 61
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
  3. 93
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs
  4. 18
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs
  5. 8
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  6. 5035
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.Designer.cs
  7. 391
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.cs
  8. 125
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

72
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -43,7 +43,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ;
public interface IVmiService : IApplicationService, ITransientDependency, IJobService public interface IVmiService : IApplicationService, ITransientDependency, IJobService
{ {
void Change(VmiLogType logType, VmiType vmiType, string erpToLoc, string partCode, string lu, string number, decimal qty, object source, string groupId); void Change(VmiLogType logType, VmiLog data);
void UnDo(string groupId); void UnDo(string groupId);
} }
@ -167,43 +167,65 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
return Task.CompletedTask; return Task.CompletedTask;
} }
public void In(VmiLogType logType, VmiBalance data)
{
var balance = this._balanceRepository.FirstOrDefault(o => o.BillType == data.BillType &&
o.PartCode == data.PartCode &&
o.VinCode == data.VinCode &&
o.ErpToLoc == data.ErpToLoc &&
o.OrderNum == data.OrderNum);
var log = new VmiLog
{
ChangedTime = DateTime.Now,
ChangedBy = _currentUser.UserName,
};
log.InjectFrom(data);
if (balance == null)
{
balance = new VmiBalance();
balance.InjectFrom(data);
balance.SetId();
this._balanceRepository.InsertAsync(balance).Wait();
}
else
{
balance.InjectFrom(data);
this._balanceRepository.UpdateAsync(balance).Wait();
}
}
/// <summary> /// <summary>
/// 出入库 /// 出入库
/// </summary> /// </summary>
/// <param name="logType">库存事务类型</param>
/// <param name="vmiType">入库出库类型</param>
/// <param name="erpToLoc">唯一索引</param>
/// <param name="partCode">唯一索引</param>
/// <param name="lu">唯一索引</param>
/// <param name="number">关联单号</param>
/// <param name="qty">变动数量</param>
/// <param name="source">来源单据</param>
/// <param name="groupId">分组号</param>
[HttpPost] [HttpPost]
[UnitOfWork] [UnitOfWork]
public void Change(VmiLogType logType, VmiType vmiType, string erpToLoc, string partCode, string lu, string number, decimal qty, object source, string groupId) public void Change(VmiLogType logType, VmiLog data)
{ {
var balance = this._balanceRepository.FirstOrDefault(o => o.ErpToLoc == erpToLoc && o.PartCode == partCode && o.LU == lu); var balance = this._balanceRepository.FirstOrDefault(o => o.BillType == data.BillType &&
var log = new VmiLog(GuidGenerator.Create()) o.PartCode == data.PartCode &&
o.VinCode == data.VinCode &&
o.ErpToLoc == data.ErpToLoc &&
o.OrderNum == data.OrderNum);
var log = new VmiLog
{ {
CreatedTime = DateTime.Now, ChangedTime = DateTime.Now,
CreatedBy = _currentUser.UserName, ChangedBy = _currentUser.UserName,
RelationNumber = number,
Qty = qty,
ChangedType = vmiType,
LogType = logType,
GroupId = groupId
}; };
log.InjectFrom(source); log.InjectFrom(data);
log.InjectFrom(balance);
if (balance == null) if (balance == null)
{ {
balance = new VmiBalance(GuidGenerator.Create()) { ErpToLoc = erpToLoc, PartCode = partCode, LU = lu, Qty = qty }; balance = new VmiBalance();
balance.InjectFrom(source); balance.InjectFrom(data);
balance.Qty = data.Count;
balance.SetId();
this._balanceRepository.InsertAsync(balance).Wait(); this._balanceRepository.InsertAsync(balance).Wait();
} }
else else
{ {
balance.Qty += qty; var value = balance.Qty + data.Count;
balance.InjectFrom(data);
balance.Qty = value;
this._balanceRepository.UpdateAsync(balance).Wait(); this._balanceRepository.UpdateAsync(balance).Wait();
} }
this._logRepository.InsertAsync(log); this._logRepository.InsertAsync(log);
@ -217,7 +239,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran
[UnitOfWork] [UnitOfWork]
public void UnDo(string groupId) public void UnDo(string groupId)
{ {
var logs = this._logRepository.Where(o => o.GroupId == groupId).AsNoTracking(); var logs = this._logRepository.Where(o => o.GroupId == groupId).AsNoTracking().OrderBy(o => o.ChangedTime);
foreach (var item in logs) foreach (var item in logs)
{ {
//var balance = this._balanceRepository.FirstOrDefault(o => o.ErpToLoc == item.ErpToLoc&& o.PartCode == item. && o.LU == item.LogType); //var balance = this._balanceRepository.FirstOrDefault(o => o.ErpToLoc == item.ErpToLoc&& o.PartCode == item. && o.LU == item.LogType);

61
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs

@ -1,5 +1,8 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
@ -10,43 +13,47 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
/// </summary> /// </summary>
public class VmiBalance : BasicAggregateRoot<Guid> public class VmiBalance : BasicAggregateRoot<Guid>
{ {
public VmiBalance(Guid id) /// <summary>
{ /// LU零件号
this.Id = id; /// </summary>
}
[Display(Name = "ERP库位")]
public string ErpToLoc { get; set; }
[Display(Name = "LU零件号")] [Display(Name = "LU零件号")]
public string LU { get; set; }
[Display(Name = "客户零件号")]
public string PartCode { get; set; } public string PartCode { get; set; }
[Display(Name = "生产码")] [Display(Name = "生产码")]
public string VinCode { get; set; } public string VinCode { get; set; }
/// <summary>
/// 根据零件关系表匹配
/// </summary>
[Display(Name = "客户零件号")]
public string CustomerPartCode { get; set; }
[Display(Name = "生产码类型")] [Display(Name = "生产码类型")]
public EnumDeliverSubBillType DeliverSubBillType { get; set; } public string CodeType { get; set; }
[Display(Name = "发货类型")] [Display(Name = "发货类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; } public EnumDeliverBjBmpBillType BillType { get; set; }
[Display(Name = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
[Display(Name = "发运日期")] [Display(Name = "发运日期")]
public DateTime ShippingDate { get; set; } public DateTime BillTime { get; set; }
[Display(Name = "订单日期")] [Display(Name = "订单日期")]
public DateTime CreationTime { get; set; } public DateTime DeliverTime { get; set; }
/// <summary>
/// ERP库位
/// </summary>
[Display(Name = "ERP库位")]
public string ErpToLoc { get; set; }
[Display(Name = "EDI顺序号")] [Display(Name = "EDI顺序号")]
public string SeqNumber { get; set; } public string Seq { get; set; }
[Display(Name = "客户订单号")] [Display(Name = "客户订单号")]
public string CustomOrderNumber { get; set; } public string OrderNum { get; set; }
[Display(Name = "塑件唯一码")] [Display(Name = "塑件唯一码")]
public string UniqueCode { get; set; } public string UniqueCode { get; set; }
@ -57,6 +64,24 @@ public class VmiBalance : BasicAggregateRoot<Guid>
[Display(Name = "PJIS生产顺序号")] [Display(Name = "PJIS生产顺序号")]
public string PjsNum { get; set; } public string PjsNum { get; set; }
[Display(Name = "配置码")]
public string Configcode { get; set; }
[Display(Name = "工厂")]
public string factory { get; set; }
[Display(Name = "发货子类型")]
public EnumDeliverSubBillType SubBillType { get; set; }
[Display(Name = "备注")] [Display(Name = "备注")]
public string Remark { get; set; } public string ReMark { get; set; }
public VmiBalance SetId()
{
var data = new { BillType, PartCode, VinCode, ErpToLoc, OrderNum };
var json = JsonSerializer.Serialize(data);
var bytes = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(json));
this.Id = new Guid(bytes);
return this;
}
} }

93
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs

@ -19,69 +19,96 @@ public class VmiLog : BasicAggregateRoot<Guid>
this.Id = id; this.Id = id;
} }
#region 非需求显示字段 /// <summary>
/// 分组编号
[Display(Name = "分组编号")] /// </summary>
public string GroupId { get; set; } public string GroupId { get; set; }
[Display(Name = "库存事务分类")] /// <summary>
/// 库存事务分类
/// </summary>
public VmiLogType LogType { get; set; } public VmiLogType LogType { get; set; }
[Display(Name = "库存变动")] [Display(Name = "库存变动")]
public decimal Count { get; set; } public decimal Count { get; set; }
#endregion 非需求显示字段
[Display(Name = "变动单号")] [Display(Name = "变动单号")]
public string RelationNumber { get; set; } public string ChangedNumber { get; set; }
[Display(Name = "变动时间")] [Display(Name = "变动时间")]
public DateTime CreatedTime { get; set; } = DateTime.Now; public DateTime ChangedTime { get; set; } = DateTime.Now;
[Display(Name = "变动类型")] [Display(Name = "变动类型")]
public VmiType ChangedType { get; set; } public VmiType ChangedType { get; set; }
[Display(Name = "便动人")] [Display(Name = "便动人")]
public string CreatedBy { get; set; } public string ChangedBy { get; set; }
[Display(Name = "是否补货")]
public bool? IsReplenished { get; set; }
[Display(Name = "实扣LU零件号")] #region 附加信息
public string No1 { get; set; }
[Display(Name = "实扣客户零件号")] //[Display(Name = "实扣厂内零件号")]
public string No2 { get; set; } //public string PartCode { get; set; }
[Display(Name = "结算LU零件号")] [Display(Name = "结算厂内零件号")]
public string No3 { get; set; } public string PartCode2 { get; set; }
[Display(Name = "结算客户零件号")] //[Display(Name = "结算客户零件号")]
public string No4 { get; set; } //public string CustomerPartCode { get; set; }
[Display(Name = "实扣生产码")] [Display(Name = "WMS实发生产码")]
public string No5 { get; set; } public string RealCode { get; set; }
//[Display(Name = "EDI订单生产码")]
//public string VinCode { get; set; }
[Display(Name = "结算生产码")] [Display(Name = "结算生产码")]
public string No6 { get; set; } public string SettlementVinCode { get; set; }
#endregion 附加信息
#region 库存备份
[Display(Name = "LU零件号")]
public string PartCode { get; set; }
[Display(Name = "生产码")]
public string VinCode { get; set; }
/// <summary>
/// 根据零件关系表匹配
/// </summary>
[Display(Name = "客户零件号")]
public string CustomerPartCode { get; set; }
[Display(Name = "生产码类型")] [Display(Name = "生产码类型")]
public string DeliverSubBillType { get; set; } public string CodeType { get; set; }
[Display(Name = "发货类型")] [Display(Name = "发货类型")]
public EnumDeliverBjBmpBillType DeliverBillType { get; set; } public EnumDeliverBjBmpBillType BillType { get; set; }
[Display(Name = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
[Display(Name = "发运日期")] [Display(Name = "发运日期")]
public DateTime ShippingDate { get; set; } public DateTime BillTime { get; set; }
[Display(Name = "订单日期")] [Display(Name = "订单日期")]
public DateTime CreationTime { get; set; } public DateTime DeliverTime { get; set; }
[Display(Name = "ERP库位")]
public string ErpToLoc { get; set; }
[Display(Name = "EDI顺序号")] [Display(Name = "EDI顺序号")]
public string SeqNumber { get; set; } public string Seq { get; set; }
[Display(Name = "客户订单号")] [Display(Name = "客户订单号")]
public string CustomOrderNumber { get; set; } public string OrderNum { get; set; }
[Display(Name = "塑件唯一码")]
public string UniqueCode { get; set; }
[Display(Name = "EDI总成号")] [Display(Name = "EDI总成号")]
public string MatchNumber { get; set; } public string MatchNumber { get; set; }
@ -89,9 +116,17 @@ public class VmiLog : BasicAggregateRoot<Guid>
[Display(Name = "PJIS生产顺序号")] [Display(Name = "PJIS生产顺序号")]
public string PjsNum { get; set; } public string PjsNum { get; set; }
[Display(Name = "ERP库位")] [Display(Name = "配置码")]
public string ErpToLoc { get; set; } public string Configcode { get; set; }
[Display(Name = "工厂")]
public string factory { get; set; }
[Display(Name = "发货子类型")]
public EnumDeliverSubBillType SubBillType { get; set; }
[Display(Name = "备注")] [Display(Name = "备注")]
public string Desc { get; set; } public string ReMark { get; set; }
#endregion 库存备份
} }

18
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs

@ -18,24 +18,6 @@ public enum VmiType
Out Out
} }
public enum VmiLogRunType
{
/// <summary>
/// 初次执行
/// </summary>
Do,
/// <summary>
/// 撤销
/// </summary>
UnDo,
/// <summary>
/// 重做
/// </summary>
ReDo
}
public enum VmiLogType public enum VmiLogType
{ {
[Display(Name = "发运入库")] [Display(Name = "发运入库")]

8
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -1261,13 +1261,13 @@ namespace Win.Sfs.SettleAccount
// b.HasIndex(o => o.Name).IsUnique(); // b.HasIndex(o => o.Name).IsUnique();
//}); //});
builder.Entity<VmiBalance>(b => builder.Entity<VmiBalance>((Action<Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<VmiBalance>>)(b =>
{ {
b.ToTable($"{options.TablePrefix}_VmiBalance", options.Schema); b.ToTable($"{options.TablePrefix}_VmiBalance", options.Schema);
b.ConfigureByConvention(); b.ConfigureByConvention();
b.HasAlternateKey(o => new { o.ErpToLoc, o.PartCode, o.LU }); b.HasAlternateKey(o => (new { o.BillType, o.PartCode, o.VinCode, o.ErpToLoc, o.OrderNum }));
}); }));
builder.Entity<VmiBalance>().HasData(new VmiBalance("test".ToGuid()) { ErpToLoc = "key1", PartCode = "key2", LU = "key3", Remark = "test" }); builder.Entity<VmiBalance>().HasData(new VmiBalance { BillType = EnumDeliverBjBmpBillType.JIS件, PartCode = "PartCode", VinCode = "VinCode", ErpToLoc = "ErpToLoc", OrderNum = "OrderNum" }.SetId());
builder.Entity<VmiLog>(b => builder.Entity<VmiLog>(b =>
{ {

5035
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.Designer.cs

File diff suppressed because it is too large

391
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.cs

@ -0,0 +1,391 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class vmi8 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropUniqueConstraint(
name: "AK_Set_VmiBalance_ErpToLoc_PartCode_LU",
table: "Set_VmiBalance");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("cd6b8f09-2146-73d3-cade-4e832627b4f6"));
migrationBuilder.RenameColumn(
name: "ShippingDate",
table: "Set_VmiLog",
newName: "DeliverTime");
migrationBuilder.RenameColumn(
name: "SeqNumber",
table: "Set_VmiLog",
newName: "factory");
migrationBuilder.RenameColumn(
name: "RelationNumber",
table: "Set_VmiLog",
newName: "VinCode");
migrationBuilder.RenameColumn(
name: "No6",
table: "Set_VmiLog",
newName: "UniqueCode");
migrationBuilder.RenameColumn(
name: "No5",
table: "Set_VmiLog",
newName: "SettlementVinCode");
migrationBuilder.RenameColumn(
name: "No4",
table: "Set_VmiLog",
newName: "Seq");
migrationBuilder.RenameColumn(
name: "No3",
table: "Set_VmiLog",
newName: "RealCode");
migrationBuilder.RenameColumn(
name: "No2",
table: "Set_VmiLog",
newName: "ReMark");
migrationBuilder.RenameColumn(
name: "No1",
table: "Set_VmiLog",
newName: "PartCode2");
migrationBuilder.RenameColumn(
name: "Desc",
table: "Set_VmiLog",
newName: "PartCode");
migrationBuilder.RenameColumn(
name: "DeliverSubBillType",
table: "Set_VmiLog",
newName: "OrderNum");
migrationBuilder.RenameColumn(
name: "DeliverBillType",
table: "Set_VmiLog",
newName: "SubBillType");
migrationBuilder.RenameColumn(
name: "CustomOrderNumber",
table: "Set_VmiLog",
newName: "CustomerPartCode");
migrationBuilder.RenameColumn(
name: "CreationTime",
table: "Set_VmiLog",
newName: "ChangedTime");
migrationBuilder.RenameColumn(
name: "CreatedTime",
table: "Set_VmiLog",
newName: "BillTime");
migrationBuilder.RenameColumn(
name: "CreatedBy",
table: "Set_VmiLog",
newName: "Configcode");
migrationBuilder.RenameColumn(
name: "Remark",
table: "Set_VmiBalance",
newName: "ReMark");
migrationBuilder.RenameColumn(
name: "ShippingDate",
table: "Set_VmiBalance",
newName: "DeliverTime");
migrationBuilder.RenameColumn(
name: "SeqNumber",
table: "Set_VmiBalance",
newName: "factory");
migrationBuilder.RenameColumn(
name: "LU",
table: "Set_VmiBalance",
newName: "OrderNum");
migrationBuilder.RenameColumn(
name: "DeliverSubBillType",
table: "Set_VmiBalance",
newName: "SubBillType");
migrationBuilder.RenameColumn(
name: "DeliverBillType",
table: "Set_VmiBalance",
newName: "BillType");
migrationBuilder.RenameColumn(
name: "CustomOrderNumber",
table: "Set_VmiBalance",
newName: "Seq");
migrationBuilder.RenameColumn(
name: "CreationTime",
table: "Set_VmiBalance",
newName: "BillTime");
migrationBuilder.AddColumn<int>(
name: "BillType",
table: "Set_VmiLog",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "ChangedBy",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ChangedNumber",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CodeType",
table: "Set_VmiLog",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "IsReplenished",
table: "Set_VmiLog",
type: "bit",
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "VinCode",
table: "Set_VmiBalance",
type: "nvarchar(450)",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "CodeType",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Configcode",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CustomerPartCode",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddUniqueConstraint(
name: "AK_Set_VmiBalance_BillType_PartCode_VinCode_ErpToLoc_OrderNum",
table: "Set_VmiBalance",
columns: new[] { "BillType", "PartCode", "VinCode", "ErpToLoc", "OrderNum" });
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BillTime", "BillType", "CodeType", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, 0, null, "VinCode", null });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropUniqueConstraint(
name: "AK_Set_VmiBalance_BillType_PartCode_VinCode_ErpToLoc_OrderNum",
table: "Set_VmiBalance");
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"));
migrationBuilder.DropColumn(
name: "BillType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ChangedBy",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "ChangedNumber",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CodeType",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "IsReplenished",
table: "Set_VmiLog");
migrationBuilder.DropColumn(
name: "CodeType",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "Configcode",
table: "Set_VmiBalance");
migrationBuilder.DropColumn(
name: "CustomerPartCode",
table: "Set_VmiBalance");
migrationBuilder.RenameColumn(
name: "factory",
table: "Set_VmiLog",
newName: "SeqNumber");
migrationBuilder.RenameColumn(
name: "VinCode",
table: "Set_VmiLog",
newName: "RelationNumber");
migrationBuilder.RenameColumn(
name: "UniqueCode",
table: "Set_VmiLog",
newName: "No6");
migrationBuilder.RenameColumn(
name: "SubBillType",
table: "Set_VmiLog",
newName: "DeliverBillType");
migrationBuilder.RenameColumn(
name: "SettlementVinCode",
table: "Set_VmiLog",
newName: "No5");
migrationBuilder.RenameColumn(
name: "Seq",
table: "Set_VmiLog",
newName: "No4");
migrationBuilder.RenameColumn(
name: "RealCode",
table: "Set_VmiLog",
newName: "No3");
migrationBuilder.RenameColumn(
name: "ReMark",
table: "Set_VmiLog",
newName: "No2");
migrationBuilder.RenameColumn(
name: "PartCode2",
table: "Set_VmiLog",
newName: "No1");
migrationBuilder.RenameColumn(
name: "PartCode",
table: "Set_VmiLog",
newName: "Desc");
migrationBuilder.RenameColumn(
name: "OrderNum",
table: "Set_VmiLog",
newName: "DeliverSubBillType");
migrationBuilder.RenameColumn(
name: "DeliverTime",
table: "Set_VmiLog",
newName: "ShippingDate");
migrationBuilder.RenameColumn(
name: "CustomerPartCode",
table: "Set_VmiLog",
newName: "CustomOrderNumber");
migrationBuilder.RenameColumn(
name: "Configcode",
table: "Set_VmiLog",
newName: "CreatedBy");
migrationBuilder.RenameColumn(
name: "ChangedTime",
table: "Set_VmiLog",
newName: "CreationTime");
migrationBuilder.RenameColumn(
name: "BillTime",
table: "Set_VmiLog",
newName: "CreatedTime");
migrationBuilder.RenameColumn(
name: "ReMark",
table: "Set_VmiBalance",
newName: "Remark");
migrationBuilder.RenameColumn(
name: "factory",
table: "Set_VmiBalance",
newName: "SeqNumber");
migrationBuilder.RenameColumn(
name: "SubBillType",
table: "Set_VmiBalance",
newName: "DeliverSubBillType");
migrationBuilder.RenameColumn(
name: "Seq",
table: "Set_VmiBalance",
newName: "CustomOrderNumber");
migrationBuilder.RenameColumn(
name: "OrderNum",
table: "Set_VmiBalance",
newName: "LU");
migrationBuilder.RenameColumn(
name: "DeliverTime",
table: "Set_VmiBalance",
newName: "ShippingDate");
migrationBuilder.RenameColumn(
name: "BillType",
table: "Set_VmiBalance",
newName: "DeliverBillType");
migrationBuilder.RenameColumn(
name: "BillTime",
table: "Set_VmiBalance",
newName: "CreationTime");
migrationBuilder.AlterColumn<string>(
name: "VinCode",
table: "Set_VmiBalance",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AddUniqueConstraint(
name: "AK_Set_VmiBalance_ErpToLoc_PartCode_LU",
table: "Set_VmiBalance",
columns: new[] { "ErpToLoc", "PartCode", "LU" });
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "CreationTime", "CustomOrderNumber", "DeliverBillType", "DeliverSubBillType", "ErpToLoc", "LU", "MatchNumber", "PartCode", "PjsNum", "Qty", "Remark", "SeqNumber", "ShippingDate", "UniqueCode", "VinCode" },
values: new object[] { new Guid("cd6b8f09-2146-73d3-cade-4e832627b4f6"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, 0, 0, "key1", "key3", null, "key2", null, 0m, "test", null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), null, null });
}
}
}

125
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -3958,29 +3958,35 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime") b.Property<DateTime>("BillTime")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<string>("CustomOrderNumber") b.Property<int>("BillType")
.HasColumnType("int");
b.Property<string>("CodeType")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<int>("DeliverBillType") b.Property<string>("Configcode")
.HasColumnType("int"); .HasColumnType("nvarchar(max)");
b.Property<int>("DeliverSubBillType") b.Property<string>("CustomerPartCode")
.HasColumnType("int"); .HasColumnType("nvarchar(max)");
b.Property<string>("ErpToLoc") b.Property<DateTime>("DeliverTime")
.IsRequired() .HasColumnType("datetime2");
.HasColumnType("nvarchar(450)");
b.Property<string>("LU") b.Property<string>("ErpToLoc")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("nvarchar(450)");
b.Property<string>("MatchNumber") b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("OrderNum")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("PartCode") b.Property<string>("PartCode")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("nvarchar(450)");
@ -3991,40 +3997,44 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<decimal>("Qty") b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)"); .HasColumnType("decimal(18,2)");
b.Property<string>("Remark") b.Property<string>("ReMark")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("SeqNumber") b.Property<string>("Seq")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("ShippingDate") b.Property<int>("SubBillType")
.HasColumnType("datetime2"); .HasColumnType("int");
b.Property<string>("UniqueCode") b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("VinCode") b.Property<string>("VinCode")
.IsRequired()
.HasColumnType("nvarchar(450)");
b.Property<string>("factory")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.HasKey("Id"); b.HasKey("Id");
b.HasAlternateKey("ErpToLoc", "PartCode", "LU"); b.HasAlternateKey("BillType", "PartCode", "VinCode", "ErpToLoc", "OrderNum");
b.ToTable("Set_VmiBalance"); b.ToTable("Set_VmiBalance");
b.HasData( b.HasData(
new new
{ {
Id = new Guid("cd6b8f09-2146-73d3-cade-4e832627b4f6"), Id = new Guid("ea936b34-ecd0-7dbd-85a9-57cd8b730873"),
CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
DeliverBillType = 0, BillType = 1,
DeliverSubBillType = 0, DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ErpToLoc = "key1", ErpToLoc = "ErpToLoc",
LU = "key3", OrderNum = "OrderNum",
PartCode = "key2", PartCode = "PartCode",
Qty = 0m, Qty = 0m,
Remark = "test", SubBillType = 0,
ShippingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) VinCode = "VinCode"
}); });
}); });
@ -4034,77 +4044,92 @@ namespace Win.Sfs.SettleAccount.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier"); .HasColumnType("uniqueidentifier");
b.Property<int>("ChangedType") b.Property<DateTime>("BillTime")
.HasColumnType("datetime2");
b.Property<int>("BillType")
.HasColumnType("int"); .HasColumnType("int");
b.Property<decimal>("Count") b.Property<string>("ChangedBy")
.HasColumnType("decimal(18,2)"); .HasColumnType("nvarchar(max)");
b.Property<string>("CreatedBy") b.Property<string>("ChangedNumber")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("CreatedTime") b.Property<DateTime>("ChangedTime")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<DateTime>("CreationTime") b.Property<int>("ChangedType")
.HasColumnType("datetime2"); .HasColumnType("int");
b.Property<string>("CustomOrderNumber") b.Property<string>("CodeType")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<int>("DeliverBillType") b.Property<string>("Configcode")
.HasColumnType("int");
b.Property<string>("DeliverSubBillType")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("Desc") b.Property<decimal>("Count")
.HasColumnType("decimal(18,2)");
b.Property<string>("CustomerPartCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("DeliverTime")
.HasColumnType("datetime2");
b.Property<string>("ErpToLoc") b.Property<string>("ErpToLoc")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("GroupId") b.Property<string>("GroupId")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<bool?>("IsReplenished")
.HasColumnType("bit");
b.Property<int>("LogType") b.Property<int>("LogType")
.HasColumnType("int"); .HasColumnType("int");
b.Property<string>("MatchNumber") b.Property<string>("MatchNumber")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No1") b.Property<string>("OrderNum")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No2") b.Property<string>("PartCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No3") b.Property<string>("PartCode2")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No4") b.Property<string>("PjsNum")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No5") b.Property<decimal>("Qty")
.HasColumnType("decimal(18,2)");
b.Property<string>("ReMark")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("No6") b.Property<string>("RealCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("PjsNum") b.Property<string>("Seq")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<decimal>("Qty") b.Property<string>("SettlementVinCode")
.HasColumnType("decimal(18,2)"); .HasColumnType("nvarchar(max)");
b.Property<string>("RelationNumber") b.Property<int>("SubBillType")
.HasColumnType("int");
b.Property<string>("UniqueCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("SeqNumber") b.Property<string>("VinCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<DateTime>("ShippingDate") b.Property<string>("factory")
.HasColumnType("datetime2"); .HasColumnType("nvarchar(max)");
b.HasKey("Id"); b.HasKey("Id");

Loading…
Cancel
Save