diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs index 870438e5..be39022a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; +using Microsoft.AspNetCore.Http; using Volo.Abp.Application.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; @@ -96,6 +97,23 @@ public class BBAC_SA_DETAIL_DTO : EntityDto public string PartCode { get; set; } } +/// +/// BBAC结算导入请求 +/// +public class BBACSaImportRequestDto +{ + /// + /// 文件 + /// + public IFormFileCollection Files { get; set; } + + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } +} + /// /// BBAC结算明细导入 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs index 346f0f81..9ef68a97 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; +using Microsoft.AspNetCore.Http; using Volo.Abp.Application.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; @@ -96,6 +97,23 @@ public class HBPO_SA_DETAIL_DTO : EntityDto public string PartCode { get; set; } } +/// +/// HBPO结算导入请求 +/// +public class HBPOSaImportRequestDto +{ + /// + /// 文件 + /// + public IFormFileCollection Files { get; set; } + + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } +} + /// /// HBPO结算明细导入 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs index 72829407..3359c5d0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs @@ -244,6 +244,13 @@ public class BeiJianImportDto : BeiJianExtraImportDto [ImporterHeader(Name = "凭证号")] [Required(ErrorMessage = "{0}不能为空")] public string GroupNum { get; set; } + + /// + /// 采购订单号 + /// + [Display(Name = "采购订单号")] + [ImporterHeader(Name = "采购订单号")] + public string Extend3 { get; set; } } /// @@ -286,13 +293,6 @@ public class BeiJianExtraImportDto [ImporterHeader(Name = "供应商名称")] public string VendorName { set; get; } - /// - /// 采购订单号 - /// - [Display(Name = "采购订单号")] - [ImporterHeader(Name = "采购订单号")] - public string PurchaseOrderNumber { set; get; } - /// /// 交付索引号 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs index 7f9fbd09..2456f978 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs @@ -126,11 +126,6 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships /// 文件 /// public IFormFileCollection Files { get; set; } - - /// - /// 是否是备件 - /// - public bool IsBj { get; set; } } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs index 97594bae..b407ca7e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs @@ -111,11 +111,11 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase /// 导入 /// [HttpPost] - public async Task ImportAsync([FromForm] IFormFileCollection files) + public async Task ImportAsync([FromForm] BBACSaImportRequestDto bbacSaImportRequestDto) { #region 导入数据转换、数据校验 ExportImporter _exportImporter = new ExportImporter(); - var importDtos = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); + var importDtos = await _exportImporter.UploadExcelImport(bbacSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false); importDtos.ForEach(importDto => { @@ -127,6 +127,11 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase var importBBACSaDetails = ObjectMapper.Map, List>(importDtos); + importBBACSaDetails.ForEach(importBBACSaDetail => + { + importBBACSaDetail.Version = bbacSaImportRequestDto.Version; + }); + //数据校验 var checkList = new List(); //结算分组号 @@ -269,7 +274,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase } if (bbacSaDetails.Any()) { - await _bbacSaDetailRepository.DeleteManyAsync(bbacSaDetails); + await _bbacSaDetailRepository.DbContext.BulkDeleteAsync(bbacSaDetails); } if (bbacCanSas.Any()) { @@ -277,11 +282,11 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase } if (bbacCanSaDetails.Any()) { - await _bbacCanSaDetailRepository.DeleteManyAsync(bbacCanSaDetails); + await _bbacCanSaDetailRepository.DbContext.BulkDeleteAsync(bbacCanSaDetails); } if (bbacNotSaDetails.Any()) { - await _bbacNotSaDetailRepository.DeleteManyAsync(bbacNotSaDetails); + await _bbacNotSaDetailRepository.DbContext.BulkDeleteAsync(bbacNotSaDetails); } } #endregion @@ -358,7 +363,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase noExistSettleMaterialCodes.ForEach(t => { - var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType.ToString()); + var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType); materialRelationships.Add(materialRelationship); }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs index 448995f5..d54de401 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs @@ -109,13 +109,18 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase /// 导入 /// [HttpPost] - public async Task ImportAsync([FromForm] IFormFileCollection files) + public async Task ImportAsync([FromForm] HBPOSaImportRequestDto hbpoSaImportRequestDto) { #region 导入数据转换、数据校验 ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + var result = await _exportImporter.UploadExcelImport(hbpoSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false); var importHBOPSaDetails = ObjectMapper.Map, List>(result); + importHBOPSaDetails.ForEach(importHBOPSaDetail => + { + importHBOPSaDetail.Version = hbpoSaImportRequestDto.Version; + }); + //Site包含CN1 亦庄 //Site包含CN5 顺义 var importCN1HBOPSaDetails = importHBOPSaDetails.FindAll(t => t.Site.Contains("CN1")); @@ -267,7 +272,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase } if (hbpoSaDetails.Any()) { - await _hbpoSaDetailRepository.DeleteManyAsync(hbpoSaDetails); + await _hbpoSaDetailRepository.DbContext.BulkDeleteAsync(hbpoSaDetails); } if (hbpoCanSas.Any()) { @@ -275,11 +280,11 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase } if (hbpoCanSaDetails.Any()) { - await _hbpoCanSaDetailRepository.DeleteManyAsync(hbpoCanSaDetails); + await _hbpoCanSaDetailRepository.DbContext.BulkDeleteAsync(hbpoCanSaDetails); } if (hbpoNotSaDetails.Any()) { - await _hbpoNotSaDetailRepository.DeleteManyAsync(hbpoNotSaDetails); + await _hbpoNotSaDetailRepository.DbContext.BulkDeleteAsync(hbpoNotSaDetails); } } #endregion @@ -358,14 +363,14 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase noExistSettleMaterialCodes.ForEach(t => { - var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType.ToString()); + var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType); materialRelationships.Add(materialRelationship); }); var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships); hbpoSaDetails.ForEach(hbpoSaDetail => { - hbpoSaDetail.PartCode = seAllMaterialRelationships.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.LU)?.ErpMaterialCode ?? hbpoSaDetail.LU.Replace(" ", "-"); + hbpoSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.LU)?.ErpMaterialCode ?? hbpoSaDetail.LU.Replace(" ", "-"); }); #endregion diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs index 7f637fa7..adc0e448 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs @@ -522,7 +522,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase noExistSettleMaterialCodes.ForEach(t => { - var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, businessType.ToString()); + var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, businessType); materialRelationships.Add(materialRelationship); }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs index ed7cc862..3ff636a0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs @@ -23,11 +23,12 @@ public class JisBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobService /// public JisBBACSeSyncAppService( WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository jisSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService - ) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) { base.SeSyncConfigInfo = new SeSyncConfig() { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs index bcc55d54..e456b53f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs @@ -26,6 +26,11 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable /// private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; + /// + /// 数据上下文 + /// + private readonly SettleAccountDbContext _settleAccountDbContext; + /// /// 同步位置标记 /// @@ -48,12 +53,14 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable /// public JisBBACSeSyncBaseAppService( WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository jisSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService) { _wmsBJBMPTContext = wmsBJBMPTContext; + _settleAccountDbContext = settleAccountDbContext; _syncPositionFlagRepository = syncPositionFlagRepository; _jisSeDetailRepository = jisSeDetailRepository; _materialRelationshipManager = materialRelationshipManager; @@ -73,7 +80,7 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable return; } await SyncJitRecordAsync().ConfigureAwait(false); - await CurrentUnitOfWork.SaveChangesAsync().ConfigureAwait(false); + await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); await SyncJisRecordAsync().ConfigureAwait(false); } @@ -107,8 +114,8 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); if (luRePartCodes.Any()) { - var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); - await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); + var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType)); + await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); } jisSeDetails.ForEach(t => @@ -116,8 +123,12 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable t.SetId(GuidGenerator.Create()); t.BusinessType = businessType; t.KeyCode = t.PN + t.LU; + if (t.BillTime != null) + { + t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); + } }); - await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); + await _settleAccountDbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); if (syncPositionFlag != null) { @@ -166,8 +177,8 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); if (luRePartCodes.Any()) { - var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); - await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); + var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType)); + await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); } jisSeDetails.ForEach(t => @@ -175,8 +186,12 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable t.SetId(GuidGenerator.Create()); t.BusinessType = businessType; t.KeyCode = t.PN + t.LU; + if (t.BillTime != null) + { + t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); + } }); - await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); + await _settleAccountDbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); if (syncPositionFlag != null) { @@ -194,4 +209,24 @@ public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable } } } + + /// + /// 添加零件关系 + /// + public async Task AddNewMaterialRelationships(IEnumerable materialRelationships) + { + //新客户零件号和厂内零件号 + var noHaveLuRePartCodes = from item1 in materialRelationships + join item2 in _settleAccountDbContext.Set() + on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode } + into temp + from item3 in temp.DefaultIfEmpty() + where item3 == null + select item1; + + if (noHaveLuRePartCodes.Any()) + { + await _settleAccountDbContext.BulkInsertAsync(noHaveLuRePartCodes.ToList()).ConfigureAwait(false); + } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs index d3c28620..9fe7d292 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs @@ -23,11 +23,12 @@ public class JisHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService /// public JisHBPOSeSyncAppService( WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository jisSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService - ) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) { base.SeSyncConfigInfo = new SeSyncConfig() { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs index a1724a51..cd12dd2f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs @@ -27,6 +27,11 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable /// private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; + /// + /// 数据上下文 + /// + private readonly SettleAccountDbContext _settleAccountDbContext; + /// /// 同步位置标记 /// @@ -49,12 +54,14 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable /// public JisHBPOSeSyncBaseAppService( WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository jisSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService) { _wmsBJBMPTContext = wmsBJBMPTContext; + _settleAccountDbContext = settleAccountDbContext; _syncPositionFlagRepository = syncPositionFlagRepository; _jisSeDetailRepository = jisSeDetailRepository; _materialRelationshipManager = materialRelationshipManager; @@ -74,7 +81,7 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable return; } await SyncJitRecordAsync().ConfigureAwait(false); - await CurrentUnitOfWork.SaveChangesAsync().ConfigureAwait(false); + await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); await SyncJisRecordAsync().ConfigureAwait(false); } @@ -109,8 +116,8 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); if (luRePartCodes.Any()) { - var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); - await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); + var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType)); + await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); } jisSeDetails.ForEach(t => @@ -118,8 +125,12 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable t.SetId(GuidGenerator.Create()); t.BusinessType = businessType; t.KeyCode = t.PN + t.LU; + if (t.BillTime != null) + { + t.Version = int.Parse(t.BillTime?.ToString("YYYYMM")); + } }); - await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); + await _settleAccountDbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); if (syncPositionFlag != null) { @@ -169,8 +180,8 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable var luRePartCodes = jisSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); if (luRePartCodes.Any()) { - var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); - await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); + var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType)); + await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); } jisSeDetails.ForEach(t => @@ -178,8 +189,12 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable t.SetId(GuidGenerator.Create()); t.BusinessType = businessType; t.KeyCode = t.PN + t.LU; + if (t.BillTime != null) + { + t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); + } }); - await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); + await _settleAccountDbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false); if (syncPositionFlag != null) { @@ -193,8 +208,28 @@ public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable TableName = syncTableName, Position = wmsRecords.Last().UID.ToString() }; - await _syncPositionFlagRepository.InsertAsync(syncPositionFlag).ConfigureAwait(false); ; + await _syncPositionFlagRepository.InsertAsync(syncPositionFlag).ConfigureAwait(false); } } } + + /// + /// 添加零件关系 + /// + public async Task AddNewMaterialRelationships(IEnumerable materialRelationships) + { + //新客户零件号和厂内零件号 + var noHaveLuRePartCodes = from item1 in materialRelationships + join item2 in _settleAccountDbContext.Set() + on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode } + into temp + from item3 in temp.DefaultIfEmpty() + where item3 == null + select item1; + + if (noHaveLuRePartCodes.Any()) + { + await _settleAccountDbContext.BulkInsertAsync(noHaveLuRePartCodes.ToList()).ConfigureAwait(false); + } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs index f22b31bd..3ba2d666 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs @@ -103,13 +103,17 @@ public class JitSeSyncAppService : ApplicationService, IInvocable var pubSeDetails = ObjectMapper.Map, List>(wmsSeRecords); if (pubSeDetails.Any()) { - //客户零件号和厂内零件号 - var luRePartCodes = pubSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); - if (luRePartCodes.Any()) + if (businessType != EnumBusinessType.BeiJian) { - var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString())); - await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); - //await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); + //备件以外其他业务添加客户零件号与厂内零件号关系 + //客户零件号和厂内零件号 + var luRePartCodes = pubSeDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); + if (luRePartCodes.Any()) + { + var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType)); + await this.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); + //await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); + } } pubSeDetails.ForEach(t => @@ -117,6 +121,10 @@ public class JitSeSyncAppService : ApplicationService, IInvocable t.SetId(GuidGenerator.Create()); t.BusinessType = businessType; t.KeyCode = t.PN + t.LU; + if (t.BillTime != null) + { + t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); + } }); await _settleAccountDbContext.BulkInsertAsync(pubSeDetails).ConfigureAwait(false); @@ -147,7 +155,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable CodeType = default, BillType = pubSeDetail.DeliverBillType, Qty = pubSeDetail.Qty, - BillTime = pubSeDetail.BillTime, + BillTime = pubSeDetail.BillTime ?? new DateTime(), DeliverTime = pubSeDetail.AssembleData, ErpToLoc = pubSeDetail.ToErpLocCode, Seq = default, @@ -173,7 +181,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable CodeType = default, BillType = pubSeDetail.DeliverBillType, Qty = pubSeDetail.Qty, - BillTime = pubSeDetail.BillTime, + BillTime = pubSeDetail.BillTime ?? new DateTime(), DeliverTime = pubSeDetail.DnBillTime, ErpToLoc = pubSeDetail.ToErpLocCode, Seq = default, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs index 196d7178..68b632b5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs @@ -23,11 +23,12 @@ public class MaiDanBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobServi /// public MaiDanBBACSeSyncAppService( WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository jisSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService - ) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) { base.SeSyncConfigInfo = new SeSyncConfig() { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs index d7080fce..570bbfe7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs @@ -23,11 +23,12 @@ public class MaiDanHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobServi /// public MaiDanHBPOSeSyncAppService( WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, INormalEfCoreRepository syncPositionFlagRepository, INormalEfCoreRepository jisSeDetailRepository, MaterialRelationshipManager materialRelationshipManager, VmiAppService vmiService - ) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService) { base.SeSyncConfigInfo = new SeSyncConfig() { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/FISes/FISAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/FISes/FISAppService.cs deleted file mode 100644 index 50786880..00000000 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/FISes/FISAppService.cs +++ /dev/null @@ -1,569 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using EFCore.BulkExtensions; -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Csv; -using Magicodes.ExporterAndImporter.Excel; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Caching.Distributed; -using Shouldly; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Caching; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Guids; -using Volo.Abp.ObjectMapping; -using Volo.Abp.Uow; -using Win.Abp.Snowflakes; -using Win.Sfs.BaseData.ImportExcelCommon; -using Win.Sfs.SettleAccount.CommonManagers; -using Win.Sfs.SettleAccount.Constant; -using Win.Sfs.SettleAccount.Entities.CodeSettings; -using Win.Sfs.SettleAccount.Entities.ImportMap; -using Win.Sfs.SettleAccount.ExcelImporter; -using Win.Sfs.SettleAccount.ExportReports; - -using Win.Sfs.SettleAccount.MaterialRelationships; -using Win.Sfs.Shared.CacheBase; -using Win.Sfs.Shared.Enums.SettleAccount; -using Win.Sfs.Shared.Filter; -using Win.Utils; - -namespace Win.Sfs.SettleAccount.FISes -{ - /// - /// 区域相关应用服务 - /// - //[Authorize(SettleAccountPermissions.FISs.Default)] - //[AllowAnonymous] - [ApiExplorerSettings(IgnoreApi = true)] - [Route("api/settleaccount/fis")] - public class FISAppService : SettleAccountApplicationBase, IFISAppService - { - private readonly IExcelImportAppService _excelImportService; - private readonly ISettleAccountBranchEfCoreRepository _repository; - private readonly ISettleAccountBranchEfCoreRepository _preBatchRepository; - private readonly ISettleAccountBranchEfCoreRepository _extendRepository; - private readonly ISettleAccountBranchEfCoreRepository _versionRepository; - private readonly ISettleAccountBranchEfCoreRepository _relrepository; - private readonly ISettleAccountBranchEfCoreRepository _importRepository; - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public FISAppService(IGuidGenerator guidGenerator, - IObjectMapper objectMapper, - ISettleAccountBranchEfCoreRepository repository, - ISettleAccountBranchEfCoreRepository versionRepository, - ISettleAccountBranchEfCoreRepository extendRepository, - ISettleAccountBranchEfCoreRepository preBatchRepository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager, - ISettleAccountBranchEfCoreRepository relrepository, - ISettleAccountBranchEfCoreRepository importRepository - ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) - { - _versionRepository = versionRepository; - _repository = repository; - _excelImportService = excelImportService; - _extendRepository = extendRepository; - _preBatchRepository = preBatchRepository; - _relrepository = relrepository; - _importRepository = importRepository; - } - - /// - /// 导入功能 - /// - /// 上传的文件(前端已经限制只能上传一个附件) - /// - [HttpPost] - [Route("ExcelImport")] - [DisableRequestSizeLimit] - - public async Task FISUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory, string model, DateTime? beginDate, DateTime? endDate) - { - - // List _errorList = new List(); - if (string.IsNullOrEmpty(model) || beginDate == null || endDate == null) - { - throw new BusinessException("8989", "产线、开始时间和结束时间、不能为空!"); - } - List _setls = new List(); - List _extendls = new List(); - var _id = GuidGenerator.Create(); - var _prelist = await _preBatchRepository.GetAllAsync(GuidGenerator.Create()); - var _chList= await _relrepository.GetAllAsync(GuidGenerator.Create(), true); - var _chls= _chList.Select(p => p.ShipMaterailCode).Distinct(); - var checkList = new List(); - foreach (var file in files) - { - - using (TextReader textReader = new StreamReader(file.OpenReadStream())) - { - - int i = 0; - while (true) - { - string str = await textReader.ReadLineAsync(); - if (string.IsNullOrEmpty(str)) - { - break; - } - else - { - try - { - var _lst = str.Split(new char[] { ';' }).ToList(); - var orderBillNum = _lst[0]; - var materialCode = _lst[1]; - var qty = decimal.Parse(_lst[2]); - var cp5 = DateTime.Parse(_lst[3]); - var fisYear = cp5.Year.ToString(); - var extend1 = model; - var sequenceNumber = _lst[6]; - var chassisNumber = _lst[7]; - var kenncode = string.Empty; - var chassisNumber2 = string.Empty; - EnumSettleStatus state = EnumSettleStatus.未结算; - if (orderBillNum.Length == 10) - { - kenncode = orderBillNum.Substring(2 , 7); - } - if (chassisNumber.Length != 18) - { - chassisNumber2 = chassisNumber.Substring(9, 8); - } - var kenn = _prelist.Where(p => p.KENNCode == kenncode).FirstOrDefault(); - if (kenn != null) - { - if ((int)EnumSettleStatus.预批量 == kenn.State) - { - state = EnumSettleStatus.预批量; - } - } - if (beginDate.Value < cp5 && cp5 < endDate.Value) - { - var _fisId = GuidGenerator.Create(); - var fis = new FIS( - _fisId, - branchId, - year, - period, - extend1, - chassisNumber, - qty, - cp5, - sequenceNumber, - orderBillNum, - materialCode, - fisYear, - _id, - kenncode, - chassisNumber2, - state, - DateTime.Now, - 0, - version, - DateTime.Now, - GuidGenerator.Create(), - beginDate == null ? DateTime.Now : beginDate.Value, - endDate == null ? DateTime.Now : endDate.Value, - string.Empty - ); - fis.SetModel(model); - _setls.Add(fis); - } - } - catch - { - } - } - i++; - } - textReader.Close(); - } - } - - - - - var _copyls= _setls.GroupBy(x =>new { x.ChassisNumber2, x.Version, x.Model, x.ItemCode }).Select(y => y.First()).ToList(); - - var _l = _copyls.Select(p => p.ItemCode).Distinct(); - - var _notls= _l.Where(p=>!_chls.Contains(p)).ToList(); - foreach (var itm in _notls) - { - checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm, string.Empty, string.Format("关系表中不存在发运物料号{0}!", itm), string.Empty)); - } - if (checkList.Count > 0) - { - return await ExportErrorReportAsync(checkList); - } - if (_copyls != null && _copyls.Count > 0) - { - foreach (var itm in _copyls) - { - var fisextend = new FISExtend( - itm.Id, - branchId, - year, - period, - itm.Extend1, - itm.ChassisNumber, - itm.Qty, - itm.CP5Time, - itm.SequenceNumber, - itm.OrderBillNum, - itm.ItemCode, - itm.FISYear, - itm.ParentId, - itm.KENNCode, - itm.ChassisNumber2, - itm.State, - DateTime.Now, - 0, - version, - DateTime.Now, - GuidGenerator.Create(), - beginDate == null ? DateTime.Now : beginDate.Value, - endDate == null ? DateTime.Now : endDate.Value, - string.Empty - - ); - fisextend.SetModel(model); - - _extendls.Add(fisextend); - } - } - var _versionQuery = _versionRepository.Where(p => p.Version == version && p.Model == model); - await _versionQuery.BatchDeleteAsync(); - var _query = _repository.Where(p => p.Version == version && p.Model == model); - await _query.BatchDeleteAsync(); - var _extendQuery = _extendRepository.Where(p => p.Version == version && p.Model == model); - await _extendQuery.BatchDeleteAsync(); - await _repository.GetDbContext().BulkInsertAsync(_copyls); - await _extendRepository.GetDbContext().BulkInsertAsync(_extendls); - FISVersion _version = new FISVersion(_id, branchId, year, period, version, customerCode, factory, model, beginDate.Value, endDate.Value); - var _ls = new List(); - _ls.Add(_version); - await _versionRepository.GetDbContext().BulkInsertAsync(_ls); - return ApplicationConsts.SuccessStr; - } - /// - /// 按ID获取唯一实体 - /// - /// - /// 返回实体全部属性 - /// - /// ID - /// 实体DTO - [HttpGet] - [Route("{id}")] - - virtual public async Task GetAsync(Guid id) - { - var result = await GetFromCacheAsync(id); - var dto = ObjectMapper.Map(result); - return dto; - } - - private async Task GetFromCacheAsync(Guid id) - { - var result = await _repository.GetAsync(id); - - - return result; - } - - - private async Task GetCountAsync(FISRequestDto input) - { - return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); - } - - private async Task GetCountAsync(FISVersionRequestDto input) - { - return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); - } - - - /// - /// 根据筛选条件获取实体列表 - /// - /// - /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 - /// - /// 请求条件 - /// 实体DTO列表 - [HttpPost] - [Route("list")] - // [Authorize(SettleAccountPermissions.FISs.Default)] - virtual public async Task> GetListAsync(Guid parendid,FISRequestDto input) - { - //if (input.ParentId != Guid.Empty) - //{ - // input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version.ToString() }); - //} - //else - //{ - // return new PagedResultDto(0, new List()); - //} - var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,input.SkipCount, true); - var totalCount = await GetCountAsync(input); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } - - - /// - /// 根据筛选条件获取实体列表 - /// - /// - /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 - /// - /// 请求条件 - /// 实体DTO列表 - [HttpPost] - [Route("list_th")] - // [Authorize(SettleAccountPermissions.FISs.Default)] - virtual public async Task> GetListTHAsync(Guid parendid, FISRequestDto input) - { - //if (input.ParentId != Guid.Empty) - //{ - // input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); - //} - //else - //{ - // return new PagedResultDto(0, new List()); - //} - var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); - var totalCount = await GetCountAsync(input); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } - - - - - - - - /// - /// 获取实体总数 - /// - /// 实体总数 - [HttpGet] - [Route("count")] - - virtual public async Task GetTotalCountAsync(Guid branchId) - { - return await _repository.GetCountAsync(branchId); - } - - /// - /// 获取全部实体列表 - /// - /// 实体DTO列表 - [HttpGet] - [Route("all")] - - virtual public async Task> GetAllAsync(Guid branchId) - { - var entities = await _repository.GetAllAsync(branchId, true); - var dtos = ObjectMapper.Map, List>(entities); - return new ListResultDto(dtos); - } - - - - - - - /// - /// 删除实体 - /// - /// ID - /// - [HttpDelete] - [Route("{id}")] - - virtual public async Task DeleteAsync(Guid id) - { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(id); - } - - /// - /// 按IDs删除实体列表 - /// - /// IDs - /// 是否执行成功 - [HttpPost] - [Route("delete")] - - virtual public async Task DeleteListAsync(List ids) - { - foreach (var id in ids) - { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); - } - return await _repository.DeleteListAsync(ids); - } - - /// - /// 版本列表 - /// - /// - /// - [HttpPost] - [Route("listversion")] - - public async Task> GetVersionListAsync(FISVersionRequestDto input) - { - var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - input.SkipCount, true); - - var totalCount = await GetCountAsync(input); - var dtos = ObjectMapper.Map, List>(entities); - foreach (var itm in dtos) - { - itm.Version = itm.Version + string.Format("({0})", itm.Model); - } - return new PagedResultDto(totalCount, dtos); - } - - - - - /// - /// 根据筛选条件获取实体列表 - /// - /// - /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 - /// - /// 请求条件 - /// 实体DTO列表 - [HttpPost] - [Route("duplicate")] - - [UnitOfWork(isTransactional: false)] - - public async Task UPdateFisAsync() - { - await _repository.GetDbContext().Database.ExecuteSqlRawAsync( - "EXEC sp_fis_remove_duplicate" - ); - return true; - } - - - - - - - - - - - /// - /// 导出文件 - /// - /// - /// - [HttpPost] - [Route("Export")] - virtual public async Task ExportAsync(FISRequestDto input) - { - - IExporter _csv = new CsvExporter(); - - IExporter _excel = new ExcelExporter(); - if (input.ParentId != Guid.Empty) - { - input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); - } - - var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - 0, true); - - var dtoDetails = ObjectMapper.Map, List>(entities); - - string _fileName = string.Empty; - //声明导出容器 - - byte[] result = null; - switch (input.FileType) - { - case 0: - _fileName = string.Format("大众FIS_{0}.csv", input.UserId.ToString()); - result = await _csv.ExportAsByteArray(dtoDetails); - break; - case 1: - _fileName = string.Format("大众FIS_{0}.xlsx", input.UserId.ToString()); - result = await _excel.ExportAsByteArray(dtoDetails); - break; - } - result.ShouldNotBeNull(); - - //保存导出文件到服务器存成二进制 - await _excelImportService.SaveBlobAsync( - new SaveExcelImportInputDto - { - Name = _fileName, - Content = result - } - ); - return _fileName; - } - //[HttpPost] - //[Route("ExportJob")] - //[Authorize(SettleAccountPermissions.FISs.Default)] - //public Task ExportFile(string taskid,string fileName) - //{ - - // return Task.CompletedTask; - //} - //[HttpPost] - //[Route("NotifyJob")] - //[Authorize(SettleAccountPermissions.FISs.Default)] - //public async Task SendNotify(string taskid,string fileName, string realFileName) - //{ - // return "str"; - //} - //[HttpPost] - //[Route("ImportJob")] - //[Authorize(SettleAccountPermissions.Materials.Default)] - //public async Task ImportFile(string taskid,string fileName,string realFileName) - //{ - // IExcelImporter _importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter(); - // //await _importer.Import(path); - // return string.Empty; - - //} - - } -} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs index d62f87a5..fe67b1ee 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs @@ -79,16 +79,15 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase p.ErpMaterialCode == itm.ErpMaterialCode); + var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode && p.BusinessType == EnumBusinessType.BeiJian); if (_first != null) { - _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode); - _first.Remark = materialRelationshipImportRequestDto.IsBj ? "BJ" : ""; + _first.Update(itm.MaterialDesc, itm.SettleMaterialCode); await _repository.UpdateAsync(_first); } else { - itm.Remark = materialRelationshipImportRequestDto.IsBj ? "BJ" : ""; + itm.BusinessType = EnumBusinessType.BeiJian; await _repository.InsertAsync(itm); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs deleted file mode 100644 index 0f056a6f..00000000 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs +++ /dev/null @@ -1,580 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Distributed; -using AutoMapper; -using System.Linq; -using System.Text; -using Volo.Abp.Guids; -using Volo.Abp.Application.Services; -using Volo.Abp.Caching; - -using Volo.Abp.ObjectMapping; -using Win.Sfs.SettleAccount.ExcelImporter; -using Win.Sfs.Shared.CacheBase; -using Win.Utils; -using Volo.Abp.Application.Dtos; -using Win.Sfs.BaseData.ImportExcelCommon; -using Volo.Abp.Domain.Repositories; -using EFCore.BulkExtensions; -using System.IO; -using Microsoft.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities.SettleAccountVersion; -using Win.Sfs.SettleAccount.FISes; -using Win.Sfs.Shared.Enums.SettleAccount; -using Win.Sfs.Shared.Filter; -using Shouldly; -using Magicodes.ExporterAndImporter.Csv; -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using System.Data.Common; -using Volo.Abp.Uow; -using Volo.Abp; -using Win.Abp.Snowflakes; -using Win.Sfs.SettleAccount.CommonManagers; -using Win.Sfs.SettleAccount.ExportReports; -using Win.Sfs.SettleAccount.Constant; -using Win.Sfs.SettleAccount.MaterialRelationships; -using Win.Sfs.SettleAccount.Entities.TaskJobs; -using Magicodes.ExporterAndImporter.Core.Models; - -using TaskJob.Services; -using TaskJob.EventArgs; -using Win.Sfs.SettleAccount.Entities.Wms; -using Win.Sfs.SettleAccount.Repository; - -namespace Win.Sfs.SettleAccount.Entities.SettleAccounts -{ - /// - /// 大众准时化结算明细导入-R3已结 - /// - [ApiExplorerSettings(IgnoreApi = true)] - [Authorize(SettleAccountPermissions.SettleAccounts.Default)] - //[AllowAnonymous] - [Route("api/settleaccount/SettleAccount")] - public class SettleAccountAppService : SettleAccountApplicationBase, ISettleAccountAppService - { - private readonly IGuidGenerator _guidGenerator; - - private readonly IExcelImportAppService _excelImportService; - - private readonly ISettleAccountBranchEfCoreRepository _preBatchRepository; - - - - private readonly ISettleAccountBranchEfCoreRepository _repository; - private readonly ISettleAccountBranchEfCoreRepository _versionRepository; - private readonly ISettleAccountBranchEfCoreRepository _fisRepository; - private readonly ISettleAccountBranchEfCoreRepository _relrepository; - private readonly TaskJobService _service; - /// - /// 构建方法 - /// - /// 构建UID - - /// 仓储接口 - /// 缓存 - public SettleAccountAppService(IGuidGenerator guidGenerator, - ISettleAccountBranchEfCoreRepository versionRepository, - ISettleAccountBranchEfCoreRepository repository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager, - TaskJobService service, - ISettleAccountBranchEfCoreRepository fisRepository, - ISettleAccountBranchEfCoreRepository preBatchRepository, - ISettleAccountBranchEfCoreRepository relrepository - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) - { - _service = service; - _fisRepository = fisRepository; - _versionRepository = versionRepository; - _guidGenerator = guidGenerator; - _excelImportService = excelImportService; - _repository = repository; - _preBatchRepository = preBatchRepository; - _relrepository = relrepository; - } - - - - - - /// - /// 导入功能 - /// - /// - /// - /// - /// - /// - /// - /// - /// - [HttpPost] - [Route("ExcelImport-PG")] - [DisableRequestSizeLimit] - [Authorize(SettleAccountPermissions.SettleAccounts.Create)] - [UnitOfWork(false)] - - public async Task SettleAccountUploadExcelImportTH([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory) - { - List customConditionList = new List(); - customConditionList.Add(new CustomCondition() { Name = "Version", Value = version??string.Empty }); - customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty }); - customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? string.Empty }); - customConditionList.Add(new CustomCondition() { Name = "Period", Value = period ?? string.Empty }); - customConditionList.Add(new CustomCondition() { Name = "Factory", Value = factory ?? string.Empty }); - var _versionQuery = _versionRepository.Where(p => p.Version == version); - if (_versionQuery.Count() > 0) - { - _versionQuery.BatchDelete(); - } - - var _query = _repository.Where(p => p.Version == version); - if (_query.Count() > 0) - { - await _query.BatchDeleteAsync(); - } - var _taskid = await _service.ImportEnqueueAsync(files, "结算数据", CurrentUser, typeof(SettleAccountImportService), customConditionList, (rs) => - { - - - - - }); - - - return _taskid; - } - /// - /// 导入功能 - /// - /// 上传的文件(前端已经限制只能上传一个附件) - /// - [HttpPost] - [Route("ExcelImport")] - [DisableRequestSizeLimit] - [Authorize(SettleAccountPermissions.SettleAccounts.Create)] - public async Task SettleAccountUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory) - { - List _setls = new List(); - List _errorList = new List(); - var _id = GuidGenerator.Create(); - var checkList = new List(); - var _chList = await _relrepository.GetAllAsync(GuidGenerator.Create(), true); - var _chls = _chList.Select(p => p.SettleMaterialCode).Distinct(); - List _precodeList = new List();// - using (TextReader textReader = new StreamReader(files[0].OpenReadStream())) - { - var _preList = _preBatchRepository.Where(p => p.State == 3).ToList(); - var _versionQuery = _versionRepository.Where(p => p.Version == version); - await _versionQuery.BatchDeleteAsync(); - var _query = _repository.Where(p => p.Version == version); - await _query.BatchDeleteAsync(); - int i = 0; - //var _userId = CurrentUser.Id.Value; - while (true) - { - string str = await textReader.ReadLineAsync(); - if (string.IsNullOrEmpty(str)) - { - break; - } - else - { - //if (i > headerNumber) - //{ - try - { - var _lst = str.Split(new char[] { '|' }).ToList(); - string _settleyear = _lst[1].Trim(); - string _kENNCode = _lst[2].Trim(); - string _chassisNumber = _lst[3].Trim(); - string _model = _lst[4].Trim(); - DateTime _cP5A = DateTime.Parse(_lst[5].Trim()); - DateTime _cP7 = DateTime.Parse(_lst[6].Trim()); - string _materialCode = _lst[7].Trim(); - decimal _qty = decimal.Parse(_lst[8].Trim()); - string _settlementID = _lst[9].Trim(); - string _settlementSupplier = _lst[10].Trim(); - if (_preList.Any(p => p.KENNCode == _kENNCode)) - { - _precodeList.Add(_kENNCode); - } - _setls.Add(new SettleAccount( - GuidGenerator.Create(), - branchId, - _settleyear, - _kENNCode, - _chassisNumber, - _model, - _cP5A, - _cP7, - _materialCode, - _qty, - _settlementID, - _settlementSupplier, - period, - year, - _id, - version, - DateTime.Now, - GuidGenerator.Create() - // _userId - )); - } - catch - { - } - //} - } - i++; - } - textReader.Close(); - } - - var _ls = _setls; - - var query = from arc in _ls - group arc by new { arc.ChassisNumber, arc.MaterialCode } - into g - where g.Count() > 1 - select g; - - var _l = _setls.Select(p => p.MaterialCode).Distinct(); - - var _notls = _l.Where(p => !_chls.Contains(p)).ToList(); - - foreach (var itm in _notls) - { - checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm, string.Empty, string.Format("关系表中不存在结算物料号{0}!", itm), string.Empty)); - } - foreach (var itm in query) - { - checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}底盘号 {1}有重复", itm.Key.MaterialCode, itm.Key.ChassisNumber), string.Empty)); - } - if (checkList.Count > 0) - { - return await ExportErrorReportAsync(checkList); - } - var _existls = _preBatchRepository.Where(p => _precodeList.Contains(p.KENNCode)).ToList(); - if (_existls.Count > 0) - { - foreach (var itm in _existls) - { - itm.Update(string.Format("结算修改预批量{0}", DateTime.Now.ToString("yyyyMMdd")), 0,string.Empty,string.Empty,string.Empty); - } - } - await _preBatchRepository.GetDbContext().BulkUpdateAsync(_existls); - await _repository.GetDbContext().BulkInsertAsync(_setls); - - await _versionRepository.InsertAsync(new SettleAccountVersion(_id, branchId, year, period, version, customerCode, factory)); - - return ApplicationConsts.SuccessStr; - } - - /// - /// 按ID获取唯一实体 - /// - /// - /// 返回实体全部属性 - /// - /// ID - /// 实体DTO - [HttpGet] - [Route("{id}")] - [Authorize(SettleAccountPermissions.SettleAccounts.Default)] - virtual public async Task GetAsync(Guid id) - { - var result = await GetFromCacheAsync(id); - var dto = ObjectMapper.Map(result); - return dto; - } - - - private async Task GetFromCacheAsync(Guid id) - { - var result = await _repository.GetAsync(id); - return result; - } - private async Task GetCountAsync(SettleAccountRequestDto input) - { - return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); - } - - private async Task GetCountAsync(SettleAccountVersionRequestDto input) - { - return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); - } - - - - - - /// - /// 导出预批量 - /// - /// - /// - [HttpGet] - [Route("ExportPreBatch")] - //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] - virtual public async Task ExportPreBatchAsync(string version) - { - - IExporter _csv = new CsvExporter(); - IExporter _excel = new ExcelExporter(); - var _query = from itm1 in _preBatchRepository join itm2 in _repository on new { itm1.KENNCode, itm1.Year } equals new { itm2.KENNCode, itm2.Year } where itm2.Version == version select itm2; - var _ls=await _query.ToListAsync(); - foreach (var itm in _ls) - { - itm.state = 3; - } - var dtoDetails = ObjectMapper.Map, List>(_ls); - string _fileName = string.Empty; - //声明导出容器 - - byte[] result = null; - //switch (input.FileType) - //{ - // case 0: - // _fileName = string.Format("结算数据(预批量)_{0}.csv", Guid.NewGuid().ToString()); - // result = await _csv.ExportAsByteArray(dtoDetails); - // break; - // case 1: - // _fileName = string.Format("结算数据_{0}.xlsx", Guid.NewGuid().ToString()); - // result = await _excel.ExportAsByteArray(dtoDetails); - // break; - //} - - _fileName = string.Format("结算数据(预批量)_{0}.xlsx", Guid.NewGuid().ToString()); - result = await _excel.ExportAsByteArray(dtoDetails); - result.ShouldNotBeNull(); - - //保存导出文件到服务器存成二进制 - await _excelImportService.SaveBlobAsync( - new SaveExcelImportInputDto - { - Name = _fileName, - Content = result - } - ); - return _fileName; - - - - } - - - - /// - /// 导出文件 - /// - /// - /// - [HttpPost] - [Route("Export")] - //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] - virtual public async Task ExportAsync(SettleAccountRequestDto input) - { - - IExporter _csv = new CsvExporter(); - IExporter _excel = new ExcelExporter(); - if (input.ParentId != Guid.Empty) - { - input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); - } - var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - 0, true); - - var dtoDetails = ObjectMapper.Map, List>(entities); - - string _fileName = string.Empty; - //声明导出容器 - - byte[] result = null; - switch (input.FileType) - { - case 0: - _fileName = string.Format("结算数据_{0}.csv", input.UserId.ToString()); - result = await _csv.ExportAsByteArray(dtoDetails); - break; - case 1: - _fileName = string.Format("结算数据_{0}.xlsx", input.UserId.ToString()); - result = await _excel.ExportAsByteArray(dtoDetails); - break; - } - result.ShouldNotBeNull(); - - //保存导出文件到服务器存成二进制 - await _excelImportService.SaveBlobAsync( - new SaveExcelImportInputDto - { - Name = _fileName, - Content = result - } - ); - return _fileName; - } - - - - - - - - - - /// - /// 根据筛选条件获取实体列表 - /// - /// - /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 - /// - /// 请求条件 - /// 实体DTO列表 - [HttpPost] - [Route("list")] - //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] - virtual public async Task> GetListAsync(Guid id, SettleAccountRequestDto input) - { - if (input.ParentId != Guid.Empty) - { - - // var _entity = await _versionRepository.GetAsync(input.ParentId); - // input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = _entity.Version }); - input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); - } - else - { - return new PagedResultDto(0, new List()); - } - var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true); - - var totalCount = await GetCountAsync(input); - var dtos = ObjectMapper.Map, List>(entities); - - return new PagedResultDto(totalCount, dtos); - } - - - /// - /// 获取实体总数 - /// - /// 实体总数 - [HttpGet] - [Route("count")] - [Authorize(SettleAccountPermissions.SettleAccounts.Default)] - virtual public async Task GetTotalCountAsync(Guid branchId) - { - return await _repository.GetCountAsync(branchId); - } - - /// - /// 获取全部实体列表 - /// - /// 实体DTO列表 - [HttpGet] - [Route("all")] - //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] - virtual public async Task> GetAllAsync(Guid branchId) - { - var entities = await _repository.GetAllAsync(branchId, true); - var dtos = ObjectMapper.Map, List>(entities); - return new ListResultDto(dtos); - } - - - - /// - /// 删除实体 - /// - /// ID - /// - [HttpDelete] - [Route("{id}")] - /// [Authorize(SettleAccountPermissions.SettleAccounts.Delete)] - virtual public async Task DeleteAsync(Guid id) - { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(id); - } - - /// - /// 按IDs删除实体列表 - /// - /// IDs - /// 是否执行成功 - [HttpPost] - [Route("delete")] - // [Authorize(SettleAccountPermissions.SettleAccounts.Delete)] - virtual public async Task DeleteListAsync(List ids) - { - foreach (var id in ids) - { - var entity = await GetFromCacheAsync(id); - //await Cache.DeleteAsync(id.ToString()); - } - - return await _repository.DeleteListAsync(ids); - } - - - - /// - ///调用存储 - /// - /// - /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 - /// - /// 请求条件 - /// 实体DTO列表 - [HttpPost] - [Route("listversion")] - - - public async Task> GetVersionListAsync(SettleAccountVersionRequestDto input) - { - var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - input.SkipCount, true); - var totalCount = await GetCountAsync(input); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } - - - - /// - /// 根据筛选条件获取实体列表 - /// - /// - /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 - /// - /// 请求条件 - /// 实体DTO列表 - [HttpPost] - [Route("updateFis")] - - [UnitOfWork(isTransactional: false)] - public async Task UPdateFisAsync() - { - _repository.GetDbContext().Database.SetCommandTimeout(300000); - await _repository.GetDbContext().Database.ExecuteSqlRawAsync( - "EXEC sp_settle_fis_update" - ); - return true; - - - - } - - - } -} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 2e53e2cf..26d0c106 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -1108,7 +1108,6 @@ namespace Win.Sfs.SettleAccount { "InvoiceNumber", d.InvoiceNumber}, { "VendorCode", d.VendorCode}, { "VendorName", d.VendorName}, - { "PurchaseOrderNumber", d.PurchaseOrderNumber}, { "DeliveryIndexNumber", d.DeliveryIndexNumber}, { "PartName", d.PartName}, { "Price", d.Price}, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs index 91dbf95f..43a1f956 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs @@ -41,7 +41,7 @@ public class PUB_SE_DETAIL :SE_BASE /// 发货时间 /// [Display(Name = "发货时间")] - public DateTime BillTime { get; set; } + public DateTime? BillTime { get; set; } /// /// 订单时间 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs index d5935ec2..e25d14dd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs @@ -1,108 +1,56 @@ -using System; -using Win.Sfs.Shared.DomainBase; +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; -namespace Win.Sfs.SettleAccount.MaterialRelationships +namespace Win.Sfs.SettleAccount.MaterialRelationships; + +/// +/// 客户零件关系 +/// +public class MaterialRelationship : AuditedAggregateRoot { /// - /// 客户零件关系 + /// 厂内物料号 /// - public class MaterialRelationship : FullAuditedAggregateRootBase - { - /// - /// 厂内物料号 - /// - public string ErpMaterialCode { get; set; } - - /// - /// 厂内物料描述 - /// - public string MaterialDesc { get; set; } - - /// - /// 客户物料号 - /// - public string SettleMaterialCode { get; set; } - - - - - - - - - - - - - /// - /// 物料属性 - /// - public string MaterialProperty { get; set; } - - - - - ///// - ///// 结算物料号 - ///// - //public string SettleMaterialCode { get; set; } - - - /// - /// 发货看板物料号 - /// - public string ShipMaterailCode { get; set; } - - /// - /// 估价类 - /// - public string AppraisalCategory { get; set; } - - - public void SetId(Guid id, Guid branchId) - { - - Id = id; - BranchId = branchId; - - + public string ErpMaterialCode { get; set; } + /// + /// 厂内物料描述 + /// + public string MaterialDesc { get; set; } + /// + /// 客户物料号 + /// + public string SettleMaterialCode { get; set; } + /// + /// 业务分类 + /// + [Display(Name = "业务分类")] + public EnumBusinessType BusinessType { get; set; } - } + public void SetId(Guid id, Guid branchId) + { + Id = id; + } - protected MaterialRelationship() - { - } - public void Update( string materialDesc, string materialProperty, string settlMaterialCode, string shipMaterailCode) - { - - MaterialDesc = materialDesc; - MaterialProperty = materialProperty; - SettleMaterialCode = settlMaterialCode; - ShipMaterailCode = shipMaterailCode; - //AppraisalCategory = appraisalCategory; - } + protected MaterialRelationship() + { + } + public void Update(string materialDesc, string settlMaterialCode) + { + MaterialDesc = materialDesc; + SettleMaterialCode = settlMaterialCode; + } - public MaterialRelationship( - Guid id, - Guid branchId, + public MaterialRelationship(Guid id) : base(id) + { - string erpMaterialCode, string materialDesc, string materialProperty, string settlMaterialCode, string shipMaterailCode, string appraisalCategory) :base(id) - { - BranchId = branchId; - ErpMaterialCode = erpMaterialCode; - MaterialDesc = materialDesc; - MaterialProperty = materialProperty; - SettleMaterialCode = settlMaterialCode; - ShipMaterailCode = shipMaterailCode; - AppraisalCategory = appraisalCategory; - } + } - public MaterialRelationship(Guid id, string erpMaterialCode, string materialDesc, string settlMaterialCode, string appraisalCategory) : base(id) - { - ErpMaterialCode = erpMaterialCode; - MaterialDesc = materialDesc; - SettleMaterialCode = settlMaterialCode; - AppraisalCategory = appraisalCategory; - } + public MaterialRelationship(Guid id, string erpMaterialCode, string materialDesc, string settlMaterialCode, EnumBusinessType businessType) : base(id) + { + ErpMaterialCode = erpMaterialCode; + MaterialDesc = materialDesc; + SettleMaterialCode = settlMaterialCode; + BusinessType = businessType; } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/CommonManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/CommonManager.cs index 42791d8d..22aabd1c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/CommonManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/CommonManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -15,6 +15,7 @@ using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.DtoBase.SettleAccount; using Win.Sfs.Shared.Enums.SettleAccount; using Win.Sfs.Shared.Filter; +using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.CommonManagers { @@ -25,7 +26,7 @@ namespace Win.Sfs.SettleAccount.CommonManagers private readonly ISettleAccountBranchEfCoreRepository _customerStorageLocationRepository; private readonly ISettleAccountBranchEfCoreRepository _inventoryDetailRepository; private readonly ISettleAccountBranchEfCoreRepository _settleAccountRepository; - private readonly ISettleAccountBranchEfCoreRepository _materialRelationshipRepository; + private readonly INormalEfCoreRepository _materialRelationshipRepository; private readonly ISettleAccountBranchEfCoreRepository _centralizedControlRepository; @@ -42,7 +43,7 @@ namespace Win.Sfs.SettleAccount.CommonManagers ISettleAccountBranchEfCoreRepository settleAccountRepository, ISettleAccountBranchEfCoreRepository centralizedControlRepository, ISettleAccountBranchEfCoreRepository itemRepository, - ISettleAccountBranchEfCoreRepository materialRelationshipRepository + INormalEfCoreRepository materialRelationshipRepository ) { _inventoryDetailRepository = inventoryDetailRepository; @@ -186,4 +187,4 @@ namespace Win.Sfs.SettleAccount.CommonManagers } -} \ No newline at end of file +} 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 d20832ad..e8df6ad3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -238,9 +238,7 @@ namespace Win.Sfs.SettleAccount b.ToTable($"{options.TablePrefix}_relationship", options.Schema); b.ConfigureByConvention(); b.Property(x => x.ErpMaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - b.HasIndex(x => new { x.ErpMaterialCode }); - - b.HasIndex(x => new { x.ErpMaterialCode }).IsUnique().HasFilter(IsDeletedFilter); + b.HasIndex(x => new { x.ErpMaterialCode, x.BusinessType }).IsUnique(); }); } @@ -1345,7 +1343,7 @@ namespace Win.Sfs.SettleAccount builder.Entity().HasData(new JobItem("JisBBACSeSync".ToGuid()) { Name = "JisBBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" }); builder.Entity().HasData(new JobItem("JisHBPOSeSync".ToGuid()) { Name = "JisHBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" }); builder.Entity().HasData(new JobItem("MaiDanBBACSeSync".ToGuid()) { Name = "买单件BBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" }); - builder.Entity().HasData(new JobItem("MaiDanHBPOSeSync".ToGuid()) { Name = "买单件HBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" }); + builder.Entity().HasData(new JobItem("MaiDanHBPOSeSync".ToGuid()) { Name = "买单件HBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanHBPOSeSyncAppService" }); builder.Entity().HasData(new JobItem("ZhiGongBBACSeSync".ToGuid()) { Name = "直供件BBAC发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" }); builder.Entity().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" }); builder.Entity().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.Designer.cs new file mode 100644 index 00000000..1ebb9543 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.Designer.cs @@ -0,0 +1,5521 @@ +// +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("20230818070358_20230818-1")] + partial class _202308181 + { + 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("BusinessType") + .HasColumnType("int"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("IsMaiDan") + .HasColumnType("bit"); + + b.Property("IsReturn") + .HasMaxLength(50) + .HasColumnType("bit"); + + 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("PartCode") + .HasColumnType("nvarchar(max)"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsMaiDan") + .HasColumnType("bit"); + + b.Property("IsReturn") + .HasMaxLength(50) + .HasColumnType("bit"); + + 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("PartCode") + .HasColumnType("nvarchar(max)"); + + 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", 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") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_PD"); + }); + + 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("IsMaiDan") + .HasColumnType("bit"); + + 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("BusinessType") + .HasColumnType("int"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + 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("BusinessType") + .HasColumnType("int"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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("PartCode") + .HasColumnType("nvarchar(max)"); + + 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("AssembleData") + .HasColumnType("datetime2"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Batch") + .HasColumnType("nvarchar(max)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BillCharacter") + .HasColumnType("nvarchar(max)"); + + b.Property("BillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("BillType") + .HasColumnType("int"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("CodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliverBillType") + .HasColumnType("int"); + + b.Property("DeliverCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverSubBillType") + .HasColumnType("int"); + + b.Property("ErpToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("FactoryPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsHaveEdiData") + .HasColumnType("bit"); + + b.Property("JISNum") + .HasColumnType("nvarchar(max)"); + + 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("MESConfigCode") + .HasColumnType("nvarchar(max)"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Oper") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderNum") + .HasColumnType("nvarchar(max)"); + + b.Property("OrigiCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PartDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Position") + .HasColumnType("nvarchar(max)"); + + b.Property("ProType") + .HasColumnType("int"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RefBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("RefVinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Seq") + .HasColumnType("nvarchar(max)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("SubBillType") + .HasColumnType("int"); + + b.Property("ToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("TransType") + .HasColumnType("int"); + + b.Property("UID") + .HasColumnType("bigint"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("VinCode") + .HasColumnType("nvarchar(max)"); + + 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("IsHaveSeData") + .HasColumnType("bit"); + + 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("nvarchar(max)"); + + 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("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SE_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_SA_REPORT", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssemblyCode") + .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("CustomerOfflineTime") + .HasColumnType("datetime2"); + + 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("FixPrice") + .HasColumnType("decimal(18,2)"); + + 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("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WMSQty") + .HasColumnType("decimal(18,2)"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SE_SA_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_ADJ_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("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsMaiDan") + .HasColumnType("bit"); + + 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("OldInvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + 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_HBPO_ADJ_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_CAN_SA", 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("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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_HBPO_CAN_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + 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("InvbillNum") + .HasColumnType("nvarchar(max)"); + + 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("PartCode") + .HasColumnType("nvarchar(max)"); + + 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_HBPO_CAN_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + 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("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("PartCode") + .HasColumnType("nvarchar(max)"); + + 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_HBPO_NOT_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_PD", 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") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_PD"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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_HBPO_PD_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SA", 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("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DNBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("RecordCount") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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_HBPO_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + 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("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("PartCode") + .HasColumnType("nvarchar(max)"); + + 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_HBPO_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SE_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssembleData") + .HasColumnType("datetime2"); + + b.Property("AssemblyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Batch") + .HasColumnType("nvarchar(max)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BillCharacter") + .HasColumnType("nvarchar(max)"); + + b.Property("BillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("BillType") + .HasColumnType("int"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("CodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliverBillType") + .HasColumnType("int"); + + b.Property("DeliverCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverSubBillType") + .HasColumnType("int"); + + b.Property("ErpToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + b.Property("FactoryPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("InjectionCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsHaveEdiData") + .HasColumnType("bit"); + + b.Property("JISNum") + .HasColumnType("nvarchar(max)"); + + 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("MESConfigCode") + .HasColumnType("nvarchar(max)"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Oper") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderNum") + .HasColumnType("nvarchar(max)"); + + b.Property("OrigiCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PartDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Position") + .HasColumnType("nvarchar(max)"); + + b.Property("ProType") + .HasColumnType("int"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("RealCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RealPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("RefBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("RefVinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Seq") + .HasColumnType("nvarchar(max)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("SubBillType") + .HasColumnType("int"); + + b.Property("ToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("TransType") + .HasColumnType("int"); + + b.Property("UID") + .HasColumnType("bigint"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("VinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SE_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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("IsHaveSeData") + .HasColumnType("bit"); + + 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_HBPO_SE_EDI"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SE_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SE_SA_REPORT", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssemblyCode") + .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("CustomerOfflineTime") + .HasColumnType("datetime2"); + + 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("FixPrice") + .HasColumnType("decimal(18,2)"); + + 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("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WMSQty") + .HasColumnType("decimal(18,2)"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SE_SA_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_GRP", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + 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("FileName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvoiceState") + .HasColumnType("int"); + + 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("ParentInvbillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("PreTaxDiff") + .HasColumnType("decimal(18,2)"); + + b.Property("RealAmt") + .HasColumnType("decimal(18,2)"); + + b.Property("RealnvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Tax") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxAmt") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxDiff") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_GRP"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_MAP_GROUP", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .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("SettleGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_MAP_GROUP"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_NOT_SETTLE", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + 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("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("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SettleGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_NOT_SETTLE"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_WAIT_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BussiessType") + .HasMaxLength(50) + .HasColumnType("int"); + + 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("EndDate") + .HasColumnType("datetime2"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PRICE") + .HasColumnType("decimal(18,2)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_WAIT_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.JIT_SE_SA_REPORT", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssemblyCode") + .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("CustomerOfflineTime") + .HasColumnType("datetime2"); + + 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("FixPrice") + .HasColumnType("decimal(18,2)"); + + 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("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WMSQty") + .HasColumnType("decimal(18,2)"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_JIT_SE_SA_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_ADJ_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("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsMaiDan") + .HasColumnType("bit"); + + 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("OldInvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + 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_PUB_ADJ_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_CAN_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_CAN_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_CAN_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasColumnType("nvarchar(max)"); + + 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("PartCode") + .HasColumnType("nvarchar(max)"); + + 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_PUB_CAN_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_NOT_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + 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("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend3") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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("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("PartCode") + .HasColumnType("nvarchar(max)"); + + 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_PUB_NOT_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_PD", 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") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_PD"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_PD_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + 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_PUB_PD_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_SA", 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("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("State") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_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("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .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("PartCode") + .HasColumnType("nvarchar(max)"); + + 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_PUB_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_SE_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AssembleData") + .HasColumnType("datetime2"); + + b.Property("Batch") + .HasColumnType("nvarchar(max)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("BillType") + .HasColumnType("int"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreateTime") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustId") + .HasColumnType("nvarchar(max)"); + + b.Property("CustPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliverBillType") + .HasColumnType("int"); + + b.Property("DeliverSubBillType") + .HasColumnType("int"); + + b.Property("DeliveryHose") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliveryIndex") + .HasColumnType("nvarchar(max)"); + + b.Property("DnBillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("DnBillTime") + .HasColumnType("datetime2"); + + b.Property("DnOper") + .HasColumnType("nvarchar(max)"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FactoryPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromErpLocCode") + .HasColumnType("nvarchar(max)"); + + b.Property("FromHose") + .HasColumnType("nvarchar(max)"); + + b.Property("FromLocCode") + .HasColumnType("nvarchar(max)"); + + 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("Oper") + .HasColumnType("nvarchar(max)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ProType") + .HasColumnType("int"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("SubBillType") + .HasColumnType("int"); + + b.Property("ToErpLocCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ToHose") + .HasColumnType("nvarchar(max)"); + + b.Property("ToLocCode") + .HasColumnType("nvarchar(max)"); + + b.Property("TransType") + .HasColumnType("int"); + + b.Property("UID") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_SE_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PURCHASE_PRICE", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Set_PURCHASE_PRICE"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.TB_RePartsRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("RepLU") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_TB_RePartsRelationship"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Boms.Bom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BomLevel") + .HasColumnType("int"); + + b.Property("BomType") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChildItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChildItemDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("ChildItemUom") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("EffectiveTime") + .HasColumnType("datetime2"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExpireTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IssuePosition") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OperateProcess") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentItemDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ScrapPercent") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ParentItemCode", "ChildItemCode", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bom"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.BBAC_SEC_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .HasColumnType("int"); + + 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("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + 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("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PrimitiveLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReplaceLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SAQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SEC_DETAIL"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.HBPO_SEC_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .HasColumnType("int"); + + 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("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + 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("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PrimitiveLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReplaceLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SAQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SEC_DETAIL"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.PUB_SEC_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .HasColumnType("int"); + + 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("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + 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("MateType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialDes") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("MaterialNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PJISSeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("PrimitiveLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReplaceLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SAQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_SEC_DETAIL"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Syncs.SyncPositionFlag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Position") + .HasColumnType("nvarchar(max)"); + + b.Property("TableName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_SyncPositionFlag"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .ValueGeneratedOnAddOrUpdate() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Cron") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("HeartBeat") + .HasColumnType("datetime2"); + + b.Property("IsDisabled") + .HasColumnType("bit"); + + b.Property("IsRunning") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Service") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Set_JobItem"); + + b.HasData( + new + { + Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), + Cron = "0 0 8 26 *", + IsDisabled = false, + IsRunning = false, + Name = "库存快照", + Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" + }, + new + { + Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"), + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "JisBBAC发运数据同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" + }, + new + { + Id = new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"), + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "JisHBPO发运数据同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" + }, + new + { + Id = new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"), + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "买单件BBAC发运数据同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" + }, + new + { + Id = new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "买单件HBPO发运数据同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanHBPOSeSyncAppService" + }, + new + { + Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "直供件BBAC发运同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" + }, + new + { + Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"), + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "直供件HBPO发运同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" + }, + new + { + Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"), + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "备件发运同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" + }, + new + { + Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"), + Cron = "0 0/30 * * * ? ", + IsDisabled = false, + IsRunning = false, + Name = "印度件发运同步", + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" + }); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("End") + .HasColumnType("datetime2"); + + b.Property("Exception") + .HasColumnType("nvarchar(max)"); + + b.Property("Host") + .HasColumnType("nvarchar(max)"); + + b.Property("JobId") + .HasColumnType("uniqueidentifier"); + + b.Property("Start") + .HasColumnType("datetime2"); + + b.Property("Success") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.ToTable("Set_JobLog"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiBalance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BackupTime") + .HasColumnType("datetime2"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("BillType") + .HasColumnType("int"); + + b.Property("CodeType") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Configcode") + .HasColumnType("nvarchar(450)"); + + b.Property("CustomerPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverTime") + .HasColumnType("datetime2"); + + b.Property("ErpToLoc") + .HasColumnType("nvarchar(450)"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderNum") + .HasColumnType("nvarchar(450)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(450)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("ReMark") + .HasColumnType("nvarchar(max)"); + + b.Property("RealCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Seq") + .HasColumnType("nvarchar(max)"); + + b.Property("SubBillType") + .HasColumnType("int"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("VinCode") + .HasColumnType("nvarchar(450)"); + + b.Property("factory") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("BillType", "CodeType", "PartCode", "VinCode", "ErpToLoc", "OrderNum", "factory", "Configcode") + .IsUnique() + .HasFilter("[CodeType] IS NOT NULL AND [PartCode] IS NOT NULL AND [VinCode] IS NOT NULL AND [ErpToLoc] IS NOT NULL AND [OrderNum] IS NOT NULL AND [factory] IS NOT NULL AND [Configcode] IS NOT NULL"); + + b.ToTable("Set_VmiBalance"); + + b.HasData( + new + { + Id = new Guid("ab6a3a74-bb4e-442c-84b5-d148f2cd99f6"), + BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + BillType = 1, + ConcurrencyStamp = "6947bb1f686043fcb95d9db67c0ca6c8", + DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + ErpToLoc = "ErpToLoc", + OrderNum = "OrderNum", + PartCode = "PartCode", + Qty = 0m, + SubBillType = 0, + VinCode = "VinCode" + }); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillTime") + .HasColumnType("datetime2"); + + b.Property("BillType") + .HasColumnType("int"); + + b.Property("ChangedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ChangedTime") + .HasColumnType("datetime2"); + + b.Property("ChangedType") + .HasColumnType("int"); + + b.Property("CodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("Configcode") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeliverTime") + .HasColumnType("datetime2"); + + b.Property("ErpToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("GroupId") + .HasColumnType("nvarchar(max)"); + + b.Property("IsReplenished") + .HasColumnType("bit"); + + b.Property("LogType") + .HasColumnType("int"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderNum") + .HasColumnType("nvarchar(max)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PartCode2") + .HasColumnType("nvarchar(max)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("ReMark") + .HasColumnType("nvarchar(max)"); + + b.Property("RealCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Seq") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementVinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("SubBillType") + .HasColumnType("int"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("VinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("factory") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_VmiLog"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiSnapshot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Path") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_VmiSnapshot"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Boms.BomVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + 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("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_bom_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.CodeSettings.CodeSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + 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("Project") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_CodeSetting"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Controls.CentralizedControl", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("Enabled") + .HasColumnType("bit"); + + 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("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("bit"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Year", "Period") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_control"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Materials.Material", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimateType") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("EstimateTypeDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + 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("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Unit") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_material"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractNo") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceList"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListBJ", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractNo") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListBJ"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .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("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersionBJ", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .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("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListVersionBJ"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.TaskJob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("Creator") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DownFileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Email") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Error") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + 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("Name") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RealDownFileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RealFileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ServiceName") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("State") + .HasColumnType("nvarchar(max)"); + + b.Property("TaskId") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_TaskJob"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.MaterialRelationships.MaterialRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ErpMaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ErpMaterialCode", "BusinessType") + .IsUnique(); + + b.ToTable("Set_relationship"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobLog", b => + { + b.HasOne("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobItem", "Job") + .WithMany() + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Job"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.cs new file mode 100644 index 00000000..fb345244 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.cs @@ -0,0 +1,191 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Win.Sfs.SettleAccount.Migrations +{ + public partial class _202308181 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_Set_relationship_ErpMaterialCode", + table: "Set_relationship"); + + migrationBuilder.DeleteData( + table: "Set_VmiBalance", + keyColumn: "Id", + keyValue: new Guid("42240e52-f4f4-4e40-b321-2bc395fde07c")); + + migrationBuilder.DropColumn( + name: "AppraisalCategory", + table: "Set_relationship"); + + migrationBuilder.DropColumn( + name: "BranchId", + table: "Set_relationship"); + + migrationBuilder.DropColumn( + name: "DeleterId", + table: "Set_relationship"); + + migrationBuilder.DropColumn( + name: "DeletionTime", + table: "Set_relationship"); + + migrationBuilder.DropColumn( + name: "Enabled", + table: "Set_relationship"); + + migrationBuilder.DropColumn( + name: "IsDeleted", + table: "Set_relationship"); + + migrationBuilder.DropColumn( + name: "MaterialProperty", + table: "Set_relationship"); + + migrationBuilder.DropColumn( + name: "Remark", + table: "Set_relationship"); + + migrationBuilder.DropColumn( + name: "ShipMaterailCode", + table: "Set_relationship"); + + migrationBuilder.AddColumn( + name: "BusinessType", + table: "Set_relationship", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AlterColumn( + name: "BillTime", + table: "Set_PUB_SE_DETAIL", + type: "datetime2", + nullable: true, + oldClrType: typeof(DateTime), + oldType: "datetime2"); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), + column: "Service", + value: "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanHBPOSeSyncAppService"); + + migrationBuilder.InsertData( + table: "Set_VmiBalance", + columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" }, + values: new object[] { new Guid("ab6a3a74-bb4e-442c-84b5-d148f2cd99f6"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "6947bb1f686043fcb95d9db67c0ca6c8", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null }); + + migrationBuilder.CreateIndex( + name: "IX_Set_relationship_ErpMaterialCode_BusinessType", + table: "Set_relationship", + columns: new[] { "ErpMaterialCode", "BusinessType" }, + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_Set_relationship_ErpMaterialCode_BusinessType", + table: "Set_relationship"); + + migrationBuilder.DeleteData( + table: "Set_VmiBalance", + keyColumn: "Id", + keyValue: new Guid("ab6a3a74-bb4e-442c-84b5-d148f2cd99f6")); + + migrationBuilder.DropColumn( + name: "BusinessType", + table: "Set_relationship"); + + migrationBuilder.AddColumn( + name: "AppraisalCategory", + table: "Set_relationship", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "BranchId", + table: "Set_relationship", + type: "uniqueidentifier", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "DeleterId", + table: "Set_relationship", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "DeletionTime", + table: "Set_relationship", + type: "datetime2", + nullable: true); + + migrationBuilder.AddColumn( + name: "Enabled", + table: "Set_relationship", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "IsDeleted", + table: "Set_relationship", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "MaterialProperty", + table: "Set_relationship", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Remark", + table: "Set_relationship", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "ShipMaterailCode", + table: "Set_relationship", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AlterColumn( + name: "BillTime", + table: "Set_PUB_SE_DETAIL", + type: "datetime2", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + oldClrType: typeof(DateTime), + oldType: "datetime2", + oldNullable: true); + + migrationBuilder.UpdateData( + table: "Set_JobItem", + keyColumn: "Id", + keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), + column: "Service", + value: "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService"); + + migrationBuilder.InsertData( + table: "Set_VmiBalance", + columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" }, + values: new object[] { new Guid("42240e52-f4f4-4e40-b321-2bc395fde07c"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "3a0fa479f64a4e84949961ac4a8aed89", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null }); + + migrationBuilder.CreateIndex( + name: "IX_Set_relationship_ErpMaterialCode", + table: "Set_relationship", + column: "ErpMaterialCode", + unique: true, + filter: "IsDeleted=0"); + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs index 41f52059..7edd1d1e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs @@ -3516,7 +3516,7 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("BillNum") .HasColumnType("nvarchar(max)"); - b.Property("BillTime") + b.Property("BillTime") .HasColumnType("datetime2"); b.Property("BillType") @@ -4386,7 +4386,7 @@ namespace Win.Sfs.SettleAccount.Migrations IsDisabled = false, IsRunning = false, Name = "买单件HBPO发运数据同步", - Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" + Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanHBPOSeSyncAppService" }, new { @@ -4540,10 +4540,10 @@ namespace Win.Sfs.SettleAccount.Migrations b.HasData( new { - Id = new Guid("42240e52-f4f4-4e40-b321-2bc395fde07c"), + Id = new Guid("ab6a3a74-bb4e-442c-84b5-d148f2cd99f6"), BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), BillType = 1, - ConcurrencyStamp = "3a0fa479f64a4e84949961ac4a8aed89", + ConcurrencyStamp = "6947bb1f686043fcb95d9db67c0ca6c8", DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), ErpToLoc = "ErpToLoc", OrderNum = "OrderNum", @@ -5455,11 +5455,8 @@ namespace Win.Sfs.SettleAccount.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property("AppraisalCategory") - .HasColumnType("nvarchar(max)"); - - b.Property("BranchId") - .HasColumnType("uniqueidentifier"); + b.Property("BusinessType") + .HasColumnType("int"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() @@ -5475,17 +5472,6 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("CreatorId"); - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("Enabled") - .HasColumnType("bit"); - b.Property("ErpMaterialCode") .IsRequired() .HasMaxLength(36) @@ -5495,12 +5481,6 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("nvarchar(max)") .HasColumnName("ExtraProperties"); - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); @@ -5512,23 +5492,13 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("MaterialDesc") .HasColumnType("nvarchar(max)"); - b.Property("MaterialProperty") - .HasColumnType("nvarchar(max)"); - - b.Property("Remark") - .HasColumnType("nvarchar(max)"); - b.Property("SettleMaterialCode") .HasColumnType("nvarchar(max)"); - b.Property("ShipMaterailCode") - .HasColumnType("nvarchar(max)"); - b.HasKey("Id"); - b.HasIndex("ErpMaterialCode") - .IsUnique() - .HasFilter("IsDeleted=0"); + b.HasIndex("ErpMaterialCode", "BusinessType") + .IsUnique(); b.ToTable("Set_relationship"); });