jianghaiqing 3 weeks ago
commit c25998f520

@ -58,7 +58,7 @@
<PackageReference Include="Snowflake.Data" Version="2.2.0" />
<PackageReference Include="Spire.XLS" Version="14.9.1" />
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.167" />
<PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.8.1" />

@ -205,20 +205,20 @@ namespace DS.WMS.Core.Application.Method
//OrderAmount = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId).Sum(f => f.OrderAmount),
//InvoiceAmount = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId).Sum(f => f.InvoiceAmount),
//SettlementAmount = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId).Sum(f => f.SettlementAmount),
//未申请开票金额=金额-开票金额-申请开票金额+申请开票金额已开票
UnBilledRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed
&& f.Currency == FeeCurrency.RMB_CODE).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount)),
&& f.Currency == FeeCurrency.RMB_CODE).Sum(f => f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount),
UnBilledUSD = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed
&& f.Currency == FeeCurrency.USD_CODE).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount)),
&& f.Currency == FeeCurrency.USD_CODE).Sum(f => f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount),
UnBilledOther = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed
&& f.Currency != FeeCurrency.RMB_CODE && f.Currency != FeeCurrency.USD_CODE).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount)),
&& f.Currency != FeeCurrency.RMB_CODE && f.Currency != FeeCurrency.USD_CODE).Sum(f => f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount),
//未结算金额=金额-结算金额-申请金额+申请金额已结算
UnSettlementPaid = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed && f.FeeType == FeeType.Payable)
.Select(f => SqlFunc.AggregateSum(f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount)),
.Sum(f => f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount),
UnSettlementCharged = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed && f.FeeType == FeeType.Receivable)
.Select(f => SqlFunc.AggregateSum(f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount)),
.Sum(f => f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount),
});
}

@ -206,23 +206,23 @@ namespace DS.WMS.Core.Application.Method
StlName = s.StlName, //结算方式
//--------统计项--------
UnpaidRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed &&
f.FeeType == FeeType.Payable && f.Currency == FeeCurrency.RMB_CODE).Select(f => SqlFunc.AggregateSum(f.Amount)),
f.FeeType == FeeType.Payable && f.Currency == FeeCurrency.RMB_CODE).Sum(f => f.Amount),
UnpaidUSD = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed &&
f.FeeType == FeeType.Payable && f.Currency == FeeCurrency.USD_CODE).Select(f => SqlFunc.AggregateSum(f.Amount)),
f.FeeType == FeeType.Payable && f.Currency == FeeCurrency.USD_CODE).Sum(f => f.Amount),
UnpaidOther = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed &&
f.FeeType == FeeType.Payable && f.Currency != FeeCurrency.USD_CODE && f.Currency != FeeCurrency.RMB_CODE).Select(f => SqlFunc.AggregateSum(f.Amount)),
f.FeeType == FeeType.Payable && f.Currency != FeeCurrency.USD_CODE && f.Currency != FeeCurrency.RMB_CODE).Sum(f => f.Amount),
UnreceivedRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed &&
f.FeeType == FeeType.Receivable && f.Currency == FeeCurrency.RMB_CODE).Select(f => SqlFunc.AggregateSum(f.Amount)),
f.FeeType == FeeType.Receivable && f.Currency == FeeCurrency.RMB_CODE).Sum(f => f.Amount),
UnreceivedUSD = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed &&
f.FeeType == FeeType.Receivable && f.Currency == FeeCurrency.USD_CODE).Select(f => SqlFunc.AggregateSum(f.Amount)),
f.FeeType == FeeType.Receivable && f.Currency == FeeCurrency.USD_CODE).Sum(f => f.Amount),
UnreceivedOther = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed &&
f.FeeType == FeeType.Receivable && f.Currency != FeeCurrency.USD_CODE && f.Currency != FeeCurrency.RMB_CODE).Select(f => SqlFunc.AggregateSum(f.Amount)),
f.FeeType == FeeType.Receivable && f.Currency != FeeCurrency.USD_CODE && f.Currency != FeeCurrency.RMB_CODE).Sum(f => f.Amount),
UnpaidRMBInv = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed &&
f.FeeType == FeeType.Payable && f.Currency == FeeCurrency.RMB_CODE).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount)),
f.FeeType == FeeType.Payable && f.Currency == FeeCurrency.RMB_CODE).Sum(f => f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount),
UnpaidUSDInv = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.BusinessId && f.FeeStatus == FeeStatus.AuditPassed &&
f.FeeType == FeeType.Payable && f.Currency == FeeCurrency.USD_CODE).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount))
f.FeeType == FeeType.Payable && f.Currency == FeeCurrency.USD_CODE).Sum(f => f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount)
});
}

@ -1129,7 +1129,7 @@ namespace DS.WMS.Core.Fee.Method
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
}
//// <summary>
/// <summary>
/// 获取费用打印信息
/// </summary>
/// <param name="providerName">数据提供程序</param>

@ -94,112 +94,6 @@ namespace DS.WMS.Core.Fee.Method
return TenantDb.UnionAll(new List<ISugarQueryable<BusinessFeeDto>> { query1 });
}
/// <summary>
/// 更新费用及其业务的费用状态
/// </summary>
/// <param name="ids">费用记录ID</param>
/// <remarks>此方法内部将始终异步执行,请确保在调用前已提交数据库事务等必要的操作。</remarks>
protected internal void UpdateFeeStatus(IEnumerable<long> ids)
{
var task1 = Task.Factory.StartNew(UpdateFeeStatusCore, ids, CancellationToken.None);
task1.ContinueWith(t => UpdateBizStatusCore(t.Result), TaskContinuationOptions.OnlyOnRanToCompletion);
}
private List<FeeRecord> UpdateFeeStatusCore(object? state)
{
if (state == null)
return [];
var ids = (IEnumerable<long>)state;
var fees = TenantDb.Queryable<FeeRecord>().Where(x => ids.Contains(x.Id))
.Select(x => new FeeRecord
{
Id = x.Id,
BusinessId = x.BusinessId,
BusinessType = x.BusinessType,
FeeStatus = x.FeeStatus,
Amount = x.Amount,
SettlementAmount = x.SettlementAmount,
OrderAmount = x.OrderAmount,
OrderSettlementAmount = x.OrderSettlementAmount
}).ToList();
if (fees.Count == 0)
return [];
List<FeeRecord> list = new(fees.Count);
foreach (var item in fees)
{
var restAmount = item.Amount - item.SettlementAmount - item.OrderAmount + item.OrderSettlementAmount;
if (restAmount == 0)
{
item.FeeStatus = FeeStatus.SettlementCompleted;
list.Add(item);
}
else if (restAmount != item.Amount)
{
item.FeeStatus = FeeStatus.PartialSettlement;
list.Add(item);
}
else if (item.SettlementAmount == 0)
{
item.FeeStatus = FeeStatus.AuditPassed;
list.Add(item);
}
}
TenantDb.Updateable(list).UpdateColumns(x => new { x.FeeStatus }).ExecuteCommand();
return list;
}
private void UpdateBizStatusCore(List<FeeRecord> list)
{
var bizIds = list.Select(x => x.BusinessId);
var types = list.Select(x => x.BusinessType).Distinct();
var fees2 = TenantDb.Queryable<FeeRecord>().Where(x => bizIds.Contains(x.BusinessId) && types.Contains(x.BusinessType))
.Select(x => new { x.BusinessId, x.BusinessType, x.FeeType, x.FeeStatus }).ToList();
if (fees2.Count == 0)
return;
var gpList = fees2.GroupBy(x => new { x.BusinessId, x.BusinessType });
foreach (var gp in gpList)
{
BusinessFeeStatus biz = new() { BusinessId = gp.Key.BusinessId, BusinessType = gp.Key.BusinessType };
var upt = TenantDb.Updateable(biz).WhereColumns(x => new { x.BusinessId, x.BusinessType });
//应收
var arList = gp.Where(x => x.FeeType == FeeType.Receivable).ToList();
if (arList.Count > 0)
{
if (arList.All(x => x.FeeStatus == FeeStatus.SettlementCompleted))
{
biz.ARFeeStatus = BillFeeStatus.SettlementCompleted;
upt = upt.UpdateColumns(x => x.ARFeeStatus);
}
else if (arList.Any(x => x.FeeStatus == FeeStatus.PartialSettlement))
{
biz.ARFeeStatus = BillFeeStatus.PartialSettlement;
upt = upt.UpdateColumns(x => x.ARFeeStatus);
}
}
//应付
var apList = gp.Where(x => x.FeeType == FeeType.Payable).ToList();
if (apList.Count > 0)
{
if (apList.All(x => x.FeeStatus == FeeStatus.SettlementCompleted))
{
biz.APFeeStatus = BillFeeStatus.SettlementCompleted;
upt = upt.UpdateColumns(x => x.APFeeStatus);
}
else if (apList.Any(x => x.FeeStatus == FeeStatus.PartialSettlement))
{
biz.APFeeStatus = BillFeeStatus.PartialSettlement;
upt = upt.UpdateColumns(x => x.APFeeStatus);
}
}
upt.ExecuteCommand();
}
}
/// <summary>
/// 获取汇率
/// </summary>

