Merge branch 'S01-轨迹中台' of http://192.168.80.50:3000/Dotnet/SJZY.Track.Api into S01-轨迹中台
This commit is contained in:
commit
57c888a448
@ -14,5 +14,10 @@
|
|||||||
/// 关键字
|
/// 关键字
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Keywords { get; set; }
|
public string Keywords { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹模版id,轨迹映射的查询使用
|
||||||
|
/// </summary>
|
||||||
|
public int TrackTemplateId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,7 +14,7 @@ namespace SJZY.Track.Application.Services.TrackTemplates;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "轨迹模版")]
|
[ApiExplorerSettings(GroupName = "轨迹模版")]
|
||||||
[Route("/Track/Template")]
|
[Route("/Track/Template")]
|
||||||
public class TrackTemplateService : ApplicationService, ITrackTemplateService, IScopedDependency
|
public class TrackTemplateService : ApplicationService, ITransientDependency
|
||||||
{
|
{
|
||||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||||
private readonly ITrackTemplateRepository _trackTemplateRepository;
|
private readonly ITrackTemplateRepository _trackTemplateRepository;
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
<Folder Include="TrackPullAggregate\Dtos\" />
|
<Folder Include="TrackPullAggregate\Dtos\" />
|
||||||
<Folder Include="TrackPushAggregate\Dtos\" />
|
<Folder Include="TrackPushAggregate\Dtos\" />
|
||||||
<Folder Include="TrackStatusAggregate\Dtos\" />
|
<Folder Include="TrackStatusAggregate\Dtos\" />
|
||||||
|
<Folder Include="TrackStatusAggregate\Dtos\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -2,4 +2,5 @@
|
|||||||
|
|
||||||
public interface ITrackStatusRepository : IBasicRepository<TrackStatusEntity>
|
public interface ITrackStatusRepository : IBasicRepository<TrackStatusEntity>
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -11,4 +11,14 @@ public class GetPageTrackTemplateVO : PageInfoInput
|
|||||||
/// 关键字
|
/// 关键字
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Keywords { get; set; }
|
public string Keywords { get; set; }
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 是否置顶
|
||||||
|
///// </summary>
|
||||||
|
//public bool IsTop { get; set; }=false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹模版id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackTemplateId { get; set; }
|
||||||
}
|
}
|
||||||
@ -3,5 +3,10 @@
|
|||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
public class TrackStatusRepository : BasicRepository<TrackStatusEntity>, ITrackStatusRepository, IScopedDependency
|
public class TrackStatusRepository : BasicRepository<TrackStatusEntity>, ITrackStatusRepository, IScopedDependency
|
||||||
|
{
|
||||||
|
public TrackStatusRepository()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -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.TrackContentAggregate;
|
||||||
using SJZY.Track.Domain.TrackFlagAggregate;
|
using SJZY.Track.Domain.TrackFlagAggregate;
|
||||||
using SJZY.Track.Domain.TrackStatusAggregate;
|
using SJZY.Track.Domain.TrackStatusAggregate;
|
||||||
@ -47,7 +48,8 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input)
|
public async Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input)
|
||||||
{
|
{
|
||||||
var pagedList = await Context.Queryable<TrackTemplateEntity>().LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
UnifyPageResultDto<GetTrackTemplateListVO> pagedList = new UnifyPageResultDto<GetTrackTemplateListVO>();
|
||||||
|
pagedList = await Context.Queryable<TrackTemplateEntity>().LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
||||||
.WhereIF(input.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId)
|
.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))
|
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords))
|
||||||
.Select((a, b) => new GetTrackTemplateListVO
|
.Select((a, b) => new GetTrackTemplateListVO
|
||||||
@ -59,6 +61,41 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
SubSystem = b.CnName
|
SubSystem = b.CnName
|
||||||
})
|
})
|
||||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
|
//如果轨迹模版id传值了,就置顶在第一条
|
||||||
|
if (input.TrackTemplateId>0&& (!pagedList.List.IsNullOrEmpty()))
|
||||||
|
{
|
||||||
|
if (input.PageIndex==1)
|
||||||
|
{
|
||||||
|
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<TrackTemplateEntity>().LeftJoin<VSystemEntity>((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;
|
return pagedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user