diff --git a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs
index be5dbb69..7ae6fd7a 100644
--- a/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs
+++ b/src/SJZY.Track.Application.Contract/Dtos/ProvideServices/GetPageTrackOrderInput.cs
@@ -83,6 +83,11 @@ public class TrackOrderDto
///
public string? NewestTrackPlace { get; set; }
+ ///
+ /// 最新轨迹时间
+ ///
+ public DateTime? NewestTrackTime { get; set; }
+
///
/// 是否完结
///
diff --git a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs
index b746323f..82e7bba1 100644
--- a/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs
+++ b/src/SJZY.Track.Application/Services/TrackContents/TrackContentService.cs
@@ -91,12 +91,13 @@ namespace SJZY.Track.Application.Services.TrackContents
{
#region 业务逻辑校验
- var trackContentEntity = await _trackContentRepository.GetFirstAsync(a =>
+ var trackContentEntitys = await _trackContentRepository.GetListAsync(a =>
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
a.Content == input.Content || a.EnContent == input.EnContent));
- if (trackContentEntity != null)
+ if (trackContentEntitys.Any())
{
- throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
+ //throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
+ throw new BusinessException(message: "当前子系统下,轨迹代码或轨迹内容或轨迹内容英文存在");
}
#endregion 业务逻辑校验
@@ -111,14 +112,14 @@ namespace SJZY.Track.Application.Services.TrackContents
{
#region 业务逻辑校验
- var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => a.Id != input.Id &&
+ var trackContentEntitys = await _trackContentRepository.GetListAsync(a => a.Id != input.Id &&
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
a.Content == input.Content || a.EnContent == input.EnContent));
- if (trackContentEntity != null)
+ if (trackContentEntitys.Any())
{
- throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
+ //throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
+ throw new BusinessException(message: "当前子系统下,轨迹代码或轨迹内容或轨迹内容英文存在");
}
-
#endregion 业务逻辑校验
//更新的时候需要覆盖内容映射轨迹代码
diff --git a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs
index 7f1ad2de..5f9bd451 100644
--- a/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs
+++ b/src/SJZY.Track.Application/Services/TrackPull/TrackPullService.cs
@@ -91,7 +91,7 @@ public class TrackPullService : ApplicationService, ITransientDependency
Expression> isAnyExp = x =>
x.SubSystemId == input.SubSystemId && x.TrackTemplateId == input.TrackTemplateId &&
x.ServiceProviderId == input.ServiceProviderId;
- if (input.Options == OptionTypeNoNull.修改) isAnyExp.And(x => x.Id != input.Id);
+ if (input.Options == OptionTypeNoNull.修改) isAnyExp = isAnyExp.And(x => x.Id != input.Id);
if (await _trackPullConfigRepository.IsAnyAsync(isAnyExp))
throw new BusinessException(message: _stringLocalizer["IsTrackPullConfigAny"]);
diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs
index 85ef0633..0577b1cf 100644
--- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs
+++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs
@@ -104,12 +104,14 @@ public class TrackPushService : ApplicationService, ITransientDependency
{
Expression> isAnyExp = x =>
x.SubSystemId == input.SubSystemId && x.CustomId == input.CustomId && x.ServiceProviderId == input.ServiceProviderId;
- if (input.Options == OptionTypeNoNull.修改) isAnyExp.And(x => x.Id != input.Id);
+ if (input.Options == OptionTypeNoNull.修改) isAnyExp = isAnyExp.And(x => x.Id != input.Id);
var trackTemplateIdExp = Expressionable.Create();
foreach (var trackTemplateId in input.TrackTemplateIds) { trackTemplateIdExp.Or(x => SqlFunc.SplitIn(x.TrackTemplateId, trackTemplateId.ToString())); }
- if (await _trackPushConfigRepository.IsAnyAsync(isAnyExp.And(trackTemplateIdExp.ToExpression())))
+ isAnyExp = isAnyExp.And(trackTemplateIdExp.ToExpression());
+
+ if (await _trackPushConfigRepository.IsAnyAsync(isAnyExp))
throw new BusinessException(message: _stringLocalizer["IsTrackPushConfigAny"]);
}
@@ -198,7 +200,7 @@ public class TrackPushService : ApplicationService, ITransientDependency
{
Expression> isContentAnyExp = x =>
x.TrackPushConfigId == input.TrackPushConfigId && x.TrackContentId == input.TrackContentId;
- if (input.Options == OptionTypeNoNull.修改) isContentAnyExp.And(x => x.Id != input.Id);
+ if (input.Options == OptionTypeNoNull.修改) isContentAnyExp = isContentAnyExp.And(x => x.Id != input.Id);
if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp))
throw new BusinessException(message: _stringLocalizer["IsTrackPushContentAny"]);
diff --git a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs
index a250f22b..621ae61a 100644
--- a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs
+++ b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs
@@ -193,11 +193,11 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
{
if (input.Options != OptionTypeNoNull.删除)
{
- Expression> isAnyExp = x =>
+ Expression> isContentAnyExp = x =>
x.TrackTemplateId == input.TrackTemplateId && x.TrackContentId == input.TrackContentId;
- if (input.Options == OptionTypeNoNull.修改) isAnyExp.And(x => x.Id != input.Id);
+ if (input.Options == OptionTypeNoNull.修改) isContentAnyExp = isContentAnyExp.And(x => x.Id != input.Id);
- if (await _trackTemplateRepository.IsContentAnyAsync(isAnyExp))
+ if (await _trackTemplateRepository.IsContentAnyAsync(isContentAnyExp))
throw new BusinessException(message: _stringLocalizer["IsTrackTemplateContentAny"]);
}
diff --git a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
index 44567900..35ad2966 100644
--- a/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
+++ b/src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
@@ -47,7 +47,7 @@ namespace SJZY.Track.Domain.Dtos.Order
///
/// 订单名称
///
- public string OrderTypeName { get; set; }
+ public string OrderTypeName { get; set; }
///
/// 订单号
@@ -89,6 +89,11 @@ namespace SJZY.Track.Domain.Dtos.Order
///
public string? NewestTrackPlace { get; set; }
+ ///
+ /// 最新轨迹时间
+ ///
+ public DateTime? NewestTrackTime { get; set; }
+
///
/// 是否完结
///
diff --git a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs
index 05fc2db1..ac5b7f61 100644
--- a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs
+++ b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs
@@ -127,6 +127,7 @@ public class OrderRepository : BasicRepository, IOrderRepository, I
NewestTrackContent = a.LatestTrackContent,
NewestTrackEnContent = a.LatestTrackEnContent,
NewestTrackPlace = a.LatestTrackPlace,
+ NewestTrackTime = a.LatestTrackTime,
IsFinish = a.IsCompleted,
CreateTime = a.CreateTime,
SubSystem = c.CnName
diff --git a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs
index 6946391e..673bb0b5 100644
--- a/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs
+++ b/src/SJZY.Track.Repository/Repositories/TrackContentRepository.cs
@@ -72,8 +72,8 @@ public class TrackContentRepository : BasicRepository, ITrac
Content = a.Content,
EnContent = a.EnContent,
TrackStatus = b.Status,
- Node = SqlFunc.IF(b.Node == 1).Return("揽收").ElseIF(b.Node == 2).Return("干线").ElseIF(b.Node == 3).Return("清关")
- .ElseIF(b.Node == 4).Return("中转").ElseIF(b.Node == 5).Return("派送")
+ Node = SqlFunc.IF(b.Node == 1).Return("揽收").ElseIF(b.Node == 2).Return("清关").ElseIF(b.Node == 3).Return("干线")
+ .ElseIF(b.Node == 4).Return("派送").ElseIF(b.Node == 5).Return("其他")
.End(""),
TrackFlag = c.Name,
CreateTime = a.CreateTime,
@@ -83,8 +83,6 @@ public class TrackContentRepository : BasicRepository, ITrac
})
.ToPagedListAsync(input.PageIndex, input.PageSize);
- var ff = await Context.Queryable().Where(a => 1 == 1).ToListAsync();
-
return pagedList;
}