cjy 4 months ago
commit 58405de358

@ -0,0 +1,18 @@
namespace DS.Module.Core
{
/// <summary>
/// 维护一些常用的,用于任务台数据上下文读写参数的参数名
/// </summary>
public static class TaskFlowDataNameConst
{
/// <summary>
/// 任务任务请求报文
/// </summary>
public const string TaskManageOrderMessageInfo = nameof(TaskManageOrderMessageInfo);
/// <summary>
/// 租户Id
/// </summary>
public const string TenantId = "TenantId";
}
}

@ -117,7 +117,7 @@ public abstract class BaseModelV2<TKey> : IDeleted
/// 创建时间 /// 创建时间
/// </summary> /// </summary>
[Description("创建时间")] [Description("创建时间")]
[SqlSugar.SugarColumn(IsOnlyIgnoreUpdate = true, ColumnDescription = "创建时间")] [SugarColumn(IsOnlyIgnoreUpdate = true, ColumnDescription = "创建时间")]
public DateTime CreateTime { get; set; } public DateTime CreateTime { get; set; }
/// <summary> /// <summary>
@ -152,13 +152,34 @@ public abstract class BaseModelV2<TKey> : IDeleted
/// 删除时间 /// 删除时间
/// </summary> /// </summary>
[Description("删除时间")] [Description("删除时间")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除时间")] [SugarColumn(IsNullable = true, ColumnDescription = "删除时间", IsOnlyIgnoreInsert = true)]
public DateTime? DeleteTime { get; set; } public DateTime? DeleteTime { get; set; }
/// <summary> /// <summary>
/// 删除人 /// 删除人
/// </summary> /// </summary>
[Description("删除人")] [Description("删除人")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除人")] [SugarColumn(IsNullable = true, ColumnDescription = "删除人", IsOnlyIgnoreInsert = true)]
public long? DeleteBy { get; set; } public long? DeleteBy { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
[Description("创建人名称")]
[SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true, ColumnDescription = "创建人名称", Length = 50)]
public string? CreateUserName { get; set; }
/// <summary>
/// 修改人名称
/// </summary>
[Description("修改人名称")]
[SugarColumn(IsNullable = true, ColumnDescription = "修改人名称", Length = 50)]
public string? UpdateUserName { get; set; }
/// <summary>
/// 删除人名称
/// </summary>
[Description("删除人名称")]
[SugarColumn(IsNullable = true, ColumnDescription = "删除人名称", Length = 50, IsOnlyIgnoreInsert = true)]
public string? DeleteUserName { get; set; }
} }

@ -14,6 +14,18 @@
{ {
dataContext.Add(key, value); dataContext.Add(key, value);
} }
/// <summary>
///
/// </summary>
public TaskFlowDataContext(params (string key, object value)[] keyValues)
{
foreach (var item in keyValues)
{
dataContext.Add(item.key, item.value);
}
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -35,7 +47,11 @@
{ {
if (dataContext.ContainsKey(key)) if (dataContext.ContainsKey(key))
{ {
return (T)dataContext[key]; var value = dataContext[key];
if (value is T t)
{
return t;
}
} }
return default; return default;
} }

@ -0,0 +1,60 @@
using DS.WMS.Core.Fee.Entity;
using SqlSugar;
namespace DS.WMS.Core.Application.Entity
{
/// <summary>
/// 费用代码与发票申请明细关系
/// </summary>
[SugarTable("application_detail_relation", TableDescription = "发票明细与费用明细关系")]
public class ApplicationDetailRelation
{
/// <summary>
/// 费用明细ID
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public long DetailId { get; set; }
/// <summary>
/// 发票明细
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(DetailId))]
public ApplicationDetail? Detail { get; set; }
/// <summary>
/// 发票明细ID
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public long InvoiceDetailId { get; set; }
/// <summary>
/// 发票明细
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(InvoiceDetailId))]
public InvoiceDetail? InvoiceDetail { get; set; }
///// <summary>
///// 费用代码ID
///// </summary>
//public long? FeeId { get; set; }
///// <summary>
///// 费用代码
///// </summary>
//[Navigate(NavigateType.OneToOne, nameof(FeeId))]
//public FeeCode? FeeCode { get; set; }
/// <summary>
/// 发票申请/发票ID
/// </summary>
[SugarColumn(ColumnDescription = "发票申请/发票ID", IsNullable = false)]
public long InvoiceId { get; set; }
/// <summary>
/// 原始发票明细名称
/// </summary>
[SugarColumn(ColumnDescription = "原始发票明细名称", IsNullable = false, Length = 50)]
public string OriginalName { get; set; }
}
}

@ -1,43 +0,0 @@
using DS.WMS.Core.Fee.Entity;
using SqlSugar;
namespace DS.WMS.Core.Application.Entity
{
/// <summary>
/// 费用代码与发票申请明细关系
/// </summary>
[SugarTable("fee_code_invoice_detail", TableDescription = "费用代码与发票申请明细关系")]
public class FeeCodeInvoiceDetail
{
/// <summary>
/// 费用代码ID
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public long FeeCodeId { get; set; }
/// <summary>
/// 费用代码
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(FeeCodeId))]
public FeeCode? FeeCode { get; set; }
/// <summary>
/// 发票明细ID
/// </summary>
[SugarColumn(IsPrimaryKey = true)]
public long InvoiceDetailId { get; set; }
/// <summary>
/// 费用代码
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(InvoiceDetailId))]
public InvoiceDetail? InvoiceDetail { get; set; }
/// <summary>
/// 发票明细名称
/// </summary>
[SugarColumn(ColumnDescription = "发票明细名称", Length = 50, IsNullable = false)]
public string DetailName { get; set; } = string.Empty;
}
}

@ -0,0 +1,14 @@
namespace DS.WMS.Core.Invoice.Dtos
{
/// <summary>
/// 发票明细操作类型
/// </summary>
public enum BuildOption
{
Create,
Update,
Delete
}
}

@ -116,6 +116,8 @@ namespace DS.WMS.Core.Invoice.Method
return DataResult<List<InvoiceApplicationDetailDto>>.Success(details); return DataResult<List<InvoiceApplicationDetailDto>>.Success(details);
} }
protected override Task<DataResult> PreSaveAsync(Entity.Invoice invoice) protected override Task<DataResult> PreSaveAsync(Entity.Invoice invoice)
{ {
invoice.Type = InvoiceType.Applcation; invoice.Type = InvoiceType.Applcation;
@ -123,11 +125,32 @@ namespace DS.WMS.Core.Invoice.Method
return Task.FromResult(DataResult.Success); return Task.FromResult(DataResult.Success);
} }
protected override async Task OnSaveAsync(Entity.Invoice invoice)
{
var list = invoice.Details?.Where(x => x.DetailId.HasValue).Select(x => new ApplicationDetail
{
Id = x.DetailId.GetValueOrDefault(),
ProcessedAmount = x.ApplyAmount,
OriginalProcessedAmount = x.OriginalAmount
}).ToList();
if (list != null && list.Count > 0)
{
//增加发票申请明细的已处理金额
await TenantDb.Updateable(list)
.PublicSetColumns(x => x.ProcessedAmount, "+").PublicSetColumns(x => x.OriginalProcessedAmount, "+")
.UpdateColumns(x => new { x.ProcessedAmount, x.OriginalProcessedAmount })
.ExecuteCommandAsync();
}
}
protected override Task PostSaveAsync(Entity.Invoice invoice) protected override Task PostSaveAsync(Entity.Invoice invoice)
{ {
return Task.Factory.StartNew(UpdateInvoiceApplications, new List<Entity.Invoice> { invoice }); return Task.Factory.StartNew(UpdateInvoiceApplications, new List<Entity.Invoice> { invoice });
} }
protected override async Task OnDeleteDetailAsync(List<Entity.Invoice> invoices, DeleteOption deleteOption) protected override async Task OnDeleteDetailAsync(List<Entity.Invoice> invoices, DeleteOption deleteOption)
{ {
var list = invoices.SelectMany(x => x.Details).Where(x => x.DetailId.HasValue).Select(x => new ApplicationDetail var list = invoices.SelectMany(x => x.Details).Where(x => x.DetailId.HasValue).Select(x => new ApplicationDetail

@ -163,6 +163,7 @@ namespace DS.WMS.Core.Invoice.Method
#pragma warning disable CS4014 #pragma warning disable CS4014
/// <summary> /// <summary>
/// 提交发票开票 /// 提交发票开票
/// </summary> /// </summary>
@ -215,7 +216,8 @@ namespace DS.WMS.Core.Invoice.Method
x.OriginalProcessedAmount, x.OriginalProcessedAmount,
y.CustomerId y.CustomerId
}).ToListAsync(); }).ToListAsync();
invoice.Details = new List<ApplicationDetail>(details.Count);
invoice.Details ??= new List<ApplicationDetail>(details.Count);
foreach (var item in details) foreach (var item in details)
{ {
@ -271,7 +273,8 @@ namespace DS.WMS.Core.Invoice.Method
//将请求明细转换为数据库的费用明细 //将请求明细转换为数据库的费用明细
invoice.Details = request.Details.Select(x => new ApplicationDetail invoice.Details = request.Details.Select(x => new ApplicationDetail
{ {
ApplicationId = x.ApplicationId, Id = x.Id,
ApplicationId = x.ApplicationId == 0 ? x.ApplicationId : invoice.Id,
RefId = x.RefId, RefId = x.RefId,
DetailId = x.Id == 0 ? null : x.Id, DetailId = x.Id == 0 ? null : x.Id,
RecordId = x.RecordId, RecordId = x.RecordId,
@ -280,17 +283,19 @@ namespace DS.WMS.Core.Invoice.Method
FeeId = x.FeeId, FeeId = x.FeeId,
FeeName = x.FeeName, FeeName = x.FeeName,
FeeType = x.FeeType, FeeType = x.FeeType,
ApplyAmount = x.Amount,
Currency = x.Currency, Currency = x.Currency,
ApplyAmount = x.ApplyAmount,
ExchangeRate = x.ExchangeRate, ExchangeRate = x.ExchangeRate,
OriginalAmount = x.OriginalAmount, OriginalAmount = x.OriginalAmount,
OriginalCurrency = x.OriginalCurrency ?? (invoice.Currency.IsNullOrEmpty() ? x.Currency : invoice.Currency), OriginalCurrency = x.OriginalCurrency ?? (invoice.Currency.IsNullOrEmpty() ? x.Currency : invoice.Currency),
}).ToList(); }).ToList();
} }
if (invoice.Details?.Count > 0) if (invoice.Details?.Count > 0)
{ {
//筛选出新增的费用明细
invoice.Details = invoice.Details.FindAll(x => x.Id == 0);
//金额禁止为0 //金额禁止为0
if (invoice.Details.Any(x => x.ApplyAmount == 0 || x.OriginalAmount == 0)) if (invoice.Details.Any(x => x.ApplyAmount == 0 || x.OriginalAmount == 0))
return DataResult<TEntity>.FailedWithDesc(nameof(MultiLanguageConst.AmountCannotBeZero)); return DataResult<TEntity>.FailedWithDesc(nameof(MultiLanguageConst.AmountCannotBeZero));
@ -304,18 +309,15 @@ namespace DS.WMS.Core.Invoice.Method
result = await PreSaveAsync(invoice); result = await PreSaveAsync(invoice);
if (!result.Succeeded) if (!result.Succeeded)
return DataResult<TEntity>.Failed(result.Message, result.MultiCode); return DataResult<TEntity>.Failed(result.Message, result.MultiCode);
invoice.ApplyAmount = invoice.Details.Sum(x => x.ApplyAmount);
invoice.AmountUppercase = new Money(invoice.ApplyAmount).ToString();
invoice.OriginalAmount = invoice.Details.Sum(x => x.OriginalAmount);
invoice.OtherInvoiceAmount = invoice.Details.Where(x => x.Currency != RMB_CODE).Sum(x => x.OriginalAmount);
} }
await TenantDb.Ado.BeginTranAsync(); await TenantDb.Ado.BeginTranAsync();
try try
{ {
BuildOption buildOption;
if (invoice.Id == 0)//新增 if (invoice.Id == 0)//新增
{ {
buildOption = BuildOption.Create;
//创建时需要生成申请单编号 //创建时需要生成申请单编号
var sequence = CommonService.Value.GetSequenceNext<TEntity>(); var sequence = CommonService.Value.GetSequenceNext<TEntity>();
if (!sequence.Succeeded) if (!sequence.Succeeded)
@ -328,53 +330,61 @@ namespace DS.WMS.Core.Invoice.Method
} }
else//编辑 else//编辑
{ {
if (invoice.Details?.Count > 0) buildOption = BuildOption.Update;
await TenantDb.Updateable(invoice).UpdateColumns(x => new
{ {
x.InvoiceNO,
x.InvoiceDate,
//x.Currency,
x.ReceiptCurrency,
x.CustomerId,
x.CustomerName,
x.AutualCustomerName,
x.InvoiceHeader,
x.Account,
x.CustomerAddTel,
x.CustomerBank,
x.OperatorId,
x.TaxID,
x.TaxRate,
x.OrgId,
x.SaleDeptId
}).ExecuteCommandAsync();
if (invoice.Details?.Count > 0)
await TenantDb.Insertable(invoice.Details).ExecuteCommandAsync(); await TenantDb.Insertable(invoice.Details).ExecuteCommandAsync();
////因需要重新生成明细,所以要先清空现有发票明细
//await TenantDb.Deleteable<InvoiceDetail>().Where(x => x.ApplicationId == invoice.Id).ExecuteCommandAsync();
} if (invoice.InvoiceDetails?.Count > 0)
else if (invoice.InvoiceDetails?.Count > 0) //发票明细只有更新
{
//更新发票明细
await TenantDb.Updateable(invoice.InvoiceDetails).IgnoreColumns(x => new { x.Category }).ExecuteCommandAsync(); await TenantDb.Updateable(invoice.InvoiceDetails).IgnoreColumns(x => new { x.Category }).ExecuteCommandAsync();
} }
await TenantDb.Updateable(invoice).IgnoreColumns(x => new
{
x.BillNO,
x.IsLocked,
x.CreateBy,
x.CreateTime,
x.Deleted,
x.DeleteBy,
x.DeleteTime
}).ExecuteCommandAsync();
}
if (invoice.Details?.Count > 0) if (invoice.Details?.Count > 0)
{ {
//更新费用记录的已开票金额 //更新费用记录的已开票金额
var fees = invoice.Details.Select(x => new FeeRecord var fees = invoice.Details.Select(x => new FeeRecord
{ {
Id = x.RecordId, Id = x.RecordId,
InvoiceAmount = x.OriginalAmount InvoiceAmount = x.OriginalAmount,
OrderInvSettlementAmount = x.OriginalAmount,
}).ToList(); }).ToList();
await TenantDb.Updateable(fees)
.PublicSetColumns(x => x.InvoiceAmount, "+")
.UpdateColumns(x => new { x.InvoiceAmount })
.ExecuteCommandAsync();
await BuildInvoiceDetailAsync([invoice]); var updateable = TenantDb.Updateable(fees).PublicSetColumns(x => x.InvoiceAmount, "+");
if (invoice.InvoiceDetails?.Count > 0) if (invoice.Type == InvoiceType.Applcation)
await TenantDb.Insertable(invoice.InvoiceDetails).ExecuteCommandAsync(); updateable = updateable.PublicSetColumns(x => x.OrderInvSettlementAmount, "+")
.UpdateColumns(x => new { x.OrderInvSettlementAmount });
await updateable.UpdateColumns(x => new { x.InvoiceAmount }).ExecuteCommandAsync();
//生成发票明细
await BuildInvoiceDetailAsync(invoice, buildOption);
//重新计算发票总金额
await RefreshInvoiceAsync([invoice]);
} }
await OnSaveAsync(invoice); await OnSaveAsync(invoice);
await TenantDb.Ado.CommitTranAsync(); await TenantDb.Ado.CommitTranAsync();
PostSaveAsync(invoice); PostSaveAsync(invoice);
return DataResult<TEntity>.Success(invoice); return DataResult<TEntity>.Success(invoice);
@ -387,6 +397,199 @@ namespace DS.WMS.Core.Invoice.Method
} }
} }
/// <summary>
/// 生成发票明细
/// </summary>
/// <param name="invoice">发票</param>
/// <param name="option">生成类型</param>
/// <returns></returns>
protected async Task BuildInvoiceDetailAsync(TEntity invoice, BuildOption option)
{
if (invoice.Details == null || invoice.Details.Count == 0)
return;
var ids = invoice.Details.Select(x => x.Id);
if (option == BuildOption.Create)
{
var feesCodes = await TenantDb.Queryable<ApplicationDetail>().InnerJoin<FeeCode>((d, fc) => d.FeeId == fc.Id && ids.Contains(d.Id))
.Select((d, fc) => new
{
DetailId = d.Id,
FeeId = fc.Id,
fc.GoodName
}).ToListAsync();
var feeCodeGroups = feesCodes.GroupBy(x => x.GoodName).ToList();
invoice.InvoiceDetails = new List<InvoiceDetail>(feeCodeGroups.Count);
List<ApplicationDetailRelation> relations = [];
foreach (var g in feeCodeGroups)
{
var invDetail = new InvoiceDetail
{
Id = SnowFlakeSingle.Instance.NextId(),
ApplicationId = invoice.Id,
Name = g.Key,
TaxRate = invoice.TaxRate,
TaxUnitPrice = invoice.Details.FindAll(x => g.Select(x => x.DetailId).Contains(x.Id)).Sum(x => x.ApplyAmount),
Category = DetailCategory.InvoiceIssuance
};
invDetail.TaxAmount = invDetail.TaxUnitPrice * invoice.TaxRate;
invDetail.UnitPrice = invDetail.TaxUnitPrice - invDetail.TaxAmount;
invoice.InvoiceDetails.Add(invDetail);
foreach (var item in g)
{
relations.Add(new ApplicationDetailRelation
{
DetailId = item.DetailId,
InvoiceDetailId = invDetail.Id,
OriginalName = g.Key,
InvoiceId = invoice.Id
});
}
}
await TenantDb.Insertable(invoice.InvoiceDetails).ExecuteCommandAsync();
await TenantDb.Insertable(relations).ExecuteCommandAsync();
}
//更新时只处理增加的明细
else if (option == BuildOption.Update)
{
//获取现有发票明细对应关系
var relations = await TenantDb.Queryable<ApplicationDetailRelation>().Where(x => x.InvoiceId == invoice.Id)
.Select(x => new
{
x.DetailId,
x.InvoiceDetailId,
x.OriginalName,
}).ToListAsync();
var feeIds = invoice.Details.Select(x => x.FeeId);
var feesCodes = await TenantDb.Queryable<FeeCode>().Where(x => feeIds.Contains(x.Id))
.Select(x => new
{
FeeId = x.Id,
x.GoodName
}).ToListAsync();
invoice.InvoiceDetails = []; //新增的发票明细
List<InvoiceDetail> invoiceDetailList = []; //更新的发票明细
List<ApplicationDetailRelation> relationList = []; //新增的明细关系
foreach (var detail in invoice.Details)
{
var goodsName = feesCodes.Find(x => x.FeeId == detail.FeeId)?.GoodName; //转换为发票明细名称
var relation = relations.Find(x => string.Equals(x.OriginalName, goodsName, StringComparison.Ordinal));
if (relation == null) //需要新增发票明细
{
var invDetail = new InvoiceDetail
{
Id = SnowFlakeSingle.Instance.NextId(),
ApplicationId = invoice.Id,
Name = goodsName,
TaxRate = invoice.TaxRate,
TaxUnitPrice = detail.ApplyAmount,
Category = DetailCategory.InvoiceIssuance
};
invDetail.TaxAmount = invDetail.TaxUnitPrice * invoice.TaxRate;
invDetail.UnitPrice = invDetail.TaxUnitPrice - invDetail.TaxAmount;
invoice.InvoiceDetails.Add(invDetail);
relationList.Add(new ApplicationDetailRelation
{
DetailId = detail.Id,
InvoiceDetailId = invDetail.Id,
InvoiceId = invoice.Id,
OriginalName = goodsName
});
}
else //发票明细已存在,追加金额
{
//添加到更新列表
invoiceDetailList.Add(new InvoiceDetail
{
Id = relation.InvoiceDetailId,
TaxUnitPrice = detail.ApplyAmount
});
}
}
if (invoice.InvoiceDetails.Count > 0)
await TenantDb.Insertable(invoice.InvoiceDetails).ExecuteCommandAsync();
//执行发票明细金额更新
if (invoiceDetailList.Count > 0)
{
var ids2 = invoiceDetailList.Select(x => x.Id);
var updateList = await TenantDb.Queryable<InvoiceDetail>().Where(x => ids2.Contains(x.Id)).Select(x => new InvoiceDetail
{
Id = x.Id,
TaxUnitPrice = x.TaxUnitPrice,
TaxRate = x.TaxRate,
TaxAmount = x.TaxAmount,
UnitPrice = x.UnitPrice
}).ToListAsync();
foreach (var item in updateList)
{
var invDetail = invoiceDetailList.Find(x => x.Id == item.Id);
item.TaxUnitPrice += (invDetail?.TaxUnitPrice).GetValueOrDefault();
item.TaxAmount = item.TaxUnitPrice * invoice.TaxRate;
item.UnitPrice = item.TaxUnitPrice - item.TaxAmount;
}
await TenantDb.Updateable(updateList).UpdateColumns(x => new
{
x.TaxUnitPrice,
x.TaxAmount,
x.UnitPrice
}).ExecuteCommandAsync();
}
if (relationList.Count > 0)
await TenantDb.Insertable(relationList).ExecuteCommandAsync();
}
else if (option == BuildOption.Delete)
{
}
}
/// <summary>
/// 重新计算发票的各项金额数据
/// </summary>
/// <param name="invoices">发票</param>
/// <returns></returns>
protected async Task<int> RefreshInvoiceAsync(List<TEntity> invoices)
{
var ids = invoices.Select(x => x.Id);
var details = await TenantDb.Queryable<ApplicationDetail>().Where(x => ids.Contains(x.ApplicationId))
.Select(x => new { x.ApplicationId, x.Currency, x.ApplyAmount, x.OriginalAmount }).ToListAsync();
var invDetails = await TenantDb.Queryable<InvoiceDetail>().Where(x => ids.Contains(x.ApplicationId))
.Select(x => new { x.ApplicationId, x.TaxUnitPrice }).ToListAsync();
foreach (var invoice in invoices)
{
var currDetails = details.FindAll(x => x.ApplicationId == invoice.Id);
invoice.ApplyAmount = currDetails.Sum(x => x.ApplyAmount);
invoice.AmountUppercase = new Money(invoice.ApplyAmount).ToString();
invoice.OriginalAmount = currDetails.Sum(x => x.OriginalAmount);
invoice.OtherInvoiceAmount = currDetails.FindAll(x => x.Currency != RMB_CODE).Sum(x => x.OriginalAmount);
invoice.InvoiceAmount = invDetails.FindAll(x => x.ApplicationId == invoice.Id).Sum(x => x.TaxUnitPrice);
}
return await TenantDb.Updateable(invoices).UpdateColumns(x => new
{
x.ApplyAmount,
x.AmountUppercase,
x.OriginalAmount,
x.OtherInvoiceAmount,
x.InvoiceAmount
}).ExecuteCommandAsync();
}
/// <summary> /// <summary>
/// 用于发票的状态检查 /// 用于发票的状态检查
/// </summary> /// </summary>
@ -428,12 +631,20 @@ namespace DS.WMS.Core.Invoice.Method
/// <param name="ids">发票ID</param> /// <param name="ids">发票ID</param>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult> DeleteAsync(params long[] ids) public async Task<DataResult> DeleteAsync(params long[] ids)
{
await TenantDb.Ado.BeginTranAsync();
try
{ {
var apps = await TenantDb.Queryable<TEntity>().Where(x => ids.Contains(x.Id)).Select(x => new TEntity var apps = await TenantDb.Queryable<TEntity>().Where(x => ids.Contains(x.Id)).Select(x => new TEntity
{ {
Id = x.Id, Id = x.Id,
Type = x.Type,
IsLocked = x.IsLocked IsLocked = x.IsLocked
}).ToListAsync(); }).ToListAsync();
if (apps.Count == 0)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData));
var details = await TenantDb.Queryable<ApplicationDetail>().Where(x => ids.Contains(x.ApplicationId)).Select( var details = await TenantDb.Queryable<ApplicationDetail>().Where(x => ids.Contains(x.ApplicationId)).Select(
x => new ApplicationDetail x => new ApplicationDetail
{ {
@ -447,14 +658,12 @@ namespace DS.WMS.Core.Invoice.Method
}).ToListAsync(); }).ToListAsync();
foreach (var app in apps) foreach (var app in apps)
app.Details = details.FindAll(x => x.ApplicationId == app.Id); await TenantDb.Ado.BeginTranAsync(); app.Details = details.FindAll(x => x.ApplicationId == app.Id);
var result = PreDelete(apps); var result = PreDelete(apps);
if (!result.Succeeded) if (!result.Succeeded)
return result; return result;
try
{
await OnDeleteDetailAsync(apps, DeleteOption.Entire); await OnDeleteDetailAsync(apps, DeleteOption.Entire);
await TenantDb.DeleteNav<TEntity>(x => ids.Contains(x.Id)).Include(x => x.Details).ExecuteCommandAsync(); await TenantDb.DeleteNav<TEntity>(x => ids.Contains(x.Id)).Include(x => x.Details).ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync(); await TenantDb.Ado.CommitTranAsync();
@ -477,6 +686,9 @@ namespace DS.WMS.Core.Invoice.Method
/// <param name="ids">明细ID</param> /// <param name="ids">明细ID</param>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult> DeleteDetailAsync(params long[] ids) public async Task<DataResult> DeleteDetailAsync(params long[] ids)
{
await TenantDb.Ado.BeginTranAsync();
try
{ {
var details = await TenantDb.Queryable<ApplicationDetail>().Where(x => ids.Contains(x.Id)).Select( var details = await TenantDb.Queryable<ApplicationDetail>().Where(x => ids.Contains(x.Id)).Select(
x => new ApplicationDetail x => new ApplicationDetail
@ -489,28 +701,32 @@ namespace DS.WMS.Core.Invoice.Method
ApplyAmount = x.ApplyAmount, ApplyAmount = x.ApplyAmount,
OriginalAmount = x.OriginalAmount OriginalAmount = x.OriginalAmount
}).ToListAsync(); }).ToListAsync();
var appIds = details.Select(x => x.ApplicationId).Distinct().ToList();
var apps = await TenantDb.Queryable<TEntity>().Where(x => appIds.Contains(x.Id)).Select(x => new TEntity if (details.Count == 0)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData));
var invIds = details.Select(x => x.ApplicationId).Distinct().ToList();
var invoices = await TenantDb.Queryable<TEntity>().Where(x => invIds.Contains(x.Id)).Select(x => new TEntity
{ {
Id = x.Id, Id = x.Id,
Type = x.Type,
IsLocked = x.IsLocked IsLocked = x.IsLocked
}).ToListAsync(); }).ToListAsync();
foreach (var app in apps) foreach (var app in invoices)
app.Details = details.FindAll(x => x.ApplicationId == app.Id); app.Details = details.FindAll(x => x.ApplicationId == app.Id);
var result = PreDelete(apps); var result = PreDelete(invoices);
if (!result.Succeeded) if (!result.Succeeded)
return result; return result;
await TenantDb.Ado.BeginTranAsync(); await OnDeleteDetailAsync(invoices, DeleteOption.DetailOnly);
try
{
await OnDeleteDetailAsync(apps, DeleteOption.DetailOnly);
await TenantDb.Deleteable(details).ExecuteCommandAsync(); await TenantDb.Deleteable(details).ExecuteCommandAsync();
//重新计算发票总金额
await RefreshInvoiceAsync(invoices);
await TenantDb.Ado.CommitTranAsync(); await TenantDb.Ado.CommitTranAsync();
PostDeleteAsync(apps, DeleteOption.Entire); PostDeleteAsync(invoices, DeleteOption.Entire);
return DataResult.Success; return DataResult.Success;
} }
@ -529,8 +745,33 @@ namespace DS.WMS.Core.Invoice.Method
/// <returns></returns> /// <returns></returns>
public async Task<DataResult> DeleteInvoiceDetailAsync(params long[] ids) public async Task<DataResult> DeleteInvoiceDetailAsync(params long[] ids)
{ {
int rows = await TenantDb.Deleteable<InvoiceDetail>().Where(x => ids.Contains(x.Id)).ExecuteCommandAsync(); await TenantDb.Ado.BeginTranAsync();
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed)); try
{
var invDetails = await TenantDb.Queryable<InvoiceDetail>().Where(x => ids.Contains(x.Id))
.Select(x => new { x.ApplicationId, x.TaxUnitPrice }).ToListAsync();
var groups = invDetails.GroupBy(x => x.ApplicationId);
foreach (var g in groups)
{
var list = g.Select(x => new TEntity { Id = g.Key, InvoiceAmount = g.Sum(x => x.TaxUnitPrice) }).ToList();
//更新发票主表的开票金额
await TenantDb.Updateable(list).PublicSetColumns(x => x.InvoiceAmount, "-")
.UpdateColumns(x => new { x.InvoiceAmount }).ExecuteCommandAsync();
}
await TenantDb.Deleteable<InvoiceDetail>().Where(x => ids.Contains(x.Id)).ExecuteCommandAsync();
//删除对应关系
await TenantDb.Deleteable<ApplicationDetailRelation>().Where(x => ids.Contains(x.InvoiceDetailId)).ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync();
return DataResult.Success;
}
catch (Exception ex)
{
await TenantDb.Ado.RollbackTranAsync();
await ex.LogAsync(Db);
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
} }
/// <summary> /// <summary>
@ -554,12 +795,15 @@ namespace DS.WMS.Core.Invoice.Method
/// <returns></returns> /// <returns></returns>
protected virtual async Task OnDeleteDetailAsync(List<TEntity> invoices, DeleteOption deleteOption) protected virtual async Task OnDeleteDetailAsync(List<TEntity> invoices, DeleteOption deleteOption)
{ {
var excludeIds = invoices.SelectMany(x => x.Details).Select(x => x.Id).ToList(); var appIds = invoices.Select(x => x.Id);
//await TenantDb.Deleteable<InvoiceDetail>().Where(x => excludeIds.Contains(x.Id)).ExecuteCommandAsync();
if (deleteOption == DeleteOption.DetailOnly) if (deleteOption == DeleteOption.DetailOnly)
{ {
var appIds = invoices.Select(x => x.Id).ToList(); //删除明细需要同时变更发票明细
foreach (var item in invoices)
BuildInvoiceDetailAsync(item, BuildOption.Delete);
var excludeIds = invoices.SelectMany(x => x.Details).Select(x => x.Id);
var details = await TenantDb.Queryable<ApplicationDetail>().Where(x => appIds.Contains(x.ApplicationId) && !excludeIds.Contains(x.Id)) var details = await TenantDb.Queryable<ApplicationDetail>().Where(x => appIds.Contains(x.ApplicationId) && !excludeIds.Contains(x.Id))
.Select(x => new ApplicationDetail .Select(x => new ApplicationDetail
{ {
@ -577,24 +821,39 @@ namespace DS.WMS.Core.Invoice.Method
item.AmountUppercase = new Money(item.ApplyAmount).ToString(); item.AmountUppercase = new Money(item.ApplyAmount).ToString();
} }
////删除明细需要同时变更发票明细
//await CreateInvoiceDetailsAsync(invoices);
//var invDetails = invoices.SelectMany(x => x.InvoiceDetails).ToList();
//if (invDetails.Count > 0)
// await TenantDb.Insertable(invDetails).ExecuteCommandAsync();
await TenantDb.Updateable(invoices).UpdateColumns(x => new await TenantDb.Updateable(invoices).UpdateColumns(x => new
{ {
x.ApplyAmount, x.ApplyAmount,
x.AmountUppercase x.AmountUppercase
}).ExecuteCommandAsync(); }).ExecuteCommandAsync();
//删除明细之间的关系
}
else if (deleteOption == DeleteOption.Entire)
{
//删除发票主表则同时删除对应发票明细
await TenantDb.Deleteable<InvoiceDetail>().Where(x => appIds.Contains(x.ApplicationId)).ExecuteCommandAsync();
//删除明细之间的关系
await TenantDb.Deleteable<ApplicationDetailRelation>().Where(x => appIds.Contains(x.InvoiceId)).ExecuteCommandAsync();
} }
foreach (var item in invoices)
{
//还原费用表的已开票金额 //还原费用表的已开票金额
var fees = invoices.SelectMany(x => x.Details).Select(x => new FeeRecord { Id = x.RecordId, InvoiceAmount = x.OriginalAmount }).ToList(); var fees = item.Details?.Select(x => new FeeRecord { Id = x.RecordId, InvoiceAmount = x.OriginalAmount }).ToList();
await TenantDb.Updateable(fees)
.PublicSetColumns(it => it.InvoiceAmount, "-").UpdateColumns(x => new { x.InvoiceAmount }) var updateable = TenantDb.Updateable(fees).PublicSetColumns(x => x.InvoiceAmount, "-");
.ExecuteCommandAsync();
if (item.Type == InvoiceType.Applcation)
updateable = updateable.PublicSetColumns(x => x.OrderInvSettlementAmount, "-")
.UpdateColumns(x => new { x.OrderInvSettlementAmount });
await updateable.UpdateColumns(x => new { x.InvoiceAmount }).ExecuteCommandAsync();
}
} }
/// <summary> /// <summary>
@ -604,51 +863,6 @@ namespace DS.WMS.Core.Invoice.Method
/// <param name="deleteOption">发票删除选项</param> /// <param name="deleteOption">发票删除选项</param>
protected virtual Task PostDeleteAsync(List<TEntity> invoices, DeleteOption deleteOption) => Task.CompletedTask; protected virtual Task PostDeleteAsync(List<TEntity> invoices, DeleteOption deleteOption) => Task.CompletedTask;
/// <summary>
/// 生成发票明细
/// </summary>
/// <param name="invoices"></param>
/// <returns></returns>
protected async Task BuildInvoiceDetailAsync(IEnumerable<TEntity> invoices)
{
foreach (var invoice in invoices)
{
if (invoice.Details?.Count > 0 && (invoice.InvoiceDetails == null || invoice.InvoiceDetails.Count == 0))
{
var ids = invoice.Details.Select(x => x.RecordId).ToList();
var feesCodes = await TenantDb.Queryable<FeeRecord>().InnerJoin<FeeCode>((f, c) => f.FeeId == c.Id && ids.Contains(f.Id))
.Select((f, c) => new
{
FeeId = c.Id,
c.GoodName
}).ToListAsync();
var list = feesCodes.GroupBy(x => x.GoodName).Select(x => new
{
Name = x.Key,
FeeIds = x.Select(y => y.FeeId)
}).ToList();
invoice.InvoiceDetails = new List<InvoiceDetail>(list.Count);
foreach (var item in list)
{
var invDetail = new InvoiceDetail
{
ApplicationId = invoice.Id,
Name = item.Name,
TaxRate = invoice.TaxRate,
TaxUnitPrice = invoice.Details.FindAll(x => item.FeeIds.Contains(x.FeeId)).Sum(x => x.ApplyAmount),
Category = DetailCategory.InvoiceIssuance
};
invDetail.TaxAmount = invDetail.TaxUnitPrice * invoice.TaxRate;
invDetail.UnitPrice = invDetail.TaxUnitPrice - invDetail.TaxAmount;
invoice.InvoiceDetails.Add(invDetail);
invoice.InvoiceAmount = invoice.InvoiceDetails.Sum(x => x.TaxUnitPrice);
}
}
}
}
/// <summary> /// <summary>
/// 设置发票的锁定状态 /// 设置发票的锁定状态

@ -1,5 +1,7 @@
using System; using SqlSugar;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -11,6 +13,11 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary> /// </summary>
public class BookingSlotStockDto public class BookingSlotStockDto
{ {
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary> /// <summary>
/// 船名 /// 船名
/// </summary> /// </summary>
@ -165,5 +172,54 @@ namespace DS.WMS.Core.Op.Dtos
/// 剩余箱数 /// 剩余箱数
/// </summary> /// </summary>
public int RemainCtnsNum { get; set; } public int RemainCtnsNum { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 创建人
public long CreateBy { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
public string CreateUserName { get; set; }
/// <summary>
/// 修改人
/// </summary>
public long UpdateBy { get; set; }
/// <summary>
/// 修改人名称
/// </summary>
public string UpdateUserName { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 删除
/// </summary>
public bool Deleted { get; set; } = false;
/// <summary>
/// 删除人名称
/// </summary>
public string DeleteUserName { get; set; }
/// <summary>
/// 删除时间
/// </summary>
public DateTime DeleteTime { get; set; }
/// <summary>
/// 删除人
/// </summary>
public long DeleteBy { get; set; }
} }
} }

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Dtos
{
/// <summary>
/// 引入舱位
/// </summary>
public class ImportSlotsDto
{
/// <summary>
/// 待引入的舱位列表
/// </summary>
public List<BookingSlotBaseWithCtnDto> slots { get; set; }
/// <summary>
/// 待关联的订舱记录
/// </summary>
public long bookingOrderId { get; set; }
/// <summary>
/// 是否进行剩余量检查
/// </summary>
public bool isCheck { get; set; }
/// <summary>
/// 额外的用于生成管理记录的信息
/// </summary>
public BookingGenerateDto generateModel { get; set; }
}
}

@ -52,12 +52,9 @@ namespace DS.WMS.Core.Op.Interface
/// <summary> /// <summary>
/// 为指定订舱记录引入舱位信息 /// 为指定订舱记录引入舱位信息
/// </summary> /// </summary>
/// <param name="slots">待引入的舱位列表</param> /// <param name="model">引入的舱位请求参数</param>
/// <param name="bookingOrderId">待关联的订舱记录</param>
/// <param name="isCheck">是否进行剩余量检查</param>
/// <param name="generateModel">额外的用于生成管理记录的信息</param>
/// <returns>(是否成功,提示消息)</returns> /// <returns>(是否成功,提示消息)</returns>
Task<(bool isSuccess, string message)> ImportSlots(List<BookingSlotBaseWithCtnDto> slots, long bookingOrderId, bool isCheck, BookingGenerateDto generateModel = null); Task<DataResult<string>> ImportSlots(ImportSlotsDto model);
/// <summary> /// <summary>
/// 库存台账查询 /// 库存台账查询
@ -88,12 +85,11 @@ namespace DS.WMS.Core.Op.Interface
Task<DataResult<List<OpFileRes>>> GetFile(long id); Task<DataResult<List<OpFileRes>>> GetFile(long id);
/// <summary> /// <summary>
/// 分页查询订舱舱位 /// 舱位台账查询
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="querySearch">查询条件</param>
/// <returns></returns> /// <returns></returns>
Task<dynamic> Page(BookingSlotBasePageInput input); Task<DataResult<List<BookingSlotBaseDto>>> GetPageAsync(PageRequest querySearch);
/// <summary> /// <summary>
/// 舱位接收保存、取消接口 /// 舱位接收保存、取消接口

@ -1,4 +1,5 @@
using DS.Module.Core; using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Op.Dtos; using DS.WMS.Core.Op.Dtos;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -106,6 +107,12 @@ namespace DS.WMS.Core.Op.Interface
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
Task<DataResult<MSKBookingResultDto>> SyncBCInfo(string mblno, long tenantId, string opTypeName = "BookingConfirmation"); Task<DataResult<MSKBookingResultDto>> SyncBCInfo(string mblno, long tenantId, string opTypeName = "BookingConfirmation");
/// <summary>
/// 同步BC状态BC,Cancellation作为任务台执行模块
/// </summary>
/// <param name="dataContext">数据上下文</param>
Task<DataResult<MSKBookingResultDto>> SyncBCInfoTask(TaskFlowDataContext dataContext);
/// <summary> /// <summary>
/// 获取初始化页面默认值 /// 获取初始化页面默认值
/// </summary> /// </summary>

@ -47,6 +47,7 @@ using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Code.Method; using DS.WMS.Core.Code.Method;
using DS.WMS.Core.Map.Method; using DS.WMS.Core.Map.Method;
using DS.Module.Core.Extensions; using DS.Module.Core.Extensions;
using DS.Module.Core.Constants;
namespace DS.WMS.Core.Op.Method namespace DS.WMS.Core.Op.Method
{ {
@ -173,17 +174,17 @@ namespace DS.WMS.Core.Op.Method
if (isNeedUpdateOldStock) if (isNeedUpdateOldStock)
{ {
//更新库存 //更新库存
//await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", new BookingSlotStockUpdateModel await _bookingSlotStockService.BookingSlotStock(new BookingSlotStockUpdateModel
//{ {
// BOOKING_SLOT_TYPE = oldObj.BOOKING_SLOT_TYPE, BookingSlotType = oldObj.BookingSlotType,
// CARRIERID = oldObj.CARRIERID, CarrierCode = oldObj.CarrierCode,
// CONTRACT_NO = oldObj.CONTRACT_NO, ContractNo = oldObj.ContractNo,
// VESSEL = oldObj.VESSEL, Vessel = oldObj.Vessel,
// VOYNO = oldObj.VOYNO, Voyno = oldObj.Voyno,
// PORTLOADID = oldObj.PORTLOADID, PortLoadId = oldObj.PortLoadId,
// PORTDISCHARGEID = oldObj.PORTDISCHARGEID, PortDischargeId = oldObj.PortDischargeId,
// TenantId = model.TenantId TenantId = long.Parse(user.TenantId)
//})); });
} }
var delCtnList = tenantDb.Queryable<BookingSlotCtn>().Where(x => x.SlotId == model.Id).ToList(); var delCtnList = tenantDb.Queryable<BookingSlotCtn>().Where(x => x.SlotId == model.Id).ToList();
@ -342,17 +343,17 @@ namespace DS.WMS.Core.Op.Method
} }
//更新库存 //更新库存
//await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", new BookingSlotStockUpdateModel await _bookingSlotStockService.BookingSlotStock(new BookingSlotStockUpdateModel
//{ {
// BOOKING_SLOT_TYPE = model.BOOKING_SLOT_TYPE, BookingSlotType = model.BookingSlotType,
// CARRIERID = model.CARRIERID, CarrierCode = model.CarrierCode,
// CONTRACT_NO = model.CONTRACT_NO, ContractNo = model.ContractNo,
// VESSEL = model.VESSEL, Vessel = model.Vessel,
// VOYNO = model.VOYNO, Voyno = model.Voyno,
// PORTLOADID = model.PORTLOADID, PortLoadId = model.PortLoadCode,
// PORTDISCHARGEID = model.PORTDISCHARGEID, PortDischargeId = model.PortDischargeCode,
// TenantId = model.TenantId TenantId = long.Parse(user.TenantId)
//})); });
var inputDto = new BookingSlotBaseApiDto var inputDto = new BookingSlotBaseApiDto
{ {
@ -2238,7 +2239,13 @@ namespace DS.WMS.Core.Op.Method
if (id > 0) if (id > 0)
{ {
////对应订舱和舱位关系 ////对应订舱和舱位关系
var allocRlt = await ImportSlots(importSlots, id, false, generateModel); var allocRlt = await ImportSlots(new ImportSlotsDto {
slots = importSlots,
bookingOrderId = id,
isCheck = false,
generateModel = generateModel
});
Logger.Log(NLog.LogLevel.Info, "根据舱位生成订舱,引入订舱关系完成"); Logger.Log(NLog.LogLevel.Info, "根据舱位生成订舱,引入订舱关系完成");
//更新舱位的拆合单标记 //更新舱位的拆合单标记
@ -2404,38 +2411,32 @@ namespace DS.WMS.Core.Op.Method
} }
#endregion #endregion
#region 为指定订舱记录引入舱位信息
/// <summary> /// <summary>
/// 为指定订舱记录引入舱位信息 /// 为指定订舱记录引入舱位信息
/// </summary> /// </summary>
/// <param name="slots">待引入的舱位列表</param> /// <param name="model">引入的舱位请求参数</param>
/// <param name="bookingOrderId">待关联的订舱记录</param> /// <returns>返回回执</returns>
/// <param name="isCheck">是否进行剩余量检查</param> public async Task<DataResult<string>> ImportSlots(ImportSlotsDto model)
/// <param name="generateModel">额外的用于生成管理记录的信息</param>
/// <returns>isSuccess检查余量及已引用检查是否成功通过message提示信息</returns>
[NonAction]
public async Task<(bool isSuccess, string message)> ImportSlots(List<BookingSlotBaseWithCtnDto> slots,
long bookingOrderId,
bool isCheck,
BookingGenerateDto generateModel = null)
{ {
slots ??= new List<BookingSlotBaseWithCtnDto>(); model.slots ??= new List<BookingSlotBaseWithCtnDto>();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
Monitor.Enter(ImportLockObj); Monitor.Enter(ImportLockObj);
try try
{ {
if (isCheck) if (model.isCheck)
{ {
(bool isExists, bool isEnough, string message) checkResult = await CheckImportSlots(slots, bookingOrderId); (bool isExists, bool isEnough, string message) checkResult = await CheckImportSlots(model.slots, model.bookingOrderId);
if (checkResult.isExists || !checkResult.isEnough) if (checkResult.isExists || !checkResult.isEnough)
return (false, checkResult.message); return DataResult<string>.FailedData(checkResult.message);
} }
var slotIdList = slots.Select(s => s.Id).ToList(); var slotIdList = model.slots.Select(s => s.Id).ToList();
List<BookingSlotBase> latestSlotList = await tenantDb.Queryable<BookingSlotBase>().Where(b => slotIdList.Contains(b.Id)).ToListAsync(); List<BookingSlotBase> latestSlotList = await tenantDb.Queryable<BookingSlotBase>().Where(b => slotIdList.Contains(b.Id)).ToListAsync();
foreach (var inSlotItem in slots) foreach (var inSlotItem in model.slots)
{ {
var latestSlot = latestSlotList.First(b => b.Id == inSlotItem.Id); var latestSlot = latestSlotList.First(b => b.Id == inSlotItem.Id);
@ -2454,33 +2455,33 @@ namespace DS.WMS.Core.Op.Method
var newSlotAllocation = latestSlot.Adapt<BookingSlotAllocation>(config); var newSlotAllocation = latestSlot.Adapt<BookingSlotAllocation>(config);
newSlotAllocation.Id = 0; newSlotAllocation.Id = 0;
newSlotAllocation.BookingSlotId = latestSlot.Id; newSlotAllocation.BookingSlotId = latestSlot.Id;
newSlotAllocation.BookingId = bookingOrderId; newSlotAllocation.BookingId = model.bookingOrderId;
newSlotAllocation.AlloBillNo = latestSlot.SlotBookingNo; newSlotAllocation.AlloBillNo = latestSlot.SlotBookingNo;
newSlotAllocation.FinalBillNo = latestSlot.SlotBookingNo; newSlotAllocation.FinalBillNo = latestSlot.SlotBookingNo;
if (generateModel != null) if (model.generateModel != null)
{ {
newSlotAllocation.CustomerId = generateModel.CustomerId; newSlotAllocation.CustomerId = model.generateModel.CustomerId;
newSlotAllocation.CustomerName = generateModel.CustomerName; newSlotAllocation.CustomerName = model.generateModel.CustomerName;
newSlotAllocation.CustServiceId = generateModel.CustServiceId?.ToString(); newSlotAllocation.CustServiceId = model.generateModel.CustServiceId?.ToString();
newSlotAllocation.CustService = generateModel.CustServiceName; newSlotAllocation.CustService = model.generateModel.CustServiceName;
newSlotAllocation.SaleId = generateModel.SaleId?.ToString(); newSlotAllocation.SaleId = model.generateModel.SaleId?.ToString();
newSlotAllocation.Sale = generateModel.SaleName; newSlotAllocation.Sale = model.generateModel.SaleName;
newSlotAllocation.DocId = generateModel.DocId?.ToString(); newSlotAllocation.DocId = model.generateModel.DocId?.ToString();
newSlotAllocation.Doc = generateModel.DocName; newSlotAllocation.Doc = model.generateModel.DocName;
newSlotAllocation.OpId = generateModel.OpId?.ToString(); newSlotAllocation.OpId = model.generateModel.OpId?.ToString();
newSlotAllocation.Op = generateModel.OpName; newSlotAllocation.Op = model.generateModel.OpName;
newSlotAllocation.Business = generateModel.BUSINESS; newSlotAllocation.Business = model.generateModel.BUSINESS;
newSlotAllocation.BusinessId = generateModel.BUSINESSID; newSlotAllocation.BusinessId = model.generateModel.BUSINESSID;
newSlotAllocation.SaleTime = generateModel.SALE_TIME; newSlotAllocation.SaleTime = model.generateModel.SALE_TIME;
newSlotAllocation.Shipper = generateModel.SHIPPER; newSlotAllocation.Shipper = model.generateModel.SHIPPER;
newSlotAllocation.GoodsName = generateModel.GOODSNAME; newSlotAllocation.GoodsName = model.generateModel.GOODSNAME;
newSlotAllocation.SellingPrice = generateModel.SELLING_PRICE; newSlotAllocation.SellingPrice = model.generateModel.SELLING_PRICE;
newSlotAllocation.SplitOrMergeFlag = generateModel.SplitOrMerge; newSlotAllocation.SplitOrMergeFlag = model.generateModel.SplitOrMerge;
if (generateModel.SplitOrMerge == 1 || generateModel.SplitOrMerge == 2) if (model.generateModel.SplitOrMerge == 1 || model.generateModel.SplitOrMerge == 2)
{ {
newSlotAllocation.AlloBillNo = generateModel.NewMBlNo; newSlotAllocation.AlloBillNo = model.generateModel.NewMBlNo;
} }
} }
@ -2504,7 +2505,7 @@ namespace DS.WMS.Core.Op.Method
{ {
var file = lastestBcFile.Adapt<OpFile>(); var file = lastestBcFile.Adapt<OpFile>();
file.Id = 0; file.Id = 0;
file.LinkId = bookingOrderId; file.LinkId = model.bookingOrderId;
await tenantDb.Insertable<OpFile>(file).ExecuteCommandAsync(); await tenantDb.Insertable<OpFile>(file).ExecuteCommandAsync();
} }
@ -2515,21 +2516,10 @@ namespace DS.WMS.Core.Op.Method
ContractNo = latestSlot.ContractNo, ContractNo = latestSlot.ContractNo,
Vessel = latestSlot.Vessel, Vessel = latestSlot.Vessel,
Voyno = latestSlot.Voyno, Voyno = latestSlot.Voyno,
PortLoadId = latestSlot.PortLoadCode,
PortDischargeId = latestSlot.PortLoadCode, PortDischargeId = latestSlot.PortLoadCode,
//PORTDISCHARGEID = latestSlot.PORTDISCHARGEID,
}); });
// 更新库存
//await _publisher.PublishAsync(new ChannelEventSource("BookingSlotStock:Update", new Event.BookingSlotStockUpdateModel
//{
// BOOKING_SLOT_TYPE = latestSlot.BOOKING_SLOT_TYPE,
// CARRIERID = latestSlot.CARRIERID,
// CONTRACT_NO = latestSlot.CONTRACT_NO,
// VESSEL = latestSlot.VESSEL,
// VOYNO = latestSlot.VOYNO,
// PORTLOADID = latestSlot.PORTLOADID,
// PORTDISCHARGEID = latestSlot.PORTDISCHARGEID,
// TenantId = latestSlot.TenantId,
//}));
} }
} }
finally finally
@ -2537,8 +2527,9 @@ namespace DS.WMS.Core.Op.Method
Monitor.Exit(ImportLockObj); Monitor.Exit(ImportLockObj);
} }
return (true, "引入成功"); return DataResult<string>.Success("引入成功");
} }
#endregion
#region 检索舱位对应的订舱订单(BY 舱位主键) #region 检索舱位对应的订舱订单(BY 舱位主键)
/// <summary> /// <summary>
@ -2693,9 +2684,25 @@ namespace DS.WMS.Core.Op.Method
throw new NotImplementedException(); throw new NotImplementedException();
} }
Task<dynamic> IBookingSlotService.Page(BookingSlotBasePageInput input) /// <summary>
/// 舱位台账查询
/// </summary>
/// <param name="querySearch">查询条件</param>
/// <returns></returns>
public async Task<DataResult<List<BookingSlotBaseDto>>> GetPageAsync(PageRequest querySearch)
{ {
throw new NotImplementedException(); var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(querySearch.QueryCondition);
var result = tenantDb.Queryable<BookingSlotBase>()
.InnerJoin<BookingSlotCtn>((a, b) => a.Id == b.SlotId)
.Select<BookingSlotBaseDto>()
.Where(whereList);
//.ToQueryPageAsync(request.PageCondition);
var list = result.ToList();
var data = await result.ToQueryPageAsync(querySearch.PageCondition);
return data;
} }
Task<long> IBookingSlotService.InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file, DynameFileInfo modifyFile) Task<long> IBookingSlotService.InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file, DynameFileInfo modifyFile)

