|
|
@ -272,6 +272,61 @@ namespace Win.Sfs.SettleAccount.Entities.Prices |
|
|
|
var dto = ObjectMapper.Map<PriceList, PriceListDto>(entity); |
|
|
|
return dto; |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// 修改实体
|
|
|
|
/// 修改作废状态
|
|
|
|
/// </summary>
|
|
|
|
//[HttpPost]
|
|
|
|
//public async Task<PriceListDto> UpdateListAsync(List<Guid> p_list)
|
|
|
|
//{
|
|
|
|
// foreach (var itm in p_list)
|
|
|
|
// {
|
|
|
|
// var entity = await _settleAccountDbContext.Set<PriceList>().FindAsync(itm).ConfigureAwait(false);
|
|
|
|
// entity.IsCancel = input.IsCancel;
|
|
|
|
// if (entity.IsCancel == false)
|
|
|
|
// {
|
|
|
|
// var existPriceList = _settleAccountDbContext.Set<PriceList>()
|
|
|
|
// .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<PriceList>().FindAsync(input.Id).ConfigureAwait(false);
|
|
|
|
// entity.IsCancel = input.IsCancel;
|
|
|
|
// if (entity.IsCancel == false)
|
|
|
|
// {
|
|
|
|
// var existPriceList = _settleAccountDbContext.Set<PriceList>()
|
|
|
|
// .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<PriceList, PriceListDto>(entity);
|
|
|
|
// return dto;
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
} |
|
|
|
} |
|
|
|