diff --git a/src/SJZY.Track.Application/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs b/src/SJZY.Track.Application/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs
index 1c98499d..357784df 100644
--- a/src/SJZY.Track.Application/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs
+++ b/src/SJZY.Track.Application/Dtos/TrackTemplates/GetPageTrackTemplateInput.cs
@@ -14,5 +14,10 @@
/// 关键字
///
public string Keywords { get; set; }
+
+ ///
+ /// 轨迹模版id,轨迹映射的查询使用
+ ///
+ public int TrackTemplateId { get; set; }
}
}
diff --git a/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs b/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs
new file mode 100644
index 00000000..938837c7
--- /dev/null
+++ b/src/SJZY.Track.Application/Services/TrackStatus/TrackStatusService.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SJZY.Track.Application.Services.TrackStatus
+{
+ public class TrackStatusService
+ {
+
+ }
+}
diff --git a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs
index 03ce0705..e4f875dc 100644
--- a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs
+++ b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs
@@ -14,7 +14,7 @@ namespace SJZY.Track.Application.Services.TrackTemplates;
///
[ApiExplorerSettings(GroupName = "轨迹模版")]
[Route("/Track/Template")]
-public class TrackTemplateService : ApplicationService, ITrackTemplateService, IScopedDependency
+public class TrackTemplateService : ApplicationService, ITransientDependency
{
private readonly IStringLocalizer _stringLocalizer;
private readonly ITrackTemplateRepository _trackTemplateRepository;
diff --git a/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj b/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj
index 43e82900..69cf9fb3 100644
--- a/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj
+++ b/src/SJZY.Track.Domain/SJZY.Track.Domain.csproj
@@ -17,6 +17,7 @@
+
diff --git a/src/SJZY.Track.Domain/TrackStatusAggregate/ITrackStatusRepository.cs b/src/SJZY.Track.Domain/TrackStatusAggregate/ITrackStatusRepository.cs
index bdb5a17d..34cb832b 100644
--- a/src/SJZY.Track.Domain/TrackStatusAggregate/ITrackStatusRepository.cs
+++ b/src/SJZY.Track.Domain/TrackStatusAggregate/ITrackStatusRepository.cs
@@ -2,4 +2,5 @@
public interface ITrackStatusRepository : IBasicRepository
{
+
}
\ No newline at end of file
diff --git a/src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetPageTrackTemplateVO.cs b/src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetPageTrackTemplateVO.cs
index 326a7d0c..c0c26bfe 100644
--- a/src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetPageTrackTemplateVO.cs
+++ b/src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetPageTrackTemplateVO.cs
@@ -11,4 +11,14 @@ public class GetPageTrackTemplateVO : PageInfoInput
/// 关键字
///
public string Keywords { get; set; }
+
+ /////
+ ///// 是否置顶
+ /////
+ //public bool IsTop { get; set; }=false;
+
+ ///
+ /// 轨迹模版id
+ ///
+ public int TrackTemplateId { get; set; }
}
\ No newline at end of file
diff --git a/src/SJZY.Track.Repository/TrackStatusRepository.cs b/src/SJZY.Track.Repository/TrackStatusRepository.cs
index 6ac8f9cc..bb13b376 100644
--- a/src/SJZY.Track.Repository/TrackStatusRepository.cs
+++ b/src/SJZY.Track.Repository/TrackStatusRepository.cs
@@ -4,4 +4,9 @@ namespace SJZY.Track.Repository;
public class TrackStatusRepository : BasicRepository, ITrackStatusRepository, IScopedDependency
{
+ public TrackStatusRepository()
+ {
+ }
+
+
}
\ No newline at end of file
diff --git a/src/SJZY.Track.Repository/TrackTemplateRepository.cs b/src/SJZY.Track.Repository/TrackTemplateRepository.cs
index 63d889c6..55c78505 100644
--- a/src/SJZY.Track.Repository/TrackTemplateRepository.cs
+++ b/src/SJZY.Track.Repository/TrackTemplateRepository.cs
@@ -1,4 +1,5 @@
-using SJZY.Expand.ABP.Core.PublicMethords;
+using SJZY.Expand.ABP.Core.Common.Dto;
+using SJZY.Expand.ABP.Core.PublicMethords;
using SJZY.Track.Domain.TrackContentAggregate;
using SJZY.Track.Domain.TrackFlagAggregate;
using SJZY.Track.Domain.TrackStatusAggregate;
@@ -47,18 +48,54 @@ public class TrackTemplateRepository : BasicRepository, ITr
///
public async Task> GetPageTrackTemplate(GetPageTrackTemplateVO input)
{
- var pagedList = await Context.Queryable().LeftJoin((a, b) => a.SubSystemId == b.Id)
- .WhereIF(input.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId)
- .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords))
- .Select((a, b) => new GetTrackTemplateListVO
+ UnifyPageResultDto pagedList = new UnifyPageResultDto();
+ pagedList = await Context.Queryable().LeftJoin((a, b) => a.SubSystemId == b.Id)
+ .WhereIF(input.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId)
+ .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords))
+ .Select((a, b) => new GetTrackTemplateListVO
+ {
+ Id = a.Id,
+ Code = a.Code,
+ CreateTime = a.CreateTime,
+ Name = a.Name,
+ SubSystem = b.CnName
+ })
+ .ToPagedListAsync(input.PageIndex, input.PageSize);
+ //如果轨迹模版id传值了,就置顶在第一条
+ if (input.TrackTemplateId>0&& (!pagedList.List.IsNullOrEmpty()))
+ {
+ if (input.PageIndex==1)
{
- Id = a.Id,
- Code = a.Code,
- CreateTime = a.CreateTime,
- Name = a.Name,
- SubSystem = b.CnName
- })
- .ToPagedListAsync(input.PageIndex, input.PageSize);
+ bool existCurrent = pagedList.List.Any(x => x.Id==input.TrackTemplateId);
+ if (existCurrent)
+ {
+ var item = pagedList.List.FirstOrDefault(x => x.Id==input.TrackTemplateId);
+ pagedList.List.Remove(item);
+ pagedList.List.Insert(0, item);
+ }
+ else
+ {
+ var item = await Context.Queryable().LeftJoin((a, b) => a.SubSystemId == b.Id)
+ .Where((a, b) => a.Id==input.TrackTemplateId)
+ .Select((a, b) => new GetTrackTemplateListVO
+ {
+ Id = a.Id,
+ Code = a.Code,
+ CreateTime = a.CreateTime,
+ Name = a.Name,
+ SubSystem = b.CnName
+ })
+ .FirstAsync();
+ if (item!=null)
+ {
+ var removeItem = pagedList.List.LastOrDefault();
+ pagedList.List.Remove(removeItem);
+ pagedList.List.Insert(0, item);
+ }
+ }
+ }
+ }
+
return pagedList;
}