From e71c8d8ee53ee71f59036d3c405dda717778ab80 Mon Sep 17 00:00:00 2001 From: mahao Date: Mon, 10 Jul 2023 13:10:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=80=E5=94=AE=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Prices/PriceListAppService.cs | 2 +- .../Entities/Prices/PriceList.cs | 69 +++++++++++++------ .../Entities/Prices/PriceListManager.cs | 6 +- 3 files changed, 53 insertions(+), 24 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index c33ba1f8..54fcfc5e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -215,7 +215,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var entityList = ObjectMapper.Map, List>(result); - var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); + var _ls = entityList.Where(p=>p.EndTime.ToString().Contains("9999")).OrderByDescending(p => p.BeginTime).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); foreach (var itm in _ls) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs index 8c1f4e23..da4d0a32 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs @@ -16,14 +16,18 @@ namespace Win.Sfs.SettleAccount.Entities.Prices public decimal SapPrice { set; get; } } - public class PriceList:FullAuditedAggregateRootBase + + /// + /// 销售价格 + /// + public class PriceList : FullAuditedAggregateRootBase { public PriceList() { } - public PriceList(Guid Id,DateTime beginDate, DateTime endDate, decimal price, string materialCode, int type,Guid parentId,string version, string customerCode) :base(Id) + public PriceList(Guid Id, DateTime beginDate, DateTime endDate, decimal price, string materialCode, int type, Guid parentId, string version, string customerCode) : base(Id) { - BeginDate = beginDate; - EndDate = endDate; + BeginTime = beginDate; + EndTime = endDate; Price = price; MaterialCode = materialCode; Type = type; @@ -32,51 +36,76 @@ namespace Win.Sfs.SettleAccount.Entities.Prices CustomerCode = customerCode; } - public void Set(DateTime beginDate, DateTime endDate, decimal price, string materialCode, int type,string customerCode) + public void Set(DateTime beginDate, DateTime endDate, decimal price, string materialCode, int type, string customerCode) { - BeginDate = beginDate; - EndDate = endDate; + BeginTime = beginDate; + EndTime = endDate; Price = price; MaterialCode = materialCode; Type = type; CustomerCode = customerCode; } - public void Update(Guid id,string version) + 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 string LU { get; set; } + /// + /// 价格 + /// + [Display(Name = "价格")] + public Decimal Price { set; get; } /// /// 开始时间 /// [Display(Name = "开始时间")] - public DateTime BeginDate { set; get; } + public DateTime BeginTime { set; get; } + /// /// 结束时间 /// - [Display(Name = "结算时间")] - public DateTime EndDate { set; get; } + [Display(Name = "结束时间")] + public DateTime EndTime { set; get; } + /// - /// 价格 + /// 客户编码 /// - [Display(Name = "价格")] - public Decimal Price { set; get; } + [Display(Name = "客户编码")] + public string ClientCode { get; set; } + + /// + /// 业务类别 + /// + [Display(Name = "业务类别")] + public string BusinessType { get; set; } + + + + + /// + ///版本 + /// + [Display(Name = "版本")] + public string Version { set; get; } + + + + [Display(Name = "客户")] + public string CustomerCode { get; set; } /// /// 物料编号 /// [Display(Name = "物料编号")] - public string MaterialCode { set; get; } + public string MaterialCode { set; get; } /// /// 类型 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs index 3040074a..af23c6ea 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs @@ -87,7 +87,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices join itm2 in pricelist on new { itm1.Type, itm1.MaterialCode,itm1.CustomerCode } equals new { itm2.Type, itm2.MaterialCode, itm2.CustomerCode } 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); + select new PriceList(itm2.Id, itm2.BeginTime, itm2.EndTime, itm1.Price, itm2.MaterialCode, itm2.Type, itm2.ParentId, itm2.Version, itm1.CustomerCode); if (update.Count() > 0) { @@ -122,7 +122,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices public virtual async Task CreateAsync(PriceList input) { var entity = new PriceList( - GuidGenerator.Create(), input.BeginDate, input.EndDate, input.Price, input.MaterialCode, input.Type,input.ParentId,input.Version,input.CustomerCode + GuidGenerator.Create(), input.BeginTime, input.EndTime, input.Price, input.MaterialCode, input.Type,input.ParentId,input.Version,input.CustomerCode ); return await _repository.InsertAsync(entity); @@ -134,7 +134,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices { var entity = await _repository.GetAsync(id); entity.Set( - input.BeginDate, input.EndDate, input.Price, input.MaterialCode, input.Type,input.CustomerCode + input.BeginTime, input.EndTime, input.Price, input.MaterialCode, input.Type,input.CustomerCode ); return await _repository.UpdateAsync(entity);