修改费用记录表部分字段与数据库不同步的问题

usertest
嵇文龙 5 months ago
parent b5555298a8
commit 0a1faaa02c

@ -1,4 +1,5 @@
using DS.Module.Core; using System.ComponentModel;
using DS.Module.Core;
using DS.WMS.Core.Op.Entity; using DS.WMS.Core.Op.Entity;
namespace DS.WMS.Core.Fee.Dtos namespace DS.WMS.Core.Fee.Dtos
@ -23,6 +24,11 @@ namespace DS.WMS.Core.Fee.Dtos
/// </summary> /// </summary>
public string? CustomerNo { get; set; } public string? CustomerNo { get; set; }
/// <summary>
/// 委托单位
/// </summary>
public string? ClientName { get; set; }
/// <summary> /// <summary>
/// 费用对象/结费单位 /// 费用对象/结费单位
/// </summary> /// </summary>
@ -43,56 +49,6 @@ namespace DS.WMS.Core.Fee.Dtos
/// </summary> /// </summary>
public string? HBLNO { get; set; } public string? HBLNO { get; set; }
/// <summary>
/// RMB未付
/// </summary>
public decimal UnpaidRMB { get; set; }
/// <summary>
/// USD未付
/// </summary>
public decimal UnpaidUSD { get; set; }
/// <summary>
/// 其他未付
/// </summary>
public decimal UnpaidOther { get; set; }
/// <summary>
/// RMB未收
/// </summary>
public decimal UnreceivedRMB { get; set; }
/// <summary>
/// USD未收
/// </summary>
public decimal UnreceivedUSD { get; set; }
/// <summary>
/// RMB未收
/// </summary>
public decimal UnreceivedOther { get; set; }
/// <summary>
/// 合计未收
/// </summary>
public decimal UnreceivedTotal { get => UnreceivedRMB + UnreceivedUSD + UnreceivedOther; }
/// <summary>
/// RMB未开票
/// </summary>
public decimal UnBilledRMB { get; set; }
/// <summary>
/// USD未开票
/// </summary>
public decimal UnBilledUSD { get; set; }
/// <summary>
/// 其他未开票
/// </summary>
public decimal UnBilledOther { get; set; }
/// <summary> /// <summary>
/// 订舱编号 /// 订舱编号
/// </summary> /// </summary>
@ -197,6 +153,47 @@ namespace DS.WMS.Core.Fee.Dtos
/// 费用Id /// 费用Id
/// </summary> /// </summary>
public long? FeeId { get; set; } public long? FeeId { get; set; }
}
/// <summary>
/// 用于付费申请的业务信息
/// </summary>
public class BizPaymentApplication : BizApplication
{
/// <summary>
/// RMB未付
/// </summary>
public decimal UnpaidRMB { get; set; }
/// <summary>
/// USD未付
/// </summary>
public decimal UnpaidUSD { get; set; }
/// <summary>
/// 其他未付
/// </summary>
public decimal UnpaidOther { get; set; }
/// <summary>
/// RMB未收
/// </summary>
public decimal UnreceivedRMB { get; set; }
/// <summary>
/// USD未收
/// </summary>
public decimal UnreceivedUSD { get; set; }
/// <summary>
/// RMB未收
/// </summary>
public decimal UnreceivedOther { get; set; }
/// <summary>
/// 合计未收
/// </summary>
public decimal UnreceivedTotal { get => UnreceivedRMB + UnreceivedUSD + UnreceivedOther; }
/// <summary> /// <summary>
/// 是否垫付费用 /// 是否垫付费用
@ -207,11 +204,128 @@ namespace DS.WMS.Core.Fee.Dtos
/// 是否禁开发票 /// 是否禁开发票
/// </summary> /// </summary>
public bool? IsInvoice { get; set; } public bool? IsInvoice { get; set; }
}
/// <summary>
/// 用于发票申请的业务信息
/// </summary>
public class BizInvoiceApplication : BizApplication
{
/// <summary>
/// RMB未开票
/// </summary>
public decimal UnBilledRMB { get; set; }
/// <summary>
/// USD未开票
/// </summary>
public decimal UnBilledUSD { get; set; }
/// <summary>
/// 其他未开票
/// </summary>
public decimal UnBilledOther { get; set; }
/// <summary>
/// 已申请金额
/// </summary>
public decimal OrderAmount { get; set; }
/// <summary>
/// 已结算金额
/// </summary>
public decimal SettlementAmount { get; set; }
/// <summary>
/// 已开票金额
/// </summary>
public decimal InvoiceAmount { get; set; }
/// <summary> /// <summary>
/// 对账编号 /// 对账编号
/// </summary> /// </summary>
public string? BillNo { get; set; } public string? DebitNo { get; set; }
/// <summary>
/// 发票号
/// </summary>
public string? InvoiceNO { get; set; }
/// <summary>
/// 费用范围
/// </summary>
public FeeRange? FeeRange { get; set; }
}
/// <summary>
/// 费用范围
/// </summary>
public enum FeeRange
{
/// <summary>
/// 全部费用
/// </summary>
[Description("全部费用")]
All = 0,
/// <summary>
/// 未结费用
/// </summary>
[Description("未结费用")]
Unsettled = 1,
/// <summary>
/// 已结费用
/// </summary>
[Description("已结费用")]
Settled = 2,
/// <summary>
/// 已付未收
/// </summary>
[Description("已付未收")]
PaidNotReceived = 3,
/// <summary>
/// 已收未付
/// </summary>
[Description("已收未付")]
ReceivedNotPaid = 4,
/// <summary>
/// 未申请未结算
/// </summary>
[Description("未申请未结算")]
NotAppliedSettled = 5,
/// <summary>
/// 未对账未结算
/// </summary>
[Description("未对账未结算")]
UnreconciledSettled = 6,
/// <summary>
/// 未开票未结算
/// </summary>
[Description("未开票未结算")]
NotIssuedSettled = 7,
/// <summary>
/// 已对账未结算
/// </summary>
[Description("已对账未结算")]
ReconciledNotSettled = 8,
/// <summary>
/// 未收未付
/// </summary>
[Description("未收未付")]
NotReceivedPaid = 9,
/// <summary>
/// 已结算未开票
/// </summary>
[Description("已结算未开票")]
SettledNotIssued = 10
} }
} }

