轨迹标记添加选中
This commit is contained in:
parent
e3a8a94e1e
commit
d8065bb9d1
@ -11,6 +11,11 @@
|
|||||||
/// 关键字
|
/// 关键字
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Keywords { get; set; }
|
public string? Keywords { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 选中的轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public List<int>? SelectIds { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetTrackContentListDto
|
public class GetTrackContentListDto
|
||||||
|
|||||||
@ -7,6 +7,9 @@
|
|||||||
"TemplateExist": "The template code already exists under the currently selected subsystem",
|
"TemplateExist": "The template code already exists under the currently selected subsystem",
|
||||||
"TrackContentExist": "The trace code or trace content or trace content in the current subsystem is repeated in English",
|
"TrackContentExist": "The trace code or trace content or trace content in the current subsystem is repeated in English",
|
||||||
"TrackStatusExist": "The trajectory status code or trajectory status or trajectory status in English is repeated under the current subsystem",
|
"TrackStatusExist": "The trajectory status code or trajectory status or trajectory status in English is repeated under the current subsystem",
|
||||||
"TrackFlagExist": "Duplicate code or flag in the current subsystem"
|
"TrackFlagExist": "Duplicate code or flag in the current subsystem",
|
||||||
|
"IsExistTrackPullConfig": "Track Pull The template has been bound. Delete the track pull before deleting the template",
|
||||||
|
"IsExistTrackStatus": "The trajectory content has been bound to the trajectory status. Delete the trajectory content before deleting the trajectory status",
|
||||||
|
"IsExistTrackFlag": "The track content has been bound to the track mark. Delete the track content before deleting the track mark"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7,6 +7,9 @@
|
|||||||
"TemplateExist": "模板代码已存在于当前选择的子系统下",
|
"TemplateExist": "模板代码已存在于当前选择的子系统下",
|
||||||
"TrackContentExist": "当前子系统下轨迹代码或轨迹内容或轨迹内容英文重复",
|
"TrackContentExist": "当前子系统下轨迹代码或轨迹内容或轨迹内容英文重复",
|
||||||
"TrackStatusExist": "当前子系统下轨迹状态代码或轨迹状态或轨迹状态英文重复",
|
"TrackStatusExist": "当前子系统下轨迹状态代码或轨迹状态或轨迹状态英文重复",
|
||||||
"TrackFlagExist": "当前子系统下代码或标记重复"
|
"TrackFlagExist": "当前子系统下代码或标记重复",
|
||||||
|
"IsExistTrackPullConfig": "轨迹拉取已绑定了该模版,请先删除轨迹拉取再删除该模版",
|
||||||
|
"IsExistTrackStatus": "轨迹内容已经绑定了该轨迹状态,请先删除轨迹内容后再删除该轨迹状态",
|
||||||
|
"IsExistTrackFlag": "轨迹内容已经绑定了该轨迹标记,请先删除轨迹内容后再删除该轨迹标记"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using SJZY.Track.Application.Contract.Dtos.TrackFlags;
|
using SJZY.Track.Application.Contract.Dtos.TrackFlags;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.TrackFlags;
|
using SJZY.Track.Domain.Dtos.TrackFlags;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
@ -16,14 +17,17 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
|||||||
{
|
{
|
||||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||||
private readonly ITrackFlagRepository _trackFlagRepository;
|
private readonly ITrackFlagRepository _trackFlagRepository;
|
||||||
|
private readonly ITrackContentRepository _trackContentRepository;
|
||||||
|
|
||||||
public TrackFlagService(
|
public TrackFlagService(
|
||||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||||
ITrackFlagRepository trackFlagRepository
|
ITrackFlagRepository trackFlagRepository,
|
||||||
|
ITrackContentRepository trackContentRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this._stringLocalizer = stringLocalizer;
|
this._stringLocalizer = stringLocalizer;
|
||||||
this._trackFlagRepository = trackFlagRepository;
|
this._trackFlagRepository = trackFlagRepository;
|
||||||
|
this._trackContentRepository=trackContentRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -121,6 +125,13 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
|||||||
|
|
||||||
private async Task<UnifyResultDto> DeleteAsync(EditTrackFlagInput input)
|
private async Task<UnifyResultDto> DeleteAsync(EditTrackFlagInput input)
|
||||||
{
|
{
|
||||||
|
#region 业务校验
|
||||||
|
var isExistContent = await _trackContentRepository.GetFirstAsync(a => a.TrackFlagId==input.Id);
|
||||||
|
if (isExistContent!=null)
|
||||||
|
{
|
||||||
|
throw new BusinessException(message: _stringLocalizer["IsExistTrackFlag"]);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
var isTrue = await _trackFlagRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
var isTrue = await _trackFlagRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||||
|
|
||||||
return new UnifyResultDto("200", "删除成功", isTrue);
|
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using SJZY.Track.Application.Contract.Dtos.TrackStatus;
|
using SJZY.Track.Application.Contract.Dtos.TrackStatus;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.TrackStatus;
|
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
@ -16,14 +17,17 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||||
private readonly ITrackStatusRepository _trackStatusRepository;
|
private readonly ITrackStatusRepository _trackStatusRepository;
|
||||||
|
private readonly ITrackContentRepository _trackContentRepository;
|
||||||
|
|
||||||
public TrackStatusService(
|
public TrackStatusService(
|
||||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||||
ITrackStatusRepository trackStatusRepository
|
ITrackStatusRepository trackStatusRepository,
|
||||||
|
ITrackContentRepository trackContentRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this._stringLocalizer = stringLocalizer;
|
this._stringLocalizer = stringLocalizer;
|
||||||
this._trackStatusRepository = trackStatusRepository;
|
this._trackStatusRepository = trackStatusRepository;
|
||||||
|
this._trackContentRepository=trackContentRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -122,6 +126,13 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
|
|
||||||
private async Task<UnifyResultDto> DeleteAsync(EditTrackStatusInput input)
|
private async Task<UnifyResultDto> DeleteAsync(EditTrackStatusInput input)
|
||||||
{
|
{
|
||||||
|
#region 业务校验
|
||||||
|
var isExistStatus = await _trackContentRepository.GetFirstAsync(a => a.TrackStatusId==input.Id);
|
||||||
|
if (isExistStatus!=null)
|
||||||
|
{
|
||||||
|
throw new BusinessException(message: _stringLocalizer["IsExistTrackStatus"]);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
var isTrue = await _trackStatusRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
var isTrue = await _trackStatusRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||||
|
|
||||||
return new UnifyResultDto("200", "删除成功", isTrue);
|
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||||
|
|||||||
@ -3,6 +3,7 @@ using Microsoft.Extensions.Localization;
|
|||||||
using SJZY.Expand.ABP.Core.Localization;
|
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.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;
|
||||||
@ -18,14 +19,18 @@ 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;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public TrackTemplateService(
|
public TrackTemplateService(
|
||||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||||
ITrackTemplateRepository trackTemplateRepository)
|
ITrackTemplateRepository trackTemplateRepository,
|
||||||
|
ITrackPullConfigRepository trackPullConfigRepository
|
||||||
|
)
|
||||||
{
|
{
|
||||||
_stringLocalizer = stringLocalizer;
|
_stringLocalizer = stringLocalizer;
|
||||||
_trackTemplateRepository = trackTemplateRepository;
|
_trackTemplateRepository = trackTemplateRepository;
|
||||||
|
_trackPullConfigRepository=trackPullConfigRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -105,14 +110,12 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
private async Task<UnifyResultDto> UpdateAsync(EditTrackTemplateInput input)
|
private async Task<UnifyResultDto> UpdateAsync(EditTrackTemplateInput input)
|
||||||
{
|
{
|
||||||
#region 业务校验
|
#region 业务校验
|
||||||
|
|
||||||
var isExist = await _trackTemplateRepository.GetFirstAsync(a =>
|
var isExist = await _trackTemplateRepository.GetFirstAsync(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);
|
||||||
if (isExist != null)
|
if (isExist != null)
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id);
|
var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id);
|
||||||
@ -125,9 +128,12 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
private async Task<UnifyResultDto> DeleteAsync(EditTrackTemplateInput input)
|
private async Task<UnifyResultDto> DeleteAsync(EditTrackTemplateInput input)
|
||||||
{
|
{
|
||||||
#region 业务校验
|
#region 业务校验
|
||||||
|
//查询看看在轨迹拉取里面有没有被占用
|
||||||
//到时候,得判断这个模版有没有在轨迹映射里面被使用过,如果被使用就抛出提示
|
var isExisistTrackPullConfig = await _trackPullConfigRepository.GetFirstAsync(a => a.TrackTemplateId==input.Id);
|
||||||
|
if (isExisistTrackPullConfig!=null)
|
||||||
|
{
|
||||||
|
throw new BusinessException(message: _stringLocalizer["IsExistTrackPullConfig"]);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
var isTrue = await _trackTemplateRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
var isTrue = await _trackTemplateRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||||
|
|||||||
@ -17,6 +17,11 @@ namespace SJZY.Track.Domain.Dtos.TrackContents
|
|||||||
/// 关键字
|
/// 关键字
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Keywords { get; set; }
|
public string? Keywords { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 选中的轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public List<int>? SelectIds { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetTrackContentListVO
|
public class GetTrackContentListVO
|
||||||
|
|||||||
@ -62,7 +62,8 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
(a, b, c, d, e, f) => a.Code.Contains(input.Keywords) || a.Content.Contains(input.Keywords)
|
(a, b, c, d, e, f) => a.Code.Contains(input.Keywords) || a.Content.Contains(input.Keywords)
|
||||||
|| a.EnContent.Contains(input.Keywords)
|
|| a.EnContent.Contains(input.Keywords)
|
||||||
)
|
)
|
||||||
.OrderByDescending((a, b, c, d, e, f) => a.CreateTime)
|
.OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d, e, f) => a.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d, e, f) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
|
||||||
.Select((a, b, c, d, e, f) => new GetTrackContentListVO
|
.Select((a, b, c, d, e, f) => new GetTrackContentListVO
|
||||||
{
|
{
|
||||||
Id = a.Id,
|
Id = a.Id,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user