@ -120,6 +120,11 @@ public class ClientBankReq
/// 寄发票地址
/// </summary>
public string? SendInvoiceAddress { get; set; }
/// <summary>
/// 银行国际代码
/// </summary>
public string? SwiftCode { get; set; }
///// <summary>
///// 发票抬头
///// </summary>

@ -129,4 +129,9 @@ public class ClientBankRes
/// 寄发票地址
/// </summary>
public string? SendInvoiceAddress { get; set; }
/// <summary>
/// 银行国际代码
/// </summary>
public string? SwiftCode { get; set; }
}

@ -137,6 +137,12 @@ public class InfoClientBank : BaseModelV2<long>
/// </summary>
[SugarColumn(ColumnDescription = "寄发票地址", Length = 200, IsNullable = true)]
public string? SendInvoiceAddress { get; set; }
/// <summary>
/// 银行国际代码
/// </summary>
[SugarColumn(ColumnDescription = "银行国际代码", Length = 150, IsNullable = true)]
public string? SwiftCode { get; set; }
///// <summary>
///// 发票抬头
///// </summary>

@ -2,6 +2,7 @@
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Settlement.Entity;
using SqlSugar;
namespace DS.WMS.Core.Settlement.Dtos
{
@ -24,6 +25,26 @@ namespace DS.WMS.Core.Settlement.Dtos
/// 结算单据信息(付费申请/发票结算适用)
/// </summary>
public List<SettlementDocument>? Documents { get; set; }
/// <summary>
/// 查询条件
/// </summary>
public string? QueryCondition { get; set; }
/// <summary>
/// 获取当前实例的查询条件
/// </summary>
/// <param name="client">SqlSugar对象</param>
/// <returns></returns>
/// <exception cref="ArgumentNullException">当<paramref name="client"/>为null时引发</exception>
public List<IConditionalModel> GetConditionalModels(ISqlSugarClient client)
{
if (string.IsNullOrEmpty(QueryCondition))
return [];
ArgumentNullException.ThrowIfNull(client, nameof(client));
return client.Utilities.JsonToConditionalModels(QueryCondition);
}
}
/// <summary>
@ -70,5 +91,6 @@ namespace DS.WMS.Core.Settlement.Dtos
/// 汇率(当收/付申请单币别与结算币别一致时此字段可为null发票结算需要提前获取原始币别
/// </summary>
public List<CurrencyExchangeRate>? ExchangeRates { get; set; }
}
}

@ -254,7 +254,7 @@ namespace DS.WMS.Core.Settlement.Method
}
/// <summary>
/// 获取付费自由结算明细
/// 获取自由结算明细
/// </summary>
/// <param name="request"></param>
/// <returns></returns>

@ -203,6 +203,7 @@ namespace DS.WMS.Core.Settlement.Method
var custIds = request.Documents.Select(x => x.CustomerId);
details1 = await TenantDb.Queryable<FeeRecord>().Where(f => ids.Contains(f.BusinessId) && types.Contains(f.BusinessType) && custIds.Contains(f.CustomerId) &&
(f.FeeStatus == FeeStatus.AuditPassed || f.FeeStatus == FeeStatus.PartialSettlement) && (f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount) != 0)
.Where(request.GetConditionalModels(Db))
.Select(f => new ApplicationDetail
{
ApplicationId = settlement.Id,
@ -322,7 +323,7 @@ namespace DS.WMS.Core.Settlement.Method
if (settlement.Details.Exists(x => x.OriginalCurrency.IsNullOrEmpty()))
return DataResult<TEntity>.FailedWithDesc(nameof(MultiLanguageConst.OriginalCurrencyCanNotNull));
settlement.Amount = settlement.Details.Sum(x => x.ApplyAmount);
//settlement.Amount = settlement.Details.Sum(x => x.ApplyAmount);
result = await PreSaveAsync(settlement);
if (!result.Succeeded)
return DataResult<TEntity>.Failed(result.Message, result.MultiCode);
@ -379,6 +380,11 @@ namespace DS.WMS.Core.Settlement.Method
.ExecuteCommandAsync();
}
//重新计算结算总金额
settlement.Amount = await TenantDb.Queryable<ApplicationDetail>().Where(x => x.ApplicationId == settlement.Id)
.SumAsync(x => x.ApplyAmount);
await TenantDb.Updateable(settlement).UpdateColumns(x => x.Amount).ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync();
await PostSaveAsync(settlement);
return DataResult<TEntity>.Success(settlement);
@ -585,6 +591,112 @@ namespace DS.WMS.Core.Settlement.Method
#endregion
/// <summary>
/// 更新费用及其业务的结算状态
/// </summary>
/// <param name="ids">费用记录ID</param>
/// <remarks>此方法内部将始终异步执行,请确保在调用前已提交数据库事务等必要的操作。</remarks>
protected internal void UpdateFeeStatus(IEnumerable<long> ids)
{
var task1 = Task.Factory.StartNew(UpdateFeeStatusCore, ids, CancellationToken.None);
task1.ContinueWith(t => UpdateBizStatusCore(t.Result), TaskContinuationOptions.OnlyOnRanToCompletion);
}
private List<FeeRecord> UpdateFeeStatusCore(object? state)
{
if (state == null)
return [];
var ids = (IEnumerable<long>)state;
var fees = TenantDb.Queryable<FeeRecord>().Where(x => ids.Contains(x.Id))
.Select(x => new FeeRecord
{
Id = x.Id,
BusinessId = x.BusinessId,
BusinessType = x.BusinessType,
FeeStatus = x.FeeStatus,
Amount = x.Amount,
SettlementAmount = x.SettlementAmount,
OrderAmount = x.OrderAmount,
OrderSettlementAmount = x.OrderSettlementAmount
}).ToList();
if (fees.Count == 0)
return [];
List<FeeRecord> list = new(fees.Count);
foreach (var item in fees)
{
var restAmount = item.Amount - item.SettlementAmount - item.OrderAmount + item.OrderSettlementAmount;
if (restAmount == 0)
{
item.FeeStatus = FeeStatus.SettlementCompleted;
list.Add(item);
}
else if (restAmount != item.Amount)
{
item.FeeStatus = FeeStatus.PartialSettlement;
list.Add(item);
}
else if (restAmount == item.Amount)
{
item.FeeStatus = FeeStatus.AuditPassed;
list.Add(item);
}
}
TenantDb.Updateable(list).UpdateColumns(x => new { x.FeeStatus }).ExecuteCommand();
return list;
}
private void UpdateBizStatusCore(List<FeeRecord> list)
{
var bizIds = list.Select(x => x.BusinessId);
var types = list.Select(x => x.BusinessType).Distinct();
var fees2 = TenantDb.Queryable<FeeRecord>().Where(x => bizIds.Contains(x.BusinessId) && types.Contains(x.BusinessType))
.Select(x => new { x.BusinessId, x.BusinessType, x.FeeType, x.FeeStatus }).ToList();
if (fees2.Count == 0)
return;
var gpList = fees2.GroupBy(x => new { x.BusinessId, x.BusinessType });
foreach (var gp in gpList)
{
BusinessFeeStatus biz = new() { BusinessId = gp.Key.BusinessId, BusinessType = gp.Key.BusinessType };
var upt = TenantDb.Updateable(biz).WhereColumns(x => new { x.BusinessId, x.BusinessType });
//应收
var arList = gp.Where(x => x.FeeType == FeeType.Receivable).ToList();
if (arList.Count > 0)
{
if (arList.All(x => x.FeeStatus == FeeStatus.SettlementCompleted))
{
biz.ARFeeStatus = BillFeeStatus.SettlementCompleted;
upt = upt.UpdateColumns(x => x.ARFeeStatus);
}
else if (arList.Any(x => x.FeeStatus == FeeStatus.PartialSettlement))
{
biz.ARFeeStatus = BillFeeStatus.PartialSettlement;
upt = upt.UpdateColumns(x => x.ARFeeStatus);
}
}
//应付
var apList = gp.Where(x => x.FeeType == FeeType.Payable).ToList();
if (apList.Count > 0)
{
if (apList.All(x => x.FeeStatus == FeeStatus.SettlementCompleted))
{
biz.APFeeStatus = BillFeeStatus.SettlementCompleted;
upt = upt.UpdateColumns(x => x.APFeeStatus);
}
else if (apList.Any(x => x.FeeStatus == FeeStatus.PartialSettlement))
{
biz.APFeeStatus = BillFeeStatus.PartialSettlement;
upt = upt.UpdateColumns(x => x.APFeeStatus);
}
}
upt.ExecuteCommand();
}
}
/// <summary>
/// 设置结算单的锁定状态
/// </summary>

@ -1,16 +1,15 @@
using System.Runtime.Serialization;
using DS.Module.Core;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.TaskInteraction.Entity;
using Masuit.Tools.Systems;
using SqlSugar;
namespace DS.WMS.Core.TaskInteraction.Dtos
{
/// <summary>
/// 提单确认信息
/// 任务组
/// </summary>
public class BLConfirmation
public class TaskGroup
{
/// <summary>
/// 主业务ID
@ -29,7 +28,7 @@ namespace DS.WMS.Core.TaskInteraction.Dtos
}
/// <summary>
/// 提单确认任务
/// 任务信息
/// </summary>
public class BLTask
{

@ -40,7 +40,7 @@ namespace DS.WMS.Core.TaskInteraction.Interface
/// <param name="bsId">业务ID</param>
/// <param name="bsType">业务类型</param>
/// <returns></returns>
Task<DataResult<BLConfirmation>> GetBLConfirmationAsync(long bsId, BusinessType bsType);
Task<DataResult<TaskGroup>> GetBLConfirmationAsync(long bsId, BusinessType bsType);
/// <summary>
/// 获取海运出口查询对象

@ -68,6 +68,13 @@ namespace DS.WMS.Core.TaskInteraction.Method
else if (callback.FlowStatus == FlowStatusEnum.Reject)
{
biz.BillAuditStatus = BillAuditStatus.RecvRejected;
await TenantDb.Updateable<FeeRecord>()
.SetColumns(x => x.FeeStatus == FeeStatus.RejectSubmission)
.SetColumns(x => x.AuditBy == userId)
.SetColumns(x => x.AuditOperator == User.UserName)
.SetColumns(x => x.AuditDate == dtNow)
.Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType && x.FeeStatus == FeeStatus.AuditSubmitted)
.ExecuteCommandAsync();
}
biz.BillFeeStatusTime = dtNow;

@ -43,7 +43,7 @@ namespace DS.WMS.Core.TaskInteraction.Method
request.Steps.Add(new TaskStepDto
{
Type = StepType.OPConfirm,
Name = StepType.OPConfirm.GetDescription()
Name = StepType.OPConfirm.ToString()
});
}
}
@ -213,9 +213,9 @@ namespace DS.WMS.Core.TaskInteraction.Method
/// <param name="bsId">业务ID</param>
/// <param name="bsType">业务类型</param>
/// <returns></returns>
public async Task<DataResult<BLConfirmation>> GetBLConfirmationAsync(long bsId, BusinessType bsType)
public async Task<DataResult<TaskGroup>> GetBLConfirmationAsync(long bsId, BusinessType bsType)
{
var confirmation = new BLConfirmation
var confirmation = new TaskGroup
{
BusinessId = bsId,
BusinessType = bsType,
@ -236,11 +236,14 @@ namespace DS.WMS.Core.TaskInteraction.Method
TaskType = t.TaskType,
TaskStatus = t.TaskStatus,
RecvUsers = t.RecvUsers,
IsMainBL = true
IsMainBL = true,
Steps = SqlFunc.Subqueryable<TaskStep>().Where(ts => ts.TaskId == t.Id).ToList(ts => new TaskStepDto
{
}, true)
}).FirstAsync();
if (mainTask == null)
return DataResult<BLConfirmation>.Success(confirmation);
return DataResult<TaskGroup>.Success(confirmation);
var list = await TenantDb.Queryable<BusinessTask>()
.LeftJoin<SeaExportBillManage>((t, b) => t.BusinessId == b.Id)
@ -278,7 +281,7 @@ namespace DS.WMS.Core.TaskInteraction.Method
}
}
return DataResult<BLConfirmation>.Success(confirmation);
return DataResult<TaskGroup>.Success(confirmation);
}
/// <summary>

