booking_auth_dev
jianghaiqing 2 years ago
commit 817687e05d

@ -22,7 +22,7 @@ namespace Myshipping.Application.Entity
/// <summary>
/// 状态时间
/// </summary>
public DateTime? OpTiem { get; set; }
public DateTime? OpTime { get; set; }
/// <summary>
/// 类别
/// </summary>

@ -5591,7 +5591,7 @@
状态
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingStatusLog.OpTiem">
<member name="P:Myshipping.Application.Entity.BookingStatusLog.OpTime">
<summary>
状态时间
</summary>
@ -6695,7 +6695,7 @@
状态
</summary>
</member>
<member name="P:Myshipping.Application.Service.BookingOrder.Dto.BookingStatusLogDto.OPTime">
<member name="P:Myshipping.Application.Service.BookingOrder.Dto.BookingStatusLogDto.OpTime">
<summary>
状态时间
</summary>

@ -622,7 +622,7 @@ namespace Myshipping.Application
bookingStatusLog.Gategory = "ship";
bookingStatusLog.CreatedTime = DateTime.Now;
bookingStatusLog.Status = item.Status;
bookingStatusLog.OpTiem = item.OPTime;
bookingStatusLog.OpTime = item.OpTime;
bookingStatusLog.MBLNO = item.MBLNO;
var id = await _statuslog.InsertReturnSnowflakeIdAsync(bookingStatusLog);
if (item.detail != null && item.detail.Count > 0)

@ -22,7 +22,7 @@ namespace Myshipping.Application.Service.BookingOrder.Dto
/// <summary>
/// 状态时间
/// </summary>
public DateTime? OPTime { get; set; }
public DateTime? OpTime { get; set; }
/// <summary>
/// 类别
/// </summary>

@ -415,4 +415,59 @@ public enum ErrorCode
EMAIL001,
#endregion
#region 租户参数
/// <summary>
/// 主键不能为空
/// </summary>
[ErrorCodeItemMetadata("主键不能为空")]
Param000,
/// <summary>
/// 类别代码不能为空
/// </summary>
[ErrorCodeItemMetadata("类别代码不能为空")]
Param001,
/// <summary>
/// 类别名称不能为空
/// </summary>
[ErrorCodeItemMetadata("类别名称不能为空")]
Param002,
/// <summary>
/// 业务大类不能为空
/// </summary>
[ErrorCodeItemMetadata("业务大类不能为空")]
Param003,
/// <summary>
/// 存在相同数据
/// </summary>
[ErrorCodeItemMetadata("存在相同数据")]
Param004,
/// <summary>
/// 租户参数代码不能为空
/// </summary>
[ErrorCodeItemMetadata("租户参数代码不能为空")]
Param005,
/// <summary>
/// 租户参数名称不能为空
/// </summary>
[ErrorCodeItemMetadata("租户参数名称不能为空")]
Param006,
/// <summary>
/// 租户ID不能为空
/// </summary>
[ErrorCodeItemMetadata("租户ID不能为空")]
Param007,
#endregion
}

@ -4035,6 +4035,46 @@
邮箱账号已存在
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.Param000">
<summary>
主键不能为空
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.Param001">
<summary>
类别代码不能为空
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.Param002">
<summary>
类别名称不能为空
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.Param003">
<summary>
业务大类不能为空
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.Param004">
<summary>
存在相同数据
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.Param005">
<summary>
租户参数代码不能为空
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.Param006">
<summary>
租户参数名称不能为空
</summary>
</member>
<member name="F:Myshipping.Core.ErrorCode.Param007">
<summary>
租户ID不能为空
</summary>
</member>
<member name="T:Myshipping.Core.FileExtensionEnum">
<summary>
文件扩展枚举
@ -9240,7 +9280,7 @@
</summary>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyTenantParamService.GetParamValue(System.Int64)">
<member name="M:Myshipping.Core.Service.DjyTenantParamService.GetParamValue(System.Int64,System.String)">
<summary>
获取参数
</summary>

