update: 解除新增轨迹对不允许重复的轨迹内容的校验

This commit is contained in:
云龙 王 2024-11-18 14:50:28 +08:00
parent 7bc3e09d90
commit 811b38c38d

View File

@ -89,12 +89,6 @@ public partial class TrackService : ApplicationService, ITrackService
var tracks = await _trackDetailsEsRepository.GetListAsync(new[] { order.Id }, input.TrackCode, true); var tracks = await _trackDetailsEsRepository.GetListAsync(new[] { order.Id }, input.TrackCode, true);
//轨迹内容不允许重复,并且已经存在了轨迹记录
if (input.IsAdd && !trackContent.IsRepeatable && tracks.Count >= 1)
{
throw new BusinessException(message: $"轨迹代码:{input.TrackCode}不允许重复添加");
}
//更新轨迹,但存在多条轨迹记录,理由:不清晰到底要修改哪一条或是全部修改 //更新轨迹,但存在多条轨迹记录,理由:不清晰到底要修改哪一条或是全部修改
if (!input.IsAdd && tracks.Count > 1) if (!input.IsAdd && tracks.Count > 1)
{ {
@ -324,12 +318,6 @@ public partial class TrackService : ApplicationService, ITrackService
var tracks = await _trackDetailsEsRepository.GetListAsync(new[] { order.Id }, input.TrackCode, true); var tracks = await _trackDetailsEsRepository.GetListAsync(new[] { order.Id }, input.TrackCode, true);
//轨迹内容不允许重复,并且已经存在了轨迹记录
if (input.IsAdd && !trackContent.IsRepeatable && tracks.Count >= 1)
{
throw new BusinessException(message: $"轨迹代码:{input.TrackCode}不允许重复添加");
}
//更新轨迹,存在多条轨迹记录不允许更改,理由:不清晰到底要修改哪一条或是全部修改 //更新轨迹,存在多条轨迹记录不允许更改,理由:不清晰到底要修改哪一条或是全部修改
if (!input.IsAdd && tracks.Count > 1) if (!input.IsAdd && tracks.Count > 1)
{ {