Merge remote-tracking branch 'origin/S01-轨迹中台' into S01-轨迹中台
This commit is contained in:
commit
ee80cb1353
@ -0,0 +1,105 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Dtos.TrackContents
|
||||||
|
{
|
||||||
|
public class EditTrackContentInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作类型
|
||||||
|
/// </summary>
|
||||||
|
public OptionType Options { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属轨迹状态id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackStatusId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容英文
|
||||||
|
/// </summary>
|
||||||
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹标记id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackFlagId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetTrackContentDetailDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属轨迹状态id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackStatusId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属轨迹状态
|
||||||
|
/// </summary>
|
||||||
|
public string TrackStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容英文
|
||||||
|
/// </summary>
|
||||||
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹标记id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackFlagId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹标记
|
||||||
|
/// </summary>
|
||||||
|
public string TrackFlag { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Dtos.TrackContents
|
||||||
|
{
|
||||||
|
public class GetPageTrackContentInput : PageInfoInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 关键字
|
||||||
|
/// </summary>
|
||||||
|
public string Keywords { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetTrackContentListDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容英文
|
||||||
|
/// </summary>
|
||||||
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属状态
|
||||||
|
/// </summary>
|
||||||
|
public string TrackStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属节点
|
||||||
|
/// </summary>
|
||||||
|
public string Node { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹标记
|
||||||
|
/// </summary>
|
||||||
|
public string TrackFlag { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人
|
||||||
|
/// </summary>
|
||||||
|
public string CreateUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改人
|
||||||
|
/// </summary>
|
||||||
|
public string UpdateUser { 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.TrackContents
|
||||||
|
{
|
||||||
|
public interface ITrackContentService
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
using SJZY.Track.Application.Dtos.TrackContents;
|
||||||
|
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
|
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Volo.Abp.DependencyInjection;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Services.TrackContents
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容服务
|
||||||
|
/// </summary>
|
||||||
|
[ApiExplorerSettings(GroupName = "轨迹内容")]
|
||||||
|
[Route("/Track/Content")]
|
||||||
|
public class TrackContentService : ApplicationService, ITransientDependency
|
||||||
|
{
|
||||||
|
private readonly ITrackContentRepository _trackContentRepository;
|
||||||
|
|
||||||
|
public TrackContentService(
|
||||||
|
ITrackContentRepository trackContentRepository
|
||||||
|
)
|
||||||
|
{
|
||||||
|
this._trackContentRepository=trackContentRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容编辑
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("Edit")]
|
||||||
|
public async Task<UnifyResultDto> EditAsync(EditTrackContentInput input)
|
||||||
|
{
|
||||||
|
return input.Options switch
|
||||||
|
{
|
||||||
|
OptionType.新增 => await AddAsync(input),
|
||||||
|
OptionType.修改 => await UpdateAsync(input),
|
||||||
|
OptionType.删除 => await DeleteAsync(input),
|
||||||
|
_ => throw new BusinessException(message: "当前操作动作不合法")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据内容id获取轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("GetDetail")]
|
||||||
|
public async Task<UnifyResultDto<GetTrackContentDetailDto>> GetDetailAsync(int id)
|
||||||
|
{
|
||||||
|
var detailInfo = await _trackContentRepository.GetDetailAsync(id);
|
||||||
|
if (detailInfo == null)
|
||||||
|
{
|
||||||
|
return new UnifyResultDto<GetTrackContentDetailDto>(false, null, "未查询到轨迹状态");
|
||||||
|
}
|
||||||
|
|
||||||
|
var dto = ObjectMapper.Map<GetTrackContentDetailVO, GetTrackContentDetailDto>(detailInfo);
|
||||||
|
return new UnifyResultDto<GetTrackContentDetailDto>("200", "", dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取分页轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("GetList")]
|
||||||
|
public async Task<UnifyPageResultDto<GetTrackContentListDto>> GetPageTrackContent(GetPageTrackContentInput input)
|
||||||
|
{
|
||||||
|
var vo = ObjectMapper.Map<GetPageTrackContentInput, GetPageTrackContentVO>(input);
|
||||||
|
var resultDto = await _trackContentRepository.GetPageTrackContent(vo);
|
||||||
|
var pageResultDto =
|
||||||
|
ObjectMapper.Map<UnifyPageResultDto<GetTrackContentListVO>, UnifyPageResultDto<GetTrackContentListDto>>(
|
||||||
|
resultDto);
|
||||||
|
|
||||||
|
return pageResultDto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 私有方法
|
||||||
|
private async Task<UnifyResultDto> AddAsync(EditTrackContentInput input)
|
||||||
|
{
|
||||||
|
var entity = ObjectMapper.Map<EditTrackContentInput, TrackContentEntity>(input);
|
||||||
|
var isTrue = await _trackContentRepository.InsertAsync(entity);
|
||||||
|
|
||||||
|
return new UnifyResultDto("200", "新增成功", isTrue);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<UnifyResultDto> UpdateAsync(EditTrackContentInput input)
|
||||||
|
{
|
||||||
|
var templateEntity = await _trackContentRepository.GetFirstAsync(a => a.Id == input.Id);
|
||||||
|
ObjectMapper.Map(input, templateEntity);
|
||||||
|
var isTrue = await _trackContentRepository.UpdateAsync(templateEntity);
|
||||||
|
|
||||||
|
return new UnifyResultDto("200", "修改成功", isTrue);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<UnifyResultDto> DeleteAsync(EditTrackContentInput input)
|
||||||
|
{
|
||||||
|
var isTrue = await _trackContentRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||||
|
|
||||||
|
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||||
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;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.TrackStatus;
|
namespace SJZY.Track.Application.Services.TrackStatus;
|
||||||
|
|
||||||
@ -9,7 +10,7 @@ namespace SJZY.Track.Application.Services.TrackStatus;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(GroupName = "轨迹状态")]
|
[ApiExplorerSettings(GroupName = "轨迹状态")]
|
||||||
[Route("/Track/Status")]
|
[Route("/Track/Status")]
|
||||||
public class TrackStatusService : ApplicationService
|
public class TrackStatusService : ApplicationService, ITransientDependency
|
||||||
{
|
{
|
||||||
private readonly ITrackStatusRepository _trackStatusRepository;
|
private readonly ITrackStatusRepository _trackStatusRepository;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
namespace SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
|
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
|
||||||
public interface ITrackContentRepository : IBasicRepository<TrackContentEntity>
|
public interface ITrackContentRepository : IBasicRepository<TrackContentEntity>
|
||||||
{
|
{
|
||||||
|
Task<GetTrackContentDetailVO?> GetDetailAsync(int id);
|
||||||
|
Task<UnifyPageResultDto<GetTrackContentListVO>> GetPageTrackContent(GetPageTrackContentVO input);
|
||||||
}
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Domain.Dtos.TrackContents
|
||||||
|
{
|
||||||
|
public class GetPageTrackContentVO : PageInfoInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 关键字
|
||||||
|
/// </summary>
|
||||||
|
public string Keywords { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GetTrackContentListVO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容英文
|
||||||
|
/// </summary>
|
||||||
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属状态
|
||||||
|
/// </summary>
|
||||||
|
public string TrackStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属节点
|
||||||
|
/// </summary>
|
||||||
|
public string Node { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹标记
|
||||||
|
/// </summary>
|
||||||
|
public string TrackFlag { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? CreateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建人
|
||||||
|
/// </summary>
|
||||||
|
public string CreateUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改人
|
||||||
|
/// </summary>
|
||||||
|
public string UpdateUser { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Domain.Dtos.TrackContents
|
||||||
|
{
|
||||||
|
public class GetTrackContentDetailVO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属轨迹状态id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackStatusId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 所属轨迹状态
|
||||||
|
/// </summary>
|
||||||
|
public string TrackStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容英文
|
||||||
|
/// </summary>
|
||||||
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹标记id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackFlagId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹标记
|
||||||
|
/// </summary>
|
||||||
|
public string TrackFlag { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,7 +1,14 @@
|
|||||||
namespace SJZY.Track.Domain.Dtos.TrackStatus;
|
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
public class GetTrackStatusListVO
|
namespace SJZY.Track.Domain.Dtos.TrackStatus
|
||||||
{
|
{
|
||||||
|
public class GetTrackStatusListVO
|
||||||
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Id
|
/// Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -12,6 +19,11 @@ public class GetTrackStatusListVO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string SubSystem { get; set; }
|
public string SubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 节点id
|
||||||
|
/// </summary>
|
||||||
|
public int NodeId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属节点
|
/// 所属节点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -51,4 +63,5 @@ public class GetTrackStatusListVO
|
|||||||
/// 修改时间
|
/// 修改时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? UpdateTime { get; set; }
|
public DateTime? UpdateTime { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<Import Project="../../common.props" />
|
<Import Project="../../common.props" />
|
||||||
|
|
||||||
@ -12,7 +12,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Aggregates\"/>
|
<Folder Include="Aggregates\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,7 +1,80 @@
|
|||||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
|
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
|
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||||
|
using SJZY.Track.Domain.VEntities;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrackContentRepository, IScopedDependency
|
public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrackContentRepository, IScopedDependency
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public TrackContentRepository()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取轨迹内容明细
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<GetTrackContentDetailVO?> GetDetailAsync(int id)
|
||||||
|
{
|
||||||
|
var detail = await Context.Queryable<TrackContentEntity>()
|
||||||
|
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
||||||
|
.Where((a, b) => a.Id == id)
|
||||||
|
.Select((a, b) => new GetTrackContentDetailVO
|
||||||
|
{
|
||||||
|
Id = a.Id,
|
||||||
|
SubSystemId = a.SubSystemId,
|
||||||
|
SubSystem = b.CnName,
|
||||||
|
TrackStatusId=a.TrackStatusId,
|
||||||
|
TrackStatus= "",
|
||||||
|
Code = a.Code,
|
||||||
|
Content = a.Content,
|
||||||
|
EnContent = a.EnContent,
|
||||||
|
TrackFlagId=a.TrackFlagId,
|
||||||
|
TrackFlag=""
|
||||||
|
})
|
||||||
|
.FirstAsync();
|
||||||
|
return detail;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分页获取轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<UnifyPageResultDto<GetTrackContentListVO>> GetPageTrackContent(GetPageTrackContentVO input)
|
||||||
|
{
|
||||||
|
UnifyPageResultDto<GetTrackContentListVO> pagedList = new UnifyPageResultDto<GetTrackContentListVO>();
|
||||||
|
pagedList = await Context.Queryable<TrackContentEntity>()
|
||||||
|
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
||||||
|
.LeftJoin<VUserEntity>((a, b, c) => a.CreateUserId == c.Id)
|
||||||
|
.LeftJoin<VUserEntity>((a, b, c, d) => a.UpdateUserId == d.Id)
|
||||||
|
.WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId)
|
||||||
|
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(),
|
||||||
|
(a, b, c, d) => a.Code.Contains(input.Keywords)
|
||||||
|
)
|
||||||
|
.Select((a, b, c, d) => new GetTrackContentListVO
|
||||||
|
{
|
||||||
|
Id = a.Id,
|
||||||
|
SubSystem = b.CnName,
|
||||||
|
Code = a.Code,
|
||||||
|
Content = a.Content,
|
||||||
|
EnContent = a.EnContent,
|
||||||
|
TrackStatus= "",
|
||||||
|
Node = "",
|
||||||
|
TrackFlag= "",
|
||||||
|
CreateTime = a.CreateTime,
|
||||||
|
CreateUser = c.Name,
|
||||||
|
UpdateTime = a.UpdateTime,
|
||||||
|
UpdateUser = d.Name,
|
||||||
|
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
|
|
||||||
|
return pagedList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user