Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Biz.Finances.V2.0
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶然
Kivii.Biz.Finances.V2.0
Commits
d2c15100
Commit
d2c15100
authored
Nov 08, 2023
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
a8954250
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
Payment.cs
Src/Entities/Payment.cs
+5
-0
PaymentExtension.cs
Src/Extensions/PaymentExtension.cs
+2
-1
RestfulPayment.Split.cs
Src/Transforms/RestfulPayment.Split.cs
+6
-2
No files found.
Src/Entities/Payment.cs
View file @
d2c15100
...
@@ -130,6 +130,11 @@ namespace Kivii.Finances.Entities
...
@@ -130,6 +130,11 @@ namespace Kivii.Finances.Entities
[
StringLength
(
100
),
Required
]
[
StringLength
(
100
),
Required
]
public
PaymentType
Type
{
get
;
set
;
}
public
PaymentType
Type
{
get
;
set
;
}
[
ApiMember
(
Description
=
"分类"
)]
[
StringLength
(
200
),
Default
(
""
)]
public
string
Category
{
get
;
set
;
}
[
ApiMember
(
Description
=
"发生金额"
)]
[
ApiMember
(
Description
=
"发生金额"
)]
[
InternalSetter
]
[
InternalSetter
]
[
DecimalLength
(
15
,
2
),
Default
(
0
)]
[
DecimalLength
(
15
,
2
),
Default
(
0
)]
...
...
Src/Extensions/PaymentExtension.cs
View file @
d2c15100
...
@@ -649,7 +649,7 @@ namespace Kivii.Finances
...
@@ -649,7 +649,7 @@ namespace Kivii.Finances
/// <param name="ownerKvid"></param>
/// <param name="ownerKvid"></param>
/// <param name="ownerName"></param>
/// <param name="ownerName"></param>
/// <returns></returns>
/// <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参数为空"
);
payment
.
ThrowIfNull
(
$"传入payment参数为空"
);
if
(
payment
.
Type
!=
PaymentType
.
Bank
)
throw
new
Exception
(
"非银行到账不可以认领!"
);
if
(
payment
.
Type
!=
PaymentType
.
Bank
)
throw
new
Exception
(
"非银行到账不可以认领!"
);
...
@@ -694,6 +694,7 @@ namespace Kivii.Finances
...
@@ -694,6 +694,7 @@ namespace Kivii.Finances
splitPayment
.
BizType
=
string
.
Empty
;
splitPayment
.
BizType
=
string
.
Empty
;
splitPayment
.
SerialNumber
=
payment
.
GetSubSerialNumber
();
splitPayment
.
SerialNumber
=
payment
.
GetSubSerialNumber
();
splitPayment
.
Type
=
PaymentType
.
Split
;
splitPayment
.
Type
=
PaymentType
.
Split
;
splitPayment
.
Category
=
category
;
//金额设置
//金额设置
splitPayment
.
AuditorName
=
splitPayment
.
OperateTime
.
Year
.
ToString
();
splitPayment
.
AuditorName
=
splitPayment
.
OperateTime
.
Year
.
ToString
();
splitPayment
.
Amount
=
amountSplit
;
splitPayment
.
Amount
=
amountSplit
;
...
...
Src/Transforms/RestfulPayment.Split.cs
View file @
d2c15100
...
@@ -33,6 +33,8 @@ namespace Kivii.Finances.Transforms
...
@@ -33,6 +33,8 @@ namespace Kivii.Finances.Transforms
public
Guid
Kvid
{
get
;
set
;
}
public
Guid
Kvid
{
get
;
set
;
}
public
string
Category
{
get
;
set
;
}
public
string
Remark
{
get
;
set
;
}
public
string
Remark
{
get
;
set
;
}
public
override
object
OnExecution
(
IRequest
req
,
IResponse
res
)
public
override
object
OnExecution
(
IRequest
req
,
IResponse
res
)
...
@@ -87,7 +89,7 @@ namespace Kivii.Finances.Transforms
...
@@ -87,7 +89,7 @@ namespace Kivii.Finances.Transforms
if
(
amountSplit
+
Amount
>
payment
.
Amount
)
throw
new
Exception
(
"认领金额超出范围!"
);
if
(
amountSplit
+
Amount
>
payment
.
Amount
)
throw
new
Exception
(
"认领金额超出范围!"
);
bank
=
payment
;
bank
=
payment
;
split
=
bank
.
BizSplit
(
Amount
,
Remark
,
ownerKvid
,
ownerName
,
conn
);
split
=
bank
.
BizSplit
(
Amount
,
Remark
,
ownerKvid
,
ownerName
,
conn
,
Category
);
#
region
记录日志
#
region
记录日志
log
=
new
EntityLog
<
Payment
>();
log
=
new
EntityLog
<
Payment
>();
...
@@ -173,6 +175,8 @@ namespace Kivii.Finances.Transforms
...
@@ -173,6 +175,8 @@ namespace Kivii.Finances.Transforms
public
List
<
Guid
>
Kvids
{
get
;
set
;
}
public
List
<
Guid
>
Kvids
{
get
;
set
;
}
public
string
Category
{
get
;
set
;
}
public
string
Remark
{
get
;
set
;
}
public
string
Remark
{
get
;
set
;
}
public
override
object
OnExecution
(
IRequest
req
,
IResponse
res
)
public
override
object
OnExecution
(
IRequest
req
,
IResponse
res
)
{
{
...
@@ -240,7 +244,7 @@ namespace Kivii.Finances.Transforms
...
@@ -240,7 +244,7 @@ namespace Kivii.Finances.Transforms
{
{
var
amount
=
payment
.
Amount
-
payment
.
AmountSplited
;
var
amount
=
payment
.
Amount
-
payment
.
AmountSplited
;
if
(
amount
<=
0
)
continue
;
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
);
splits
.
Add
(
splitPayment
);
banks
.
Add
(
payment
);
banks
.
Add
(
payment
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment