From 3ebbe620af79778f522a7718107736f4728cff4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=86=9B?= <2357729423@qq.com> Date: Sat, 30 Mar 2024 15:54:51 +0800 Subject: [PATCH] =?UTF-8?q?feature=EF=BC=9A=E3=80=90=E8=BD=A8=E8=BF=B9?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=94=AF=E6=8C=81=E9=A1=BA=E5=BA=8F=E4=BA=92?= =?UTF-8?q?=E6=8D=A2=E3=80=91=20=20=20=20=20https://www.tapd.cn/60863849/p?= =?UTF-8?q?rong/stories/view/1160863849001017011?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackPush/EditTrackPushContentInput.cs | 5 ++++ .../Services/TrackPush/TrackPushService.cs | 30 ++++++++----------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs index ec85498a..62fa7cda 100644 --- a/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs +++ b/src/SJZY.Track.Application.Contract/Dtos/TrackPush/EditTrackPushContentInput.cs @@ -34,6 +34,11 @@ public class EditTrackPushContentInput /// public int TrackContentId { get; set; } + /// + /// 可交换顺序的轨迹内容id + /// + public int? SwapTrackContentId { get; set; } + /// /// 轨迹内容参数值 /// diff --git a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs index e506cc3f..5225e8db 100644 --- a/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs +++ b/src/SJZY.Track.Application/Services/TrackPush/TrackPushService.cs @@ -5,9 +5,7 @@ using SJZY.Expand.ABP.Core.PublicMethords; using SJZY.Track.Application.Contract.Dtos.TrackPush; using SJZY.Track.Application.Contract.Services; using SJZY.Track.Application.Localization; -using SJZY.Track.Domain.Aggregates.TrackPullAggregate; using SJZY.Track.Domain.Aggregates.TrackPushAggregate; -using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate; using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.TrackPush; @@ -22,19 +20,15 @@ public class TrackPushService : ApplicationService { private readonly IStringLocalizer _stringLocalizer; private readonly ITrackPushConfigRepository _trackPushConfigRepository; - private readonly ITrackPullConfigRepository _trackPullConfigRepository; private readonly ITrackPushCacheService _trackPushCacheService; public TrackPushService( IStringLocalizer stringLocalizer, ITrackPushConfigRepository trackPushConfigRepository, - ITrackTemplateRepository trackTemplateRepository, - ITrackPullConfigRepository trackPullConfigRepository, ITrackPushCacheService trackPushCacheService) { _stringLocalizer = stringLocalizer; _trackPushConfigRepository = trackPushConfigRepository; - _trackPullConfigRepository = trackPullConfigRepository; _trackPushCacheService = trackPushCacheService; } @@ -160,21 +154,21 @@ public class TrackPushService : ApplicationService if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => x.TrackContentId == input.TrackContentId))) throw new BusinessException(message: _stringLocalizer["IsTrackPushContentAny"]); - else if (!input.TrackContentCodeValue.IsNullOrWhiteSpace() && - await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => - x.TrackContentCodeValue == input.TrackContentCodeValue))) + if (!input.TrackContentCodeValue.IsNullOrWhiteSpace() && + await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => + x.TrackContentCodeValue == input.TrackContentCodeValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPushContentCodeValueAny"]); - else if (!input.TrackStatusValue.IsNullOrWhiteSpace() && - await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => - x.TrackStatusValue == input.TrackStatusValue))) + if (!input.TrackStatusValue.IsNullOrWhiteSpace() && + await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => + x.TrackStatusValue == input.TrackStatusValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPushContentStatusValueAny"]); - else if (!input.TrackContentValue.IsNullOrWhiteSpace() && - await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => - x.TrackContentValue == input.TrackContentValue))) + if (!input.TrackContentValue.IsNullOrWhiteSpace() && + await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => + x.TrackContentValue == input.TrackContentValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPushContentValueAny"]); - else if (!input.TrackEnContentValue.IsNullOrWhiteSpace() && - await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => - x.TrackEnContentValue == input.TrackEnContentValue))) + if (!input.TrackEnContentValue.IsNullOrWhiteSpace() && + await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => + x.TrackEnContentValue == input.TrackEnContentValue))) throw new BusinessException(message: _stringLocalizer["IsTrackPushEnContentValueAny"]); }