Commit 382f26d5 by 陶然

新增性能分析

parent 4181e7df
......@@ -11,7 +11,7 @@ using System.Threading.Tasks;
namespace Kivii.Finances.Transforms
{
[Api(Description = "款登记")]
[Api(Description = "款登记")]
[RequiresAnyRole(SystemRoles.Everyone)]
public class PayPaying : RestfulExecution<Pay>
{
......@@ -51,6 +51,8 @@ namespace Kivii.Finances.Transforms
if (PayingMethods.Count == 1)//单笔付款登记
{
using (KiviiContext.Profiler("单个方式收款"))
{
var payingMethod = PayingMethods[0];
if (payingMethod.Type == PayType.Payment)
{
......@@ -219,10 +221,13 @@ namespace Kivii.Finances.Transforms
throw ex;
}
}
}
return rtns;
}
else//组合付款登记
{
using (KiviiContext.Profiler("组合方式收款"))
{
var paymentKvids = PayingMethods.Where(o => o.Type == PayType.Payment).ToList().ConvertAll(o => o.Kvid);
var accountKvids = PayingMethods.Where(o => o.Type == PayType.Account).ToList().ConvertAll(o => o.Kvid);
var discountKvids = PayingMethods.Where(o => o.Type == PayType.Discount).ToList().ConvertAll(o => o.Kvid);
......@@ -352,7 +357,7 @@ namespace Kivii.Finances.Transforms
subTrans.ForEach(o => o?.Rollback());
throw ex;
}
}
return rtns;
}
}
......
......@@ -62,6 +62,8 @@ namespace Kivii.Finances.Transforms
try
{
using (KiviiContext.Profiler("创建结算"))
{
foreach (var item in Items)
{
if (item.Amount != item.Details.Sum(o => o.Amount) || item.AmountPlan != item.Details.Sum(o => o.AmountPlan)) throw new Exception("项目明细总费用和结算主体总费用不一致!");
......@@ -120,7 +122,7 @@ namespace Kivii.Finances.Transforms
}
#endregion
}
}
tranE?.Commit();
tranF?.Commit();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment