公共库-模块

booking_auth_dev
wanghaomei 2 years ago
parent 5955d722f4
commit d32d8b5212

@ -0,0 +1,41 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Core.Entity
{
[SugarTable("CommonModule")]
[Description("模块")]
public class CommonModule : CommonDbEntity
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Description { get; set; }
}
}

@ -1447,6 +1447,26 @@
修改人
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CommonModule.Code">
<summary>
代码
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CommonModule.Name">
<summary>
名称
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CommonModule.Sort">
<summary>
排序
</summary>
</member>
<member name="P:Myshipping.Core.Entity.CommonModule.Description">
<summary>
描述
</summary>
</member>
<member name="T:Myshipping.Core.Entity.DBEntityTenant">
<summary>
自定义租户基类实体
@ -7042,6 +7062,11 @@
新增签单方式
</summary>
</member>
<member name="M:Myshipping.Core.Service.CommonDBService.ModuleList(Myshipping.Core.Service.NameQueryDto)">
<summary>
获取箱型信息
</summary>
</member>
<member name="P:Myshipping.Core.Service.CommonDB.Dto.CodeCarrierDto.Code">
<summary>
代码

@ -42,6 +42,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
private readonly SqlSugarRepository<MappingService> _mappingServiceRep;
private readonly ISysCacheService _sysCacheService;
private readonly SqlSugarRepository<CodeIssueType> _codeIssueTypeRep;
private readonly SqlSugarRepository<CommonModule> _commonModuleRep;
private readonly ILogger<CommonDBService> _logger;
public CommonDBService(SqlSugarRepository<CodeCarrier> codeCarrierRep,
SqlSugarRepository<CodeVessel> codeVesselRep,
@ -63,6 +64,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
SqlSugarRepository<MappingPackage> mappingPackageRep,
SqlSugarRepository<MappingService> mappingServiceRep,
SqlSugarRepository<CodeIssueType> codeIssueTypeRep,
SqlSugarRepository<CommonModule> commonModuleRep,
ILogger<CommonDBService> logger,
ISysCacheService sysCacheService)
{
@ -87,8 +89,9 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
_mappingPackageRep = mappingPackageRep;
_mappingServiceRep = mappingServiceRep;
_codeIssueTypeRep = codeIssueTypeRep;
_commonModuleRep = commonModuleRep;
_logger = logger;
}
@ -118,7 +121,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
entity.CreateUser = UserManager.DjyUserId;
await _codeCarrierRep.InsertAsync(entity);
await GetAllCarrier();
}
/// <summary>
@ -148,7 +151,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
{
entity.GID = Guid.NewGuid().ToString();
entity.CreateTime = DateTime.Now;
entity.CreateUser =UserManager.DjyUserId;
entity.CreateUser = UserManager.DjyUserId;
await _mappingCarrierRep.InsertAsync(entity);
}
else
@ -689,7 +692,7 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
.WhereIF(!string.IsNullOrEmpty(input.MapCode), x => x.MapCode.Contains(input.MapCode, System.StringComparison.CurrentCultureIgnoreCase))
.WhereIF(!string.IsNullOrEmpty(input.Module), x => x.Module == input.Module)
.WhereIF(!string.IsNullOrEmpty(input.MapName), x => x.MapName.Contains(input.MapName, System.StringComparison.CurrentCultureIgnoreCase));
return queryList.ToList();
}
@ -819,7 +822,17 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
#endregion
#region 模块列表
/// <summary>
/// 获取箱型信息
/// </summary>
[HttpGet("/commondb/modules")]
public async Task<dynamic> ModuleList([FromQuery] NameQueryDto input)
{
return await _commonModuleRep.AsQueryable().OrderBy(x => x.Sort).Select(x => new { x.Code, x.Name, x.Sort }).ToListAsync();
}
#endregion
#region 实现接口,获取公共数据并缓存
@ -949,11 +962,11 @@ public class CommonDBService : ICommonDBService, IDynamicApiController, ITransie
[NonAction]
public async Task<List<CodeFrt>> GetAllFrt()
{
var list = await _codeFrtRep.ToListAsync();
await _sysCacheService.SetAllCodeFrt(list);
return list;
}
[NonAction]
public async Task<List<MappingFrt>> GetAllMappingFrt()

Loading…
Cancel
Save