@ -32,6 +32,9 @@ using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Map.Method; using DS.WMS.Core.Map.Method;
using Microsoft.Owin.Security.Provider; using Microsoft.Owin.Security.Provider;
using LanguageExt; using LanguageExt;
using DS.Module.Core.Data;
using DS.WMS.Core.TaskPlat.Dtos;
using NLog.Fluent;
namespace DS.WMS.Core.Op.Method namespace DS.WMS.Core.Op.Method
{ {
@ -433,7 +436,8 @@ namespace DS.WMS.Core.Op.Method
} }
showDto.Legs = legs.OrderBy(t => t.ETD).Select((t, idx) => { showDto.Legs = legs.OrderBy(t => t.ETD).Select((t, idx) =>
{
t.SortNo = idx + 1; t.SortNo = idx + 1;
return t; return t;
}).ToList(); }).ToList();
@ -1544,7 +1548,8 @@ namespace DS.WMS.Core.Op.Method
ctnEntity.UpdateBy = long.Parse(user.UserId); ctnEntity.UpdateBy = long.Parse(user.UserId);
//ctnEntity.UpdatedUserName = UserManager.Name; //ctnEntity.UpdatedUserName = UserManager.Name;
tenantDb.Updateable<SpaceBookingOrderCtn>(ctnEntity).IgnoreColumns(x => new { tenantDb.Updateable<SpaceBookingOrderCtn>(ctnEntity).IgnoreColumns(x => new
{
x.CreateBy, x.CreateBy,
//x.CreatedUserName, //x.CreatedUserName,
x.CreateTime, x.CreateTime,
@ -1579,13 +1584,15 @@ namespace DS.WMS.Core.Op.Method
if (ctnEntityList.Count > 0) if (ctnEntityList.Count > 0)
{ {
ctnEntityList.ForEach(async ctn => { ctnEntityList.ForEach(async ctn =>
{
ctn.Deleted = true; ctn.Deleted = true;
ctn.DeleteTime = nowDate; ctn.DeleteTime = nowDate;
ctn.DeleteBy = long.Parse(user.UserId); ctn.DeleteBy = long.Parse(user.UserId);
//ctn.UpdatedUserName = UserManager.Name; //ctn.UpdatedUserName = UserManager.Name;
await tenantDb.Updateable<SpaceBookingOrderCtn>(ctn).UpdateColumns(x => new { await tenantDb.Updateable<SpaceBookingOrderCtn>(ctn).UpdateColumns(x => new
{
x.Deleted, x.Deleted,
x.DeleteTime, x.DeleteTime,
x.DeleteBy, x.DeleteBy,
@ -1690,7 +1697,8 @@ namespace DS.WMS.Core.Op.Method
shipScheduleRecord.DeleteBy = long.Parse(user.UserId); shipScheduleRecord.DeleteBy = long.Parse(user.UserId);
//shipScheduleRecord.UpdatedUserName = UserManager.Name; //shipScheduleRecord.UpdatedUserName = UserManager.Name;
await tenantDb.Updateable<SpaceBookingOrderShipSchedule>(shipScheduleRecord).UpdateColumns(x => new { await tenantDb.Updateable<SpaceBookingOrderShipSchedule>(shipScheduleRecord).UpdateColumns(x => new
{
x.Deleted, x.Deleted,
x.DeleteTime, x.DeleteTime,
x.DeleteBy, x.DeleteBy,
@ -1743,7 +1751,8 @@ namespace DS.WMS.Core.Op.Method
info.DeleteBy = long.Parse(user.UserId); info.DeleteBy = long.Parse(user.UserId);
//info.UpdatedUserName = UserManager.Name; //info.UpdatedUserName = UserManager.Name;
await tenantDb.Updateable<SpaceBookingOrder>(info).UpdateColumns(x => new { await tenantDb.Updateable<SpaceBookingOrder>(info).UpdateColumns(x => new
{
x.Deleted, x.Deleted,
x.DeleteTime, x.DeleteTime,
x.DeleteBy x.DeleteBy
@ -1978,7 +1987,8 @@ namespace DS.WMS.Core.Op.Method
model.UpdateBy = long.Parse(user.UserId); model.UpdateBy = long.Parse(user.UserId);
//model.UpdatedUserName = UserManager.Name; //model.UpdatedUserName = UserManager.Name;
await tenantDb.Updateable<SpaceBookingOrder>(model).UpdateColumns(x => new { await tenantDb.Updateable<SpaceBookingOrder>(model).UpdateColumns(x => new
{
x.IsRecvBC, x.IsRecvBC,
x.LstRecvBCDate, x.LstRecvBCDate,
x.UpdateTime, x.UpdateTime,
@ -1994,7 +2004,8 @@ namespace DS.WMS.Core.Op.Method
model.UpdateBy = long.Parse(user.UserId); model.UpdateBy = long.Parse(user.UserId);
//model.UpdatedUserName = UserManager.Name; //model.UpdatedUserName = UserManager.Name;
await tenantDb.Updateable<SpaceBookingOrder>(model).UpdateColumns(x => new { await tenantDb.Updateable<SpaceBookingOrder>(model).UpdateColumns(x => new
{
x.IsRecvBKCancel, x.IsRecvBKCancel,
x.LstRecvBKCancelDate, x.LstRecvBKCancelDate,
x.UpdateTime, x.UpdateTime,
@ -2013,6 +2024,41 @@ namespace DS.WMS.Core.Op.Method
return DataResult<MSKBookingResultDto>.Success(result); return DataResult<MSKBookingResultDto>.Success(result);
} }
/// <summary>
/// 同步BC状态BC,Cancellation作为任务台执行模块
/// </summary>
/// <param name="dataContext">数据上下文</param>
public async Task<DataResult<MSKBookingResultDto>> SyncBCInfoTask(TaskFlowDataContext dataContext)
{
var messageInfo = dataContext.Get<TaskManageOrderMessageInfo>(TaskFlowDataNameConst.TaskManageOrderMessageInfo);
if (messageInfo == null)
{
throw new ArgumentNullException($"缺少参数:{TaskFlowDataNameConst.TaskManageOrderMessageInfo}");
}
if (string.IsNullOrEmpty(messageInfo.Main?.BCInfo?.MBLNo))
{
throw new ArgumentNullException($"提单号为空");
}
var tenantId = dataContext.Get<long>(TaskFlowDataNameConst.TenantId);
if (tenantId == 0)
{
throw new ArgumentNullException($"缺少参数:TenantId");
}
string type = messageInfo.Main.TaskType switch
{
TaskBaseTypeEnum.BC => "BookingConfirmation",
TaskBaseTypeEnum.CANCELLATION => "Cancellation",
_ => throw new NotImplementedException()
};
var result = await this.SyncBCInfo(messageInfo.Main.BCInfo.MBLNo, tenantId, type);
Logger.Log(NLog.LogLevel.Info, $"入库完BC自动推送状态到API订舱列表 mblno={messageInfo.Main.BCInfo.MBLNo} synRlt={JsonConvert.SerializeObject(result)}");
return result;
}
#endregion #endregion
#region 批量复制前调取校验预警 #region 批量复制前调取校验预警

@ -6,6 +6,7 @@ namespace DS.WMS.Core.TaskPlat.Interface
public interface IMyModuleTest1 public interface IMyModuleTest1
{ {
Task<DataResult> TestMethod11(TaskFlowDataContext dataContext); Task<DataResult> TestMethod11(TaskFlowDataContext dataContext);
Task<DataResult> TestMethod11();
DataResult TestMethod12(TaskFlowDataContext dataContext); DataResult TestMethod12(TaskFlowDataContext dataContext);
//public string G() //public string G()

@ -21,6 +21,10 @@ namespace DS.WMS.Core.TaskPlat.Method
return Task.FromResult(DataResult.Successed($"TestMethod11返回的成功结果address:{address}height:{height}bcInfoVessel:{bcInfoVessel}")); return Task.FromResult(DataResult.Successed($"TestMethod11返回的成功结果address:{address}height:{height}bcInfoVessel:{bcInfoVessel}"));
} }
public Task<DataResult> TestMethod11()
{
return Task.FromResult(DataResult.Successed($"TestMethod11返回的成功结果"));
}
public DataResult TestMethod12(TaskFlowDataContext dataContext) public DataResult TestMethod12(TaskFlowDataContext dataContext)
{ {
throw new Exception("TestMethod12内的测试异常"); throw new Exception("TestMethod12内的测试异常");

@ -478,9 +478,14 @@ namespace DS.WMS.Core.TaskPlat.Method
2@ 2@
*/ */
TaskFlowDataContext dataContext = new(nameof(TaskManageOrderMessageInfo), info); // 执行自动化操作
TaskFlowDataContext dataContext = new(
(TaskFlowDataNameConst.TaskManageOrderMessageInfo, info),
(TaskFlowDataNameConst.TenantId, long.Parse(user.TenantId))
);
TaskFlowRuner taskFlow = new TaskFlowRuner(tenantDb, serviceProvider); TaskFlowRuner taskFlow = new TaskFlowRuner(tenantDb, serviceProvider);
await taskFlow.Run(info.Main.TaskType, info, taskInfo, dataContext); await taskFlow.Run(info.Main.TaskType, taskInfo.Id, dataContext);
if (info.Main.TaskType == TaskBaseTypeEnum.BC) if (info.Main.TaskType == TaskBaseTypeEnum.BC)
{ {

@ -1,6 +1,5 @@
using DS.Module.Core; using DS.Module.Core;
using DS.Module.Core.Data; using DS.Module.Core.Data;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Entity; using DS.WMS.Core.TaskPlat.Entity;
using Newtonsoft.Json; using Newtonsoft.Json;
using SqlSugar; using SqlSugar;
@ -33,16 +32,11 @@ namespace DS.WMS.Core.TaskPlat
/// 执行 /// 执行
/// </summary> /// </summary>
/// <param name="taskBaseType">任务类型</param> /// <param name="taskBaseType">任务类型</param>
/// <param name="messageInfo">任务原始接收信息</param> /// <param name="taskId">任务Id</param>
/// <param name="taskInfo">任务基础信息</param> /// <param name="dataContext">起始入参数据上下文</param>
/// <param name="dataContext">原始入参数据</param>
/// <returns>(执行日志Id,模块是否全部执行完成,模块执行结果是否全部为success)</returns> /// <returns>(执行日志Id,模块是否全部执行完成,模块执行结果是否全部为success)</returns>
public async Task<(long flowLogId, bool isAllComplete, bool isAllSuccess)> Run(TaskBaseTypeEnum taskBaseType, TaskManageOrderMessageInfo messageInfo, TaskBaseInfo taskInfo, TaskFlowDataContext dataContext) public async Task<(long flowLogId, bool isAllComplete, bool isAllSuccess)> Run(TaskBaseTypeEnum taskBaseType, long taskId, TaskFlowDataContext dataContext)
{ {
if (taskInfo == null)
{
throw new ArgumentNullException(nameof(taskInfo));
}
if (dataContext == null) if (dataContext == null)
{ {
throw new ArgumentNullException(nameof(dataContext)); throw new ArgumentNullException(nameof(dataContext));
@ -58,7 +52,7 @@ namespace DS.WMS.Core.TaskPlat
TaskFlowLog log = new() TaskFlowLog log = new()
{ {
IsMatch = false, IsMatch = false,
TaskId = taskInfo.Id, TaskId = taskId,
TaskType = taskBaseType.ToString(), TaskType = taskBaseType.ToString(),
IsComplete = false, IsComplete = false,
ExceptionMessage = msg, ExceptionMessage = msg,
@ -73,43 +67,60 @@ namespace DS.WMS.Core.TaskPlat
.Where(x => allConfigIdList.Contains(x.ConfigId)) .Where(x => allConfigIdList.Contains(x.ConfigId))
.ToListAsync(); .ToListAsync();
// 判断每项流程达成的条件数量
Dictionary<long, int> configMatchCount = allConfigList.ToDictionary(x => x.Id, x => 0); Dictionary<long, int> configMatchCount = allConfigList.ToDictionary(x => x.Id, x => 0);
//dynamic taskInfoDynamic = taskInfo;
foreach (var configItem in allConfigList) foreach (var configItem in allConfigList)
{ {
var conditionListGroup = allConditionList.Where(x => x.ConfigId == configItem.Id); var conditionListGroup = allConditionList.Where(x => x.ConfigId == configItem.Id);
foreach (var conditionItem in conditionListGroup) foreach (var conditionItem in conditionListGroup)
{ {
var (_, val, _) = GetPropertyValue(messageInfo, conditionItem.FieldName); string? valStr;
if (conditionItem.FieldName.Contains('.'))
{
var firstKey = conditionItem.FieldName.Split('.').First();
if (!dataContext.ContainsKey(firstKey)) continue;
var obj = dataContext.Get<object>(firstKey)!;
var propertyPath = conditionItem.FieldName.Substring(conditionItem.FieldName.IndexOf('.') + 1);
var (_, val, _) = GetPropertyValue(obj, propertyPath);
if (val == null) continue; if (val == null) continue;
var valStr = val.ToString()!; valStr = val.ToString();
}
else
{
if (!dataContext.ContainsKey(conditionItem.FieldName)) continue;
var obj = dataContext.Get<object>(conditionItem.FieldName)!;
valStr = obj.ToString();
}
if (conditionItem.MatchType == 1) if (conditionItem.MatchType == 1)
{ {
if (valStr.Equals(conditionItem.MatchValue, StringComparison.CurrentCultureIgnoreCase)) if (valStr?.Equals(conditionItem.MatchValue, StringComparison.CurrentCultureIgnoreCase) == true)
{ {
configMatchCount[configItem.Id] = configMatchCount[configItem.Id] + 1; configMatchCount[configItem.Id] = configMatchCount[configItem.Id] + 1;
} }
} }
else if (conditionItem.MatchType == 2) else if (conditionItem.MatchType == 2)
{ {
if (valStr.Contains(conditionItem.MatchValue!, StringComparison.CurrentCultureIgnoreCase)) if (valStr?.Contains(conditionItem.MatchValue, StringComparison.CurrentCultureIgnoreCase) == true)
{ {
configMatchCount[configItem.Id] = configMatchCount[configItem.Id] + 1; configMatchCount[configItem.Id] = configMatchCount[configItem.Id] + 1;
} }
} }
else if (conditionItem.MatchType == 3) else if (conditionItem.MatchType == 3)
{ {
if (valStr.StartsWith(conditionItem.MatchValue!, StringComparison.CurrentCultureIgnoreCase)) if (valStr?.StartsWith(conditionItem.MatchValue, StringComparison.CurrentCultureIgnoreCase) == true)
{ {
configMatchCount[configItem.Id] = configMatchCount[configItem.Id] + 1; configMatchCount[configItem.Id] = configMatchCount[configItem.Id] + 1;
} }
} }
else if (conditionItem.MatchType == 4) else if (conditionItem.MatchType == 4)
{ {
if (valStr.EndsWith(conditionItem.MatchValue!, StringComparison.CurrentCultureIgnoreCase)) if (valStr?.EndsWith(conditionItem.MatchValue, StringComparison.CurrentCultureIgnoreCase) == true)
{ {
configMatchCount[configItem.Id] = configMatchCount[configItem.Id] + 1; configMatchCount[configItem.Id] = configMatchCount[configItem.Id] + 1;
} }
@ -117,6 +128,7 @@ namespace DS.WMS.Core.TaskPlat
} }
} }
// 取出最匹配的流程
KeyValuePair<long, int>? bestMatched = null!; KeyValuePair<long, int>? bestMatched = null!;
foreach (var item in configMatchCount) foreach (var item in configMatchCount)
{ {
@ -134,6 +146,7 @@ namespace DS.WMS.Core.TaskPlat
if (item.Value == bestMatched.Value.Value) if (item.Value == bestMatched.Value.Value)
{ {
// 如果达成的条件数量相等,则取最早的流程
if (item.Key < bestMatched.Value.Key) if (item.Key < bestMatched.Value.Key)
{ {
bestMatched = new KeyValuePair<long, int>(item.Key, item.Value); bestMatched = new KeyValuePair<long, int>(item.Key, item.Value);
@ -154,7 +167,7 @@ namespace DS.WMS.Core.TaskPlat
{ {
Id = SnowFlakeSingle.Instance.NextId(), Id = SnowFlakeSingle.Instance.NextId(),
IsMatch = true, IsMatch = true,
TaskId = taskInfo.Id, TaskId = taskId,
TaskType = taskBaseType.ToString(), TaskType = taskBaseType.ToString(),
MatchMainConfigId = targetConfig.Id, MatchMainConfigId = targetConfig.Id,
ConfigList = JsonConvert.SerializeObject(configList), ConfigList = JsonConvert.SerializeObject(configList),
@ -163,6 +176,7 @@ namespace DS.WMS.Core.TaskPlat
IsSuccess = true, IsSuccess = true,
}; };
// 执行流程
foreach (var configItem in configList) foreach (var configItem in configList)
{ {
TaskFlowLogDetail flowLogDetail = new() TaskFlowLogDetail flowLogDetail = new()
@ -256,7 +270,7 @@ namespace DS.WMS.Core.TaskPlat
flowLogDetail.IsComplete = false; flowLogDetail.IsComplete = false;
flowLogDetail.IsSuccess = false; flowLogDetail.IsSuccess = false;
flowLogDetail.ExceptionMessage = WriteLog("", ex); flowLogDetail.ExceptionMessage = WriteLog("模块执行过程中发生异常", ex);
await tenantDb.Insertable(flowLogDetail).ExecuteCommandAsync(); await tenantDb.Insertable(flowLogDetail).ExecuteCommandAsync();
if (configItem.IsExceptionContinue) if (configItem.IsExceptionContinue)

@ -101,7 +101,7 @@ namespace DS.WMS.FeeApi.Controllers
} }
/// <summary> /// <summary>
/// 删除发票明细 /// 删除费用明细
/// </summary> /// </summary>
/// <param name="model">发票明细ID</param> /// <param name="model">发票明细ID</param>
/// <returns></returns> /// <returns></returns>

@ -2945,3 +2945,171 @@
2024-07-17 15:41:56.4414 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config 2024-07-17 15:41:56.4414 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-17 15:41:56.4498 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile 2024-07-17 15:41:56.4498 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-17 15:41:56.4498 Info Configuration initialized. 2024-07-17 15:41:56.4498 Info Configuration initialized.
2024-07-18 11:27:43.4190 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 11:27:43.4666 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 11:27:43.4666 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 11:27:43.4898 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 11:27:43.4948 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 11:27:43.4948 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 11:27:43.4948 Info Configuration initialized.
2024-07-18 11:34:31.2142 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 11:34:31.2422 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 11:34:31.2450 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 11:34:31.2450 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 11:34:31.2450 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 11:34:31.2627 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 11:34:31.2627 Info Configuration initialized.
2024-07-18 11:38:08.5155 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 11:38:08.5914 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 11:38:08.6284 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 11:38:08.6636 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 11:38:08.6756 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 11:38:08.6830 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 11:38:08.6830 Info Configuration initialized.
2024-07-18 11:44:51.6688 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 11:44:51.7113 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 11:44:51.7181 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 11:44:51.7365 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 11:44:51.7460 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 11:44:51.7460 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 11:44:51.7460 Info Configuration initialized.
2024-07-18 13:35:21.5138 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 13:35:21.5612 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 13:35:21.5612 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 13:35:21.6011 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 13:35:21.6127 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 13:35:21.6127 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 13:35:21.6234 Info Configuration initialized.
2024-07-18 13:58:32.4861 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 13:58:32.5226 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 13:58:32.5280 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 13:58:32.5280 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 13:58:32.5469 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 13:58:32.5469 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 13:58:32.5469 Info Configuration initialized.
2024-07-18 16:42:24.0738 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 16:42:24.1256 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 16:42:24.1256 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 16:42:24.2047 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 16:42:24.2047 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 16:42:24.2047 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 16:42:24.2190 Info Configuration initialized.
2024-07-18 16:55:27.1766 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 16:55:27.2060 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 16:55:27.2060 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 16:55:27.2217 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 16:55:27.2217 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 16:55:27.2217 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 16:55:27.2336 Info Configuration initialized.
2024-07-18 17:22:41.4230 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 17:22:41.4910 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 17:22:41.4958 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 17:22:41.5180 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 17:22:41.5180 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 17:22:41.5300 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 17:22:41.5300 Info Configuration initialized.
2024-07-18 17:28:44.7162 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 17:28:44.7668 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 17:28:44.7668 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 17:28:44.7891 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 17:28:44.7963 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 17:28:44.7963 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 17:28:44.7963 Info Configuration initialized.
2024-07-18 17:41:32.0585 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-18 17:41:32.0991 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-18 17:41:32.0991 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-18 17:41:32.1223 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-18 17:41:32.1223 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-18 17:41:32.1223 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-18 17:41:32.1446 Info Configuration initialized.
2024-07-19 09:19:34.9862 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 09:19:35.0109 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 09:19:35.0109 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 09:19:35.0305 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 09:19:35.0305 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 09:19:35.0377 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 09:19:35.0377 Info Configuration initialized.
2024-07-19 11:24:38.2652 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 11:24:38.3020 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 11:24:38.3075 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 11:24:38.3254 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 11:24:38.3374 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 11:24:38.3374 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 11:24:38.3504 Info Configuration initialized.
2024-07-19 11:27:23.3357 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 11:27:23.3822 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 11:27:23.3822 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 11:27:23.4045 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 11:27:23.4121 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 11:27:23.4121 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 11:27:23.4121 Info Configuration initialized.
2024-07-19 11:29:46.6648 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 11:29:46.7253 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 11:29:46.7253 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 11:29:46.7540 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 11:29:46.7654 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 11:29:46.7654 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 11:29:46.7776 Info Configuration initialized.
2024-07-19 11:38:32.6478 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 11:38:32.7002 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 11:38:32.7002 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 11:38:32.7221 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 11:38:32.7304 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 11:38:32.7304 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 11:38:32.7425 Info Configuration initialized.
2024-07-19 13:37:25.8031 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 13:37:25.8405 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 13:37:25.8405 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 13:37:25.8681 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 13:37:25.8681 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 13:37:25.8681 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 13:37:25.8870 Info Configuration initialized.
2024-07-19 14:01:42.4487 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 14:01:42.5039 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 14:01:42.5083 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 14:01:42.5343 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 14:01:42.5458 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 14:01:42.5458 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 14:01:42.5666 Info Configuration initialized.
2024-07-19 14:25:22.8202 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 14:25:22.8617 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 14:25:22.8655 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 14:25:22.8655 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 14:25:22.8868 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 14:25:22.8868 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 14:25:22.8975 Info Configuration initialized.
2024-07-19 14:27:52.9955 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 14:27:53.0208 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 14:27:53.0461 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 14:27:53.0592 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 14:27:53.0592 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 14:27:53.0708 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 14:27:53.0708 Info Configuration initialized.
2024-07-19 14:43:21.1470 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 14:43:21.1798 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 14:43:21.1798 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 14:43:21.2084 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 14:43:21.2164 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 14:43:21.2164 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 14:43:21.2269 Info Configuration initialized.
2024-07-19 14:51:05.4318 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 14:51:05.4863 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 14:51:05.4931 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 14:51:05.5167 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 14:51:05.5309 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 14:51:05.5309 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 14:51:05.5439 Info Configuration initialized.
2024-07-19 14:54:06.9457 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 14:54:07.0147 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 14:54:07.0147 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 14:54:07.0368 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 14:54:07.0481 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 14:54:07.0560 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 14:54:07.0686 Info Configuration initialized.
2024-07-19 15:00:10.8049 Info Registered target NLog.Targets.FileTarget(Name=allfile)
2024-07-19 15:00:10.8635 Info Registered target NLog.Targets.FileTarget(Name=ownFile-web)
2024-07-19 15:00:10.8694 Info Registered target NLog.Targets.ColoredConsoleTarget(Name=console)
2024-07-19 15:00:10.8886 Info NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 5.2.8.2366. Product version: 5.2.8+f586f1341c46fa38aaaff4c641e7f0fa7e813943. GlobalAssemblyCache: False
2024-07-19 15:00:10.8983 Info Validating config: TargetNames=console, ownFile-web, ConfigItems=54, FilePath=D:\Source\Repos\DS8\ds-wms-service\DS.WMS.FeeApi\bin\Debug\net8.0\nlog.config
2024-07-19 15:00:10.8983 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: allfile
2024-07-19 15:00:10.8983 Info Configuration initialized.

@ -78,8 +78,7 @@ namespace DS.WMS.OpApi.Controllers
/// 检查指定订舱记录,是否可以引入舱位列表 /// 检查指定订舱记录,是否可以引入舱位列表
/// </summary> /// </summary>
/// <param name="slots">待引入的舱位列表</param> /// <param name="slots">待引入的舱位列表</param>
/// <param name="bookingOrderId">待关联的订舱记录</param> /// <returns>返回回执</returns>
/// <returns>(指定订舱记录是否已经引入过舱位数据,现有舱位及箱子是否满足需求,提示信息)</returns>
[HttpPost] [HttpPost]
[Route("CheckImportSlots")] [Route("CheckImportSlots")]
public async Task<DataResult> CheckImportSlots([FromBody] List<BookingSlotBaseWithCtnDto> slots) public async Task<DataResult> CheckImportSlots([FromBody] List<BookingSlotBaseWithCtnDto> slots)
@ -92,16 +91,13 @@ namespace DS.WMS.OpApi.Controllers
/// <summary> /// <summary>
/// 为指定订舱记录引入舱位信息 /// 为指定订舱记录引入舱位信息
/// </summary> /// </summary>
/// <param name="slots">待引入的舱位列表</param> /// <param name="model">引入舱位参数</param>
/// <param name="bookingOrderId">待关联的订舱记录</param>
/// <param name="isCheck">是否进行剩余量检查</param>
/// <param name="generateModel">额外的用于生成管理记录的信息</param>
/// <returns>(是否成功,提示消息)</returns> /// <returns>(是否成功,提示消息)</returns>
[HttpPost] [HttpPost]
[Route("ImportSlots")] [Route("ImportSlots")]
public async Task<DataResult> ImportSlots([FromBody] List<BookingSlotBaseWithCtnDto> slots) public async Task<DataResult<string>> ImportSlots([FromBody] ImportSlotsDto model)
{ {
return null;//await _bookingSlotService.ImportSlots(slots, 0, false, null); return await _bookingSlotService.ImportSlots(model);
} }
#endregion #endregion
@ -140,8 +136,8 @@ namespace DS.WMS.OpApi.Controllers
/// <param name="input">舱位详情</param> /// <param name="input">舱位详情</param>
/// <returns>返回输出</returns> /// <returns>返回输出</returns>
[HttpPost] [HttpPost]
[Route("Save3")] [Route("Save")]
public async Task<DataResult<BookingSlotBaseSaveOutput>> Save3([FromBody] BookingSlotBaseSaveInput input) public async Task<DataResult<BookingSlotBaseSaveOutput>> Save([FromBody] BookingSlotBaseSaveInput input)
{ {
return await _bookingSlotService.Save(input); return await _bookingSlotService.Save(input);
} }
@ -163,32 +159,15 @@ namespace DS.WMS.OpApi.Controllers
#region 分页查询订舱舱位 #region 分页查询订舱舱位
/// <summary> /// <summary>
/// 分页查询订舱舱位 /// 舱位台账查询
/// </summary> /// </summary>
/// <param name="input"></param> /// <param name="querySearch">查询条件</param>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
[Route("Page")] [Route("GetPage")]
public async Task<DataResult> Page([FromBody] BookingSlotBasePageInput input) public async Task<DataResult<List<BookingSlotBaseDto>>> GetPageAsync(PageRequest querySearch)
{ {
return await _bookingSlotService.Page(input); return await _bookingSlotService.GetPageAsync(querySearch);
}
#endregion
#region 舱位接收保存、取消接口
/// <summary>
/// 舱位接收保存、取消接口
/// </summary>
/// <param name="dto"></param>
/// <param name="file"></param>
/// <param name="modifyFile"></param>
/// <returns></returns>
[HttpPost]
[Route("InnerApiReceive")]
public async Task<DataResult<long>> InnerApiReceive([FromBody] BookingSlotBaseApiDto dto)
{
return null;// await _bookingSlotService.InnerApiReceive(dto, null, null);
} }
#endregion #endregion

@ -6,7 +6,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi</_PublishTargetUrl> <_PublishTargetUrl>D:\Code\PublishCopy\ds8-opapi</_PublishTargetUrl>
<History>True|2024-07-19T05:48:27.9722093Z||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||;</History> <History>True|2024-07-19T07:33:45.3242155Z||;False|2024-07-19T15:32:41.9604526+08:00||;True|2024-07-19T13:48:27.9722093+08:00||;False|2024-07-19T13:47:56.7900396+08:00||;True|2024-07-19T11:41:15.4223247+08:00||;True|2024-07-19T08:46:28.8014836+08:00||;True|2024-07-18T19:24:50.4184188+08:00||;True|2024-07-18T19:19:14.7056635+08:00||;True|2024-07-18T19:04:43.5615501+08:00||;True|2024-07-18T18:38:39.1976753+08:00||;True|2024-07-18T18:25:15.6833492+08:00||;True|2024-07-18T18:08:46.3114951+08:00||;True|2024-07-18T17:59:12.5292256+08:00||;True|2024-07-18T16:18:45.8049777+08:00||;True|2024-07-18T16:12:42.9723969+08:00||;True|2024-07-18T16:07:14.1432207+08:00||;True|2024-07-17T17:44:18.4741963+08:00||;True|2024-07-17T17:42:47.2735071+08:00||;True|2024-07-17T16:13:32.9037697+08:00||;True|2024-07-17T15:40:21.2550083+08:00||;True|2024-07-17T14:03:08.1814323+08:00||;True|2024-07-15T13:43:42.6073130+08:00||;True|2024-07-15T11:53:40.6498579+08:00||;True|2024-07-15T11:53:03.1652559+08:00||;True|2024-07-15T11:42:33.0154478+08:00||;True|2024-07-15T10:20:03.3925876+08:00||;True|2024-07-15T10:13:28.1415352+08:00||;True|2024-07-08T14:33:12.6884426+08:00||;True|2024-07-08T09:56:58.4995696+08:00||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>
Loading…
Cancel
Save