轨迹内容功能
This commit is contained in:
parent
bee28546b4
commit
047e9b4885
@ -11,22 +11,70 @@ namespace SJZY.Track.Application.Dtos.TrackContents
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Id
|
/// Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作类型
|
/// 操作类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public OptionType Options { get; set; }
|
public OptionType Options { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 子系统id
|
/// 子系统id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SubSystemId { get; set; }
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属轨迹状态id
|
/// 所属轨迹状态id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TrackStatusId { get; set; }
|
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>
|
||||||
/// 轨迹内容代码
|
/// 轨迹内容代码
|
||||||
@ -41,11 +89,17 @@ namespace SJZY.Track.Application.Dtos.TrackContents
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹内容英文
|
/// 轨迹内容英文
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string EnContent { get; set; }
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹标记id
|
/// 轨迹标记id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TrackFlagId { get; set; }
|
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; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,8 @@
|
|||||||
using SJZY.Track.Application.Dtos.TrackContents;
|
using SJZY.Track.Application.Dtos.TrackContents;
|
||||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
|
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -42,6 +44,41 @@ namespace SJZY.Track.Application.Services.TrackContents
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <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 私有方法
|
#region 私有方法
|
||||||
private async Task<UnifyResultDto> AddAsync(EditTrackContentInput input)
|
private async Task<UnifyResultDto> AddAsync(EditTrackContentInput input)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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,4 +1,8 @@
|
|||||||
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;
|
||||||
|
|
||||||
@ -10,5 +14,67 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <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