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
7724a15b
Commit
7724a15b
authored
Apr 06, 2022
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
892da3d6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
19 deletions
+74
-19
Account.cs
Src/Entities/Account.cs
+14
-0
InvoiceTitle.cs
Src/Entities/InvoiceTitle.cs
+17
-0
Kivii.Biz.Finances.V2.0.csproj
Src/Kivii.Biz.Finances.V2.0.csproj
+10
-9
RestfulBill.cs
Src/Transforms/RestfulBill.cs
+5
-2
RestfulPayment.Accept.cs
Src/Transforms/RestfulPayment.Accept.cs
+24
-5
RestfulStatistic.cs
Src/Transforms/RestfulStatistic.cs
+0
-0
packages.config
Src/packages.config
+4
-3
No files found.
Src/Entities/Account.cs
View file @
7724a15b
...
...
@@ -14,6 +14,20 @@ namespace Kivii.Finances.Entities
{
#
region
账户所有人,禁止更新
[
IgnoreUpdate
]
[
DefaultEmptyGuid
]
public
Guid
BizKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"业务流水号"
)]
[
IgnoreUpdate
]
[
StringLength
(
200
)]
public
string
BizId
{
get
;
set
;
}
[
ApiMember
(
Description
=
"业务类型"
)]
[
IgnoreUpdate
]
[
StringLength
(
100
)]
public
string
BizType
{
get
;
set
;
}
[
IgnoreUpdate
]
[
DefaultEmptyGuid
,
Required
]
public
Guid
OwnerKvid
{
get
;
set
;
}
...
...
Src/Entities/InvoiceTitle.cs
View file @
7724a15b
using
Kivii.DataAnnotations
;
using
System
;
namespace
Kivii.Finances.Entities
{
...
...
@@ -6,6 +7,22 @@ namespace Kivii.Finances.Entities
[
Alias
(
Configs
.
TableNameInvoiceTitle
)]
public
class
InvoiceTitle
:
Entity
,
IEntityInAssemblyDb
{
#
region
关联信息
Biz
内部设置
[
IgnoreUpdate
]
[
DefaultEmptyGuid
]
public
Guid
BizKvid
{
get
;
set
;
}
[
ApiMember
(
Description
=
"业务流水号"
)]
[
IgnoreUpdate
]
[
StringLength
(
200
)]
public
string
BizId
{
get
;
set
;
}
[
ApiMember
(
Description
=
"业务类型"
)]
[
IgnoreUpdate
]
[
StringLength
(
100
)]
public
string
BizType
{
get
;
set
;
}
#
endregion
[
ApiMember
(
Description
=
"公司名称"
)]
[
StringLength
(
50
),
Required
,
Unique
]
public
string
CompanyName
{
get
;
set
;
}
...
...
Src/Kivii.Biz.Finances.V2.0.csproj
View file @
7724a15b
...
...
@@ -31,14 +31,14 @@
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"Kivii.Common.V4.5, Version=5.6.202
1.102
00, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\packages\Kivii.Common.5.6.202
1.102
00\lib\net45\Kivii.Common.V4.5.dll
</HintPath>
<Reference
Include=
"Kivii.Common.V4.5, Version=5.6.202
2.40
00, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\packages\Kivii.Common.5.6.202
2.40
00\lib\net45\Kivii.Common.V4.5.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Core.V4.5, Version=5.6.202
1.102
00, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\packages\Kivii.Core.5.6.202
1.102
00\lib\net45\Kivii.Core.V4.5.dll
</HintPath>
<Reference
Include=
"Kivii.Core.V4.5, Version=5.6.202
2.40
00, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\packages\Kivii.Core.5.6.202
2.40
00\lib\net45\Kivii.Core.V4.5.dll
</HintPath>
</Reference>
<Reference
Include=
"Kivii.Linq.V4.5, Version=5.6.202
1.10190
, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\packages\Kivii.Linq.5.6.202
1.10190
\lib\net45\Kivii.Linq.V4.5.dll
</HintPath>
<Reference
Include=
"Kivii.Linq.V4.5, Version=5.6.202
2.4011
, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\packages\Kivii.Linq.5.6.202
2.4011
\lib\net45\Kivii.Linq.V4.5.dll
</HintPath>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
...
...
@@ -98,9 +98,6 @@
<Compile
Include=
"Transforms\RestfulStatistic.cs"
/>
</ItemGroup>
<ItemGroup>
<None
Include=
"packages.config"
/>
</ItemGroup>
<ItemGroup>
<EmbeddedResource
Include=
"Content\codes\App.Const.Finances.js"
/>
<EmbeddedResource
Include=
"Content\codes\Classic.Control.Kivii.Finances.AccountDetail.List.js"
/>
<EmbeddedResource
Include=
"Content\codes\Classic.Control.Kivii.Finances.Bill.Form.js"
/>
...
...
@@ -212,5 +209,8 @@
<EmbeddedResource
Include=
"Content\codet\Classic.View.Kivii.Finances.Statistic.Invoice.js"
/>
<EmbeddedResource
Include=
"Content\codet\Classic.View.Kivii.Finances.Statistic.Settlement.js"
/>
</ItemGroup>
<ItemGroup>
<None
Include=
"packages.config"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
</Project>
\ No newline at end of file
Src/Transforms/RestfulBill.cs
View file @
7724a15b
...
...
@@ -127,7 +127,10 @@ namespace Kivii.Finances.Transforms
public
override
bool
OnPreRestfulDelete
(
IRequest
req
,
IResponse
res
,
IDbConnection
dbConnection
,
IRestfulDeleteResponse
<
Bill
>
rtns
)
{
dbConnection
.
Exists
<
Bill
>(
o
=>
Sql
.
In
(
o
.
Kvid
,
Kvids
)
&&
o
.
AmountPayment
==
o
.
Amount
).
ThrowIfTrue
(
"此账单已归档付款登记,无法删除"
);
//if (dbConnection is LinqConnection && (dbConnection as LinqConnection).DbTransaction == null)
//{
_trans
=
dbConnection
.
OpenTransaction
();
//}
return
base
.
OnPreRestfulDelete
(
req
,
res
,
dbConnection
,
rtns
);
}
...
...
@@ -138,11 +141,11 @@ namespace Kivii.Finances.Transforms
var
deleteBillDetails
=
dbConnection
.
From
<
BillDetail
>().
Update
(
o
=>
o
.
Status
).
Where
(
o
=>
Sql
.
In
(
o
.
BillKvid
,
Kvids
));
dbConnection
.
UpdateOnly
<
BillDetail
>(
new
BillDetail
{
Status
=
-
1
},
deleteBillDetails
);
_trans
.
Commit
();
_trans
?
.
Commit
();
}
catch
(
Exception
ex
)
{
_trans
.
Rollback
();
_trans
?
.
Rollback
();
throw
ex
;
}
return
base
.
OnPostRestfulDelete
(
req
,
res
,
dbConnection
,
rtns
);
...
...
Src/Transforms/RestfulPayment.Accept.cs
View file @
7724a15b
...
...
@@ -34,15 +34,13 @@ namespace Kivii.Finances.Transforms
var
typeCashs
=
Items
.
Where
(
o
=>
o
.
Type
==
PaymentType
.
Cash
).
ToList
();
var
typePoss
=
Items
.
Where
(
o
=>
o
.
Type
==
PaymentType
.
Pos
).
ToList
();
var
serialNumbers
=
typeBanks
.
ConvertAll
(
o
=>
o
.
SerialNumber
);
serialNumbers
.
AddRange
(
typeCashs
.
ConvertAll
(
o
=>
o
.
SerialNumber
));
serialNumbers
.
AddRange
(
typePoss
.
ConvertAll
(
o
=>
o
.
SerialNumber
));
var
serialNumbers
=
Items
.
ConvertAll
(
o
=>
o
.
SerialNumber
);
serialNumbers
.
RemoveAll
(
o
=>
o
.
IsNullOrEmpty
());
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Payment
>();
var
accountBalance
=
CurrencyUnit
.
CNY
.
GetBalanceAccount
();
var
existPayments
=
conn
.
Select
<
Payment
>(
o
=>
Sql
.
In
(
o
.
SerialNumber
,
serialNumbers
))
;
List
<
Payment
>
existPayments
=
null
;
if
(!
serialNumbers
.
IsNullOrEmpty
())
existPayments
=
conn
.
Select
<
Payment
>(
o
=>
Sql
.
In
(
o
.
SerialNumber
,
serialNumbers
));
var
allAccountDetails
=
new
List
<
AccountDetail
>();
var
allAcceptPayments
=
new
List
<
Payment
>();
var
allAcceptPays
=
new
List
<
Pay
>();
...
...
@@ -52,11 +50,18 @@ namespace Kivii.Finances.Transforms
{
foreach
(
var
item
in
typeBanks
)
{
#
region
验证是否为重复项
if
(!
existPayments
.
IsNullOrEmpty
())
{
var
exist
=
existPayments
.
FirstOrDefault
(
o
=>
o
.
SerialNumber
==
item
.
SerialNumber
);
if
(
exist
!=
null
)
continue
;
}
else
{
var
exist
=
conn
.
Single
<
Payment
>(
o
=>
o
.
PayerName
==
item
.
PayerName
&&
o
.
OperateTime
==
item
.
OperateTime
&&
o
.
Amount
==
item
.
Amount
&&
o
.
RootKvid
==
o
.
Kvid
);
if
(
exist
!=
null
)
continue
;
}
#
endregion
if
(
item
.
Amount
<=
0
)
continue
;
//Account account = null;
//if (item.PayerAccountKvid != Guid.Empty) account = accounts.FirstOrDefault(o => o.Kvid == item.PayerAccountKvid);
...
...
@@ -98,11 +103,18 @@ namespace Kivii.Finances.Transforms
if
(
cashAccount
==
null
)
throw
new
Exception
(
"未找到当前登录人的现金账户!"
);
foreach
(
var
item
in
typeCashs
)
{
#
region
验证是否为重复项
if
(!
existPayments
.
IsNullOrEmpty
())
{
var
exist
=
existPayments
.
FirstOrDefault
(
o
=>
o
.
SerialNumber
==
item
.
SerialNumber
);
if
(
exist
!=
null
)
continue
;
}
else
{
var
exist
=
conn
.
Single
<
Payment
>(
o
=>
o
.
PayerName
==
item
.
PayerName
&&
o
.
OperateTime
==
item
.
OperateTime
&&
o
.
Amount
==
item
.
Amount
&&
o
.
RootKvid
==
o
.
Kvid
);
if
(
exist
!=
null
)
continue
;
}
#
endregion
if
(
item
.
Amount
<=
0
)
continue
;
var
itemKvid
=
Guid
.
NewGuid
();
item
.
AmountInvoice
=
0
;
...
...
@@ -139,11 +151,18 @@ namespace Kivii.Finances.Transforms
if
(
posAccount
==
null
)
throw
new
Exception
(
"未找到当前登录人的刷卡账户!"
);
foreach
(
var
item
in
typePoss
)
{
#
region
验证是否为重复项
if
(!
existPayments
.
IsNullOrEmpty
())
{
var
exist
=
existPayments
.
FirstOrDefault
(
o
=>
o
.
SerialNumber
==
item
.
SerialNumber
);
if
(
exist
!=
null
)
continue
;
}
else
{
var
exist
=
conn
.
Single
<
Payment
>(
o
=>
o
.
PayerName
==
item
.
PayerName
&&
o
.
OperateTime
==
item
.
OperateTime
&&
o
.
Amount
==
item
.
Amount
&&
o
.
RootKvid
==
o
.
Kvid
);
if
(
exist
!=
null
)
continue
;
}
#
endregion
if
(
item
.
Amount
<=
0
)
continue
;
var
itemKvid
=
Guid
.
NewGuid
();
item
.
AmountInvoice
=
0
;
...
...
Src/Transforms/RestfulStatistic.cs
View file @
7724a15b
This diff is collapsed.
Click to expand it.
Src/packages.config
View file @
7724a15b
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
package
id
=
"Kivii.Common"
version
=
"5.6.202
1.102
00"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Core"
version
=
"5.6.202
1.102
00"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Linq"
version
=
"5.6.202
1.10190
"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Common"
version
=
"5.6.202
2.40
00"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Core"
version
=
"5.6.202
2.40
00"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Linq"
version
=
"5.6.202
2.4011
"
targetFramework
=
"net45"
/>
</
packages
>
\ No newline at end of file
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