@ -16,14 +16,14 @@ namespace DS.WMS.Core.Application.Interface
/// </summary> /// </summary>
/// <param name="application"></param> /// <param name="application"></param>
/// <returns></returns> /// <returns></returns>
Task<DataResult> SaveAsync(TEntity application); Task<DataResult<TEntity>> SaveAsync(TEntity application);
/// <summary> /// <summary>
/// 提交申请单 /// 提交申请单
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
Task<DataResult> SaveAsync(ApplicationRequest<TEntity> request); Task<DataResult<TEntity>> SaveAsync(ApplicationRequest<TEntity> request);
/// <summary> /// <summary>
/// 删除申请单明细 /// 删除申请单明细

@ -22,6 +22,6 @@ namespace DS.WMS.Core.Application.Interface
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
Task<DataResult<List<BizApplication>>> GetBizListAsync(PageRequest request); Task<DataResult<List<BizInvoiceApplication>>> GetBizListAsync(PageRequest request);
} }
} }

@ -23,7 +23,7 @@ namespace DS.WMS.Core.Application.Interface
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
Task<DataResult<List<BizApplication>>> GetBizListAsync(PageRequest request); Task<DataResult<List<BizPaymentApplication>>> GetBizListAsync(PageRequest request);
/// <summary> /// <summary>
/// 获取申请单详情 /// 获取申请单详情

