Merge branch 'S01-轨迹中台' into dev

This commit is contained in:
moyongzhen 2024-03-02 12:16:36 +08:00
commit e7f7eecbe0
2 changed files with 9 additions and 8 deletions

View File

@ -86,14 +86,13 @@ namespace SJZY.Track.Application.Services.TrackFlags
private async Task<UnifyResultDto> AddAsync(EditTrackFlagInput input)
{
#region 业务校验
var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a =>
var trackStatusEntitys = await _trackFlagRepository.GetListAsync(a =>
a.SubSystemId == input.SubSystemId && (a.Code == input.Code || a.Name == input.Flag));
if (trackStatusEntity != null)
if (trackStatusEntitys.Any())
{
throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
//throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
throw new BusinessException(message: "当前子系统下已存在轨迹标记代码");
}
#endregion
var entity = ObjectMapper.Map<EditTrackFlagInput, TrackFlagEntity>(input);
@ -106,12 +105,13 @@ namespace SJZY.Track.Application.Services.TrackFlags
{
#region 业务校验
var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a => a.Id != input.Id &&
var trackStatusEntitys = await _trackFlagRepository.GetListAsync(a => a.Id != input.Id &&
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
a.Name == input.Flag));
if (trackStatusEntity != null)
if (trackStatusEntitys.Any())
{
throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
//throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
throw new BusinessException(message: "当前子系统下已存在轨迹标记代码");
}
#endregion

View File

@ -112,6 +112,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
(a, b, c) => a.CreateTime >= input.CreateTimeStart)
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
(a, b, c) => a.CreateTime <= input.CreateTimeEnd)
.OrderByDescending((a, b, c) => a.CreateTime)
.Select((a, b, c) => new TrackOrderVO
{
Id = a.Id,