|
@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Http; |
|
|
using Microsoft.AspNetCore.Http; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Shouldly; |
|
|
using Shouldly; |
|
|
|
|
|
using Volo.Abp; |
|
|
using Volo.Abp.Application.Dtos; |
|
|
using Volo.Abp.Application.Dtos; |
|
|
using Volo.Abp.Caching; |
|
|
using Volo.Abp.Caching; |
|
|
using Win.Abp.Snowflakes; |
|
|
using Win.Abp.Snowflakes; |
|
@ -255,11 +256,17 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList> |
|
|
entity.IsCancel = input.IsCancel; |
|
|
entity.IsCancel = input.IsCancel; |
|
|
if (entity.IsCancel == false) |
|
|
if (entity.IsCancel == false) |
|
|
{ |
|
|
{ |
|
|
var ddd = _settleAccountDbContext.Set<PriceList>() |
|
|
var existsPriceList = _settleAccountDbContext.Set<PriceList>() |
|
|
.Where(t => t.LU == entity.LU) |
|
|
.Where(t => t.LU == entity.LU) |
|
|
.Where(t => t.IsCancel == false) |
|
|
.Where(t => t.IsCancel == false) |
|
|
.Where(t => t.Id != entity.Id) |
|
|
.Where(t => t.Id != entity.Id) |
|
|
.ToList(); |
|
|
.ToList(); |
|
|
|
|
|
|
|
|
|
|
|
var existsPrice = existsPriceList.Find(t => (entity.BeginTime > t.BeginTime && entity.BeginTime < t.EndTime) || (t.BeginTime > entity.BeginTime && t.BeginTime < entity.EndTime)); |
|
|
|
|
|
if (existsPrice != null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existsPrice.BeginTime:yyyy-MM-dd}至{existsPrice.EndTime:yyyy-MM-dd}】存在交集", "400"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
_settleAccountDbContext.Set<PriceList>().Update(entity); |
|
|
_settleAccountDbContext.Set<PriceList>().Update(entity); |
|
|
var dto = ObjectMapper.Map<PriceList, PriceListDto>(entity); |
|
|
var dto = ObjectMapper.Map<PriceList, PriceListDto>(entity); |
|
|