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>
|
/// </summary>
|
||||||
public string? NewestTrackPlace { get; set; }
|
public string? NewestTrackPlace { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最新轨迹时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? NewestTrackTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否完结
|
/// 是否完结
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -91,12 +91,13 @@ namespace SJZY.Track.Application.Services.TrackContents
|
|||||||
{
|
{
|
||||||
#region 业务逻辑校验
|
#region 业务逻辑校验
|
||||||
|
|
||||||
var trackContentEntity = await _trackContentRepository.GetFirstAsync(a =>
|
var trackContentEntitys = await _trackContentRepository.GetListAsync(a =>
|
||||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||||
a.Content == input.Content || a.EnContent == input.EnContent));
|
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 业务逻辑校验
|
#endregion 业务逻辑校验
|
||||||
@ -111,14 +112,14 @@ namespace SJZY.Track.Application.Services.TrackContents
|
|||||||
{
|
{
|
||||||
#region 业务逻辑校验
|
#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.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||||
a.Content == input.Content || a.EnContent == input.EnContent));
|
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 业务逻辑校验
|
#endregion 业务逻辑校验
|
||||||
|
|
||||||
//更新的时候需要覆盖内容映射轨迹代码
|
//更新的时候需要覆盖内容映射轨迹代码
|
||||||
|
|||||||
@ -91,7 +91,7 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
|||||||
Expression<Func<TrackPullConfigEntity, bool>> isAnyExp = x =>
|
Expression<Func<TrackPullConfigEntity, bool>> isAnyExp = x =>
|
||||||
x.SubSystemId == input.SubSystemId && x.TrackTemplateId == input.TrackTemplateId &&
|
x.SubSystemId == input.SubSystemId && x.TrackTemplateId == input.TrackTemplateId &&
|
||||||
x.ServiceProviderId == input.ServiceProviderId;
|
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))
|
if (await _trackPullConfigRepository.IsAnyAsync(isAnyExp))
|
||||||
throw new BusinessException(message: _stringLocalizer["IsTrackPullConfigAny"]);
|
throw new BusinessException(message: _stringLocalizer["IsTrackPullConfigAny"]);
|
||||||
|
|||||||
@ -104,12 +104,14 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
Expression<Func<TrackPushConfigEntity, bool>> isAnyExp = x =>
|
Expression<Func<TrackPushConfigEntity, bool>> isAnyExp = x =>
|
||||||
x.SubSystemId == input.SubSystemId && x.CustomId == input.CustomId && x.ServiceProviderId == input.ServiceProviderId;
|
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>();
|
var trackTemplateIdExp = Expressionable.Create<TrackPushConfigEntity>();
|
||||||
foreach (var trackTemplateId in input.TrackTemplateIds) { trackTemplateIdExp.Or(x => SqlFunc.SplitIn(x.TrackTemplateId, trackTemplateId.ToString())); }
|
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"]);
|
throw new BusinessException(message: _stringLocalizer["IsTrackPushConfigAny"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,7 +200,7 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
Expression<Func<TrackPushContentConfigEntity, bool>> isContentAnyExp = x =>
|
Expression<Func<TrackPushContentConfigEntity, bool>> isContentAnyExp = x =>
|
||||||
x.TrackPushConfigId == input.TrackPushConfigId && x.TrackContentId == input.TrackContentId;
|
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))
|
if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp))
|
||||||
throw new BusinessException(message: _stringLocalizer["IsTrackPushContentAny"]);
|
throw new BusinessException(message: _stringLocalizer["IsTrackPushContentAny"]);
|
||||||
|
|||||||
@ -193,11 +193,11 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
if (input.Options != OptionTypeNoNull.删除)
|
if (input.Options != OptionTypeNoNull.删除)
|
||||||
{
|
{
|
||||||
Expression<Func<TrackTemplateContentEntity, bool>> isAnyExp = x =>
|
Expression<Func<TrackTemplateContentEntity, bool>> isContentAnyExp = x =>
|
||||||
x.TrackTemplateId == input.TrackTemplateId && x.TrackContentId == input.TrackContentId;
|
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"]);
|
throw new BusinessException(message: _stringLocalizer["IsTrackTemplateContentAny"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ namespace SJZY.Track.Domain.Dtos.Order
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单名称
|
/// 订单名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string OrderTypeName { get; set; }
|
public string OrderTypeName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单号
|
/// 订单号
|
||||||
@ -89,6 +89,11 @@ namespace SJZY.Track.Domain.Dtos.Order
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? NewestTrackPlace { get; set; }
|
public string? NewestTrackPlace { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最新轨迹时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? NewestTrackTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否完结
|
/// 是否完结
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -127,6 +127,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
NewestTrackContent = a.LatestTrackContent,
|
NewestTrackContent = a.LatestTrackContent,
|
||||||
NewestTrackEnContent = a.LatestTrackEnContent,
|
NewestTrackEnContent = a.LatestTrackEnContent,
|
||||||
NewestTrackPlace = a.LatestTrackPlace,
|
NewestTrackPlace = a.LatestTrackPlace,
|
||||||
|
NewestTrackTime = a.LatestTrackTime,
|
||||||
IsFinish = a.IsCompleted,
|
IsFinish = a.IsCompleted,
|
||||||
CreateTime = a.CreateTime,
|
CreateTime = a.CreateTime,
|
||||||
SubSystem = c.CnName
|
SubSystem = c.CnName
|
||||||
|
|||||||
@ -72,8 +72,8 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
Content = a.Content,
|
Content = a.Content,
|
||||||
EnContent = a.EnContent,
|
EnContent = a.EnContent,
|
||||||
TrackStatus = b.Status,
|
TrackStatus = b.Status,
|
||||||
Node = SqlFunc.IF(b.Node == 1).Return("揽收").ElseIF(b.Node == 2).Return("干线").ElseIF(b.Node == 3).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("派送")
|
.ElseIF(b.Node == 4).Return("派送").ElseIF(b.Node == 5).Return("其他")
|
||||||
.End(""),
|
.End(""),
|
||||||
TrackFlag = c.Name,
|
TrackFlag = c.Name,
|
||||||
CreateTime = a.CreateTime,
|
CreateTime = a.CreateTime,
|
||||||
@ -83,8 +83,6 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
})
|
})
|
||||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
|
|
||||||
var ff = await Context.Queryable<TrackContentEntity>().Where(a => 1 == 1).ToListAsync();
|
|
||||||
|
|
||||||
return pagedList;
|
return pagedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user