cjy 2 months ago
commit 786ed4fc90

@ -17,7 +17,7 @@ namespace DS.WMS.Core.Application.Dtos
/// <summary> /// <summary>
/// 业务信息 /// 业务信息
/// </summary> /// </summary>
public List<BizItem> Items { get; set; } = []; public List<FeeClient> Items { get; set; } = [];
/// <summary> /// <summary>
/// 汇率转换信息 /// 汇率转换信息

@ -0,0 +1,94 @@
using DS.WMS.Core.Op.Entity;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization;
namespace DS.WMS.Core.Application.Dtos
{
/// <summary>
/// 业务ID与类型
/// </summary>
public class BizItem
{
public static readonly BizItemComparer DefaultComparer = new();
/// <summary>
/// 业务ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 业务类型
/// </summary>
public BusinessType BusinessType { get; set; }
public class BizItemComparer : IEqualityComparer<BizItem>
{
public bool Equals(BizItem? x, BizItem? y)
{
if (x == null || y == null)
return false;
return x.Id == y.Id && x.BusinessType == y.BusinessType;
}
public int GetHashCode([DisallowNull] BizItem obj)
{
return obj.Id.GetHashCode() ^ (int)obj.BusinessType;
}
}
}
/// <summary>
/// 费用对象/单位
/// </summary>
public class FeeClient : BizItem
{
/// <summary>
/// 费用对象ID
/// </summary>
public long CustomerId { get; set; }
}
public class BizOperation : IValidatableObject
{
/// <summary>
/// 请求值object类型根据业务按需传值
/// </summary>
public object Value { get; set; }
/// <summary>
/// 业务ID与类型
/// </summary>
public List<BizItem>? Items { get; set; }
/// <summary>
/// 业务ID
/// </summary>
[IgnoreDataMember]
public IEnumerable<long>? Ids => Items?.Select(x => x.Id).Distinct();
/// <summary>
/// 业务类型
/// </summary>
[IgnoreDataMember]
public IEnumerable<BusinessType>? Types => Items?.Select(x => x.BusinessType).Distinct();
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (Items == null || Items.Count == 0)
{
yield return new ValidationResult($"缺少请求参数:{nameof(Items)}");
}
}
}
public class BizOperation<T> : BizOperation
{
/// <summary>
/// 请求值(根据业务按需传值)
/// </summary>
public new T Value { get; set; }
}
}

@ -36,7 +36,7 @@ namespace DS.WMS.Core.Application.Interface
/// </summary> /// </summary>
/// <param name="items">业务ID与业务类型</param> /// <param name="items">业务ID与业务类型</param>
/// <returns></returns> /// <returns></returns>
Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync(params BizItem[] items); Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync(params FeeClient[] items);
/// <summary> /// <summary>
/// 删除发票明细 /// 删除发票明细

@ -36,7 +36,7 @@ namespace DS.WMS.Core.Application.Interface
/// </summary> /// </summary>
/// <param name="items">业务ID与业务类型</param> /// <param name="items">业务ID与业务类型</param>
/// <returns></returns> /// <returns></returns>
Task<DataResult<PaymentApplicaitonBiz>> GetFeesAsync(params BizItem[] items); Task<DataResult<PaymentApplicaitonBiz>> GetFeesAsync(IEnumerable<FeeClient> items);
/// <summary> /// <summary>
/// 设置是否收到发票 /// 设置是否收到发票
@ -46,6 +46,5 @@ namespace DS.WMS.Core.Application.Interface
/// <returns></returns> /// <returns></returns>
Task<DataResult> SetInvoiceReceivedAsync(bool isInvoiceReceived, params long[] ids); Task<DataResult> SetInvoiceReceivedAsync(bool isInvoiceReceived, params long[] ids);
} }
} }

