diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj
index fa4ebe42..e285db5f 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj
@@ -88,6 +88,7 @@
+
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/balance.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/balance.js
index a6375733..5197088b 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/balance.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/inventory/balance.js
@@ -1,46 +1,78 @@
const schema = {
- title: "通用代码",
+ title: "寄售库存",
type: "object",
properties: {
- project: {
- title: "项目",
- type: "string",
- readOnly: true,
- showForList: true,
- rules: [
- {
- required: true,
- },
- ],
+ id: {
+ type: "string",
+ hidden: true,
},
- value: {
- title: "值",
+ erpToLoc: {
+ title: "ERP库位",
type: "string",
- readOnly: true,
- showForList: true,
- rules: [
- {
- required: true,
- },
- ],
},
- description: {
- title: "描述",
+ lu: {
+ title: "LU零件号",
+ type: "string",
+ },
+ partCode: {
+ title: "客户零件号",
+ type: "string",
+ },
+ vinCode: {
+ title: "生产码",
+ type: "string",
+ },
+ codeType: {
+ title: "生产码类型",
+ type: "string",
+ },
+ proType: {
+ title: "发货类型",
+ type: "string",
+ },
+ qty: {
+ title: "数量",
+ type: "string",
+ },
+ shippingDate: {
+ title: "发运日期",
+ type: "string",
+ input: "date",
+ },
+ creationTime: {
+ title: "订单日期",
+ type: "string",
+ input: "date",
+ },
+ seqNumber: {
+ title: "EDI顺序号",
+ type: "string",
+ },
+ tmpe4: {
+ title: "客户订单号",
+ type: "string",
+ },
+ uniqueCode: {
+ title: "塑件唯一码",
+ type: "string",
+ },
+ matchNumber: {
+ title: "EDI总成号",
+ type: "string",
+ },
+ pjsNum: {
+ title: "PJIS生产顺序号",
+ type: "string",
+ },
+ desc: {
+ title: "备注",
type: "string",
- input: "textarea",
- showForList: true,
- rules: [
- {
- required: true,
- },
- { max: 60 },
- ],
},
},
};
-const baseUrl = "settleaccount/code-setting";
-const queryUrl = `${baseUrl}/get-list`;
+const baseUrl = "settleaccount/vmi";
+const queryUrl = `${baseUrl}/balance`;
const detailsUrl = `${baseUrl}/get/%s`;
const createUrl = `${baseUrl}/create`;
const updateUrl = `${baseUrl}/update/%s`;
@@ -62,7 +94,7 @@ export default function () {
method: queryMethod,
hasFilter: true,
schema: {
- title: "通用代码",
+ title: "寄售库存",
type: "object",
properties: {
filters: {
@@ -89,7 +121,7 @@ export default function () {
default: [
{
logic: "and",
- column: "project",
+ column: "erpToLoc",
action: "like",
value: null,
readOnly: true,
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
index 4cf373a7..a71e37cc 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
@@ -1,66 +1,145 @@
using System;
+using System.IO;
+using System.Linq;
+using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
+using Volo.Abp.AspNetCore.Uow;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
+using Win.Sfs.SettleAccount.EntityFrameworkCore;
+using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
+using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
namespace Win.Sfs.SettleAccount.Entities.BQ;
public interface IVmiService : IApplicationService, ITransientDependency, IJobService
{
- string Test();
-
void In(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message);
void Out(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message);
- Task> Query(RequestDto request);
+ void Run(string logGroupId, VmiType type);
}
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class VmiAppService : ApplicationService, IVmiService, IJobService, ITransientDependency
{
- private readonly INormalEfCoreRepository _repository;
+ private readonly INormalEfCoreRepository _balanceRepository;
+ private readonly INormalEfCoreRepository _logRepository;
+ private readonly INormalEfCoreRepository _snapshotRepository;
- public VmiAppService(INormalEfCoreRepository repository)
+ public VmiAppService(INormalEfCoreRepository balanceRepository,
+ INormalEfCoreRepository logRepository,
+ INormalEfCoreRepository snapshotRepository)
{
- this._repository = repository;
+ this._balanceRepository = balanceRepository;
+ this._logRepository = logRepository;
+ this._snapshotRepository = snapshotRepository;
}
+ ///
+ /// 定时备份
+ ///
[HttpPost]
public void Invoke()
{
+ Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/files/vmi"));
+ var date = DateTime.Now.ToString("yyyyMMddHH");
+ var connectionString = $"Data Source=wwwroot/files/vmi/{date}.db";
+ using var dbContext = new VmiSqliteContext(connectionString);
+ if (!dbContext.GetService().Exists() && dbContext.Database.EnsureCreated())
+ {
+ this._balanceRepository.AsNoTracking().ForEachAsync(o =>
+ {
+ dbContext.Set().Add(o);
+ });
+ dbContext.SaveChanges();
+ var snapshot = new VmiSnapshot { Name = date, Path = connectionString };
+ this._snapshotRepository.InsertAsync(snapshot).Wait();
+ }
Console.WriteLine($"{nameof(VmiAppService)}:{DateTime.Now}");
}
+ ///
+ /// 入库
+ ///
[HttpPost]
public void In(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message)
{
}
+ ///
+ /// 出库
+ ///
[HttpPost]
public void Out(VmiCategory category, string erpToLoc, string partCode, string lu, decimal count, object message)
{
}
+ ///
+ /// 库存事务重放
+ ///
+ ///
+ ///
+ [NonAction]
+ public void Run(string logGroupId, VmiType type)
+ {
+ }
+
+ ///
+ /// 库存余额查询
+ ///
+ ///
+ ///
[HttpPost]
- public async Task> Query(RequestDto input)
+ public async Task> Balance(RequestDto input)
{
- var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
- var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
+ var entities = await _balanceRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
+ var totalCount = await _balanceRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
//var dtos = ObjectMapper.Map, List>(entities);
return new PagedResultDto(totalCount, entities);
}
- [HttpGet]
- public string Test()
+ ///
+ /// 库存事务查询
+ ///
+ ///
+ ///
+ [HttpPost]
+ public async Task> Log(RequestDto input)
+ {
+ var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
+ var totalCount = await _logRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
+ //var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, entities);
+ }
+
+ ///
+ /// 时点库存查询
+ ///
+ /// 备份名称
+ ///
+ [HttpPost("{name}")]
+ public async Task> Backup(string name, RequestDto input)
{
- return "Test";
+ var connectionString = $"Data Source=wwwroot/files/vmi/{name}.db";
+ using var dbContext = new VmiSqliteContext(connectionString);
+ var repo = dbContext.Set();
+ var filters = input.Filters.ToLambda();
+ var query = (input.Filters.Count > 0 ? repo.Where(input.Filters.ToLambda()) : repo);
+ var totalCount = query.Count();
+ var entities = await query.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync();
+ return new PagedResultDto(totalCount, entities);
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs
index 62ea44cd..06d07496 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs
@@ -1,20 +1,18 @@
using System;
-using System.Collections.Generic;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class JobItem : Entity, IHasConcurrencyStamp
{
- public JobItem()
+ public JobItem(Guid id)
{
- this.Id = Guid.NewGuid();
+ this.Id = id;
}
public string Name { get; set; }
public string Cron { get; set; }
public string Service { get; set; }
public bool IsRunning { get; set; }
- public List Logs { get; set; } = new List();
public string ConcurrencyStamp { get; set; }
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs
index a870d1cd..f7eb6a14 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs
@@ -6,7 +6,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class JobLog : Entity
{
public JobItem Job { get; set; }
- public Guid? JobId { get; set; }
+ public Guid JobId { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public bool Success { get; set; }
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
index 87004e06..5996ed7b 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs
@@ -1,56 +1,90 @@
using System;
-using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
+///
+/// ERP库位+零件号+生产码
+///
public class VmiBalance : Entity
{
- [Display(Name = "Erp目标库位", Description = "Key")]
+ public VmiBalance(Guid id)
+ {
+ this.Id = id;
+ }
+
+ ///
+ /// Erp目标库位
+ ///
public string ErpToLoc { get; set; }
- [Display(Name = "LU零件号", Description = "Key")]
+ ///
+ /// LU零件号
+ ///
public string LU { get; set; }
- [Display(Name = "客户零件号")]
+ ///
+ /// 客户零件号
+ ///
public string PartCode { get; set; }
- [Display(Name = "生产码", Description = "Key")]
+ ///
+ /// 生产码
+ ///
+ [Display(Name = "", Description = "Key")]
public string VinCode { get; set; }
- [Display(Name = "生产码类型")]
+ ///
+ /// 生产码类型
+ ///
public string CodeType { get; set; }
- [Display(Name = "发货类型")]
+ ///
+ /// 发货类型
+ ///
public string ProType { get; set; }
- [Display(Name = "数量")]
+ ///
+ /// 数量
+ ///
public decimal Qty { get; set; }
- [Display(Name = "发运日期")]
+ ///
+ /// 发运日期
+ ///
public DateTime ShippingDate { get; set; }
- [Display(Name = "订单日期")]
+ ///
+ /// 订单日期
+ ///
public DateTime CreationTime { get; set; }
- [Display(Name = "EDI顺序号")]
+ ///
+ /// EDI顺序号
+ ///
public string SeqNumber { get; set; }
- [Display(Name = "客户订单号")]
+ ///
+ /// 客户订单号
+ ///
public string Tmpe4 { get; set; }
- [Display(Name = "塑件唯一码")]
+ ///
+ /// 塑件唯一码
+ ///
public string UniqueCode { get; set; }
- [Display(Name = "EDI总成号")]
+ ///
+ /// EDI总成号
+ ///
public string MatchNumber { get; set; }
- [Display(Name = "PJIS生产顺序号")]
+ ///
+ /// PJIS生产顺序号
+ ///
public string PjsNum { get; set; }
[Display(Name = "备注")]
public string Desc { get; set; }
-
- public List Logs { get; set; } = new List();
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiCategory.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiCategory.cs
index f2a74b63..468ab78a 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiCategory.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiCategory.cs
@@ -9,6 +9,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
///
public class VmiCategory : Entity
{
+ public VmiCategory(Guid id)
+ {
+ this.Id = id;
+ }
+
public VmiType Type { get; set; }
public string Number { get; set; }
public string Name { get; set; }
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs
index 64131caa..d5b698d6 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs
@@ -1,4 +1,5 @@
using System;
+using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
@@ -8,18 +9,162 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
///
public class VmiLog : Entity
{
+ ///
+ /// 批量操作Id
+ ///
+ public string GroupId { get; set; }
+
+ ///
+ /// 库存事务执行类型
+ ///
+ public VmiLogType VmiType { get; set; }
+
+ ///
+ /// 库存事务分类
+ ///
public Guid CategoryId { get; set; }
+
+ ///
+ /// 库存Id
+ ///
public Guid BalanceId { get; set; }
+ #region 库存备份
+
+ ///
+ /// Erp目标库位
+ ///
+ public string ErpToLoc { get; set; }
+
+ ///
+ /// LU零件号
+ ///
+ public string LU { get; set; }
+
+ ///
+ /// 客户零件号
+ ///
+ public string PartCode { get; set; }
+
+ ///
+ /// 生产码
+ ///
+ [Display(Name = "", Description = "Key")]
+ public string VinCode { get; set; }
+
+ ///
+ /// 生产码类型
+ ///
+ public string CodeType { get; set; }
+
+ ///
+ /// 发货类型
+ ///
+ public string ProType { get; set; }
+
+ ///
+ /// 数量
+ ///
+ public decimal Qty { get; set; }
+
+ ///
+ /// 发运日期
+ ///
+ public DateTime ShippingDate { get; set; }
+
+ ///
+ /// 订单日期
+ ///
+ public DateTime CreationTime { get; set; }
+
+ ///
+ /// EDI顺序号
+ ///
+ public string SeqNumber { get; set; }
+
+ ///
+ /// 客户订单号
+ ///
+ public string Tmpe4 { get; set; }
+
+ ///
+ /// 塑件唯一码
+ ///
+ public string UniqueCode { get; set; }
+
///
- /// 操作范围
+ /// EDI总成号
///
- public string SessionId { get; set; }
+ public string MatchNumber { get; set; }
+
+ ///
+ /// PJIS生产顺序号
+ ///
+ public string PjsNum { get; set; }
+
+ ///
+ /// 备注
+ ///
+ public string BalanceDesc { get; set; }
+
+ #endregion 库存备份
+ ///
+ /// 变动单号
+ ///
public string OrderNumber { get; set; }
+
+ ///
+ /// 变动时间
+ ///
public DateTime CreatedDate { get; set; } = DateTime.Now;
+
+ ///
+ /// 变动类型
+ ///
+ public string D2 { get; set; }
+
+ ///
+ /// 便动人
+ ///
public string CreatedBy { get; set; }
- public VmiOperatorType Type { get; set; }
+
+ ///
+ /// 实扣LU零件号
+ ///
+ public string F2 { get; set; }
+
+ ///
+ /// 实扣客户零件号
+ ///
+ public string G2 { get; set; }
+
+ ///
+ /// 结算LU零件号
+ ///
+ public string H2 { get; set; }
+
+ ///
+ /// 结算客户零件号
+ ///
+ public string I2 { get; set; }
+
+ ///
+ /// 实扣生产码
+ ///
+ public string J2 { get; set; }
+
+ ///
+ /// 结算生产码
+ ///
+ public string K2 { get; set; }
+
+ ///
+ /// 备注
+ ///
+ public string Desc { get; set; }
+
+ public VmiType Type { get; set; }
public VmiCategory Category { get; set; }
public VmiBalance Balance { get; set; }
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiOperatorType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiOperatorType.cs
deleted file mode 100644
index ad75bf56..00000000
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiOperatorType.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
-
-public enum VmiOperatorType
-{
- Do,
- UnDo,
- ReDo
-}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs
index ca9826a9..12af79eb 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs
@@ -9,9 +9,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
public class VmiSnapshot : Entity
{
///
- /// YYYY-MM-DD hh
+ /// 备份名称
///
public string Name { get; set; }
+ ///
+ /// 数据库文件路径
+ ///
public string Path { get; set; }
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs
index bd249098..aa47d337 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs
@@ -5,6 +5,31 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi;
///
public enum VmiType
{
+ ///
+ /// 入库
+ ///
In,
+
+ ///
+ /// 出库
+ ///
Out
}
+
+public enum VmiLogType
+{
+ ///
+ /// 初次执行
+ ///
+ Do,
+
+ ///
+ /// 撤销
+ ///
+ UnDo,
+
+ ///
+ /// 重做
+ ///
+ ReDo
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
index c3da1f4f..7582fdb3 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
@@ -15,6 +15,7 @@ using Win.Sfs.SettleAccount.Entities.Materials;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.Entities.SettleAccounts;
using Win.Sfs.SettleAccount.MaterialRelationships;
+using Win.Sfs.Shared;
using Win.Sfs.Shared.Constant;
namespace Win.Sfs.SettleAccount
@@ -519,7 +520,7 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention();
b.Property(x => x.SettleBillNum).HasMaxLength(50);
b.Property(x => x.Site).HasMaxLength(50);
-
+
b.Property(x => x.IsReturn).HasMaxLength(50);
b.Property(x => x.BillNum).HasMaxLength(50);
b.Property(x => x.InvGroupNum).HasMaxLength(50);
@@ -559,7 +560,7 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention();
b.Property(x => x.Site).HasMaxLength(50);
-
+
b.Property(x => x.IsReturn).HasMaxLength(50);
b.Property(x => x.SettleBillNum).HasMaxLength(50);
b.Property(x => x.InvGroupNum).HasMaxLength(50);
@@ -807,13 +808,10 @@ namespace Win.Sfs.SettleAccount
});
}
-
private static void ConfigurePUB_SEC_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
-
builder.Entity(b =>
{
-
b.ToTable($"{options.TablePrefix}_PUB_SEC_DETAIL", options.Schema);
b.ConfigureByConvention();
@@ -829,12 +827,11 @@ namespace Win.Sfs.SettleAccount
b.Property(x => x.ConcurrencyStamp).HasMaxLength(50);
});
}
+
private static void ConfigureHBPO_SEC_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
-
builder.Entity(b =>
{
-
b.ToTable($"{options.TablePrefix}_HBPO_SEC_DETAIL", options.Schema);
b.ConfigureByConvention();
@@ -850,12 +847,11 @@ namespace Win.Sfs.SettleAccount
b.Property(x => x.ConcurrencyStamp).HasMaxLength(50);
});
}
+
private static void ConfigureBBAC_SEC_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
-
builder.Entity(b =>
{
-
b.ToTable($"{options.TablePrefix}_BBAC_SEC_DETAIL", options.Schema);
b.ConfigureByConvention();
@@ -872,14 +868,6 @@ namespace Win.Sfs.SettleAccount
});
}
-
-
-
-
-
-
-
-
private static void ConfigureHBPO_SE_EDI(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity(b =>
@@ -1165,7 +1153,6 @@ namespace Win.Sfs.SettleAccount
private static void ConfigureVmi(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
- builder.Entity().HasData(new JobItem { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiService" });
builder.Entity(b =>
{
b.ToTable($"{options.TablePrefix}_JobItem", options.Schema);
@@ -1176,7 +1163,12 @@ namespace Win.Sfs.SettleAccount
b.Property(o => o.Cron).HasMaxLength(50).IsRequired();
b.Property(x => x.ConcurrencyStamp).HasMaxLength(50);
});
- builder.Entity().HasOne(o => o.Job).WithMany(o => o.Logs).HasForeignKey(o => o.JobId).OnDelete(DeleteBehavior.SetNull);
+
+ builder.Entity(b =>
+ {
+ b.ToTable($"{options.TablePrefix}_JobLog", options.Schema);
+ b.ConfigureByConvention();
+ });
builder.Entity(b =>
{
@@ -1185,6 +1177,7 @@ namespace Win.Sfs.SettleAccount
b.Property(o => o.Number).HasMaxLength(50).IsRequired();
b.HasIndex(o => o.Number).IsUnique();
b.Property(o => o.Name).HasMaxLength(50).IsRequired();
+ b.HasIndex(o => o.Name).IsUnique();
});
builder.Entity(b =>
@@ -1193,20 +1186,29 @@ namespace Win.Sfs.SettleAccount
b.ConfigureByConvention();
b.HasAlternateKey(o => new { o.ErpToLoc, o.PartCode, o.LU });
});
+ builder.Entity().HasData(new VmiBalance("test".ToGuid()) { ErpToLoc = "key1", PartCode = "key2", LU = "key3", Desc = "test" });
builder.Entity(b =>
{
b.ToTable($"{options.TablePrefix}_VmiLog", options.Schema);
b.ConfigureByConvention();
});
- builder.Entity().HasOne(o => o.Category).WithMany(o => o.Logs).HasForeignKey(o => o.CategoryId).OnDelete(DeleteBehavior.Cascade);
- builder.Entity().HasOne(o => o.Balance).WithMany(o => o.Logs).HasForeignKey(o => o.BalanceId).OnDelete(DeleteBehavior.Cascade);
builder.Entity(b =>
{
b.ToTable($"{options.TablePrefix}_VmiSnapshot", options.Schema);
b.ConfigureByConvention();
});
+
+ //seed
+ builder.Entity().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiService" });
+ builder.Entity().HasData(new VmiCategory("发运".ToGuid()) { Type = VmiType.In, Name = "发运", Number = "100" });
+ builder.Entity().HasData(new VmiCategory("结算".ToGuid()) { Type = VmiType.Out, Name = "结算", Number = "200" });
+ builder.Entity().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" });
+ builder.Entity().HasData(new VmiCategory("调整入库".ToGuid()) { Type = VmiType.In, Name = "调整入库", Number = "400" });
+ builder.Entity().HasData(new VmiCategory("调整出库".ToGuid()) { Type = VmiType.Out, Name = "调整出库", Number = "500" });
+ builder.Entity().HasData(new VmiCategory("漏发补货".ToGuid()) { Type = VmiType.In, Name = "漏发补货", Number = "600" });
+ builder.Entity().HasData(new VmiCategory("负库存补货".ToGuid()) { Type = VmiType.In, Name = "负库存补货", Number = "700" });
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/VmiSqliteContext.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/VmiSqliteContext.cs
new file mode 100644
index 00000000..8adf9b1e
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/VmiSqliteContext.cs
@@ -0,0 +1,26 @@
+using System;
+using Microsoft.EntityFrameworkCore;
+using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
+
+namespace Win.Sfs.SettleAccount.EntityFrameworkCore;
+
+public class VmiSqliteContext : DbContext
+{
+ private readonly string _connectionString;
+
+ public VmiSqliteContext(string connectionString)
+ {
+ this._connectionString = connectionString;
+ }
+
+ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
+ {
+ optionsBuilder.UseSqlite(this._connectionString);
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder.Entity().HasKey(o => o.Id);
+ modelBuilder.Entity().Property("BackupDate");
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.Designer.cs
new file mode 100644
index 00000000..1b5929fa
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.Designer.cs
@@ -0,0 +1,4896 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Volo.Abp.EntityFrameworkCore;
+using Win.Sfs.SettleAccount;
+
+namespace Win.Sfs.SettleAccount.Migrations
+{
+ [DbContext(typeof(SettleAccountDbContext))]
+ [Migration("20230724063308_vmi3")]
+ partial class vmi3
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
+ .HasAnnotation("Relational:MaxIdentifierLength", 128)
+ .HasAnnotation("ProductVersion", "5.0.17")
+ .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("int");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_CAN_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ContractDocID")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_CAN_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_NOT_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ContractDocID")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_NOT_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_PD_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Extend1")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend2")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend3")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend4")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RELU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("REPN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_PD_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DNBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Category")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AssemblyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BeginDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InjectionCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SeqNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ShippingDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.Property("WmsBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SE_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_EDI", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AssemblyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BeginDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Extend1")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Extend2")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Extend3")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Extend4")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InjectionCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SeqNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SE_EDI");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_REPORT", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AssemblyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BeginDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("EDIQty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InjectionCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SeqNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property