feature:【轨迹推送支持顺序互换】

https://www.tapd.cn/60863849/prong/stories/view/1160863849001017011
This commit is contained in:
李鹏军 2024-03-30 15:54:51 +08:00
parent a58b9e264a
commit 3ebbe620af
2 changed files with 17 additions and 18 deletions

View File

@ -34,6 +34,11 @@ public class EditTrackPushContentInput
/// </summary> /// </summary>
public int TrackContentId { get; set; } public int TrackContentId { get; set; }
/// <summary>
/// 可交换顺序的轨迹内容id
/// </summary>
public int? SwapTrackContentId { get; set; }
/// <summary> /// <summary>
/// 轨迹内容参数值 /// 轨迹内容参数值
/// </summary> /// </summary>

View File

@ -5,9 +5,7 @@ using SJZY.Expand.ABP.Core.PublicMethords;
using SJZY.Track.Application.Contract.Dtos.TrackPush; using SJZY.Track.Application.Contract.Dtos.TrackPush;
using SJZY.Track.Application.Contract.Services; using SJZY.Track.Application.Contract.Services;
using SJZY.Track.Application.Localization; using SJZY.Track.Application.Localization;
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
using SJZY.Track.Domain.Aggregates.TrackPushAggregate; using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
using SJZY.Track.Domain.Dtos.Common; using SJZY.Track.Domain.Dtos.Common;
using SJZY.Track.Domain.Dtos.TrackPush; using SJZY.Track.Domain.Dtos.TrackPush;
@ -22,19 +20,15 @@ public class TrackPushService : ApplicationService
{ {
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer; private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
private readonly ITrackPushConfigRepository _trackPushConfigRepository; private readonly ITrackPushConfigRepository _trackPushConfigRepository;
private readonly ITrackPullConfigRepository _trackPullConfigRepository;
private readonly ITrackPushCacheService _trackPushCacheService; private readonly ITrackPushCacheService _trackPushCacheService;
public TrackPushService( public TrackPushService(
IStringLocalizer<TrackLocalizationResource> stringLocalizer, IStringLocalizer<TrackLocalizationResource> stringLocalizer,
ITrackPushConfigRepository trackPushConfigRepository, ITrackPushConfigRepository trackPushConfigRepository,
ITrackTemplateRepository trackTemplateRepository,
ITrackPullConfigRepository trackPullConfigRepository,
ITrackPushCacheService trackPushCacheService) ITrackPushCacheService trackPushCacheService)
{ {
_stringLocalizer = stringLocalizer; _stringLocalizer = stringLocalizer;
_trackPushConfigRepository = trackPushConfigRepository; _trackPushConfigRepository = trackPushConfigRepository;
_trackPullConfigRepository = trackPullConfigRepository;
_trackPushCacheService = trackPushCacheService; _trackPushCacheService = trackPushCacheService;
} }
@ -160,19 +154,19 @@ public class TrackPushService : ApplicationService
if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x =>
x.TrackContentId == input.TrackContentId))) x.TrackContentId == input.TrackContentId)))
throw new BusinessException(message: _stringLocalizer["IsTrackPushContentAny"]); throw new BusinessException(message: _stringLocalizer["IsTrackPushContentAny"]);
else if (!input.TrackContentCodeValue.IsNullOrWhiteSpace() && if (!input.TrackContentCodeValue.IsNullOrWhiteSpace() &&
await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x =>
x.TrackContentCodeValue == input.TrackContentCodeValue))) x.TrackContentCodeValue == input.TrackContentCodeValue)))
throw new BusinessException(message: _stringLocalizer["IsTrackPushContentCodeValueAny"]); throw new BusinessException(message: _stringLocalizer["IsTrackPushContentCodeValueAny"]);
else if (!input.TrackStatusValue.IsNullOrWhiteSpace() && if (!input.TrackStatusValue.IsNullOrWhiteSpace() &&
await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x =>
x.TrackStatusValue == input.TrackStatusValue))) x.TrackStatusValue == input.TrackStatusValue)))
throw new BusinessException(message: _stringLocalizer["IsTrackPushContentStatusValueAny"]); throw new BusinessException(message: _stringLocalizer["IsTrackPushContentStatusValueAny"]);
else if (!input.TrackContentValue.IsNullOrWhiteSpace() && if (!input.TrackContentValue.IsNullOrWhiteSpace() &&
await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x =>
x.TrackContentValue == input.TrackContentValue))) x.TrackContentValue == input.TrackContentValue)))
throw new BusinessException(message: _stringLocalizer["IsTrackPushContentValueAny"]); throw new BusinessException(message: _stringLocalizer["IsTrackPushContentValueAny"]);
else if (!input.TrackEnContentValue.IsNullOrWhiteSpace() && if (!input.TrackEnContentValue.IsNullOrWhiteSpace() &&
await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x => await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp.And(x =>
x.TrackEnContentValue == input.TrackEnContentValue))) x.TrackEnContentValue == input.TrackEnContentValue)))
throw new BusinessException(message: _stringLocalizer["IsTrackPushEnContentValueAny"]); throw new BusinessException(message: _stringLocalizer["IsTrackPushEnContentValueAny"]);