@ -176,7 +176,7 @@ namespace DS.WMS.Core.Application.Method
var query1 = TenantDb.Queryable<SeaExport>() var query1 = TenantDb.Queryable<SeaExport>()
.InnerJoin<FeeRecord>((s, f) => s.Id == f.BusinessId && f.BusinessType == BusinessType.OceanShippingExport) .InnerJoin<FeeRecord>((s, f) => s.Id == f.BusinessId && f.BusinessType == BusinessType.OceanShippingExport)
.Where((s, f) => f.FeeStatus == FeeStatus.AuditPassed) .Where((s, f) => f.FeeStatus == FeeStatus.AuditPassed)
.GroupBy((s, f) => s.Id) .GroupBy((s, f) => new { s.Id, f.CustomerId })
.Select((s, f) => new BizInvoiceApplication .Select((s, f) => new BizInvoiceApplication
{ {
Id = s.Id, Id = s.Id,
@ -231,10 +231,11 @@ namespace DS.WMS.Core.Application.Method
/// </summary> /// </summary>
/// <param name="items">业务ID与业务类型</param> /// <param name="items">业务ID与业务类型</param>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync(params BizItem[] items) public async Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync(params FeeClient[] items)
{ {
var bizIds = items.Select(x => x.Id).ToList(); var bizIds = items.Select(x => x.Id).Distinct();
var types = items.Select(x => x.BusinessType).ToList(); var types = items.Select(x => x.BusinessType).Distinct();
var cIds = items.Select(x => x.CustomerId).Distinct();
var list = await TenantDb.Queryable<FeeRecord>() var list = await TenantDb.Queryable<FeeRecord>()
.Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && f.FeeStatus == FeeStatus.AuditPassed) .Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && f.FeeStatus == FeeStatus.AuditPassed)
@ -412,11 +413,12 @@ namespace DS.WMS.Core.Application.Method
protected override async Task<List<ApplicationDetail>> GetDetailsAsync(ApplicationRequest<InvoiceApplication> request) protected override async Task<List<ApplicationDetail>> GetDetailsAsync(ApplicationRequest<InvoiceApplication> request)
{ {
var ids1 = request.Items.Select(x => x.Id); var ids1 = request.Items.Select(x => x.Id).Distinct();
var ids2 = request.Items.Select(x => x.BusinessType); var ids2 = request.Items.Select(x => x.BusinessType).Distinct();
var ids3 = request.Items.Select(x => x.CustomerId).Distinct();
var list = await TenantDb.Queryable<FeeRecord>().Where(x => var list = await TenantDb.Queryable<FeeRecord>().Where(x => x.FeeStatus == FeeStatus.AuditPassed &&
ids1.Contains(x.BusinessId) && ids2.Contains(x.BusinessType) && x.FeeStatus == FeeStatus.AuditPassed) ids1.Contains(x.BusinessId) && ids2.Contains(x.BusinessType) && ids3.Contains(x.CustomerId))
.Where(request.GetQueryConditions(Db)) .Where(request.GetQueryConditions(Db))
.Select(x => new ApplicationDetail .Select(x => new ApplicationDetail
{ {

@ -8,7 +8,6 @@ using DS.WMS.Core.Application.Interface;
using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Info.Entity; using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Sys.Entity; using DS.WMS.Core.Sys.Entity;
using SqlSugar; using SqlSugar;
@ -123,15 +122,11 @@ namespace DS.WMS.Core.Application.Method
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<List<BizPaymentApplication>>> GetBizListAsync(PageRequest request) public async Task<DataResult<List<BizPaymentApplication>>> GetBizListAsync(PageRequest request)
{ {
var queryList = CreateBizQuery(); var query = CreateBizQuery();
var whereList = request.GetConditionalModels(Db);
if (!request.QueryCondition.IsNullOrEmpty()) query = query.Where(whereList);
{
var whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
queryList = queryList.Where(whereList);
}
var result = await queryList.ToQueryPageAsync(request.PageCondition); var result = await query.ToQueryPageAsync(request.PageCondition);
if (result.Data.Count > 0) if (result.Data.Count > 0)
{ {
@ -164,17 +159,17 @@ namespace DS.WMS.Core.Application.Method
var query1 = TenantDb.Queryable<SeaExport>() var query1 = TenantDb.Queryable<SeaExport>()
.InnerJoin<FeeRecord>((s, f) => s.Id == f.BusinessId && f.BusinessType == BusinessType.OceanShippingExport) .InnerJoin<FeeRecord>((s, f) => s.Id == f.BusinessId && f.BusinessType == BusinessType.OceanShippingExport)
.Where((s, f) => f.FeeStatus == FeeStatus.AuditPassed) .Where((s, f) => f.FeeStatus == FeeStatus.AuditPassed)
.GroupBy((s, f) => s.Id) .GroupBy((s, f) => new { s.Id, f.CustomerId })
.Select((s, f) => new BizPaymentApplication .Select((s, f) => new BizPaymentApplication
{ {
Id = s.Id, Id = s.Id,
BusinessType = BusinessType.OceanShippingExport, BusinessType = BusinessType.OceanShippingExport,
CustomerNo = s.CustomerNo, //委托编号 CustomerNo = s.CustomerNo, //委托编号
ClientName = s.CustomerName, //委托单位
MBLNO = s.MBLNO, MBLNO = s.MBLNO,
HBLNO = s.HBLNO, HBLNO = s.HBLNO,
CustomerId = s.CustomerId, CustomerId = f.CustomerId,
CustomerName = s.CustomerName,//结费单位 CustomerName = f.CustomerName, //结费单位
ClientName = s.CustomerName, //委托单位
AccountDate = s.AccountDate, AccountDate = s.AccountDate,
BookingNO = s.BookingNo, //订舱编号 BookingNO = s.BookingNo, //订舱编号
CntrTotal = s.CntrTotal, CntrTotal = s.CntrTotal,
@ -196,12 +191,14 @@ namespace DS.WMS.Core.Application.Method
f.FeeType == FeeType.Payable && f.Currency == FeeCurrency.USD_CODE).Select(f => SqlFunc.AggregateSum(f.Amount)), f.FeeType == FeeType.Payable && f.Currency == FeeCurrency.USD_CODE).Select(f => SqlFunc.AggregateSum(f.Amount)),
UnpaidOther = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed && UnpaidOther = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && 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).Select(f => SqlFunc.AggregateSum(f.Amount)),
UnreceivedRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed && UnreceivedRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && 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).Select(f => SqlFunc.AggregateSum(f.Amount)),
UnreceivedUSD = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed && UnreceivedUSD = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && 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).Select(f => SqlFunc.AggregateSum(f.Amount)),
UnreceivedOther = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed && UnreceivedOther = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && 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).Select(f => SqlFunc.AggregateSum(f.Amount)),
UnpaidRMBInv = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed && UnpaidRMBInv = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && 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).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount)),
UnpaidUSDInv = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed && UnpaidUSDInv = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed &&
@ -219,13 +216,15 @@ namespace DS.WMS.Core.Application.Method
/// </summary> /// </summary>
/// <param name="items">业务ID与业务类型</param> /// <param name="items">业务ID与业务类型</param>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<PaymentApplicaitonBiz>> GetFeesAsync(params BizItem[] items) public async Task<DataResult<PaymentApplicaitonBiz>> GetFeesAsync(IEnumerable<FeeClient> items)
{ {
var bizIds = items.Select(x => x.Id).ToList(); var ids = items.Select(x => x.Id).Distinct();
var types = items.Select(x => x.BusinessType).ToList(); var types = items.Select(x => x.BusinessType).Distinct();
var cIds = items.Select(x => x.CustomerId).Distinct();
var list = await TenantDb.Queryable<FeeRecord>() var list = await TenantDb.Queryable<FeeRecord>()
.Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && f.FeeStatus == FeeStatus.AuditPassed) .Where(f => ids.Contains(f.BusinessId) && types.Contains(f.BusinessType) &&
cIds.Contains(f.CustomerId) && f.FeeStatus == FeeStatus.AuditPassed)
.Select(f => new FeePaymentDto .Select(f => new FeePaymentDto
{ {
RecordId = f.Id, RecordId = f.Id,
@ -381,11 +380,12 @@ namespace DS.WMS.Core.Application.Method
protected override async Task<List<ApplicationDetail>> GetDetailsAsync(ApplicationRequest<PaymentApplication> request) protected override async Task<List<ApplicationDetail>> GetDetailsAsync(ApplicationRequest<PaymentApplication> request)
{ {
var ids1 = request.Items.Select(x => x.Id); var ids1 = request.Items.Select(x => x.Id).Distinct();
var ids2 = request.Items.Select(x => x.BusinessType); var ids2 = request.Items.Select(x => x.BusinessType).Distinct();
var ids3 = request.Items.Select(x => x.CustomerId).Distinct();
var list = await TenantDb.Queryable<FeeRecord>().Where(x => var list = await TenantDb.Queryable<FeeRecord>().Where(x => x.FeeStatus == FeeStatus.AuditPassed &&
ids1.Contains(x.BusinessId) && ids2.Contains(x.BusinessType) && x.FeeStatus == FeeStatus.AuditPassed) ids1.Contains(x.BusinessId) && ids2.Contains(x.BusinessType) && ids3.Contains(x.CustomerId))
.Where(request.GetQueryConditions(Db)) .Where(request.GetQueryConditions(Db))
.Select(x => new ApplicationDetail .Select(x => new ApplicationDetail
{ {

@ -1,4 +1,4 @@
using System.Diagnostics.CodeAnalysis; using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Entity;
namespace DS.WMS.Core.Fee.Dtos namespace DS.WMS.Core.Fee.Dtos
@ -56,51 +56,6 @@ namespace DS.WMS.Core.Fee.Dtos
public List<BizItem> Items { get; set; } public List<BizItem> Items { get; set; }
} }
public class BizItem
{
public static readonly BizItemComparer DefaultComparer = new BizItemComparer();
/// <summary>
/// 业务ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// 业务类型
/// </summary>
public BusinessType BusinessType { get; set; }
public class BizItemComparer : IEqualityComparer<BizItem>
{
public bool Equals(BizItem? x, BizItem? y)
{
if (x == null || y == null)
return false;
return x.Id == y.Id && x.BusinessType == y.BusinessType;
}
public int GetHashCode([DisallowNull] BizItem obj)
{
return obj.Id.GetHashCode() ^ (int)obj.BusinessType;
}
}
}
public class BizOperation
{
/// <summary>
/// 请求值object类型根据业务按需传值
/// </summary>
public object Value { get; set; }
/// <summary>
/// 业务ID与类型
/// </summary>
public List<BizItem> Items { get; set; }
}
public class AuditDetailRequest : BizItem public class AuditDetailRequest : BizItem
{ {
public string? QueryCondition { get; set; } public string? QueryCondition { get; set; }

@ -1,5 +1,6 @@
using DS.Module.Core; using DS.Module.Core;
using DS.Module.Core.Extensions; using DS.Module.Core.Extensions;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Code.Entity; using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.Fee.Entity;
@ -748,7 +749,7 @@ namespace DS.WMS.Core.Fee.Method
BillAuditStatus = x.BillAuditStatus BillAuditStatus = x.BillAuditStatus
}).FirstAsync(); }).FirstAsync();
if (biz == null) if (biz == null)
return DataResult.Failed(MultiLanguageConst.Operation_Failed); return DataResult.Failed(MultiLanguageConst.EmptyData);
} }
else else
{ {
@ -761,7 +762,7 @@ namespace DS.WMS.Core.Fee.Method
BusinessType = x.BusinessType BusinessType = x.BusinessType
}).FirstAsync(); }).FirstAsync();
if (fee == null) if (fee == null)
return DataResult.Failed(MultiLanguageConst.Operation_Failed); return DataResult.Failed(MultiLanguageConst.EmptyData);
fee.Reason = callback.RejectReason; fee.Reason = callback.RejectReason;
} }

@ -21,8 +21,7 @@ namespace DS.WMS.Core.Invoice.Interface
/// </summary> /// </summary>
/// <param name="items">业务ID与业务类型</param> /// <param name="items">业务ID与业务类型</param>
/// <returns></returns> /// <returns></returns>
Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync(params BizItem[] items); Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync(params FeeClient[] items);
} }
} }

@ -56,7 +56,7 @@ namespace DS.WMS.Core.Invoice.Method
if (!request.QueryCondition.IsNullOrEmpty()) if (!request.QueryCondition.IsNullOrEmpty())
{ {
var whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); var whereList = request.GetConditionalModels(Db);
query = query.Where(whereList); query = query.Where(whereList);
} }
@ -120,13 +120,15 @@ namespace DS.WMS.Core.Invoice.Method
/// </summary> /// </summary>
/// <param name="items">业务ID与业务类型</param> /// <param name="items">业务ID与业务类型</param>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync(params BizItem[] items) public async Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync(params FeeClient[] items)
{ {
var bizIds = items.Select(x => x.Id).ToList(); var bizIds = items.Select(x => x.Id).Distinct();
var types = items.Select(x => x.BusinessType).ToList(); var types = items.Select(x => x.BusinessType).Distinct();
var cIds = items.Select(x => x.CustomerId).Distinct();
var list = await TenantDb.Queryable<FeeRecord>() var list = await TenantDb.Queryable<FeeRecord>()
.Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && AllowedStatus.Contains(f.FeeStatus)) .Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && cIds.Contains(f.CustomerId) &&
AllowedStatus.Contains(f.FeeStatus))
.Select(f => new FeeInvoiceDto .Select(f => new FeeInvoiceDto
{ {
RecordId = f.Id, RecordId = f.Id,

@ -149,8 +149,6 @@ namespace DS.WMS.Core.Invoice.Method
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

@ -3,7 +3,7 @@ using DS.Module.Core;
using DS.Module.Core.Data; using DS.Module.Core.Data;
using DS.Module.Core.Helpers; using DS.Module.Core.Helpers;
using DS.Module.DjyRulesEngine; using DS.Module.DjyRulesEngine;
using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Flow.Dtos; using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Flow.Entity; using DS.WMS.Core.Flow.Entity;
using DS.WMS.Core.Flow.Interface; using DS.WMS.Core.Flow.Interface;

@ -1,5 +1,5 @@
using DS.Module.Core; using DS.Module.Core;
using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Settlement.Dtos; using DS.WMS.Core.Settlement.Dtos;
using DS.WMS.Core.Settlement.Entity; using DS.WMS.Core.Settlement.Entity;
@ -23,7 +23,7 @@ namespace DS.WMS.Core.Settlement.Interface
/// </summary> /// </summary>
/// <param name="items">业务ID与业务类型</param> /// <param name="items">业务ID与业务类型</param>
/// <returns></returns> /// <returns></returns>
Task<DataResult<FeeForm>> GetFeesAsync(params BizItem[] items); Task<DataResult<FeeForm>> GetFeesAsync(params FeeClient[] items);
/// <summary> /// <summary>
/// 获取付费自由结算单 /// 获取付费自由结算单

@ -5,7 +5,6 @@ using DS.Module.Core.Extensions;
using DS.WMS.Core.Application.Dtos; using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Application.Entity; using DS.WMS.Core.Application.Entity;
using DS.WMS.Core.Code.Entity; using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Settlement.Dtos; using DS.WMS.Core.Settlement.Dtos;
@ -143,14 +142,15 @@ namespace DS.WMS.Core.Settlement.Method
/// </summary> /// </summary>
/// <param name="items">业务ID与业务类型</param> /// <param name="items">业务ID与业务类型</param>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<FeeForm>> GetFeesAsync(params BizItem[] items) public async Task<DataResult<FeeForm>> GetFeesAsync(params FeeClient[] items)
{ {
var bizIds = items.Select(x => x.Id).ToList(); var bizIds = items.Select(x => x.Id).Distinct();
var types = items.Select(x => x.BusinessType).ToList(); var types = items.Select(x => x.BusinessType).Distinct();
var cIds = items.Select(x => x.CustomerId).Distinct();
var list = await TenantDb.Queryable<FeeRecord>() var list = await TenantDb.Queryable<FeeRecord>()
.Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && f.FeeStatus == FeeStatus.AuditPassed && .Where(f => bizIds.Contains(f.BusinessId) && types.Contains(f.BusinessType) && cIds.Contains(f.CustomerId) &&
(f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount) != 0) f.FeeStatus == FeeStatus.AuditPassed && (f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount) != 0)
.Select(f => new FeeItem .Select(f => new FeeItem
{ {
RecordId = f.Id, RecordId = f.Id,
@ -375,6 +375,5 @@ namespace DS.WMS.Core.Settlement.Method
return DataResult.Success; return DataResult.Success;
} }
} }
} }

@ -1,4 +1,5 @@
using DS.Module.Core; using DS.Module.Core;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Interface; using DS.WMS.Core.Fee.Interface;
using DS.WMS.Core.Flow.Dtos; using DS.WMS.Core.Flow.Dtos;

@ -1,7 +1,7 @@
using System.Net; using System.Net;
using DS.Module.Core; using DS.Module.Core;
using DS.Module.Core.Data; using DS.Module.Core.Data;
using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Fee.Entity; using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Fee.Interface; using DS.WMS.Core.Fee.Interface;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;

@ -53,7 +53,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="items">业务ID与业务类型</param> /// <param name="items">业务ID与业务类型</param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("GetFees")] [HttpPost, Route("GetFees")]
public async Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync([FromBody] BizItem[] items) public async Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync([FromBody] FeeClient[] items)
{ {
return await _service.GetFeesAsync(items); return await _service.GetFeesAsync(items);
} }

@ -66,7 +66,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="items">业务ID和类型</param> /// <param name="items">业务ID和类型</param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("GetFees")] [HttpPost, Route("GetFees")]
public async Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync([FromBody] params BizItem[] items) public async Task<DataResult<InvoiceApplicaitonBiz>> GetFeesAsync([FromBody] params FeeClient[] items)
{ {
if (items == null || items.Length == 0) if (items == null || items.Length == 0)
return DataResult<InvoiceApplicaitonBiz>.Failed("缺少请求参数"); return DataResult<InvoiceApplicaitonBiz>.Failed("缺少请求参数");

@ -60,10 +60,10 @@ namespace DS.WMS.FeeApi.Controllers
/// <summary> /// <summary>
/// 根据业务编号及类型获取关联费用记录 /// 根据业务编号及类型获取关联费用记录
/// </summary> /// </summary>
/// <param name="items">业务ID和类型</param> /// <param name="items"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("GetFees")] [HttpPost, Route("GetFees")]
public async Task<DataResult<PaymentApplicaitonBiz>> GetFeesAsync([FromBody] params BizItem[] items) public async Task<DataResult<PaymentApplicaitonBiz>> GetFeesAsync([FromBody] params FeeClient[] items)
{ {
if (items == null || items.Length == 0) if (items == null || items.Length == 0)
return DataResult<PaymentApplicaitonBiz>.Failed("缺少请求参数"); return DataResult<PaymentApplicaitonBiz>.Failed("缺少请求参数");

@ -1,5 +1,6 @@
using DS.Module.Core; using DS.Module.Core;
using DS.Module.Core.Data; using DS.Module.Core.Data;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Fee.Dtos; using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Settlement.Dtos; using DS.WMS.Core.Settlement.Dtos;
using DS.WMS.Core.Settlement.Entity; using DS.WMS.Core.Settlement.Entity;
@ -41,7 +42,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="items">业务ID与业务类型</param> /// <param name="items">业务ID与业务类型</param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("GetFees")] [HttpPost, Route("GetFees")]
public async Task<DataResult<FeeForm>> GetFeesAsync([FromBody] BizItem[] items) public async Task<DataResult<FeeForm>> GetFeesAsync([FromBody] FeeClient[] items)
{ {
return await _service.GetFeesAsync(items); return await _service.GetFeesAsync(items);
} }

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl> <_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>True|2024-09-06T10:49:17.9435308Z||;True|2024-09-06T17:01:39.6646353+08:00||;True|2024-09-06T10:27:36.9990456+08:00||;True|2024-09-06T09:48:23.4236094+08:00||;True|2024-09-05T13:57:23.8452431+08:00||;True|2024-09-05T10:21:34.6675149+08:00||;True|2024-09-05T09:12:44.5610882+08:00||;True|2024-09-04T10:07:38.3707398+08:00||;True|2024-09-04T09:52:47.0574599+08:00||;True|2024-09-03T16:41:23.7516960+08:00||;True|2024-09-03T15:22:31.8718097+08:00||;True|2024-09-03T10:01:09.7656702+08:00||;False|2024-09-03T09:46:46.8956531+08:00||;True|2024-09-02T17:07:41.0268500+08:00||;True|2024-09-02T13:50:22.0203254+08:00||;True|2024-09-02T13:34:23.3441546+08:00||;True|2024-08-30T11:25:14.7431645+08:00||;True|2024-08-29T16:38:26.3491372+08:00||;True|2024-08-29T16:32:31.8580864+08:00||;False|2024-08-29T16:30:41.4763198+08:00||;True|2024-08-09T09:18:05.8484398+08:00||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;True|2024-05-27T15:03:42.9803879+08:00||;True|2024-05-27T08:49:54.3933663+08:00||;True|2024-05-27T08:46:13.5862236+08:00||;True|2024-05-23T17:19:32.8154451+08:00||;True|2024-05-23T17:19:01.4587615+08:00||;</History> <History>True|2024-09-13T02:44:56.1241214Z||;False|2024-09-13T10:44:26.6088271+08:00||;False|2024-09-13T10:44:06.1615137+08:00||;False|2024-09-13T10:43:19.2432517+08:00||;False|2024-09-13T10:38:18.1663387+08:00||;True|2024-09-06T18:49:17.9435308+08:00||;True|2024-09-06T17:01:39.6646353+08:00||;True|2024-09-06T10:27:36.9990456+08:00||;True|2024-09-06T09:48:23.4236094+08:00||;True|2024-09-05T13:57:23.8452431+08:00||;True|2024-09-05T10:21:34.6675149+08:00||;True|2024-09-05T09:12:44.5610882+08:00||;True|2024-09-04T10:07:38.3707398+08:00||;True|2024-09-04T09:52:47.0574599+08:00||;True|2024-09-03T16:41:23.7516960+08:00||;True|2024-09-03T15:22:31.8718097+08:00||;True|2024-09-03T10:01:09.7656702+08:00||;False|2024-09-03T09:46:46.8956531+08:00||;True|2024-09-02T17:07:41.0268500+08:00||;True|2024-09-02T13:50:22.0203254+08:00||;True|2024-09-02T13:34:23.3441546+08:00||;True|2024-08-30T11:25:14.7431645+08:00||;True|2024-08-29T16:38:26.3491372+08:00||;True|2024-08-29T16:32:31.8580864+08:00||;False|2024-08-29T16:30:41.4763198+08:00||;True|2024-08-09T09:18:05.8484398+08:00||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;True|2024-07-11T11:40:17.3581147+08:00||;True|2024-07-04T17:20:50.0175739+08:00||;True|2024-07-02T11:26:14.2092751+08:00||;True|2024-07-02T09:21:51.3513605+08:00||;True|2024-07-01T17:47:56.0407256+08:00||;True|2024-07-01T16:42:55.7374984+08:00||;True|2024-07-01T15:49:58.9266967+08:00||;True|2024-07-01T14:35:48.1117178+08:00||;True|2024-07-01T11:41:52.2969338+08:00||;True|2024-07-01T11:13:02.6561160+08:00||;True|2024-06-28T15:28:43.1470725+08:00||;True|2024-06-28T15:16:20.1999596+08:00||;True|2024-06-28T15:14:56.2534743+08:00||;True|2024-06-28T15:02:41.3033806+08:00||;True|2024-06-28T13:37:28.2462742+08:00||;True|2024-06-28T11:06:30.7400535+08:00||;True|2024-06-26T15:24:17.1939896+08:00||;True|2024-06-26T14:33:06.3530466+08:00||;True|2024-06-26T09:45:24.4055568+08:00||;True|2024-06-25T15:45:57.6052473+08:00||;True|2024-06-25T10:17:17.7408916+08:00||;False|2024-06-25T10:16:23.5639654+08:00||;False|2024-06-25T10:15:28.3857721+08:00||;False|2024-06-25T10:10:59.5536995+08:00||;False|2024-06-25T10:07:10.4050937+08:00||;True|2024-06-24T15:22:18.2672769+08:00||;True|2024-06-24T15:01:04.8153621+08:00||;False|2024-06-24T15:00:29.9618848+08:00||;True|2024-06-24T14:07:19.9401637+08:00||;False|2024-06-24T14:06:36.1250570+08:00||;True|2024-06-21T15:13:57.4273503+08:00||;True|2024-06-21T15:04:37.8218608+08:00||;True|2024-06-21T14:12:48.0266638+08:00||;True|2024-06-21T13:52:30.0950155+08:00||;True|2024-06-20T11:02:42.9508506+08:00||;True|2024-06-19T11:43:01.1899282+08:00||;True|2024-06-19T11:23:01.2938141+08:00||;True|2024-06-18T08:51:21.6222152+08:00||;True|2024-06-17T09:20:35.0804494+08:00||;True|2024-06-17T08:41:58.1319484+08:00||;True|2024-06-17T08:38:09.0137102+08:00||;True|2024-06-14T15:19:45.7395180+08:00||;True|2024-06-14T14:38:49.7094421+08:00||;True|2024-06-14T14:27:39.2815370+08:00||;True|2024-06-14T09:42:21.5397525+08:00||;True|2024-06-13T16:03:39.8475642+08:00||;True|2024-06-13T14:12:10.1725629+08:00||;True|2024-06-13T10:46:52.6971321+08:00||;True|2024-06-11T17:03:44.8328978+08:00||;True|2024-06-06T17:41:51.1810315+08:00||;True|2024-06-06T10:57:27.8273617+08:00||;True|2024-06-04T14:23:21.3742450+08:00||;True|2024-05-31T17:01:42.4717460+08:00||;True|2024-05-31T13:56:03.0734064+08:00||;True|2024-05-31T08:45:52.3549394+08:00||;True|2024-05-30T17:16:32.8907958+08:00||;True|2024-05-30T16:18:06.9957657+08:00||;True|2024-05-29T15:44:18.4051203+08:00||;True|2024-05-29T15:11:03.1518632+08:00||;True|2024-05-29T14:52:26.0823495+08:00||;True|2024-05-29T11:17:20.2245101+08:00||;True|2024-05-29T08:36:28.9569161+08:00||;True|2024-05-28T08:44:31.4427261+08:00||;False|2024-05-28T08:44:02.5254826+08:00||;True|2024-05-27T15:16:32.9413631+08:00||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>
Loading…
Cancel
Save