Merge branch 'S01-轨迹中台' of http://192.168.80.50:3000/Dotnet/SJZY.Track.Api into S01-轨迹中台
This commit is contained in:
commit
02af7bc45e
@ -101,7 +101,22 @@ namespace SJZY.Track.Application.Services.TrackContents
|
||||
if (trackContentEntitys.Any())
|
||||
{
|
||||
//throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
|
||||
throw new BusinessException(message: "当前子系统下,轨迹代码或轨迹内容或轨迹内容英文存在");
|
||||
var codes = trackContentEntitys.FirstOrDefault(a => a.Code==input.Code);
|
||||
if (codes!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹代码已存在");
|
||||
}
|
||||
var contents = trackContentEntitys.FirstOrDefault(a => a.Content==input.Content);
|
||||
if (contents!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹内容已存在");
|
||||
}
|
||||
var contentEns = trackContentEntitys.FirstOrDefault(a => a.EnContent==input.EnContent);
|
||||
if (contentEns!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹内容英文已存在");
|
||||
}
|
||||
//throw new BusinessException(message: "当前子系统下,轨迹代码或轨迹内容或轨迹内容英文存在");
|
||||
}
|
||||
|
||||
#endregion 业务逻辑校验
|
||||
@ -122,7 +137,22 @@ namespace SJZY.Track.Application.Services.TrackContents
|
||||
if (trackContentEntitys.Any())
|
||||
{
|
||||
//throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
|
||||
throw new BusinessException(message: "当前子系统下,轨迹代码或轨迹内容或轨迹内容英文存在");
|
||||
//throw new BusinessException(message: "当前子系统下,轨迹代码或轨迹内容或轨迹内容英文存在");
|
||||
var codes = trackContentEntitys.FirstOrDefault(a => a.Code==input.Code);
|
||||
if (codes!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹代码已存在");
|
||||
}
|
||||
var contents = trackContentEntitys.FirstOrDefault(a => a.Content==input.Content);
|
||||
if (contents!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹内容已存在");
|
||||
}
|
||||
var contentEns = trackContentEntitys.FirstOrDefault(a => a.EnContent==input.EnContent);
|
||||
if (contentEns!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹内容英文已存在");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 业务逻辑校验
|
||||
|
||||
@ -86,12 +86,22 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
||||
private async Task<UnifyResultDto> AddAsync(EditTrackFlagInput input)
|
||||
{
|
||||
#region 业务校验
|
||||
var trackStatusEntitys = await _trackFlagRepository.GetListAsync(a =>
|
||||
var trackFlagsEntitys = await _trackFlagRepository.GetListAsync(a =>
|
||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code || a.Name == input.Flag));
|
||||
if (trackStatusEntitys.Any())
|
||||
if (trackFlagsEntitys.Any())
|
||||
{
|
||||
//throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
|
||||
throw new BusinessException(message: "当前子系统下已存在轨迹标记代码");
|
||||
//throw new BusinessException(message: "当前子系统下已存在轨迹标记代码");
|
||||
var trackFlagCode = trackFlagsEntitys.FirstOrDefault(a => a.Code==input.Code);
|
||||
if (trackFlagCode!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下代码已存在");
|
||||
}
|
||||
var trackFlagName = trackFlagsEntitys.FirstOrDefault(a => a.Name==input.Flag);
|
||||
if (trackFlagName!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下标记已存在");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -105,13 +115,23 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
||||
{
|
||||
#region 业务校验
|
||||
|
||||
var trackStatusEntitys = await _trackFlagRepository.GetListAsync(a => a.Id != input.Id &&
|
||||
var trackFlagsEntitys = await _trackFlagRepository.GetListAsync(a => a.Id != input.Id &&
|
||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||
a.Name == input.Flag));
|
||||
if (trackStatusEntitys.Any())
|
||||
if (trackFlagsEntitys.Any())
|
||||
{
|
||||
//throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
|
||||
throw new BusinessException(message: "当前子系统下已存在轨迹标记代码");
|
||||
//throw new BusinessException(message: "当前子系统下已存在轨迹标记代码");
|
||||
var trackFlagCode = trackFlagsEntitys.FirstOrDefault(a => a.Code==input.Code);
|
||||
if (trackFlagCode!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下代码已存在");
|
||||
}
|
||||
var trackFlagName = trackFlagsEntitys.FirstOrDefault(a => a.Name==input.Flag);
|
||||
if (trackFlagName!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下标记已存在");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -93,7 +93,22 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
||||
if (trackStatusEntitys.Any())
|
||||
{
|
||||
//throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
||||
throw new BusinessException(message: "当前子系统下,轨迹状态代码或轨迹状态或轨迹状态英文存在");
|
||||
//throw new BusinessException(message: "当前子系统下,轨迹状态代码或轨迹状态或轨迹状态英文存在");
|
||||
var trackStatusCode = trackStatusEntitys.FirstOrDefault(t => t.Code==input.Code);
|
||||
if (trackStatusCode!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹状态代码已存在");
|
||||
}
|
||||
var trackStatusName = trackStatusEntitys.FirstOrDefault(t => t.Status==input.TrackStatus);
|
||||
if (trackStatusName!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹状态已存在");
|
||||
}
|
||||
var trackStatusEnName = trackStatusEntitys.FirstOrDefault(t => t.EnStatus==input.EntrackStatus);
|
||||
if (trackStatusEnName!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹状态英文已存在");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -114,7 +129,22 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
||||
if (trackStatusEntitys.Any())
|
||||
{
|
||||
//throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
||||
throw new BusinessException(message: "当前子系统下,轨迹状态代码或轨迹状态或轨迹状态英文存在");
|
||||
//throw new BusinessException(message: "当前子系统下,轨迹状态代码或轨迹状态或轨迹状态英文存在");
|
||||
var trackStatusCode = trackStatusEntitys.FirstOrDefault(t => t.Code==input.Code);
|
||||
if (trackStatusCode!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹状态代码已存在");
|
||||
}
|
||||
var trackStatusName = trackStatusEntitys.FirstOrDefault(t => t.Status==input.TrackStatus);
|
||||
if (trackStatusName!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹状态已存在");
|
||||
}
|
||||
var trackStatusEnName = trackStatusEntitys.FirstOrDefault(t => t.EnStatus==input.EntrackStatus);
|
||||
if (trackStatusEnName!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下轨迹状态英文已存在");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -96,13 +96,24 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
||||
#region 业务校验
|
||||
|
||||
//校验模版代码唯一性
|
||||
var templateEntity =
|
||||
await _trackTemplateRepository.GetFirstAsync(
|
||||
a => a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
||||
if (templateEntity != null)
|
||||
//var templateEntity =
|
||||
// await _trackTemplateRepository.GetFirstAsync(
|
||||
// a => a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
||||
var templateEntitys = await _trackTemplateRepository.GetListAsync(a => a.SubSystemId == input.SubSystemId && (a.Code == input.Code|| a.Name==input.Name));
|
||||
if (templateEntitys.Any())
|
||||
{
|
||||
//throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
||||
throw new BusinessException(message: "模板代码已存在于当前选择的子系统下");
|
||||
//throw new BusinessException(message: "模板代码已存在于当前选择的子系统下");
|
||||
var trackTemplateCode = templateEntitys.FirstOrDefault(t => t.Code==input.Code);
|
||||
if (trackTemplateCode!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下模板代码已存在");
|
||||
}
|
||||
var trackTemplateName = templateEntitys.FirstOrDefault(t => t.Name==input.Name);
|
||||
if (trackTemplateName!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下模板名称已存在");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 业务校验
|
||||
@ -117,11 +128,21 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
||||
{
|
||||
#region 业务校验
|
||||
|
||||
var isExist = await _trackTemplateRepository.GetFirstAsync(a =>
|
||||
a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
||||
if (isExist != null)
|
||||
var templateEntitys = await _trackTemplateRepository.GetListAsync(a =>
|
||||
a.Id != input.Id && a.SubSystemId == input.SubSystemId && (a.Code == input.Code || a.Name==input.Name));
|
||||
if (templateEntitys.Any())
|
||||
{
|
||||
throw new BusinessException(message: "模板代码已存在于当前选择的子系统下");
|
||||
//throw new BusinessException(message: "模板代码已存在于当前选择的子系统下");
|
||||
var trackTemplateCode = templateEntitys.FirstOrDefault(t => t.Code==input.Code);
|
||||
if (trackTemplateCode!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下模板代码已存在");
|
||||
}
|
||||
var trackTemplateName = templateEntitys.FirstOrDefault(t => t.Name==input.Name);
|
||||
if (trackTemplateName!=null)
|
||||
{
|
||||
throw new BusinessException(message: "该子系统下模板名称已存在");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 业务校验
|
||||
|
||||
Loading…
Reference in New Issue
Block a user