From c5e8d65906185e5ec919a488382f3178d1616051 Mon Sep 17 00:00:00 2001 From: moyongzhen <2534173414@qq.com> Date: Tue, 27 Feb 2024 15:19:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrackTemplateAutoMapperProfile.cs | 8 +- .../TrackTemplates/TrackTemplateService.cs | 197 +++++++++--------- .../Dtos/GetPageTrackTemplateVO.cs | 14 ++ .../Dtos/GetTrackTemplateDetailVO.cs | 63 ++++++ .../ITrackTemplateRepository.cs | 4 + .../VEntities}/VExternalSubjectEntity.cs | 0 .../VEntities/VServiceProviderEntity.cs | 76 +++++++ .../VEntities/VSystemEntity.cs | 154 ++++++++++++++ .../VEntities/VUserEntity.cs | 106 ++++++++++ .../Services/TrackTemplateRepository.cs | 58 ------ .../ValueObjects/GetPageTrackTemplateVO.cs | 21 -- .../ValueObjects/GetTrackTemplateDetailVO.cs | 70 ------- .../TrackTemplateRepository.cs | 59 +++++- .../VData/Entitys/VServiceProviderEntity.cs | 77 ------- .../VData/Entitys/VSystemEntity.cs | 155 -------------- .../VData/Entitys/VUserEntity.cs | 107 ---------- .../Services/ExternalSubjectRepository.cs | 9 - .../Services/IExternalSubjectRepository.cs | 9 - .../Services/IServiceProviderRepository.cs | 9 - .../VData/Services/ISystemRepository.cs | 9 - .../VData/Services/IUserRepository.cs | 9 - .../Services/ServiceProviderRepository.cs | 9 - .../VData/Services/SystemRepository.cs | 9 - .../VData/Services/UserRepository.cs | 9 - 24 files changed, 566 insertions(+), 675 deletions(-) create mode 100644 src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetPageTrackTemplateVO.cs create mode 100644 src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetTrackTemplateDetailVO.cs rename src/{SJZY.Track.Repository/VData/Entitys => SJZY.Track.Domain/VEntities}/VExternalSubjectEntity.cs (100%) create mode 100644 src/SJZY.Track.Domain/VEntities/VServiceProviderEntity.cs create mode 100644 src/SJZY.Track.Domain/VEntities/VSystemEntity.cs create mode 100644 src/SJZY.Track.Domain/VEntities/VUserEntity.cs delete mode 100644 src/SJZY.Track.Repository/TrackTemplate/Services/TrackTemplateRepository.cs delete mode 100644 src/SJZY.Track.Repository/TrackTemplate/ValueObjects/GetPageTrackTemplateVO.cs delete mode 100644 src/SJZY.Track.Repository/TrackTemplate/ValueObjects/GetTrackTemplateDetailVO.cs delete mode 100644 src/SJZY.Track.Repository/VData/Entitys/VServiceProviderEntity.cs delete mode 100644 src/SJZY.Track.Repository/VData/Entitys/VSystemEntity.cs delete mode 100644 src/SJZY.Track.Repository/VData/Entitys/VUserEntity.cs delete mode 100644 src/SJZY.Track.Repository/VData/Services/ExternalSubjectRepository.cs delete mode 100644 src/SJZY.Track.Repository/VData/Services/IExternalSubjectRepository.cs delete mode 100644 src/SJZY.Track.Repository/VData/Services/IServiceProviderRepository.cs delete mode 100644 src/SJZY.Track.Repository/VData/Services/ISystemRepository.cs delete mode 100644 src/SJZY.Track.Repository/VData/Services/IUserRepository.cs delete mode 100644 src/SJZY.Track.Repository/VData/Services/ServiceProviderRepository.cs delete mode 100644 src/SJZY.Track.Repository/VData/Services/SystemRepository.cs delete mode 100644 src/SJZY.Track.Repository/VData/Services/UserRepository.cs diff --git a/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs b/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs index f715d0cf..e581521f 100644 --- a/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs +++ b/src/SJZY.Track.Application/AutoMapper/TrackTemplateAutoMapperProfile.cs @@ -1,12 +1,6 @@ using AutoMapper; -using SJZY.Track.Application.Dtos.Demo; using SJZY.Track.Application.Dtos.TrackTemplates; -using SJZY.Track.Repository.TrackTemplate.ValueObjects; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using SJZY.Track.Domain.TrackTemplateAggregate.Dtos; namespace SJZY.Track.Application.AutoMapper { diff --git a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs index e74dbe83..3421669c 100644 --- a/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs +++ b/src/SJZY.Track.Application/Services/TrackTemplates/TrackTemplateService.cs @@ -1,107 +1,102 @@ -using SJZY.Expand.ABP.Core.Common.Dto; -using SJZY.Track.Application.Dtos.TrackTemplates; -using SJZY.Track.Repository.TrackTemplate.Entitys; -using SJZY.Track.Repository.TrackTemplate.Services; -using SJZY.Track.Repository.TrackTemplate.ValueObjects; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using SJZY.Track.Application.Dtos.TrackTemplates; using SJZY.Track.Domain.TrackTemplateAggregate; +using SJZY.Track.Domain.TrackTemplateAggregate.Dtos; using Volo.Abp.DependencyInjection; -using Volo.Abp.ObjectMapping; -namespace SJZY.Track.Application.Services.TrackTemplates +namespace SJZY.Track.Application.Services.TrackTemplates; + +/// +/// 轨迹模版 +/// +[ApiExplorerSettings(GroupName = "轨迹模版")] +[Route("/Track")] +public class TrackTemplateService : ApplicationService, ITrackTemplateService, IScopedDependency { - /// - /// 轨迹模版 - /// - [ApiExplorerSettings(GroupName = "轨迹模版")] - [Route("/Track")] - public class TrackTemplateService : ApplicationService, ITrackTemplateService, IScopedDependency + private readonly ITrackTemplateRepository _trackTemplateRepository; + + public TrackTemplateService( + ITrackTemplateRepository trackTemplateRepository + ) { - private readonly ITrackTemplateRepository _trackTemplateRepository; - - public TrackTemplateService( - ITrackTemplateRepository trackTemplateRepository - ) - { - this._trackTemplateRepository=trackTemplateRepository; - } - - /// - /// 轨迹模版编辑 - /// - /// - [HttpPost("/Template/Edit")] - public async Task EditAsync(EditTrackTemplateInput input) - { - return input.Options switch - { - OptionType.新增 => await AddAsync(input), - OptionType.修改 => await UpdateAsync(input), - OptionType.删除 => await DeleteAsync(input), - _ => throw new BusinessException(message: "当前操作动作不合法") - }; - } - - /// - /// 根据模版id获取轨迹模版 - /// - /// - /// - [HttpGet("/Template/GetDetail")] - public async Task> GetDetailAsync(int id) - { - var detailInfo = await _trackTemplateRepository.GetDetailAsync(id); - if (detailInfo==null) - { - return new UnifyResultDto(false, null, "未查询到轨迹模版"); - } - var dto = ObjectMapper.Map(detailInfo); - return new UnifyResultDto("200", "", dto); - } - - /// - /// 获取分页轨迹模版 - /// - /// - /// - [HttpPost("/Template/GetList")] - public async Task> GetPageTrackTemplate(GetPageTrackTemplateInput input) - { - var vo = ObjectMapper.Map(input); - var resultDto = await _trackTemplateRepository.GetPageTrackTemplate(vo); - var pageResultDto = ObjectMapper.Map, UnifyPageResultDto>(resultDto); - - return pageResultDto; - } - - #region 私有方法 - private async Task AddAsync(EditTrackTemplateInput input) - { - var entity = ObjectMapper.Map(input); - var isTrue = await _trackTemplateRepository.InsertAsync(entity); - - return new UnifyResultDto("200", "新增成功", isTrue); - } - - private async Task UpdateAsync(EditTrackTemplateInput input) - { - var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id==input.Id); - ObjectMapper.Map(input, templateEntity); - var isTrue = await _trackTemplateRepository.UpdateAsync(templateEntity); - - return new UnifyResultDto("200", "修改成功", isTrue); - } - - private async Task DeleteAsync(EditTrackTemplateInput input) - { - var isTrue = await _trackTemplateRepository.DeleteByIdAsync(input.Id); - - return new UnifyResultDto("200", "删除成功", isTrue); - } - #endregion + _trackTemplateRepository = trackTemplateRepository; } -} + + /// + /// 轨迹模版编辑 + /// + /// + [HttpPost("/Template/Edit")] + public async Task EditAsync(EditTrackTemplateInput input) + { + return input.Options switch + { + OptionType.新增 => await AddAsync(input), + OptionType.修改 => await UpdateAsync(input), + OptionType.删除 => await DeleteAsync(input), + _ => throw new BusinessException(message: "当前操作动作不合法") + }; + } + + /// + /// 根据模版id获取轨迹模版 + /// + /// + /// + [HttpGet("/Template/GetDetail")] + public async Task> GetDetailAsync(int id) + { + var detailInfo = await _trackTemplateRepository.GetDetailAsync(id); + if (detailInfo == null) + { + return new UnifyResultDto(false, null, "未查询到轨迹模版"); + } + + var dto = ObjectMapper.Map(detailInfo); + return new UnifyResultDto("200", "", dto); + } + + /// + /// 获取分页轨迹模版 + /// + /// + /// + [HttpPost("/Template/GetList")] + public async Task> GetPageTrackTemplate(GetPageTrackTemplateInput input) + { + var vo = ObjectMapper.Map(input); + var resultDto = await _trackTemplateRepository.GetPageTrackTemplate(vo); + var pageResultDto = + ObjectMapper.Map, UnifyPageResultDto>( + resultDto); + + return pageResultDto; + } + + #region 私有方法 + + private async Task AddAsync(EditTrackTemplateInput input) + { + var entity = ObjectMapper.Map(input); + var isTrue = await _trackTemplateRepository.InsertAsync(entity); + + return new UnifyResultDto("200", "新增成功", isTrue); + } + + private async Task UpdateAsync(EditTrackTemplateInput input) + { + var templateEntity = await _trackTemplateRepository.GetFirstAsync(a => a.Id == input.Id); + ObjectMapper.Map(input, templateEntity); + var isTrue = await _trackTemplateRepository.UpdateAsync(templateEntity); + + return new UnifyResultDto("200", "修改成功", isTrue); + } + + private async Task DeleteAsync(EditTrackTemplateInput input) + { + var isTrue = await _trackTemplateRepository.SoftDeleteAsync(x => x.Id == input.Id); + + return new UnifyResultDto("200", "删除成功", isTrue); + } + + #endregion +} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetPageTrackTemplateVO.cs b/src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetPageTrackTemplateVO.cs new file mode 100644 index 00000000..88e54c4f --- /dev/null +++ b/src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetPageTrackTemplateVO.cs @@ -0,0 +1,14 @@ +namespace SJZY.Track.Domain.TrackTemplateAggregate.Dtos; + +public class GetPageTrackTemplateVO: PageInfoInput +{ + /// + /// 子系统id + /// + public int SubSystemId { get; set; } + + /// + /// 关键字 + /// + public string Keywords { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetTrackTemplateDetailVO.cs b/src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetTrackTemplateDetailVO.cs new file mode 100644 index 00000000..72e19fcf --- /dev/null +++ b/src/SJZY.Track.Domain/TrackTemplateAggregate/Dtos/GetTrackTemplateDetailVO.cs @@ -0,0 +1,63 @@ +namespace SJZY.Track.Domain.TrackTemplateAggregate.Dtos; + +/// +/// 获取轨迹模版明细 +/// +public class GetTrackTemplateDetailVO +{ + /// + /// Id + /// + public int Id { get; set; } + + /// + /// 子系统id + /// + public int SubSystemId { get; set; } + + /// + /// 子系统 + /// + public string SubSystem { get; set; } + + /// + /// 模版名称 + /// + public string Name { get; set; } + + /// + /// 模版代码 + /// + public string Code { get; set; } +} + +/// +/// 获取轨迹模版列表 +/// +public class GetTrackTemplateListVO +{ + /// + /// 轨迹模版id + /// + public int Id { get; set; } + + /// + /// 模板名称 + /// + public string Name { set; get; } + + /// + /// 模版代码 + /// + public string Code { get; set; } + + /// + /// 所属子系统 + /// + public string SubSystem { set; get; } + + /// + /// 创建时间 + /// + public DateTime? CreateTime { get; set; } +} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/TrackTemplateAggregate/ITrackTemplateRepository.cs b/src/SJZY.Track.Domain/TrackTemplateAggregate/ITrackTemplateRepository.cs index ffa1a742..4a27aa53 100644 --- a/src/SJZY.Track.Domain/TrackTemplateAggregate/ITrackTemplateRepository.cs +++ b/src/SJZY.Track.Domain/TrackTemplateAggregate/ITrackTemplateRepository.cs @@ -5,4 +5,8 @@ namespace SJZY.Track.Domain.TrackTemplateAggregate; public interface ITrackTemplateRepository : IBasicRepository { Task GetTemplateContentsAsync(List distinctTemplateIds); + + Task GetDetailAsync(int id); + + Task> GetPageTrackTemplate(GetPageTrackTemplateVO input); } \ No newline at end of file diff --git a/src/SJZY.Track.Repository/VData/Entitys/VExternalSubjectEntity.cs b/src/SJZY.Track.Domain/VEntities/VExternalSubjectEntity.cs similarity index 100% rename from src/SJZY.Track.Repository/VData/Entitys/VExternalSubjectEntity.cs rename to src/SJZY.Track.Domain/VEntities/VExternalSubjectEntity.cs diff --git a/src/SJZY.Track.Domain/VEntities/VServiceProviderEntity.cs b/src/SJZY.Track.Domain/VEntities/VServiceProviderEntity.cs new file mode 100644 index 00000000..eb9c74a4 --- /dev/null +++ b/src/SJZY.Track.Domain/VEntities/VServiceProviderEntity.cs @@ -0,0 +1,76 @@ +namespace SJZY.Track.Domain.VEntities; + +/// +/// 服务商主表 +/// +[SugarTable("v_service_provider")] +public class VServiceProviderEntity : IFullAuditedBasicEntitys +{ + + /// + /// 自增主键 + /// + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 授权接口Code + /// + [SugarColumn(ColumnName = "AuthInterfaceCode")] + public string AuthInterfaceCode { get; set; } + + /// + /// 服务商代码 + /// + [SugarColumn(ColumnName = "Code")] + public string Code { get; set; } + + /// + /// 描述 + /// + [SugarColumn(ColumnName = "Description")] + public string Description { get; set; } + + /// + /// 流程代码 + /// + [SugarColumn(ColumnName = "FlowCode")] + public string FlowCode { get; set; } + + /// + /// 是否禁用账户验证 + /// + [SugarColumn(ColumnName = "IsDisableAuth")] + public bool IsDisableAuth { get; set; } + + /// + /// 服务商名称 + /// + [SugarColumn(ColumnName = "Name")] + public string Name { get; set; } + + /// + /// 请求超时(s) + /// + [SugarColumn(ColumnName = "Timeout")] + public int? Timeout { get; set; } + + /// + /// 轨迹时区 + /// + [SugarColumn(ColumnName = "TraceTimeZone")] + public string TraceTimeZone { get; set; } + + /// + /// 服务商类型(弃用) + /// + [SugarColumn(ColumnName = "Type")] + public int Type { get; set; } + + /// + /// 服务商类型(多选) + /// + [SugarColumn(ColumnName = "Types")] + public string Types { get; set; } + +} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/VEntities/VSystemEntity.cs b/src/SJZY.Track.Domain/VEntities/VSystemEntity.cs new file mode 100644 index 00000000..a7166a5b --- /dev/null +++ b/src/SJZY.Track.Domain/VEntities/VSystemEntity.cs @@ -0,0 +1,154 @@ +namespace SJZY.Track.Domain.VEntities; + +/// +/// +/// +[SugarTable("v_system")] +public class VSystemEntity : IFullAuditedBasicEntitys +{ + + /// + /// 子系统id + /// + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 关联的内部子系统 + /// + [SugarColumn(ColumnName = "AssociatedInternalSubsystem")] + public int? AssociatedInternalSubsystem { get; set; } + + /// + /// 子系统授权类型(1.标准 2.因素) + /// + [SugarColumn(ColumnName = "AuthType")] + public bool AuthType { get; set; } + + /// + /// 中文名 + /// + [SugarColumn(ColumnName = "CnName")] + public string CnName { get; set; } + + /// + /// 备注 + /// + [SugarColumn(ColumnName = "Comment")] + public string Comment { get; set; } + + /// + /// 安装包下载链接,当类型为安装包时,必填 + /// + [SugarColumn(ColumnName = "DownloadUrl")] + public string DownloadUrl { get; set; } + + /// + /// 英文名 + /// + [SugarColumn(ColumnName = "EnName")] + public string EnName { get; set; } + + /// + /// 飞书应用ID + /// + [SugarColumn(ColumnName = "FsAppId")] + public string FsAppId { get; set; } + + /// + /// 欠费允许下单(默认为是) + /// + [SugarColumn(ColumnName = "IsAllowPlaceOrder")] + public bool? IsAllowPlaceOrder { get; set; } + + /// + /// 是否开通授信 + /// + [SugarColumn(ColumnName = "IsCredit")] + public bool? IsCredit { get; set; } + + /// + /// 是否启用 + /// + [SugarColumn(ColumnName = "IsEnable")] + public bool IsEnable { get; set; } + + /// + /// 是否启用业务主体(判断登录是否选择业务主体) + /// + [SugarColumn(ColumnName = "IsEnableBusiness")] + public bool? IsEnableBusiness { get; set; } + + /// + /// 是否结束初始化 + /// + [SugarColumn(ColumnName = "IsEndInit")] + public bool IsEndInit { get; set; } + + /// + /// 是否开通余额 + /// + [SugarColumn(ColumnName = "IsOpenBalance")] + public bool IsOpenBalance { get; set; } + + /// + /// 子系统唯一值 + /// + [SugarColumn(ColumnName = "Key")] + public string Key { get; set; } + + /// + /// 子系统Logo图标 + /// + [SugarColumn(ColumnName = "LogoIcon")] + public string LogoIcon { get; set; } + + /// + /// 主账号Id + /// + [SugarColumn(ColumnName = "MainUserId")] + public int? MainUserId { get; set; } + + /// + /// 移动端链接 + /// + [SugarColumn(ColumnName = "MobileUrl")] + public string MobileUrl { get; set; } + + /// + /// 运营主体 + /// + [SugarColumn(ColumnName = "OperatingSubject")] + public int? OperatingSubject { get; set; } + + /// + /// 排序值 + /// + [SugarColumn(ColumnName = "Sort")] + public int? Sort { get; set; } + + /// + /// 跨境电商物流1 干线物流2 国内代理贸易3 非业务类4 + /// + [SugarColumn(ColumnName = "SysBusinessType")] + public int? SysBusinessType { get; set; } + + /// + /// 系统所属1:内部 2:外部 + /// + [SugarColumn(ColumnName = "SystemProperty")] + public int SystemProperty { get; set; } + + /// + /// 子系统类型:1-Web、2-安装包exe + /// + [SugarColumn(ColumnName = "SystemType")] + public int? SystemType { get; set; } + + /// + /// 子系统token + /// + [SugarColumn(ColumnName = "Token")] + public string Token { get; set; } + +} \ No newline at end of file diff --git a/src/SJZY.Track.Domain/VEntities/VUserEntity.cs b/src/SJZY.Track.Domain/VEntities/VUserEntity.cs new file mode 100644 index 00000000..eee0b80d --- /dev/null +++ b/src/SJZY.Track.Domain/VEntities/VUserEntity.cs @@ -0,0 +1,106 @@ +namespace SJZY.Track.Domain.VEntities; + +/// +/// 用户信息表 +/// +[SugarTable("v_user")] +public class VUserEntity : IFullAuditedBasicEntitys +{ + + /// + /// 用户id + /// + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] + public int Id { get; set; } + + /// + /// 账号 + /// + [SugarColumn(ColumnName = "Account")] + public string Account { get; set; } + + /// + /// 公司Id + /// + [SugarColumn(ColumnName = "CompanyId")] + public int? CompanyId { get; set; } + + /// + /// 国际区号 + /// + [SugarColumn(ColumnName = "CountryCode")] + public string CountryCode { get; set; } + + /// + /// 默认语言枚举 + /// + [SugarColumn(ColumnName = "DefaultLang")] + public bool? DefaultLang { get; set; } + + /// + /// 部门Id + /// + [SugarColumn(ColumnName = "DeptId")] + public int? DeptId { get; set; } + + /// + /// 员工id + /// + [SugarColumn(ColumnName = "EmployeeId")] + public int? EmployeeId { get; set; } + + /// + /// 英文名 + /// + [SugarColumn(ColumnName = "EnName")] + public string EnName { get; set; } + + /// + /// 是否业务员 + /// + [SugarColumn(ColumnName = "IsBusiness")] + public bool? IsBusiness { get; set; } + + /// + /// 是否启用 + /// + [SugarColumn(ColumnName = "IsEnable")] + public bool IsEnable { get; set; } + + /// + /// 固定电话(座机号码) + /// + [SugarColumn(ColumnName = "LandlinePhone")] + public string LandlinePhone { get; set; } + + /// + /// 姓名 + /// + [SugarColumn(ColumnName = "Name")] + public string Name { get; set; } + + /// + /// 用户直接组织节点Id + /// + [SugarColumn(ColumnName = "OrgId")] + public int? OrgId { get; set; } + + /// + /// 密码 + /// + [SugarColumn(ColumnName = "PassWord")] + public string PassWord { get; set; } + + /// + /// 绑定手机号 + /// + [SugarColumn(ColumnName = "TelPhone")] + public string TelPhone { get; set; } + + /// + /// 用户来源(1.员工入职 2.手动添加 3.其他) + /// + [SugarColumn(ColumnName = "UserOrigin")] + public bool? UserOrigin { get; set; } + +} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/TrackTemplate/Services/TrackTemplateRepository.cs b/src/SJZY.Track.Repository/TrackTemplate/Services/TrackTemplateRepository.cs deleted file mode 100644 index 7a91300d..00000000 --- a/src/SJZY.Track.Repository/TrackTemplate/Services/TrackTemplateRepository.cs +++ /dev/null @@ -1,58 +0,0 @@ -using SJZY.Track.Repository.TrackTemplate.Entitys; -using SJZY.Track.Repository.TrackTemplate.ValueObjects; -using SJZY.Track.Repository.VData.Entitys; - -namespace SJZY.Track.Repository.TrackTemplate.Services -{ - public class TrackTemplateRepository : BasicRepository, ITrackTemplateRepository, IScopedDependency - { - public TrackTemplateRepository() - { - } - - /// - /// 获取轨迹模版明细 - /// - /// - /// - public async Task GetDetailAsync(int id) - { - var detail = await Context.Queryable().LeftJoin((a, b) => a.SubSystemId==b.Id) - .Where((a, b) => a.Id==id) - .Select((a, b) => new - GetTrackTemplateDetailVO - { - Id = a.Id, - Code = a.Code, - Name = a.Name, - SubSystemId = a.SubSystemId, - SubSystem=b.CnName - }).FirstAsync(); - - return detail; - } - - - /// - /// 分页获取轨迹模版 - /// - /// - /// - public async Task> GetPageTrackTemplate(GetPageTrackTemplateVO input) - { - var pagedList = await Context.Queryable().LeftJoin((a, b) => a.SubSystemId==b.Id) - .WhereIF(input.SubSystemId>0, (a, b) => a.SubSystemId==input.SubSystemId) - .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b) => a.Name.Contains(input.Keywords)|| a.Code.Contains(input.Keywords)) - .Select((a, b) => new GetTrackTemplateListVO - { - Id=a.Id, - Code=a.Code, - CreateTime= a.CreateTime, - Name = a.Name, - SubSystem = b.CnName - }) - .ToPagedListAsync(input.PageIndex, input.PageSize); - return pagedList; - } - } -} diff --git a/src/SJZY.Track.Repository/TrackTemplate/ValueObjects/GetPageTrackTemplateVO.cs b/src/SJZY.Track.Repository/TrackTemplate/ValueObjects/GetPageTrackTemplateVO.cs deleted file mode 100644 index 50c343e8..00000000 --- a/src/SJZY.Track.Repository/TrackTemplate/ValueObjects/GetPageTrackTemplateVO.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Repository.TrackTemplate.ValueObjects -{ - public class GetPageTrackTemplateVO : PageInfoInput - { - /// - /// 子系统id - /// - public int SubSystemId { get; set; } - - /// - /// 关键字 - /// - public string Keywords { get; set; } - } -} diff --git a/src/SJZY.Track.Repository/TrackTemplate/ValueObjects/GetTrackTemplateDetailVO.cs b/src/SJZY.Track.Repository/TrackTemplate/ValueObjects/GetTrackTemplateDetailVO.cs deleted file mode 100644 index b5393e84..00000000 --- a/src/SJZY.Track.Repository/TrackTemplate/ValueObjects/GetTrackTemplateDetailVO.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SJZY.Track.Repository.TrackTemplate.ValueObjects -{ - /// - /// 获取轨迹模版明细 - /// - public class GetTrackTemplateDetailVO - { - /// - /// Id - /// - public int Id { get; set; } - - /// - /// 子系统id - /// - public int SubSystemId { get; set; } - - /// - /// 子系统 - /// - public string SubSystem { get; set; } - - /// - /// 模版名称 - /// - public string Name { get; set; } - - /// - /// 模版代码 - /// - public string Code { get; set; } - } - - /// - /// 获取轨迹模版列表 - /// - public class GetTrackTemplateListVO - { - /// - /// 轨迹模版id - /// - public int Id { get; set; } - - /// - /// 模板名称 - /// - public string Name { set; get; } - - /// - /// 模版代码 - /// - public string Code { get; set; } - - /// - /// 所属子系统 - /// - public string SubSystem { set; get; } - - /// - /// 创建时间 - /// - public DateTime? CreateTime { get; set; } - } -} diff --git a/src/SJZY.Track.Repository/TrackTemplateRepository.cs b/src/SJZY.Track.Repository/TrackTemplateRepository.cs index 08370333..6ac4ef56 100644 --- a/src/SJZY.Track.Repository/TrackTemplateRepository.cs +++ b/src/SJZY.Track.Repository/TrackTemplateRepository.cs @@ -1,13 +1,58 @@ using SJZY.Track.Domain.TrackTemplateAggregate; using SJZY.Track.Domain.TrackTemplateAggregate.Dtos; +using SJZY.Track.Domain.VEntities; -namespace SJZY.Track.Repository.TrackTemplate +namespace SJZY.Track.Repository; + +public class TrackTemplateRepository : BasicRepository, ITrackTemplateRepository, IScopedDependency { - public class TrackTemplateRepository : BasicRepository, ITrackTemplateRepository, IScopedDependency + public Task GetTemplateContentsAsync(List distinctTemplateIds) { - public Task GetTemplateContentsAsync(List distinctTemplateIds) - { - throw new NotImplementedException(); - } + throw new NotImplementedException(); } -} + + /// + /// 获取轨迹模版明细 + /// + /// + /// + public async Task GetDetailAsync(int id) + { + var detail = await Context.Queryable().LeftJoin((a, b) => a.SubSystemId==b.Id) + .Where((a, b) => a.Id==id) + .Select((a, b) => new + GetTrackTemplateDetailVO + { + Id = a.Id, + Code = a.Code, + Name = a.Name, + SubSystemId = a.SubSystemId, + SubSystem=b.CnName + }).FirstAsync(); + + return detail; + } + + + /// + /// 分页获取轨迹模版 + /// + /// + /// + public async Task> GetPageTrackTemplate(GetPageTrackTemplateVO input) + { + var pagedList = await Context.Queryable().LeftJoin((a, b) => a.SubSystemId==b.Id) + .WhereIF(input.SubSystemId>0, (a, b) => a.SubSystemId==input.SubSystemId) + .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b) => a.Name.Contains(input.Keywords)|| a.Code.Contains(input.Keywords)) + .Select((a, b) => new GetTrackTemplateListVO + { + Id=a.Id, + Code=a.Code, + CreateTime= a.CreateTime, + Name = a.Name, + SubSystem = b.CnName + }) + .ToPagedListAsync(input.PageIndex, input.PageSize); + return pagedList; + } +} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/VData/Entitys/VServiceProviderEntity.cs b/src/SJZY.Track.Repository/VData/Entitys/VServiceProviderEntity.cs deleted file mode 100644 index 45a28246..00000000 --- a/src/SJZY.Track.Repository/VData/Entitys/VServiceProviderEntity.cs +++ /dev/null @@ -1,77 +0,0 @@ -namespace SJZY.Track.Repository.VData.Entitys -{ - /// - /// 服务商主表 - /// - [SugarTable("v_service_provider")] - public class VServiceProviderEntity : IFullAuditedBasicEntitys - { - - /// - /// 自增主键 - /// - [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - - /// - /// 授权接口Code - /// - [SugarColumn(ColumnName = "AuthInterfaceCode")] - public string AuthInterfaceCode { get; set; } - - /// - /// 服务商代码 - /// - [SugarColumn(ColumnName = "Code")] - public string Code { get; set; } - - /// - /// 描述 - /// - [SugarColumn(ColumnName = "Description")] - public string Description { get; set; } - - /// - /// 流程代码 - /// - [SugarColumn(ColumnName = "FlowCode")] - public string FlowCode { get; set; } - - /// - /// 是否禁用账户验证 - /// - [SugarColumn(ColumnName = "IsDisableAuth")] - public bool IsDisableAuth { get; set; } - - /// - /// 服务商名称 - /// - [SugarColumn(ColumnName = "Name")] - public string Name { get; set; } - - /// - /// 请求超时(s) - /// - [SugarColumn(ColumnName = "Timeout")] - public int? Timeout { get; set; } - - /// - /// 轨迹时区 - /// - [SugarColumn(ColumnName = "TraceTimeZone")] - public string TraceTimeZone { get; set; } - - /// - /// 服务商类型(弃用) - /// - [SugarColumn(ColumnName = "Type")] - public int Type { get; set; } - - /// - /// 服务商类型(多选) - /// - [SugarColumn(ColumnName = "Types")] - public string Types { get; set; } - - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/VData/Entitys/VSystemEntity.cs b/src/SJZY.Track.Repository/VData/Entitys/VSystemEntity.cs deleted file mode 100644 index 76e5fcdb..00000000 --- a/src/SJZY.Track.Repository/VData/Entitys/VSystemEntity.cs +++ /dev/null @@ -1,155 +0,0 @@ -namespace SJZY.Track.Repository.VData.Entitys -{ - /// - /// - /// - [SugarTable("v_system")] - public class VSystemEntity : IFullAuditedBasicEntitys - { - - /// - /// 子系统id - /// - [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - - /// - /// 关联的内部子系统 - /// - [SugarColumn(ColumnName = "AssociatedInternalSubsystem")] - public int? AssociatedInternalSubsystem { get; set; } - - /// - /// 子系统授权类型(1.标准 2.因素) - /// - [SugarColumn(ColumnName = "AuthType")] - public bool AuthType { get; set; } - - /// - /// 中文名 - /// - [SugarColumn(ColumnName = "CnName")] - public string CnName { get; set; } - - /// - /// 备注 - /// - [SugarColumn(ColumnName = "Comment")] - public string Comment { get; set; } - - /// - /// 安装包下载链接,当类型为安装包时,必填 - /// - [SugarColumn(ColumnName = "DownloadUrl")] - public string DownloadUrl { get; set; } - - /// - /// 英文名 - /// - [SugarColumn(ColumnName = "EnName")] - public string EnName { get; set; } - - /// - /// 飞书应用ID - /// - [SugarColumn(ColumnName = "FsAppId")] - public string FsAppId { get; set; } - - /// - /// 欠费允许下单(默认为是) - /// - [SugarColumn(ColumnName = "IsAllowPlaceOrder")] - public bool? IsAllowPlaceOrder { get; set; } - - /// - /// 是否开通授信 - /// - [SugarColumn(ColumnName = "IsCredit")] - public bool? IsCredit { get; set; } - - /// - /// 是否启用 - /// - [SugarColumn(ColumnName = "IsEnable")] - public bool IsEnable { get; set; } - - /// - /// 是否启用业务主体(判断登录是否选择业务主体) - /// - [SugarColumn(ColumnName = "IsEnableBusiness")] - public bool? IsEnableBusiness { get; set; } - - /// - /// 是否结束初始化 - /// - [SugarColumn(ColumnName = "IsEndInit")] - public bool IsEndInit { get; set; } - - /// - /// 是否开通余额 - /// - [SugarColumn(ColumnName = "IsOpenBalance")] - public bool IsOpenBalance { get; set; } - - /// - /// 子系统唯一值 - /// - [SugarColumn(ColumnName = "Key")] - public string Key { get; set; } - - /// - /// 子系统Logo图标 - /// - [SugarColumn(ColumnName = "LogoIcon")] - public string LogoIcon { get; set; } - - /// - /// 主账号Id - /// - [SugarColumn(ColumnName = "MainUserId")] - public int? MainUserId { get; set; } - - /// - /// 移动端链接 - /// - [SugarColumn(ColumnName = "MobileUrl")] - public string MobileUrl { get; set; } - - /// - /// 运营主体 - /// - [SugarColumn(ColumnName = "OperatingSubject")] - public int? OperatingSubject { get; set; } - - /// - /// 排序值 - /// - [SugarColumn(ColumnName = "Sort")] - public int? Sort { get; set; } - - /// - /// 跨境电商物流1 干线物流2 国内代理贸易3 非业务类4 - /// - [SugarColumn(ColumnName = "SysBusinessType")] - public int? SysBusinessType { get; set; } - - /// - /// 系统所属1:内部 2:外部 - /// - [SugarColumn(ColumnName = "SystemProperty")] - public int SystemProperty { get; set; } - - /// - /// 子系统类型:1-Web、2-安装包exe - /// - [SugarColumn(ColumnName = "SystemType")] - public int? SystemType { get; set; } - - /// - /// 子系统token - /// - [SugarColumn(ColumnName = "Token")] - public string Token { get; set; } - - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/VData/Entitys/VUserEntity.cs b/src/SJZY.Track.Repository/VData/Entitys/VUserEntity.cs deleted file mode 100644 index 1049171f..00000000 --- a/src/SJZY.Track.Repository/VData/Entitys/VUserEntity.cs +++ /dev/null @@ -1,107 +0,0 @@ -namespace SJZY.Track.Repository.VData.Entitys -{ - /// - /// 用户信息表 - /// - [SugarTable("v_user")] - public class VUserEntity : IFullAuditedBasicEntitys - { - - /// - /// 用户id - /// - [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - - /// - /// 账号 - /// - [SugarColumn(ColumnName = "Account")] - public string Account { get; set; } - - /// - /// 公司Id - /// - [SugarColumn(ColumnName = "CompanyId")] - public int? CompanyId { get; set; } - - /// - /// 国际区号 - /// - [SugarColumn(ColumnName = "CountryCode")] - public string CountryCode { get; set; } - - /// - /// 默认语言枚举 - /// - [SugarColumn(ColumnName = "DefaultLang")] - public bool? DefaultLang { get; set; } - - /// - /// 部门Id - /// - [SugarColumn(ColumnName = "DeptId")] - public int? DeptId { get; set; } - - /// - /// 员工id - /// - [SugarColumn(ColumnName = "EmployeeId")] - public int? EmployeeId { get; set; } - - /// - /// 英文名 - /// - [SugarColumn(ColumnName = "EnName")] - public string EnName { get; set; } - - /// - /// 是否业务员 - /// - [SugarColumn(ColumnName = "IsBusiness")] - public bool? IsBusiness { get; set; } - - /// - /// 是否启用 - /// - [SugarColumn(ColumnName = "IsEnable")] - public bool IsEnable { get; set; } - - /// - /// 固定电话(座机号码) - /// - [SugarColumn(ColumnName = "LandlinePhone")] - public string LandlinePhone { get; set; } - - /// - /// 姓名 - /// - [SugarColumn(ColumnName = "Name")] - public string Name { get; set; } - - /// - /// 用户直接组织节点Id - /// - [SugarColumn(ColumnName = "OrgId")] - public int? OrgId { get; set; } - - /// - /// 密码 - /// - [SugarColumn(ColumnName = "PassWord")] - public string PassWord { get; set; } - - /// - /// 绑定手机号 - /// - [SugarColumn(ColumnName = "TelPhone")] - public string TelPhone { get; set; } - - /// - /// 用户来源(1.员工入职 2.手动添加 3.其他) - /// - [SugarColumn(ColumnName = "UserOrigin")] - public bool? UserOrigin { get; set; } - - } -} \ No newline at end of file diff --git a/src/SJZY.Track.Repository/VData/Services/ExternalSubjectRepository.cs b/src/SJZY.Track.Repository/VData/Services/ExternalSubjectRepository.cs deleted file mode 100644 index cc3763b1..00000000 --- a/src/SJZY.Track.Repository/VData/Services/ExternalSubjectRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SJZY.Track.Repository.VData.Entitys; - -namespace SJZY.Track.Repository.VData.Services -{ - public class ExternalSubjectRepository : BasicRepository, IExternalSubjectRepository, IScopedDependency - { - - } -} diff --git a/src/SJZY.Track.Repository/VData/Services/IExternalSubjectRepository.cs b/src/SJZY.Track.Repository/VData/Services/IExternalSubjectRepository.cs deleted file mode 100644 index 3860ca53..00000000 --- a/src/SJZY.Track.Repository/VData/Services/IExternalSubjectRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SJZY.Track.Repository.VData.Entitys; - -namespace SJZY.Track.Repository.VData.Services -{ - public interface IExternalSubjectRepository : ISimpleClient - { - - } -} diff --git a/src/SJZY.Track.Repository/VData/Services/IServiceProviderRepository.cs b/src/SJZY.Track.Repository/VData/Services/IServiceProviderRepository.cs deleted file mode 100644 index bc3b5182..00000000 --- a/src/SJZY.Track.Repository/VData/Services/IServiceProviderRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SJZY.Track.Repository.VData.Entitys; - -namespace SJZY.Track.Repository.VData.Services -{ - public interface IServiceProviderRepository : ISimpleClient - { - - } -} diff --git a/src/SJZY.Track.Repository/VData/Services/ISystemRepository.cs b/src/SJZY.Track.Repository/VData/Services/ISystemRepository.cs deleted file mode 100644 index ae4864df..00000000 --- a/src/SJZY.Track.Repository/VData/Services/ISystemRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SJZY.Track.Repository.VData.Entitys; - -namespace SJZY.Track.Repository.VData.Services -{ - public interface ISystemRepository : ISimpleClient - { - - } -} diff --git a/src/SJZY.Track.Repository/VData/Services/IUserRepository.cs b/src/SJZY.Track.Repository/VData/Services/IUserRepository.cs deleted file mode 100644 index 63847127..00000000 --- a/src/SJZY.Track.Repository/VData/Services/IUserRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SJZY.Track.Repository.VData.Entitys; - -namespace SJZY.Track.Repository.VData.Services -{ - public interface IUserRepository : ISimpleClient - { - - } -} diff --git a/src/SJZY.Track.Repository/VData/Services/ServiceProviderRepository.cs b/src/SJZY.Track.Repository/VData/Services/ServiceProviderRepository.cs deleted file mode 100644 index 097c3ae7..00000000 --- a/src/SJZY.Track.Repository/VData/Services/ServiceProviderRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SJZY.Track.Repository.VData.Entitys; - -namespace SJZY.Track.Repository.VData.Services -{ - public class VServiceProviderRepository : BasicRepository, IServiceProviderRepository, IScopedDependency - { - - } -} diff --git a/src/SJZY.Track.Repository/VData/Services/SystemRepository.cs b/src/SJZY.Track.Repository/VData/Services/SystemRepository.cs deleted file mode 100644 index 5193a325..00000000 --- a/src/SJZY.Track.Repository/VData/Services/SystemRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SJZY.Track.Repository.VData.Entitys; - -namespace SJZY.Track.Repository.VData.Services -{ - public class SystemRepository : BasicRepository, ISystemRepository, IScopedDependency - { - - } -} diff --git a/src/SJZY.Track.Repository/VData/Services/UserRepository.cs b/src/SJZY.Track.Repository/VData/Services/UserRepository.cs deleted file mode 100644 index 2a3b76df..00000000 --- a/src/SJZY.Track.Repository/VData/Services/UserRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using SJZY.Track.Repository.VData.Entitys; - -namespace SJZY.Track.Repository.VData.Services -{ - public class UserRepository : BasicRepository, IUserRepository, IScopedDependency - { - - } -}