Merge pull request '修改接口' (#10) from S01-轨迹中台 into dev
Reviewed-on: http://192.168.80.50:3000/Dotnet/SJZY.Track.Api/pulls/10
This commit is contained in:
commit
e049d7520b
@ -37,27 +37,27 @@ public class EditTrackPullConfigInput
|
||||
/// <summary>
|
||||
/// 拉取轨迹时区
|
||||
/// </summary>
|
||||
public string TackTimeZoneName { get; set; }
|
||||
public string? TackTimeZoneName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹内容代码
|
||||
/// </summary>
|
||||
public string TrackContentCodeName { get; set; }
|
||||
public string? TrackContentCodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹内容
|
||||
/// </summary>
|
||||
public string TrackContentName { get; set; }
|
||||
public string? TrackContentName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹发生地
|
||||
/// </summary>
|
||||
public string TrackPlaceName { get; set; }
|
||||
public string? TrackPlaceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹状态
|
||||
/// </summary>
|
||||
public string TrackStatusName { get; set; }
|
||||
public string? TrackStatusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模板id
|
||||
@ -67,5 +67,5 @@ public class EditTrackPullConfigInput
|
||||
/// <summary>
|
||||
/// 拉取轨迹发生时间
|
||||
/// </summary>
|
||||
public string TrackTimeName { get; set; }
|
||||
public string? TrackTimeName { get; set; }
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||
|
||||
public class SortTrackPushContentInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 排序信息
|
||||
/// </summary>
|
||||
public List<Dictionary<int, int>> SortInfo { get; set; }
|
||||
}
|
||||
@ -237,4 +237,15 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹推送配置内容排序
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("SortContent")]
|
||||
public async Task<bool> SortContentAsync([FromBody] SortTrackPushContentInput input)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -99,7 +99,7 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
||||
throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion 业务校验
|
||||
|
||||
var entity = ObjectMapper.Map<EditTrackTemplateInput, TrackTemplateEntity>(input);
|
||||
var isTrue = await _trackTemplateRepository.InsertAsync(entity);
|
||||
@ -110,13 +110,15 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
||||
private async Task<UnifyResultDto> UpdateAsync(EditTrackTemplateInput input)
|
||||
{
|
||||
#region 业务校验
|
||||
|
||||
var isExist = await _trackTemplateRepository.GetFirstAsync(a =>
|
||||
a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
||||
if (isExist != null)
|
||||
{
|
||||
throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion 业务校验
|
||||
|
||||
var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id);
|
||||
ObjectMapper.Map(input, templateEntity);
|
||||
@ -128,13 +130,15 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
||||
private async Task<UnifyResultDto> DeleteAsync(EditTrackTemplateInput input)
|
||||
{
|
||||
#region 业务校验
|
||||
|
||||
//查询看看在轨迹拉取里面有没有被占用
|
||||
var isExisistTrackPullConfig = await _trackPullConfigRepository.GetFirstAsync(a => a.TrackTemplateId == input.Id);
|
||||
if (isExisistTrackPullConfig != null)
|
||||
{
|
||||
throw new BusinessException(message: _stringLocalizer["IsExistTrackPullConfig"]);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion 业务校验
|
||||
|
||||
var isTrue = await _trackTemplateRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||
|
||||
|
||||
@ -15,5 +15,5 @@ public class KeywordsInputVO : PageInfoInput
|
||||
/// <summary>
|
||||
/// 选中项
|
||||
/// </summary>
|
||||
public int? SelectedId { get; set; }
|
||||
public List<int>? SelectedId { get; set; }
|
||||
}
|
||||
@ -23,4 +23,14 @@ public class GetTrackPushConfigPageOutputVO
|
||||
/// 模板名称
|
||||
/// </summary>
|
||||
public string TrackTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模板id
|
||||
/// </summary>
|
||||
public string TrackTemplateId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模板ids
|
||||
/// </summary>
|
||||
public List<int> TrackTemplateIds { get; set; }
|
||||
}
|
||||
@ -5,5 +5,5 @@ public class GetTrackTemplateContentPageInputVO : PageInfoInput
|
||||
/// <summary>
|
||||
/// 轨迹模板id
|
||||
/// </summary>
|
||||
public int TrackTemplateId { get; set; }
|
||||
public List<int> TrackTemplateIds { get; set; }
|
||||
}
|
||||
@ -68,4 +68,9 @@ public class GetTrackTemplateContentPageOutputVO
|
||||
/// 修改人
|
||||
/// </summary>
|
||||
public string UpdateUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容id
|
||||
/// </summary>
|
||||
public int TrackContentId { get; set; }
|
||||
}
|
||||
@ -32,9 +32,11 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
|
||||
TrackTemplate = SqlFunc.Subqueryable<TrackTemplateEntity>()
|
||||
.Where(template => SqlFunc.SplitIn(trackPush.TrackTemplateId, template.Id.ToString()) && !template.IsDeleted)
|
||||
.SelectStringJoin(template => template.Name, ","),
|
||||
TrackTemplateId = trackPush.TrackTemplateId,
|
||||
CreateTime = trackPush.CreateTime
|
||||
})
|
||||
.Distinct()
|
||||
.Mapper(x => { x.TrackTemplateIds = x.TrackTemplateId.Split(',').Select(int.Parse).ToList(); })
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
}
|
||||
|
||||
|
||||
@ -84,8 +84,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
(templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) =>
|
||||
templateContent.UpdateUserId == updateUser.Id && !updateUser.IsDeleted)
|
||||
.Filter(null, true)
|
||||
.Where(templateContent =>
|
||||
templateContent.TrackTemplateId == input.TrackTemplateId && !templateContent.IsDeleted)
|
||||
.Where(templateContent => input.TrackTemplateIds.Contains(templateContent.TrackTemplateId) && !templateContent.IsDeleted)
|
||||
.OrderByDescending(templateContent => templateContent.CreateTime)
|
||||
.Select((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) =>
|
||||
new GetTrackTemplateContentPageOutputVO
|
||||
|
||||
Loading…
Reference in New Issue
Block a user