|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using System.Text;
|
|
|
|
|
using AngleSharp.Dom;
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Enums;
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
@ -13,6 +14,7 @@ using DS.WMS.Core.Settlement.Entity;
|
|
|
|
|
using DS.WMS.Core.Settlement.Interface;
|
|
|
|
|
using DS.WMS.Core.Sys.Entity;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using static AnyDiff.DifferenceLines;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Settlement.Method
|
|
|
|
|
{
|
|
|
|
@ -568,8 +570,8 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
|
{
|
|
|
|
|
await base.OnDeleteDetailAsync(settlements);
|
|
|
|
|
|
|
|
|
|
//还原付费申请明细
|
|
|
|
|
var list = settlements.FindAll(x => x.Mode == SettlementMode.Payment);
|
|
|
|
|
//还原收/付费申请明细
|
|
|
|
|
var list = settlements.FindAll(x => x.Mode == SettlementMode.Payment || x.Mode == SettlementMode.Charge);
|
|
|
|
|
if (list.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
var items = list.SelectMany(x => x.Details);
|
|
|
|
@ -578,7 +580,9 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
|
.Select(x => new ApplicationDetail
|
|
|
|
|
{
|
|
|
|
|
Id = x.Id,
|
|
|
|
|
ApplicationId = x.ApplicationId,
|
|
|
|
|
ProcessedAmount = x.ProcessedAmount,
|
|
|
|
|
OriginalAmount = x.OriginalAmount,
|
|
|
|
|
OriginalProcessedAmount = x.OriginalProcessedAmount
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
@ -592,6 +596,31 @@ namespace DS.WMS.Core.Settlement.Method
|
|
|
|
|
await TenantDb.Updateable(details)
|
|
|
|
|
.UpdateColumns(x => new { x.ProcessedAmount, x.OriginalProcessedAmount })
|
|
|
|
|
.ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
var gpList = details.GroupBy(x => x.ApplicationId);
|
|
|
|
|
List<PaymentApplication> applications = [];
|
|
|
|
|
foreach (var gp in gpList)
|
|
|
|
|
{
|
|
|
|
|
var processedCount = gp.Count(x => x.OriginalAmount - x.OriginalProcessedAmount == 0);
|
|
|
|
|
var itemCount = gp.Count();
|
|
|
|
|
if (itemCount == processedCount)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
var entity = new PaymentApplication { Id = gp.Key };
|
|
|
|
|
if (processedCount == 0)
|
|
|
|
|
{
|
|
|
|
|
entity.Status = PaymentApplicationStatus.AuditPassed;
|
|
|
|
|
}
|
|
|
|
|
else if (itemCount > processedCount)
|
|
|
|
|
{
|
|
|
|
|
entity.Status = PaymentApplicationStatus.PartialSettlement;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
applications.Add(entity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (applications.Count > 0)
|
|
|
|
|
await TenantDb.Updateable(applications).UpdateColumns(x => new { x.Status }).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|