@ -42,7 +42,7 @@ namespace DS.WMS.Core.Application.Method
/// </summary> /// </summary>
/// <param name="application">申请单</param> /// <param name="application">申请单</param>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult> SaveAsync(TEntity application) public async Task<DataResult<TEntity>> SaveAsync(TEntity application)
{ {
TEntity dbValue = null; TEntity dbValue = null;
if (application.Id >= 0) if (application.Id >= 0)
@ -52,7 +52,7 @@ namespace DS.WMS.Core.Application.Method
x => new TEntity { Status = x.Status, Currency = x.Currency }).FirstAsync(); x => new TEntity { Status = x.Status, Currency = x.Currency }).FirstAsync();
if (dbValue == null) if (dbValue == null)
return DataResult.Failed("未能获取申请单信息"); return DataResult<TEntity>.Failed("未能获取申请单信息");
} }
if (application.Currency.IsNullOrEmpty()) if (application.Currency.IsNullOrEmpty())
@ -61,7 +61,7 @@ namespace DS.WMS.Core.Application.Method
application.Details ??= []; application.Details ??= [];
var result = PreSave(application, dbValue); var result = PreSave(application, dbValue);
if (!result.Succeeded) if (!result.Succeeded)
return result; return DataResult<TEntity>.Failed(result.Message);
List<FeeRecord> fees = []; List<FeeRecord> fees = [];
if (application.Details.Count > 0) if (application.Details.Count > 0)
@ -110,7 +110,7 @@ namespace DS.WMS.Core.Application.Method
result = CalculateAmount(application, fees); result = CalculateAmount(application, fees);
if (!result.Succeeded) if (!result.Succeeded)
return result; return DataResult<TEntity>.Failed(result.Message);
} }
await TenantDb.Ado.BeginTranAsync(); await TenantDb.Ado.BeginTranAsync();
@ -123,7 +123,7 @@ namespace DS.WMS.Core.Application.Method
var sequence = commonService.Value.GetSequenceNext<PaymentApplication>(); var sequence = commonService.Value.GetSequenceNext<PaymentApplication>();
if (!sequence.Succeeded) if (!sequence.Succeeded)
{ {
return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist); return DataResult<TEntity>.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist);
} }
application.ApplicationNO = sequence.Data; application.ApplicationNO = sequence.Data;
@ -152,13 +152,13 @@ namespace DS.WMS.Core.Application.Method
await TenantDb.Ado.CommitTranAsync(); await TenantDb.Ado.CommitTranAsync();
PostSave(application); PostSave(application);
return DataResult.Success; return DataResult<TEntity>.Success(application);
} }
catch (Exception ex) catch (Exception ex)
{ {
await TenantDb.Ado.RollbackTranAsync(); await TenantDb.Ado.RollbackTranAsync();
await ex.LogAsync(Db); await ex.LogAsync(Db);
return DataResult.Failed("发生错误,提交失败"); return DataResult<TEntity>.Failed("发生错误,提交失败");
} }
} }
@ -167,7 +167,7 @@ namespace DS.WMS.Core.Application.Method
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult> SaveAsync(ApplicationRequest<TEntity> request) public async Task<DataResult<TEntity>> SaveAsync(ApplicationRequest<TEntity> request)
{ {
request.Application ??= new(); request.Application ??= new();
request.Application.Details = await GetDetailsAsync(request.Items); request.Application.Details = await GetDetailsAsync(request.Items);

@ -85,17 +85,61 @@ namespace DS.WMS.Core.Application.Method
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<List<BizApplication>>> GetBizListAsync(PageRequest request) public async Task<DataResult<List<BizInvoiceApplication>>> GetBizListAsync(PageRequest request)
{ {
var queryList = CreateBizQuery(); var query = CreateBizQuery();
if (!request.QueryCondition.IsNullOrEmpty()) if (!request.QueryCondition.IsNullOrEmpty())
{ {
var whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition); var whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
queryList = queryList.Where(whereList); int? index = null;
foreach (var item in whereList)
{
ConditionalModel? model = item as ConditionalModel;
if (model == null)
continue;
//设置了费用范围筛选
if (string.Equals(model.FieldName, nameof(BizInvoiceApplication.FeeRange)) && int.TryParse(model.FieldValue, out int feeRangeVal))
{
FeeRange feeRange = (FeeRange)feeRangeVal;
switch (feeRange)
{
case FeeRange.Unsettled:
query = query.Where(x => x.SettlementAmount == 0);
break;
case FeeRange.Settled:
query = query.Where(x => x.SettlementAmount > 0);
break;
case FeeRange.PaidNotReceived:
break;
case FeeRange.ReceivedNotPaid:
break;
case FeeRange.NotAppliedSettled:
query = query.Where(x => x.OrderAmount == 0 && x.SettlementAmount == 0);
break;
case FeeRange.UnreconciledSettled:
break;
case FeeRange.NotIssuedSettled:
break;
case FeeRange.ReconciledNotSettled:
break;
case FeeRange.NotReceivedPaid:
break;
case FeeRange.SettledNotIssued:
break;
}
index = whereList.IndexOf(item);
break;
}
}
if (index.HasValue)
whereList.RemoveAt(index.Value);
query = query.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)
{ {
//关联用户名称 //关联用户名称
@ -122,23 +166,24 @@ namespace DS.WMS.Core.Application.Method
} }
//创建各项业务数据的查询并集 //创建各项业务数据的查询并集
internal ISugarQueryable<BizApplication> CreateBizQuery() internal ISugarQueryable<BizInvoiceApplication> CreateBizQuery()
{ {
//海运出口 //海运出口
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) => s.Id)
.Select((s, f) => new BizApplication .Select((s, f) => new BizInvoiceApplication
{ {
Id = s.Id, Id = s.Id,
AccountDate = s.AccountDate, AccountDate = s.AccountDate,
BusinessType = BusinessType.OceanShippingExport, BusinessType = BusinessType.OceanShippingExport,
CntrTotal = s.CntrTotal, CntrTotal = s.CntrTotal,
CreateBy = s.CreateBy, CreateBy = s.CreateBy,
CustomerId = s.CustomerId,//费用对象 CustomerId = f.CustomerId,//费用对象
CustomerName = s.CustomerName, CustomerName = f.CustomerName,
CustomerNo = s.CustomerNo, CustomerNo = s.CustomerNo,
ClientName = s.CustomerName, //委托单位
DischargePort = s.DischargePort, DischargePort = s.DischargePort,
ETD = s.ETD, ETD = s.ETD,
HBLNO = s.HBLNO, HBLNO = s.HBLNO,
@ -155,21 +200,23 @@ namespace DS.WMS.Core.Application.Method
FeeType = f.FeeType, FeeType = f.FeeType,
FeeId = f.FeeId, FeeId = f.FeeId,
Currency = f.Currency, Currency = f.Currency,
IsAdvancedPay = f.IsAdvancedPay, DebitNo = f.DebitNo,
IsInvoice = f.IsInvoice, OrderAmount = f.OrderAmount,
InvoiceAmount = f.InvoiceAmount,
SettlementAmount = f.SettlementAmount,
//未申请开票金额=(金额-开票金额-申请开票金额+申请开票金额已开票 //未申请开票金额=(金额-开票金额-申请开票金额+申请开票金额已开票
UnBilledRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed UnBilledRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed
&& f.Currency == RMB_CODE).Select(f => SqlFunc.AggregateSum((f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount).GetValueOrDefault())), && f.Currency == RMB_CODE).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount)),
UnBilledUSD = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed UnBilledUSD = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed
&& f.Currency == USD_CODE).Select(f => SqlFunc.AggregateSum((f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount).GetValueOrDefault())), && f.Currency == USD_CODE).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount)),
UnBilledOther = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed UnBilledOther = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed
&& f.Currency != RMB_CODE && f.Currency != USD_CODE).Select(f => SqlFunc.AggregateSum((f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount).GetValueOrDefault())) && f.Currency != RMB_CODE && f.Currency != USD_CODE).Select(f => SqlFunc.AggregateSum(f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount))
}); });
//海运进口 //海运进口
return TenantDb.UnionAll(new List<ISugarQueryable<BizApplication>> { query1 }); return TenantDb.UnionAll(new List<ISugarQueryable<BizInvoiceApplication>> { query1 });
} }
/// <summary> /// <summary>
@ -193,9 +240,9 @@ namespace DS.WMS.Core.Application.Method
FeeId = f.FeeId, FeeId = f.FeeId,
FeeName = f.FeeName, FeeName = f.FeeName,
FeeType = f.FeeType, FeeType = f.FeeType,
Amount = f.Amount.GetValueOrDefault(), Amount = f.Amount,
Currency = f.Currency, Currency = f.Currency,
RestAmount = (f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount).GetValueOrDefault(), RestAmount = f.Amount - f.InvoiceAmount - f.OrderInvoiceAmount + f.OrderInvSettlementAmount,
Remark = f.Remark, Remark = f.Remark,
CreateBy = f.CreateBy CreateBy = f.CreateBy
}).ToListAsync(); }).ToListAsync();
@ -342,7 +389,7 @@ namespace DS.WMS.Core.Application.Method
Id = x.Id, Id = x.Id,
BusinessId = x.BusinessId, BusinessId = x.BusinessId,
BusinessType = x.BusinessType, BusinessType = x.BusinessType,
Amount = (x.Amount - x.InvoiceAmount - x.OrderInvoiceAmount + x.OrderInvSettlementAmount).GetValueOrDefault(), Amount = x.Amount - x.InvoiceAmount - x.OrderInvoiceAmount + x.OrderInvSettlementAmount,
ExchangeRate = x.ExchangeRate, ExchangeRate = x.ExchangeRate,
OriginalCurrency = x.Currency OriginalCurrency = x.Currency
}).ToListAsync(); }).ToListAsync();
@ -395,7 +442,7 @@ namespace DS.WMS.Core.Application.Method
} }
//未申请开票金额=(金额-已开票金额-申请开票金额+申请开票金额已开票 //未申请开票金额=(金额-已开票金额-申请开票金额+申请开票金额已开票
var restAmount = (fee.Amount - fee.InvoiceAmount- fee.OrderInvoiceAmount + fee.OrderInvSettlementAmount).GetValueOrDefault(); var restAmount = fee.Amount - fee.InvoiceAmount - fee.OrderInvoiceAmount + fee.OrderInvSettlementAmount;
if (detail.OriginalAmount > 0 && detail.OriginalAmount > restAmount) if (detail.OriginalAmount > 0 && detail.OriginalAmount > restAmount)
{ {
sb.Append($"申请单明细【{detail.FeeName}】的申请开票金额不能超出原费用的金额;"); sb.Append($"申请单明细【{detail.FeeName}】的申请开票金额不能超出原费用的金额;");

@ -123,7 +123,7 @@ namespace DS.WMS.Core.Application.Method
FeeBiz model = new() FeeBiz model = new()
{ {
ReceivableTotal = (await TenantDb.Queryable<FeeRecord>().Where(x => x.CustomerId == customerId ReceivableTotal = (await TenantDb.Queryable<FeeRecord>().Where(x => x.CustomerId == customerId
&& x.FeeType == FeeType.Receivable && x.FeeStatus == FeeStatus.AuditPassed).SumAsync(x => x.Amount)).GetValueOrDefault() && x.FeeType == FeeType.Receivable && x.FeeStatus == FeeStatus.AuditPassed).SumAsync(x => x.Amount))
}; };
var fees = await TenantDb.Queryable<FeeRecord>().Where(x => var fees = await TenantDb.Queryable<FeeRecord>().Where(x =>
@ -137,8 +137,8 @@ namespace DS.WMS.Core.Application.Method
model.TotalItems = fees.GroupBy(x => x.Currency).Select(x => new TotalItem model.TotalItems = fees.GroupBy(x => x.Currency).Select(x => new TotalItem
{ {
Currency = x.Key, Currency = x.Key,
PayableAmount = x.Where(y => y.FeeType == FeeType.Payable && y.Currency == x.Key).Sum(y => y.Amount).GetValueOrDefault(), PayableAmount = x.Where(y => y.FeeType == FeeType.Payable && y.Currency == x.Key).Sum(y => y.Amount),
ReceivableAmount = x.Where(y => y.FeeType == FeeType.Receivable && y.Currency == x.Key).Sum(y => y.Amount).GetValueOrDefault(), ReceivableAmount = x.Where(y => y.FeeType == FeeType.Receivable && y.Currency == x.Key).Sum(y => y.Amount),
RestAmount = 0 //todo:未收 RestAmount = 0 //todo:未收
}).ToList(); }).ToList();
@ -208,15 +208,15 @@ namespace DS.WMS.Core.Application.Method
x.Amount x.Amount
}).ToListAsync(); }).ToListAsync();
stat.ReceivableTotal = fees.FindAll(x => x.FeeType == FeeType.Receivable).Sum(x => x.Amount).GetValueOrDefault(); stat.ReceivableTotal = fees.FindAll(x => x.FeeType == FeeType.Receivable).Sum(x => x.Amount);
stat.ReceivableCNY = fees.FindAll(x => x.FeeType == FeeType.Receivable && x.Currency == RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(); stat.ReceivableCNY = fees.FindAll(x => x.FeeType == FeeType.Receivable && x.Currency == RMB_CODE).Sum(x => x.Amount);
stat.ReceivableUSD = fees.FindAll(x => x.FeeType == FeeType.Receivable && x.Currency == USD_CODE).Sum(x => x.Amount).GetValueOrDefault(); stat.ReceivableUSD = fees.FindAll(x => x.FeeType == FeeType.Receivable && x.Currency == USD_CODE).Sum(x => x.Amount);
stat.ReceivableOther = fees.FindAll(x => x.FeeType == FeeType.Receivable && x.Currency != USD_CODE && x.Currency != RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(); stat.ReceivableOther = fees.FindAll(x => x.FeeType == FeeType.Receivable && x.Currency != USD_CODE && x.Currency != RMB_CODE).Sum(x => x.Amount);
stat.PayableTotal = fees.FindAll(x => x.FeeType == FeeType.Payable).Sum(x => x.Amount).GetValueOrDefault(); stat.PayableTotal = fees.FindAll(x => x.FeeType == FeeType.Payable).Sum(x => x.Amount);
stat.PayableCNY = fees.FindAll(x => x.FeeType == FeeType.Payable && x.Currency == RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(); stat.PayableCNY = fees.FindAll(x => x.FeeType == FeeType.Payable && x.Currency == RMB_CODE).Sum(x => x.Amount);
stat.PayableUSD = fees.FindAll(x => x.FeeType == FeeType.Payable && x.Currency == USD_CODE).Sum(x => x.Amount).GetValueOrDefault(); stat.PayableUSD = fees.FindAll(x => x.FeeType == FeeType.Payable && x.Currency == USD_CODE).Sum(x => x.Amount);
stat.PayableOther = fees.FindAll(x => x.FeeType == FeeType.Payable && x.Currency != USD_CODE && x.Currency != RMB_CODE).Sum(x => x.Amount).GetValueOrDefault(); stat.PayableOther = fees.FindAll(x => x.FeeType == FeeType.Payable && x.Currency != USD_CODE && x.Currency != RMB_CODE).Sum(x => x.Amount);
long?[] usersId = [stat.OperatorId]; long?[] usersId = [stat.OperatorId];
if (Array.Exists(usersId, x => x.HasValue)) if (Array.Exists(usersId, x => x.HasValue))

@ -138,7 +138,7 @@ namespace DS.WMS.Core.Application.Method
/// </summary> /// </summary>
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
public async Task<DataResult<List<BizApplication>>> GetBizListAsync(PageRequest request) public async Task<DataResult<List<BizPaymentApplication>>> GetBizListAsync(PageRequest request)
{ {
var queryList = CreateBizQuery(); var queryList = CreateBizQuery();
@ -174,14 +174,14 @@ namespace DS.WMS.Core.Application.Method
} }
//创建各项业务数据的查询并集 //创建各项业务数据的查询并集
internal ISugarQueryable<BizApplication> CreateBizQuery() internal ISugarQueryable<BizPaymentApplication> CreateBizQuery()
{ {
//海运出口 //海运出口
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) => s.Id)
.Select((s, f) => new BizApplication .Select((s, f) => new BizPaymentApplication
{ {
Id = s.Id, Id = s.Id,
AccountDate = s.AccountDate, AccountDate = s.AccountDate,
@ -211,17 +211,17 @@ namespace DS.WMS.Core.Application.Method
IsInvoice = f.IsInvoice, IsInvoice = f.IsInvoice,
//统计项 //统计项
UnpaidRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed && UnpaidRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed &&
f.FeeType == FeeType.Payable && f.Currency == RMB_CODE).Select(f => SqlFunc.AggregateSumNoNull(f.Amount.Value)), f.FeeType == FeeType.Payable && f.Currency == RMB_CODE).Select(f => SqlFunc.AggregateSumNoNull(f.Amount)),
UnpaidUSD = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed && UnpaidUSD = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.BusinessId == s.Id && f.FeeStatus == FeeStatus.AuditPassed &&
f.FeeType == FeeType.Payable && f.Currency == USD_CODE).Select(f => SqlFunc.AggregateSumNoNull(f.Amount.Value)), f.FeeType == FeeType.Payable && f.Currency == USD_CODE).Select(f => SqlFunc.AggregateSumNoNull(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 != USD_CODE && f.Currency != RMB_CODE).Select(f => SqlFunc.AggregateSumNoNull(f.Amount.Value)), f.FeeType == FeeType.Payable && f.Currency != USD_CODE && f.Currency != RMB_CODE).Select(f => SqlFunc.AggregateSumNoNull(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 == RMB_CODE).Select(f => SqlFunc.AggregateSumNoNull(f.Amount.Value)), f.FeeType == FeeType.Receivable && f.Currency == RMB_CODE).Select(f => SqlFunc.AggregateSumNoNull(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 == USD_CODE).Select(f => SqlFunc.AggregateSumNoNull(f.Amount.Value)), f.FeeType == FeeType.Receivable && f.Currency == USD_CODE).Select(f => SqlFunc.AggregateSumNoNull(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 != USD_CODE && f.Currency != RMB_CODE).Select(f => SqlFunc.AggregateSumNoNull(f.Amount.Value)), f.FeeType == FeeType.Receivable && f.Currency != USD_CODE && f.Currency != RMB_CODE).Select(f => SqlFunc.AggregateSumNoNull(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 == "CNY").Select(f => SqlFunc.AggregateSumNoNull(f.InvoiceAmount.Value)), // f.FeeType == FeeType.Payable && f.Currency == "CNY").Select(f => SqlFunc.AggregateSumNoNull(f.InvoiceAmount.Value)),
//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 &&
@ -231,7 +231,7 @@ namespace DS.WMS.Core.Application.Method
//海运进口 //海运进口
return TenantDb.UnionAll(new List<ISugarQueryable<BizApplication>> { query1 }); return TenantDb.UnionAll(new List<ISugarQueryable<BizPaymentApplication>> { query1 });
} }
/// <summary> /// <summary>
@ -255,11 +255,11 @@ namespace DS.WMS.Core.Application.Method
FeeId = f.FeeId, FeeId = f.FeeId,
FeeName = f.FeeName, FeeName = f.FeeName,
FeeType = f.FeeType, FeeType = f.FeeType,
Amount = f.Amount.GetValueOrDefault(), Amount = f.Amount,
Currency = f.Currency, Currency = f.Currency,
OriginalCurrency = f.Currency, OriginalCurrency = f.Currency,
OriginalRate = f.ExchangeRate, OriginalRate = f.ExchangeRate,
RestAmount = (f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount).GetValueOrDefault(), RestAmount = f.Amount - f.SettlementAmount - f.OrderAmount + f.OrderSettlementAmount,
InvoiceAmount = f.InvoiceAmount, InvoiceAmount = f.InvoiceAmount,
Remark = f.Remark, Remark = f.Remark,
CreateBy = f.CreateBy CreateBy = f.CreateBy
@ -404,7 +404,7 @@ namespace DS.WMS.Core.Application.Method
.Select(x => new ApplicationDetail .Select(x => new ApplicationDetail
{ {
RecordId = x.Id, RecordId = x.Id,
Amount = (x.Amount - x.SettlementAmount - x.OrderAmount + x.OrderSettlementAmount).GetValueOrDefault(), Amount = x.Amount - x.SettlementAmount - x.OrderAmount + x.OrderSettlementAmount,
Currency = x.Currency, Currency = x.Currency,
ExchangeRate = x.ExchangeRate, ExchangeRate = x.ExchangeRate,
OriginalCurrency = x.Currency OriginalCurrency = x.Currency
@ -451,7 +451,7 @@ namespace DS.WMS.Core.Application.Method
detail.Record = fee; detail.Record = fee;
//未申请金额=总金额-结算金额-申请金额+申请金额已结算 //未申请金额=总金额-结算金额-申请金额+申请金额已结算
var restAmount = fee.Amount.GetValueOrDefault() - fee.SettlementAmount.GetValueOrDefault() - fee.OrderAmount.GetValueOrDefault() + fee.OrderSettlementAmount; var restAmount = fee.Amount - fee.SettlementAmount - fee.OrderAmount + fee.OrderSettlementAmount;
if (detail.OriginalAmount > 0 && detail.OriginalAmount > restAmount) if (detail.OriginalAmount > 0 && detail.OriginalAmount > restAmount)
{ {
sb.Append($"申请单明细【{detail.FeeName}】的申请金额不能超出原费用的金额;"); sb.Append($"申请单明细【{detail.FeeName}】的申请金额不能超出原费用的金额;");

@ -487,7 +487,7 @@ namespace DS.WMS.Core.Fee.Dtos
/// <summary> /// <summary>
/// 发票号 /// 发票号
/// </summary> /// </summary>
public string InvoiceNum { get; set; } public string InvoiceNO { get; set; }
/// <summary> /// <summary>
/// 税率 /// 税率

@ -166,7 +166,7 @@ namespace DS.WMS.Core.Fee.Dtos
{ {
_source = source; _source = source;
var localReceivable = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == x.LocalCurrency).Sum(x => x.Amount).GetValueOrDefault(); var localReceivable = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == x.LocalCurrency).Sum(x => x.Amount);
//其他币种按汇率转换为本币金额,下同 //其他币种按汇率转换为本币金额,下同
var otherReceivable = (from s in _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency != x.LocalCurrency) var otherReceivable = (from s in _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency != x.LocalCurrency)
group s by new { s.Currency, s.ExchangeRate } into g group s by new { s.Currency, s.ExchangeRate } into g
@ -178,7 +178,7 @@ namespace DS.WMS.Core.Fee.Dtos
ReceivableTotal = localReceivable + otherReceivable;//应收合计 ReceivableTotal = localReceivable + otherReceivable;//应收合计
var localPayable = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == x.LocalCurrency).Sum(x => x.Amount).GetValueOrDefault(); var localPayable = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == x.LocalCurrency).Sum(x => x.Amount);
var otherPayable = (from s in _source.Where(x => x.FeeType == FeeType.Payable && x.Currency != x.LocalCurrency) var otherPayable = (from s in _source.Where(x => x.FeeType == FeeType.Payable && x.Currency != x.LocalCurrency)
group s by new { s.Currency, s.ExchangeRate } into g group s by new { s.Currency, s.ExchangeRate } into g
select new select new
@ -212,20 +212,20 @@ namespace DS.WMS.Core.Fee.Dtos
//人民币 //人民币
ReceivableCNY = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(); ReceivableCNY = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.Amount);
PayableCNY = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(); PayableCNY = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.Amount);
NoTaxReceivableCNY = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.NoTaxAmount); NoTaxReceivableCNY = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.NoTaxAmount);
NoTaxPayableCNY = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.NoTaxAmount); NoTaxPayableCNY = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.NoTaxAmount);
//美元 //美元
ReceivableUSD = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(); ReceivableUSD = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.Amount);
PayableUSD = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(); PayableUSD = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.Amount);
NoTaxReceivableUSD = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.NoTaxAmount); NoTaxReceivableUSD = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.NoTaxAmount);
NoTaxPayableUSD = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.NoTaxAmount); NoTaxPayableUSD = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.NoTaxAmount);
//其他 //其他
ReceivableOther = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount).GetValueOrDefault(); ReceivableOther = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount);
PayableOther = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount).GetValueOrDefault(); PayableOther = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.Amount);
NoTaxReceivableOther = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.NoTaxAmount); NoTaxReceivableOther = _source.Where(x => x.FeeType == FeeType.Receivable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.NoTaxAmount);
NoTaxPayableOther = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.NoTaxAmount); NoTaxPayableOther = _source.Where(x => x.FeeType == FeeType.Payable && x.Currency != "USD" && x.Currency != "CNY").Sum(x => x.NoTaxAmount);
@ -235,12 +235,12 @@ namespace DS.WMS.Core.Fee.Dtos
select new ByCustomerStat select new ByCustomerStat
{ {
CustomerName = g.Key, CustomerName = g.Key,
ReceivableTotal = g.Where(x => x.FeeType == FeeType.Receivable).Sum(x => x.Amount).GetValueOrDefault(), ReceivableTotal = g.Where(x => x.FeeType == FeeType.Receivable).Sum(x => x.Amount),
PayableTotal = g.Where(x => x.FeeType == FeeType.Payable).Sum(x => x.Amount).GetValueOrDefault(), PayableTotal = g.Where(x => x.FeeType == FeeType.Payable).Sum(x => x.Amount),
ReceivableCNY = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(), ReceivableCNY = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "CNY").Sum(x => x.Amount),
PayableCNY = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.Amount).GetValueOrDefault(), PayableCNY = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == "CNY").Sum(x => x.Amount),
ReceivableUSD = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault(), ReceivableUSD = g.Where(x => x.FeeType == FeeType.Receivable && x.Currency == "USD").Sum(x => x.Amount),
PayableUSD = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.Amount).GetValueOrDefault() PayableUSD = g.Where(x => x.FeeType == FeeType.Payable && x.Currency == "USD").Sum(x => x.Amount)
}).ToList(); }).ToList();
} }

