From bf5ddeb0ba240255120daf995380650335cb71f0 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 14 Jan 2022 10:17:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Prices/PriceListDtoBase.cs | 140 +++++++++ .../Prices/PriceListVersionDtoBase.cs | 68 +++++ .../Entities/Prices/PriceListAppServiceBJ.cs | 286 ++++++++++++++++++ .../SettleAccount.Application.xml | 86 ++++++ ...ttleAccountApplicationAutoMapperProfile.cs | 19 ++ .../Entities/Prices/PriceList.cs | 74 +++++ .../Entities/Prices/PriceListManager.cs | 166 ++++++++++ .../Entities/Prices/PriceListVersion.cs | 25 ++ ...AccountDbContextModelCreatingExtensions.cs | 41 ++- 9 files changed, 904 insertions(+), 1 deletion(-) create mode 100644 src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs index 696b5a80..deab4a71 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs @@ -151,6 +151,146 @@ namespace Win.Sfs.SettleAccount.Entities.Prices + public class PriceListBJDto : EntityDto + { + /// + /// 版本 + /// + [Display(Name = "版本")] + public string Version { set; get; } + /// + ///开始时间 + /// + [Display(Name = "开始时间")] + public DateTime BeginDate { get; set; } + /// + ///结算时间 + /// + [Display(Name = "结算时间")] + public DateTime EndDate { get; set; } + /// + ///价格 + /// + [Display(Name = "价格")] + public decimal Price { get; set; } + /// + ///物料编号 + /// + [Display(Name = "物料编号")] + public string MaterialCode { get; set; } + /// + ///价格类型 + /// + [Display(Name = "价格类型")] + public int Type { get; set; } + + public Guid ParentId { set; get; } + [Display(Name = "客户")] + public string CustomerCode { get; set; } + + } + + + + public class PriceListBJExportDto + { + /// + /// 版本 + /// + [Display(Name = "版本")] + [ExporterHeader(DisplayName = "版本")] + public string Version { set; get; } + [ImporterHeader(Name = "有效从")] + public DateTime BeginDate { get; set; } + /// + ///结算时间 + /// + [ImporterHeader(Name = "有效到")] + public DateTime EndDate { get; set; } + /// + ///价格 + /// + [ImporterHeader(Name = "*金额")] + public decimal Price { get; set; } + /// + ///物料编号 + /// + [ImporterHeader(Name = "*物料编码")] + public string MaterialCode { get; set; } + /// + ///价格类型 + /// + [ImporterHeader(Name = "*分销渠道")] + public int Type { get; set; } + [ImporterHeader(Name = "*客户")] + public string CustomerCode { get; set; } + + } + + + public class PriceListBJImportDto + { + ///// + ///// 版本 + ///// + //[Display(Name = "版本")] + //public string Version { set; get; } + /// + ///开始时间 + /// + [ImporterHeader(Name = "有效从")] + public DateTime BeginDate { get; set; } + /// + ///结算时间 + /// + [ImporterHeader(Name = "有效到")] + public DateTime EndDate { get; set; } + /// + ///价格 + /// + [ImporterHeader(Name = "*金额")] + public decimal Price { get; set; } + /// + ///物料编号 + /// + [ImporterHeader(Name = "*物料编码")] + public string MaterialCode { get; set; } + /// + ///价格类型 + /// + [ImporterHeader(Name = "*分销渠道")] + public int Type { get; set; } + [ImporterHeader(Name = "*客户")] + public string CustomerCode { get; set; } + + } + + public class PriceListBJRequestDto : PagedAndSortedResultRequestDto + { + + + [Display(Name = "开始时间")] + public DateTime BeginDate { get; set; } + [Display(Name = "结算时间")] + public DateTime EndDate { get; set; } + [Display(Name = "价格")] + public decimal Price { get; set; } + [Display(Name = "物料编号")] + public string MaterialCode { get; set; } + [Display(Name = "价格类型")] + public int Type { get; set; } + + public Guid ParentId { set; get; } + + public int FileType { set; get; } + + public string Version { set; get; } + + public virtual List Filters { get; set; } = new List(); + } + + + } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListVersionDtoBase.cs b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListVersionDtoBase.cs index 80d4cc06..d9d6823d 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListVersionDtoBase.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListVersionDtoBase.cs @@ -62,5 +62,73 @@ namespace Win.Sfs.SettleAccount.Entities.Prices + + + + + + + + + + + + public class PriceListVersionBJDto : EntityDto + + { + + public string Year { get; set; } + public string Period { get; set; } + public string Version { get; set; } + public string Factory { get; set; } + + } + + + + public class PriceListVersionBJExportDto + + { + + public string Year { get; set; } + public string Period { get; set; } + public string Version { get; set; } + public string Factory { get; set; } + + } + + + + public class PriceListVersionBJImportDto + + { + + public string Year { get; set; } + public string Period { get; set; } + public string Version { get; set; } + public string Factory { get; set; } + + } + + + + public class PriceListVersionBJRequestDto : PagedAndSortedResultRequestDto + + { + + public string Year { get; set; } + public string Period { get; set; } + public string Version { get; set; } + public string Factory { get; set; } + + public virtual List Filters { get; set; } = new List(); + } + + + + + + + } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs new file mode 100644 index 00000000..7f209b49 --- /dev/null +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -0,0 +1,286 @@ +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 Shouldly; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.Constant; +using Win.Sfs.SettleAccount.Entities.ImportMap; +using Win.Sfs.SettleAccount.ExcelImporter; +using Win.Sfs.Shared.Filter; + +namespace Win.Sfs.SettleAccount.Entities.Prices +{ + /// + /// 标准价格单-相关应用服务 + /// + [Authorize(SettleAccountPermissions.PriceLists.Default)] + [Route("api/SettleAccount/PriceList")] + public class PriceListAppServiceBJ : ApplicationService + /*, IPriceListAppService*/ + { + private readonly PriceListManagerBJ _mng; + private readonly IExcelImportAppService _excelImportService; + private readonly ISettleAccountBranchEfCoreRepository _mapRepository; + public PriceListAppServiceBJ( + IExcelImportAppService excelImportService, + ISettleAccountBranchEfCoreRepository mapRepository, + PriceListManagerBJ mng + ) + { + _mapRepository = mapRepository; + _excelImportService = excelImportService; + _mng = mng; + } + + /// + /// 按ID获取唯一实体 + /// + /// + /// 返回实体全部属性 + /// + /// ID + /// 实体DTO + + [HttpGet] + [Route("{id}")] + /// [Authorize(SettleAccountPermissions.PriceLists.Default)] + virtual public async Task GetAsync(Guid id) + { + var result = await _mng.GetAsync(id); ; + var dto = ObjectMapper.Map(result); + return dto; + + } + + + + /// + /// 根据筛选条件获取实体列表 + /// + /// + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + /// + /// 请求条件 + /// 实体DTO列表 + [HttpPost] + [Route("list")] + //[Authorize(SettleAccountPermissions.PriceLists.Default)] + virtual public async Task> GetListAsync(PriceListRequestDto input) + { + + if (!string.IsNullOrEmpty(input.Version)) + { + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); + } + var entities = await _mng.GetListAsync(input.Filters, input.Sorting, input.MaxResultCount, + input.SkipCount); + var totalCount = await GetCountAsync(input); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } + + /// + /// 根据筛选条件获取实体列表 + /// + /// + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + /// + /// 请求条件 + /// 实体DTO列表 + [HttpPost] + [Route("versionlist")] + // [Authorize(SettleAccountPermissions.PriceLists.Default)] + virtual public async Task> GetVersionListAsync(PriceListRequestDto input) + { + + + var entities = await _mng.GetVersionListAsync(input.Filters, input.Sorting, input.MaxResultCount,input.SkipCount); + var totalCount = await GetCountAsync(input); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } + + + + + + + private async Task GetCountAsync(PriceListRequestDto input) + { + return await _mng.GetCountAsync(input.Filters, GuidGenerator.Create()); + } + + /// + /// 获取实体总数 + /// + /// 实体总数 + [HttpGet] + [Route("count")] + //[Authorize(SettleAccountPermissions.PriceLists.Default)] + virtual public async Task GetTotalCountAsync(Guid branchId) + { + return await _mng.GetCountAsync(new List(), branchId); + } + + /// + /// 获取全部实体列表 + /// + /// 实体DTO列表 + [HttpGet] + [Route("all")] + //[Authorize(SettleAccountPermissions.PriceLists.Default)] + virtual public async Task> GetAllAsync(Guid branchId) + { + var entities = await _mng.GetAllAsync(branchId); + var dtos = ObjectMapper.Map, List>(entities); + return new ListResultDto(dtos); + } + + /// + /// 批量导入实体列表 + /// + /// + /// 以ID为依据,数据库中找不到ID的实体会新增,已有ID的实体会修改 + /// + /// 实体列表 + /// 是否导入成功 + [HttpPost] + [Route("ExcelImport-Map")] + [Authorize(SettleAccountPermissions.PriceLists.Create)] + virtual public async Task ImportAsync([FromForm] IFormFileCollection files,string version) + { + ExportImporter _exportImporter = new ExportImporter(); + + var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + + var list=result.Where(p => p.Type == 20).ToList(); + + + + + + + var entityList = ObjectMapper.Map, List>(result); + var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); + + foreach (var itm in _ls) + { + itm.Update(GuidGenerator.Create(),version); + } + await _mng.ImportAsync(_ls.ToList(), version); + return ApplicationConsts.SuccessStr; + } + + + + + /// + /// 修改实体 + /// + /// ID + /// 修改实体DTO + /// 实体DTO + [HttpPut] + [Route("{id}")] + [Authorize(SettleAccountPermissions.PriceLists.Update)] + virtual public async Task UpdateAsync(Guid id, PriceListBJDto input) + { + var entity = new PriceListBJ( + + ); + + var _ent = await _mng.UpdateAsync(id, entity); + + + var dto = ObjectMapper.Map(_ent); + return dto; + } + + /// + /// 删除实体 + /// + /// ID + /// + [HttpDelete] + [Route("{id}")] + //[Authorize(SettleAccountPermissions.PriceLists.Delete)] + virtual public async Task DeleteAsync(Guid id) + { + + await _mng.DeleteAsync(id); + } + + /// + /// 按IDs删除实体列表 + /// + /// ID列表 + /// 是否执行成功 + [HttpPost] + [Route("delete")] + //[Authorize(SettleAccountPermissions.PriceLists.Delete)] + virtual public async Task DeleteListAsync(List ids) + { + + return await _mng.DeleteListAsync(ids); + } + + /// + /// 导出文件 + /// + /// + /// + [HttpPost] + [Route("Export")] + //[Authorize(SettleAccountPermissions.PriceLists.Default)] + virtual public async Task ExportAsync(PriceListRequestDto input) + { + + IExporter _csv = new CsvExporter(); + IExporter _excel = new ExcelExporter(); + var entities = await _mng.GetListAsync(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}.xlsx", 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; + } + result.ShouldNotBeNull(); + + //保存导出文件到服务器存成二进制 + await _excelImportService.SaveBlobAsync( + new SaveExcelImportInputDto + { + Name = _fileName, + Content = result + } + ); + return _fileName; + } + + + + } +} + diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml index feb5aef7..d8f46b72 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml @@ -1397,6 +1397,92 @@ + + + 标准价格单-相关应用服务 + + + + + 按ID获取唯一实体 + + + 返回实体全部属性 + + ID + 实体DTO + + + + 根据筛选条件获取实体列表 + + + 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + + 请求条件 + 实体DTO列表 + + + + 根据筛选条件获取实体列表 + + + 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + + 请求条件 + 实体DTO列表 + + + + 获取实体总数 + + 实体总数 + + + + 获取全部实体列表 + + 实体DTO列表 + + + + 批量导入实体列表 + + + 以ID为依据,数据库中找不到ID的实体会新增,已有ID的实体会修改 + + 实体列表 + 是否导入成功 + + + + 修改实体 + + ID + 修改实体DTO + 实体DTO + + + + 删除实体 + + ID + + + + + 按IDs删除实体列表 + + ID列表 + 是否执行成功 + + + + 导出文件 + + + + 总成与结算件关系 diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 51cd3ac8..9c44fdb6 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -197,6 +197,10 @@ namespace Win.Sfs.SettleAccount CreateMapSettlementPakAndSparePartsVersion(); CreateMapSecMatchBaseDto(); + CreateMapPriceListBJVersion(); + CreateMapPriceListBJ(); + + #endregion @@ -596,6 +600,14 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); CreateMap().ReverseMap(); } + private void CreateMapPriceListBJVersion() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } @@ -608,7 +620,14 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); } + private void CreateMapPriceListBJ() + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } private void CreateMapInvoiceSettledDiff() diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs index b60d25c2..8c1f4e23 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs @@ -90,4 +90,78 @@ namespace Win.Sfs.SettleAccount.Entities.Prices public Guid ParentId { set; get; } } + public class PriceListBJ : FullAuditedAggregateRootBase + { + public PriceListBJ() + { } + public PriceListBJ(Guid Id, DateTime beginDate, DateTime endDate, decimal price, string materialCode, int type, Guid parentId, string version, string customerCode) : base(Id) + { + BeginDate = beginDate; + EndDate = endDate; + Price = price; + MaterialCode = materialCode; + Type = type; + ParentId = parentId; + Version = version; + CustomerCode = customerCode; + } + + public void Set(DateTime beginDate, DateTime endDate, decimal price, string materialCode, int type, string customerCode) + { + BeginDate = beginDate; + EndDate = endDate; + Price = price; + MaterialCode = materialCode; + Type = type; + CustomerCode = customerCode; + } + public void Update(Guid id, string version) + { + Id = id; + Version = version; + } + [Display(Name = "客户")] + public string CustomerCode { get; set; } + + /// + ///版本 + /// + [Display(Name = "版本")] + public string Version { set; get; } + + + /// + /// 开始时间 + /// + [Display(Name = "开始时间")] + public DateTime BeginDate { set; get; } + /// + /// 结束时间 + /// + [Display(Name = "结算时间")] + public DateTime EndDate { set; get; } + /// + /// 价格 + /// + [Display(Name = "价格")] + public Decimal Price { set; get; } + + /// + /// 物料编号 + /// + [Display(Name = "物料编号")] + public string MaterialCode { set; get; } + + /// + /// 类型 + /// + [Display(Name = "价格类型")] + public int Type { set; get; } + /// + /// 父Id + /// + [Display(Name = "父Id")] + public Guid ParentId { set; get; } + + } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs index 50f968ee..72806b30 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs @@ -171,5 +171,171 @@ namespace Win.Sfs.SettleAccount.Entities.Prices return entities; } } + + public class PriceListManagerBJ : DomainService + { + private readonly ISettleAccountBranchEfCoreRepository _repository; + private readonly ISettleAccountBranchEfCoreRepository _versionRepository; + protected PriceListManagerBJ() { } + public PriceListManagerBJ( + ISettleAccountBranchEfCoreRepository repository, + ISettleAccountBranchEfCoreRepository versionRepository + ) + { + _versionRepository = versionRepository; + _repository = repository; + } + public virtual async Task GetAsync(Guid id) + { + return await _repository.GetAsync(id); + } + + public virtual List GetPriceList(string version) + { + var entities = _repository.Where(p => p.Version == version); + return entities.ToList(); + } + + public virtual async Task> GetListAsync( + + List filters, + string sorting = null, + int maxResultCount = int.MaxValue, + int skipCount = 0, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), filters, sorting, maxResultCount, + skipCount); + return entities; + } + public virtual async Task> GetVersionListAsync( + + List filters, + string sorting = null, + int maxResultCount = int.MaxValue, + int skipCount = 0, + bool includeDetails = false, + CancellationToken cancellationToken = default) + { + var entities = await _versionRepository.GetListByFilterAsync(GuidGenerator.Create(), filters, sorting, maxResultCount, + skipCount); + return entities; + } + + + + public async Task GetCountAsync(List p_filter + , Guid branchId) + { + return await _repository.GetCountByFilterAsync(branchId, p_filter); + } + + + public virtual async Task> ImportAsync(List entities, string version) + { + List _errorList = new List(); + //写校验在这里 + + var pricelist = GetPriceList(version); + + + //var LeftJoin = from emp in ListOfEmployees + // join dept in ListOfDepartment + // on emp.DeptID equals dept.ID into JoinedEmpDept + // from dept in JoinedEmpDept.DefaultIfEmpty() + + var update = from itm1 in entities + join itm2 in pricelist + on new { itm1.Type, itm1.MaterialCode } equals new { itm2.Type, itm2.MaterialCode } + where itm1.Price != itm2.Price + select new PriceList(itm2.Id, itm2.BeginDate, itm2.EndDate, itm1.Price, itm2.MaterialCode, itm2.Type, itm2.ParentId, itm2.Version, itm1.CustomerCode); + + if (update.Count() > 0) + { + + await _repository.GetDbContext().BulkUpdateAsync(update.ToList()); + } + else + { + var add = from itm1 in entities + join itm2 in pricelist + on new { itm1.Type, itm1.MaterialCode } + equals new { itm2.Type, itm2.MaterialCode } + into temp + from itm3 in temp.DefaultIfEmpty() + where itm3 == null + select itm1; + await _repository.GetDbContext().BulkInsertAsync(add.ToList()); + + } + + + + + + + var _first = _versionRepository.FirstOrDefault(p => p.Version == version); + if (_first == null) + { + + List _versionList = new List() { new PriceListVersionBJ(GuidGenerator.Create(), DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), version) }; + await _versionRepository.GetDbContext().BulkInsertAsync(_versionList); + } + return _errorList; + } + + + public virtual async Task CreateAsync(PriceListBJ input) + { + var entity = new PriceListBJ( + GuidGenerator.Create(), input.BeginDate, input.EndDate, input.Price, input.MaterialCode, input.Type, input.ParentId, input.Version, input.CustomerCode + ); + + return await _repository.InsertAsync(entity); + + } + + + public virtual async Task UpdateAsync(Guid id, PriceListBJ input) + { + var entity = await _repository.GetAsync(id); + entity.Set( + input.BeginDate, input.EndDate, input.Price, input.MaterialCode, input.Type, input.CustomerCode + ); + return await _repository.UpdateAsync(entity); + + } + + + public virtual async Task DeleteAsync(Guid id) + { + await _repository.DeleteAsync(id); + } + + + public virtual async Task DeleteListAsync(List ids) + { + return await _repository.DeleteListAsync(ids); + } + + + public virtual async Task GetTotalCountAsync(Guid branchId) + { + return await _repository.GetCountAsync(branchId); + } + + public virtual async Task> GetAllAsync(Guid branchId) + { + var entities = await _repository.GetAllAsync(branchId); + + return entities; + } + } + + + + + } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListVersion.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListVersion.cs index b5307fa1..155c7d60 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListVersion.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListVersion.cs @@ -31,6 +31,31 @@ namespace Win.Sfs.SettleAccount.Entities.Prices Version = version; + } + } + public class PriceListVersionBJ : FullAuditedAggregateRootBase + { + public PriceListVersionBJ() + { } + public string Year { get; private set; } + /// + /// 期间 + /// + public string Period { get; private set; } + /// + /// 版本号 + /// + public string Version { get; set; } + + public string Factory { private set; get; } + public PriceListVersionBJ(Guid id, string year, string period, string version) : base(id) + { + + Year = year; + Period = period; + Version = version; + + } } } diff --git a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index 1761bedc..a94da223 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -354,6 +354,8 @@ namespace Win.Sfs.SettleAccount //一汽轿车出库 builder.ConfigureWmsHQCarOutPutVersion(options); builder.ConfigureWmsHQCarPutDetial(options); + builder.ConfigurePriceListVersionBJ(options); + builder.ConfigurePriceListBJ(options); #endregion @@ -1608,6 +1610,43 @@ namespace Win.Sfs.SettleAccount }); } + private static void ConfigurePriceListBJ(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) + { + + builder.Entity(b => + { + + b.ToTable($"{options.TablePrefix}_PriceListBJ", options.Schema); + + b.ConfigureByConvention(); + b.Property(x => x.MaterialCode).HasMaxLength(50); + b.Property(x => x.CustomerCode).HasMaxLength(50); + + }); + } + private static void ConfigurePriceListVersionBJ(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) + { + + builder.Entity(b => + { + + b.ToTable($"{options.TablePrefix}_PriceListVersionBJ", options.Schema); + + b.ConfigureByConvention(); + b.Property(x => x.Year).HasMaxLength(50); + b.Property(x => x.Period).HasMaxLength(50); + b.Property(x => x.Version).HasMaxLength(50); + b.Property(x => x.Factory).HasMaxLength(50); + + }); + } + + + + + + + //private static void ConfigureMaterialRelationshipVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) //{ @@ -1628,7 +1667,7 @@ namespace Win.Sfs.SettleAccount - + private static void ConfigureInvoiceSettledDiff(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)