Merge pull request 'S01-轨迹中台' (#16) from S01-轨迹中台 into dev
Reviewed-on: http://192.168.80.50:3000/Dotnet/SJZY.Track.Api/pulls/16
This commit is contained in:
commit
0500165708
@ -83,6 +83,11 @@ public class TrackOrderDto
|
||||
/// </summary>
|
||||
public string? NewestTrackPlace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新轨迹时间
|
||||
/// </summary>
|
||||
public DateTime? NewestTrackTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否完结
|
||||
/// </summary>
|
||||
|
||||
@ -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 业务逻辑校验
|
||||
|
||||
//更新的时候需要覆盖内容映射轨迹代码
|
||||
|
||||
@ -91,7 +91,7 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
||||
Expression<Func<TrackPullConfigEntity, bool>> 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"]);
|
||||
|
||||
@ -104,12 +104,14 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
||||
{
|
||||
Expression<Func<TrackPushConfigEntity, bool>> 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<TrackPushConfigEntity>();
|
||||
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<Func<TrackPushContentConfigEntity, bool>> 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"]);
|
||||
|
||||
@ -193,11 +193,11 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
||||
{
|
||||
if (input.Options != OptionTypeNoNull.删除)
|
||||
{
|
||||
Expression<Func<TrackTemplateContentEntity, bool>> isAnyExp = x =>
|
||||
Expression<Func<TrackTemplateContentEntity, bool>> 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"]);
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ namespace SJZY.Track.Domain.Dtos.Order
|
||||
/// <summary>
|
||||
/// 订单名称
|
||||
/// </summary>
|
||||
public string OrderTypeName { get; set; }
|
||||
public string OrderTypeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
@ -89,6 +89,11 @@ namespace SJZY.Track.Domain.Dtos.Order
|
||||
/// </summary>
|
||||
public string? NewestTrackPlace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新轨迹时间
|
||||
/// </summary>
|
||||
public DateTime? NewestTrackTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否完结
|
||||
/// </summary>
|
||||
|
||||
@ -127,6 +127,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
NewestTrackContent = a.LatestTrackContent,
|
||||
NewestTrackEnContent = a.LatestTrackEnContent,
|
||||
NewestTrackPlace = a.LatestTrackPlace,
|
||||
NewestTrackTime = a.LatestTrackTime,
|
||||
IsFinish = a.IsCompleted,
|
||||
CreateTime = a.CreateTime,
|
||||
SubSystem = c.CnName
|
||||
|
||||
@ -72,8 +72,8 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, 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<TrackContentEntity>, ITrac
|
||||
})
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
|
||||
var ff = await Context.Queryable<TrackContentEntity>().Where(a => 1 == 1).ToListAsync();
|
||||
|
||||
return pagedList;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user