提示语优化
This commit is contained in:
parent
d9a52413de
commit
d3dea7dd9e
@ -101,7 +101,22 @@ namespace SJZY.Track.Application.Services.TrackContents
|
|||||||
if (trackContentEntitys.Any())
|
if (trackContentEntitys.Any())
|
||||||
{
|
{
|
||||||
//throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
|
//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 业务逻辑校验
|
#endregion 业务逻辑校验
|
||||||
@ -122,7 +137,22 @@ namespace SJZY.Track.Application.Services.TrackContents
|
|||||||
if (trackContentEntitys.Any())
|
if (trackContentEntitys.Any())
|
||||||
{
|
{
|
||||||
//throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
|
//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 业务逻辑校验
|
#endregion 业务逻辑校验
|
||||||
|
|||||||
@ -86,12 +86,22 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
|||||||
private async Task<UnifyResultDto> AddAsync(EditTrackFlagInput input)
|
private async Task<UnifyResultDto> AddAsync(EditTrackFlagInput input)
|
||||||
{
|
{
|
||||||
#region 业务校验
|
#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));
|
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: _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
|
#endregion
|
||||||
|
|
||||||
@ -105,13 +115,23 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
|||||||
{
|
{
|
||||||
#region 业务校验
|
#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.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||||
a.Name == input.Flag));
|
a.Name == input.Flag));
|
||||||
if (trackStatusEntitys.Any())
|
if (trackFlagsEntitys.Any())
|
||||||
{
|
{
|
||||||
//throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
|
//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
|
#endregion
|
||||||
|
|||||||
@ -93,7 +93,22 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
if (trackStatusEntitys.Any())
|
if (trackStatusEntitys.Any())
|
||||||
{
|
{
|
||||||
//throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
//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
|
#endregion
|
||||||
@ -114,7 +129,22 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
if (trackStatusEntitys.Any())
|
if (trackStatusEntitys.Any())
|
||||||
{
|
{
|
||||||
//throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
//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
|
#endregion
|
||||||
|
|||||||
@ -96,13 +96,24 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
#region 业务校验
|
#region 业务校验
|
||||||
|
|
||||||
//校验模版代码唯一性
|
//校验模版代码唯一性
|
||||||
var templateEntity =
|
//var templateEntity =
|
||||||
await _trackTemplateRepository.GetFirstAsync(
|
// await _trackTemplateRepository.GetFirstAsync(
|
||||||
a => a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
// a => a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
||||||
if (templateEntity != null)
|
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: _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 业务校验
|
#endregion 业务校验
|
||||||
@ -117,11 +128,21 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
#region 业务校验
|
#region 业务校验
|
||||||
|
|
||||||
var isExist = await _trackTemplateRepository.GetFirstAsync(a =>
|
var templateEntitys = await _trackTemplateRepository.GetListAsync(a =>
|
||||||
a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
a.Id != input.Id && a.SubSystemId == input.SubSystemId && (a.Code == input.Code || a.Name==input.Name));
|
||||||
if (isExist != null)
|
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 业务校验
|
#endregion 业务校验
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user