抽象应用契约层
This commit is contained in:
parent
95d91559e8
commit
a2e458e57f
@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0E2537C3-6
|
||||
EndProject
|
||||
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}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.Application.Contract", "src\SJZY.Track.Application.Contract\SJZY.Track.Application.Contract.csproj", "{390A44FB-0DB5-4B66-86AB-7712DC3030F5}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SJZY.Track.Test", "test\SJZY.Track.Test\SJZY.Track.Test.csproj", "{3A53539C-4A85-4E5D-A071-7B4B193AB0E0}"
|
||||
EndProject
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo
|
||||
{
|
||||
/// <summary>
|
||||
/// automapper 复杂转换样例
|
||||
@ -43,7 +43,6 @@
|
||||
{
|
||||
return "辽宁省沈阳市...";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ComplexAutomapperDemoOutput
|
||||
@ -83,7 +82,4 @@
|
||||
/// </summary>
|
||||
public int[] RoleIds { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo
|
||||
{
|
||||
public class DemoDetailSaveInput
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo
|
||||
{
|
||||
public class DemoInput
|
||||
{
|
||||
@ -0,0 +1,10 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo;
|
||||
|
||||
public class ExcelImportOuput
|
||||
{
|
||||
// [MiniExcelLibs.Attributes.ExcelColumnName("姓名")]
|
||||
public string Name { get; set; }
|
||||
|
||||
// [MiniExcelLibs.Attributes.ExcelColumnName("年龄")]
|
||||
public int Age { get; set; }
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo;
|
||||
|
||||
public class GetDemoListByPageInput : PageInfoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo
|
||||
{
|
||||
public class GetDemoListByPageOutput
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo
|
||||
{
|
||||
public class MyCustomerResultOutput
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo
|
||||
{
|
||||
public class OssUploadOutput
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.HttpApi.Dtos
|
||||
namespace SJZY.Track.Application.Contract.Dtos
|
||||
{
|
||||
public class RemoteDemoInput
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.HttpApi.Dtos
|
||||
namespace SJZY.Track.Application.Contract.Dtos
|
||||
{
|
||||
public class RemoteDemoOutput
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo
|
||||
{
|
||||
public class SwaggerDemoInput
|
||||
{
|
||||
@ -30,13 +30,10 @@ namespace SJZY.Track.Application.Dtos.Demo
|
||||
|
||||
public enum Gender
|
||||
{
|
||||
[Description("纯爷们")]
|
||||
男 = 2,
|
||||
[Description("纯爷们")] 男 = 2,
|
||||
|
||||
[Description("大姑娘")]
|
||||
女 = 5,
|
||||
[Description("大姑娘")] 女 = 5,
|
||||
|
||||
[Description("你憋问")]
|
||||
未知 = 8
|
||||
[Description("你憋问")] 未知 = 8
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo
|
||||
{
|
||||
public class ValidateExecuteInput
|
||||
{
|
||||
@ -56,7 +56,6 @@
|
||||
/// 用户角色
|
||||
/// </summary>
|
||||
public List<UserRoleInput> UserRoleInputList { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class UserInfoInput
|
||||
@ -0,0 +1,6 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.Demo
|
||||
{
|
||||
public class ValidateExecuteOutput
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class DeleteOrderInput : OrderNoInfo
|
||||
{
|
||||
}
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices
|
||||
{
|
||||
public class GetOrderDetailsInput
|
||||
{
|
||||
@ -0,0 +1,95 @@
|
||||
namespace SJZY.Track.Application.Contract.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>
|
||||
/// 轨迹订单Dto
|
||||
/// </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; }
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class GetTrackInput
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class GetTrackOutput
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class LinkOrderInput
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class OrderNoInfo
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class UpdateOrderInput : OrderNoInfo
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class UpsertOrderInput : UpdateOrderInput
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
|
||||
public class UpsertTrackInput : OrderNoInfo
|
||||
{
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.TrackContents
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackContents
|
||||
{
|
||||
public class EditTrackContentInput
|
||||
{
|
||||
@ -102,4 +96,3 @@ namespace SJZY.Track.Application.Dtos.TrackContents
|
||||
public string TrackFlag { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.TrackContents
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackContents
|
||||
{
|
||||
public class GetPageTrackContentInput : PageInfoInput
|
||||
{
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.TrackFlags
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackFlags
|
||||
{
|
||||
public class EditTrackFlagInput
|
||||
{
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.TrackFlags
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackFlags
|
||||
{
|
||||
public class GetTrackFlagListDto
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.TrackPull;
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackPull;
|
||||
|
||||
public class EditTrackPullConfigInput
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.TrackPull;
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackPull;
|
||||
|
||||
public class UpdateTrackPullContentInput
|
||||
{
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.TrackStatus
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackStatus
|
||||
{
|
||||
public class EditTrackStatusInput
|
||||
{
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.TrackStatus
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackStatus
|
||||
{
|
||||
public class GetTrackStatusDetailDto
|
||||
{
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Dtos.TrackStatus
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackStatus
|
||||
{
|
||||
public class GetTrackStatusListDto
|
||||
{
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.TrackTemplates;
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public class EditTrackTemplateContentInput
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.TrackTemplates
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackTemplates
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取轨迹模版分页输入
|
||||
@ -1,4 +1,4 @@
|
||||
namespace SJZY.Track.Application.Dtos.TrackTemplates
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackTemplates
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取轨迹模版详情
|
||||
4
src/SJZY.Track.Application.Contract/GlobalUsings.cs
Normal file
4
src/SJZY.Track.Application.Contract/GlobalUsings.cs
Normal file
@ -0,0 +1,4 @@
|
||||
// Global using directives
|
||||
|
||||
global using SJZY.Expand.ABP.Common.Enums;
|
||||
global using SJZY.Expand.ABP.Core.Common.Dto;
|
||||
@ -0,0 +1,13 @@
|
||||
using SJZY.Track.Application.Contract.Dtos;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace SJZY.Track.Application.Contract.Services;
|
||||
|
||||
/// <summary>
|
||||
/// 客户端连接测试接口
|
||||
/// </summary>
|
||||
public interface IRemoteDemoService : IRemoteService, IScopedDependency
|
||||
{
|
||||
Task<UnifyResultDto<RemoteDemoOutput>> ConnectionTest(RemoteDemoInput input);
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
namespace SJZY.Track.Application.Contract.Services;
|
||||
|
||||
public interface ITrackContentService
|
||||
{
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
namespace SJZY.Track.Application.Contract.Services;
|
||||
|
||||
public interface ITrackFlagService
|
||||
{
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
namespace SJZY.Track.Application.Contract.Services;
|
||||
|
||||
public interface ITrackStatusService
|
||||
{
|
||||
}
|
||||
@ -1,12 +1,11 @@
|
||||
using Volo.Abp.Modularity;
|
||||
|
||||
namespace SJZY.Track.HttpApi
|
||||
namespace SJZY.Track.Application.Contract
|
||||
{
|
||||
public class TrackHttpApiModule : AbpModule
|
||||
{
|
||||
public override void PreConfigureServices(ServiceConfigurationContext context)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
using AutoMapper;
|
||||
using SJZY.Track.Application.Dtos.Demo;
|
||||
using SJZY.Track.Application.Contract.Dtos.Demo;
|
||||
using SJZY.Track.Domain.Aggregates.DemoAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Demo;
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
using AutoMapper;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.Track.Application.Dtos.Demo;
|
||||
|
||||
using SJZY.Track.Application.Contract.Dtos.Demo;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper
|
||||
{
|
||||
@ -20,9 +19,11 @@ namespace SJZY.Track.Application.AutoMapper
|
||||
//一些简单计算的场景,酌情使用...
|
||||
.ForMember(dest => dest.Age, opt => opt.MapFrom(source => GetAgeByBirthdate(source.UserInfo.BirthDay)))
|
||||
//结构不一致的场景
|
||||
.ForMember(dest => dest.RoleIds, opt => opt.MapFrom(source => source.UserRoleInputList.Select(m => m.Id).ToArray()))
|
||||
.ForMember(dest => dest.RoleIds,
|
||||
opt => opt.MapFrom(source => source.UserRoleInputList.Select(m => m.Id).ToArray()))
|
||||
//条件映射(这里只是举例,日常开发时sqlsugar在新增时会避开自增主键)
|
||||
.ForMember(dest => dest.Id, opt =>
|
||||
.ForMember(dest => dest.Id,
|
||||
opt =>
|
||||
{
|
||||
opt.Condition(src => src.OptionType == OptionType.删除 || src.OptionType == OptionType.修改);
|
||||
});
|
||||
@ -36,8 +37,8 @@ namespace SJZY.Track.Application.AutoMapper
|
||||
{
|
||||
age--;
|
||||
}
|
||||
|
||||
return age < 0 ? 0 : age;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,7 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper.Internal.Mappers;
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper;
|
||||
|
||||
|
||||
@ -1,16 +1,7 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper.Internal.Mappers;
|
||||
using SJZY.Track.Application.Dtos.TrackContents;
|
||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.ObjectMapping;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper
|
||||
{
|
||||
@ -22,7 +13,8 @@ namespace SJZY.Track.Application.AutoMapper
|
||||
CreateMap<GetTrackContentDetailVO, GetTrackContentDetailDto>(MemberList.None);
|
||||
CreateMap<GetPageTrackContentInput, GetPageTrackContentVO>(MemberList.None);
|
||||
CreateMap<GetTrackContentListVO, GetTrackContentListDto>(MemberList.None);
|
||||
CreateMap<UnifyPageResultDto<GetTrackContentListVO>, UnifyPageResultDto<GetTrackContentListDto>>(MemberList.None);
|
||||
CreateMap<UnifyPageResultDto<GetTrackContentListVO>, UnifyPageResultDto<GetTrackContentListDto>>(
|
||||
MemberList.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,7 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper.Internal.Mappers;
|
||||
using SJZY.Track.Application.Dtos.TrackFlags;
|
||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackFlags;
|
||||
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackFlags;
|
||||
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.ObjectMapping;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper
|
||||
{
|
||||
@ -18,7 +9,6 @@ namespace SJZY.Track.Application.AutoMapper
|
||||
{
|
||||
public TrackFlagAutoMapperProfile()
|
||||
{
|
||||
|
||||
CreateMap<EditTrackFlagInput, TrackFlagEntity>(MemberList.None)
|
||||
.ForMember(dest => dest.Name, opt => opt.MapFrom(source => source.Flag))
|
||||
.ForMember(dest => dest.IsCompleted, opt => opt.MapFrom(source => source.IsFinish));
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using AutoMapper;
|
||||
using SJZY.Track.Application.Dtos.TrackPull;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackPull;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPullAggregate;
|
||||
using Volo.Abp.AutoMapper;
|
||||
|
||||
|
||||
@ -1,15 +1,7 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper.Internal.Mappers;
|
||||
using SJZY.Track.Application.Dtos.Demo;
|
||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackStatus;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.ObjectMapping;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper
|
||||
{
|
||||
@ -25,7 +17,8 @@ namespace SJZY.Track.Application.AutoMapper
|
||||
CreateMap<GetTrackStatusDetailVO, GetTrackStatusDetailDto>(MemberList.None);
|
||||
CreateMap<GetPageTrackStatusInput, GetPageTrackStatusVO>(MemberList.None);
|
||||
CreateMap<GetTrackStatusListVO, GetTrackStatusListDto>(MemberList.None);
|
||||
CreateMap<UnifyPageResultDto<GetTrackStatusListVO>, UnifyPageResultDto<GetTrackStatusListDto>>(MemberList.None);
|
||||
CreateMap<UnifyPageResultDto<GetTrackStatusListVO>, UnifyPageResultDto<GetTrackStatusListDto>>(MemberList
|
||||
.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,7 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper.Internal.Mappers;
|
||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
using Volo.Abp.ObjectMapping;
|
||||
|
||||
namespace SJZY.Track.Application.AutoMapper;
|
||||
|
||||
@ -19,6 +17,7 @@ public class TrackTemplateAutoMapperProfile : Profile
|
||||
CreateMap<EditTrackTemplateInput, TrackTemplateEntity>(MemberList.None);
|
||||
CreateMap<GetPageTrackTemplateInput, GetPageTrackTemplateVO>(MemberList.None);
|
||||
CreateMap<GetTrackTemplateListVO, GetTrackTemplateListDto>(MemberList.None);
|
||||
CreateMap<UnifyPageResultDto<GetTrackTemplateListVO>, UnifyPageResultDto<GetTrackTemplateListDto>>(MemberList.None);
|
||||
CreateMap<UnifyPageResultDto<GetTrackTemplateListVO>, UnifyPageResultDto<GetTrackTemplateListDto>>(MemberList
|
||||
.None);
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
{
|
||||
public class ExcelImportOuput
|
||||
{
|
||||
[MiniExcelLibs.Attributes.ExcelColumnName("姓名")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[MiniExcelLibs.Attributes.ExcelColumnName("年龄")]
|
||||
public int Age { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
{
|
||||
public class GetDemoListByPageInput : PageInfoInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
namespace SJZY.Track.Application.Dtos.Demo
|
||||
{
|
||||
public class ValidateExecuteOutput
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -1,5 +0,0 @@
|
||||
namespace SJZY.Track.Application.Dtos.ProvideServices;
|
||||
|
||||
public class DeleteOrderInput : OrderNoInfo
|
||||
{
|
||||
}
|
||||
@ -1,102 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
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>
|
||||
/// 轨迹订单Dto
|
||||
/// </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; }
|
||||
}
|
||||
}
|
||||
@ -27,6 +27,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SJZY.Track.Domain\SJZY.Track.Domain.csproj" />
|
||||
<ProjectReference Include="..\SJZY.Track.HttpApi\SJZY.Track.HttpApi.csproj" />
|
||||
<ProjectReference Include="..\SJZY.Track.Application.Contract\SJZY.Track.Application.Contract.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using SJZY.Expand.ABP.Core.Common;
|
||||
using SJZY.Track.Application.Dtos.Demo;
|
||||
using SJZY.Track.Application.Contract.Dtos.Demo;
|
||||
using SJZY.Track.Domain.Aggregates.DemoAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Demo;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using SJZY.Expand.ABP.Core.Common.Dto;
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
|
||||
@ -93,7 +92,8 @@ public class OrderService : ApplicationService
|
||||
{
|
||||
var vo = ObjectMapper.Map<GetPageTrackOrderInput, GetPageTrackOrderInputVO>(input);
|
||||
var pageList = await _orderRepository.GetPageTrackOrder(vo);
|
||||
var pageResultDto = ObjectMapper.Map<UnifyPageResultDto<TrackOrderVO>, UnifyPageResultDto<TrackOrderDto>>(pageList);
|
||||
var pageResultDto =
|
||||
ObjectMapper.Map<UnifyPageResultDto<TrackOrderVO>, UnifyPageResultDto<TrackOrderDto>>(pageList);
|
||||
return pageResultDto;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
using DotNetCore.CAP;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace SJZY.Track.Application.Services.ProvideServices;
|
||||
|
||||
public class TrackCustomer : ITransientDependency, ICapSubscribe
|
||||
{
|
||||
public const string CapSubscribe = "SJZY.FMC.VoucherRedundantCalc";
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using DotNetCore.CAP;
|
||||
using SJZY.Track.Application.Dtos.ProvideServices;
|
||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
using SJZY.Track.Domain.Queries;
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Services.TrackContents
|
||||
{
|
||||
public interface ITrackContentService
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,8 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Track.Application.Dtos.TrackContents;
|
||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||
using SJZY.Track.Application.Localization;
|
||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace SJZY.Track.Application.Services.TrackContents
|
||||
@ -74,7 +66,8 @@ namespace SJZY.Track.Application.Services.TrackContents
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetList")]
|
||||
public async Task<UnifyPageResultDto<GetTrackContentListDto>> GetPageTrackContent(GetPageTrackContentInput input)
|
||||
public async Task<UnifyPageResultDto<GetTrackContentListDto>> GetPageTrackContent(
|
||||
GetPageTrackContentInput input)
|
||||
{
|
||||
var vo = ObjectMapper.Map<GetPageTrackContentInput, GetPageTrackContentVO>(input);
|
||||
var resultDto = await _trackContentRepository.GetPageTrackContent(vo);
|
||||
@ -86,15 +79,19 @@ namespace SJZY.Track.Application.Services.TrackContents
|
||||
}
|
||||
|
||||
#region 私有方法
|
||||
|
||||
private async Task<UnifyResultDto> AddAsync(EditTrackContentInput input)
|
||||
{
|
||||
#region 业务逻辑校验
|
||||
var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => a.SubSystemId==input.SubSystemId&&(a.Code==input.Code ||
|
||||
|
||||
var trackContentEntity = await _trackContentRepository.GetFirstAsync(a =>
|
||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||
a.Content == input.Content || a.EnContent == input.EnContent));
|
||||
if (trackContentEntity != null)
|
||||
{
|
||||
throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var entity = ObjectMapper.Map<EditTrackContentInput, TrackContentEntity>(input);
|
||||
@ -106,12 +103,15 @@ namespace SJZY.Track.Application.Services.TrackContents
|
||||
private async Task<UnifyResultDto> UpdateAsync(EditTrackContentInput input)
|
||||
{
|
||||
#region 业务逻辑校验
|
||||
var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => a.Id!=input.Id && a.SubSystemId==input.SubSystemId && (a.Code==input.Code ||
|
||||
|
||||
var trackContentEntity = await _trackContentRepository.GetFirstAsync(a => a.Id != input.Id &&
|
||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||
a.Content == input.Content || a.EnContent == input.EnContent));
|
||||
if (trackContentEntity != null)
|
||||
{
|
||||
throw new BusinessException(message: _stringLocalizer["TrackContentExist"]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var templateEntity = await _trackContentRepository.GetFirstAsync(a => a.Id == input.Id);
|
||||
@ -127,6 +127,7 @@ namespace SJZY.Track.Application.Services.TrackContents
|
||||
|
||||
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Services.TrackFlags
|
||||
{
|
||||
public interface ITrackFlagService
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,8 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Track.Application.Dtos.TrackFlags;
|
||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackFlags;
|
||||
using SJZY.Track.Application.Localization;
|
||||
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 System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace SJZY.Track.Application.Services.TrackFlags
|
||||
@ -86,14 +78,18 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
||||
}
|
||||
|
||||
#region 私有方法
|
||||
|
||||
private async Task<UnifyResultDto> AddAsync(EditTrackFlagInput input)
|
||||
{
|
||||
#region 业务校验
|
||||
var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a => a.SubSystemId==input.SubSystemId&& (a.Code==input.Code || a.Name==input.Flag));
|
||||
|
||||
var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a =>
|
||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code || a.Name == input.Flag));
|
||||
if (trackStatusEntity != null)
|
||||
{
|
||||
throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var entity = ObjectMapper.Map<EditTrackFlagInput, TrackFlagEntity>(input);
|
||||
@ -105,12 +101,15 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
||||
private async Task<UnifyResultDto> UpdateAsync(EditTrackFlagInput input)
|
||||
{
|
||||
#region 业务校验
|
||||
var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a => a.Id !=input.Id && a.SubSystemId==input.SubSystemId&& (a.Code==input.Code ||
|
||||
|
||||
var trackStatusEntity = await _trackFlagRepository.GetFirstAsync(a => a.Id != input.Id &&
|
||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||
a.Name == input.Flag));
|
||||
if (trackStatusEntity != null)
|
||||
{
|
||||
throw new BusinessException(message: _stringLocalizer["TrackFlagExist"]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var templateEntity = await _trackFlagRepository.GetFirstAsync(a => a.Id == input.Id);
|
||||
@ -126,6 +125,7 @@ namespace SJZY.Track.Application.Services.TrackFlags
|
||||
|
||||
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System.Linq.Expressions;
|
||||
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.Contract.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;
|
||||
@ -50,7 +50,8 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("GetContentPage")]
|
||||
public async Task<UnifyPageResultDto<GetTrackPullContentPageOutputVO>> GetContentPageAsync([FromBody] GetTrackPullContentPageInputVO input)
|
||||
public async Task<UnifyPageResultDto<GetTrackPullContentPageOutputVO>> GetContentPageAsync(
|
||||
[FromBody] GetTrackPullContentPageInputVO input)
|
||||
{
|
||||
return await _trackPullConfigRepository.GetContentPageAsync(input);
|
||||
}
|
||||
@ -88,7 +89,8 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
||||
if (input.Options != OptionTypeNoNull.删除)
|
||||
{
|
||||
Expression<Func<TrackPullConfigEntity, bool>> isAnyExp = x =>
|
||||
x.SubSystemId == input.SubSystemId && x.TrackTemplateId == input.TrackTemplateId && x.ServiceProviderId == input.ServiceProviderId;
|
||||
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))
|
||||
@ -100,9 +102,11 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
||||
case OptionTypeNoNull.新增:
|
||||
{
|
||||
var trackPullEntity = ObjectMapper.Map<EditTrackPullConfigInput, TrackPullConfigEntity>(input);
|
||||
var trackPullParamsEntity = ObjectMapper.Map<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(input);
|
||||
var trackPullParamsEntity =
|
||||
ObjectMapper.Map<EditTrackPullConfigInput, TrackPushPullParamsConfigEntity>(input);
|
||||
|
||||
var trackTemplateContentEntities = await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId);
|
||||
var trackTemplateContentEntities =
|
||||
await _trackTemplateRepository.GetContentListAsync(x => x.TrackTemplateId == input.TrackTemplateId);
|
||||
|
||||
var trackPullContentEntities = new List<TrackPullContentConfigEntity>();
|
||||
|
||||
@ -121,6 +125,7 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
||||
TrackContentId = item.TrackContentId
|
||||
});
|
||||
}
|
||||
|
||||
await _trackPullConfigRepository.InsertContentRangeAsync(trackPullContentEntities);
|
||||
|
||||
ts.Complete();
|
||||
@ -130,15 +135,20 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
||||
|
||||
case OptionTypeNoNull.修改:
|
||||
{
|
||||
var oldTrackPullEntity = await _trackPullConfigRepository.GetFirstAsync(x => x.Id == input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||
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 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);
|
||||
var trackTemplateContentEntities =
|
||||
await _trackTemplateRepository.GetContentListAsync(x =>
|
||||
x.TrackTemplateId == input.TrackTemplateId);
|
||||
|
||||
foreach (var item in trackTemplateContentEntities)
|
||||
{
|
||||
@ -173,11 +183,13 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
||||
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.SoftDeleteParamsAsync(x =>
|
||||
x.PullOrPushConfigId == input.Id && !x.IsPush);
|
||||
await _trackPullConfigRepository.SoftDeleteContentAsync(x => x.TrackPullConfigId == input.Id);
|
||||
|
||||
ts.Complete();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -196,7 +208,8 @@ public class TrackPullService : ApplicationService, ITransientDependency
|
||||
[HttpPost("UpdateContent")]
|
||||
public async Task<bool> UpdateContentAsync([FromBody] UpdateTrackPullContentInput input)
|
||||
{
|
||||
var oldTrackPullContentEntity = await _trackPullConfigRepository.GetContentByIdAsync(input.Id) ?? throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||
var oldTrackPullContentEntity = await _trackPullConfigRepository.GetContentByIdAsync(input.Id) ??
|
||||
throw new BusinessException(message: _stringLocalizer["NotFindData"]);
|
||||
|
||||
ObjectMapper.Map(input, oldTrackPullContentEntity);
|
||||
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SJZY.Track.Application.Services.TrackStatus
|
||||
{
|
||||
public interface ITrackStatusService
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackStatus;
|
||||
using SJZY.Track.Application.Localization;
|
||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackStatus;
|
||||
@ -79,15 +78,19 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
||||
}
|
||||
|
||||
#region 私有方法
|
||||
|
||||
private async Task<UnifyResultDto> AddAsync(EditTrackStatusInput input)
|
||||
{
|
||||
#region 业务校验
|
||||
var trackStatusEntity = await _trackStatusRepository.GetFirstAsync(a => a.SubSystemId==input.SubSystemId&& (a.Code==input.Code ||
|
||||
|
||||
var trackStatusEntity = await _trackStatusRepository.GetFirstAsync(a => a.SubSystemId == input.SubSystemId &&
|
||||
(a.Code == input.Code ||
|
||||
a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus));
|
||||
if (trackStatusEntity != null)
|
||||
{
|
||||
throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var entity = ObjectMapper.Map<EditTrackStatusInput, TrackStatusEntity>(input);
|
||||
@ -99,12 +102,15 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
||||
private async Task<UnifyResultDto> UpdateAsync(EditTrackStatusInput input)
|
||||
{
|
||||
#region 业务校验
|
||||
var trackStatusEntity = await _trackStatusRepository.GetFirstAsync(a => a.Id !=input.Id && a.SubSystemId==input.SubSystemId&& (a.Code==input.Code ||
|
||||
|
||||
var trackStatusEntity = await _trackStatusRepository.GetFirstAsync(a => a.Id != input.Id &&
|
||||
a.SubSystemId == input.SubSystemId && (a.Code == input.Code ||
|
||||
a.Status == input.TrackStatus || a.EnStatus == input.EntrackStatus));
|
||||
if (trackStatusEntity != null)
|
||||
{
|
||||
throw new BusinessException(message: _stringLocalizer["TrackStatusExist"]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var templateEntity = await _trackStatusRepository.GetFirstAsync(a => a.Id == input.Id);
|
||||
@ -120,5 +126,6 @@ public class TrackStatusService : ApplicationService, ITransientDependency
|
||||
|
||||
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@ -1,8 +1,7 @@
|
||||
using System.Linq.Expressions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SJZY.Expand.ABP.Core.Localization;
|
||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
||||
using SJZY.Track.Application.Localization;
|
||||
using SJZY.Track.Domain.Aggregates.TrackTemplateAggregate;
|
||||
using SJZY.Track.Domain.Dtos.TrackTemplate;
|
||||
@ -85,12 +84,16 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
||||
private async Task<UnifyResultDto> AddAsync(EditTrackTemplateInput input)
|
||||
{
|
||||
#region 业务校验
|
||||
|
||||
//校验模版代码唯一性
|
||||
var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.SubSystemId == input.SubSystemId &&a.Code==input.Code);
|
||||
var templateEntity =
|
||||
await _trackTemplateRepository.GetFirstAsync(
|
||||
a => a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
||||
if (templateEntity != null)
|
||||
{
|
||||
throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var entity = ObjectMapper.Map<EditTrackTemplateInput, TrackTemplateEntity>(input);
|
||||
@ -102,11 +105,14 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
||||
private async Task<UnifyResultDto> UpdateAsync(EditTrackTemplateInput input)
|
||||
{
|
||||
#region 业务校验
|
||||
var isExist = await _trackTemplateRepository.GetFirstAsync(a => a.Id!=input.Id && a.SubSystemId == input.SubSystemId &&a.Code==input.Code);
|
||||
|
||||
var isExist = await _trackTemplateRepository.GetFirstAsync(a =>
|
||||
a.Id != input.Id && a.SubSystemId == input.SubSystemId && a.Code == input.Code);
|
||||
if (isExist != null)
|
||||
{
|
||||
throw new BusinessException(message: _stringLocalizer["TemplateExist"]);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id);
|
||||
@ -119,8 +125,11 @@ public class TrackTemplateService : ApplicationService, ITransientDependency
|
||||
private async Task<UnifyResultDto> DeleteAsync(EditTrackTemplateInput input)
|
||||
{
|
||||
#region 业务校验
|
||||
|
||||
//到时候,得判断这个模版有没有在轨迹映射里面被使用过,如果被使用就抛出提示
|
||||
|
||||
#endregion
|
||||
|
||||
var isTrue = await _trackTemplateRepository.SoftDeleteAsync(x => x.Id == input.Id);
|
||||
|
||||
return new UnifyResultDto("200", "删除成功", isTrue);
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
using FluentValidation;
|
||||
using SJZY.Track.Application.Dtos.Demo;
|
||||
using SJZY.Track.Application.Contract.Dtos.Demo;
|
||||
|
||||
namespace SJZY.Track.Application.Validations.Demo
|
||||
{
|
||||
|
||||
public class SimpleValidateInputValidation : AbstractValidator<ValidateExecuteInput>, IValidationEnabled
|
||||
{
|
||||
public SimpleValidateInputValidation()
|
||||
@ -31,14 +30,14 @@ namespace SJZY.Track.Application.Validations.Demo
|
||||
RuleFor(x => x.LoginName).MinimumLength(6).WithMessage("登录账号不能小于6个字符!");
|
||||
|
||||
//正则表达式
|
||||
RuleFor(x => x.PassWord).Matches("^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[!@#$\\%\\^\\&\\*\\(\\)])[0-9a-zA-Z!@#$\\%\\^\\&\\*\\(\\)]{6,10}")
|
||||
RuleFor(x => x.PassWord)
|
||||
.Matches(
|
||||
"^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[!@#$\\%\\^\\&\\*\\(\\)])[0-9a-zA-Z!@#$\\%\\^\\&\\*\\(\\)]{6,10}")
|
||||
.WithMessage("密码必须同时包含数字、英文字母、特殊字符,且长度必须在6-10位之间");
|
||||
|
||||
//自定义校验规则,注意这里的校验仅限于模型参数级的校验,更复杂的业务校验应在业务层完成
|
||||
RuleFor(x => x.PassWordAgain).Must((data, context) =>
|
||||
{
|
||||
return data.PassWord == data.PassWordAgain;
|
||||
}).WithMessage("两次输入密码不一致!");
|
||||
RuleFor(x => x.PassWordAgain).Must((data, context) => { return data.PassWord == data.PassWordAgain; })
|
||||
.WithMessage("两次输入密码不一致!");
|
||||
|
||||
//数字类型校验
|
||||
RuleFor(x => x.MiniCount).LessThan(100).WithMessage("最小数量必须小于100");
|
||||
@ -50,19 +49,19 @@ namespace SJZY.Track.Application.Validations.Demo
|
||||
RuleFor(x => x.TotalQuota).ScalePrecision(2, 4, true).WithMessage("最大额度金额【整数位+小数位】不能超过4位,且小数位不能超过2位");
|
||||
|
||||
//条件分支
|
||||
When(x => x.Option == OptionType.修改 || x.Option == OptionType.删除, () =>
|
||||
When(x => x.Option == OptionType.修改 || x.Option == OptionType.删除,
|
||||
() =>
|
||||
{
|
||||
RuleFor(x => x.Id).NotNull().WithMessage("修改或删除时Id为必填参数!").GreaterThan(0).WithMessage("修改或删除时Id必须大于0!");
|
||||
RuleFor(x => x.Id).NotNull().WithMessage("修改或删除时Id为必填参数!").GreaterThan(0)
|
||||
.WithMessage("修改或删除时Id必须大于0!");
|
||||
});
|
||||
|
||||
//单个实体校验
|
||||
RuleFor(x => x.UserInfoInput).NotNull().WithMessage("用户信息为必填参数!").SetValidator(new UserInfoInputValidation());
|
||||
RuleFor(x => x.UserInfoInput).NotNull().WithMessage("用户信息为必填参数!")
|
||||
.SetValidator(new UserInfoInputValidation());
|
||||
|
||||
//集合校验
|
||||
RuleForEach(x => x.UserRoleInputList).SetValidator(new UserRoleInputValidation());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
using FluentValidation;
|
||||
using SJZY.Track.Application.Dtos.Demo;
|
||||
|
||||
using SJZY.Track.Application.Contract.Dtos.Demo;
|
||||
|
||||
namespace SJZY.Track.Application.Validations.Demo
|
||||
{
|
||||
@ -10,6 +9,5 @@ namespace SJZY.Track.Application.Validations.Demo
|
||||
{
|
||||
RuleFor(x => x.QQ).NotNull().WithMessage("QQ号码不能为空");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
using FluentValidation;
|
||||
using SJZY.Track.Application.Dtos.Demo;
|
||||
using SJZY.Track.Application.Contract.Dtos.Demo;
|
||||
|
||||
namespace SJZY.Track.Application.Validations.Demo
|
||||
{
|
||||
|
||||
@ -1,11 +1,5 @@
|
||||
using FluentValidation;
|
||||
using SJZY.Track.Application.Dtos.TrackContents;
|
||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||
|
||||
namespace SJZY.Track.Application.Validations.TrackContents
|
||||
{
|
||||
@ -14,15 +8,10 @@ namespace SJZY.Track.Application.Validations.TrackContents
|
||||
public EditTrackContentInputValidation()
|
||||
{
|
||||
//条件分支
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, () =>
|
||||
{
|
||||
RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!");
|
||||
});
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除,
|
||||
() => { RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); });
|
||||
|
||||
When(x => x.Options == OptionType.新增, () =>
|
||||
{
|
||||
RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!");
|
||||
});
|
||||
When(x => x.Options == OptionType.新增, () => { RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); });
|
||||
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.新增, () =>
|
||||
{
|
||||
@ -33,6 +22,5 @@ namespace SJZY.Track.Application.Validations.TrackContents
|
||||
RuleFor(x => x.EnContent).NotNull().WithMessage("轨迹内容英文必填!").NotEmpty().WithMessage("轨迹内容英文不能为空!");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,5 @@
|
||||
using FluentValidation;
|
||||
using SJZY.Track.Application.Dtos.TrackFlags;
|
||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackFlags;
|
||||
|
||||
namespace SJZY.Track.Application.Validations.TrackFlags
|
||||
{
|
||||
@ -14,15 +8,10 @@ namespace SJZY.Track.Application.Validations.TrackFlags
|
||||
public EditTrackFlagInputValidation()
|
||||
{
|
||||
//条件分支
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, () =>
|
||||
{
|
||||
RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!");
|
||||
});
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除,
|
||||
() => { RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); });
|
||||
|
||||
When(x => x.Options == OptionType.新增, () =>
|
||||
{
|
||||
RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!");
|
||||
});
|
||||
When(x => x.Options == OptionType.新增, () => { RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); });
|
||||
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.新增, () =>
|
||||
{
|
||||
|
||||
@ -1,11 +1,5 @@
|
||||
using FluentValidation;
|
||||
using SJZY.Track.Application.Dtos.TrackContents;
|
||||
using SJZY.Track.Application.Dtos.TrackStatus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackStatus;
|
||||
|
||||
namespace SJZY.Track.Application.Validations.TrackStatus
|
||||
{
|
||||
@ -14,15 +8,10 @@ namespace SJZY.Track.Application.Validations.TrackStatus
|
||||
public EditTrackStatusInputValidation()
|
||||
{
|
||||
//条件分支
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, () =>
|
||||
{
|
||||
RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!");
|
||||
});
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除,
|
||||
() => { RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); });
|
||||
|
||||
When(x => x.Options == OptionType.新增, () =>
|
||||
{
|
||||
RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!");
|
||||
});
|
||||
When(x => x.Options == OptionType.新增, () => { RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); });
|
||||
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.新增, () =>
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using FluentValidation;
|
||||
using SJZY.Track.Application.Dtos.TrackTemplates;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackTemplates;
|
||||
|
||||
namespace SJZY.Track.Application.Validations.TrackTemplates
|
||||
{
|
||||
@ -11,16 +11,10 @@ namespace SJZY.Track.Application.Validations.TrackTemplates
|
||||
public EditTrackTemplateInputValidation()
|
||||
{
|
||||
//条件分支
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除, () =>
|
||||
{
|
||||
RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!");
|
||||
});
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.删除,
|
||||
() => { RuleFor(x => x.Id).GreaterThan(0).WithMessage("修改或删除时Id必须大于0!"); });
|
||||
|
||||
When(x => x.Options == OptionType.新增, () =>
|
||||
{
|
||||
RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!");
|
||||
|
||||
});
|
||||
When(x => x.Options == OptionType.新增, () => { RuleFor(x => x.Id).Equal(0).WithMessage("新增时Id必须等于0!"); });
|
||||
|
||||
When(x => x.Options == OptionType.修改 || x.Options == OptionType.新增, () =>
|
||||
{
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
using SJZY.Expand.ABP.Core.Common.Dto;
|
||||
using SJZY.Track.HttpApi.Dtos;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.DependencyInjection;
|
||||
|
||||
namespace SJZY.Track.HttpApi.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 客户端连接测试接口
|
||||
/// </summary>
|
||||
public interface IRemoteDemoService : IRemoteService, IScopedDependency
|
||||
{
|
||||
Task<UnifyResultDto<RemoteDemoOutput>> ConnectionTest(RemoteDemoInput input);
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,4 @@
|
||||
|
||||
using SJZY.Track.Application.Dtos.Demo;
|
||||
using SJZY.Track.Application.Contract.Dtos.Demo;
|
||||
using SJZY.Track.Application.Services.Demo;
|
||||
|
||||
namespace SJZY.OpenApi.Test.Demo
|
||||
@ -7,11 +6,14 @@ namespace SJZY.OpenApi.Test.Demo
|
||||
public class DemoTest : TestModuleTestBase
|
||||
{
|
||||
#region 构造函数
|
||||
|
||||
private InterFaceDemoService _interFaceDemoService;
|
||||
|
||||
public DemoTest()
|
||||
{
|
||||
_interFaceDemoService = GetRequiredService<InterFaceDemoService>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[Fact]
|
||||
@ -23,6 +25,5 @@ namespace SJZY.OpenApi.Test.Demo
|
||||
|
||||
Assert.NotNull(res);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user