|
|
@ -214,16 +214,16 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ> |
|
|
|
entity.IsCancel = input.IsCancel; |
|
|
|
if (entity.IsCancel == false) |
|
|
|
{ |
|
|
|
var existsPriceBjList = _settleAccountDbContext.Set<PriceListBJ>() |
|
|
|
var existPriceBjList = _settleAccountDbContext.Set<PriceListBJ>() |
|
|
|
.Where(t => t.LU == entity.LU) |
|
|
|
.Where(t => t.IsCancel == false) |
|
|
|
.Where(t => t.Id != entity.Id) |
|
|
|
.ToList(); |
|
|
|
|
|
|
|
var existsPriceBj = existsPriceBjList.Find(t => (entity.BeginDate >= t.BeginDate && entity.BeginDate < t.EndDate) || (t.BeginDate >= entity.BeginDate && t.BeginDate < entity.EndDate)); |
|
|
|
if (existsPriceBj != null) |
|
|
|
var existPriceBj = existPriceBjList.Find(t => (entity.BeginDate >= t.BeginDate && entity.BeginDate < t.EndDate) || (t.BeginDate >= entity.BeginDate && t.BeginDate < entity.EndDate)); |
|
|
|
if (existPriceBj != null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existsPriceBj.BeginDate:yyyy-MM-dd}至{existsPriceBj.EndDate:yyyy-MM-dd}】存在交集", "400"); |
|
|
|
throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPriceBj.BeginDate:yyyy-MM-dd}至{existPriceBj.EndDate:yyyy-MM-dd}】存在交集", "400"); |
|
|
|
} |
|
|
|
} |
|
|
|
_settleAccountDbContext.Set<PriceListBJ>().Update(entity); |
|
|
|