change 结构调整
This commit is contained in:
parent
752f65b1e2
commit
37e225e456
@ -19,14 +19,15 @@ using Volo.Abp.Json;
|
|||||||
using Volo.Abp.Modularity;
|
using Volo.Abp.Modularity;
|
||||||
|
|
||||||
[assembly: HostingStartup(typeof(HostingStartup))]
|
[assembly: HostingStartup(typeof(HostingStartup))]
|
||||||
|
|
||||||
namespace SJZY.Track.Api
|
namespace SJZY.Track.Api
|
||||||
{
|
{
|
||||||
[DependsOn(
|
[DependsOn(
|
||||||
typeof(AbpAutofacModule),
|
typeof(AbpAutofacModule),
|
||||||
typeof(SjzyAbpCodeModule),
|
typeof(SjzyAbpCodeModule),
|
||||||
typeof(ApplicationModule),
|
|
||||||
typeof(AbpAspNetCoreMvcModule),
|
typeof(AbpAspNetCoreMvcModule),
|
||||||
typeof(AbpAspNetCoreSerilogModule),
|
typeof(AbpAspNetCoreSerilogModule),
|
||||||
|
typeof(ApplicationModule),
|
||||||
typeof(SJZYTrackRepositoryModule)
|
typeof(SJZYTrackRepositoryModule)
|
||||||
)]
|
)]
|
||||||
public class SJZYTrackApiModule : AbpModule
|
public class SJZYTrackApiModule : AbpModule
|
||||||
@ -49,7 +50,9 @@ namespace SJZY.Track.Api
|
|||||||
//Json格式化全局处理
|
//Json格式化全局处理
|
||||||
context.Services.Configure<MvcNewtonsoftJsonOptions>(options =>
|
context.Services.Configure<MvcNewtonsoftJsonOptions>(options =>
|
||||||
{
|
{
|
||||||
options.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver();//.DefaultContractResolver();
|
options.SerializerSettings.ContractResolver =
|
||||||
|
new Newtonsoft.Json.Serialization.
|
||||||
|
CamelCasePropertyNamesContractResolver(); //.DefaultContractResolver();
|
||||||
options.SerializerSettings.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
|
options.SerializerSettings.Converters.Add(new DateTimeJsonConverter("yyyy-MM-dd HH:mm:ss"));
|
||||||
options.SerializerSettings.Converters.Add(new LongJsonConverter());
|
options.SerializerSettings.Converters.Add(new LongJsonConverter());
|
||||||
});
|
});
|
||||||
@ -59,7 +62,6 @@ namespace SJZY.Track.Api
|
|||||||
|
|
||||||
|
|
||||||
context.Services.AddRedis();
|
context.Services.AddRedis();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
||||||
@ -79,6 +81,7 @@ namespace SJZY.Track.Api
|
|||||||
app.UsePrometheus();
|
app.UsePrometheus();
|
||||||
|
|
||||||
#region 启动提示
|
#region 启动提示
|
||||||
|
|
||||||
Console.WriteLine($@"
|
Console.WriteLine($@"
|
||||||
+-------------------------------------------------------+
|
+-------------------------------------------------------+
|
||||||
| |
|
| |
|
||||||
@ -89,8 +92,8 @@ namespace SJZY.Track.Api
|
|||||||
| |
|
| |
|
||||||
+-------------------------------------------------------+
|
+-------------------------------------------------------+
|
||||||
");
|
");
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using SJZY.Track.Application.Dtos.Demo;
|
using SJZY.Track.Application.Dtos.Demo;
|
||||||
using SJZY.Track.Domain.DemoAggregate;
|
using SJZY.Track.Domain.Aggregates.DemoAggregate;
|
||||||
using SJZY.Track.Domain.DemoAggregate.Dtos;
|
using SJZY.Track.Domain.Dtos.Demo;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.AutoMapper;
|
namespace SJZY.Track.Application.AutoMapper;
|
||||||
|
|
||||||
@ -12,7 +12,8 @@ internal class AutoMapperProfile : Profile
|
|||||||
CreateMap<UnifyPageResultDto<DemoEntity>, UnifyPageResultDto<GetDemoListByPageOutput>>(MemberList.None);
|
CreateMap<UnifyPageResultDto<DemoEntity>, UnifyPageResultDto<GetDemoListByPageOutput>>(MemberList.None);
|
||||||
|
|
||||||
CreateMap<GetDemoListByPageInput, DemoValueObject>(MemberList.None).ReverseMap();
|
CreateMap<GetDemoListByPageInput, DemoValueObject>(MemberList.None).ReverseMap();
|
||||||
CreateMap<UnifyPageResultDto<GetDemoListByPageInput>, UnifyPageResultDto<DemoValueObject>>(MemberList.None).ReverseMap();
|
CreateMap<UnifyPageResultDto<GetDemoListByPageInput>, UnifyPageResultDto<DemoValueObject>>(MemberList.None)
|
||||||
|
.ReverseMap();
|
||||||
/*
|
/*
|
||||||
代码说明:
|
代码说明:
|
||||||
MemberList.None的意思是,忽略源对象和目标对象的属性匹配检查,其他可选值:MemberList.Source(检查是否映射了所有源成员)、MemberList.Destination(检查是否映射了所有目标成员)
|
MemberList.None的意思是,忽略源对象和目标对象的属性匹配检查,其他可选值:MemberList.Source(检查是否映射了所有源成员)、MemberList.Destination(检查是否映射了所有目标成员)
|
||||||
@ -28,6 +29,5 @@ internal class AutoMapperProfile : Profile
|
|||||||
CreateMap<DemoEntity, DemoInput>(MemberList.None).ReverseMap();
|
CreateMap<DemoEntity, DemoInput>(MemberList.None).ReverseMap();
|
||||||
CreateMap<DemoEntity, GetDemoListByPageOutput>(MemberList.None);
|
CreateMap<DemoEntity, GetDemoListByPageOutput>(MemberList.None);
|
||||||
CreateMap<DemoEntity, DemoDetailSaveInput>(MemberList.None).ReverseMap();
|
CreateMap<DemoEntity, DemoDetailSaveInput>(MemberList.None).ReverseMap();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,10 +1,10 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
using SJZY.Track.Application.Dtos.TrackTemplates;
|
||||||
using SJZY.Track.Domain.TrackTemplateAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
using SJZY.Track.Domain.TrackTemplateAggregate.Dtos;
|
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.AutoMapper;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.AutoMapper
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹模版自动映射
|
/// 轨迹模版自动映射
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -19,4 +19,3 @@ namespace SJZY.Track.Application.AutoMapper
|
|||||||
CreateMap<EditTrackTemplateContentInput, TrackTemplateContentEntity>(MemberList.None);
|
CreateMap<EditTrackTemplateContentInput, TrackTemplateContentEntity>(MemberList.None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||||
|
|
||||||
@ -22,7 +23,6 @@ public class CreateOrderInput
|
|||||||
public OrderDetails Details { get; set; }
|
public OrderDetails Details { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class OrderTemplateInfo
|
public class OrderTemplateInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -1,26 +1,15 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||||
|
|
||||||
public class LinkOrderInput
|
public class LinkOrderInput
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// false解绑,true关联,必填
|
||||||
|
/// </summary>
|
||||||
|
public bool IsLink { get; set; }
|
||||||
|
|
||||||
public NoInfo NoInfo { get; set; }
|
public NoInfo NoInfo { get; set; }
|
||||||
|
|
||||||
public List<NoInfo> LinkedOrderInfos { get; set; }
|
public List<NoInfo> LinkedOrderInfos { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class NoInfo
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 订单类型
|
|
||||||
/// </summary>
|
|
||||||
public int NoType { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 订单号
|
|
||||||
/// </summary>
|
|
||||||
[Required]
|
|
||||||
[MaxLength(100)]
|
|
||||||
public string OrderNo { get; set; }
|
|
||||||
}
|
|
||||||
@ -1,10 +1,10 @@
|
|||||||
using SJZY.Expand.ABP.Core.Common;
|
using SJZY.Expand.ABP.Core.Common;
|
||||||
using SJZY.Track.Application.Dtos.Demo;
|
using SJZY.Track.Application.Dtos.Demo;
|
||||||
using SJZY.Track.Domain.DemoAggregate;
|
using SJZY.Track.Domain.Aggregates.DemoAggregate;
|
||||||
using SJZY.Track.Domain.DemoAggregate.Dtos;
|
using SJZY.Track.Domain.Dtos.Demo;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Application.Services.Demo;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.Demo
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 接口请求完整样例
|
/// 接口请求完整样例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -12,14 +12,18 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
public class InterFaceDemoService : ApplicationService
|
public class InterFaceDemoService : ApplicationService
|
||||||
{
|
{
|
||||||
#region 构造函数
|
#region 构造函数
|
||||||
|
|
||||||
private readonly IDemoRepository _demoRepository;
|
private readonly IDemoRepository _demoRepository;
|
||||||
|
|
||||||
public InterFaceDemoService(IDemoRepository demoRepository)
|
public InterFaceDemoService(IDemoRepository demoRepository)
|
||||||
{
|
{
|
||||||
_demoRepository = demoRepository;
|
_demoRepository = demoRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 增删改
|
#region 增删改
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 增删改
|
/// 增删改
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -37,7 +41,6 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
}
|
}
|
||||||
else if (input.Option == OptionType.修改 || input.Option == OptionType.删除)
|
else if (input.Option == OptionType.修改 || input.Option == OptionType.删除)
|
||||||
{
|
{
|
||||||
|
|
||||||
var demoInfo = await _demoRepository.GetById1(input.Id);
|
var demoInfo = await _demoRepository.GetById1(input.Id);
|
||||||
if (demoInfo == null)
|
if (demoInfo == null)
|
||||||
{
|
{
|
||||||
@ -60,12 +63,14 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
await _demoRepository.UpdateAsync(entity);
|
await _demoRepository.UpdateAsync(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 局部更新最佳实践
|
#region 局部更新最佳实践
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 局部更新最佳实践
|
/// 局部更新最佳实践
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -87,9 +92,11 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
|
|
||||||
return new IdBaseDto() { Id = input.Id };
|
return new IdBaseDto() { Id = input.Id };
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 分页查询接口
|
#region 分页查询接口
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 分页查询
|
/// 分页查询
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -105,9 +112,11 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 入参转换
|
#region 入参转换
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 入参转换
|
/// 入参转换
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -122,6 +131,7 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
var res = ObjectMapper.Map<List<DemoEntity>, List<GetDemoListByPageOutput>>(list);
|
var res = ObjectMapper.Map<List<DemoEntity>, List<GetDemoListByPageOutput>>(list);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 原生sql
|
#region 原生sql
|
||||||
@ -141,6 +151,7 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 自定义返回结果格式
|
#region 自定义返回结果格式
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自定义返回结果格式
|
/// 自定义返回结果格式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -162,9 +173,11 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 约定类型下返回null
|
#region 约定类型下返回null
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 约定类型下返回null
|
/// 约定类型下返回null
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -176,9 +189,11 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
MyCustomerResultOutput res = null;
|
MyCustomerResultOutput res = null;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region
|
#region
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 没有返回值
|
/// 没有返回值
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -189,9 +204,11 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 主从关系实体存储
|
#region 主从关系实体存储
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 主从关系实体存储
|
/// 主从关系实体存储
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -209,6 +226,7 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 数据缓存
|
#region 数据缓存
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据缓存
|
/// 数据缓存
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -220,6 +238,7 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
var res = await _demoRepository.GetDataCache(input.Id);
|
var res = await _demoRepository.GetDataCache(input.Id);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//[HttpPost("InterFace/AAAA")]
|
//[HttpPost("InterFace/AAAA")]
|
||||||
@ -230,4 +249,3 @@ namespace SJZY.Track.Application.Services.Demo
|
|||||||
// return result;
|
// return result;
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||||
using SJZY.Track.Domain;
|
using SJZY.Track.Domain;
|
||||||
using SJZY.Track.Domain.OrderAggregate;
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
using SJZY.UserCenter.HttpApi.Services;
|
using SJZY.UserCenter.HttpApi.Services;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||||
@ -13,10 +13,12 @@ namespace SJZY.Track.Application.Services.ProvideServices;
|
|||||||
public class OrderService : ApplicationService
|
public class OrderService : ApplicationService
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
|
private readonly IBasicQuery<OrderLinkEntity> _orderLinkQuery;
|
||||||
|
|
||||||
public OrderService(IOrderRepository orderRepository)
|
public OrderService(IOrderRepository orderRepository, IBasicQuery<OrderLinkEntity> orderLinkQuery)
|
||||||
{
|
{
|
||||||
_orderRepository = orderRepository;
|
_orderRepository = orderRepository;
|
||||||
|
_orderLinkQuery = orderLinkQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -69,13 +71,23 @@ public class OrderService: ApplicationService
|
|||||||
[HttpPost("Order/Link")]
|
[HttpPost("Order/Link")]
|
||||||
public async Task<bool> LinkOrderAsync(LinkOrderInput input)
|
public async Task<bool> LinkOrderAsync(LinkOrderInput input)
|
||||||
{
|
{
|
||||||
// var distinctOrderNos = input.LinkedOrderInfos.Distinct().ToList();
|
//todo:去重
|
||||||
//
|
var distinctOrderInfos = input.LinkedOrderInfos.Distinct().ToList();
|
||||||
|
|
||||||
|
if (await _orderRepository.IsAnyAsync(x => x.IsEqual(input.NoInfo)))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
// var links = input.LinkedOrderInfos.Select(x => new OrderLinkEntity
|
// var links = input.LinkedOrderInfos.Select(x => new OrderLinkEntity
|
||||||
// {
|
// {
|
||||||
// LinkOrderId = x.,
|
// OrderNo = x.OrderNo,
|
||||||
// OrderId = 0
|
// OrderType = x.NoType
|
||||||
// })
|
// }).ToList();
|
||||||
|
//
|
||||||
|
// foreach (var link in links)
|
||||||
|
// {
|
||||||
|
// if (await _orderLinkQuery.IsAnyAsync(x => x.))
|
||||||
|
// }
|
||||||
// _orderRepository.LinkOrderAsync();
|
// _orderRepository.LinkOrderAsync();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||||
using SJZY.Track.Domain;
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
using SJZY.Track.Domain.OrderAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||||
using SJZY.Track.Domain.TrackTemplateAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
|
||||||
using SJZY.Track.Repository.TrackDetails;
|
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,9 @@
|
|||||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
using SJZY.Track.Domain.TrackStatusAggregate;
|
|
||||||
using SJZY.Track.Domain.TrackTemplateAggregate;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.TrackStatus
|
namespace SJZY.Track.Application.Services.TrackStatus;
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹状态
|
/// 轨迹状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -44,6 +37,7 @@ namespace SJZY.Track.Application.Services.TrackStatus
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region 私有方法
|
#region 私有方法
|
||||||
|
|
||||||
private async Task<UnifyResultDto> AddAsync(EditTrackStatusInput input)
|
private async Task<UnifyResultDto> AddAsync(EditTrackStatusInput input)
|
||||||
{
|
{
|
||||||
var entity = ObjectMapper.Map<EditTrackStatusInput, TrackStatusEntity>(input);
|
var entity = ObjectMapper.Map<EditTrackStatusInput, TrackStatusEntity>(input);
|
||||||
@ -67,6 +61,6 @@ namespace SJZY.Track.Application.Services.TrackStatus
|
|||||||
|
|
||||||
return new UnifyResultDto("200", "删除成功", isTrue);
|
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
using Microsoft.Extensions.Localization;
|
using System.Linq.Expressions;
|
||||||
|
using Microsoft.Extensions.Localization;
|
||||||
using SJZY.Expand.ABP.Core.Localization;
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
using SJZY.Track.Application.Dtos.TrackTemplates;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
using SJZY.Track.Domain.TrackTemplateAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
using SJZY.Track.Domain.TrackTemplateAggregate.Dtos;
|
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
using System.Linq.Expressions;
|
|
||||||
using Volo.Abp.DependencyInjection;
|
using Volo.Abp.DependencyInjection;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.TrackTemplates;
|
namespace SJZY.Track.Application.Services.TrackTemplates;
|
||||||
@ -113,7 +113,8 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("GetContentPage")]
|
[HttpPost("GetContentPage")]
|
||||||
public async Task<UnifyPageResultDto<GetTrackTemplateContentPageOutputVO>> GetContentPageAsync([FromBody] GetTrackTemplateContentPageInputVO input)
|
public async Task<UnifyPageResultDto<GetTrackTemplateContentPageOutputVO>> GetContentPageAsync(
|
||||||
|
[FromBody] GetTrackTemplateContentPageInputVO input)
|
||||||
{
|
{
|
||||||
return await _trackTemplateRepository.GetContentPageAsync(input);
|
return await _trackTemplateRepository.GetContentPageAsync(input);
|
||||||
}
|
}
|
||||||
@ -159,7 +160,8 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
|
|
||||||
case OptionTypeNoNull.修改:
|
case OptionTypeNoNull.修改:
|
||||||
|
|
||||||
var oldEntity = await _trackTemplateRepository.GetByIdAsync(input.Id!.Value) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
var oldEntity = await _trackTemplateRepository.GetByIdAsync(input.Id!.Value) ??
|
||||||
|
throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||||
|
|
||||||
ObjectMapper.Map(input, oldEntity);
|
ObjectMapper.Map(input, oldEntity);
|
||||||
|
|
||||||
@ -174,7 +176,8 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new BusinessException(message: _stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum, nameof(EditTrackTemplateContentInput.Options)]);
|
throw new BusinessException(message: _stringLocalizer[SjzyBasicLocalization.Validation_IsInEnum,
|
||||||
|
nameof(EditTrackTemplateContentInput.Options)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
namespace SJZY.Track.Domain.DemoAggregate;
|
namespace SJZY.Track.Domain.Aggregates.DemoAggregate;
|
||||||
|
|
||||||
[SugarTable("t_demo_detail")]
|
[SugarTable("t_demo_detail")]
|
||||||
public class DemoDetailEntity
|
public class DemoDetailEntity : IEntity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Id
|
/// Id
|
||||||
@ -1,10 +1,10 @@
|
|||||||
namespace SJZY.Track.Domain.DemoAggregate;
|
namespace SJZY.Track.Domain.Aggregates.DemoAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 测试表
|
/// 测试表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_demo")]
|
[SugarTable("t_demo")]
|
||||||
public class DemoEntity : IFullAuditedBasicEntitys
|
public class DemoEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Id
|
/// Id
|
||||||
@ -33,5 +33,4 @@ public class DemoEntity : IFullAuditedBasicEntitys
|
|||||||
|
|
||||||
[Navigate(NavigateType.OneToMany, nameof(DemoDetailEntity.DemoId))]
|
[Navigate(NavigateType.OneToMany, nameof(DemoDetailEntity.DemoId))]
|
||||||
public List<DemoDetailEntity> DemoDetailList { get; set; }
|
public List<DemoDetailEntity> DemoDetailList { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using SJZY.Track.Domain.DemoAggregate.Dtos;
|
using SJZY.Track.Domain.Dtos.Demo;
|
||||||
|
|
||||||
namespace SJZY.Track.Domain.DemoAggregate
|
namespace SJZY.Track.Domain.Aggregates.DemoAggregate
|
||||||
{
|
{
|
||||||
public interface IDemoRepository
|
public interface IDemoRepository
|
||||||
{
|
{
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using SJZY.Track.Domain.OrderAggregate.Dtos;
|
using SJZY.Track.Domain.Dtos.Order;
|
||||||
|
|
||||||
namespace SJZY.Track.Domain.OrderAggregate;
|
namespace SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
|
||||||
public interface IOrderRepository : IBasicRepository<OrderEntity>
|
public interface IOrderRepository : IBasicRepository<OrderEntity>
|
||||||
{
|
{
|
||||||
@ -1,12 +1,13 @@
|
|||||||
namespace SJZY.Track.Domain.OrderAggregate;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹订单主表
|
/// 轨迹订单主表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_order")]
|
[SugarTable("t_order")]
|
||||||
public class OrderEntity : IFullAuditedBasicEntitys
|
public class OrderEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -67,4 +68,25 @@ public class OrderEntity : IFullAuditedBasicEntitys
|
|||||||
[SugarColumn(ColumnName = "SubSystemId")]
|
[SugarColumn(ColumnName = "SubSystemId")]
|
||||||
public int SubSystemId { get; set; }
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsEqual(NoInfo noInfo)
|
||||||
|
{
|
||||||
|
return OrderType == noInfo.NoType && OrderNo == noInfo.OrderNo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public struct NoInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单类型,必填
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
public int NoType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单号,必填
|
||||||
|
/// </summary>
|
||||||
|
[Required]
|
||||||
|
[MaxLength(100)]
|
||||||
|
public string OrderNo { get; set; }
|
||||||
}
|
}
|
||||||
@ -1,13 +1,12 @@
|
|||||||
namespace SJZY.Track.Domain.OrderAggregate;
|
namespace SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹订单关联表(1:N)
|
/// 轨迹订单关联表(1:N)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_order_link")]
|
[SugarTable("t_order_link")]
|
||||||
public class OrderLinkEntity : ICreateBaicEntity,
|
public class OrderLinkEntity : ICreateBaicEntity,
|
||||||
ISoftDeleteBasicEntity
|
ISoftDeleteBasicEntity, IEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -1,12 +1,11 @@
|
|||||||
namespace SJZY.Track.Domain.OrderAggregate;
|
namespace SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹订单模板表(1:N)
|
/// 轨迹订单模板表(1:N)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_order_template")]
|
[SugarTable("t_order_template")]
|
||||||
public class OrderTemplateEntity : ICreateBaicEntity
|
public class OrderTemplateEntity : ICreateBaicEntity, IEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
namespace SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
|
||||||
|
public interface ITrackContentRepository : IBasicRepository<TrackContentEntity>
|
||||||
|
{
|
||||||
|
}
|
||||||
@ -1,10 +1,10 @@
|
|||||||
namespace SJZY.Track.Domain.TrackContentAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹内容
|
/// 轨迹内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_content")]
|
[SugarTable("t_track_content")]
|
||||||
public class TrackContentEntity : IFullAuditedBasicEntitys
|
public class TrackContentEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
@ -1,10 +1,10 @@
|
|||||||
namespace SJZY.Track.Domain.TrackContentAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹内容映射表
|
/// 轨迹内容映射表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_content_map")]
|
[SugarTable("t_track_content_map")]
|
||||||
public class TrackContentMapEntity : IFullAuditedBasicEntitys
|
public class TrackContentMapEntity : IFullAuditedBasicEntitys, IEntity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
@ -1,7 +1,6 @@
|
|||||||
using SJZY.Track.Domain.TrackDetailsAggregate;
|
using SJZY.Track.Domain.Dtos.TrackDetails;
|
||||||
using SJZY.Track.Repository.TrackDetails.Dtos;
|
|
||||||
|
|
||||||
namespace SJZY.Track.Repository.TrackDetails;
|
namespace SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||||
|
|
||||||
public interface ITrackDetailsRepository
|
public interface ITrackDetailsRepository
|
||||||
{
|
{
|
||||||
@ -1,9 +1,9 @@
|
|||||||
using Nest;
|
using Nest;
|
||||||
using SJZY.Expand.ElasticSearch;
|
using SJZY.Expand.ElasticSearch;
|
||||||
|
|
||||||
namespace SJZY.Track.Domain.TrackDetailsAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||||
|
|
||||||
[ElasticsearchType(Name = IndexName)]
|
[ElasticsearchType(RelationName = IndexName)]
|
||||||
public class TrackDetailsIndex : IdBaseIndex
|
public class TrackDetailsIndex : IdBaseIndex
|
||||||
{
|
{
|
||||||
public const string IndexName = "sjzy_track_details";
|
public const string IndexName = "sjzy_track_details";
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace SJZY.Track.Domain.TrackFlagAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||||
|
|
||||||
public interface ITrackFlagRepository : IBasicRepository<TrackFlagEntity>
|
public interface ITrackFlagRepository : IBasicRepository<TrackFlagEntity>
|
||||||
{
|
{
|
||||||
@ -1,10 +1,10 @@
|
|||||||
namespace SJZY.Track.Domain.TrackFlagAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹标记表
|
/// 轨迹标记表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_flag")]
|
[SugarTable("t_track_flag")]
|
||||||
public class TrackFlagEntity : IFullAuditedBasicEntitys
|
public class TrackFlagEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
@ -1,6 +1,5 @@
|
|||||||
namespace SJZY.Track.Domain.TrackPullAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
|
|
||||||
public interface ITrackPullConfigRepository : IBasicRepository<TrackPullConfigEntity>
|
public interface ITrackPullConfigRepository : IBasicRepository<TrackPullConfigEntity>
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,12 +1,11 @@
|
|||||||
namespace SJZY.Track.Domain.TrackPullAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹拉取配置表
|
/// 轨迹拉取配置表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_pull_config")]
|
[SugarTable("t_track_pull_config")]
|
||||||
public class TrackPullConfigEntity : IFullAuditedBasicEntitys
|
public class TrackPullConfigEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -42,5 +41,4 @@ public class TrackPullConfigEntity : IFullAuditedBasicEntitys
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackTemplateId")]
|
[SugarColumn(ColumnName = "TrackTemplateId")]
|
||||||
public int TrackTemplateId { get; set; }
|
public int TrackTemplateId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,12 +1,11 @@
|
|||||||
namespace SJZY.Track.Domain.TrackPullAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹拉取内容配置表
|
/// 轨迹拉取内容配置表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_pull_content_config")]
|
[SugarTable("t_track_pull_content_config")]
|
||||||
public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys
|
public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -66,5 +65,4 @@ public class TrackPullContentConfigEntity : IFullAuditedBasicEntitys
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackTimeZone")]
|
[SugarColumn(ColumnName = "TrackTimeZone")]
|
||||||
public string TrackTimeZone { get; set; }
|
public string TrackTimeZone { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,10 +1,10 @@
|
|||||||
namespace SJZY.Track.Domain.TrackPullAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹拉取/推送参数配置
|
/// 轨迹拉取/推送参数配置
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_push_pull_params_config")]
|
[SugarTable("t_track_push_pull_params_config")]
|
||||||
public class TrackPushPullParamsConfigEntity : IFullAuditedBasicEntitys
|
public class TrackPushPullParamsConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace SJZY.Track.Domain.TrackPushAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
|
|
||||||
public interface ITrackPushConfigRepository : IBasicRepository<TrackPushConfigEntity>
|
public interface ITrackPushConfigRepository : IBasicRepository<TrackPushConfigEntity>
|
||||||
{
|
{
|
||||||
@ -1,10 +1,10 @@
|
|||||||
namespace SJZY.Track.Domain.TrackPushAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹推送配置表
|
/// 轨迹推送配置表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_push_config")]
|
[SugarTable("t_track_push_config")]
|
||||||
public class TrackPushConfigEntity : IFullAuditedBasicEntitys
|
public class TrackPushConfigEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
@ -1,10 +1,10 @@
|
|||||||
namespace SJZY.Track.Domain.TrackPushAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹推送内容配置表
|
/// 轨迹推送内容配置表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_push_content_config")]
|
[SugarTable("t_track_push_content_config")]
|
||||||
public class TrackPushContentConfigEntity : IFullAuditedBasicEntitys
|
public class TrackPushContentConfigEntity : IFullAuditedBasicEntitys, IEntity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
@ -1,6 +1,5 @@
|
|||||||
namespace SJZY.Track.Domain.TrackStatusAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
|
|
||||||
public interface ITrackStatusRepository : IBasicRepository<TrackStatusEntity>
|
public interface ITrackStatusRepository : IBasicRepository<TrackStatusEntity>
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,10 +1,10 @@
|
|||||||
namespace SJZY.Track.Domain.TrackStatusAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹状态表
|
/// 轨迹状态表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_status")]
|
[SugarTable("t_track_status")]
|
||||||
public class TrackStatusEntity : IFullAuditedBasicEntitys
|
public class TrackStatusEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
@ -1,6 +1,6 @@
|
|||||||
using SJZY.Track.Domain.TrackTemplateAggregate.Dtos;
|
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
|
|
||||||
namespace SJZY.Track.Domain.TrackTemplateAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
|
|
||||||
public interface ITrackTemplateRepository : IBasicRepository<TrackTemplateEntity>
|
public interface ITrackTemplateRepository : IBasicRepository<TrackTemplateEntity>
|
||||||
{
|
{
|
||||||
@ -15,7 +15,8 @@ public interface ITrackTemplateRepository : IBasicRepository<TrackTemplateEntity
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<UnifyPageResultDto<GetTrackTemplateContentPageOutputVO>> GetContentPageAsync(GetTrackTemplateContentPageInputVO input);
|
Task<UnifyPageResultDto<GetTrackTemplateContentPageOutputVO>> GetContentPageAsync(
|
||||||
|
GetTrackTemplateContentPageInputVO input);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹模板内容详情
|
/// 轨迹模板内容详情
|
||||||
@ -1,10 +1,10 @@
|
|||||||
namespace SJZY.Track.Domain.TrackTemplateAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹模板内容表(1:N)
|
/// 轨迹模板内容表(1:N)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_template_content")]
|
[SugarTable("t_track_template_content")]
|
||||||
public class TrackTemplateContentEntity : IFullAuditedBasicEntitys
|
public class TrackTemplateContentEntity : IFullAuditedBasicEntitys, IEntity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
@ -1,12 +1,11 @@
|
|||||||
namespace SJZY.Track.Domain.TrackTemplateAggregate;
|
namespace SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹模板表
|
/// 轨迹模板表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_template")]
|
[SugarTable("t_track_template")]
|
||||||
public class TrackTemplateEntity : IFullAuditedBasicEntitys
|
public class TrackTemplateEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -30,5 +29,4 @@ public class TrackTemplateEntity : IFullAuditedBasicEntitys
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "SubSystemId")]
|
[SugarColumn(ColumnName = "SubSystemId")]
|
||||||
public int SubSystemId { get; set; }
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,18 +0,0 @@
|
|||||||
namespace SJZY.Track.Domain.DemoAggregate.Dtos
|
|
||||||
{
|
|
||||||
public class DemoValueObject
|
|
||||||
{
|
|
||||||
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 当前页码
|
|
||||||
/// </summary>
|
|
||||||
public int PageIndex { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 每页大小
|
|
||||||
/// </summary>
|
|
||||||
public int PageSize { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
16
src/SJZY.Track.Domain/Dtos/Demo/DemoValueObject.cs
Normal file
16
src/SJZY.Track.Domain/Dtos/Demo/DemoValueObject.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.Demo;
|
||||||
|
|
||||||
|
public class DemoValueObject
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前页码
|
||||||
|
/// </summary>
|
||||||
|
public int PageIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 每页大小
|
||||||
|
/// </summary>
|
||||||
|
public int PageSize { get; set; }
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace SJZY.Track.Domain.OrderAggregate.Dtos;
|
namespace SJZY.Track.Domain.Dtos.Order;
|
||||||
|
|
||||||
public class OrderTemplateDto
|
public class OrderTemplateDto
|
||||||
{
|
{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace SJZY.Track.Repository.TrackDetails.Dtos;
|
namespace SJZY.Track.Domain.Dtos.TrackDetails;
|
||||||
|
|
||||||
public class TrackDetailsQueryInput : PageInfoInput
|
public class TrackDetailsQueryInput : PageInfoInput
|
||||||
{
|
{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace SJZY.Track.Domain.TrackTemplateAggregate.Dtos;
|
namespace SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
|
|
||||||
public class GetPageTrackTemplateVO : PageInfoInput
|
public class GetPageTrackTemplateVO : PageInfoInput
|
||||||
{
|
{
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
|
|
||||||
|
public class GetTrackTemplateContentDetailOutputVO
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否可删
|
||||||
|
/// </summary>
|
||||||
|
public bool IsCanDelete { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否对外
|
||||||
|
/// </summary>
|
||||||
|
public bool IsExternal { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string TrackContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackContentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹状态
|
||||||
|
/// </summary>
|
||||||
|
public string TrackStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹状态id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackStatusId { get; set; }
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace SJZY.Track.Domain.TrackTemplateAggregate.Dtos;
|
namespace SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
|
|
||||||
public class GetTrackTemplateContentPageInputVO : PageInfoInput
|
public class GetTrackTemplateContentPageInputVO : PageInfoInput
|
||||||
{
|
{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace SJZY.Track.Domain.TrackTemplateAggregate.Dtos;
|
namespace SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
|
|
||||||
public class GetTrackTemplateContentPageOutputVO
|
public class GetTrackTemplateContentPageOutputVO
|
||||||
{
|
{
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace SJZY.Track.Domain.TrackTemplateAggregate.Dtos;
|
namespace SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取轨迹模版明细
|
/// 获取轨迹模版明细
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
|
|
||||||
|
public class TemplateContentDto
|
||||||
|
{
|
||||||
|
}
|
||||||
@ -7,3 +7,4 @@ global using System;
|
|||||||
global using System.Collections.Generic;
|
global using System.Collections.Generic;
|
||||||
global using System.Linq.Expressions;
|
global using System.Linq.Expressions;
|
||||||
global using System.Threading.Tasks;
|
global using System.Threading.Tasks;
|
||||||
|
global using SJZY.Track.Domain.SeedWork;
|
||||||
38
src/SJZY.Track.Domain/IBasicQuery.cs
Normal file
38
src/SJZY.Track.Domain/IBasicQuery.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
namespace SJZY.Track.Domain;
|
||||||
|
|
||||||
|
public interface IBasicQuery<T> where T : IEntity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// top 1
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="whereExpression"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<T> GetFirstAsync(Expression<Func<T, bool>> whereExpression);
|
||||||
|
|
||||||
|
Task<TResult> GetFirstAsync<TResult>(Expression<Func<T, bool>> whereExpression,
|
||||||
|
Expression<Func<T, TResult>> resultExpression);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// get list
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="whereExpression"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<T>> GetListAsync(Expression<Func<T, bool>> whereExpression);
|
||||||
|
|
||||||
|
Task<List<TResult>> GetListAsync<TResult>(Expression<Func<T, bool>> whereExpression,
|
||||||
|
Expression<Func<T, TResult>> resultExpression);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// count
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="exp"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<int> CountAsync(Expression<Func<T, bool>> exp);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// exists
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="exp"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> IsAnyAsync(Expression<Func<T, bool>> exp);
|
||||||
|
}
|
||||||
@ -1,39 +1,7 @@
|
|||||||
namespace SJZY.Track.Domain;
|
namespace SJZY.Track.Domain;
|
||||||
|
|
||||||
public interface IBasicRepository<T>
|
public interface IBasicRepository<T> : IBasicQuery<T> where T : IAggregateRoot
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// top 1
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="whereExpression"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<T> GetFirstAsync(Expression<Func<T, bool>> whereExpression);
|
|
||||||
|
|
||||||
Task<TResult> GetFirstAsync<TResult>(Expression<Func<T, bool>> whereExpression, Expression<Func<T, TResult>> resultExpression);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// get list
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="whereExpression"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<T>> GetListAsync(Expression<Func<T, bool>> whereExpression);
|
|
||||||
|
|
||||||
Task<List<TResult>> GetListAsync<TResult>(Expression<Func<T, bool>> whereExpression, Expression<Func<T, TResult>> resultExpression);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// count
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="exp"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<int> CountAsync(Expression<Func<T, bool>> exp);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// exists
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="exp"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<bool> IsAnyAsync(Expression<Func<T, bool>> exp);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// update
|
/// update
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -12,12 +12,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="TrackContentAggregate\Dtos\" />
|
<Folder Include="Aggregates\"/>
|
||||||
<Folder Include="TrackFlagAggregate\Dtos\" />
|
|
||||||
<Folder Include="TrackPullAggregate\Dtos\" />
|
|
||||||
<Folder Include="TrackPushAggregate\Dtos\" />
|
|
||||||
<Folder Include="TrackStatusAggregate\Dtos\" />
|
|
||||||
<Folder Include="TrackStatusAggregate\Dtos\" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
5
src/SJZY.Track.Domain/SeedWork/IAggregateRoot.cs
Normal file
5
src/SJZY.Track.Domain/SeedWork/IAggregateRoot.cs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
namespace SJZY.Track.Domain.SeedWork;
|
||||||
|
|
||||||
|
public interface IAggregateRoot : IEntity
|
||||||
|
{
|
||||||
|
}
|
||||||
5
src/SJZY.Track.Domain/SeedWork/IEntity.cs
Normal file
5
src/SJZY.Track.Domain/SeedWork/IEntity.cs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
namespace SJZY.Track.Domain.SeedWork;
|
||||||
|
|
||||||
|
public interface IEntity
|
||||||
|
{
|
||||||
|
}
|
||||||
@ -1,6 +0,0 @@
|
|||||||
namespace SJZY.Track.Domain.TrackContentAggregate
|
|
||||||
{
|
|
||||||
public interface ITrackContentRepository : IBasicRepository<TrackContentEntity>
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
namespace SJZY.Track.Domain.TrackTemplateAggregate.Dtos
|
|
||||||
{
|
|
||||||
public class GetTrackTemplateContentDetailOutputVO
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否可删
|
|
||||||
/// </summary>
|
|
||||||
public bool IsCanDelete { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否对外
|
|
||||||
/// </summary>
|
|
||||||
public bool IsExternal { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 排序
|
|
||||||
/// </summary>
|
|
||||||
public int Sort { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 轨迹内容
|
|
||||||
/// </summary>
|
|
||||||
public string TrackContent { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 轨迹内容id
|
|
||||||
/// </summary>
|
|
||||||
public int TrackContentId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 轨迹状态
|
|
||||||
/// </summary>
|
|
||||||
public string TrackStatus { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 轨迹状态id
|
|
||||||
/// </summary>
|
|
||||||
public int TrackStatusId { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
namespace SJZY.Track.Domain.TrackTemplateAggregate.Dtos;
|
|
||||||
|
|
||||||
public class TemplateContentDto
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
25
src/SJZY.Track.Repository/BasicQuery.cs
Normal file
25
src/SJZY.Track.Repository/BasicQuery.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using System.Linq.Expressions;
|
||||||
|
using SJZY.Track.Domain;
|
||||||
|
using SJZY.Track.Domain.SeedWork;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
|
public class BasicQuery<T> : SimpleClient<T>, IBasicQuery<T> where T : class, IEntity, new()
|
||||||
|
{
|
||||||
|
public BasicQuery()
|
||||||
|
{
|
||||||
|
Context = SqlsugarScopeBasic.GetContextSafely("default");
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<TResult> GetFirstAsync<TResult>(Expression<Func<T, bool>> whereExpression,
|
||||||
|
Expression<Func<T, TResult>> resultExpression)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<T>().Where(whereExpression).Select(resultExpression).FirstAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<TResult>> GetListAsync<TResult>(Expression<Func<T, bool>> whereExpression,
|
||||||
|
Expression<Func<T, TResult>> resultExpression)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<T>().Where(whereExpression).Select(resultExpression).ToListAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
using SJZY.Track.Domain;
|
using System.Linq.Expressions;
|
||||||
using System.Linq.Expressions;
|
using SJZY.Track.Domain;
|
||||||
|
using SJZY.Track.Domain.SeedWork;
|
||||||
using Volo.Abp;
|
using Volo.Abp;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
@ -8,25 +9,8 @@ namespace SJZY.Track.Repository;
|
|||||||
/// 仓储基类实现
|
/// 仓储基类实现
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="T"></typeparam>
|
/// <typeparam name="T"></typeparam>
|
||||||
public class BasicRepository<T> : SimpleClient<T>, IBasicRepository<T> where T : class, new()
|
public class BasicRepository<T> : BasicQuery<T>, IBasicRepository<T> where T : class, IAggregateRoot, new()
|
||||||
{
|
{
|
||||||
public BasicRepository()
|
|
||||||
{
|
|
||||||
Context = SqlsugarScopeBasic.GetContextSafely("default");
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<TResult> GetFirstAsync<TResult>(Expression<Func<T, bool>> whereExpression,
|
|
||||||
Expression<Func<T, TResult>> resultExpression)
|
|
||||||
{
|
|
||||||
return await Context.Queryable<T>().Where(whereExpression).Select(resultExpression).FirstAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<TResult>> GetListAsync<TResult>(Expression<Func<T, bool>> whereExpression,
|
|
||||||
Expression<Func<T, TResult>> resultExpression)
|
|
||||||
{
|
|
||||||
return await Context.Queryable<T>().Where(whereExpression).Select(resultExpression).ToListAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<bool> UpdateAsync(T entity, Expression<Func<T, object>> ignoreColumns)
|
public async Task<bool> UpdateAsync(T entity, Expression<Func<T, object>> ignoreColumns)
|
||||||
{
|
{
|
||||||
return await Context.Updateable(entity)
|
return await Context.Updateable(entity)
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
using SJZY.Track.Domain.DemoAggregate;
|
using System.Transactions;
|
||||||
using SJZY.Track.Domain.DemoAggregate.Dtos;
|
using SJZY.Track.Domain.Aggregates.DemoAggregate;
|
||||||
using System.Transactions;
|
using SJZY.Track.Domain.Dtos.Demo;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository
|
|
||||||
{
|
|
||||||
public class DemoRepository : BasicRepository<DemoEntity>, IDemoRepository, IScopedDependency
|
public class DemoRepository : BasicRepository<DemoEntity>, IDemoRepository, IScopedDependency
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -53,6 +53,7 @@ namespace SJZY.Track.Repository
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 参数为实体
|
#region 参数为实体
|
||||||
@ -67,9 +68,11 @@ namespace SJZY.Track.Repository
|
|||||||
var list = await AsQueryable().ToListAsync();
|
var list = await AsQueryable().ToListAsync();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 执行原生sql语句
|
#region 执行原生sql语句
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 执行原生sql语句
|
/// 执行原生sql语句
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -99,12 +102,11 @@ namespace SJZY.Track.Repository
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 简单事务
|
#region 简单事务
|
||||||
|
|
||||||
public async Task Transaction()
|
public async Task Transaction()
|
||||||
{
|
{
|
||||||
|
|
||||||
using (var ts = new TransactionScope())
|
using (var ts = new TransactionScope())
|
||||||
{
|
{
|
||||||
|
|
||||||
await base.InsertAsync(new DemoEntity { Name = "1111" });
|
await base.InsertAsync(new DemoEntity { Name = "1111" });
|
||||||
await base.InsertAsync(new DemoEntity { Name = "222" });
|
await base.InsertAsync(new DemoEntity { Name = "222" });
|
||||||
await base.InsertAsync(new DemoEntity { Name = "3333" });
|
await base.InsertAsync(new DemoEntity { Name = "3333" });
|
||||||
@ -115,9 +117,11 @@ namespace SJZY.Track.Repository
|
|||||||
ts.Complete();
|
ts.Complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 夸方法事务
|
#region 夸方法事务
|
||||||
|
|
||||||
public async Task MultipleMethodTrans1()
|
public async Task MultipleMethodTrans1()
|
||||||
{
|
{
|
||||||
await base.InsertAsync(new DemoEntity { Name = "---" });
|
await base.InsertAsync(new DemoEntity { Name = "---" });
|
||||||
@ -126,13 +130,14 @@ namespace SJZY.Track.Repository
|
|||||||
|
|
||||||
public async Task MultipleMethodTrans2()
|
public async Task MultipleMethodTrans2()
|
||||||
{
|
{
|
||||||
|
|
||||||
//throw new BusinessException(message: "手动抛出异常");
|
//throw new BusinessException(message: "手动抛出异常");
|
||||||
await base.InsertAsync(new DemoEntity { Name = "xxx" });
|
await base.InsertAsync(new DemoEntity { Name = "xxx" });
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 事务嵌套
|
#region 事务嵌套
|
||||||
|
|
||||||
public async Task InternalTrans()
|
public async Task InternalTrans()
|
||||||
{
|
{
|
||||||
using (var ts = new TransactionScope())
|
using (var ts = new TransactionScope())
|
||||||
@ -145,9 +150,11 @@ namespace SJZY.Track.Repository
|
|||||||
ts.Complete();
|
ts.Complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 局部更新
|
#region 局部更新
|
||||||
|
|
||||||
public async Task UpdatePartColumns(DemoEntity entity)
|
public async Task UpdatePartColumns(DemoEntity entity)
|
||||||
{
|
{
|
||||||
Context.Updateable(entity).UpdateColumns(m => new { m.Description, m.Name }).ExecuteCommand();
|
Context.Updateable(entity).UpdateColumns(m => new { m.Description, m.Name }).ExecuteCommand();
|
||||||
@ -156,9 +163,11 @@ namespace SJZY.Track.Repository
|
|||||||
Context.Updateable(entity).IgnoreColumns(m => new { m.CreateUserId, m.Age }).ExecuteCommand();
|
Context.Updateable(entity).IgnoreColumns(m => new { m.CreateUserId, m.Age }).ExecuteCommand();
|
||||||
// UPDATE `test` SET`IsDeleted`= 0,`Name`= 'string',`Description`= 'string',`EnabledMark`= 0,`DeleteUserId`= 0,`DeleteTime`= '2022/8/13 23:42:36',`CreateTime`= '2015/5/12 0:00:00',`UpdateUserId`= 0,`UpdateTime`= '2022/8/13 23:55:27' WHERE `id`= 5
|
// UPDATE `test` SET`IsDeleted`= 0,`Name`= 'string',`Description`= 'string',`EnabledMark`= 0,`DeleteUserId`= 0,`DeleteTime`= '2022/8/13 23:42:36',`CreateTime`= '2015/5/12 0:00:00',`UpdateUserId`= 0,`UpdateTime`= '2022/8/13 23:55:27' WHERE `id`= 5
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导航属性
|
/// 导航属性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -170,9 +179,11 @@ namespace SJZY.Track.Repository
|
|||||||
var res = await Context.InsertNav(entity).Include(m => m.DemoDetailList).ExecuteCommandAsync();
|
var res = await Context.InsertNav(entity).Include(m => m.DemoDetailList).ExecuteCommandAsync();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 缓存
|
#region 缓存
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取数据包含缓存
|
/// 获取数据包含缓存
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -192,7 +203,6 @@ namespace SJZY.Track.Repository
|
|||||||
|
|
||||||
return demo;
|
return demo;
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
#endregion
|
||||||
}
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
using SJZY.Track.Domain.OrderAggregate;
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
using SJZY.Track.Domain.OrderAggregate.Dtos;
|
using SJZY.Track.Domain.Dtos.Order;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,8 @@ public class SJZYTrackRepositoryModule : AbpModule
|
|||||||
|
|
||||||
context.Services.AddSqlsugar(options =>
|
context.Services.AddSqlsugar(options =>
|
||||||
{
|
{
|
||||||
options.AddRange(new List<SqlsugarOptions> {
|
options.AddRange(new List<SqlsugarOptions>
|
||||||
|
{
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
ConnectionString = configuration["ConnectionStrings:DefaultConnection"],
|
ConnectionString = configuration["ConnectionStrings:DefaultConnection"],
|
||||||
@ -33,10 +34,6 @@ public class SJZYTrackRepositoryModule : AbpModule
|
|||||||
);
|
);
|
||||||
}, DataBaseContext.OnExcutingAction, "SJZY.Track.Repository");
|
}, DataBaseContext.OnExcutingAction, "SJZY.Track.Repository");
|
||||||
|
|
||||||
|
|
||||||
context.Services.AddScoped(typeof(IBasicRepository<>), typeof(BasicRepository<>));
|
|
||||||
|
|
||||||
|
|
||||||
context.Services.AddElasticSearch(options =>
|
context.Services.AddElasticSearch(options =>
|
||||||
{
|
{
|
||||||
options.NodeUrls = configuration.GetSection("ElasticSearch:NodeUrls").Get<List<string>>();
|
options.NodeUrls = configuration.GetSection("ElasticSearch:NodeUrls").Get<List<string>>();
|
||||||
@ -45,4 +42,10 @@ public class SJZYTrackRepositoryModule : AbpModule
|
|||||||
options.Base64PassPassword = configuration["ElasticSearch:Base64PassPassword"];
|
options.Base64PassPassword = configuration["ElasticSearch:Base64PassPassword"];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
||||||
|
{
|
||||||
|
context.Services.AddTransient(typeof(IBasicQuery<>), typeof(BasicQuery<>));
|
||||||
|
context.Services.AddTransient(typeof(IBasicRepository<>), typeof(BasicRepository<>));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using SJZY.Track.Domain.TrackContentAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
|
|||||||
@ -2,9 +2,8 @@ using Nest;
|
|||||||
using SJZY.Expand.ABP.Core.Logger;
|
using SJZY.Expand.ABP.Core.Logger;
|
||||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||||
using SJZY.Expand.ElasticSearch.Services;
|
using SJZY.Expand.ElasticSearch.Services;
|
||||||
using SJZY.Track.Domain.TrackDetailsAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||||
using SJZY.Track.Repository.TrackDetails;
|
using SJZY.Track.Domain.Dtos.TrackDetails;
|
||||||
using SJZY.Track.Repository.TrackDetails.Dtos;
|
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using SJZY.Track.Domain.TrackFlagAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
using SJZY.Track.Domain.TrackPullAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>, ITrackPullConfigRepository, IScopedDependency
|
public class TrackPullConfigRepository : BasicRepository<TrackPullConfigEntity>, ITrackPullConfigRepository,
|
||||||
|
IScopedDependency
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -1,7 +1,8 @@
|
|||||||
using SJZY.Track.Domain.TrackPushAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>, ITrackPushConfigRepository, IScopedDependency
|
public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>, ITrackPushConfigRepository,
|
||||||
|
IScopedDependency
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -1,12 +1,13 @@
|
|||||||
namespace SJZY.Track.Repository.TrackPushRecord.Entitys
|
using SJZY.Track.Domain.SeedWork;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Repository.TrackPushRecord.Entitys
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹推送记录
|
/// 轨迹推送记录
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_push_record")]
|
[SugarTable("t_track_push_record")]
|
||||||
public class TrackPushRecordEntity
|
public class TrackPushRecordEntity : IAggregateRoot
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -54,6 +55,5 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "TrackTotal")]
|
[SugarColumn(ColumnName = "TrackTotal")]
|
||||||
public string TrackTotal { get; set; }
|
public string TrackTotal { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,12 +1,13 @@
|
|||||||
namespace SJZY.Track.Repository.TrackPushRecordDetails.Entitys
|
using SJZY.Track.Domain.SeedWork;
|
||||||
|
|
||||||
|
namespace SJZY.Track.Repository.TrackPushRecordDetails.Entitys
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹推送明细表
|
/// 轨迹推送明细表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarTable("t_track_push_record_details")]
|
[SugarTable("t_track_push_record_details")]
|
||||||
public class TrackPushRecordDetailsEntity
|
public class TrackPushRecordDetailsEntity : IAggregateRoot
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自增主键
|
/// 自增主键
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -42,6 +43,5 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "PushRecordId")]
|
[SugarColumn(ColumnName = "PushRecordId")]
|
||||||
public int PushRecordId { get; set; }
|
public int PushRecordId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using SJZY.Track.Domain.TrackStatusAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
@ -7,6 +7,4 @@ public class TrackStatusRepository : BasicRepository<TrackStatusEntity>, ITrackS
|
|||||||
public TrackStatusRepository()
|
public TrackStatusRepository()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,13 +1,12 @@
|
|||||||
using SJZY.Expand.ABP.Core.Common.Dto;
|
using System.Linq.Expressions;
|
||||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||||
using SJZY.Track.Domain.TrackContentAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
using SJZY.Track.Domain.TrackFlagAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||||
using SJZY.Track.Domain.TrackStatusAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
using SJZY.Track.Domain.TrackTemplateAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||||
using SJZY.Track.Domain.TrackTemplateAggregate.Dtos;
|
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||||
using SJZY.Track.Domain.VEntities;
|
using SJZY.Track.Domain.VEntities;
|
||||||
using SJZY.Track.Repository.Enum;
|
using SJZY.Track.Repository.Enum;
|
||||||
using System.Linq.Expressions;
|
|
||||||
|
|
||||||
namespace SJZY.Track.Repository;
|
namespace SJZY.Track.Repository;
|
||||||
|
|
||||||
@ -26,7 +25,8 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<GetTrackTemplateDetailVO?> GetDetailAsync(int id)
|
public async Task<GetTrackTemplateDetailVO?> GetDetailAsync(int id)
|
||||||
{
|
{
|
||||||
var detail = await Context.Queryable<TrackTemplateEntity>().LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
var detail = await Context.Queryable<TrackTemplateEntity>()
|
||||||
|
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
||||||
.Where((a, b) => a.Id == id)
|
.Where((a, b) => a.Id == id)
|
||||||
.Select((a, b) => new
|
.Select((a, b) => new
|
||||||
GetTrackTemplateDetailVO
|
GetTrackTemplateDetailVO
|
||||||
@ -49,9 +49,11 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
public async Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input)
|
public async Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input)
|
||||||
{
|
{
|
||||||
UnifyPageResultDto<GetTrackTemplateListVO> pagedList = new UnifyPageResultDto<GetTrackTemplateListVO>();
|
UnifyPageResultDto<GetTrackTemplateListVO> pagedList = new UnifyPageResultDto<GetTrackTemplateListVO>();
|
||||||
pagedList = await Context.Queryable<TrackTemplateEntity>().LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
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.SubSystemId > 0, (a, b) => a.SubSystemId == input.SubSystemId)
|
||||||
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords))
|
.WhereIF(!input.Keywords.IsNullOrWhiteSpace(),
|
||||||
|
(a, b) => a.Name.Contains(input.Keywords) || a.Code.Contains(input.Keywords))
|
||||||
.Select((a, b) => new GetTrackTemplateListVO
|
.Select((a, b) => new GetTrackTemplateListVO
|
||||||
{
|
{
|
||||||
Id = a.Id,
|
Id = a.Id,
|
||||||
@ -75,7 +77,8 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var item = await Context.Queryable<TrackTemplateEntity>().LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
var item = await Context.Queryable<TrackTemplateEntity>()
|
||||||
|
.LeftJoin<VSystemEntity>((a, b) => a.SubSystemId == b.Id)
|
||||||
.Where((a, b) => a.Id == input.TrackTemplateId)
|
.Where((a, b) => a.Id == input.TrackTemplateId)
|
||||||
.Select((a, b) => new GetTrackTemplateListVO
|
.Select((a, b) => new GetTrackTemplateListVO
|
||||||
{
|
{
|
||||||
@ -100,18 +103,29 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public async Task<UnifyPageResultDto<GetTrackTemplateContentPageOutputVO>> GetContentPageAsync(GetTrackTemplateContentPageInputVO input)
|
public async Task<UnifyPageResultDto<GetTrackTemplateContentPageOutputVO>> GetContentPageAsync(
|
||||||
|
GetTrackTemplateContentPageInputVO input)
|
||||||
{
|
{
|
||||||
return await Context.Queryable<TrackTemplateContentEntity>()
|
return await Context.Queryable<TrackTemplateContentEntity>()
|
||||||
.InnerJoin<TrackContentEntity>((templateContent, trackContent) => templateContent.TrackContentId == trackContent.Id && !trackContent.IsDeleted)
|
.InnerJoin<TrackContentEntity>((templateContent, trackContent) =>
|
||||||
.LeftJoin<TrackStatusEntity>((templateContent, trackContent, trackStatus) => trackContent.TrackStatusId == trackStatus.Id && !trackStatus.IsDeleted)
|
templateContent.TrackContentId == trackContent.Id && !trackContent.IsDeleted)
|
||||||
.LeftJoin<VEnumValueInfoEntity>((templateContent, trackContent, trackStatus, enumValue) => enumValue.Property == EnumPropertyEnums.节点.GetDescription() && trackStatus.Node == enumValue.Enumkey && !enumValue.IsDeleted)
|
.LeftJoin<TrackStatusEntity>((templateContent, trackContent, trackStatus) =>
|
||||||
.LeftJoin<TrackFlagEntity>((templateContent, trackContent, trackStatus, enumValue, trackFlag) => trackContent.TrackFlagId == trackFlag.Id && !trackFlag.IsDeleted)
|
trackContent.TrackStatusId == trackStatus.Id && !trackStatus.IsDeleted)
|
||||||
.LeftJoin<VUserEntity>((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser) => templateContent.CreateUserId == createUser.Id && !createUser.IsDeleted)
|
.LeftJoin<VEnumValueInfoEntity>((templateContent, trackContent, trackStatus, enumValue) =>
|
||||||
.LeftJoin<VUserEntity>((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) => templateContent.UpdateUserId == updateUser.Id && !updateUser.IsDeleted)
|
enumValue.Property == EnumPropertyEnums.节点.GetDescription() && trackStatus.Node == enumValue.Enumkey &&
|
||||||
|
!enumValue.IsDeleted)
|
||||||
|
.LeftJoin<TrackFlagEntity>((templateContent, trackContent, trackStatus, enumValue, trackFlag) =>
|
||||||
|
trackContent.TrackFlagId == trackFlag.Id && !trackFlag.IsDeleted)
|
||||||
|
.LeftJoin<VUserEntity>((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser) =>
|
||||||
|
templateContent.CreateUserId == createUser.Id && !createUser.IsDeleted)
|
||||||
|
.LeftJoin<VUserEntity>(
|
||||||
|
(templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) =>
|
||||||
|
templateContent.UpdateUserId == updateUser.Id && !updateUser.IsDeleted)
|
||||||
.Filter(null, true)
|
.Filter(null, true)
|
||||||
.Where(templateContent => templateContent.TrackTemplateId == input.TrackTemplateId && !templateContent.IsDeleted)
|
.Where(templateContent =>
|
||||||
.Select((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) => new GetTrackTemplateContentPageOutputVO
|
templateContent.TrackTemplateId == input.TrackTemplateId && !templateContent.IsDeleted)
|
||||||
|
.Select((templateContent, trackContent, trackStatus, enumValue, trackFlag, createUser, updateUser) =>
|
||||||
|
new GetTrackTemplateContentPageOutputVO
|
||||||
{
|
{
|
||||||
Id = templateContent.Id,
|
Id = templateContent.Id,
|
||||||
TrackStatus = trackStatus.Status,
|
TrackStatus = trackStatus.Status,
|
||||||
@ -129,8 +143,10 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
|||||||
public async Task<GetTrackTemplateContentDetailOutputVO> GetContentDetailAsync(int id)
|
public async Task<GetTrackTemplateContentDetailOutputVO> GetContentDetailAsync(int id)
|
||||||
{
|
{
|
||||||
return await Context.Queryable<TrackTemplateContentEntity>()
|
return await Context.Queryable<TrackTemplateContentEntity>()
|
||||||
.InnerJoin<TrackContentEntity>((templateContent, trackContent) => templateContent.TrackContentId == trackContent.Id && !trackContent.IsDeleted)
|
.InnerJoin<TrackContentEntity>((templateContent, trackContent) =>
|
||||||
.LeftJoin<TrackStatusEntity>((templateContent, trackContent, trackStatus) => trackContent.TrackStatusId == trackStatus.Id && !trackStatus.IsDeleted)
|
templateContent.TrackContentId == trackContent.Id && !trackContent.IsDeleted)
|
||||||
|
.LeftJoin<TrackStatusEntity>((templateContent, trackContent, trackStatus) =>
|
||||||
|
trackContent.TrackStatusId == trackStatus.Id && !trackStatus.IsDeleted)
|
||||||
.Filter(null, true)
|
.Filter(null, true)
|
||||||
.Where(templateContent => templateContent.Id == id && !templateContent.IsDeleted)
|
.Where(templateContent => templateContent.Id == id && !templateContent.IsDeleted)
|
||||||
.Select((templateContent, trackContent, trackStatus) => new GetTrackTemplateContentDetailOutputVO
|
.Select((templateContent, trackContent, trackStatus) => new GetTrackTemplateContentDetailOutputVO
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user