@ -92,17 +92,17 @@ namespace DS.WMS.Core.Fee.Entity
/// 不含税单价 /// 不含税单价
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "不含税单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] [SugarColumn(ColumnDescription = "不含税单价", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? UnitPrice { get; set; } public decimal UnitPrice { get; set; }
/// <summary> /// <summary>
/// 数量 /// 数量
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "数量", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")] [SugarColumn(ColumnDescription = "数量", IsNullable = true, Length = 18, DecimalDigits = 4, DefaultValue = "0")]
public decimal? Quantity { get; set; } public decimal Quantity { get; set; }
/// <summary> /// <summary>
/// 金额 /// 金额
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "金额", IsNullable = true, Length = 18, DecimalDigits = 2, DefaultValue = "0")] [SugarColumn(ColumnDescription = "金额", IsNullable = true, Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal? Amount { get; set; } public decimal Amount { get; set; }
/// <summary> /// <summary>
/// 币别 /// 币别
@ -136,28 +136,28 @@ namespace DS.WMS.Core.Fee.Entity
/// Desc:佣金比率 /// Desc:佣金比率
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "佣金比率", Length = 18, DecimalDigits = 3, DefaultValue = "0")] [SugarColumn(ColumnDescription = "佣金比率", Length = 18, DecimalDigits = 3, DefaultValue = "0")]
public decimal? CommissionRate { get; set; } = 0; public decimal CommissionRate { get; set; }
/// <summary> /// <summary>
/// 已结算金额 /// 已结算金额
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "已结算金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] [SugarColumn(ColumnDescription = "已结算金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal? SettlementAmount { get; set; } = 0; public decimal SettlementAmount { get; set; }
/// <summary> /// <summary>
/// 已开票金额 /// 已开票金额
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "已开票金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] [SugarColumn(ColumnDescription = "已开票金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal? InvoiceAmount { get; set; } = 0; public decimal InvoiceAmount { get; set; }
/// <summary> /// <summary>
///已申请金额 ///已申请金额
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "已申请金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] [SugarColumn(ColumnDescription = "已申请金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal? OrderAmount { get; set; } = 0; public decimal OrderAmount { get; set; } = 0;
/// <summary> /// <summary>
/// Desc:申请开票金额 /// Desc:申请开票金额
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "申请开票金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")] [SugarColumn(ColumnDescription = "申请开票金额", Length = 18, DecimalDigits = 2, DefaultValue = "0")]
public decimal? OrderInvoiceAmount { get; set; } = 0; public decimal OrderInvoiceAmount { get; set; }
/// <summary> /// <summary>
/// 审核人Id /// 审核人Id
@ -206,11 +206,6 @@ namespace DS.WMS.Core.Fee.Entity
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "是否销售订舱", DefaultValue = "0")] [SugarColumn(ColumnDescription = "是否销售订舱", DefaultValue = "0")]
public bool? IsCrmOrderFee { get; set; } = false; public bool? IsCrmOrderFee { get; set; } = false;
/// <summary>
/// 排序
/// </summary>
[SugarColumn(ColumnDescription = "排序")]
public int? OrderNo { get; set; } = 100;
/// <summary> /// <summary>
/// 费用状态 /// 费用状态
@ -222,13 +217,14 @@ namespace DS.WMS.Core.Fee.Entity
/// 发票号 /// 发票号
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "发票号", IsNullable = true, Length = 200)] [SugarColumn(ColumnDescription = "发票号", IsNullable = true, Length = 200)]
public string InvoiceNum { get; set; } public string InvoiceNO { get; set; }
/// <summary> /// <summary>
/// 支票号 /// 支票号
/// </summary> /// </summary>
[SugarColumn(ColumnDescription = "支票号", IsNullable = true, Length = 200)] [SugarColumn(ColumnDescription = "支票号", IsNullable = true, Length = 200)]
[Description("支票号")] [Description("支票号")]
public string ChequeNum { get; set; } public string ChequeNO { get; set; }
/// <summary> /// <summary>
/// 仓储编号 /// 仓储编号
@ -236,12 +232,6 @@ namespace DS.WMS.Core.Fee.Entity
[SugarColumn(ColumnDescription = "仓储编号", IsNullable = true, Length = 100)] [SugarColumn(ColumnDescription = "仓储编号", IsNullable = true, Length = 100)]
public string WmsOutBSNO { get; set; } public string WmsOutBSNO { get; set; }
/// <summary>
/// 行号
/// </summary>
[SugarColumn(ColumnDescription = "行号")]
public int LineNum { get; set; }
/// <summary> /// <summary>
/// 税率 /// 税率
/// </summary> /// </summary>
@ -381,6 +371,12 @@ namespace DS.WMS.Core.Fee.Entity
[SugarColumn(ColumnDescription = "当前审批ID", IsNullable = true)] [SugarColumn(ColumnDescription = "当前审批ID", IsNullable = true)]
public long? FlowId { get; set; } public long? FlowId { get; set; }
/// <summary>
/// 排序
/// </summary>
[SugarColumn(ColumnDescription = "排序")]
public int? OrderNo { get; set; }
[Navigate(NavigateType.ManyToOne,nameof(Entity.FeeCode.Id))] [Navigate(NavigateType.ManyToOne,nameof(Entity.FeeCode.Id))]
public FeeCode Fee { get; set; } public FeeCode Fee { get; set; }
} }

