Commit d2c15100 by 陶然

优化

parent a8954250
......@@ -130,6 +130,11 @@ namespace Kivii.Finances.Entities
[StringLength(100), Required]
public PaymentType Type { get; set; }
[ApiMember(Description = "分类")]
[StringLength(200), Default("")]
public string Category { get; set; }
[ApiMember(Description = "发生金额")]
[InternalSetter]
[DecimalLength(15, 2), Default(0)]
......
......@@ -649,7 +649,7 @@ namespace Kivii.Finances
/// <param name="ownerKvid"></param>
/// <param name="ownerName"></param>
/// <returns></returns>
public static Payment BizSplit(this Payment payment, decimal amountSplit, string remark = null, Guid? ownerKvid = null, string ownerName = null, IDbConnection conn = null)
public static Payment BizSplit(this Payment payment, decimal amountSplit, string remark = null, Guid? ownerKvid = null, string ownerName = null, IDbConnection conn = null, string category = null)
{
payment.ThrowIfNull($"传入payment参数为空");
if (payment.Type != PaymentType.Bank) throw new Exception("非银行到账不可以认领!");
......@@ -694,6 +694,7 @@ namespace Kivii.Finances
splitPayment.BizType = string.Empty;
splitPayment.SerialNumber = payment.GetSubSerialNumber();
splitPayment.Type = PaymentType.Split;
splitPayment.Category = category;
//金额设置
splitPayment.AuditorName = splitPayment.OperateTime.Year.ToString();
splitPayment.Amount = amountSplit;
......
......@@ -33,6 +33,8 @@ namespace Kivii.Finances.Transforms
public Guid Kvid { get; set; }
public string Category { get; set; }
public string Remark { get; set; }
public override object OnExecution(IRequest req, IResponse res)
......@@ -87,7 +89,7 @@ namespace Kivii.Finances.Transforms
if (amountSplit + Amount > payment.Amount) throw new Exception("认领金额超出范围!");
bank = payment;
split = bank.BizSplit(Amount, Remark, ownerKvid, ownerName, conn);
split = bank.BizSplit(Amount, Remark, ownerKvid, ownerName, conn, Category);
#region 记录日志
log = new EntityLog<Payment>();
......@@ -173,6 +175,8 @@ namespace Kivii.Finances.Transforms
public List<Guid> Kvids { get; set; }
public string Category { get; set; }
public string Remark { get; set; }
public override object OnExecution(IRequest req, IResponse res)
{
......@@ -240,7 +244,7 @@ namespace Kivii.Finances.Transforms
{
var amount = payment.Amount - payment.AmountSplited;
if (amount <= 0) continue;
var splitPayment = payment.BizSplit(amount, Remark, ownerKvid, ownerName, conn);
var splitPayment = payment.BizSplit(amount, Remark, ownerKvid, ownerName, conn, Category);
splits.Add(splitPayment);
banks.Add(payment);
......
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