Merge remote-tracking branch 'origin/S01-轨迹中台' into S01-轨迹中台
# Conflicts: # src/SJZY.Track.Domain/GlobalConst.cs
This commit is contained in:
commit
8b4219a8ad
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Configuration": {
|
"Configuration": {
|
||||||
"UseLocalConfiguration": true, //是否使用本地配置文件
|
"UseLocalConfiguration": false, //是否使用本地配置文件
|
||||||
"ConfiguraFileName": "appsettings.Development.json", //指定配置文件名称,开启UseLocalConfiguration时生效
|
"ConfiguraFileName": "appsettings.Development.json", //指定配置文件名称,开启UseLocalConfiguration时生效
|
||||||
"Apollo": {
|
"Apollo": {
|
||||||
"AppId": "SJZY.Track.Configuration",
|
"AppId": "SJZY.Track.Configuration",
|
||||||
|
|||||||
@ -7,10 +7,15 @@ public class GetPageTrackOrderInput : PageInfoInput
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int SubSystemId { get; set; }
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 单号
|
||||||
|
///// </summary>
|
||||||
|
//public List<string>? OrderNos { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单号
|
/// 单号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string>? OrderNos { get; set; }
|
public string? OrderNos { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建时间开始
|
/// 创建时间开始
|
||||||
@ -38,6 +43,11 @@ public class TrackOrderDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int OrderType { get; set; }
|
public int OrderType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单名称
|
||||||
|
/// </summary>
|
||||||
|
public string? OrderTypeName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单号
|
/// 订单号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -78,6 +88,11 @@ public class TrackOrderDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? NewestTrackPlace { get; set; }
|
public string? NewestTrackPlace { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最新轨迹时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? NewestTrackTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否完结
|
/// 是否完结
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -0,0 +1,41 @@
|
|||||||
|
namespace SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||||
|
|
||||||
|
public class EditTrackContentMapInput
|
||||||
|
{
|
||||||
|
public int? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int? MapSubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string? MapTrackContentCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int? MapTrackContentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作类型
|
||||||
|
/// </summary>
|
||||||
|
public OptionTypeNoNull Options { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 源子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int? SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 源轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string? TrackContentCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 源轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int? TrackContentId { get; set; }
|
||||||
|
}
|
||||||
@ -11,6 +11,16 @@
|
|||||||
/// 关键字
|
/// 关键字
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Keywords { get; set; }
|
public string? Keywords { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹状态id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackStatusId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 选中的轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public List<int>? SelectIds { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetTrackContentListDto
|
public class GetTrackContentListDto
|
||||||
|
|||||||
@ -12,60 +12,60 @@ public class EditTrackPullConfigInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹订单号
|
/// 拉取轨迹订单号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string OrderNoName { get; set; }
|
public string? OrderNoName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 返参解析对象
|
/// 返参解析对象
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ParseMethod { get; set; }
|
public int? ParseMethod { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 定时任务(分钟)
|
/// 定时任务(分钟)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int PullInterval { get; set; }
|
public int? PullInterval { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 服务商id
|
/// 服务商id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ServiceProviderId { get; set; }
|
public int? ServiceProviderId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 子系统id
|
/// 子系统id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SubSystemId { get; set; }
|
public int? SubSystemId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹时区
|
/// 拉取轨迹时区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TackTimeZoneName { get; set; }
|
public string? TackTimeZoneName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹内容代码
|
/// 拉取轨迹内容代码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackContentCodeName { get; set; }
|
public string? TrackContentCodeName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹内容
|
/// 拉取轨迹内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackContentName { get; set; }
|
public string? TrackContentName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹发生地
|
/// 拉取轨迹发生地
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackPlaceName { get; set; }
|
public string? TrackPlaceName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹状态
|
/// 拉取轨迹状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackStatusName { get; set; }
|
public string? TrackStatusName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹模板id
|
/// 轨迹模板id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TrackTemplateId { get; set; }
|
public int? TrackTemplateId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹发生时间
|
/// 拉取轨迹发生时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTimeName { get; set; }
|
public string? TrackTimeName { get; set; }
|
||||||
}
|
}
|
||||||
@ -7,7 +7,7 @@ public class UpdateTrackPullContentInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 服务商轨迹代码参数值
|
/// 服务商轨迹代码参数值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackContentCodeValue { get; set; }
|
public string? TrackContentCodeValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹内容id
|
/// 轨迹内容id
|
||||||
@ -17,17 +17,17 @@ public class UpdateTrackPullContentInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 服务商轨迹内容参数值
|
/// 服务商轨迹内容参数值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackContentValue { get; set; }
|
public string? TrackContentValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹关键词(正向)
|
/// 拉取轨迹关键字(正向)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackKeyword { get; set; }
|
public List<string>? TrackKeywords { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹关键词(反向)
|
/// 拉取轨迹关键字(反向)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackKeywordReverse { get; set; }
|
public List<string>? TrackKeywordReverses { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹发生地参数值
|
/// 轨迹发生地参数值
|
||||||
@ -42,10 +42,10 @@ public class UpdateTrackPullContentInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 服务商轨迹状态参数值
|
/// 服务商轨迹状态参数值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackStatusValue { get; set; }
|
public string? TrackStatusValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹时区GMT
|
/// 轨迹时区GMT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -10,7 +10,7 @@ public class EditTrackPushConfigInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送扩展字段
|
/// 推送扩展字段
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ExpandFieldsName { get; set; }
|
public string? ExpandFieldsName { get; set; }
|
||||||
|
|
||||||
public int? Id { get; set; }
|
public int? Id { get; set; }
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ public class EditTrackPushConfigInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹订单号
|
/// 推送轨迹订单号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string OrderNoName { get; set; }
|
public string? OrderNoName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 服务商id
|
/// 服务商id
|
||||||
@ -42,40 +42,40 @@ public class EditTrackPushConfigInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹时区
|
/// 推送轨迹时区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TackTimeZoneName { get; set; }
|
public string? TackTimeZoneName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹内容代码
|
/// 推送轨迹内容代码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackContentCodeName { get; set; }
|
public string? TrackContentCodeName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹内容
|
/// 推送轨迹内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackContentName { get; set; }
|
public string? TrackContentName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹内容英文
|
/// 推送轨迹内容英文
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackEnContentName { get; set; }
|
public string? TrackEnContentName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹发生地
|
/// 推送轨迹发生地
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackPlaceName { get; set; }
|
public string? TrackPlaceName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹状态
|
/// 推送轨迹状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackStatusName { get; set; }
|
public string? TrackStatusName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹模板id
|
/// 轨迹模板id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<int> TrackTemplateIds { get; set; }
|
public List<int>? TrackTemplateIds { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹发生时间
|
/// 推送轨迹发生时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTimeName { get; set; }
|
public string? TrackTimeName { get; set; }
|
||||||
}
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
namespace SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||||
|
|
||||||
|
public class EditTrackPushContentInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 扩展字段参数值
|
||||||
|
/// </summary>
|
||||||
|
public string? ExpandFieldsValue { get; set; }
|
||||||
|
|
||||||
|
public int? Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作类型
|
||||||
|
/// </summary>
|
||||||
|
public OptionTypeNoNull Options { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送单号类型
|
||||||
|
/// </summary>
|
||||||
|
public int OrderNoType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送轨迹排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹代码参数值
|
||||||
|
/// </summary>
|
||||||
|
public string? TrackContentCodeValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackContentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容参数值
|
||||||
|
/// </summary>
|
||||||
|
public string? TrackContentValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容英文参数值
|
||||||
|
/// </summary>
|
||||||
|
public string? TrackEnContentValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹推送配置id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackPushConfigId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹状态参数值
|
||||||
|
/// </summary>
|
||||||
|
public string? TrackStatusValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹时区GMT
|
||||||
|
/// </summary>
|
||||||
|
public double? TrackTimeZone { get; set; }
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||||
|
|
||||||
|
public class SortTrackPushContentInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 排序信息
|
||||||
|
/// </summary>
|
||||||
|
public List<DropdownListDataDto> SortInfo { get; set; }
|
||||||
|
}
|
||||||
@ -14,25 +14,20 @@ public class EditTrackTemplateContentInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否可删
|
/// 是否可删
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsCanDelete { get; set; }
|
public bool? IsCanDelete { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否对外
|
/// 是否对外
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsExternal { get; set; }
|
public bool? IsExternal { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
public int Sort { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹内容id
|
/// 轨迹内容id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TrackContentId { get; set; }
|
public int? TrackContentId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹模板id
|
/// 轨迹模板id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TrackTemplateId { get; set; }
|
public int? TrackTemplateId { get; set; }
|
||||||
}
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
||||||
|
|
||||||
|
public class SortTrackTemplateContentInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 排序信息
|
||||||
|
/// </summary>
|
||||||
|
public List<DropdownListDataDto> SortInfo { get; set; }
|
||||||
|
}
|
||||||
@ -1,6 +1,8 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
|
using AutoMapper.Internal.Mappers;
|
||||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.Order;
|
using SJZY.Track.Domain.Dtos.Order;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
@ -21,5 +23,6 @@ public class OrderAutoMapperProfile : Profile
|
|||||||
CreateMap<GetPageTrackOrderInput, GetPageTrackOrderInputVO>(MemberList.None);
|
CreateMap<GetPageTrackOrderInput, GetPageTrackOrderInputVO>(MemberList.None);
|
||||||
CreateMap<TrackOrderVO, TrackOrderDto>(MemberList.None);
|
CreateMap<TrackOrderVO, TrackOrderDto>(MemberList.None);
|
||||||
CreateMap<UnifyPageResultDto<TrackOrderVO>, UnifyPageResultDto<TrackOrderDto>>(MemberList.None);
|
CreateMap<UnifyPageResultDto<TrackOrderVO>, UnifyPageResultDto<TrackOrderDto>>(MemberList.None);
|
||||||
|
CreateMap<TrackDetailsIndex, TrackOrderDetailDto>(MemberList.None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -15,6 +15,7 @@ namespace SJZY.Track.Application.AutoMapper
|
|||||||
CreateMap<GetTrackContentListVO, GetTrackContentListDto>(MemberList.None);
|
CreateMap<GetTrackContentListVO, GetTrackContentListDto>(MemberList.None);
|
||||||
CreateMap<UnifyPageResultDto<GetTrackContentListVO>, UnifyPageResultDto<GetTrackContentListDto>>(
|
CreateMap<UnifyPageResultDto<GetTrackContentListVO>, UnifyPageResultDto<GetTrackContentListDto>>(
|
||||||
MemberList.None);
|
MemberList.None);
|
||||||
|
CreateMap<EditTrackContentMapInput, TrackContentMapEntity>(MemberList.None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -12,6 +12,16 @@ public class TrackPullAutoMapperProfile : Profile
|
|||||||
CreateMap<EditTrackPullConfigInput, TrackPullConfigEntity>(MemberList.None);
|
CreateMap<EditTrackPullConfigInput, TrackPullConfigEntity>(MemberList.None);
|
||||||
CreateMap<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id)
|
CreateMap<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id)
|
||||||
.ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => false));
|
.ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => false));
|
||||||
CreateMap<UpdateTrackPullContentInput, TrackPullContentConfigEntity>(MemberList.None);
|
CreateMap<UpdateTrackPullContentInput, TrackPullContentConfigEntity>(MemberList.None)
|
||||||
|
.ForMember(dest => dest.TrackKeyword, opt =>
|
||||||
|
{
|
||||||
|
opt.Condition(src => !src.TrackKeywords.IsNullOrEmpty());
|
||||||
|
opt.MapFrom(src => string.Join(',', src.TrackKeywords));
|
||||||
|
})
|
||||||
|
.ForMember(dest => dest.TrackKeywordReverse, opt =>
|
||||||
|
{
|
||||||
|
opt.Condition(src => !src.TrackKeywordReverses.IsNullOrEmpty());
|
||||||
|
opt.MapFrom(src => string.Join(',', src.TrackKeywordReverses));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -14,5 +14,6 @@ public class TrackPushAutoMapperProfile : Profile
|
|||||||
.ForMember(dest => dest.TrackTemplateId, opt => opt.MapFrom(source => string.Join(',', source.TrackTemplateIds)));
|
.ForMember(dest => dest.TrackTemplateId, opt => opt.MapFrom(source => string.Join(',', source.TrackTemplateIds)));
|
||||||
CreateMap<EditTrackPushConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id)
|
CreateMap<EditTrackPushConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id)
|
||||||
.ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => true));
|
.ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => true));
|
||||||
|
CreateMap<EditTrackPushContentInput, TrackPushContentConfigEntity>(MemberList.None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7,6 +7,9 @@
|
|||||||
"TemplateExist": "The template code already exists under the currently selected subsystem",
|
"TemplateExist": "The template code already exists under the currently selected subsystem",
|
||||||
"TrackContentExist": "The trace code or trace content or trace content in the current subsystem is repeated in English",
|
"TrackContentExist": "The trace code or trace content or trace content in the current subsystem is repeated in English",
|
||||||
"TrackStatusExist": "The trajectory status code or trajectory status or trajectory status in English is repeated under the current subsystem",
|
"TrackStatusExist": "The trajectory status code or trajectory status or trajectory status in English is repeated under the current subsystem",
|
||||||
"TrackFlagExist": "Duplicate code or flag in the current subsystem"
|
"TrackFlagExist": "Duplicate code or flag in the current subsystem",
|
||||||
|
"IsExistTrackPullConfig": "Track Pull The template has been bound. Delete the track pull before deleting the template",
|
||||||
|
"IsExistTrackStatus": "The trajectory content has been bound to the trajectory status. Delete the trajectory content before deleting the trajectory status",
|
||||||
|
"IsExistTrackFlag": "The track content has been bound to the track mark. Delete the track content before deleting the track mark"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7,6 +7,9 @@
|
|||||||
"TemplateExist": "模板代码已存在于当前选择的子系统下",
|
"TemplateExist": "模板代码已存在于当前选择的子系统下",
|
||||||
"TrackContentExist": "当前子系统下轨迹代码或轨迹内容或轨迹内容英文重复",
|
"TrackContentExist": "当前子系统下轨迹代码或轨迹内容或轨迹内容英文重复",
|
||||||
"TrackStatusExist": "当前子系统下轨迹状态代码或轨迹状态或轨迹状态英文重复",
|
"TrackStatusExist": "当前子系统下轨迹状态代码或轨迹状态或轨迹状态英文重复",
|
||||||
"TrackFlagExist": "当前子系统下代码或标记重复"
|
"TrackFlagExist": "当前子系统下代码或标记重复",
|
||||||
|
"IsExistTrackPullConfig": "轨迹拉取已绑定了该模版,请先删除轨迹拉取再删除该模版",
|
||||||
|
"IsExistTrackStatus": "轨迹内容已经绑定了该轨迹状态,请先删除轨迹内容后再删除该轨迹状态",
|
||||||
|
"IsExistTrackFlag": "轨迹内容已经绑定了该轨迹标记,请先删除轨迹内容后再删除该轨迹标记"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,8 +1,15 @@
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
|
using SJZY.Expand.ABP.Core.Common.Dto;
|
||||||
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
|
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||||
using SJZY.Track.Application.Contract.Dtos.TrackContents;
|
using SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||||
|
using SJZY.Track.Application.Contract.Dtos.TrackPull;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.TrackContents;
|
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
|
using SJZY.Track.Domain.Queries;
|
||||||
|
using System.Linq.Expressions;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.TrackContents
|
namespace SJZY.Track.Application.Services.TrackContents
|
||||||
@ -16,14 +23,17 @@ namespace SJZY.Track.Application.Services.TrackContents
|
|||||||
{
|
{
|
||||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||||
private readonly ITrackContentRepository _trackContentRepository;
|
private readonly ITrackContentRepository _trackContentRepository;
|
||||||
|
private readonly IBasicQuery<TrackContentMapEntity> _trackContentMapBasicQuery;
|
||||||
|
|
||||||
public TrackContentService(
|
public TrackContentService(
|
||||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||||
ITrackContentRepository trackContentRepository
|
ITrackContentRepository trackContentRepository,
|
||||||
|
IBasicQuery<TrackContentMapEntity> trackContentMapBasicQuery
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this._stringLocalizer = stringLocalizer;
|
this._stringLocalizer = stringLocalizer;
|
||||||
this._trackContentRepository = trackContentRepository;
|
this._trackContentRepository = trackContentRepository;
|
||||||
|
this._trackContentMapBasicQuery=trackContentMapBasicQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -84,15 +94,15 @@ namespace SJZY.Track.Application.Services.TrackContents
|
|||||||
{
|
{
|
||||||
#region 业务逻辑校验
|
#region 业务逻辑校验
|
||||||
|
|
||||||
var trackContentEntity = await _trackContentRepository.GetFirstAsync(a =>
|
var trackContentEntitys = await _trackContentRepository.GetListAsync(a =>
|
||||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||||
a.Content == input.Content || a.EnContent == input.EnContent));
|
a.Content == input.Content || a.EnContent == input.EnContent));
|
||||||
if (trackContentEntity != null)
|
if (trackContentEntitys.Any())
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
|
//throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
|
||||||
|
throw new BusinessException(message: "当前子系统下,轨迹代码或轨迹内容或轨迹内容英文存在");
|
||||||
}
|
}
|
||||||
|
#endregion 业务逻辑校验
|
||||||
#endregion
|
|
||||||
|
|
||||||
var entity = ObjectMapper.Map<EditTrackContentInput, TrackContentEntity>(input);
|
var entity = ObjectMapper.Map<EditTrackContentInput, TrackContentEntity>(input);
|
||||||
var isTrue = await _trackContentRepository.InsertAsync(entity);
|
var isTrue = await _trackContentRepository.InsertAsync(entity);
|
||||||
@ -103,31 +113,141 @@ namespace SJZY.Track.Application.Services.TrackContents
|
|||||||
private async Task<UnifyResultDto> UpdateAsync(EditTrackContentInput input)
|
private async Task<UnifyResultDto> UpdateAsync(EditTrackContentInput input)
|
||||||
{
|
{
|
||||||
#region 业务逻辑校验
|
#region 业务逻辑校验
|
||||||
|
var trackContentEntitys = await _trackContentRepository.GetListAsync(a => a.Id != input.Id &&
|
||||||
var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => a.Id != input.Id &&
|
|
||||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||||
a.Content == input.Content || a.EnContent == input.EnContent));
|
a.Content == input.Content || a.EnContent == input.EnContent));
|
||||||
if (trackContentEntity != null)
|
if (trackContentEntitys.Any())
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
|
//throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
|
||||||
|
throw new BusinessException(message: "当前子系统下,轨迹代码或轨迹内容或轨迹内容英文存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion 业务逻辑校验
|
||||||
|
|
||||||
|
//更新的时候需要覆盖内容映射轨迹代码
|
||||||
var templateEntity = await _trackContentRepository.GetFirstAsync(a => a.Id == input.Id);
|
var templateEntity = await _trackContentRepository.GetFirstAsync(a => a.Id == input.Id);
|
||||||
|
|
||||||
|
bool isTrue = false;
|
||||||
|
|
||||||
|
using (var ts = TransactionScopeHelper.Create())
|
||||||
|
{
|
||||||
|
// 如果轨迹内容的子系统和code发生变化,同步到轨迹映射表
|
||||||
|
if (templateEntity.SubSystemId != input.SubSystemId || templateEntity.Code != input.Code)
|
||||||
|
{
|
||||||
|
await _trackContentRepository.UpdateMapAsync(x => new TrackContentMapEntity
|
||||||
|
{
|
||||||
|
SubSystemId = input.SubSystemId,
|
||||||
|
TrackContentCode = input.Code
|
||||||
|
}, x => x.TrackContentId == input.Id);
|
||||||
|
|
||||||
|
await _trackContentRepository.UpdateMapAsync(x => new TrackContentMapEntity
|
||||||
|
{
|
||||||
|
MapSubSystemId = input.SubSystemId,
|
||||||
|
MapTrackContentCode = input.Code
|
||||||
|
}, x => x.MapTrackContentId == input.Id);
|
||||||
|
}
|
||||||
|
|
||||||
ObjectMapper.Map(input, templateEntity);
|
ObjectMapper.Map(input, templateEntity);
|
||||||
var isTrue = await _trackContentRepository.UpdateAsync(templateEntity);
|
|
||||||
|
isTrue = await _trackContentRepository.UpdateAsync(templateEntity);
|
||||||
|
|
||||||
|
ts.Complete();
|
||||||
|
}
|
||||||
|
|
||||||
return new UnifyResultDto("200", "修改成功", isTrue);
|
return new UnifyResultDto("200", "修改成功", isTrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<UnifyResultDto> DeleteAsync(EditTrackContentInput input)
|
private async Task<UnifyResultDto> DeleteAsync(EditTrackContentInput input)
|
||||||
{
|
{
|
||||||
|
#region 业务校验
|
||||||
|
|
||||||
|
//需要加个判断,存在内容映射,则出提示
|
||||||
|
var trackContentMapEntities = await _trackContentMapBasicQuery.GetListAsync(a => a.TrackContentId==input.Id|| a.MapTrackContentId==input.Id);
|
||||||
|
if (trackContentMapEntities.Any())
|
||||||
|
{
|
||||||
|
throw new BusinessException(message: "无法删除该内容,该轨迹内容已在轨迹内容映射中使用了,请检查");
|
||||||
|
}
|
||||||
|
#endregion 业务校验
|
||||||
|
|
||||||
var isTrue = await _trackContentRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
var isTrue = await _trackContentRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||||
|
|
||||||
return new UnifyResultDto("200", "删除成功", isTrue);
|
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion 私有方法
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容映射列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("GetMapPage")]
|
||||||
|
public async Task<UnifyPageResultDto<GetTrackContentMapPageOutputVO>> GetMapPageAsync([FromBody] GetTrackContentMapPageInputVO input)
|
||||||
|
{
|
||||||
|
return await _trackContentRepository.GetMapPageAsync(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容映射详情
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("GetMapDetail")]
|
||||||
|
public async Task<GetTrackContentMapDetailOutputVO> GetMapDetailAsync(int id)
|
||||||
|
{
|
||||||
|
return await _trackContentRepository.GetMapDetailAsync(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容映射编辑
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("EditMap")]
|
||||||
|
public async Task<bool> EditMapAsync([FromBody] EditTrackContentMapInput input)
|
||||||
|
{
|
||||||
|
if (input.Options != OptionTypeNoNull.删除)
|
||||||
|
{
|
||||||
|
if (input.SubSystemId == input.MapSubSystemId) throw new BusinessException(message: _stringLocalizer["NotAllowedToMapSubSystem"]);
|
||||||
|
|
||||||
|
Expression<Func<TrackContentMapEntity, bool>> isMapAnyExp = x =>
|
||||||
|
x.TrackContentId == input.TrackContentId && x.MapTrackContentId == input.MapTrackContentId;
|
||||||
|
if (input.Options == OptionTypeNoNull.修改) isMapAnyExp.And(x => x.Id != input.Id);
|
||||||
|
|
||||||
|
if (await _trackContentRepository.IsMapAnyAsync(isMapAnyExp))
|
||||||
|
throw new BusinessException(message: _stringLocalizer["IsTrackContentMapAny"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (input.Options)
|
||||||
|
{
|
||||||
|
case OptionTypeNoNull.新增:
|
||||||
|
{
|
||||||
|
var trackContentMapEntity = ObjectMapper.Map<EditTrackContentMapInput, TrackContentMapEntity>(input);
|
||||||
|
|
||||||
|
await _trackContentRepository.InsertMapAsync(trackContentMapEntity);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OptionTypeNoNull.修改:
|
||||||
|
{
|
||||||
|
var oldTrackContentMapEntity = await _trackContentRepository.GetMapByIdAsync(input.Id!.Value) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||||
|
|
||||||
|
ObjectMapper.Map(input, oldTrackContentMapEntity);
|
||||||
|
|
||||||
|
await _trackContentRepository.UpdateMapAsync(oldTrackContentMapEntity);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OptionTypeNoNull.删除:
|
||||||
|
await _trackContentRepository.SoftDeleteMapAsync(x => x.Id == input.Id);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new BusinessException(message: _stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum,
|
||||||
|
nameof(EditTrackContentMapInput.Options)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using SJZY.Track.Application.Contract.Dtos.TrackFlags;
|
using SJZY.Track.Application.Contract.Dtos.TrackFlags;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.TrackFlags;
|
using SJZY.Track.Domain.Dtos.TrackFlags;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
@ -16,14 +17,17 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
|||||||
{
|
{
|
||||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||||
private readonly ITrackFlagRepository _trackFlagRepository;
|
private readonly ITrackFlagRepository _trackFlagRepository;
|
||||||
|
private readonly ITrackContentRepository _trackContentRepository;
|
||||||
|
|
||||||
public TrackFlagService(
|
public TrackFlagService(
|
||||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||||
ITrackFlagRepository trackFlagRepository
|
ITrackFlagRepository trackFlagRepository,
|
||||||
|
ITrackContentRepository trackContentRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this._stringLocalizer = stringLocalizer;
|
this._stringLocalizer = stringLocalizer;
|
||||||
this._trackFlagRepository = trackFlagRepository;
|
this._trackFlagRepository = trackFlagRepository;
|
||||||
|
this._trackContentRepository=trackContentRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -82,14 +86,13 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
|||||||
private async Task<UnifyResultDto> AddAsync(EditTrackFlagInput input)
|
private async Task<UnifyResultDto> AddAsync(EditTrackFlagInput input)
|
||||||
{
|
{
|
||||||
#region 业务校验
|
#region 业务校验
|
||||||
|
var trackStatusEntitys = await _trackFlagRepository.GetListAsync(a =>
|
||||||
var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a =>
|
|
||||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code || a.Name == input.Flag));
|
a.SubSystemId == input.SubSystemId && (a.Code == input.Code || a.Name == input.Flag));
|
||||||
if (trackStatusEntity != null)
|
if (trackStatusEntitys.Any())
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
|
//throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
|
||||||
|
throw new BusinessException(message: "当前子系统下已存在轨迹标记代码");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
var entity = ObjectMapper.Map<EditTrackFlagInput, TrackFlagEntity>(input);
|
var entity = ObjectMapper.Map<EditTrackFlagInput, TrackFlagEntity>(input);
|
||||||
@ -102,12 +105,13 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
|||||||
{
|
{
|
||||||
#region 业务校验
|
#region 业务校验
|
||||||
|
|
||||||
var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a => a.Id != input.Id &&
|
var trackStatusEntitys = await _trackFlagRepository.GetListAsync(a => a.Id != input.Id &&
|
||||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||||
a.Name == input.Flag));
|
a.Name == input.Flag));
|
||||||
if (trackStatusEntity != null)
|
if (trackStatusEntitys.Any())
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
|
//throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
|
||||||
|
throw new BusinessException(message: "当前子系统下已存在轨迹标记代码");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -121,6 +125,13 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
|||||||
|
|
||||||
private async Task<UnifyResultDto> DeleteAsync(EditTrackFlagInput input)
|
private async Task<UnifyResultDto> DeleteAsync(EditTrackFlagInput input)
|
||||||
{
|
{
|
||||||
|
#region 业务校验
|
||||||
|
var isExistContent = await _trackContentRepository.GetFirstAsync(a => a.TrackFlagId==input.Id);
|
||||||
|
if (isExistContent!=null)
|
||||||
|
{
|
||||||
|
throw new BusinessException(message: _stringLocalizer["IsExistTrackFlag"]);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
var isTrue = await _trackFlagRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
var isTrue = await _trackFlagRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||||
|
|
||||||
return new UnifyResultDto("200", "删除成功", isTrue);
|
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||||
|
|||||||
@ -5,9 +5,11 @@ using SJZY.Expand.ABP.Core.PublicMethords;
|
|||||||
using SJZY.Track.Application.Contract.Dtos.TrackPull;
|
using SJZY.Track.Application.Contract.Dtos.TrackPull;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.Common;
|
using SJZY.Track.Domain.Dtos.Common;
|
||||||
using SJZY.Track.Domain.Dtos.TrackPull;
|
using SJZY.Track.Domain.Dtos.TrackPull;
|
||||||
|
using SqlSugar;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.TrackPull;
|
namespace SJZY.Track.Application.Services.TrackPull;
|
||||||
@ -91,7 +93,7 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
|||||||
Expression<Func<TrackPullConfigEntity, bool>> isAnyExp = x =>
|
Expression<Func<TrackPullConfigEntity, bool>> isAnyExp = x =>
|
||||||
x.SubSystemId == input.SubSystemId && x.TrackTemplateId == input.TrackTemplateId &&
|
x.SubSystemId == input.SubSystemId && x.TrackTemplateId == input.TrackTemplateId &&
|
||||||
x.ServiceProviderId == input.ServiceProviderId;
|
x.ServiceProviderId == input.ServiceProviderId;
|
||||||
if (input.Options == OptionTypeNoNull.修改) isAnyExp.And(x => x.Id != input.Id);
|
if (input.Options == OptionTypeNoNull.修改) isAnyExp = isAnyExp.And(x => x.Id != input.Id);
|
||||||
|
|
||||||
if (await _trackPullConfigRepository.IsAnyAsync(isAnyExp))
|
if (await _trackPullConfigRepository.IsAnyAsync(isAnyExp))
|
||||||
throw new BusinessException(message: _stringLocalizer["IsTrackPullConfigAny"]);
|
throw new BusinessException(message: _stringLocalizer["IsTrackPullConfigAny"]);
|
||||||
@ -208,6 +210,21 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
|||||||
[HttpPost("UpdateContent")]
|
[HttpPost("UpdateContent")]
|
||||||
public async Task<bool> UpdateContentAsync([FromBody] UpdateTrackPullContentInput input)
|
public async Task<bool> UpdateContentAsync([FromBody] UpdateTrackPullContentInput input)
|
||||||
{
|
{
|
||||||
|
Expression<Func<TrackPullContentConfigEntity, bool>> isContentAnyExp = x => x.Id != input.Id && x.TrackPullConfigId == input.TrackPullConfigId;
|
||||||
|
|
||||||
|
var trackKeywordExp = Expressionable.Create<TrackPullContentConfigEntity>()
|
||||||
|
.And(x => x.TrackContentId == input.TrackContentId
|
||||||
|
|| (input.TrackContentCodeValue != null && x.TrackContentCodeValue == input.TrackContentCodeValue)
|
||||||
|
|| (input.TrackStatusValue != null && x.TrackStatusValue == input.TrackStatusValue)
|
||||||
|
|| (input.TrackContentValue != null && x.TrackContentValue == input.TrackContentValue));
|
||||||
|
|
||||||
|
input.TrackKeywords?.ForEach(item => { trackKeywordExp.Or(x => SqlFunc.SplitIn(x.TrackKeyword, item)); });
|
||||||
|
|
||||||
|
isContentAnyExp = isContentAnyExp.And(trackKeywordExp.ToExpression());
|
||||||
|
|
||||||
|
if (await _trackPullConfigRepository.IsContentAnyAsync(isContentAnyExp))
|
||||||
|
throw new BusinessException(message: _stringLocalizer["IsTrackPullContentAny"]);
|
||||||
|
|
||||||
var oldTrackPullContentEntity = await _trackPullConfigRepository.GetContentByIdAsync(input.Id) ??
|
var oldTrackPullContentEntity = await _trackPullConfigRepository.GetContentByIdAsync(input.Id) ??
|
||||||
throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
|
using SJZY.Expand.ABP.Core;
|
||||||
using SJZY.Expand.ABP.Core.Localization;
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||||
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||||
@ -66,7 +67,7 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
|||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("GetDetail")]
|
[HttpGet("GetDetail")]
|
||||||
public async Task<GetTrackPushConfigDetailOutputVO?> GetDetailAsync(int id)
|
public async Task<GetTrackPushConfigDetailOutputVO> GetDetailAsync(int id)
|
||||||
{
|
{
|
||||||
var res = await _trackPushConfigRepository.GetDetailAsync(id);
|
var res = await _trackPushConfigRepository.GetDetailAsync(id);
|
||||||
if (res is null) return null;
|
if (res is null) return null;
|
||||||
@ -103,12 +104,14 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
Expression<Func<TrackPushConfigEntity, bool>> isAnyExp = x =>
|
Expression<Func<TrackPushConfigEntity, bool>> isAnyExp = x =>
|
||||||
x.SubSystemId == input.SubSystemId && x.CustomId == input.CustomId && x.ServiceProviderId == input.ServiceProviderId;
|
x.SubSystemId == input.SubSystemId && x.CustomId == input.CustomId && x.ServiceProviderId == input.ServiceProviderId;
|
||||||
if (input.Options == OptionTypeNoNull.修改) isAnyExp.And(x => x.Id != input.Id);
|
if (input.Options == OptionTypeNoNull.修改) isAnyExp = isAnyExp.And(x => x.Id != input.Id);
|
||||||
|
|
||||||
var trackTemplateIdExp = Expressionable.Create<TrackPushConfigEntity>();
|
var trackTemplateIdExp = Expressionable.Create<TrackPushConfigEntity>();
|
||||||
foreach (var trackTemplateId in input.TrackTemplateIds) { trackTemplateIdExp.Or(x => SqlFunc.SplitIn(x.TrackTemplateId, trackTemplateId.ToString())); }
|
foreach (var trackTemplateId in input.TrackTemplateIds) { trackTemplateIdExp.Or(x => SqlFunc.SplitIn(x.TrackTemplateId, trackTemplateId.ToString())); }
|
||||||
|
|
||||||
if (await _trackPushConfigRepository.IsAnyAsync(isAnyExp.And(trackTemplateIdExp.ToExpression())))
|
isAnyExp = isAnyExp.And(trackTemplateIdExp.ToExpression());
|
||||||
|
|
||||||
|
if (await _trackPushConfigRepository.IsAnyAsync(isAnyExp))
|
||||||
throw new BusinessException(message: _stringLocalizer["IsTrackPushConfigAny"]);
|
throw new BusinessException(message: _stringLocalizer["IsTrackPushConfigAny"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,6 +129,8 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
|||||||
trackPushParamsEntity.PullOrPushConfigId = id;
|
trackPushParamsEntity.PullOrPushConfigId = id;
|
||||||
await _trackPullConfigRepository.InsertParamsAsync(trackPushParamsEntity);
|
await _trackPullConfigRepository.InsertParamsAsync(trackPushParamsEntity);
|
||||||
|
|
||||||
|
if (input.IsAutoPush) await RedisHelper.Client.SAddAsync(GlobalConst.AutoPushRosterRedisKey, input.CustomId);
|
||||||
|
|
||||||
ts.Complete();
|
ts.Complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -135,6 +140,8 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
var oldTrackPushEntity = await _trackPushConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
var oldTrackPushEntity = await _trackPushConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||||
|
|
||||||
|
int oldCustomId = oldTrackPushEntity.CustomId;
|
||||||
|
|
||||||
var oldTrackPushParamsEntity =
|
var oldTrackPushParamsEntity =
|
||||||
await _trackPullConfigRepository.GetParamsSingleAsync(x =>
|
await _trackPullConfigRepository.GetParamsSingleAsync(x =>
|
||||||
x.PullOrPushConfigId == input.Id && x.IsPush);
|
x.PullOrPushConfigId == input.Id && x.IsPush);
|
||||||
@ -147,12 +154,18 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
|||||||
await _trackPushConfigRepository.UpdateAsync(oldTrackPushEntity);
|
await _trackPushConfigRepository.UpdateAsync(oldTrackPushEntity);
|
||||||
await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPushParamsEntity);
|
await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPushParamsEntity);
|
||||||
|
|
||||||
|
await RedisHelper.Client.SRemAsync(GlobalConst.AutoPushRosterRedisKey, oldCustomId);
|
||||||
|
if (input.IsAutoPush) await RedisHelper.Client.SAddAsync(GlobalConst.AutoPushRosterRedisKey, input.CustomId);
|
||||||
|
|
||||||
ts.Complete();
|
ts.Complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OptionTypeNoNull.删除:
|
case OptionTypeNoNull.删除:
|
||||||
|
{
|
||||||
|
var oldTrackPushEntity = await _trackPushConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||||
|
|
||||||
using (var ts = TransactionScopeHelper.Create())
|
using (var ts = TransactionScopeHelper.Create())
|
||||||
{
|
{
|
||||||
await _trackPushConfigRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
await _trackPushConfigRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||||
@ -160,9 +173,11 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
|||||||
x.PullOrPushConfigId == input.Id && x.IsPush);
|
x.PullOrPushConfigId == input.Id && x.IsPush);
|
||||||
await _trackPushConfigRepository.SoftDeleteContentAsync(x => x.TrackPushConfigId == input.Id);
|
await _trackPushConfigRepository.SoftDeleteContentAsync(x => x.TrackPushConfigId == input.Id);
|
||||||
|
|
||||||
|
await RedisHelper.Client.SRemAsync(GlobalConst.AutoPushRosterRedisKey, oldTrackPushEntity.CustomId);
|
||||||
|
|
||||||
ts.Complete();
|
ts.Complete();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -172,4 +187,82 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹推送配置内容编辑
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("EditContent")]
|
||||||
|
public async Task<bool> EditContentAsync([FromBody] EditTrackPushContentInput input)
|
||||||
|
{
|
||||||
|
if (input.Options != OptionTypeNoNull.删除)
|
||||||
|
{
|
||||||
|
Expression<Func<TrackPushContentConfigEntity, bool>> isContentAnyExp = x =>
|
||||||
|
x.TrackPushConfigId == input.TrackPushConfigId
|
||||||
|
&& (x.TrackContentId == input.TrackContentId
|
||||||
|
|| (input.TrackContentCodeValue != null && x.TrackContentCodeValue == input.TrackContentCodeValue)
|
||||||
|
|| (input.TrackStatusValue != null && x.TrackStatusValue == x.TrackStatusValue)
|
||||||
|
|| (input.TrackContentValue != null && x.TrackContentValue == input.TrackContentValue)
|
||||||
|
|| (input.TrackEnContentValue != null && x.TrackEnContentValue == input.TrackEnContentValue));
|
||||||
|
if (input.Options == OptionTypeNoNull.修改) isContentAnyExp = isContentAnyExp.And(x => x.Id != input.Id);
|
||||||
|
|
||||||
|
if (await _trackPushConfigRepository.IsContentAnyAsync(isContentAnyExp))
|
||||||
|
throw new BusinessException(message: _stringLocalizer["IsTrackPushContentAny"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (input.Options)
|
||||||
|
{
|
||||||
|
case OptionTypeNoNull.新增:
|
||||||
|
{
|
||||||
|
var trackPushContentEntity = ObjectMapper.Map<EditTrackPushContentInput, TrackPushContentConfigEntity>(input);
|
||||||
|
|
||||||
|
await _trackPushConfigRepository.InsertContentAsync(trackPushContentEntity);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OptionTypeNoNull.修改:
|
||||||
|
{
|
||||||
|
var oldTrackPushContentEntity = await _trackPushConfigRepository.GetContentByIdAsync(input.Id!.Value) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||||
|
|
||||||
|
ObjectMapper.Map(input, oldTrackPushContentEntity);
|
||||||
|
|
||||||
|
await _trackPushConfigRepository.UpdateContentAsync(oldTrackPushContentEntity);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OptionTypeNoNull.删除:
|
||||||
|
await _trackPushConfigRepository.SoftDeleteContentAsync(x => x.Id == input.Id);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new BusinessException(message: _stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum,
|
||||||
|
nameof(EditTrackPushContentInput.Options)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹推送配置内容排序
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("SortContent")]
|
||||||
|
public async Task<bool> SortContentAsync([FromBody] SortTrackPushContentInput input)
|
||||||
|
{
|
||||||
|
List<int> ids = input.SortInfo.Select(x => int.Parse(x.Key)).ToList();
|
||||||
|
|
||||||
|
var trackPushContentEntities = await _trackPushConfigRepository.GetContentListAsync(x => ids.Contains(x.Id));
|
||||||
|
|
||||||
|
trackPushContentEntities.ForEach(item =>
|
||||||
|
{
|
||||||
|
item.Sort = input.SortInfo.Single(x => x.Key == item.Id.ToString()).Value;
|
||||||
|
});
|
||||||
|
|
||||||
|
await _trackPushConfigRepository.UpdateContentRangeAsync(trackPushContentEntities);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using SJZY.Track.Application.Contract.Dtos.TrackStatus;
|
using SJZY.Track.Application.Contract.Dtos.TrackStatus;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
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;
|
using Volo.Abp.DependencyInjection;
|
||||||
@ -16,14 +17,17 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||||
private readonly ITrackStatusRepository _trackStatusRepository;
|
private readonly ITrackStatusRepository _trackStatusRepository;
|
||||||
|
private readonly ITrackContentRepository _trackContentRepository;
|
||||||
|
|
||||||
public TrackStatusService(
|
public TrackStatusService(
|
||||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||||
ITrackStatusRepository trackStatusRepository
|
ITrackStatusRepository trackStatusRepository,
|
||||||
|
ITrackContentRepository trackContentRepository
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this._stringLocalizer = stringLocalizer;
|
this._stringLocalizer = stringLocalizer;
|
||||||
this._trackStatusRepository = trackStatusRepository;
|
this._trackStatusRepository = trackStatusRepository;
|
||||||
|
this._trackContentRepository=trackContentRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -83,12 +87,13 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
#region 业务校验
|
#region 业务校验
|
||||||
|
|
||||||
var trackStatusEntity = await _trackStatusRepository.GetFirstAsync(a => a.SubSystemId == input.SubSystemId &&
|
var trackStatusEntitys = await _trackStatusRepository.GetListAsync(a => a.SubSystemId == input.SubSystemId &&
|
||||||
(a.Code == input.Code ||
|
(a.Code == input.Code ||
|
||||||
a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus));
|
a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus));
|
||||||
if (trackStatusEntity != null)
|
if (trackStatusEntitys.Any())
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
//throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
||||||
|
throw new BusinessException(message: "当前子系统下,轨迹状态代码或轨迹状态或轨迹状态英文存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -103,12 +108,13 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
#region 业务校验
|
#region 业务校验
|
||||||
|
|
||||||
var trackStatusEntity = await _trackStatusRepository.GetFirstAsync(a => a.Id != input.Id &&
|
var trackStatusEntitys = await _trackStatusRepository.GetListAsync(a => a.Id != input.Id &&
|
||||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||||
a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus));
|
a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus));
|
||||||
if (trackStatusEntity != null)
|
if (trackStatusEntitys.Any())
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
//throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
||||||
|
throw new BusinessException(message: "当前子系统下,轨迹状态代码或轨迹状态或轨迹状态英文存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -122,6 +128,14 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
|||||||
|
|
||||||
private async Task<UnifyResultDto> DeleteAsync(EditTrackStatusInput input)
|
private async Task<UnifyResultDto> DeleteAsync(EditTrackStatusInput input)
|
||||||
{
|
{
|
||||||
|
#region 业务校验
|
||||||
|
var isExistStatus = await _trackContentRepository.GetFirstAsync(a => a.TrackStatusId==input.Id);
|
||||||
|
if (isExistStatus!=null)
|
||||||
|
{
|
||||||
|
//throw new BusinessException(message: _stringLocalizer["IsExistTrackStatus"]);
|
||||||
|
throw new BusinessException(message: "轨迹内容已经绑定了该轨迹状态,请先删除轨迹内容后再删除该轨迹状态");
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
var isTrue = await _trackStatusRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
var isTrue = await _trackStatusRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||||
|
|
||||||
return new UnifyResultDto("200", "删除成功", isTrue);
|
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using SJZY.Expand.ABP.Core.Localization;
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
|
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||||
using SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
using SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
@ -18,14 +21,21 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||||
private readonly ITrackTemplateRepository _trackTemplateRepository;
|
private readonly ITrackTemplateRepository _trackTemplateRepository;
|
||||||
|
private readonly ITrackPullConfigRepository _trackPullConfigRepository;
|
||||||
|
private readonly ITrackPushConfigRepository _trackPushConfigRepository;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public TrackTemplateService(
|
public TrackTemplateService(
|
||||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||||
ITrackTemplateRepository trackTemplateRepository)
|
ITrackTemplateRepository trackTemplateRepository,
|
||||||
|
ITrackPullConfigRepository trackPullConfigRepository,
|
||||||
|
ITrackPushConfigRepository trackPushConfigRepository
|
||||||
|
)
|
||||||
{
|
{
|
||||||
_stringLocalizer = stringLocalizer;
|
_stringLocalizer = stringLocalizer;
|
||||||
_trackTemplateRepository = trackTemplateRepository;
|
_trackTemplateRepository = trackTemplateRepository;
|
||||||
|
_trackPullConfigRepository = trackPullConfigRepository;
|
||||||
|
_trackPushConfigRepository = trackPushConfigRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -91,10 +101,11 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
a => a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
a => a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
||||||
if (templateEntity != null)
|
if (templateEntity != null)
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
//throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
||||||
|
throw new BusinessException(message: "模板代码已存在于当前选择的子系统下");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion 业务校验
|
||||||
|
|
||||||
var entity = ObjectMapper.Map<EditTrackTemplateInput, TrackTemplateEntity>(input);
|
var entity = ObjectMapper.Map<EditTrackTemplateInput, TrackTemplateEntity>(input);
|
||||||
var isTrue = await _trackTemplateRepository.InsertAsync(entity);
|
var isTrue = await _trackTemplateRepository.InsertAsync(entity);
|
||||||
@ -110,10 +121,10 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
||||||
if (isExist != null)
|
if (isExist != null)
|
||||||
{
|
{
|
||||||
throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
throw new BusinessException(message: "模板代码已存在于当前选择的子系统下");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion 业务校验
|
||||||
|
|
||||||
var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id);
|
var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id);
|
||||||
ObjectMapper.Map(input, templateEntity);
|
ObjectMapper.Map(input, templateEntity);
|
||||||
@ -126,9 +137,21 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
#region 业务校验
|
#region 业务校验
|
||||||
|
|
||||||
//到时候,得判断这个模版有没有在轨迹映射里面被使用过,如果被使用就抛出提示
|
//查询看看在轨迹拉取里面有没有被占用
|
||||||
|
var isExisistTrackPullConfigs = await _trackPullConfigRepository.GetListAsync(a => a.TrackTemplateId == input.Id);
|
||||||
|
if (isExisistTrackPullConfigs.Any())
|
||||||
|
{
|
||||||
|
//throw new BusinessException(message: _stringLocalizer["IsExistTrackPullConfig"]);
|
||||||
|
throw new BusinessException(message: "轨迹拉取配置里已经绑定模版,请检查");
|
||||||
|
}
|
||||||
|
//轨迹推送里看看是否被占用
|
||||||
|
var isExisistTrackPushConfigs = await _trackPushConfigRepository.GetListAsync(a => a.TrackTemplateId.Contains(input.Id.ToString()));
|
||||||
|
if (isExisistTrackPushConfigs.Any())
|
||||||
|
{
|
||||||
|
throw new BusinessException(message: "轨迹推送配置里已经绑定模版,请检查");
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion 业务校验
|
||||||
|
|
||||||
var isTrue = await _trackTemplateRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
var isTrue = await _trackTemplateRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||||
|
|
||||||
@ -170,11 +193,11 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
if (input.Options != OptionTypeNoNull.删除)
|
if (input.Options != OptionTypeNoNull.删除)
|
||||||
{
|
{
|
||||||
Expression<Func<TrackTemplateContentEntity, bool>> isAnyExp = x =>
|
Expression<Func<TrackTemplateContentEntity, bool>> isContentAnyExp = x =>
|
||||||
x.TrackTemplateId == input.TrackTemplateId && x.TrackContentId == input.TrackContentId;
|
x.TrackTemplateId == input.TrackTemplateId && x.TrackContentId == input.TrackContentId;
|
||||||
if (input.Options == OptionTypeNoNull.修改) isAnyExp.And(x => x.Id != input.Id);
|
if (input.Options == OptionTypeNoNull.修改) isContentAnyExp = isContentAnyExp.And(x => x.Id != input.Id);
|
||||||
|
|
||||||
if (await _trackTemplateRepository.IsContentAnyAsync(isAnyExp))
|
if (await _trackTemplateRepository.IsContentAnyAsync(isContentAnyExp))
|
||||||
throw new BusinessException(message: _stringLocalizer["IsTrackTemplateContentAny"]);
|
throw new BusinessException(message: _stringLocalizer["IsTrackTemplateContentAny"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,4 +235,26 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹模板内容排序
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("SortContent")]
|
||||||
|
public async Task<bool> SortContentAsync([FromBody] SortTrackTemplateContentInput input)
|
||||||
|
{
|
||||||
|
List<int> ids = input.SortInfo.Select(x => int.Parse(x.Key)).ToList();
|
||||||
|
|
||||||
|
var trackTemplateContentEntities = await _trackTemplateRepository.GetContentListAsync(x => ids.Contains(x.Id));
|
||||||
|
|
||||||
|
trackTemplateContentEntities.ForEach(item =>
|
||||||
|
{
|
||||||
|
item.Sort = input.SortInfo.Single(x => x.Key == item.Id.ToString()).Value;
|
||||||
|
});
|
||||||
|
|
||||||
|
await _trackTemplateRepository.UpdateContentRangeAsync(trackTemplateContentEntities);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
using FluentValidation;
|
||||||
|
using Microsoft.Extensions.Localization;
|
||||||
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
|
using SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||||
|
using SJZY.Track.Application.Localization;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Validations.TrackContents;
|
||||||
|
|
||||||
|
public class EditTrackContentMapInputValidation : AbstractValidator<EditTrackContentMapInput>, IValidationEnabled
|
||||||
|
{
|
||||||
|
public EditTrackContentMapInputValidation(IStringLocalizer<TrackLocalizationResource> stringLocalizer)
|
||||||
|
{
|
||||||
|
RuleFor(x => x.Options).IsInEnum().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum, nameof(EditTrackContentMapInput.Options)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.Id).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackContentMapInput.Id), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.MapSubSystemId).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackContentMapInput.MapSubSystemId), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.MapTrackContentId).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackContentMapInput.MapTrackContentId), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.SubSystemId).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackContentMapInput.SubSystemId), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackContentId).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackContentMapInput.TrackContentId), 0]);
|
||||||
|
|
||||||
|
When(x => x.Options != OptionTypeNoNull.新增, () =>
|
||||||
|
{
|
||||||
|
RuleFor(x => x.Id).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackContentMapInput.Id)]);
|
||||||
|
});
|
||||||
|
|
||||||
|
When(x => x.Options != OptionTypeNoNull.删除, () =>
|
||||||
|
{
|
||||||
|
RuleFor(x => x.MapSubSystemId).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackContentMapInput.MapSubSystemId)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.MapTrackContentCode).NotEmpty().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotEmpty, nameof(EditTrackContentMapInput.MapTrackContentCode)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.MapTrackContentId).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackContentMapInput.MapTrackContentId)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.SubSystemId).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackContentMapInput.SubSystemId)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackContentCode).NotEmpty().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotEmpty, nameof(EditTrackContentMapInput.TrackContentCode)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackContentId).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackContentMapInput.TrackContentId)]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
using FluentValidation;
|
||||||
|
using Microsoft.Extensions.Localization;
|
||||||
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
|
using SJZY.Track.Application.Contract.Dtos.TrackPull;
|
||||||
|
using SJZY.Track.Application.Localization;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Validations.TrackPull;
|
||||||
|
|
||||||
|
public class EditTrackPullConfigInputValidation : AbstractValidator<EditTrackPullConfigInput>, IValidationEnabled
|
||||||
|
{
|
||||||
|
public EditTrackPullConfigInputValidation(IStringLocalizer<TrackLocalizationResource> stringLocalizer)
|
||||||
|
{
|
||||||
|
RuleFor(x => x.Options).IsInEnum().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum, nameof(EditTrackPullConfigInput.Options)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.Id).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackPullConfigInput.Id), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.ParseMethod).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackPullConfigInput.ParseMethod), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.PullInterval).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackPullConfigInput.PullInterval), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.SubSystemId).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackPullConfigInput.SubSystemId), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.ServiceProviderId).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackPullConfigInput.ServiceProviderId), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.SubSystemId).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackPullConfigInput.SubSystemId), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackTemplateId).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackPullConfigInput.TrackTemplateId), 0]);
|
||||||
|
|
||||||
|
When(x => x.Options != OptionTypeNoNull.新增, () =>
|
||||||
|
{
|
||||||
|
RuleFor(x => x.Id).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackPullConfigInput.Id)]);
|
||||||
|
});
|
||||||
|
|
||||||
|
When(x => x.Options != OptionTypeNoNull.删除, () =>
|
||||||
|
{
|
||||||
|
RuleFor(x => x.SubSystemId).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackPullConfigInput.SubSystemId)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.ServiceProviderId).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackPullConfigInput.ServiceProviderId)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackTemplateId).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackPullConfigInput.TrackTemplateId)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.PullInterval).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackPullConfigInput.PullInterval)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.ParseMethod).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackPullConfigInput.ParseMethod)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.OrderNoName).NotEmpty().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotEmpty, nameof(EditTrackPullConfigInput.OrderNoName)]);
|
||||||
|
|
||||||
|
When(x => x.ParseMethod == 1, () =>
|
||||||
|
{
|
||||||
|
RuleFor(x => x.TackTimeZoneName).NotEmpty().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotEmpty, nameof(EditTrackPullConfigInput.TackTimeZoneName)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackContentCodeName).NotEmpty().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotEmpty, nameof(EditTrackPullConfigInput.TrackContentCodeName)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackContentName).NotEmpty().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotEmpty, nameof(EditTrackPullConfigInput.TrackContentName)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackPlaceName).NotEmpty().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotEmpty, nameof(EditTrackPullConfigInput.TrackPlaceName)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackStatusName).NotEmpty().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotEmpty, nameof(EditTrackPullConfigInput.TrackStatusName)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackTimeName).NotEmpty().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotEmpty, nameof(EditTrackPullConfigInput.TrackTimeName)]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
using FluentValidation;
|
||||||
|
using Microsoft.Extensions.Localization;
|
||||||
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
|
using SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
||||||
|
using SJZY.Track.Application.Localization;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Validations.TrackTemplates;
|
||||||
|
|
||||||
|
public class EditTrackTemplateContentInputValidation : AbstractValidator<EditTrackTemplateContentInput>, IValidationEnabled
|
||||||
|
{
|
||||||
|
public EditTrackTemplateContentInputValidation(IStringLocalizer<TrackLocalizationResource> stringLocalizer)
|
||||||
|
{
|
||||||
|
RuleFor(x => x.Options).IsInEnum().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum, nameof(EditTrackTemplateContentInput.Options)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.Id).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackTemplateContentInput.Id), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackContentId).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackTemplateContentInput.TrackContentId), 0]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackTemplateId).GreaterThan(0).WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_GreaterThan, nameof(EditTrackTemplateContentInput.TrackTemplateId), 0]);
|
||||||
|
|
||||||
|
When(x => x.Options != OptionTypeNoNull.新增, () =>
|
||||||
|
{
|
||||||
|
RuleFor(x => x.Id).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackTemplateContentInput.Id)]);
|
||||||
|
});
|
||||||
|
|
||||||
|
When(x => x.Options != OptionTypeNoNull.删除, () =>
|
||||||
|
{
|
||||||
|
RuleFor(x => x.IsCanDelete).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackTemplateContentInput.IsCanDelete)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.IsExternal).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackTemplateContentInput.IsExternal)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackContentId).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackTemplateContentInput.TrackContentId)]);
|
||||||
|
|
||||||
|
RuleFor(x => x.TrackTemplateId).NotNull().WithMessage(stringLocalizer[SjzyBasicLocalization.Validation_NotNull, nameof(EditTrackTemplateContentInput.TrackTemplateId)]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,7 +11,7 @@ public interface IOrderRepository : IBasicRepository<OrderEntity>
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<bool> CreateOrderAsync(OrderEntity order);
|
Task<bool> CreateOrderAsync(OrderEntity order);
|
||||||
|
|
||||||
Task<List<TrackOrderDetailVO>> GetOrderDetails(GetOrderDetailsInputVO input);
|
//Task<List<TrackOrderDetailVO>> GetOrderDetails(GetOrderDetailsInputVO input);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取分页的轨迹订单
|
/// 获取分页的轨迹订单
|
||||||
|
|||||||
@ -1,10 +1,26 @@
|
|||||||
using SJZY.Track.Domain.Dtos.TrackContents;
|
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
using SJZY.Track.Domain.Dtos.TrackStatus;
|
|
||||||
|
|
||||||
namespace SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
|
||||||
public interface ITrackContentRepository : IBasicRepository<TrackContentEntity>
|
public interface ITrackContentRepository : IBasicRepository<TrackContentEntity>
|
||||||
{
|
{
|
||||||
Task<GetTrackContentDetailVO?> GetDetailAsync(int id);
|
Task<GetTrackContentDetailVO?> GetDetailAsync(int id);
|
||||||
|
|
||||||
Task<UnifyPageResultDto<GetTrackContentListVO>> GetPageTrackContent(GetPageTrackContentVO input);
|
Task<UnifyPageResultDto<GetTrackContentListVO>> GetPageTrackContent(GetPageTrackContentVO input);
|
||||||
|
|
||||||
|
Task<UnifyPageResultDto<GetTrackContentMapPageOutputVO>> GetMapPageAsync(GetTrackContentMapPageInputVO input);
|
||||||
|
|
||||||
|
Task<GetTrackContentMapDetailOutputVO> GetMapDetailAsync(int id);
|
||||||
|
|
||||||
|
Task<bool> IsMapAnyAsync(Expression<Func<TrackContentMapEntity, bool>> whereExpression);
|
||||||
|
|
||||||
|
Task<bool> InsertMapAsync(TrackContentMapEntity insertObj);
|
||||||
|
|
||||||
|
Task<TrackContentMapEntity> GetMapByIdAsync(int id);
|
||||||
|
|
||||||
|
Task<bool> UpdateMapAsync(TrackContentMapEntity updateObj);
|
||||||
|
|
||||||
|
Task<bool> SoftDeleteMapAsync(Expression<Func<TrackContentMapEntity, bool>> whereExpression);
|
||||||
|
|
||||||
|
Task<bool> UpdateMapAsync(Expression<Func<TrackContentMapEntity, TrackContentMapEntity>> columns, Expression<Func<TrackContentMapEntity, bool>> whereExpression);
|
||||||
}
|
}
|
||||||
@ -48,4 +48,6 @@ public interface ITrackPullConfigRepository : IBasicRepository<TrackPullConfigEn
|
|||||||
Task<TrackPullContentConfigEntity> GetContentByIdAsync(int id);
|
Task<TrackPullContentConfigEntity> GetContentByIdAsync(int id);
|
||||||
|
|
||||||
Task<bool> UpdateContentAsync(TrackPullContentConfigEntity updateObj);
|
Task<bool> UpdateContentAsync(TrackPullContentConfigEntity updateObj);
|
||||||
|
|
||||||
|
Task<bool> IsContentAnyAsync(Expression<Func<TrackPullContentConfigEntity, bool>> whereExpression);
|
||||||
}
|
}
|
||||||
@ -64,5 +64,5 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
|||||||
/// 轨迹时区GMT
|
/// 轨迹时区GMT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackTimeZone")]
|
[SugarColumn(ColumnName = "TrackTimeZone")]
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -14,4 +14,16 @@ public interface ITrackPushConfigRepository : IBasicRepository<TrackPushConfigEn
|
|||||||
Task<GetTrackPushContentDetailOutputVO> GetContentDetailAsync(int id);
|
Task<GetTrackPushContentDetailOutputVO> GetContentDetailAsync(int id);
|
||||||
|
|
||||||
Task<bool> SoftDeleteContentAsync(Expression<Func<TrackPushContentConfigEntity, bool>> whereExpression);
|
Task<bool> SoftDeleteContentAsync(Expression<Func<TrackPushContentConfigEntity, bool>> whereExpression);
|
||||||
|
|
||||||
|
Task<bool> IsContentAnyAsync(Expression<Func<TrackPushContentConfigEntity, bool>> whereExpression);
|
||||||
|
|
||||||
|
Task<bool> InsertContentAsync(TrackPushContentConfigEntity insertObj);
|
||||||
|
|
||||||
|
Task<TrackPushContentConfigEntity> GetContentByIdAsync(int id);
|
||||||
|
|
||||||
|
Task<bool> UpdateContentAsync(TrackPushContentConfigEntity updateObj);
|
||||||
|
|
||||||
|
Task<List<TrackPushContentConfigEntity>> GetContentListAsync(Expression<Func<TrackPushContentConfigEntity, bool>> whereExpression);
|
||||||
|
|
||||||
|
Task<bool> UpdateContentRangeAsync(List<TrackPushContentConfigEntity> updateObjs);
|
||||||
}
|
}
|
||||||
@ -70,5 +70,5 @@ public class TrackPushContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
|||||||
/// 轨迹时区GMT
|
/// 轨迹时区GMT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackTimeZone")]
|
[SugarColumn(ColumnName = "TrackTimeZone")]
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -35,4 +35,6 @@ public interface ITrackTemplateRepository : IBasicRepository<TrackTemplateEntity
|
|||||||
|
|
||||||
Task<List<TrackTemplateContentEntity>> GetContentListAsync(
|
Task<List<TrackTemplateContentEntity>> GetContentListAsync(
|
||||||
Expression<Func<TrackTemplateContentEntity, bool>> whereExpression);
|
Expression<Func<TrackTemplateContentEntity, bool>> whereExpression);
|
||||||
|
|
||||||
|
Task<bool> UpdateContentRangeAsync(List<TrackTemplateContentEntity> updateObjs);
|
||||||
}
|
}
|
||||||
@ -15,5 +15,5 @@ public class KeywordsInputVO : PageInfoInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 选中项
|
/// 选中项
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int? SelectedId { get; set; }
|
public List<int>? SelectedIds { get; set; }
|
||||||
}
|
}
|
||||||
@ -13,10 +13,16 @@ namespace SJZY.Track.Domain.Dtos.Order
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int SubSystemId { get; set; }
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 单号
|
||||||
|
///// </summary>
|
||||||
|
//public List<string>? OrderNos { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单号
|
/// 单号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string>? OrderNos { get; set; }
|
public string? OrderNos { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建时间开始
|
/// 创建时间开始
|
||||||
@ -44,6 +50,11 @@ namespace SJZY.Track.Domain.Dtos.Order
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int OrderType { get; set; }
|
public int OrderType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单名称
|
||||||
|
/// </summary>
|
||||||
|
public string OrderTypeName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 订单号
|
/// 订单号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -84,6 +95,11 @@ namespace SJZY.Track.Domain.Dtos.Order
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string? NewestTrackPlace { get; set; }
|
public string? NewestTrackPlace { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最新轨迹时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? NewestTrackTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否完结
|
/// 是否完结
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -17,6 +17,16 @@ namespace SJZY.Track.Domain.Dtos.TrackContents
|
|||||||
/// 关键字
|
/// 关键字
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Keywords { get; set; }
|
public string? Keywords { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹状态id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackStatusId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 选中的轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public List<int>? SelectIds { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetTrackContentListVO
|
public class GetTrackContentListVO
|
||||||
|
|||||||
@ -0,0 +1,56 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
|
|
||||||
|
public class GetTrackContentMapDetailOutputVO
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射子系统
|
||||||
|
/// </summary>
|
||||||
|
public string MapSubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int MapSubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string MapTrackContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int MapTrackContentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 源轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string TrackContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 源轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackContentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 源轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string TrackContentCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string MapTrackContentCode { get; set; }
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
using SJZY.Track.Domain.Dtos.Common;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
|
|
||||||
|
public class GetTrackContentMapPageInputVO : KeywordsInputVO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 映射子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int? MapSubSystemId { get; set; }
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
|
|
||||||
|
public class GetTrackContentMapPageOutputVO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容英文
|
||||||
|
/// </summary>
|
||||||
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string MapCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射内容
|
||||||
|
/// </summary>
|
||||||
|
public string MapContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射内容英文
|
||||||
|
/// </summary>
|
||||||
|
public string MapEnContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射子系统
|
||||||
|
/// </summary>
|
||||||
|
public string MapSubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射轨迹状态
|
||||||
|
/// </summary>
|
||||||
|
public string MapTrackStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹状态
|
||||||
|
/// </summary>
|
||||||
|
public string TrackStatus { get; set; }
|
||||||
|
}
|
||||||
@ -29,15 +29,25 @@ public class GetTrackPullContentDetailOutputVO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackKeyword { get; set; }
|
public string TrackKeyword { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取轨迹关键字(正向)
|
||||||
|
/// </summary>
|
||||||
|
public List<string>? TrackKeywords { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹关键字(反向)
|
/// 拉取轨迹关键字(反向)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackKeywordReverse { get; set; }
|
public string TrackKeywordReverse { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 拉取轨迹关键字(反向)
|
||||||
|
/// </summary>
|
||||||
|
public List<string>? TrackKeywordReverses { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹发生地
|
/// 拉取轨迹发生地
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TrackPlaceValue { get; set; }
|
public int? TrackPlaceValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹拉取配置id
|
/// 轨迹拉取配置id
|
||||||
@ -52,5 +62,5 @@ public class GetTrackPullContentDetailOutputVO
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹时区
|
/// 拉取轨迹时区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -22,40 +22,30 @@ public class GetTrackPullContentPageOutputVO
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹内容代码
|
/// 拉取轨迹内容代码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackContentCodeValue { get; set; }
|
public string? TrackContentCodeValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹内容
|
/// 拉取轨迹内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool? TrackContentValue { get; set; }
|
public string? TrackContentValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹关键字(正向)
|
/// 拉取轨迹关键字(正向)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackKeyword { get; set; }
|
public string? TrackKeyword { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 拉取轨迹关键字(正向)
|
|
||||||
/// </summary>
|
|
||||||
public List<string> TrackKeywords { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹关键字(反向)
|
/// 拉取轨迹关键字(反向)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackKeywordReverse { get; set; }
|
public string? TrackKeywordReverse { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 拉取轨迹关键字(反向)
|
|
||||||
/// </summary>
|
|
||||||
public List<string> TrackKeywordsReverse { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹发生地
|
/// 轨迹发生地
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackPlaceValue { get; set; }
|
public string? TrackPlaceValue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 拉取轨迹状态
|
/// 拉取轨迹状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackStatusValue { get; set; }
|
public string? TrackStatusValue { get; set; }
|
||||||
}
|
}
|
||||||
@ -91,6 +91,11 @@ public class GetTrackPushConfigDetailOutputVO
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTemplateId { get; set; }
|
public string TrackTemplateId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹模板ids
|
||||||
|
/// </summary>
|
||||||
|
public List<int> TrackTemplateIds { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹发生时间
|
/// 推送轨迹发生时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -23,4 +23,14 @@ public class GetTrackPushConfigPageOutputVO
|
|||||||
/// 模板名称
|
/// 模板名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTemplate { get; set; }
|
public string TrackTemplate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹模板id
|
||||||
|
/// </summary>
|
||||||
|
public string TrackTemplateId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹模板ids
|
||||||
|
/// </summary>
|
||||||
|
public List<int> TrackTemplateIds { get; set; }
|
||||||
}
|
}
|
||||||
@ -57,5 +57,5 @@ public class GetTrackPushContentDetailOutputVO
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 推送轨迹时区
|
/// 推送轨迹时区
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TrackTimeZone { get; set; }
|
public double? TrackTimeZone { get; set; }
|
||||||
}
|
}
|
||||||
@ -38,4 +38,9 @@ public class GetTrackTemplateContentDetailOutputVO
|
|||||||
/// 轨迹状态id
|
/// 轨迹状态id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TrackStatusId { get; set; }
|
public int TrackStatusId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹模板id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackTemplateId { get; set; }
|
||||||
}
|
}
|
||||||
@ -5,5 +5,10 @@ public class GetTrackTemplateContentPageInputVO : PageInfoInput
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹模板id
|
/// 轨迹模板id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int TrackTemplateId { get; set; }
|
public List<int> TrackTemplateIds { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 选中项
|
||||||
|
/// </summary>
|
||||||
|
public List<int>? SelectedIds { get; set; }
|
||||||
}
|
}
|
||||||
@ -68,4 +68,9 @@ public class GetTrackTemplateContentPageOutputVO
|
|||||||
/// 修改人
|
/// 修改人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string UpdateUser { get; set; }
|
public string UpdateUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackContentId { get; set; }
|
||||||
}
|
}
|
||||||
@ -17,9 +17,13 @@ public class GlobalConst
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const string UpdateOrderTrackSubscribe = "SJZY.Track.UpdateOrderTrack";
|
public const string UpdateOrderTrackSubscribe = "SJZY.Track.UpdateOrderTrack";
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹要推送的客户redis key前缀
|
/// 轨迹要推送的客户redis key前缀
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string TrackPushKeyPrefix = "TrackPush:";
|
public const string TrackPushKeyPrefix = "TrackPush:";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 自动推送名单RedisKey
|
||||||
|
/// </summary>
|
||||||
|
public const string AutoPushRosterRedisKey = "AutoPushRoster";
|
||||||
}
|
}
|
||||||
@ -85,15 +85,15 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
|
|
||||||
#region 轨迹订单明细
|
#region 轨迹订单明细
|
||||||
|
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 根据轨迹订单id获取轨迹明细列表
|
///// 根据轨迹订单id获取轨迹明细列表
|
||||||
/// </summary>
|
///// </summary>
|
||||||
/// <param name="input"></param>
|
///// <param name="input"></param>
|
||||||
/// <returns></returns>
|
///// <returns></returns>
|
||||||
public async Task<List<TrackOrderDetailVO>> GetOrderDetails(GetOrderDetailsInputVO input)
|
//public async Task<List<TrackOrderDetailVO>> GetOrderDetails(GetOrderDetailsInputVO input)
|
||||||
{
|
//{
|
||||||
return null;
|
// return null;
|
||||||
}
|
//}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -106,22 +106,31 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<UnifyPageResultDto<TrackOrderVO>> GetPageTrackOrder(GetPageTrackOrderInputVO input)
|
public async Task<UnifyPageResultDto<TrackOrderVO>> GetPageTrackOrder(GetPageTrackOrderInputVO input)
|
||||||
{
|
{
|
||||||
|
List<string> orderNoList = new List<string>();
|
||||||
|
if (!input.OrderNos.IsNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
orderNoList = input.OrderNos.Split(new char[] { ',', ',', ':', ':' }).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
var pageList = await Context.Queryable<OrderEntity>()
|
var pageList = await Context.Queryable<OrderEntity>()
|
||||||
.LeftJoin<VExternalSubjectEntity>((a, b) => a.CustomId == b.Id)
|
.LeftJoin<VExternalSubjectEntity>((a, b) => a.CustomId == b.Id && b.IsDeleted == false)
|
||||||
.LeftJoin<VSystemEntity>((a, b, c) => a.SubSystemId == c.Id)
|
.LeftJoin<VSystemEntity>((a, b, c) => a.SubSystemId == c.Id && c.IsDeleted == false)
|
||||||
.WhereIF(input.SubSystemId > 0, (a, b, c) => a.SubSystemId == input.SubSystemId)
|
.WhereIF(input.SubSystemId > 0, (a, b, c) => a.SubSystemId == input.SubSystemId)
|
||||||
.WhereIF(!input.OrderNos.IsNullOrEmpty(), (a, b, c) => input.OrderNos.Contains(a.OrderNo))
|
.WhereIF(!orderNoList.IsNullOrEmpty(), (a, b, c) => orderNoList.Contains(a.OrderNo))
|
||||||
.WhereIF(input.CreateTimeStart.HasValue && input.CreateTimeEnd.HasValue,
|
.WhereIF(input.CreateTimeStart.HasValue && input.CreateTimeEnd.HasValue,
|
||||||
(a, b, c) => a.CreateTime >= input.CreateTimeStart && a.CreateTime <= input.CreateTimeEnd)
|
(a, b, c) => a.CreateTime >= input.CreateTimeStart && a.CreateTime <= input.CreateTimeEnd)
|
||||||
.WhereIF(input.CreateTimeStart.HasValue && (!input.CreateTimeEnd.HasValue),
|
.WhereIF(input.CreateTimeStart.HasValue && (!input.CreateTimeEnd.HasValue),
|
||||||
(a, b, c) => a.CreateTime >= input.CreateTimeStart)
|
(a, b, c) => a.CreateTime >= input.CreateTimeStart)
|
||||||
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
|
.WhereIF((!input.CreateTimeStart.HasValue) && input.CreateTimeEnd.HasValue,
|
||||||
(a, b, c) => a.CreateTime <= input.CreateTimeEnd)
|
(a, b, c) => a.CreateTime <= input.CreateTimeEnd)
|
||||||
|
.OrderByDescending((a, b, c) => a.CreateTime)
|
||||||
.Select((a, b, c) => new TrackOrderVO
|
.Select((a, b, c) => new TrackOrderVO
|
||||||
{
|
{
|
||||||
Id = a.Id,
|
Id = a.Id,
|
||||||
OrderNumber = a.OrderNo,
|
OrderNumber = a.OrderNo,
|
||||||
OrderType = a.OrderType,
|
OrderType = a.OrderType,
|
||||||
|
OrderTypeName = SqlFunc.IF(a.OrderType == 1).Return("干线提单").ElseIF(a.OrderType == 2).Return("小包运单").ElseIF(a.OrderType == 3)
|
||||||
|
.Return("箱/袋单").ElseIF(a.OrderType == 4).Return("FBA订单").End(""),
|
||||||
CustomerShortName = b.Abbreviation,
|
CustomerShortName = b.Abbreviation,
|
||||||
CustomerCode = b.Code,
|
CustomerCode = b.Code,
|
||||||
TrackTemplateNames = SqlFunc.Subqueryable<OrderTemplateEntity>()
|
TrackTemplateNames = SqlFunc.Subqueryable<OrderTemplateEntity>()
|
||||||
@ -130,6 +139,7 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
|||||||
NewestTrackContent = a.LatestTrackContent,
|
NewestTrackContent = a.LatestTrackContent,
|
||||||
NewestTrackEnContent = a.LatestTrackEnContent,
|
NewestTrackEnContent = a.LatestTrackEnContent,
|
||||||
NewestTrackPlace = a.LatestTrackPlace,
|
NewestTrackPlace = a.LatestTrackPlace,
|
||||||
|
NewestTrackTime = a.LatestTrackTime,
|
||||||
IsFinish = a.IsCompleted,
|
IsFinish = a.IsCompleted,
|
||||||
CreateTime = a.CreateTime,
|
CreateTime = a.CreateTime,
|
||||||
SubSystem = c.CnName
|
SubSystem = c.CnName
|
||||||
|
|||||||
@ -3,15 +3,15 @@ using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
|||||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.TrackContents;
|
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
using SJZY.Track.Domain.VEntities;
|
using SJZY.Track.Domain.VEntities;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository.Repositories;
|
namespace SJZY.Track.Repository.Repositories;
|
||||||
|
|
||||||
public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrackContentRepository, IScopedDependency
|
public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrackContentRepository, IScopedDependency
|
||||||
{
|
{
|
||||||
|
|
||||||
public TrackContentRepository()
|
public TrackContentRepository()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -22,9 +22,9 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
public async Task<GetTrackContentDetailVO?> GetDetailAsync(int id)
|
public async Task<GetTrackContentDetailVO?> GetDetailAsync(int id)
|
||||||
{
|
{
|
||||||
var detail = await Context.Queryable<TrackContentEntity>()
|
var detail = await Context.Queryable<TrackContentEntity>()
|
||||||
.LeftJoin<TrackStatusEntity>((a, b) => a.TrackStatusId==b.Id)
|
.LeftJoin<TrackStatusEntity>((a, b) => a.TrackStatusId == b.Id && b.IsDeleted == false)
|
||||||
.LeftJoin<TrackFlagEntity>((a, b, c) => a.TrackFlagId==c.Id)
|
.LeftJoin<TrackFlagEntity>((a, b, c) => a.TrackFlagId == c.Id && c.IsDeleted == false)
|
||||||
.LeftJoin<VSystemEntity>((a, b, c, d) => a.SubSystemId == d.Id)
|
.LeftJoin<VSystemEntity>((a, b, c, d) => a.SubSystemId == d.Id && d.IsDeleted == false)
|
||||||
.Where((a, b, c, d) => a.Id == id)
|
.Where((a, b, c, d) => a.Id == id)
|
||||||
.Select((a, b, c, d) => new GetTrackContentDetailVO
|
.Select((a, b, c, d) => new GetTrackContentDetailVO
|
||||||
{
|
{
|
||||||
@ -52,17 +52,18 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
{
|
{
|
||||||
UnifyPageResultDto<GetTrackContentListVO> pagedList = new UnifyPageResultDto<GetTrackContentListVO>();
|
UnifyPageResultDto<GetTrackContentListVO> pagedList = new UnifyPageResultDto<GetTrackContentListVO>();
|
||||||
pagedList = await Context.Queryable<TrackContentEntity>()
|
pagedList = await Context.Queryable<TrackContentEntity>()
|
||||||
.LeftJoin<TrackStatusEntity>((a, b) => a.TrackStatusId==b.Id)
|
.LeftJoin<TrackStatusEntity>((a, b) => a.TrackStatusId == b.Id && b.IsDeleted == false)
|
||||||
.LeftJoin<TrackFlagEntity>((a, b, c) => a.TrackFlagId==c.Id)
|
.LeftJoin<TrackFlagEntity>((a, b, c) => a.TrackFlagId == c.Id && c.IsDeleted == false)
|
||||||
.LeftJoin<VSystemEntity>((a, b, c, d) => a.SubSystemId == d.Id)
|
.LeftJoin<VSystemEntity>((a, b, c, d) => a.SubSystemId == d.Id && d.IsDeleted == false)
|
||||||
.LeftJoin<VUserEntity>((a, b, c, d, e) => a.CreateUserId == e.Id)
|
.LeftJoin<VUserEntity>((a, b, c, d, e) => a.CreateUserId == e.Id && e.IsDeleted == false)
|
||||||
.LeftJoin<VUserEntity>((a, b, c, d, e, f) => a.UpdateUserId == f.Id)
|
.LeftJoin<VUserEntity>((a, b, c, d, e, f) => a.UpdateUserId == f.Id && f.IsDeleted == false)
|
||||||
.WhereIF(input.SubSystemId > 0, (a, b, c, d, e, f) => a.SubSystemId == input.SubSystemId)
|
.WhereIF(input.SubSystemId > 0, (a, b, c, d, e, f) => a.SubSystemId == input.SubSystemId)
|
||||||
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(),
|
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(),
|
||||||
(a, b, c, d, e, f) => a.Code.Contains(input.Keywords) || a.Content.Contains(input.Keywords)
|
(a, b, c, d, e, f) => a.Code.Contains(input.Keywords) || a.Content.Contains(input.Keywords)
|
||||||
|| a.EnContent.Contains(input.Keywords)
|
|| a.EnContent.Contains(input.Keywords))
|
||||||
)
|
.WhereIF(input.TrackStatusId>0, (a, b, c, d, e, f) => a.TrackStatusId==input.TrackStatusId)
|
||||||
.OrderByDescending((a, b, c, d, e, f) => a.CreateTime)
|
.OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d, e, f) => a.CreateTime, OrderByType.Desc)
|
||||||
|
.OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d, e, f) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
|
||||||
.Select((a, b, c, d, e, f) => new GetTrackContentListVO
|
.Select((a, b, c, d, e, f) => new GetTrackContentListVO
|
||||||
{
|
{
|
||||||
Id = a.Id,
|
Id = a.Id,
|
||||||
@ -71,8 +72,8 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
Content = a.Content,
|
Content = a.Content,
|
||||||
EnContent = a.EnContent,
|
EnContent = a.EnContent,
|
||||||
TrackStatus = b.Status,
|
TrackStatus = b.Status,
|
||||||
Node = SqlFunc.IF(b.Node == 1).Return("揽收").ElseIF(b.Node == 2).Return("干线").ElseIF(b.Node == 3).Return("清关")
|
Node = SqlFunc.IF(b.Node == 1).Return("揽收").ElseIF(b.Node == 2).Return("清关").ElseIF(b.Node == 3).Return("干线")
|
||||||
.ElseIF(b.Node == 4).Return("中转").ElseIF(b.Node == 5).Return("派送")
|
.ElseIF(b.Node == 4).Return("派送").ElseIF(b.Node == 5).Return("其他")
|
||||||
.End(""),
|
.End(""),
|
||||||
TrackFlag = c.Name,
|
TrackFlag = c.Name,
|
||||||
CreateTime = a.CreateTime,
|
CreateTime = a.CreateTime,
|
||||||
@ -84,4 +85,91 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
|
|
||||||
return pagedList;
|
return pagedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<UnifyPageResultDto<GetTrackContentMapPageOutputVO>> GetMapPageAsync(GetTrackContentMapPageInputVO input)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackContentMapEntity>()
|
||||||
|
.InnerJoin<TrackContentEntity>((contentMap, sourceContent) => contentMap.TrackContentId == sourceContent.Id && !sourceContent.IsDeleted)
|
||||||
|
.InnerJoin<TrackContentEntity>((contentMap, sourceContent, targetContent) => contentMap.MapTrackContentId == targetContent.Id && !targetContent.IsDeleted)
|
||||||
|
.LeftJoin<VSystemEntity>((contentMap, sourceContent, targetContent, sourceSystem) => contentMap.SubSystemId == sourceSystem.Id && !sourceSystem.IsDeleted)
|
||||||
|
.LeftJoin<VSystemEntity>((contentMap, sourceContent, targetContent, sourceSystem, targetSystem) => contentMap.MapSubSystemId == targetSystem.Id && !targetSystem.IsDeleted)
|
||||||
|
.LeftJoin<TrackStatusEntity>((contentMap, sourceContent, targetContent, sourceSystem, targetSystem, sourceStatus) => sourceContent.TrackStatusId == sourceStatus.Id && !sourceStatus.IsDeleted)
|
||||||
|
.LeftJoin<TrackStatusEntity>((contentMap, sourceContent, targetContent, sourceSystem, targetSystem, sourceStatus, targetStatus) => targetContent.TrackStatusId == targetStatus.Id && !targetStatus.IsDeleted)
|
||||||
|
.Filter(null, true)
|
||||||
|
.Where(contentMap => !contentMap.IsDeleted)
|
||||||
|
.WhereIF(input.SubSystemId.HasValue, contentMap => contentMap.SubSystemId == input.SubSystemId)
|
||||||
|
.WhereIF(input.MapSubSystemId.HasValue, contentMap => contentMap.MapSubSystemId == input.MapSubSystemId)
|
||||||
|
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (contentMap, sourceContent) => sourceContent.Code.Contains(input.Keywords) || sourceContent.Content.Contains(input.Keywords) || sourceContent.EnContent.Contains(input.Keywords))
|
||||||
|
.OrderByDescending(contentMap => contentMap.CreateTime)
|
||||||
|
.Select((contentMap, sourceContent, targetContent, sourceSystem, targetSystem, sourceStatus, targetStatus) => new GetTrackContentMapPageOutputVO
|
||||||
|
{
|
||||||
|
Id = contentMap.Id,
|
||||||
|
SubSystem = sourceSystem.CnName,
|
||||||
|
Code = contentMap.TrackContentCode,
|
||||||
|
TrackStatus = sourceStatus.Status,
|
||||||
|
Content = sourceContent.Content,
|
||||||
|
EnContent = sourceContent.EnContent,
|
||||||
|
MapSubSystem = targetSystem.CnName,
|
||||||
|
MapCode = contentMap.MapTrackContentCode,
|
||||||
|
MapTrackStatus = targetStatus.Status,
|
||||||
|
MapContent = targetContent.Content,
|
||||||
|
MapEnContent = targetContent.EnContent
|
||||||
|
})
|
||||||
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<GetTrackContentMapDetailOutputVO> GetMapDetailAsync(int id)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackContentMapEntity>()
|
||||||
|
.InnerJoin<TrackContentEntity>((contentMap, sourceContent) => contentMap.TrackContentId == sourceContent.Id && !sourceContent.IsDeleted)
|
||||||
|
.InnerJoin<TrackContentEntity>((contentMap, sourceContent, targetContent) => contentMap.MapTrackContentId == targetContent.Id && !targetContent.IsDeleted)
|
||||||
|
.LeftJoin<VSystemEntity>((contentMap, sourceContent, targetContent, sourceSystem) => contentMap.SubSystemId == sourceSystem.Id && !sourceSystem.IsDeleted)
|
||||||
|
.LeftJoin<VSystemEntity>((contentMap, sourceContent, targetContent, sourceSystem, targetSystem) => contentMap.MapSubSystemId == targetSystem.Id && !targetSystem.IsDeleted)
|
||||||
|
.Filter(null, true)
|
||||||
|
.Where(contentMap => !contentMap.IsDeleted)
|
||||||
|
.Select((contentMap, sourceContent, targetContent, sourceSystem, targetSystem) => new GetTrackContentMapDetailOutputVO
|
||||||
|
{
|
||||||
|
Id = contentMap.Id,
|
||||||
|
SubSystemId = contentMap.SubSystemId,
|
||||||
|
SubSystem = sourceSystem.CnName,
|
||||||
|
TrackContent = contentMap.TrackContentCode + "-" + sourceContent.Content,
|
||||||
|
MapSubSystem = targetSystem.CnName,
|
||||||
|
MapTrackContent = contentMap.MapTrackContentCode + "-" + targetContent.Content
|
||||||
|
}, true)
|
||||||
|
.SingleAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> IsMapAnyAsync(Expression<Func<TrackContentMapEntity, bool>> whereExpression)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackContentMapEntity>().Where(whereExpression).AnyAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> InsertMapAsync(TrackContentMapEntity insertObj)
|
||||||
|
{
|
||||||
|
return await Context.Insertable(insertObj).ExecuteCommandAsync() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<TrackContentMapEntity> GetMapByIdAsync(int id)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackContentMapEntity>().InSingleAsync(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> UpdateMapAsync(TrackContentMapEntity updateObj)
|
||||||
|
{
|
||||||
|
return await Context.Updateable(updateObj).ExecuteCommandHasChangeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> SoftDeleteMapAsync(Expression<Func<TrackContentMapEntity, bool>> whereExpression)
|
||||||
|
{
|
||||||
|
return await Context.Updateable<TrackContentMapEntity>()
|
||||||
|
.Where(whereExpression)
|
||||||
|
.SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true)
|
||||||
|
.ExecuteCommandHasChangeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> UpdateMapAsync(Expression<Func<TrackContentMapEntity, TrackContentMapEntity>> columns, Expression<Func<TrackContentMapEntity, bool>> whereExpression)
|
||||||
|
{
|
||||||
|
return await Context.Updateable<TrackContentMapEntity>().SetColumns(columns).Where(whereExpression)
|
||||||
|
.ExecuteCommandAsync() > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -18,7 +18,7 @@ public class TrackFlagRepository : BasicRepository<TrackFlagEntity>, ITrackFlagR
|
|||||||
public async Task<GetTrackFlagDetailVO?> GetDetailAsync(int id)
|
public async Task<GetTrackFlagDetailVO?> GetDetailAsync(int id)
|
||||||
{
|
{
|
||||||
var detail = await Context.Queryable<TrackFlagEntity>()
|
var detail = await Context.Queryable<TrackFlagEntity>()
|
||||||
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false)
|
||||||
.Where((a, b) => a.Id == id)
|
.Where((a, b) => a.Id == id)
|
||||||
.Select((a, b) => new GetTrackFlagDetailVO
|
.Select((a, b) => new GetTrackFlagDetailVO
|
||||||
{
|
{
|
||||||
@ -42,9 +42,9 @@ public class TrackFlagRepository : BasicRepository<TrackFlagEntity>, ITrackFlagR
|
|||||||
{
|
{
|
||||||
UnifyPageResultDto<GetTrackFlagListVO> pagedList = new UnifyPageResultDto<GetTrackFlagListVO>();
|
UnifyPageResultDto<GetTrackFlagListVO> pagedList = new UnifyPageResultDto<GetTrackFlagListVO>();
|
||||||
pagedList = await Context.Queryable<TrackFlagEntity>()
|
pagedList = await Context.Queryable<TrackFlagEntity>()
|
||||||
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false)
|
||||||
.LeftJoin<VUserEntity>((a, b, c) => a.CreateUserId == c.Id)
|
.LeftJoin<VUserEntity>((a, b, c) => a.CreateUserId == c.Id && c.IsDeleted == false)
|
||||||
.LeftJoin<VUserEntity>((a, b, c, d) => a.UpdateUserId == d.Id)
|
.LeftJoin<VUserEntity>((a, b, c, d) => a.UpdateUserId == d.Id && d.IsDeleted == false)
|
||||||
.WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId)
|
.WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId)
|
||||||
.OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => a.CreateTime, OrderByType.Desc)
|
.OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => a.CreateTime, OrderByType.Desc)
|
||||||
.OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
|
.OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, c, d) => SqlFunc.IIF(input.SelectIds.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
|
||||||
|
|||||||
@ -45,11 +45,6 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
|||||||
{
|
{
|
||||||
Id = pullContent.Id
|
Id = pullContent.Id
|
||||||
}, true)
|
}, true)
|
||||||
.Mapper(x =>
|
|
||||||
{
|
|
||||||
x.TrackKeywords = x.TrackKeyword.Split(',').ToList();
|
|
||||||
x.TrackKeywordsReverse = x.TrackKeywordReverse.Split(',').ToList();
|
|
||||||
})
|
|
||||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,6 +77,11 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
|||||||
Id = pullContent.Id,
|
Id = pullContent.Id,
|
||||||
Code = trackContent.Code + "-" + trackContent.Content,
|
Code = trackContent.Code + "-" + trackContent.Content,
|
||||||
}, true)
|
}, true)
|
||||||
|
.Mapper(x =>
|
||||||
|
{
|
||||||
|
x.TrackKeywords = x.TrackKeyword?.Split(',').ToList();
|
||||||
|
x.TrackKeywordReverses = x.TrackKeywordReverse?.Split(',').ToList();
|
||||||
|
})
|
||||||
.SingleAsync();
|
.SingleAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,4 +130,9 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
|||||||
{
|
{
|
||||||
return await Context.Updateable(updateObj).ExecuteCommandHasChangeAsync();
|
return await Context.Updateable(updateObj).ExecuteCommandHasChangeAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<bool> IsContentAnyAsync(Expression<Func<TrackPullContentConfigEntity, bool>> whereExpression)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackPullContentConfigEntity>().Where(whereExpression).AnyAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -32,9 +32,11 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
|
|||||||
TrackTemplate = SqlFunc.Subqueryable<TrackTemplateEntity>()
|
TrackTemplate = SqlFunc.Subqueryable<TrackTemplateEntity>()
|
||||||
.Where(template => SqlFunc.SplitIn(trackPush.TrackTemplateId, template.Id.ToString()) && !template.IsDeleted)
|
.Where(template => SqlFunc.SplitIn(trackPush.TrackTemplateId, template.Id.ToString()) && !template.IsDeleted)
|
||||||
.SelectStringJoin(template => template.Name, ","),
|
.SelectStringJoin(template => template.Name, ","),
|
||||||
|
TrackTemplateId = trackPush.TrackTemplateId,
|
||||||
CreateTime = trackPush.CreateTime
|
CreateTime = trackPush.CreateTime
|
||||||
})
|
})
|
||||||
.Distinct()
|
.Distinct()
|
||||||
|
.Mapper(x => { x.TrackTemplateIds = x.TrackTemplateId.Split(',').Select(int.Parse).ToList(); })
|
||||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,6 +70,7 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
|
|||||||
CustomName = externalSubject.Abbreviation,
|
CustomName = externalSubject.Abbreviation,
|
||||||
ServiceProvider = service.Name,
|
ServiceProvider = service.Name,
|
||||||
}, true)
|
}, true)
|
||||||
|
.Mapper(x => { x.TrackTemplateIds = x.TrackTemplateId.Split(',').Select(int.Parse).ToList(); })
|
||||||
.SingleAsync();
|
.SingleAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,4 +94,34 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
|
|||||||
.SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true)
|
.SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true)
|
||||||
.ExecuteCommandHasChangeAsync();
|
.ExecuteCommandHasChangeAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<bool> IsContentAnyAsync(Expression<Func<TrackPushContentConfigEntity, bool>> whereExpression)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackPushContentConfigEntity>().Where(whereExpression).AnyAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> InsertContentAsync(TrackPushContentConfigEntity insertObj)
|
||||||
|
{
|
||||||
|
return await Context.Insertable(insertObj).ExecuteCommandAsync() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<TrackPushContentConfigEntity> GetContentByIdAsync(int id)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackPushContentConfigEntity>().InSingleAsync(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> UpdateContentAsync(TrackPushContentConfigEntity updateObj)
|
||||||
|
{
|
||||||
|
return await Context.Updateable(updateObj).ExecuteCommandHasChangeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<TrackPushContentConfigEntity>> GetContentListAsync(Expression<Func<TrackPushContentConfigEntity, bool>> whereExpression)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackPushContentConfigEntity>().Where(whereExpression).ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> UpdateContentRangeAsync(List<TrackPushContentConfigEntity> updateObjs)
|
||||||
|
{
|
||||||
|
return await Context.Updateable(updateObjs).ExecuteCommandHasChangeAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -14,7 +14,7 @@ public class TrackStatusRepository : BasicRepository<TrackStatusEntity>, ITrackS
|
|||||||
public async Task<GetTrackStatusDetailVO?> GetDetailAsync(int id)
|
public async Task<GetTrackStatusDetailVO?> GetDetailAsync(int id)
|
||||||
{
|
{
|
||||||
var detail = await Context.Queryable<TrackStatusEntity>()
|
var detail = await Context.Queryable<TrackStatusEntity>()
|
||||||
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id&&b.IsDeleted==false)
|
||||||
.Where((a, b) => a.Id == id)
|
.Where((a, b) => a.Id == id)
|
||||||
.Select((a, b) => new GetTrackStatusDetailVO
|
.Select((a, b) => new GetTrackStatusDetailVO
|
||||||
{
|
{
|
||||||
@ -38,9 +38,9 @@ public class TrackStatusRepository : BasicRepository<TrackStatusEntity>, ITrackS
|
|||||||
public async Task<UnifyPageResultDto<GetTrackStatusListVO>> GetPageTrackStatus(GetPageTrackStatusVO input)
|
public async Task<UnifyPageResultDto<GetTrackStatusListVO>> GetPageTrackStatus(GetPageTrackStatusVO input)
|
||||||
{
|
{
|
||||||
UnifyPageResultDto<GetTrackStatusListVO> pagedList = await Context.Queryable<TrackStatusEntity>()
|
UnifyPageResultDto<GetTrackStatusListVO> pagedList = await Context.Queryable<TrackStatusEntity>()
|
||||||
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false)
|
||||||
.LeftJoin<VUserEntity>((a, b, c) => a.CreateUserId == c.Id)
|
.LeftJoin<VUserEntity>((a, b, c) => a.CreateUserId == c.Id && c.IsDeleted == false)
|
||||||
.LeftJoin<VUserEntity>((a, b, c, d) => a.UpdateUserId == d.Id)
|
.LeftJoin<VUserEntity>((a, b, c, d) => a.UpdateUserId == d.Id && d.IsDeleted == false)
|
||||||
.WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId)
|
.WhereIF(input.SubSystemId > 0, (a, b, c, d) => a.SubSystemId == input.SubSystemId)
|
||||||
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(),
|
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(),
|
||||||
(a, b, c, d) => a.Status.Contains(input.Keywords) || a.EnStatus.Contains(input.Keywords) ||
|
(a, b, c, d) => a.Status.Contains(input.Keywords) || a.EnStatus.Contains(input.Keywords) ||
|
||||||
|
|||||||
@ -20,7 +20,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
public async Task<GetTrackTemplateDetailVO?> GetDetailAsync(int id)
|
public async Task<GetTrackTemplateDetailVO?> GetDetailAsync(int id)
|
||||||
{
|
{
|
||||||
var detail = await Context.Queryable<TrackTemplateEntity>()
|
var detail = await Context.Queryable<TrackTemplateEntity>()
|
||||||
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false)
|
||||||
.Where((a, b) => a.Id == id)
|
.Where((a, b) => a.Id == id)
|
||||||
.Select((a, b) => new
|
.Select((a, b) => new
|
||||||
GetTrackTemplateDetailVO
|
GetTrackTemplateDetailVO
|
||||||
@ -43,7 +43,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
public async Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input)
|
public async Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input)
|
||||||
{
|
{
|
||||||
UnifyPageResultDto<GetTrackTemplateListVO> pagedList = await Context.Queryable<TrackTemplateEntity>()
|
UnifyPageResultDto<GetTrackTemplateListVO> pagedList = await Context.Queryable<TrackTemplateEntity>()
|
||||||
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id && b.IsDeleted == false)
|
||||||
.WhereIF(input.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId)
|
.WhereIF(input.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId)
|
||||||
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(),
|
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(),
|
||||||
(a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords))
|
(a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords))
|
||||||
@ -84,9 +84,9 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
(templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) =>
|
(templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) =>
|
||||||
templateContent.UpdateUserId == updateUser.Id && !updateUser.IsDeleted)
|
templateContent.UpdateUserId == updateUser.Id && !updateUser.IsDeleted)
|
||||||
.Filter(null, true)
|
.Filter(null, true)
|
||||||
.Where(templateContent =>
|
.Where(templateContent => input.TrackTemplateIds.Contains(templateContent.TrackTemplateId) && !templateContent.IsDeleted)
|
||||||
templateContent.TrackTemplateId == input.TrackTemplateId && !templateContent.IsDeleted)
|
.OrderByIF(input.SelectedIds.IsNullOrEmpty(), templateContent => templateContent.CreateTime, OrderByType.Desc)
|
||||||
.OrderByDescending(templateContent => templateContent.CreateTime)
|
.OrderByIF(!input.SelectedIds.IsNullOrEmpty(), templateContent => SqlFunc.IIF(input.SelectedIds.Contains(templateContent.TrackContentId), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), templateContent.CreateTime), OrderByType.Desc)
|
||||||
.Select((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) =>
|
.Select((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) =>
|
||||||
new GetTrackTemplateContentPageOutputVO
|
new GetTrackTemplateContentPageOutputVO
|
||||||
{
|
{
|
||||||
@ -99,6 +99,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
UpdateTime = templateContent.UpdateTime,
|
UpdateTime = templateContent.UpdateTime,
|
||||||
UpdateUser = updateUser.Name
|
UpdateUser = updateUser.Name
|
||||||
}, true)
|
}, true)
|
||||||
|
.Distinct()
|
||||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,4 +160,9 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
{
|
{
|
||||||
return await Context.Queryable<TrackTemplateContentEntity>().Where(whereExpression).ToListAsync();
|
return await Context.Queryable<TrackTemplateContentEntity>().Where(whereExpression).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<bool> UpdateContentRangeAsync(List<TrackTemplateContentEntity> updateObjs)
|
||||||
|
{
|
||||||
|
return await Context.Updateable(updateObjs).ExecuteCommandHasChangeAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user