@ -366,7 +366,7 @@ namespace DS.WMS.Core.Fee.Method
SettlementAmount = f.SettlementAmount,//结算金额 SettlementAmount = f.SettlementAmount,//结算金额
InvoiceAmount = f.InvoiceAmount,//开票金额 InvoiceAmount = f.InvoiceAmount,//开票金额
OrderAmount = f.OrderAmount,//申请金额 OrderAmount = f.OrderAmount,//申请金额
InvoiceNum = f.InvoiceNum,//发票号 InvoiceNO = f.InvoiceNO,//发票号
Tax = f.Tax,//税额 Tax = f.Tax,//税额
DebitNo = f.DebitNo,//对账编号 DebitNo = f.DebitNo,//对账编号
SaleOrg = f.SaleOrg, SaleOrg = f.SaleOrg,

@ -817,7 +817,7 @@ namespace DS.WMS.Core.Fee.Method
PrintTime = DateTime.Now, PrintTime = DateTime.Now,
Details = list.Select(x => new CostAccountingDetail Details = list.Select(x => new CostAccountingDetail
{ {
Amount = x.Amount.GetValueOrDefault(), Amount = x.Amount,
Currency = x.Currency, Currency = x.Currency,
CustomerName = x.CustomerName, CustomerName = x.CustomerName,
FeeName = x.FeeName, FeeName = x.FeeName,

@ -41,7 +41,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("GetBizList")] [HttpPost, Route("GetBizList")]
public async Task<DataResult<List<BizApplication>>> BizListAsync([FromBody] PageRequest request) public async Task<DataResult<List<BizInvoiceApplication>>> BizListAsync([FromBody] PageRequest request)
{ {
return await _service.GetBizListAsync(request); return await _service.GetBizListAsync(request);
} }
@ -77,7 +77,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="application">申请单</param> /// <param name="application">申请单</param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("Save")] [HttpPost, Route("Save")]
public async Task<DataResult> SaveAsync([FromBody] InvoiceApplication application) public async Task<DataResult<InvoiceApplication>> SaveAsync([FromBody] InvoiceApplication application)
{ {
return await _service.SaveAsync(application); return await _service.SaveAsync(application);
} }
@ -88,10 +88,10 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("BizSave")] [HttpPost, Route("BizSave")]
public async Task<DataResult> SaveAsync([FromBody] ApplicationRequest<InvoiceApplication> request) public async Task<DataResult<InvoiceApplication>> SaveAsync([FromBody] ApplicationRequest<InvoiceApplication> request)
{ {
if (request.Items == null || request.Items.Count == 0) if (request.Items == null || request.Items.Count == 0)
return DataResult.Failed("缺少请求参数"); return DataResult<InvoiceApplication>.Failed("缺少请求参数");
return await _service.SaveAsync(request); return await _service.SaveAsync(request);
} }

@ -41,7 +41,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("GetBizList")] [HttpPost, Route("GetBizList")]
public async Task<DataResult<List<BizApplication>>> BizListAsync([FromBody] PageRequest request) public async Task<DataResult<List<BizPaymentApplication>>> BizListAsync([FromBody] PageRequest request)
{ {
return await _service.GetBizListAsync(request); return await _service.GetBizListAsync(request);
} }
@ -77,7 +77,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="application">申请单</param> /// <param name="application">申请单</param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("Save")] [HttpPost, Route("Save")]
public async Task<DataResult> SaveAsync([FromBody] PaymentApplication application) public async Task<DataResult<PaymentApplication>> SaveAsync([FromBody] PaymentApplication application)
{ {
return await _service.SaveAsync(application); return await _service.SaveAsync(application);
} }
@ -88,10 +88,10 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost, Route("BizSave")] [HttpPost, Route("BizSave")]
public async Task<DataResult> SaveAsync([FromBody] ApplicationRequest<PaymentApplication> request) public async Task<DataResult<PaymentApplication>> SaveAsync([FromBody] ApplicationRequest<PaymentApplication> request)
{ {
if (request.Items == null || request.Items.Count == 0) if (request.Items == null || request.Items.Count == 0)
return DataResult.Failed("缺少请求参数"); return DataResult<PaymentApplication>.Failed("缺少请求参数");
return await _service.SaveAsync(request); return await _service.SaveAsync(request);
} }

@ -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-06-24T07:22:18.2672769Z||;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||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History> <History>True|2024-06-25T02:17:17.7408916Z||;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||;True|2024-05-22T16:52:42.2166228+08:00||;True|2024-05-22T15:19:49.1773202+08:00||;True|2024-05-22T15:13:31.9485525+08:00||;True|2024-05-22T13:29:02.1355808+08:00||;True|2024-05-22T09:48:40.8753914+08:00||;True|2024-05-22T09:25:06.2068137+08:00||;True|2024-05-22T09:18:53.0759815+08:00||;True|2024-05-21T17:13:36.4091775+08:00||;True|2024-05-21T14:41:18.8486299+08:00||;True|2024-05-21T11:04:27.3649637+08:00||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>
Loading…
Cancel
Save