@ -190,15 +190,15 @@ namespace DS.WMS.Core.TaskInteraction.Method
if (!await HasAuthorizedAsync())
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.ModuleUnauthorized));
////检查步骤类型是否重复
//if (request.Steps?.Count > 0)
//{
// if (request.Steps.Where(x => x.Type != StepType.NotSpecified).GroupBy(x => x.Type).Select(x => x.Key).Count() > 1)
// return DataResult.FailedWithDesc(nameof(MultiLanguageConst.DuplicateStepType));
//检查步骤类型是否重复
if (request.Steps?.Count > 0)
{
if (request.Steps.Where(x => x.Type != StepType.NotSpecified).GroupBy(x => x.Type).Select(x => x.Key).Count() > 1)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.DuplicateStepType));
// if (request.Steps.Any(x => x.Type == StepType.NotSpecified && string.IsNullOrEmpty(x.Name)))
// return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TypeOrName));
//}
if (request.Steps.Any(x => x.Type == StepType.NotSpecified && string.IsNullOrEmpty(x.Name)))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TypeOrName));
}
if (request.HasCabin.GetValueOrDefault() && request.BusinessType.HasValue)
{
@ -449,13 +449,13 @@ namespace DS.WMS.Core.TaskInteraction.Method
if (request.TaskStatus == TaskStatusEnum.Complete && await TenantDb.Queryable<BusinessTask>().AnyAsync(x => x.ParentId == task.Id && x.TaskStatus != request.TaskStatus))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.UnfinishedItems));
////检查是否有未完成的任务步骤
//var steps = await TenantDb.Queryable<TaskStep>().Where(x => x.TaskId == task.Id && !x.IsCompleted)
// .Select(x => new { x.Type, x.Name }).ToListAsync();
//if (steps.Count > 0)
// return DataResult.Failed(
// MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.UnfinishedItems)) + "" + string.Join("|", steps.Select(x => x.Type == StepType.NotSpecified ? x.Name : x.Type.GetDescription())),
// nameof(MultiLanguageConst.UnfinishedItems));
//检查是否有未完成的任务步骤
var steps = await TenantDb.Queryable<TaskStep>().Where(x => x.TaskId == task.Id && !x.IsCompleted)
.Select(x => new { x.Type, x.Name }).ToListAsync();
if (steps.Count > 0)
return DataResult.Failed(
MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.UnfinishedItems)) + "" + string.Join("|", steps.Select(x => x.Type == StepType.NotSpecified ? x.Name : x.Type.GetDescription())),
nameof(MultiLanguageConst.UnfinishedItems));
//触发任务状态变更通知
if (task.TaskStatus != request.TaskStatus)

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>True|2024-11-02T12:54:29.9931812Z||;True|2024-11-02T20:39:20.4100370+08:00||;True|2024-11-02T18:33:41.0724285+08:00||;True|2024-11-02T18:21:55.8561639+08:00||;True|2024-11-02T17:36:24.3401782+08:00||;True|2024-11-02T16:38:03.0054105+08:00||;True|2024-11-02T16:26:26.1698304+08:00||;True|2024-11-02T16:15:20.2872358+08:00||;True|2024-11-02T15:19:14.9663838+08:00||;True|2024-11-02T14:39:47.8808708+08:00||;False|2024-11-02T14:22:04.2841792+08:00||;True|2024-11-02T11:50:48.2452805+08:00||;True|2024-10-29T18:52:12.7978878+08:00||;True|2024-10-29T10:27:49.1623527+08:00||;True|2024-10-25T15:09:27.7029075+08:00||;True|2024-10-25T10:29:26.9218878+08:00||;True|2024-10-22T17:58:39.9582805+08:00||;True|2024-10-21T17:57:21.7047579+08:00||;True|2024-10-21T14:30:54.4520206+08:00||;True|2024-10-21T10:19:05.7405749+08:00||;True|2024-10-18T16:11:05.4049685+08:00||;True|2024-10-18T14:59:49.1162741+08:00||;True|2024-10-16T16:29:15.3185348+08:00||;True|2024-10-16T14:12:58.1754214+08:00||;True|2024-10-16T14:08:06.5805581+08:00||;True|2024-10-16T11:55:29.8273176+08:00||;True|2024-10-15T17:39:40.4090324+08:00||;True|2024-10-15T17:06:43.0181578+08:00||;True|2024-10-15T15:07:38.9601925+08:00||;True|2024-10-12T13:33:32.4412583+08:00||;True|2024-10-11T17:00:54.0916209+08:00||;True|2024-10-11T10:54:50.3307087+08:00||;True|2024-10-11T10:45:07.8181500+08:00||;True|2024-10-11T10:40:44.2066046+08:00||;True|2024-10-11T10:21:25.7226983+08:00||;True|2024-10-11T10:09:05.5257478+08:00||;True|2024-10-10T14:58:29.1228618+08:00||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||;True|2024-09-21T11:59:19.0549926+08:00||;True|2024-09-21T11:24:32.4451752+08:00||;True|2024-09-21T10:39:11.5297411+08:00||;True|2024-09-20T18:24:31.7827684+08:00||;True|2024-09-19T17:55:53.1666689+08:00||;True|2024-09-19T17:42:47.9061485+08:00||;True|2024-09-19T16:08:21.7225571+08:00||;False|2024-09-19T14:15:42.9318446+08:00||;True|2024-09-19T11:20:03.5567568+08:00||;True|2024-09-18T11:35:18.1509724+08:00||;True|2024-09-18T09:08:59.1152574+08:00||;True|2024-09-14T15:48:22.9374486+08:00||;True|2024-09-14T15:42:19.0503983+08:00||;True|2024-09-14T11:51:53.3339222+08:00||;True|2024-09-14T11:41:38.3542237+08:00||;True|2024-09-14T11:19:13.1037012+08:00||;</History>
<History>True|2024-11-04T03:26:53.4821041Z||;True|2024-11-04T11:19:48.8467193+08:00||;True|2024-11-04T11:01:39.9398452+08:00||;True|2024-11-04T10:30:55.0743204+08:00||;True|2024-11-02T21:17:44.8575190+08:00||;True|2024-11-02T20:54:29.9931812+08:00||;True|2024-11-02T20:39:20.4100370+08:00||;True|2024-11-02T18:33:41.0724285+08:00||;True|2024-11-02T18:21:55.8561639+08:00||;True|2024-11-02T17:36:24.3401782+08:00||;True|2024-11-02T16:38:03.0054105+08:00||;True|2024-11-02T16:26:26.1698304+08:00||;True|2024-11-02T16:15:20.2872358+08:00||;True|2024-11-02T15:19:14.9663838+08:00||;True|2024-11-02T14:39:47.8808708+08:00||;False|2024-11-02T14:22:04.2841792+08:00||;True|2024-11-02T11:50:48.2452805+08:00||;True|2024-10-29T18:52:12.7978878+08:00||;True|2024-10-29T10:27:49.1623527+08:00||;True|2024-10-25T15:09:27.7029075+08:00||;True|2024-10-25T10:29:26.9218878+08:00||;True|2024-10-22T17:58:39.9582805+08:00||;True|2024-10-21T17:57:21.7047579+08:00||;True|2024-10-21T14:30:54.4520206+08:00||;True|2024-10-21T10:19:05.7405749+08:00||;True|2024-10-18T16:11:05.4049685+08:00||;True|2024-10-18T14:59:49.1162741+08:00||;True|2024-10-16T16:29:15.3185348+08:00||;True|2024-10-16T14:12:58.1754214+08:00||;True|2024-10-16T14:08:06.5805581+08:00||;True|2024-10-16T11:55:29.8273176+08:00||;True|2024-10-15T17:39:40.4090324+08:00||;True|2024-10-15T17:06:43.0181578+08:00||;True|2024-10-15T15:07:38.9601925+08:00||;True|2024-10-12T13:33:32.4412583+08:00||;True|2024-10-11T17:00:54.0916209+08:00||;True|2024-10-11T10:54:50.3307087+08:00||;True|2024-10-11T10:45:07.8181500+08:00||;True|2024-10-11T10:40:44.2066046+08:00||;True|2024-10-11T10:21:25.7226983+08:00||;True|2024-10-11T10:09:05.5257478+08:00||;True|2024-10-10T14:58:29.1228618+08:00||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||;True|2024-09-21T11:59:19.0549926+08:00||;True|2024-09-21T11:24:32.4451752+08:00||;True|2024-09-21T10:39:11.5297411+08:00||;True|2024-09-20T18:24:31.7827684+08:00||;True|2024-09-19T17:55:53.1666689+08:00||;True|2024-09-19T17:42:47.9061485+08:00||;True|2024-09-19T16:08:21.7225571+08:00||;False|2024-09-19T14:15:42.9318446+08:00||;True|2024-09-19T11:20:03.5567568+08:00||;True|2024-09-18T11:35:18.1509724+08:00||;True|2024-09-18T09:08:59.1152574+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

@ -53,7 +53,7 @@ namespace DS.WMS.OpApi.Controllers
/// <param name="businessType">业务类型(可选参数)</param>
/// <returns></returns>
[HttpGet, Route("GetBLConfirmation")]
public async Task<DataResult<BLConfirmation>> GetBLConfirmationAsync(long businessId, BusinessType businessType)
public async Task<DataResult<TaskGroup>> GetBLConfirmationAsync(long businessId, BusinessType businessType)
{
return await taskService.GetBLConfirmationAsync(businessId, businessType);
}

Loading…
Cancel
Save