Merge branch 'S01-轨迹中台' into dev
This commit is contained in:
commit
c3980b6abb
@ -92,7 +92,8 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus));
|
a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus));
|
||||||
if (trackStatusEntity != null)
|
if (trackStatusEntity != null)
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
//throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
||||||
|
throw new BusinessException("当前子系统下,轨迹状态代码或轨迹状态或轨迹状态英文存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -112,7 +113,8 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus));
|
a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus));
|
||||||
if (trackStatusEntity != null)
|
if (trackStatusEntity != null)
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
//throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
||||||
|
throw new BusinessException("当前子系统下,轨迹状态代码或轨迹状态或轨迹状态英文存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -130,7 +132,8 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
var isExistStatus = await _trackContentRepository.GetFirstAsync(a => a.TrackStatusId==input.Id);
|
var isExistStatus = await _trackContentRepository.GetFirstAsync(a => a.TrackStatusId==input.Id);
|
||||||
if (isExistStatus!=null)
|
if (isExistStatus!=null)
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["IsExistTrackStatus"]);
|
//throw new BusinessException(message: _stringLocalizer["IsExistTrackStatus"]);
|
||||||
|
throw new BusinessException("轨迹内容已经绑定了该轨迹状态,请先删除轨迹内容后再删除该轨迹状态");
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
var isTrue = await _trackStatusRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
var isTrue = await _trackStatusRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||||
|
|||||||
@ -4,6 +4,7 @@ using SJZY.Expand.ABP.Core.Localization;
|
|||||||
using SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
using SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
@ -20,17 +21,20 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||||
private readonly ITrackTemplateRepository _trackTemplateRepository;
|
private readonly ITrackTemplateRepository _trackTemplateRepository;
|
||||||
private readonly ITrackPullConfigRepository _trackPullConfigRepository;
|
private readonly ITrackPullConfigRepository _trackPullConfigRepository;
|
||||||
|
private readonly ITrackPushConfigRepository _trackPushConfigRepository;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public TrackTemplateService(
|
public TrackTemplateService(
|
||||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||||
ITrackTemplateRepository trackTemplateRepository,
|
ITrackTemplateRepository trackTemplateRepository,
|
||||||
ITrackPullConfigRepository trackPullConfigRepository
|
ITrackPullConfigRepository trackPullConfigRepository,
|
||||||
|
ITrackPushConfigRepository trackPushConfigRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_stringLocalizer = stringLocalizer;
|
_stringLocalizer = stringLocalizer;
|
||||||
_trackTemplateRepository = trackTemplateRepository;
|
_trackTemplateRepository = trackTemplateRepository;
|
||||||
_trackPullConfigRepository = trackPullConfigRepository;
|
_trackPullConfigRepository = trackPullConfigRepository;
|
||||||
|
_trackPushConfigRepository=trackPushConfigRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -97,7 +101,7 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
if (templateEntity != null)
|
if (templateEntity != null)
|
||||||
{
|
{
|
||||||
//throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
//throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
||||||
throw new BusinessException("轨迹代码重复");
|
throw new BusinessException("模板代码已存在于当前选择的子系统下");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion 业务校验
|
#endregion 业务校验
|
||||||
@ -116,7 +120,7 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
||||||
if (isExist != null)
|
if (isExist != null)
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
throw new BusinessException(message: _stringLocalizer["模板代码已存在于当前选择的子系统下"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion 业务校验
|
#endregion 业务校验
|
||||||
@ -133,10 +137,17 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
#region 业务校验
|
#region 业务校验
|
||||||
|
|
||||||
//查询看看在轨迹拉取里面有没有被占用
|
//查询看看在轨迹拉取里面有没有被占用
|
||||||
var isExisistTrackPullConfig = await _trackPullConfigRepository.GetFirstAsync(a => a.TrackTemplateId == input.Id);
|
var isExisistTrackPullConfigs = await _trackPullConfigRepository.GetListAsync(a => a.TrackTemplateId == input.Id);
|
||||||
if (isExisistTrackPullConfig != null)
|
if (isExisistTrackPullConfigs.Any())
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["IsExistTrackPullConfig"]);
|
//throw new BusinessException(message: _stringLocalizer["IsExistTrackPullConfig"]);
|
||||||
|
throw new BusinessException(message: _stringLocalizer["轨迹拉取配置里已经绑定模版,请检查"]);
|
||||||
|
}
|
||||||
|
//轨迹推送里看看是否被占用
|
||||||
|
var isExisistTrackPushConfigs = await _trackPushConfigRepository.GetListAsync(a => a.TrackTemplateId.Contains(input.Id.ToString()));
|
||||||
|
if (isExisistTrackPushConfigs.Any())
|
||||||
|
{
|
||||||
|
throw new BusinessException(message: _stringLocalizer["轨迹推送配置里已经绑定模版,请检查"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion 业务校验
|
#endregion 业务校验
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user