@ -10,6 +10,7 @@ using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using Myshipping.Core.Entity;
using System;
using Furion.FriendlyException;
namespace Myshipping.Core.Service
{
@ -33,7 +34,7 @@ namespace Myshipping.Core.Service
_cache = cache;
}
#region 类别
/// <summary>
/// 增加租户参数类别表
/// </summary>
@ -41,6 +42,21 @@ namespace Myshipping.Core.Service
[HttpPost("/DJYTenantParam/add")]
public async Task Add(AddDJYTenantParamInput input)
{
if (string.IsNullOrWhiteSpace(input.ParaCode)) {
throw Oops.Oh(ErrorCode.Param001);
}
if (string.IsNullOrWhiteSpace(input.ParaName)) {
throw Oops.Oh(ErrorCode.Param002);
}
if (string.IsNullOrWhiteSpace(input.Type))
{
throw Oops.Oh(ErrorCode.Param002);
}
var list=await _rep.FirstOrDefaultAsync(x => x.ParaCode == input.ParaCode && x.Type == input.Type);
if (list!=null) {
throw Oops.Oh(ErrorCode.Param004);
}
var entity = input.Adapt<DjyTenantParam>();
await _rep.InsertAsync(entity);
}
@ -52,6 +68,27 @@ namespace Myshipping.Core.Service
[HttpPost("/DJYTenantParam/edit")]
public async Task Update(UpdateDJYTenantParamInput input)
{
if ( input.Id==0)
{
throw Oops.Oh(ErrorCode.Param000);
}
if (string.IsNullOrWhiteSpace(input.ParaCode))
{
throw Oops.Oh(ErrorCode.Param001);
}
if (string.IsNullOrWhiteSpace(input.ParaName))
{
throw Oops.Oh(ErrorCode.Param002);
}
if (string.IsNullOrWhiteSpace(input.Type))
{
throw Oops.Oh(ErrorCode.Param002);
}
var list = await _rep.FirstOrDefaultAsync(x => x.ParaCode == input.ParaCode && x.Type == input.Type&&x.Id!=input.Id);
if (list != null)
{
throw Oops.Oh(ErrorCode.Param004);
}
var entity = input.Adapt<DjyTenantParam>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
@ -64,12 +101,17 @@ namespace Myshipping.Core.Service
[SqlSugarUnitOfWork]
public async Task Delete(long Id)
{
if (Id == 0)
{
throw Oops.Oh(ErrorCode.Param000);
}
var entity = await _rep.FirstOrDefaultAsync(u => u.Id == Id);
await _itemrep.DeleteAsync(m => m.ParaCode == entity.ParaCode);
await _valuerep.DeleteAsync(m => m.ParaCode == entity.ParaCode);
await _rep.DeleteAsync(entity);
}
/// <summary>
/// 获取租户参数类别
/// </summary>
@ -79,6 +121,9 @@ namespace Myshipping.Core.Service
{
return await _rep.AsQueryable().WhereIF(!string.IsNullOrEmpty(Type),x => x.Type == Type).OrderBy(x => x.Sort).ToListAsync();
}
#endregion
#region 参数
/// <summary>
/// 获取租户参数
@ -100,6 +145,23 @@ namespace Myshipping.Core.Service
[HttpPost("/DJYTenantParam/addParamItem")]
public async Task AddParamItem(DjyTenantParamItem input)
{
if (string.IsNullOrWhiteSpace(input.ParaCode))
{
throw Oops.Oh(ErrorCode.Param001);
}
if (string.IsNullOrWhiteSpace(input.ItemCode))
{
throw Oops.Oh(ErrorCode.Param005);
}
if (string.IsNullOrWhiteSpace(input.ItemName))
{
throw Oops.Oh(ErrorCode.Param006);
}
var list = await _itemrep.FirstOrDefaultAsync(x => x.ParaCode == input.ParaCode && x.ItemCode == input.ItemCode);
if (list != null)
{
throw Oops.Oh(ErrorCode.Param004);
}
var entity = input.Adapt<DjyTenantParamItem>();
await _itemrep.InsertAsync(entity);
}
@ -112,6 +174,27 @@ namespace Myshipping.Core.Service
[HttpPost("/DJYTenantParam/editParamItem")]
public async Task UpdateParamItem(DjyTenantParamItem input)
{
if (input.Id == 0)
{
throw Oops.Oh(ErrorCode.Param000);
}
if (string.IsNullOrWhiteSpace(input.ParaCode))
{
throw Oops.Oh(ErrorCode.Param001);
}
if (string.IsNullOrWhiteSpace(input.ItemCode))
{
throw Oops.Oh(ErrorCode.Param005);
}
if (string.IsNullOrWhiteSpace(input.ItemName))
{
throw Oops.Oh(ErrorCode.Param006);
}
var list = await _itemrep.FirstOrDefaultAsync(x => x.ParaCode == input.ParaCode && x.ItemCode == input.ItemCode && x.Id != input.Id);
if (list != null)
{
throw Oops.Oh(ErrorCode.Param004);
}
var entity = input.Adapt<DjyTenantParamItem>();
await _itemrep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
@ -125,30 +208,32 @@ namespace Myshipping.Core.Service
[SqlSugarUnitOfWork]
public async Task DeleteParamItem(long Id)
{
if (Id == 0)
{
throw Oops.Oh(ErrorCode.Param000);
}
var entity = await _itemrep.FirstOrDefaultAsync(u => u.Id == Id);
await _valuerep.DeleteAsync(m => m.ItemCode == entity.ItemCode && m.ParaCode == entity.ParaCode);
await _itemrep.DeleteAsync(entity);
}
#endregion
#region 值
/// <summary>
/// 获取参数
/// </summary>
/// <returns></returns>
[HttpGet("/DJYTenantParam/getParamValue")]
public async Task<List<DjyTenantParamValue>> GetParamValue(long tenantId)
public async Task<List<DjyTenantParamValue>> GetParamValue(long tenantId, string paraCode=null)
{
if (tenantId==0) {
tenantId = Convert.ToInt64(UserManager.TENANT_ID);
}
return await _valuerep.AsQueryable().Where(x => x.TenantId == tenantId).OrderBy(x => x.Sort).ToListAsync();
return await _valuerep.AsQueryable().Where(x => x.TenantId == tenantId).WhereIF(paraCode!=null,x=>x.ParaCode==paraCode).OrderBy(x => x.Sort).ToListAsync();
}
/// <summary>
/// 增加参数
/// </summary>
@ -157,6 +242,23 @@ namespace Myshipping.Core.Service
public async Task AddParamValue(DjyTenantParamValue input)
{
var entity = input.Adapt<DjyTenantParamValue>();
if (string.IsNullOrWhiteSpace(input.ParaCode))
{
throw Oops.Oh(ErrorCode.Param001);
}
if (string.IsNullOrWhiteSpace(input.ItemCode))
{
throw Oops.Oh(ErrorCode.Param005);
}
if ( input.TenantId==null)
{
throw Oops.Oh(ErrorCode.Param007);
}
var list = await _valuerep.FirstOrDefaultAsync(x => x.ParaCode == input.ParaCode && x.TenantId == input.TenantId );
if (list != null)
{
throw Oops.Oh(ErrorCode.Param004);
}
await _valuerep.InsertAsync(entity);
await CacheData();
}
@ -170,6 +272,27 @@ namespace Myshipping.Core.Service
public async Task UpdateParamValue(DjyTenantParamValue input)
{
var entity = input.Adapt<DjyTenantParamValue>();
if (input.Id == 0)
{
throw Oops.Oh(ErrorCode.Param000);
}
if (string.IsNullOrWhiteSpace(input.ParaCode))
{
throw Oops.Oh(ErrorCode.Param001);
}
if (string.IsNullOrWhiteSpace(input.ItemCode))
{
throw Oops.Oh(ErrorCode.Param005);
}
if (input.TenantId == null)
{
throw Oops.Oh(ErrorCode.Param007);
}
var list = await _valuerep.FirstOrDefaultAsync(x => x.ParaCode == input.ParaCode && x.TenantId == input.TenantId&&x.Id!=input.Id);
if (list != null)
{
throw Oops.Oh(ErrorCode.Param004);
}
await _valuerep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
await CacheData();
}
@ -185,7 +308,7 @@ namespace Myshipping.Core.Service
var entity = await _itemrep.FirstOrDefaultAsync(u => u.Id == Id);
await _valuerep.DeleteAsync(entity);
}
#endregion
public async Task CacheData()
{

@ -82,7 +82,7 @@ public class SysTenantService : ISysTenantService, IDynamicApiController, ITrans
public async Task<dynamic> QueryTenantPageList([FromQuery] TenantInput input)
{
var tenants = await _sysTenantRep.AsQueryable()
.Where(m => m.TenantType != TenantTypeEnum.SYSTEM)
//.Where(m => m.TenantType != TenantTypeEnum.SYSTEM)
.WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Host), u => u.Host.Contains(input.Host.Trim()))
.Select<TenantOutput>()

@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>

Loading…
Cancel
Save