From a5cbed7c5a2f7af6f4a850298e87c6ac5c6e6aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Wed, 1 Nov 2023 16:02:39 +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 --- .../Bases/PD_SERVICE.cs | 2 +- .../Entities/BQ/BBAC_BA_SERVICE.cs | 3 +- .../Entities/BQ/HBPO_BA_SERVICE.cs | 2 +- .../BQ/Syncs/PendingDeductionService.cs | 1 + .../Entities/Prices/PriceListAppService.cs | 55 +++++++++++++++++++ 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs index 30bc7e39..12854b6f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs @@ -232,7 +232,7 @@ namespace Win.Sfs.SettleAccount.Bases } var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList(); - var first1 = detailist.FirstOrDefault(); + var first1 = detailist.Where(p=>p.BusinessType!=0).FirstOrDefault(); List customConditionList = new List(); customConditionList.Add(new CustomCondition() { Name = "BillNumList", Value = string.Join(",", p_list) }); customConditionList.Add(new CustomCondition() { Name = "Type", Value = first1.BusinessType.ToString() }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index 57bdd48b..026893ad 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -391,7 +391,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ site: itm.Site, qty: itm.Qty, price: itm.Price, - category: itm.BusinessType, + category: inv.BusinessType, isReturn: itm.Qty > 0 ? false : true, settleDate: itm.SettleDate, groupNum: itm.GroupNum, @@ -399,6 +399,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ contactid: itm.Extend1,//生产号 invbillnum: string.Empty, partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode + )); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs index 56d1823a..0180ebdf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs @@ -377,7 +377,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ site: itm.Site, qty: itm.Qty, price: itm.Price, - businessType: itm.BusinessType, + businessType: inv.BusinessType, settleDate: itm.SettleDate, groupNum: itm.GroupNum, invGroupNum: inv.InvGroupNum, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs index 2d854c5c..754c71fe 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs @@ -222,6 +222,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs ReMark = itm.Extend3 }; var ls = query.ToList(); + foreach (var itm in ls) { itm.SetId(GuidGenerator.Create()); 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 2b461558..8d2a3849 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 @@ -272,6 +272,61 @@ namespace Win.Sfs.SettleAccount.Entities.Prices var dto = ObjectMapper.Map(entity); return dto; } + /// + /// 修改实体 + /// 修改作废状态 + /// + //[HttpPost] + //public async Task UpdateListAsync(List p_list) + //{ + // foreach (var itm in p_list) + // { + // var entity = await _settleAccountDbContext.Set().FindAsync(itm).ConfigureAwait(false); + // entity.IsCancel = input.IsCancel; + // if (entity.IsCancel == false) + // { + // var existPriceList = _settleAccountDbContext.Set() + // .Where(t => t.LU == entity.LU) + // .Where(t => t.IsCancel == false) + // .Where(t => t.Id != entity.Id) + // .ToList(); + + // var existPrice = existPriceList.Find(t => (entity.BeginTime >= t.BeginTime && entity.BeginTime < t.EndTime) || (t.BeginTime >= entity.BeginTime && t.BeginTime < entity.EndTime)); + // if (existPrice != null) + // { + // throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPrice.BeginTime:yyyy-MM-dd}至{existPrice.EndTime:yyyy-MM-dd}】存在交集", "400"); + // } + // } + + + + + // } + + // var entity = await _settleAccountDbContext.Set().FindAsync(input.Id).ConfigureAwait(false); + // entity.IsCancel = input.IsCancel; + // if (entity.IsCancel == false) + // { + // var existPriceList = _settleAccountDbContext.Set() + // .Where(t => t.LU == entity.LU) + // .Where(t => t.IsCancel == false) + // .Where(t => t.Id != entity.Id) + // .ToList(); + + // var existPrice = existPriceList.Find(t => (entity.BeginTime >= t.BeginTime && entity.BeginTime < t.EndTime) || (t.BeginTime >= entity.BeginTime && t.BeginTime < entity.EndTime)); + // if (existPrice != null) + // { + // throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPrice.BeginTime:yyyy-MM-dd}至{existPrice.EndTime:yyyy-MM-dd}】存在交集", "400"); + // } + // } + // await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); + // var dto = ObjectMapper.Map(entity); + // return dto; + //} + + + + #endregion } }