轨迹模版
This commit is contained in:
parent
3036cfbab4
commit
cbabe27185
@ -0,0 +1,25 @@
|
||||
using AutoMapper;
|
||||
using SJZY.Track.Application.Dtos.Demo;
|
||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
||||
using SJZY.Track.Repository.TrackTemplate.ValueObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹模版自动映射
|
||||
/// </summary>
|
||||
public class TrackTemplateAutoMapperProfile : Profile
|
||||
{
|
||||
public TrackTemplateAutoMapperProfile()
|
||||
{
|
||||
CreateMap<GetTrackTemplateDetailVO, GetTrackTemplateDetailDto>(MemberList.None);
|
||||
|
||||
//CreateMap<UnifyResultDto<GetTrackTemplateDetailVO>, UnifyResultDto<GetTrackTemplateDetailDto>>(MemberList.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.TrackTemplates
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取轨迹模版分页输入
|
||||
/// </summary>
|
||||
public class GetPageTrackTemplateInput : PageInfoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关键字
|
||||
/// </summary>
|
||||
public string Keywords { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
using Microsoft.OpenApi.Writers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.TrackTemplates
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取轨迹模版详情
|
||||
/// </summary>
|
||||
public class GetTrackTemplateDetailDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统
|
||||
/// </summary>
|
||||
public string SubSystem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版代码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取轨迹模版列表
|
||||
/// </summary>
|
||||
public class GetTrackTemplateListDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹模版id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板名称
|
||||
/// </summary>
|
||||
public string Name { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版代码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属子系统
|
||||
/// </summary>
|
||||
public string SubSystem { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑轨迹模版
|
||||
/// </summary>
|
||||
public class EditTrackTemplateInput
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public int Id { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作类型
|
||||
/// </summary>
|
||||
public OptionType Options { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板名称
|
||||
/// </summary>
|
||||
public int Name { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板代码
|
||||
/// </summary>
|
||||
public int Code { set; get; }
|
||||
}
|
||||
}
|
||||
@ -1,20 +1,100 @@
|
||||
using System;
|
||||
using SJZY.Expand.ABP.Core.Common.Dto;
|
||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
||||
using SJZY.Track.Repository.TrackTemplate.Entitys;
|
||||
using SJZY.Track.Repository.TrackTemplate.Services;
|
||||
using SJZY.Track.Repository.TrackTemplate.ValueObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
using Volo.Abp.ObjectMapping;
|
||||
|
||||
namespace SJZY.Track.Application.Services.TrackTemplates
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "轨迹模版")]
|
||||
[Route("/Track")]
|
||||
public class TrackTemplateService : ApplicationService, ITrackTemplateService, IScopedDependency
|
||||
{
|
||||
public TrackTemplateService()
|
||||
{
|
||||
private readonly ITrackTemplateRepository _trackTemplateRepository;
|
||||
|
||||
public TrackTemplateService(
|
||||
ITrackTemplateRepository trackTemplateRepository
|
||||
)
|
||||
{
|
||||
this._trackTemplateRepository=trackTemplateRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模版编辑
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/Template/Edit")]
|
||||
public async Task<UnifyResultDto> EditAsync(EditTrackTemplateInput 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("/Template/GetDetail")]
|
||||
public async Task<UnifyResultDto<GetTrackTemplateDetailDto>> GetDetailAsync(int id)
|
||||
{
|
||||
//var detailInfo = await _trackTemplateRepository.GetFirstAsync(a => a.Id== id);
|
||||
var detailInfo = await _trackTemplateRepository.GetDetailAsync(id);
|
||||
if (detailInfo==null)
|
||||
{
|
||||
return new UnifyResultDto<GetTrackTemplateDetailDto>(false, null, "未查询到轨迹模版");
|
||||
}
|
||||
var dto = ObjectMapper.Map<GetTrackTemplateDetailVO, GetTrackTemplateDetailDto>(detailInfo);
|
||||
return new UnifyResultDto<GetTrackTemplateDetailDto>("200", "", dto);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页轨迹模版
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/Template/GetList")]
|
||||
public async Task<UnifyPageResultDto<GetTrackTemplateListDto>> GetPageTrackTemplate(GetPageTrackTemplateInput input)
|
||||
{
|
||||
var vo = ObjectMapper.Map<GetPageTrackTemplateInput, GetPageTrackTemplateVO>(input);
|
||||
var resultDto = await _trackTemplateRepository.GetPageTrackTemplate(vo);
|
||||
var pageResultDto = ObjectMapper.Map<UnifyPageResultDto<GetTrackTemplateListVO>, UnifyPageResultDto<GetTrackTemplateListDto>>(resultDto);
|
||||
|
||||
return pageResultDto;
|
||||
}
|
||||
|
||||
#region 私有方法
|
||||
private async Task<UnifyResultDto> AddAsync(EditTrackTemplateInput input)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task<UnifyResultDto> UpdateAsync(EditTrackTemplateInput input)
|
||||
{
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private async Task<UnifyResultDto> DeleteAsync(EditTrackTemplateInput input)
|
||||
{
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
<Folder Include="TrackPushRecord\ValueObjects\" />
|
||||
<Folder Include="TrackStatus\ValueObjects\" />
|
||||
<Folder Include="TrackTemplateContent\ValueObjects\" />
|
||||
<Folder Include="TrackTemplate\ValueObjects\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
using SJZY.Track.Repository.TrackTemplate.Entitys;
|
||||
using SJZY.Track.Repository.TrackTemplate.ValueObjects;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackTemplate.Services
|
||||
{
|
||||
public interface ITrackTemplateRepository : ISimpleClient<TrackTemplateEntity>
|
||||
{
|
||||
Task<GetTrackTemplateDetailVO> GetDetailAsync(int id);
|
||||
|
||||
Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,36 @@
|
||||
using SJZY.Track.Repository.TrackTemplate.Entitys;
|
||||
using SJZY.Track.Repository.TrackTemplate.ValueObjects;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackTemplate.Services
|
||||
{
|
||||
public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITrackTemplateRepository, IScopedDependency
|
||||
{
|
||||
public TrackTemplateRepository()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取轨迹模版明细
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<GetTrackTemplateDetailVO> GetDetailAsync(int id)
|
||||
{
|
||||
//await Context.Queryable<TrackTemplateEntity>().LeftJoin<>
|
||||
|
||||
return new GetTrackTemplateDetailVO();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 分页获取轨迹模版
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackTemplate.ValueObjects
|
||||
{
|
||||
public class GetPageTrackTemplateVO : PageInfoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关键字
|
||||
/// </summary>
|
||||
public string Keywords { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackTemplate.ValueObjects
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取轨迹模版明细
|
||||
/// </summary>
|
||||
public class GetTrackTemplateDetailVO
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统
|
||||
/// </summary>
|
||||
public string SubSystem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版代码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取轨迹模版列表
|
||||
/// </summary>
|
||||
public class GetTrackTemplateListVO
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹模版id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板名称
|
||||
/// </summary>
|
||||
public string Name { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 模版代码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属子系统
|
||||
/// </summary>
|
||||
public string SubSystem { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user