Merge branch 'S01-轨迹中台' of http://192.168.80.50:3000/Dotnet/SJZY.Track.Api into S01-轨迹中台
This commit is contained in:
commit
6e760e3926
@ -10,7 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DAC93270-5A2
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0E2537C3-6EF3-4085-9BD2-CF923E53F82A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.Repository", "src\SJZY.Track.Repository\SJZY.Track.Repository.csproj", "{D9CF5706-1972-414F-821E-AA32C13B8570}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.Infrastructure", "src\SJZY.Track.Infrastructure\SJZY.Track.Infrastructure.csproj", "{D9CF5706-1972-414F-821E-AA32C13B8570}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.HttpApi", "src\SJZY.Track.HttpApi\SJZY.Track.HttpApi.csproj", "{390A44FB-0DB5-4B66-86AB-7712DC3030F5}"
|
||||
EndProject
|
||||
|
||||
2
SJZY.Track.Api.sln.DotSettings
Normal file
2
SJZY.Track.Api.sln.DotSettings
Normal file
@ -0,0 +1,2 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=SJZY/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SJZY.Track.Application\SJZY.Track.Application.csproj" />
|
||||
<ProjectReference Include="..\SJZY.Track.Repository\SJZY.Track.Repository.csproj" />
|
||||
<ProjectReference Include="..\SJZY.Track.Infrastructure\SJZY.Track.Infrastructure.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ using SJZY.Expand.ABP.Core.Prometheus;
|
||||
using SJZY.Expand.ABP.Core.Redis;
|
||||
using SJZY.Expand.ABP.Core.Swagger;
|
||||
using SJZY.Track.Application;
|
||||
using SJZY.Track.Repository;
|
||||
using SJZY.Track.Infrastructure;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.AspNetCore.Mvc;
|
||||
using Volo.Abp.AspNetCore.Serilog;
|
||||
@ -28,7 +28,7 @@ namespace SJZY.Track.Api
|
||||
typeof(AbpAspNetCoreMvcModule),
|
||||
typeof(AbpAspNetCoreSerilogModule),
|
||||
typeof(ApplicationModule),
|
||||
typeof(SJZYTrackRepositoryModule)
|
||||
typeof(SJZYTrackInfrastructureModule)
|
||||
)]
|
||||
public class SJZYTrackApiModule : AbpModule
|
||||
{
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
using SJZY.Track.Application.Localization;
|
||||
using SJZY.UserCenter.Contracts;
|
||||
using SJZY.UserCenter.SharedModel;
|
||||
using SJZY.UserCenter.SharedModel.Pub;
|
||||
using Volo.Abp.AspNetCore.Mvc;
|
||||
using Volo.Abp.AutoMapper;
|
||||
using Volo.Abp.FluentValidation;
|
||||
@ -18,7 +19,8 @@ namespace SJZY.Track.Application
|
||||
typeof(AbpLocalizationModule),
|
||||
typeof(AbpVirtualFileSystemModule),
|
||||
typeof(AbpHttpClientModule),
|
||||
typeof(SJZYTrackDomainModule)
|
||||
typeof(SJZYTrackDomainModule),
|
||||
typeof(SjzyUserCenterHttpApiModule)
|
||||
)]
|
||||
public class ApplicationModule : AbpModule
|
||||
{
|
||||
@ -46,6 +48,11 @@ namespace SJZY.Track.Application
|
||||
.AddBaseTypes(typeof(SjzyBasicLocalization))
|
||||
.AddVirtualJson("/Localization/Resources");
|
||||
});
|
||||
//授权拦截提示
|
||||
context.Services.Configure<MvcOptions>(options =>
|
||||
{
|
||||
options.Filters.Add(new ApiAsyncAuthorizationFilter());
|
||||
});
|
||||
|
||||
//用户中心
|
||||
context.Services.AddHttpClientProxies(typeof(SjzyUserCenterHttpApiModule).Assembly, "UserCenter", false);
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper.Internal.Mappers;
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper;
|
||||
|
||||
@ -8,12 +11,16 @@ public class OrderAutoMapperProfile : Profile
|
||||
{
|
||||
public OrderAutoMapperProfile()
|
||||
{
|
||||
CreateMap<CreateOrderInput, OrderEntity>(MemberList.None);
|
||||
CreateMap<UpsertOrderInput, OrderEntity>(MemberList.None);
|
||||
CreateMap<UpdateOrderInput, OrderEntity>(MemberList.None);
|
||||
|
||||
CreateMap<OrderTemplateInfo, OrderTemplateEntity>(MemberList.None)
|
||||
.ForMember(dest => dest.ServiceProviderId, opt => opt.MapFrom(m => m.ServiceProviderId ?? 0))
|
||||
.ForMember(dest => dest.TrackTemplateId, opt => opt.MapFrom(m => m.TemplateId));
|
||||
CreateMap<OrderFligthInfo, OrderFlightEntity>(MemberList.None);
|
||||
|
||||
CreateMap<GetPageTrackOrderInput, GetPageTrackOrderInputVO>(MemberList.None);
|
||||
CreateMap<TrackOrderVO, TrackOrderDto>(MemberList.None);
|
||||
CreateMap<UnifyPageResultDto<TrackOrderVO>, UnifyPageResultDto<TrackOrderDto>>(MemberList.None);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
using AutoMapper;
|
||||
using SJZY.Track.Application.Dtos.TrackPull;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
using Volo.Abp.AutoMapper;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper;
|
||||
|
||||
public class TrackPullAutoMapperProfile : Profile
|
||||
{
|
||||
public TrackPullAutoMapperProfile()
|
||||
{
|
||||
CreateMap<EditTrackPullConfigInput, TrackPullConfigEntity>(MemberList.None);
|
||||
CreateMap<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(MemberList.None).Ignore(dest => dest.Id)
|
||||
.ForMember(dest => dest.IsPush, opt => opt.MapFrom(source => false));
|
||||
CreateMap<UpdateTrackPullContentInput, TrackPullContentConfigEntity>(MemberList.None);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
using AutoMapper;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper;
|
||||
|
||||
public class TrackPushAutoMapperProfile : Profile
|
||||
{
|
||||
public TrackPushAutoMapperProfile()
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -1,23 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
|
||||
public class DeleteOrderInput : OrderNoInfo
|
||||
{
|
||||
}
|
||||
|
||||
public class OrderNoInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单类型,必填
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int OrderType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单号,必填
|
||||
/// </summary>
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string OrderNo { get; set; } = null!;
|
||||
}
|
||||
@ -8,7 +8,25 @@ namespace SJZY.Track.Application.Dtos.ProvideServices
|
||||
{
|
||||
public class GetPageTrackOrderInput : PageInfoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单号
|
||||
/// </summary>
|
||||
public List<string>? OrderNos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间开始
|
||||
/// </summary>
|
||||
public DateTime? CreateTimeStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间截止
|
||||
/// </summary>
|
||||
public DateTime? CreateTimeEnd { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -16,6 +34,69 @@ namespace SJZY.Track.Application.Dtos.ProvideServices
|
||||
/// </summary>
|
||||
public class TrackOrderDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹订单id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单类型id
|
||||
/// </summary>
|
||||
public int OrderType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
public string? OrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模版
|
||||
/// </summary>
|
||||
public string? TrackTemplateNames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户简称
|
||||
/// </summary>
|
||||
public string? CustomerShortName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户代码
|
||||
/// </summary>
|
||||
public string? CustomerCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单明细(json)
|
||||
/// </summary>
|
||||
public string? OrderDetails { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新轨迹内容
|
||||
/// </summary>
|
||||
public string? NewestTrackContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新轨迹内容英文
|
||||
/// </summary>
|
||||
public string? NewestTrackEnContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新轨迹发生地
|
||||
/// </summary>
|
||||
public string? NewestTrackPlace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否完结
|
||||
/// </summary>
|
||||
public bool IsFinish { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统
|
||||
/// </summary>
|
||||
public string SubSystem { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
|
||||
public class OrderNoInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单类型,必填
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int OrderType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单号,必填
|
||||
/// </summary>
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string OrderNo { get; set; } = null!;
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
|
||||
public class CreateOrderInput : UpdateOrderInput
|
||||
public class UpsertOrderInput : UpdateOrderInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户id
|
||||
@ -0,0 +1,24 @@
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
|
||||
public class UpsertTrackInput : OrderNoInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹内容代码
|
||||
/// </summary>
|
||||
public string TrackCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地
|
||||
/// </summary>
|
||||
public string TrackPlace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生时间
|
||||
/// </summary>
|
||||
public DateTime TrackTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生时区
|
||||
/// </summary>
|
||||
public float TraceTimeZone { get; set; }
|
||||
}
|
||||
@ -31,17 +31,17 @@ namespace SJZY.Track.Application.Dtos.TrackContents
|
||||
/// <summary>
|
||||
/// 轨迹内容代码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容
|
||||
/// </summary>
|
||||
public string Content { get; set; }
|
||||
public string? Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容英文
|
||||
/// </summary>
|
||||
public string EnContent { get; set; }
|
||||
public string? EnContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹标记id
|
||||
|
||||
@ -16,7 +16,7 @@ namespace SJZY.Track.Application.Dtos.TrackContents
|
||||
/// <summary>
|
||||
/// 关键字
|
||||
/// </summary>
|
||||
public string Keywords { get; set; }
|
||||
public string Keywords { get; set; } = "";
|
||||
}
|
||||
|
||||
public class GetTrackContentListDto
|
||||
|
||||
@ -26,12 +26,12 @@ namespace SJZY.Track.Application.Dtos.TrackFlags
|
||||
/// <summary>
|
||||
/// 标记
|
||||
/// </summary>
|
||||
public string Flag { get; set; }
|
||||
public string? Flag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 代码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否完结
|
||||
|
||||
@ -0,0 +1,71 @@
|
||||
namespace SJZY.Track.Application.Dtos.TrackPull;
|
||||
|
||||
public class EditTrackPullConfigInput
|
||||
{
|
||||
public int? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作类型
|
||||
/// </summary>
|
||||
public OptionTypeNoNull Options { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹订单号
|
||||
/// </summary>
|
||||
public string OrderNoName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 返参解析对象
|
||||
/// </summary>
|
||||
public int ParseMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 定时任务(分钟)
|
||||
/// </summary>
|
||||
public int PullInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商id
|
||||
/// </summary>
|
||||
public int ServiceProviderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹时区
|
||||
/// </summary>
|
||||
public string TackTimeZoneName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹内容代码
|
||||
/// </summary>
|
||||
public string TrackContentCodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹内容
|
||||
/// </summary>
|
||||
public string TrackContentName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹发生地
|
||||
/// </summary>
|
||||
public string TrackPlaceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹状态
|
||||
/// </summary>
|
||||
public string TrackStatusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模板id
|
||||
/// </summary>
|
||||
public int TrackTemplateId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拉取轨迹发生时间
|
||||
/// </summary>
|
||||
public string TrackTimeName { get; set; }
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
namespace SJZY.Track.Application.Dtos.TrackPull;
|
||||
|
||||
public class UpdateTrackPullContentInput
|
||||
{
|
||||
public int Id { 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 TrackKeyword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(反向)
|
||||
/// </summary>
|
||||
public string TrackKeywordReverse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数值
|
||||
/// </summary>
|
||||
public int? TrackPlaceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹拉取配置id
|
||||
/// </summary>
|
||||
public int TrackPullConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
public string TrackStatusValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区GMT
|
||||
/// </summary>
|
||||
public string TrackTimeZone { get; set; }
|
||||
}
|
||||
@ -31,16 +31,16 @@ namespace SJZY.Track.Application.Dtos.TrackStatus
|
||||
/// <summary>
|
||||
/// 轨迹状态代码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
public string? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态
|
||||
/// </summary>
|
||||
public string TrackStatus { get; set; }
|
||||
public string? TrackStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态英文
|
||||
/// </summary>
|
||||
public string EntrackStatus { get; set; }
|
||||
public string? EntrackStatus { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,11 +65,11 @@ namespace SJZY.Track.Application.Dtos.TrackStatus
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 关键字
|
||||
/// </summary>
|
||||
public string Keywords { get; set; }
|
||||
public string Keywords { get; set; } = "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
/// <summary>
|
||||
/// 关键字
|
||||
/// </summary>
|
||||
public string Keywords { get; set; }
|
||||
public string Keywords { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模版id,轨迹映射的查询使用
|
||||
|
||||
@ -85,11 +85,11 @@
|
||||
/// <summary>
|
||||
/// 模板名称
|
||||
/// </summary>
|
||||
public string Name { set; get; }
|
||||
public string? Name { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板代码
|
||||
/// </summary>
|
||||
public string Code { set; get; }
|
||||
public string? Code { set; get; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,12 +17,12 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SJZY.Expand.AliyunOSS" Version="7.0.10" />
|
||||
<PackageReference Include="SJZY.Expand.Excel" Version="7.0.5" />
|
||||
<PackageReference Include="SJZY.UserCenter.HttpApi" Version="3.0.3-testbuild" />
|
||||
<PackageReference Include="SJZY.UserCenter.SharedModel" Version="3.0.3-testbuild" />
|
||||
<PackageReference Include="Volo.Abp.Http.Client" Version="7.0.2" />
|
||||
<PackageReference Include="Volo.Abp.FluentValidation" Version="7.0.2" />
|
||||
<PackageReference Include="SJZY.Expand.AliyunOSS" Version="7.0.10"/>
|
||||
<PackageReference Include="SJZY.Expand.Excel" Version="7.0.5"/>
|
||||
<PackageReference Include="Volo.Abp.Http.Client" Version="7.0.2"/>
|
||||
<PackageReference Include="Volo.Abp.FluentValidation" Version="7.0.2"/>
|
||||
<PackageReference Include="SJZY.UserCenter.HttpApi" Version="3.0.3-alpha8"/>
|
||||
<PackageReference Include="SJZY.Expand.CAP" Version="7.8.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
|
||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Expand.ABP.Core.Common.Dto;
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
|
||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
|
||||
@ -22,8 +24,8 @@ public class OrderService : ApplicationService
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessException"></exception>
|
||||
[HttpPost("Order/CreateOrUpdate")]
|
||||
public async Task<string> CreateOrUpdateOrderAsync(CreateOrderInput input)
|
||||
[HttpPost("Order/Upsert")]
|
||||
public async Task<string> UpsertAsync(UpsertOrderInput input)
|
||||
{
|
||||
var order = await _orderRepository.GetFirstAsync(x =>
|
||||
x.OrderType == input.OrderType && x.OrderNo == input.OrderNo);
|
||||
@ -34,7 +36,7 @@ public class OrderService : ApplicationService
|
||||
return "更新成功";
|
||||
}
|
||||
|
||||
order = ObjectMapper.Map<CreateOrderInput, OrderEntity>(input);
|
||||
order = ObjectMapper.Map<UpsertOrderInput, OrderEntity>(input);
|
||||
order.SubSystemId = 1;
|
||||
order.OrderTemplates = ObjectMapper.Map<List<OrderTemplateInfo>, List<OrderTemplateEntity>>(input.Templates);
|
||||
order.OrderFlights = ObjectMapper.Map<List<OrderFligthInfo>, List<OrderFlightEntity>>(input.FlightInfos);
|
||||
@ -59,12 +61,13 @@ public class OrderService : ApplicationService
|
||||
throw new BusinessException(message: $"订单:{input.OrderNo}不存在");
|
||||
}
|
||||
|
||||
await _orderRepository.SoftDeleteAsync(x => x.Id == orderId);
|
||||
await _orderRepository.DeleteOrderAsync(orderId);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#region 轨迹订单明细
|
||||
|
||||
/// <summary>
|
||||
/// 根据轨迹订单id获取轨迹订单明细列表
|
||||
/// </summary>
|
||||
@ -75,19 +78,25 @@ public class OrderService : ApplicationService
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 轨迹订单列表
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// 获取分页的轨迹订单
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("/Order/GetTrackOrderList")]
|
||||
public async Task<UnifyPageResultDto<TrackOrderDto>> GetPageTrackOrder(GetPageTrackOrderInput input)
|
||||
{
|
||||
return null;
|
||||
var vo = ObjectMapper.Map<GetPageTrackOrderInput, GetPageTrackOrderInputVO>(input);
|
||||
var pageList = await _orderRepository.GetPageTrackOrder(vo);
|
||||
var pageResultDto = ObjectMapper.Map<UnifyPageResultDto<TrackOrderVO>, UnifyPageResultDto<TrackOrderDto>>(pageList);
|
||||
return pageResultDto;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private async Task UpdateOrderAsync(UpdateOrderInput input, OrderEntity order)
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
|
||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
|
||||
@ -12,15 +11,13 @@ namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
public class TrackQueryService : ApplicationService
|
||||
{
|
||||
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
||||
private readonly IOrderRepository _orderRepository;
|
||||
private readonly ITrackTemplateRepository _trackTemplateRepository;
|
||||
private readonly ITrackQueries _trackQueries;
|
||||
|
||||
public TrackQueryService(ITrackDetailsRepository trackDetailsRepository, IOrderRepository orderRepository,
|
||||
ITrackTemplateRepository trackTemplateRepository)
|
||||
public TrackQueryService(ITrackDetailsRepository trackDetailsRepository,
|
||||
ITrackQueries trackQueries)
|
||||
{
|
||||
_trackDetailsRepository = trackDetailsRepository;
|
||||
_orderRepository = orderRepository;
|
||||
_trackTemplateRepository = trackTemplateRepository;
|
||||
_trackQueries = trackQueries;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -29,8 +26,8 @@ public class TrackQueryService : ApplicationService
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessException"></exception>
|
||||
[HttpPost("TrackQuery/GetByOrderNos")]
|
||||
public async Task<List<GetTrackOutput>> GetByOrderNosAsync(GetTrackInput input)
|
||||
[HttpPost("Track/Query")]
|
||||
public async Task<List<GetTrackOutput>> QueryAsync(GetTrackInput input)
|
||||
{
|
||||
if (input.OrderNos.Count > 500)
|
||||
{
|
||||
@ -38,8 +35,8 @@ public class TrackQueryService : ApplicationService
|
||||
}
|
||||
|
||||
var res = new List<GetTrackOutput>();
|
||||
input.OrderNos = input.OrderNos.Distinct().ToList();
|
||||
var details = await _trackDetailsRepository.GetListAsync(input.OrderNos);
|
||||
input.OrderNos = input.OrderNos.Distinct().ToList(); // 单号去重
|
||||
var details = await _trackDetailsRepository.GetListAsync(input.OrderType, input.OrderNos);
|
||||
|
||||
var isTurn = input.TimeZone != 0;
|
||||
foreach (var group in details.GroupBy(x => x.OrderId))
|
||||
@ -78,18 +75,21 @@ public class TrackQueryService : ApplicationService
|
||||
list.ForEach(item => item.TrackDetails.Sort((a, b) => b.Time.CompareTo(a.Time)));
|
||||
break;
|
||||
case SortMethod.ByTemplate:
|
||||
var orderTemplates = await _orderRepository.GetOrderTemplatesAsync(input.OrderType, input.OrderNos);
|
||||
var orderTemplates = await _trackQueries
|
||||
.GetOrderTemplateLinksAsync(input.OrderType, input.OrderNos);
|
||||
var distinctTemplateIds = orderTemplates.Select(x => x.TemplateId).Distinct().ToList();
|
||||
var templateContent =
|
||||
await _trackTemplateRepository.GetTemplateContentOrderlyAsync(distinctTemplateIds);
|
||||
var templateContent = await _trackQueries.GetOrderedTrackCodesAsync(distinctTemplateIds);
|
||||
list.ForEach(item =>
|
||||
{
|
||||
var template = orderTemplates.FirstOrDefault(x => x.OrderNo == item.OrderNo);
|
||||
if (template == default) return;
|
||||
var codes = templateContent
|
||||
.Where(x => x.TemplateId == template.TemplateId)
|
||||
.Select(x => x.Code)
|
||||
.ToList();
|
||||
var codes = new List<string>();
|
||||
// 多模板拼接显示
|
||||
foreach (var orderTemplate in orderTemplates.Where(x => x.OrderNo == item.OrderNo))
|
||||
{
|
||||
codes.AddRange(templateContent
|
||||
.Where(t => t.TemplateId == orderTemplate.TemplateId)
|
||||
.Select(t => t.Code));
|
||||
}
|
||||
|
||||
item.TrackDetails = item.TrackDetails
|
||||
.Where(x => codes.Contains(x.Code)) // 剔除不在模板内容中的元素
|
||||
.OrderBy(x => codes.IndexOf(x.Code)) // 按照在模板内容的位置排序
|
||||
|
||||
@ -1,5 +1,88 @@
|
||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
using DotNetCore.CAP;
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
using SJZY.UserCenter.HttpApi.Services;
|
||||
|
||||
public class TrackService
|
||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹服务
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "提供接口")]
|
||||
public class TrackService : ApplicationService
|
||||
{
|
||||
private readonly IOrderRepository _orderRepository;
|
||||
private readonly ITrackDetailsRepository _trackDetailsRepository;
|
||||
private readonly ITrackQueries _trackQueries;
|
||||
private readonly ICapPublisher _capPublisher;
|
||||
|
||||
public TrackService(ITrackQueries trackQueries, IOrderRepository orderRepository,
|
||||
ITrackDetailsRepository trackDetailsRepository, ICapPublisher capPublisher)
|
||||
{
|
||||
_trackQueries = trackQueries;
|
||||
_orderRepository = orderRepository;
|
||||
_trackDetailsRepository = trackDetailsRepository;
|
||||
_capPublisher = capPublisher;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增/更新订单轨迹接口
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="BusinessException"></exception>
|
||||
[HttpPost("Track/Upsert")]
|
||||
public async Task<bool> UpsertTrackAsync(UpsertTrackInput input)
|
||||
{
|
||||
var orderId = await _orderRepository.GetFirstAsync(x =>
|
||||
x.OrderType == input.OrderType && x.OrderNo == input.OrderNo, x => x.Id);
|
||||
if (orderId == default)
|
||||
{
|
||||
throw new BusinessException(message: $"订单:{input.OrderNo}不存在");
|
||||
}
|
||||
|
||||
// 不存在则新增轨迹,存在则更新
|
||||
var track = await _trackDetailsRepository.GetFirstOrDefaultAsync(orderId, input.TrackCode);
|
||||
if (track == default)
|
||||
{
|
||||
var trackContent = await _trackQueries.MatchTrackContentAsync(orderId, input.TrackCode);
|
||||
if (trackContent == default)
|
||||
{
|
||||
throw new BusinessException(message: $"订单:{input.OrderNo} 所绑定的模板,没有一条内容可以匹配轨迹代码:{input.TrackCode}");
|
||||
}
|
||||
|
||||
track = new TrackDetailsIndex
|
||||
{
|
||||
OrderId = orderId,
|
||||
OrderNo = input.OrderNo,
|
||||
OrderType = input.OrderType,
|
||||
TrackStatus = trackContent.Status,
|
||||
TrackCode = input.TrackCode,
|
||||
TrackContent = trackContent.Content,
|
||||
TrackEnContent = trackContent.EnContent,
|
||||
TrackPlace = input.TrackPlace,
|
||||
TrackTime = input.TrackTime,
|
||||
TraceTimeZone = input.TraceTimeZone,
|
||||
CreateUserId = CurrentUserRequest.CurrentUser.UserId,
|
||||
CreateTime = DateTime.Now
|
||||
};
|
||||
await _trackDetailsRepository.CreateAsync(track);
|
||||
}
|
||||
else
|
||||
{
|
||||
track.UpdateUserId = CurrentUserRequest.CurrentUser.UserId;
|
||||
track.UpdateTime = DateTime.Now;
|
||||
track.TrackPlace = input.TrackPlace;
|
||||
track.TrackTime = input.TrackTime;
|
||||
track.TraceTimeZone = input.TraceTimeZone;
|
||||
await _trackDetailsRepository.UpdateAsync(track);
|
||||
}
|
||||
|
||||
// 根据订单关联关系向下刷,不同子系统还需要做内容映射
|
||||
|
||||
// 推送
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,13 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Expand.ABP.Core.Localization;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.Track.Application.Dtos.TrackPull;
|
||||
using SJZY.Track.Application.Localization;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Common;
|
||||
using SJZY.Track.Domain.Dtos.TrackPull;
|
||||
using System.Linq.Expressions;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace SJZY.Track.Application.Services.TrackPull;
|
||||
@ -16,13 +21,16 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
||||
{
|
||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||
private readonly ITrackPullConfigRepository _trackPullConfigRepository;
|
||||
private readonly ITrackTemplateRepository _trackTemplateRepository;
|
||||
|
||||
public TrackPullService(
|
||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||
ITrackPullConfigRepository trackPullConfigRepository)
|
||||
ITrackPullConfigRepository trackPullConfigRepository,
|
||||
ITrackTemplateRepository trackTemplateRepository)
|
||||
{
|
||||
_stringLocalizer = stringLocalizer;
|
||||
_trackPullConfigRepository = trackPullConfigRepository;
|
||||
_trackTemplateRepository = trackTemplateRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -68,4 +76,132 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
||||
{
|
||||
return await _trackPullConfigRepository.GetContentDetailAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹拉取配置编辑
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("Edit")]
|
||||
public async Task<bool> EditAsync([FromBody] EditTrackPullConfigInput input)
|
||||
{
|
||||
if (input.Options != OptionTypeNoNull.删除)
|
||||
{
|
||||
Expression<Func<TrackPullConfigEntity, bool>> isAnyExp = x =>
|
||||
x.SubSystemId == input.SubSystemId && x.TrackTemplateId == input.TrackTemplateId && x.ServiceProviderId == input.ServiceProviderId;
|
||||
if (input.Options == OptionTypeNoNull.修改) isAnyExp.And(x => x.Id != input.Id);
|
||||
|
||||
if (await _trackPullConfigRepository.IsAnyAsync(isAnyExp))
|
||||
throw new BusinessException(message: _stringLocalizer["IsTrackPullConfigAny"]);
|
||||
}
|
||||
|
||||
switch (input.Options)
|
||||
{
|
||||
case OptionTypeNoNull.新增:
|
||||
{
|
||||
var trackPullEntity = ObjectMapper.Map<EditTrackPullConfigInput, TrackPullConfigEntity>(input);
|
||||
var trackPullParamsEntity = ObjectMapper.Map<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(input);
|
||||
|
||||
var trackTemplateContentEntities = await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId);
|
||||
|
||||
var trackPullContentEntities = new List<TrackPullContentConfigEntity>();
|
||||
|
||||
using (var ts = TransactionScopeHelper.Create())
|
||||
{
|
||||
int id = await _trackPullConfigRepository.InsertReturnIdentityAsync(trackPullEntity);
|
||||
|
||||
trackPullParamsEntity.PullOrPushConfigId = id;
|
||||
await _trackPullConfigRepository.InsertParamsAsync(trackPullParamsEntity);
|
||||
|
||||
foreach (var item in trackTemplateContentEntities)
|
||||
{
|
||||
trackPullContentEntities.Add(new()
|
||||
{
|
||||
TrackPullConfigId = id,
|
||||
TrackContentId = item.TrackContentId
|
||||
});
|
||||
}
|
||||
await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities);
|
||||
|
||||
ts.Complete();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case OptionTypeNoNull.修改:
|
||||
{
|
||||
var oldTrackPullEntity = await _trackPullConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||
|
||||
var oldTrackPullParamsEntity = await _trackPullConfigRepository.GetParamsSingleAsync(x => x.PullOrPushConfigId == input.Id && !x.IsPush);
|
||||
|
||||
var trackPullContentEntities = new List<TrackPullContentConfigEntity>();
|
||||
|
||||
if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId)
|
||||
{
|
||||
var trackTemplateContentEntities = await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId);
|
||||
|
||||
foreach (var item in trackTemplateContentEntities)
|
||||
{
|
||||
trackPullContentEntities.Add(new()
|
||||
{
|
||||
TrackPullConfigId = oldTrackPullEntity.Id,
|
||||
TrackContentId = item.TrackContentId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ObjectMapper.Map(input, oldTrackPullEntity);
|
||||
ObjectMapper.Map(input, oldTrackPullParamsEntity);
|
||||
|
||||
using (var ts = TransactionScopeHelper.Create())
|
||||
{
|
||||
await _trackPullConfigRepository.UpdateAsync(oldTrackPullEntity);
|
||||
await _trackPullConfigRepository.UpdateParamsAsync(oldTrackPullParamsEntity);
|
||||
|
||||
if (oldTrackPullEntity.TrackTemplateId != input.TrackTemplateId)
|
||||
{
|
||||
await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id);
|
||||
await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities);
|
||||
}
|
||||
|
||||
ts.Complete();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case OptionTypeNoNull.删除:
|
||||
using (var ts = TransactionScopeHelper.Create())
|
||||
{
|
||||
await _trackPullConfigRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||
await _trackPullConfigRepository.SoftDeleteParamsAsync(x => x.PullOrPushConfigId == input.Id && !x.IsPush);
|
||||
await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id);
|
||||
|
||||
ts.Complete();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new BusinessException(message: _stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum,
|
||||
nameof(EditTrackPullConfigInput.Options)]);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹拉取配置内容修改
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("UpdateContent")]
|
||||
public async Task<bool> UpdateContentAsync([FromBody] UpdateTrackPullContentInput input)
|
||||
{
|
||||
var oldTrackPullContentEntity = await _trackPullConfigRepository.GetContentByIdAsync(input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||
|
||||
ObjectMapper.Map(input, oldTrackPullContentEntity);
|
||||
|
||||
await _trackPullConfigRepository.UpdateContentAsync(oldTrackPullContentEntity);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Track.Application.Localization;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Common;
|
||||
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace SJZY.Track.Application.Services.TrackPush;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹推送
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "轨迹推送")]
|
||||
[Route("/Track/PushConfig")]
|
||||
public class TrackPushService : ApplicationService, ITransientDependency
|
||||
{
|
||||
private readonly IStringLocalizer<TrackLocalizationResource> _stringLocalizer;
|
||||
private readonly ITrackPushConfigRepository _trackPushConfigRepository;
|
||||
|
||||
public TrackPushService(
|
||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||
ITrackPushConfigRepository trackPushConfigRepository)
|
||||
{
|
||||
_stringLocalizer = stringLocalizer;
|
||||
_trackPushConfigRepository = trackPushConfigRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹推送配置列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetPage")]
|
||||
public async Task<UnifyPageResultDto<GetTrackPushConfigPageOutputVO>> GetPageAsync([FromBody] KeywordsInputVO input)
|
||||
{
|
||||
return await _trackPushConfigRepository.GetPageAsync(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹推送配置内容列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetContentPage")]
|
||||
public async Task<UnifyPageResultDto<GetTrackPushContentPageOutputVO>> GetContentPageAsync([FromBody] GetTrackPushContentPageInputVO input)
|
||||
{
|
||||
return await _trackPushConfigRepository.GetContentPageAsync(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹推送配置详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetDetail")]
|
||||
public async Task<GetTrackPushConfigDetailOutputVO> GetDetailAsync(int id)
|
||||
{
|
||||
return await _trackPushConfigRepository.GetDetailAsync(id);
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||
using SJZY.Track.Application.Localization;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.Linq.Expressions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Expand.ABP.Core.Localization;
|
||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
||||
|
||||
@ -11,13 +11,14 @@ public interface IOrderRepository : IBasicRepository<OrderEntity>
|
||||
/// <returns></returns>
|
||||
Task<bool> CreateOrderAsync(OrderEntity order);
|
||||
|
||||
Task<List<TrackOrderDetailVO>> GetOrderDetails(GetOrderDetailsInputVO input);
|
||||
|
||||
/// <summary>
|
||||
/// 根据订单号,获取订单模板
|
||||
/// 获取分页的轨迹订单
|
||||
/// </summary>
|
||||
/// <param name="orderType">订单类型</param>
|
||||
/// <param name="distinctOrderNumbers"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<OrderTemplateDto>> GetOrderTemplatesAsync(int orderType, List<string> distinctOrderNumbers);
|
||||
Task<UnifyPageResultDto<TrackOrderVO>> GetPageTrackOrder(GetPageTrackOrderInputVO input);
|
||||
|
||||
/// <summary>
|
||||
/// 关联订单
|
||||
@ -39,4 +40,11 @@ public interface IOrderRepository : IBasicRepository<OrderEntity>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
Task UpdateOrderAsync(OrderEntity order);
|
||||
|
||||
/// <summary>
|
||||
/// 删除订单
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
Task DeleteOrderAsync(int orderId);
|
||||
}
|
||||
@ -4,7 +4,7 @@
|
||||
/// 订单航班表(1:N)
|
||||
/// </summary>
|
||||
[SugarTable("t_order_flight")]
|
||||
public class OrderFlightEntity : ICreateBaicEntity, IEntity
|
||||
public class OrderFlightEntity : ICreateBaicEntity, ISoftDeleteBasicEntity, IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增主键
|
||||
@ -33,10 +33,18 @@ public class OrderFlightEntity : ICreateBaicEntity, IEntity
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CreateUserId")]
|
||||
public int CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
}
|
||||
@ -4,7 +4,7 @@
|
||||
/// 轨迹订单关联表(1:N)
|
||||
/// </summary>
|
||||
[SugarTable("t_order_link")]
|
||||
public class OrderLinkEntity : ICreateBaicEntity, IEntity
|
||||
public class OrderLinkEntity : ICreateBaicEntity, ISoftDeleteBasicEntity, IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增主键
|
||||
@ -39,10 +39,18 @@ public class OrderLinkEntity : ICreateBaicEntity, IEntity
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CreateUserId")]
|
||||
public int CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
}
|
||||
@ -4,7 +4,7 @@
|
||||
/// 轨迹订单模板表(1:N)
|
||||
/// </summary>
|
||||
[SugarTable("t_order_template")]
|
||||
public class OrderTemplateEntity : ICreateBaicEntity, IEntity
|
||||
public class OrderTemplateEntity : ICreateBaicEntity, ISoftDeleteBasicEntity, IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 自增主键
|
||||
@ -30,6 +30,21 @@ public class OrderTemplateEntity : ICreateBaicEntity, IEntity
|
||||
[SugarColumn(ColumnName = "TrackTemplateId")]
|
||||
public int TrackTemplateId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CreateUserId")]
|
||||
public int CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
}
|
||||
@ -16,19 +16,19 @@ public class TrackContentEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||
/// 轨迹内容代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Code")]
|
||||
public string Code { get; set; }
|
||||
public string Code { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Content")]
|
||||
public string Content { get; set; }
|
||||
public string Content { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容英文
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "EnContent")]
|
||||
public string EnContent { get; set; }
|
||||
public string EnContent { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
|
||||
@ -4,9 +4,13 @@ namespace SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
|
||||
public interface ITrackDetailsRepository
|
||||
{
|
||||
Task WriteTrack(TrackDetailsIndex index);
|
||||
Task<TrackDetailsIndex?> GetFirstOrDefaultAsync(int orderId, string inputTrackCode);
|
||||
|
||||
Task<List<TrackDetailsIndex>> GetListAsync(List<string> orderNos);
|
||||
Task UpdateAsync(TrackDetailsIndex index);
|
||||
|
||||
Task CreateAsync(TrackDetailsIndex index);
|
||||
|
||||
Task<List<TrackDetailsIndex>> GetListAsync(int orderType, List<string> orderNos);
|
||||
|
||||
Task<(List<TrackDetailsIndex> list, long total)> GetListAsync(TrackDetailsQueryInput input);
|
||||
}
|
||||
@ -21,7 +21,7 @@ public class TrackDetailsIndex : IdBaseIndex
|
||||
/// <summary>
|
||||
/// 订单类型(主数据枚举TrackOrderType)
|
||||
/// </summary>
|
||||
public string OrderType { get; set; }
|
||||
public int OrderType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态
|
||||
|
||||
@ -32,4 +32,20 @@ public interface ITrackPullConfigRepository : IBasicRepository<TrackPullConfigEn
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetTrackPullContentDetailOutputVO> GetContentDetailAsync(int id);
|
||||
|
||||
Task<bool> InsertParamsAsync(TrackPushPullParamsConfigEntity insertObj);
|
||||
|
||||
Task<bool> InsertContentRangeAsync(List<TrackPullContentConfigEntity> insertObjs);
|
||||
|
||||
Task<TrackPushPullParamsConfigEntity> GetParamsSingleAsync(Expression<Func<TrackPushPullParamsConfigEntity, bool>> whereExpression);
|
||||
|
||||
Task<bool> UpdateParamsAsync(TrackPushPullParamsConfigEntity updateObj);
|
||||
|
||||
Task<bool> SoftDeleteContentAsync(Expression<Func<TrackPullContentConfigEntity, bool>> whereExpression);
|
||||
|
||||
Task<bool> SoftDeleteParamsAsync(Expression<Func<TrackPushPullParamsConfigEntity, bool>> whereExpression);
|
||||
|
||||
Task<TrackPullContentConfigEntity> GetContentByIdAsync(int id);
|
||||
|
||||
Task<bool> UpdateContentAsync(TrackPullContentConfigEntity updateObj);
|
||||
}
|
||||
@ -1,5 +1,13 @@
|
||||
namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Common;
|
||||
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||
|
||||
namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||
|
||||
public interface ITrackPushConfigRepository : IBasicRepository<TrackPushConfigEntity>
|
||||
{
|
||||
Task<UnifyPageResultDto<GetTrackPushConfigPageOutputVO>> GetPageAsync(KeywordsInputVO input);
|
||||
|
||||
Task<UnifyPageResultDto<GetTrackPushContentPageOutputVO>> GetContentPageAsync(GetTrackPushContentPageInputVO input);
|
||||
|
||||
Task<GetTrackPushConfigDetailOutputVO> GetDetailAsync(int id);
|
||||
}
|
||||
@ -16,13 +16,13 @@ public class TrackStatusEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||
/// 轨迹状态代码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Code")]
|
||||
public string Code { get; set; }
|
||||
public string Code { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态英文
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "EnStatus")]
|
||||
public string EnStatus { get; set; }
|
||||
public string EnStatus { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 所属节点(主数据枚举ServiceNode)
|
||||
@ -34,7 +34,7 @@ public class TrackStatusEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||
/// 轨迹状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Status")]
|
||||
public string Status { get; set; }
|
||||
public string Status { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
|
||||
@ -4,8 +4,6 @@ namespace SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
|
||||
public interface ITrackTemplateRepository : IBasicRepository<TrackTemplateEntity>
|
||||
{
|
||||
Task<List<TemplateContentOrderlyDto>> GetTemplateContentOrderlyAsync(List<int> distinctTemplateIds);
|
||||
|
||||
Task<GetTrackTemplateDetailVO?> GetDetailAsync(int id);
|
||||
|
||||
Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input);
|
||||
@ -34,4 +32,7 @@ public interface ITrackTemplateRepository : IBasicRepository<TrackTemplateEntity
|
||||
Task<bool> UpdateContentAsync(TrackTemplateContentEntity updateObj);
|
||||
|
||||
Task<bool> SoftDeleteContentAsync(int id);
|
||||
|
||||
Task<List<TrackTemplateContentEntity>> GetContentListAsync(
|
||||
Expression<Func<TrackTemplateContentEntity, bool>> whereExpression);
|
||||
}
|
||||
18
src/SJZY.Track.Domain/Dtos/Order/GetOrderDetailsInputVO.cs
Normal file
18
src/SJZY.Track.Domain/Dtos/Order/GetOrderDetailsInputVO.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Domain.Dtos.Order
|
||||
{
|
||||
public class GetOrderDetailsInputVO
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class TrackOrderDetailVO
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
102
src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
Normal file
102
src/SJZY.Track.Domain/Dtos/Order/GetPageTrackOrderInputVO.cs
Normal file
@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Domain.Dtos.Order
|
||||
{
|
||||
public class GetPageTrackOrderInputVO : PageInfoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单号
|
||||
/// </summary>
|
||||
public List<string> OrderNos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间开始
|
||||
/// </summary>
|
||||
public DateTime? CreateTimeStart { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间截止
|
||||
/// </summary>
|
||||
public DateTime? createTimeEnd { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹订单VO
|
||||
/// </summary>
|
||||
public class TrackOrderVO
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹订单id
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单类型id
|
||||
/// </summary>
|
||||
public int OrderType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
public string? OrderNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模版
|
||||
/// </summary>
|
||||
public string? TrackTemplateNames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户简称
|
||||
/// </summary>
|
||||
public string? CustomerShortName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户代码
|
||||
/// </summary>
|
||||
public string? CustomerCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单明细(json)
|
||||
/// </summary>
|
||||
public string? OrderDetails { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新轨迹内容
|
||||
/// </summary>
|
||||
public string? NewestTrackContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新轨迹内容英文
|
||||
/// </summary>
|
||||
public string? NewestTrackEnContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最新轨迹发生地
|
||||
/// </summary>
|
||||
public string? NewestTrackPlace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否完结
|
||||
/// </summary>
|
||||
public bool IsFinish { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统
|
||||
/// </summary>
|
||||
public string SubSystem { get; set; }
|
||||
}
|
||||
}
|
||||
23
src/SJZY.Track.Domain/Dtos/Order/OrderIdentifier.cs
Normal file
23
src/SJZY.Track.Domain/Dtos/Order/OrderIdentifier.cs
Normal file
@ -0,0 +1,23 @@
|
||||
namespace SJZY.Track.Domain.Dtos.Order;
|
||||
|
||||
/// <summary>
|
||||
/// 订单标识符
|
||||
/// </summary>
|
||||
public readonly struct OrderIdentifier
|
||||
{
|
||||
public OrderIdentifier(int orderType, string orderNo)
|
||||
{
|
||||
OrderType = orderType;
|
||||
OrderNo = orderNo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单类型
|
||||
/// </summary>
|
||||
public int OrderType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
public string OrderNo { get; }
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
namespace SJZY.Track.Domain.Dtos.Order;
|
||||
|
||||
public class OrderTemplateDto
|
||||
public class OrderTemplateLinkDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单号
|
||||
/// </summary>
|
||||
public string OrderNo { get; set; }
|
||||
public string OrderNo { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 模板id
|
||||
@ -0,0 +1,19 @@
|
||||
namespace SJZY.Track.Domain.Dtos.TrackDetails;
|
||||
|
||||
public class MatchTrackContentDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹内容
|
||||
/// </summary>
|
||||
public string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容英文
|
||||
/// </summary>
|
||||
public string EnContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态
|
||||
/// </summary>
|
||||
public string Status { get; set; }
|
||||
}
|
||||
@ -7,7 +7,7 @@ public class GetTrackPullConfigPageOutputVO
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
public int? Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商名称
|
||||
|
||||
@ -0,0 +1,98 @@
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
|
||||
namespace SJZY.Track.Domain.Dtos.TrackPush;
|
||||
|
||||
public class GetTrackPushConfigDetailOutputVO
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户id
|
||||
/// </summary>
|
||||
public int CustomId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户
|
||||
/// </summary>
|
||||
public string CustomName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送扩展字段
|
||||
/// </summary>
|
||||
public string ExpandFieldsName { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否自动推送
|
||||
/// </summary>
|
||||
public bool IsAutoPush { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹订单号
|
||||
/// </summary>
|
||||
public string OrderNoName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商
|
||||
/// </summary>
|
||||
public string ServiceProvider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商id
|
||||
/// </summary>
|
||||
public int ServiceProviderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统
|
||||
/// </summary>
|
||||
public string SubSystem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹时区
|
||||
/// </summary>
|
||||
public string TackTimeZoneName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹内容代码
|
||||
/// </summary>
|
||||
public string TrackContentCodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹内容
|
||||
/// </summary>
|
||||
public string TrackContentName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹内容英文
|
||||
/// </summary>
|
||||
public string TrackEnContentName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹发生地
|
||||
/// </summary>
|
||||
public string TrackPlaceName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹状态
|
||||
/// </summary>
|
||||
public string TrackStatusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模板
|
||||
/// </summary>
|
||||
public List<DropdownListDataDto> TrackTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模板id
|
||||
/// </summary>
|
||||
public int TrackTemplateId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹发生时间
|
||||
/// </summary>
|
||||
public string TrackTimeName { get; set; }
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
namespace SJZY.Track.Domain.Dtos.TrackPush;
|
||||
|
||||
public class GetTrackPushConfigPageOutputVO
|
||||
{
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户名称
|
||||
/// </summary>
|
||||
public string CustomName { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统名称
|
||||
/// </summary>
|
||||
public string SubSystem { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板名称
|
||||
/// </summary>
|
||||
public string TrackTemplate { get; set; }
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
namespace SJZY.Track.Domain.Dtos.TrackPush;
|
||||
|
||||
public class GetTrackPushContentPageInputVO : PageInfoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹推送配置id
|
||||
/// </summary>
|
||||
public int TrackPushConfigId { get; set; }
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
namespace SJZY.Track.Domain.Dtos.TrackPush;
|
||||
|
||||
public class GetTrackPushContentPageOutputVO
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹内容代码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容
|
||||
/// </summary>
|
||||
public string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容英文
|
||||
/// </summary>
|
||||
public string EnContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送扩展字段
|
||||
/// </summary>
|
||||
public string ExpandFieldsValue { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送单号类型
|
||||
/// </summary>
|
||||
public string OrderNoType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送排序
|
||||
/// </summary>
|
||||
public int Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹内容代码
|
||||
/// </summary>
|
||||
public string TrackContentCodeValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹内容
|
||||
/// </summary>
|
||||
public string TrackContentValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹内容英文
|
||||
/// </summary>
|
||||
public string TrackEnContentValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送轨迹状态
|
||||
/// </summary>
|
||||
public string TrackStatusValue { get; set; }
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
namespace SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
|
||||
public class TemplateContentOrderlyDto
|
||||
public class OrderedTrackCodeDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 模板id
|
||||
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace SJZY.Track.Repository.Enum;
|
||||
namespace SJZY.Track.Domain.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// 枚举属性
|
||||
@ -10,6 +10,5 @@ public enum EnumPropertyEnums
|
||||
/// <summary>
|
||||
/// 节点
|
||||
/// </summary>
|
||||
[Description("ServiceNode")]
|
||||
节点,
|
||||
[Description("ServiceNode")] 节点,
|
||||
}
|
||||
@ -1,4 +1,6 @@
|
||||
namespace SJZY.Track.Domain;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
|
||||
namespace SJZY.Track.Domain;
|
||||
|
||||
public interface IBasicRepository<T> : IBasicQuery<T> where T : IAggregateRoot
|
||||
{
|
||||
@ -33,7 +35,7 @@ public interface IBasicRepository<T> : IBasicQuery<T> where T : IAggregateRoot
|
||||
/// <param name="entities"></param>
|
||||
/// <param name="updateColumns">要更新的列</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> UpdateRangeAsync(List<T> entities, Expression<Func<T, object>> updateColumns = null);
|
||||
Task<bool> UpdateRangeAsync(List<T> entities, Expression<Func<T, object>>? updateColumns = null);
|
||||
|
||||
/// <summary>
|
||||
/// 软删
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Domain;
|
||||
namespace SJZY.Track.Domain.Queries;
|
||||
|
||||
public interface IBasicQuery<T> where T : IEntity
|
||||
{
|
||||
34
src/SJZY.Track.Domain/Queries/ITrackQueries.cs
Normal file
34
src/SJZY.Track.Domain/Queries/ITrackQueries.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
using SJZY.Track.Domain.Dtos.TrackDetails;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
|
||||
namespace SJZY.Track.Domain.Queries;
|
||||
|
||||
/// <summary>
|
||||
/// 提供接口专用查询
|
||||
/// </summary>
|
||||
public interface ITrackQueries
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据订单号,获取订单模板
|
||||
/// </summary>
|
||||
/// <param name="orderType">订单类型</param>
|
||||
/// <param name="orderNumbers">订单号</param>
|
||||
/// <returns></returns>
|
||||
Task<List<OrderTemplateLinkDto>> GetOrderTemplateLinksAsync(int orderType, List<string> orderNumbers);
|
||||
|
||||
/// <summary>
|
||||
/// 根据订单模板,获取有序的轨迹code
|
||||
/// </summary>
|
||||
/// <param name="templateIds">模板id</param>
|
||||
/// <returns></returns>
|
||||
Task<List<OrderedTrackCodeDto>> GetOrderedTrackCodesAsync(List<int> templateIds);
|
||||
|
||||
/// <summary>
|
||||
/// 根据订单id找到订单模板,匹配模板命中的轨迹内容
|
||||
/// </summary>
|
||||
/// <param name="orderId">订单id</param>
|
||||
/// <param name="code">轨迹代码</param>
|
||||
/// <returns></returns>
|
||||
Task<MatchTrackContentDto?> MatchTrackContentAsync(int orderId, string code);
|
||||
}
|
||||
77
src/SJZY.Track.Infrastructure/DataBaseContext.cs
Normal file
77
src/SJZY.Track.Infrastructure/DataBaseContext.cs
Normal file
@ -0,0 +1,77 @@
|
||||
using SJZY.UserCenter.HttpApi.Services;
|
||||
|
||||
#pragma warning disable 1591
|
||||
|
||||
namespace SJZY.Track.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// Sqlsugar 上下文对象
|
||||
/// </summary>
|
||||
public class DataBaseContext
|
||||
{
|
||||
#region 审计属性自动赋值
|
||||
|
||||
public static void OnExcutingAction(object oldValue, DataFilterModel entityInfo)
|
||||
{
|
||||
//过滤掉 "v_" 开头的表
|
||||
if (entityInfo.EntityColumnInfo.DbTableName.StartsWith("v_", StringComparison.OrdinalIgnoreCase))
|
||||
throw new Exception("非法的操作,不允许编辑映射表");
|
||||
|
||||
//新增
|
||||
if (entityInfo.OperationType == DataFilterType.InsertByObject)
|
||||
{
|
||||
if (entityInfo.PropertyName == nameof(ICreateBaicEntity.CreateTime))
|
||||
entityInfo.SetValue(DateTime.Now);
|
||||
if (entityInfo.PropertyName == nameof(ICreateBaicEntity.CreateUserId))
|
||||
{
|
||||
if (oldValue == null || (int)oldValue == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
entityInfo.SetValue(CurrentUserRequest.CurrentUser?.UserId);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
//entityInfo.SetValue(CurrentUserRequest.CurrentUser.UserId);
|
||||
}
|
||||
}
|
||||
//修改
|
||||
else if (entityInfo.OperationType == DataFilterType.UpdateByObject)
|
||||
{
|
||||
if (entityInfo.PropertyName == nameof(IUpdateBasicEntity.UpdateTime))
|
||||
entityInfo.SetValue(DateTime.Now);
|
||||
else if (entityInfo.PropertyName == nameof(IUpdateBasicEntity.UpdateUserId))
|
||||
{
|
||||
if (oldValue == null || (int)oldValue == 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
entityInfo.SetValue(CurrentUserRequest.CurrentUser.UserId);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
//entityInfo.SetValue(CurrentUserRequest.CurrentUser.UserId);
|
||||
}
|
||||
//删除
|
||||
else if (entityInfo.PropertyName == nameof(IDeleteBasicEntity.IsDeleted))
|
||||
{
|
||||
var currentType = entityInfo.EntityValue.GetType();
|
||||
bool.TryParse(
|
||||
currentType.GetProperty(entityInfo.PropertyName)?.GetValue(entityInfo.EntityValue)?.ToString(),
|
||||
out bool isdelete);
|
||||
if (isdelete)
|
||||
{
|
||||
//currentType.GetProperty(nameof(IDeleteBasicEntity.DeleteUserId))?.SetValue(entityInfo.EntityValue, 5);
|
||||
currentType.GetProperty(nameof(IDeleteBasicEntity.DeleteTime))
|
||||
?.SetValue(entityInfo.EntityValue, DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 审计属性自动赋值
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
using System.Linq.Expressions;
|
||||
using SJZY.Track.Domain;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
using SJZY.Track.Domain.SeedWork;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
namespace SJZY.Track.Infrastructure.Queries;
|
||||
|
||||
#pragma warning disable CS8613
|
||||
public class BasicQuery<T> : SimpleClient<T>, IBasicQuery<T> where T : class, IEntity, new()
|
||||
78
src/SJZY.Track.Infrastructure/Queries/TrackQueries.cs
Normal file
78
src/SJZY.Track.Infrastructure/Queries/TrackQueries.cs
Normal file
@ -0,0 +1,78 @@
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
using SJZY.Track.Domain.Dtos.TrackDetails;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
|
||||
namespace SJZY.Track.Infrastructure.Queries;
|
||||
|
||||
public class TrackQueries : ISugarRepository, ITrackQueries,
|
||||
ITransientDependency
|
||||
{
|
||||
public ISqlSugarClient Context { get; set; }
|
||||
|
||||
public TrackQueries()
|
||||
{
|
||||
Context = SqlsugarScopeBasic.GetContextSafely("default");
|
||||
}
|
||||
|
||||
public async Task<List<OrderTemplateLinkDto>> GetOrderTemplateLinksAsync(int orderType,
|
||||
params string[] orderNumbers)
|
||||
{
|
||||
return await Context.Queryable<OrderEntity>()
|
||||
.LeftJoin<OrderTemplateEntity>((a, b) => a.Id == b.OrderId)
|
||||
.Where(a => a.OrderType == orderType && orderNumbers.Contains(a.OrderNo))
|
||||
.Select((a, b) => new OrderTemplateLinkDto
|
||||
{
|
||||
OrderNo = a.OrderNo,
|
||||
TemplateId = b.TrackTemplateId
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<OrderTemplateLinkDto>> GetOrderTemplateLinksAsync(int orderType, List<string> orderNumbers)
|
||||
{
|
||||
return await Context.Queryable<OrderEntity>()
|
||||
.LeftJoin<OrderTemplateEntity>((a, b) => a.Id == b.OrderId)
|
||||
.Where(a => a.OrderType == orderType && orderNumbers.Contains(a.OrderNo))
|
||||
.Select((a, b) => new OrderTemplateLinkDto
|
||||
{
|
||||
OrderNo = a.OrderNo,
|
||||
TemplateId = b.TrackTemplateId
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<OrderedTrackCodeDto>> GetOrderedTrackCodesAsync(List<int> templateIds)
|
||||
{
|
||||
return await Context.Queryable<TrackTemplateContentEntity>()
|
||||
.LeftJoin<TrackContentEntity>((a, b) => a.TrackContentId == b.Id)
|
||||
.Where(a => templateIds.Contains(a.TrackTemplateId))
|
||||
.OrderBy(a => a.Sort)
|
||||
.Select((a, b) => new OrderedTrackCodeDto
|
||||
{
|
||||
TemplateId = a.Id,
|
||||
Code = b.Code
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<MatchTrackContentDto?> MatchTrackContentAsync(int orderId, string code)
|
||||
{
|
||||
return await Context.Queryable<OrderTemplateEntity>()
|
||||
.LeftJoin<TrackTemplateContentEntity>((x, a) => x.TrackTemplateId == a.TrackTemplateId)
|
||||
.LeftJoin<TrackContentEntity>((x, a, b) => a.TrackContentId == b.Id)
|
||||
.LeftJoin<TrackStatusEntity>((x, a, b, c) => b.TrackStatusId == c.Id)
|
||||
.Where((x, a, b) => x.OrderId == orderId && b.Code == code)
|
||||
.Select((x, a, b, c) => new MatchTrackContentDto
|
||||
{
|
||||
Content = b.Content,
|
||||
EnContent = b.EnContent,
|
||||
Status = c.Status
|
||||
})
|
||||
.FirstAsync();
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,10 @@
|
||||
using System.Linq.Expressions;
|
||||
using SJZY.Track.Domain;
|
||||
using SJZY.Track.Domain.SeedWork;
|
||||
using SJZY.Track.Infrastructure.Queries;
|
||||
using Volo.Abp;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
namespace SJZY.Track.Infrastructure.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// 仓储基类实现
|
||||
@ -32,7 +33,7 @@ public class BasicRepository<T> : BasicQuery<T>, IBasicRepository<T> where T : c
|
||||
.ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateRangeAsync(List<T> entities, Expression<Func<T, object>> columns = null)
|
||||
public async Task<bool> UpdateRangeAsync(List<T> entities, Expression<Func<T, object>>? columns = null)
|
||||
{
|
||||
return await Context.Updateable(entities)
|
||||
.UpdateColumnsIF(columns != null, columns)
|
||||
@ -2,7 +2,7 @@
|
||||
using SJZY.Track.Domain.Aggregates.DemoAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Demo;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
namespace SJZY.Track.Infrastructure.Repositories;
|
||||
|
||||
public class DemoRepository : BasicRepository<DemoEntity>, IDemoRepository, IScopedDependency
|
||||
{
|
||||
132
src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs
Normal file
132
src/SJZY.Track.Infrastructure/Repositories/OrderRepository.cs
Normal file
@ -0,0 +1,132 @@
|
||||
using Nest;
|
||||
using SJZY.Track.Domain;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
using SJZY.Track.Domain.VEntities;
|
||||
using SJZY.Track.Repository.VData.Entitys;
|
||||
|
||||
namespace SJZY.Track.Infrastructure.Repositories;
|
||||
|
||||
public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, ITransientDependency
|
||||
{
|
||||
public async Task<bool> CreateOrderAsync(OrderEntity order)
|
||||
{
|
||||
return await Context.InsertNav(order)
|
||||
.Include(x => x.OrderFlights)
|
||||
.Include(x => x.OrderTemplates)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task LinkOrderAsync(List<OrderLinkEntity> orderLinkEntities)
|
||||
{
|
||||
await Context.Insertable(orderLinkEntities).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task UnLinkByIdsAsync(List<int> linkIds)
|
||||
{
|
||||
await Context.Deleteable(linkIds).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task UpdateOrderAsync(OrderEntity order)
|
||||
{
|
||||
using var tran = TransactionHelper.GetReadCommitted();
|
||||
|
||||
// 更新订单主表
|
||||
await UpdateAsync(order, x => new { x.CustomId, x.SubSystemId });
|
||||
|
||||
// 更新订单模板
|
||||
await Context.Deleteable<OrderTemplateEntity>().Where(x => x.OrderId == order.Id).ExecuteCommandAsync();
|
||||
order.OrderTemplates.ForEach(x => x.OrderId = order.Id);
|
||||
await Context.Insertable(order.OrderTemplates).ExecuteCommandAsync();
|
||||
|
||||
// 更新订单航班
|
||||
await Context.Deleteable<OrderFlightEntity>().Where(x => x.OrderId == order.Id).ExecuteCommandAsync();
|
||||
order.OrderFlights.ForEach(x => x.OrderId = order.Id);
|
||||
await Context.Insertable(order.OrderFlights).ExecuteCommandAsync();
|
||||
|
||||
tran.Complete();
|
||||
}
|
||||
|
||||
public async Task DeleteOrderAsync(int orderId)
|
||||
{
|
||||
using var tran = TransactionHelper.GetReadCommitted();
|
||||
|
||||
// 软删订单主表
|
||||
await SoftDeleteAsync(x => x.Id == orderId);
|
||||
|
||||
// 软删订单模板
|
||||
// 软删订单航班
|
||||
// 软删订单关联关系
|
||||
|
||||
tran.Complete();
|
||||
}
|
||||
|
||||
#region 轨迹订单明细
|
||||
|
||||
/// <summary>
|
||||
/// 根据轨迹订单id获取轨迹明细列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<TrackOrderDetailVO>> GetOrderDetails(GetOrderDetailsInputVO input)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 轨迹订单分页
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页的轨迹订单
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<UnifyPageResultDto<TrackOrderVO>> GetPageTrackOrder(GetPageTrackOrderInputVO input)
|
||||
{
|
||||
var pageList = await Context.Queryable<OrderEntity>()
|
||||
.LeftJoin<VExternalSubjectEntity>((a, b) => a.CustomId==b.Id)
|
||||
.LeftJoin<VSystemEntity>((a, b, c) => a.SubSystemId==c.Id)
|
||||
.Select((a, b, c) => new TrackOrderVO
|
||||
{
|
||||
Id = a.Id,
|
||||
OrderNumber= a.OrderNo,
|
||||
OrderType = a.OrderType,
|
||||
CustomerShortName= b.Abbreviation,
|
||||
CustomerCode= b.Code,
|
||||
TrackTemplateNames = "",
|
||||
OrderDetails="",
|
||||
NewestTrackContent= a.LatestTrackContent,
|
||||
NewestTrackEnContent= a.LatestTrackEnContent,
|
||||
NewestTrackPlace= a.LatestTrackPlace,
|
||||
IsFinish=a.IsCompleted,
|
||||
CreateTime=a.CreateTime,
|
||||
SubSystem= c.CnName
|
||||
})
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
|
||||
if (pageList.List.Any())
|
||||
{
|
||||
var orderIds = pageList.List.Select(a => a.Id);
|
||||
//查询轨迹模版
|
||||
|
||||
|
||||
var trackTemplateList = await Context.Queryable<OrderTemplateEntity>()
|
||||
.LeftJoin<TrackTemplateEntity>((a, b) => a.TrackTemplateId==b.Id)
|
||||
.Where((a, b) => orderIds.Contains(a.OrderId))
|
||||
.Select((a, b) => new { OrderId = a.OrderId, Name = b.Name })
|
||||
.ToListAsync();
|
||||
|
||||
pageList.List.ForEach(a =>
|
||||
{
|
||||
var templateListOfOrderId = trackTemplateList.Where(b => b.OrderId== a.Id);
|
||||
a.TrackTemplateNames = templateListOfOrderId.Select(c => c.Name).JoinAsString(",");
|
||||
});
|
||||
}
|
||||
|
||||
return pageList;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@ -2,10 +2,9 @@
|
||||
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||
using SJZY.Track.Domain.VEntities;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
namespace SJZY.Track.Infrastructure.Repositories;
|
||||
|
||||
public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrackContentRepository, IScopedDependency
|
||||
{
|
||||
@ -25,7 +24,7 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
||||
var detail = await Context.Queryable<TrackContentEntity>()
|
||||
.LeftJoin<TrackStatusEntity>((a, b) => a.TrackStatusId==b.Id)
|
||||
.LeftJoin<TrackFlagEntity>((a, b, c) => a.TrackFlagId==c.Id)
|
||||
.LeftJoin<VSystemEntity>((a, b, c, d) => a.SubSystemId == b.Id)
|
||||
.LeftJoin<VSystemEntity>((a, b, c, d) => a.SubSystemId == d.Id)
|
||||
.Where((a, b, c, d) => a.Id == id)
|
||||
.Select((a, b, c, d) => new GetTrackContentDetailVO
|
||||
{
|
||||
@ -1,35 +1,56 @@
|
||||
using Nest;
|
||||
using SJZY.Expand.ABP.Core.Logger;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.Expand.ElasticSearch.Services;
|
||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackDetails;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
namespace SJZY.Track.Infrastructure.Repositories;
|
||||
|
||||
internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetailsIndex>, ITrackDetailsRepository,
|
||||
ITransientDependency
|
||||
{
|
||||
public string IndexName => $"{TrackDetailsIndex.IndexName}-{DateTime.Now:yyyy.MM.dd}";
|
||||
|
||||
public TrackDetailsRepository(ConnectionFactory connectionFactory) : base(connectionFactory)
|
||||
{
|
||||
}
|
||||
|
||||
public async Task WriteTrack(TrackDetailsIndex index)
|
||||
public async Task<TrackDetailsIndex?> GetFirstOrDefaultAsync(int orderId, string trackCode)
|
||||
{
|
||||
try
|
||||
var r = await Context.SearchAsync<TrackDetailsIndex>(s => s
|
||||
.Index($"{TrackDetailsIndex.IndexName}-{DateTime.Now:yyyy.MM.dd}")
|
||||
.Query(q =>
|
||||
q.Term(t => t.Field(f => f.OrderId).Value(orderId))
|
||||
&& q.Term(t => t.Field(f => f.TrackCode).Value(trackCode))
|
||||
)
|
||||
);
|
||||
|
||||
if (r.IsValid)
|
||||
{
|
||||
//await Context.IndexDocumentAsync(idx);
|
||||
var response = await Context.IndexAsync(index,
|
||||
request => request.Index($"{TrackDetailsIndex.IndexName}-{DateTime.Now:yyyy.MM.dd}"));
|
||||
if (!response.IsValid) LogHelper.Error("数据添加失败,原因:" + response.DebugInformation);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogHelper.Error($"日志插入ES失败:{ex.Message}。{index.ToJson()}");
|
||||
return r.Documents.FirstOrDefault();
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
public async Task<List<TrackDetailsIndex>> GetListAsync(List<string> orderNos)
|
||||
public async Task UpdateAsync(TrackDetailsIndex index)
|
||||
{
|
||||
var response = await Context.UpdateAsync<TrackDetailsIndex>(index.Id, u => u
|
||||
.Index(IndexName)
|
||||
.Doc(index)
|
||||
//.Refresh(Refresh.True) // 可选:立即刷新索引使更改立即可见
|
||||
);
|
||||
if (!response.IsValid)
|
||||
throw new Exception($"数据修改失败,原因:{response.DebugInformation}");
|
||||
}
|
||||
|
||||
public async Task CreateAsync(TrackDetailsIndex index)
|
||||
{
|
||||
var response = await Context.IndexAsync(index, request => request.Index(IndexName));
|
||||
if (!response.IsValid)
|
||||
throw new Exception($"数据添加失败,原因:{response.DebugInformation}");
|
||||
}
|
||||
|
||||
public async Task<List<TrackDetailsIndex>> GetListAsync(int orderType, List<string> orderNos)
|
||||
{
|
||||
if (orderNos.Count < 1) return new List<TrackDetailsIndex>();
|
||||
|
||||
@ -42,9 +63,11 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
||||
.Field(f => f.TrackTime)
|
||||
.Field(f => f.TraceTimeZone)
|
||||
))
|
||||
.Query(q => q.Terms(t => t
|
||||
.Field(f => f.OrderNo)
|
||||
.Terms(orderNos)))
|
||||
.Query(q =>
|
||||
q.Terms(t => t
|
||||
.Field(f => f.OrderNo)
|
||||
.Terms(orderNos))
|
||||
&& q.Term(f => f.OrderType, orderType))
|
||||
);
|
||||
|
||||
return data.Documents.ToList();
|
||||
@ -1,10 +1,8 @@
|
||||
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackFlags;
|
||||
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||
using SJZY.Track.Domain.VEntities;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
namespace SJZY.Track.Infrastructure.Repositories;
|
||||
|
||||
public class TrackFlagRepository : BasicRepository<TrackFlagEntity>, ITrackFlagRepository, IScopedDependency
|
||||
{
|
||||
@ -1,11 +1,12 @@
|
||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||
using System.Linq.Expressions;
|
||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Common;
|
||||
using SJZY.Track.Domain.Dtos.TrackPull;
|
||||
using SJZY.Track.Domain.VEntities;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
namespace SJZY.Track.Infrastructure.Repositories;
|
||||
|
||||
public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>, ITrackPullConfigRepository,
|
||||
IScopedDependency
|
||||
@ -83,4 +84,50 @@ public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>,
|
||||
}, true)
|
||||
.SingleAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> InsertParamsAsync(TrackPushPullParamsConfigEntity insertObj)
|
||||
{
|
||||
return await Context.Insertable(insertObj).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
|
||||
public async Task<bool> InsertContentRangeAsync(List<TrackPullContentConfigEntity> insertObjs)
|
||||
{
|
||||
return await Context.Insertable(insertObjs).ExecuteCommandAsync() > 0;
|
||||
}
|
||||
|
||||
public async Task<TrackPushPullParamsConfigEntity> GetParamsSingleAsync(Expression<Func<TrackPushPullParamsConfigEntity, bool>> whereExpression)
|
||||
{
|
||||
return await Context.Queryable<TrackPushPullParamsConfigEntity>().SingleAsync(whereExpression);
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateParamsAsync(TrackPushPullParamsConfigEntity updateObj)
|
||||
{
|
||||
return await Context.Updateable(updateObj).ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> SoftDeleteContentAsync(Expression<Func<TrackPullContentConfigEntity, bool>> whereExpression)
|
||||
{
|
||||
return await Context.Updateable<TrackPullContentConfigEntity>()
|
||||
.Where(whereExpression)
|
||||
.SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true)
|
||||
.ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> SoftDeleteParamsAsync(Expression<Func<TrackPushPullParamsConfigEntity, bool>> whereExpression)
|
||||
{
|
||||
return await Context.Updateable<TrackPushPullParamsConfigEntity>()
|
||||
.Where(whereExpression)
|
||||
.SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true)
|
||||
.ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
public async Task<TrackPullContentConfigEntity> GetContentByIdAsync(int id)
|
||||
{
|
||||
return await Context.Queryable<TrackPullContentConfigEntity>().InSingleAsync(id);
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateContentAsync(TrackPullContentConfigEntity updateObj)
|
||||
{
|
||||
return await Context.Updateable(updateObj).ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Common;
|
||||
using SJZY.Track.Domain.Dtos.TrackPush;
|
||||
using SJZY.Track.Domain.VEntities;
|
||||
using SJZY.Track.Repository.VData.Entitys;
|
||||
|
||||
namespace SJZY.Track.Infrastructure.Repositories;
|
||||
|
||||
public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>, ITrackPushConfigRepository,
|
||||
IScopedDependency
|
||||
{
|
||||
public async Task<UnifyPageResultDto<GetTrackPushConfigPageOutputVO>> GetPageAsync(KeywordsInputVO input)
|
||||
{
|
||||
return await AsQueryable()
|
||||
.LeftJoin<VSystemEntity>((trackPush, system) => trackPush.SubSystemId == system.Id && !system.IsDeleted)
|
||||
.LeftJoin<VExternalSubjectEntity>((trackPush, system, externalSubject) => trackPush.CustomId == externalSubject.Id && !externalSubject.IsDeleted)
|
||||
.LeftJoin<TrackTemplateEntity>((trackPush, system, externalSubject, template) => SqlFunc.SplitIn(trackPush.TrackTemplateId, template.Id.ToString()) && !template.IsDeleted)
|
||||
.Filter(null, true)
|
||||
.Where(trackPush => !trackPush.IsDeleted)
|
||||
.WhereIF(input.SubSystemId.HasValue, trackPush => trackPush.SubSystemId == input.SubSystemId)
|
||||
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (trackPush, system, externalSubject, template) => externalSubject.Abbreviation.Contains(input.Keywords) || externalSubject.Name.Contains(input.Keywords) || template.Name.Contains(input.Keywords))
|
||||
.OrderByDescending(trackPush => trackPush.CreateTime)
|
||||
.Select((trackPush, system, externalSubject, template) => new GetTrackPushConfigPageOutputVO
|
||||
{
|
||||
Id = trackPush.Id,
|
||||
SubSystem = system.CnName,
|
||||
CustomName = externalSubject.Abbreviation,
|
||||
TrackTemplate = SqlFunc.Subqueryable<TrackTemplateEntity>()
|
||||
.Where(template => SqlFunc.SplitIn(trackPush.TrackTemplateId, template.Id.ToString()) && !template.IsDeleted)
|
||||
.SelectStringJoin(template => template.Name, ","),
|
||||
CreateTime = trackPush.CreateTime
|
||||
})
|
||||
.Distinct()
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
}
|
||||
|
||||
public async Task<UnifyPageResultDto<GetTrackPushContentPageOutputVO>> GetContentPageAsync(GetTrackPushContentPageInputVO input)
|
||||
{
|
||||
return await Context.Queryable<TrackPushContentConfigEntity>()
|
||||
.InnerJoin<TrackContentEntity>((pushContent, trackContent) => pushContent.TrackContentId == trackContent.Id)
|
||||
.Where(pushContent => pushContent.TrackPushConfigId == input.TrackPushConfigId)
|
||||
.OrderBy((pushContent, trackContent) => pushContent.Sort)
|
||||
.Select((pushContent, trackContent) => new GetTrackPushContentPageOutputVO
|
||||
{
|
||||
Id = pushContent.Id,
|
||||
Sort = pushContent.Sort
|
||||
}, true)
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
}
|
||||
|
||||
public async Task<GetTrackPushConfigDetailOutputVO> GetDetailAsync(int id)
|
||||
{
|
||||
return await AsQueryable()
|
||||
.LeftJoin<VSystemEntity>((trackPush, system) => trackPush.SubSystemId == system.Id && !system.IsDeleted)
|
||||
.LeftJoin<VExternalSubjectEntity>((trackPush, system, externalSubject) => trackPush.CustomId == externalSubject.Id && !externalSubject.IsDeleted)
|
||||
.LeftJoin<VServiceProviderEntity>((trackPush, system, externalSubject, service) => trackPush.ServiceProviderId == service.Id && !service.IsDeleted)
|
||||
.InnerJoin<TrackPushPullParamsConfigEntity>((trackPush, system, externalSubject, service, paramsConfig) => trackPush.Id == paramsConfig.PullOrPushConfigId && paramsConfig.IsPush && !paramsConfig.IsDeleted)
|
||||
.Filter(null, true)
|
||||
.Where(trackPush => trackPush.Id == id && !trackPush.IsDeleted)
|
||||
.Select((trackPush, system, externalSubject, service, paramsConfig) => new GetTrackPushConfigDetailOutputVO
|
||||
{
|
||||
Id = trackPush.Id,
|
||||
SubSystem = system.CnName,
|
||||
CustomName = externalSubject.Abbreviation,
|
||||
ServiceProvider = service.Name,
|
||||
}, true)
|
||||
.SingleAsync();
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@ using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||
using SJZY.Track.Domain.VEntities;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
namespace SJZY.Track.Infrastructure.Repositories;
|
||||
|
||||
public class TrackStatusRepository : BasicRepository<TrackStatusEntity>, ITrackStatusRepository, IScopedDependency
|
||||
{
|
||||
@ -5,29 +5,13 @@ using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
using SJZY.Track.Domain.Enums;
|
||||
using SJZY.Track.Domain.VEntities;
|
||||
using SJZY.Track.Repository.Enum;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
namespace SJZY.Track.Infrastructure.Repositories;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITrackTemplateRepository, IScopedDependency
|
||||
{
|
||||
public async Task<List<TemplateContentOrderlyDto>> GetTemplateContentOrderlyAsync(List<int> distinctTemplateIds)
|
||||
{
|
||||
return await Context.Queryable<TrackTemplateEntity>()
|
||||
.LeftJoin<TrackTemplateContentEntity>((a, b) => a.Id == b.TrackTemplateId)
|
||||
.LeftJoin<TrackContentEntity>((a, b, c) => b.TrackContentId == c.Id)
|
||||
.Where(a => distinctTemplateIds.Contains(a.Id))
|
||||
.OrderBy((a, b) => b.Sort)
|
||||
.Select((a, b, c) => new TemplateContentOrderlyDto
|
||||
{
|
||||
TemplateId = a.Id,
|
||||
Code = c.Code
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取轨迹模版明细
|
||||
/// </summary>
|
||||
@ -40,13 +24,13 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
.Where((a, b) => a.Id == id)
|
||||
.Select((a, b) => new
|
||||
GetTrackTemplateDetailVO
|
||||
{
|
||||
Id = a.Id,
|
||||
Code = a.Code,
|
||||
Name = a.Name,
|
||||
SubSystemId = a.SubSystemId,
|
||||
SubSystem = b.CnName
|
||||
}).FirstAsync();
|
||||
{
|
||||
Id = a.Id,
|
||||
Code = a.Code,
|
||||
Name = a.Name,
|
||||
SubSystemId = a.SubSystemId,
|
||||
SubSystem = b.CnName
|
||||
}).FirstAsync();
|
||||
|
||||
return detail;
|
||||
}
|
||||
@ -58,13 +42,14 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
/// <returns></returns>
|
||||
public async Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input)
|
||||
{
|
||||
UnifyPageResultDto<GetTrackTemplateListVO> pagedList = new UnifyPageResultDto<GetTrackTemplateListVO>();
|
||||
pagedList = await Context.Queryable<TrackTemplateEntity>()
|
||||
UnifyPageResultDto<GetTrackTemplateListVO> pagedList = await Context.Queryable<TrackTemplateEntity>()
|
||||
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
||||
.WhereIF(input.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId)
|
||||
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(),
|
||||
(a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords))
|
||||
.OrderByIF(input.TrackTemplateId > 0, (a, b) => SqlFunc.IIF(a.Id == input.TrackTemplateId, SqlFunc.DateAdd(SqlFunc.GetDate(), 1), a.CreateTime), OrderByType.Desc)
|
||||
.OrderByIF(input.TrackTemplateId > 0,
|
||||
(a, b) => SqlFunc.IIF(a.Id == input.TrackTemplateId, SqlFunc.DateAdd(SqlFunc.GetDate(), 1),
|
||||
a.CreateTime), OrderByType.Desc)
|
||||
.Select((a, b) => new GetTrackTemplateListVO
|
||||
{
|
||||
Id = a.Id,
|
||||
@ -167,4 +152,10 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
.SetColumns(nameof(ISoftDeleteBasicEntity.IsDeleted), true)
|
||||
.ExecuteCommandHasChangeAsync();
|
||||
}
|
||||
|
||||
public async Task<List<TrackTemplateContentEntity>> GetContentListAsync(
|
||||
Expression<Func<TrackTemplateContentEntity, bool>> whereExpression)
|
||||
{
|
||||
return await Context.Queryable<TrackTemplateContentEntity>().Where(whereExpression).ToListAsync();
|
||||
}
|
||||
}
|
||||
@ -17,8 +17,10 @@
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SJZY.LoggerCenter.HttpApi" Version="7.0.5" />
|
||||
<PackageReference Include="Volo.Abp.Autofac" Version="7.0.2" />
|
||||
<PackageReference Include="SJZY.LoggerCenter.HttpApi" Version="7.0.5"/>
|
||||
<PackageReference Include="Volo.Abp.Autofac" Version="7.0.2"/>
|
||||
<PackageReference Include="SJZY.UserCenter.HttpApi" Version="3.0.3-alpha8"/>
|
||||
<PackageReference Include="SJZY.Expand.CAP" Version="7.8.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@ -3,17 +3,20 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using SJZY.Expand.ABP.Core.SqlSugar.Options;
|
||||
using SJZY.Expand.ElasticSearch;
|
||||
using SJZY.Track.Domain;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
using SJZY.Track.Infrastructure.Queries;
|
||||
using SJZY.Track.Infrastructure.Repositories;
|
||||
using Volo.Abp.Autofac;
|
||||
using Volo.Abp.Modularity;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
namespace SJZY.Track.Infrastructure;
|
||||
|
||||
/// <summary>
|
||||
/// 仓储模块
|
||||
/// </summary>
|
||||
[DependsOn(typeof(AbpAutofacModule))]
|
||||
[DependsOn(typeof(SJZYTrackDomainModule))]
|
||||
public class SJZYTrackRepositoryModule : AbpModule
|
||||
public class SJZYTrackInfrastructureModule : AbpModule
|
||||
{
|
||||
public override void PreConfigureServices(ServiceConfigurationContext context)
|
||||
{
|
||||
@ -43,6 +46,7 @@ public class SJZYTrackRepositoryModule : AbpModule
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
||||
{
|
||||
context.Services.AddTransient(typeof(IBasicQuery<>), typeof(BasicQuery<>));
|
||||
@ -1,6 +1,6 @@
|
||||
using SJZY.Track.Domain.SeedWork;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackPushRecord.Entitys
|
||||
namespace SJZY.Track.Infrastructure.TrackPushRecord.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹推送记录
|
||||
@ -0,0 +1,8 @@
|
||||
using SJZY.Track.Infrastructure.TrackPushRecord.Entitys;
|
||||
|
||||
namespace SJZY.Track.Infrastructure.TrackPushRecord.Services
|
||||
{
|
||||
public interface ITrackPushRecordRepository : ISimpleClient<TrackPushRecordEntity>
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
using SJZY.Track.Infrastructure.Repositories;
|
||||
using SJZY.Track.Infrastructure.TrackPushRecord.Entitys;
|
||||
|
||||
namespace SJZY.Track.Infrastructure.TrackPushRecord.Services
|
||||
{
|
||||
public class TrackPushRecordRepository : BasicRepository<TrackPushRecordEntity>, ITrackPushRecordRepository, IScopedDependency
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
using SJZY.Track.Domain.SeedWork;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackPushRecordDetails.Entitys
|
||||
namespace SJZY.Track.Infrastructure.TrackPushRecordDetails.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹推送明细表
|
||||
@ -0,0 +1,8 @@
|
||||
using SJZY.Track.Infrastructure.TrackPushRecordDetails.Entitys;
|
||||
|
||||
namespace SJZY.Track.Infrastructure.TrackPushRecordDetails.Services
|
||||
{
|
||||
public interface ITrackPushRecordDetailsRepository : ISimpleClient<TrackPushRecordDetailsEntity>
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
using SJZY.Track.Infrastructure.Repositories;
|
||||
using SJZY.Track.Infrastructure.TrackPushRecordDetails.Entitys;
|
||||
|
||||
namespace SJZY.Track.Infrastructure.TrackPushRecordDetails.Services
|
||||
{
|
||||
public class TrackPushRecordDetailsRepository : BasicRepository<TrackPushRecordDetailsEntity>, ITrackPushRecordDetailsRepository, IScopedDependency
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
#pragma warning disable 1591
|
||||
namespace SJZY.Track.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// Sqlsugar 上下文对象
|
||||
/// </summary>
|
||||
public class DataBaseContext
|
||||
{
|
||||
|
||||
#region 审计属性自动赋值
|
||||
|
||||
public static void OnExcutingAction(object oldValue, DataFilterModel entityInfo)
|
||||
{
|
||||
//过滤掉 "v_" 开头的表
|
||||
if (entityInfo.EntityColumnInfo.DbTableName.StartsWith("v_", StringComparison.OrdinalIgnoreCase))
|
||||
throw new Exception("非法的操作,不允许编辑映射表");
|
||||
|
||||
//新增
|
||||
if (entityInfo.OperationType == DataFilterType.InsertByObject)
|
||||
{
|
||||
if (entityInfo.PropertyName == nameof(ICreateBaicEntity.CreateTime))
|
||||
entityInfo.SetValue(DateTime.Now);
|
||||
if (entityInfo.PropertyName == nameof(ICreateBaicEntity.CreateUserId))
|
||||
{
|
||||
//entityInfo.SetValue(CurrentUserRequest.CurrentUser.UserId);
|
||||
}
|
||||
}
|
||||
//修改
|
||||
else if (entityInfo.OperationType == DataFilterType.UpdateByObject)
|
||||
{
|
||||
if (entityInfo.PropertyName == nameof(IUpdateBasicEntity.UpdateTime))
|
||||
entityInfo.SetValue(DateTime.Now);
|
||||
else if (entityInfo.PropertyName == nameof(IUpdateBasicEntity.UpdateUserId))
|
||||
{
|
||||
//entityInfo.SetValue(CurrentUserRequest.CurrentUser.UserId);
|
||||
}
|
||||
//删除
|
||||
else if (entityInfo.PropertyName == nameof(IDeleteBasicEntity.IsDeleted))
|
||||
{
|
||||
var currentType = entityInfo.EntityValue.GetType();
|
||||
bool.TryParse(currentType.GetProperty(entityInfo.PropertyName)?.GetValue(entityInfo.EntityValue)?.ToString(), out bool isdelete);
|
||||
if (isdelete)
|
||||
{
|
||||
//currentType.GetProperty(nameof(IDeleteBasicEntity.DeleteUserId))?.SetValue(entityInfo.EntityValue, 5);
|
||||
currentType.GetProperty(nameof(IDeleteBasicEntity.DeleteTime))?.SetValue(entityInfo.EntityValue, DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 审计属性自动赋值
|
||||
}
|
||||
}
|
||||
@ -1,60 +0,0 @@
|
||||
using SJZY.Track.Domain;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
|
||||
public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, ITransientDependency
|
||||
{
|
||||
public async Task<bool> CreateOrderAsync(OrderEntity order)
|
||||
{
|
||||
return await Context.InsertNav(order)
|
||||
.Include(x => x.OrderFlights)
|
||||
.Include(x => x.OrderTemplates)
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task<List<OrderTemplateDto>> GetOrderTemplatesAsync(int orderType,
|
||||
List<string> distinctOrderNumbers)
|
||||
{
|
||||
return await AsQueryable()
|
||||
.LeftJoin<OrderTemplateEntity>((a, b) => a.Id == b.OrderId)
|
||||
.Where(a => a.OrderType == orderType && distinctOrderNumbers.Contains(a.OrderNo))
|
||||
.Select((a, b) => new OrderTemplateDto
|
||||
{
|
||||
OrderNo = a.OrderNo,
|
||||
TemplateId = b.TrackTemplateId
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task LinkOrderAsync(List<OrderLinkEntity> orderLinkEntities)
|
||||
{
|
||||
await Context.Insertable(orderLinkEntities).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task UnLinkByIdsAsync(List<int> linkIds)
|
||||
{
|
||||
await Context.Deleteable(linkIds).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
public async Task UpdateOrderAsync(OrderEntity order)
|
||||
{
|
||||
using var tran = TransactionHelper.GetReadCommitted();
|
||||
|
||||
// 更新订单主表
|
||||
await UpdateAsync(order, x => new { x.CustomId, x.SubSystemId });
|
||||
|
||||
// 更新订单模板
|
||||
await Context.Deleteable<OrderTemplateEntity>().Where(x => x.OrderId == order.Id).ExecuteCommandAsync();
|
||||
order.OrderTemplates.ForEach(x => x.OrderId = order.Id);
|
||||
await Context.Insertable(order.OrderTemplates).ExecuteCommandAsync();
|
||||
|
||||
// 更新订单航班
|
||||
await Context.Deleteable<OrderFlightEntity>().Where(x => x.OrderId == order.Id).ExecuteCommandAsync();
|
||||
order.OrderFlights.ForEach(x => x.OrderId = order.Id);
|
||||
await Context.Insertable(order.OrderFlights).ExecuteCommandAsync();
|
||||
|
||||
tran.Complete();
|
||||
}
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||
|
||||
namespace SJZY.Track.Repository;
|
||||
|
||||
public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>, ITrackPushConfigRepository,
|
||||
IScopedDependency
|
||||
{
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
using SJZY.Track.Repository.TrackPushRecord.Entitys;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackPushRecord.Services
|
||||
{
|
||||
public interface ITrackPushRecordRepository : ISimpleClient<TrackPushRecordEntity>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
using SJZY.Track.Repository.TrackPushRecord.Entitys;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackPushRecord.Services
|
||||
{
|
||||
public class TrackPushRecordRepository : BasicRepository<TrackPushRecordEntity>, ITrackPushRecordRepository, IScopedDependency
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
using SJZY.Track.Repository.TrackPushRecordDetails.Entitys;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackPushRecordDetails.Services
|
||||
{
|
||||
public interface ITrackPushRecordDetailsRepository : ISimpleClient<TrackPushRecordDetailsEntity>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
using SJZY.Track.Repository.TrackPushRecordDetails.Entitys;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackPushRecordDetails.Services
|
||||
{
|
||||
public class TrackPushRecordDetailsRepository : BasicRepository<TrackPushRecordDetailsEntity>, ITrackPushRecordDetailsRepository, IScopedDependency
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SJZY.Track.Api;
|
||||
using SJZY.Track.Application;
|
||||
using SJZY.Track.Repository;
|
||||
using SJZY.Track.Infrastructure;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.AspNetCore.TestBase;
|
||||
using Volo.Abp.Authorization;
|
||||
@ -19,7 +19,7 @@ namespace SJZY.Track.Test;
|
||||
typeof(AbpAspNetCoreTestBaseModule),
|
||||
typeof(AbpAutofacModule),
|
||||
typeof(AbpAuthorizationModule),
|
||||
typeof(SJZYTrackRepositoryModule),
|
||||
typeof(SJZYTrackInfrastructureModule),
|
||||
typeof(ApplicationModule),
|
||||
typeof(SJZYTrackApiModule),
|
||||
typeof(AbpHttpClientModule) //添加abp的http代理模块
|
||||
|
||||
Loading…
Reference in New Issue
Block a user