examples
This commit is contained in:
parent
c5e8d65906
commit
e6d52a3894
@ -26,4 +26,8 @@
|
||||
<ProjectReference Include="..\SJZY.Track.Domain\SJZY.Track.Domain.csproj" />
|
||||
<ProjectReference Include="..\SJZY.Track.HttpApi\SJZY.Track.HttpApi.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Services\TrackMap\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using SJZY.Track.Domain.OrderAggregate;
|
||||
using SJZY.Track.Domain.TrackTemplateAggregate;
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain;
|
||||
using SJZY.Track.Repository.TrackDetails;
|
||||
|
||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
@ -60,6 +61,15 @@ public class TrackQueryService : ApplicationService
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task CreateOrder()
|
||||
{
|
||||
using var tran = TransactionHelper.GetReadCommitted();
|
||||
await _orderRepository.InsertAsync(new OrderEntity());
|
||||
await _orderRepository.CreateOrderTemplateAsync(new OrderTemplateEntity());
|
||||
|
||||
tran.Complete();
|
||||
}
|
||||
|
||||
private void TrackDetailSort(GetTrackOutput item, SortMethod sortMethod)
|
||||
{
|
||||
switch (sortMethod)
|
||||
|
||||
@ -10,4 +10,11 @@ public interface IOrderRepository : IBasicRepository<OrderEntity>
|
||||
/// <param name="distinctOrderNumbers"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<OrderTemplateDto>> GetOrderTemplatesAsync(List<string> distinctOrderNumbers);
|
||||
|
||||
/// <summary>
|
||||
/// 创建订单模板
|
||||
/// </summary>
|
||||
/// <param name="templateEntity"></param>
|
||||
/// <returns></returns>
|
||||
Task CreateOrderTemplateAsync(OrderTemplateEntity templateEntity);
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
namespace SJZY.Track.Domain.TrackPullAggregate;
|
||||
|
||||
public interface ITrackPullConfigRepository : IBasicRepository<TrackPullConfigEntity>
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
namespace SJZY.Track.Domain.TrackPullAggregate;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹拉取配置表
|
||||
/// </summary>
|
||||
[SugarTable("t_track_pull_config")]
|
||||
public class TrackPullConfigEntity : IFullAuditedBasicEntitys
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 自增主键
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 解析方式,1取接口通返参映射后的,2取服务商原返参
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "ParseMethod")]
|
||||
public int ParseMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商拉取频率(分钟)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "PullInterval")]
|
||||
public int PullInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "ServiceProviderId")]
|
||||
public int ServiceProviderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "SubSystemId")]
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackTemplateId")]
|
||||
public int TrackTemplateId { get; set; }
|
||||
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
namespace SJZY.Track.Domain.TrackPullAggregate;
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹拉取内容配置表
|
||||
/// </summary>
|
||||
[SugarTable("t_track_pull_content_config")]
|
||||
public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 自增主键
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹代码参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentCodeValue")]
|
||||
public string TrackContentCodeValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentId")]
|
||||
public int TrackContentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹内容参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentValue")]
|
||||
public string TrackContentValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(正向),多个逗分隔
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackKeyword")]
|
||||
public string TrackKeyword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(反向),多个逗分隔
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackKeywordReverse")]
|
||||
public string TrackKeywordReverse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数值(主数据枚举)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackPlaceValue")]
|
||||
public int? TrackPlaceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹拉取配置id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackPullConfigId")]
|
||||
public int TrackPullConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackStatusValue")]
|
||||
public string TrackStatusValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区GMT
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackTimeZone")]
|
||||
public string TrackTimeZone { get; set; }
|
||||
|
||||
}
|
||||
17
src/SJZY.Track.Domain/TransactionHelper.cs
Normal file
17
src/SJZY.Track.Domain/TransactionHelper.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System.Transactions;
|
||||
|
||||
namespace SJZY.Track.Domain;
|
||||
|
||||
public class TransactionHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取读已提交级别的事务,记得要释放
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static TransactionScope GetReadCommitted()
|
||||
{
|
||||
return new TransactionScope(TransactionScopeOption.Required,
|
||||
new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted },
|
||||
TransactionScopeAsyncFlowOption.Enabled);
|
||||
}
|
||||
}
|
||||
@ -13,4 +13,9 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
.Select<OrderTemplateDto>()
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task CreateOrderTemplateAsync(OrderTemplateEntity templateEntity)
|
||||
{
|
||||
await Context.Insertable(templateEntity).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
@ -27,8 +27,6 @@
|
||||
<Folder Include="TrackContentMap\ValueObjects\" />
|
||||
<Folder Include="TrackContent\ValueObjects\" />
|
||||
<Folder Include="TrackFlag\ValueObjects\" />
|
||||
<Folder Include="TrackPullConfig\ValueObjects\" />
|
||||
<Folder Include="TrackPullContentConfig\ValueObjects\" />
|
||||
<Folder Include="TrackPushConfig\ValueObjects\" />
|
||||
<Folder Include="TrackPushContentConfig\ValueObjects\" />
|
||||
<Folder Include="TrackPushPullParamsConfig\ValueObjects\" />
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
namespace SJZY.Track.Repository.TrackPullConfig.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹拉取配置表
|
||||
/// </summary>
|
||||
[SugarTable("t_track_pull_config")]
|
||||
public class TrackPullConfigEntity : IFullAuditedBasicEntitys
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 自增主键
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 解析方式,1取接口通返参映射后的,2取服务商原返参
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "ParseMethod")]
|
||||
public int ParseMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商拉取频率(分钟)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "PullInterval")]
|
||||
public int PullInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "ServiceProviderId")]
|
||||
public int ServiceProviderId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "SubSystemId")]
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackTemplateId")]
|
||||
public int TrackTemplateId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
using SJZY.Track.Repository.TrackPullConfig.Entitys;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackPullConfig.Services
|
||||
{
|
||||
public interface ITrackPullConfigRepository : ISimpleClient<TrackPullConfigEntity>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
using SJZY.Track.Repository.TrackPullConfig.Entitys;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackPullConfig.Services
|
||||
{
|
||||
public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>, ITrackPullConfigRepository, IScopedDependency
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
9
src/SJZY.Track.Repository/TrackPullConfigRepository.cs
Normal file
9
src/SJZY.Track.Repository/TrackPullConfigRepository.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using SJZY.Track.Domain.TrackPullAggregate;
|
||||
|
||||
namespace SJZY.Track.Repository
|
||||
{
|
||||
public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>, ITrackPullConfigRepository, IScopedDependency
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
namespace SJZY.Track.Repository.TrackPullContentConfig.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 轨迹拉取内容配置表
|
||||
/// </summary>
|
||||
[SugarTable("t_track_pull_content_config")]
|
||||
public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 自增主键
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹代码参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentCodeValue")]
|
||||
public string TrackContentCodeValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentId")]
|
||||
public int TrackContentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹内容参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackContentValue")]
|
||||
public string TrackContentValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(正向),多个逗分隔
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackKeyword")]
|
||||
public string TrackKeyword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹关键词(反向),多个逗分隔
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackKeywordReverse")]
|
||||
public string TrackKeywordReverse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹发生地参数值(主数据枚举)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackPlaceValue")]
|
||||
public int? TrackPlaceValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹拉取配置id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackPullConfigId")]
|
||||
public int TrackPullConfigId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务商轨迹状态参数值
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackStatusValue")]
|
||||
public string TrackStatusValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹时区GMT
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "TrackTimeZone")]
|
||||
public string TrackTimeZone { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
using SJZY.Track.Repository.TrackPullContentConfig.Entitys;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackPullContentConfig.Services
|
||||
{
|
||||
public interface ITrackPullContentConfigRepository : ISimpleClient<TrackPullContentConfigEntity>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
using SJZY.Track.Repository.TrackPullContentConfig.Entitys;
|
||||
|
||||
namespace SJZY.Track.Repository.TrackPullContentConfig.Services
|
||||
{
|
||||
public class TrackPullContentConfigRepository : BasicRepository<TrackPullContentConfigEntity>, ITrackPullContentConfigRepository, IScopedDependency
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user