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
b6ebcc10
Commit
b6ebcc10
authored
Mar 16, 2023
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
79bd88b3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
11 deletions
+83
-11
Kivii.Biz.Finances.V2.0.csproj
Src/Kivii.Biz.Finances.V2.0.csproj
+10
-7
Kivii.Biz.Finances.V2.0.csproj.user
Src/Kivii.Biz.Finances.V2.0.csproj.user
+2
-1
RestfulStatistic.cs
Src/Transforms/Statistics/RestfulStatistic.cs
+67
-0
packages.config
Src/packages.config
+4
-3
No files found.
Src/Kivii.Biz.Finances.V2.0.csproj
View file @
b6ebcc10
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<DebugSymbols>
true
</DebugSymbols>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<Optimize>
false
</Optimize>
<OutputPath>
..\..\..\
..\njzj.k5
\appextend\
</OutputPath>
<OutputPath>
..\..\..\
k5-njzj
\appextend\
</OutputPath>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
<WarningLevel>
4
</WarningLevel>
...
@@ -31,14 +31,17 @@
...
@@ -31,14 +31,17 @@
<WarningLevel>
4
</WarningLevel>
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference
Include=
"Kivii.Common.V4.5, Version=5.6.2022.12000, Culture=neutral, processorArchitecture=MSIL"
>
<Reference
Include=
"Kivii.Common.V4.5, Version=5.6.2023.2220, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\..\..\njzj.k5\packages\Kivii.Common.5.6.2022.12000\lib\net45\Kivii.Common.V4.5.dll
</HintPath>
<HintPath>
..\..\..\k5-njzj\packages\Kivii.Common.5.6.2023.2220\lib\net45\Kivii.Common.V4.5.dll
</HintPath>
<Private>
False
</Private>
</Reference>
</Reference>
<Reference
Include=
"Kivii.Core.V4.5, Version=5.6.2022.12000, Culture=neutral, processorArchitecture=MSIL"
>
<Reference
Include=
"Kivii.Core.V4.5, Version=5.6.2023.1310, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\..\..\njzj.k5\packages\Kivii.Core.5.6.2022.12000\lib\net45\Kivii.Core.V4.5.dll
</HintPath>
<HintPath>
..\..\..\k5-njzj\packages\Kivii.Core.5.6.2023.1310\lib\net45\Kivii.Core.V4.5.dll
</HintPath>
<Private>
False
</Private>
</Reference>
</Reference>
<Reference
Include=
"Kivii.Linq.V4.5, Version=5.6.2022.12180, Culture=neutral, processorArchitecture=MSIL"
>
<Reference
Include=
"Kivii.Linq.V4.5, Version=5.6.2022.12200, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\..\..\..\njzj.k5\packages\Kivii.Linq.5.6.2022.12180\lib\net45\Kivii.Linq.V4.5.dll
</HintPath>
<HintPath>
..\..\..\k5-njzj\packages\Kivii.Linq.5.6.2022.12200\lib\net45\Kivii.Linq.V4.5.dll
</HintPath>
<Private>
False
</Private>
</Reference>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Core"
/>
...
...
Src/Kivii.Biz.Finances.V2.0.csproj.user
View file @
b6ebcc10
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
</PropertyGroup>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"
>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"
>
<StartAction>
Program
</StartAction>
<StartAction>
Program
</StartAction>
<StartProgram>
D:\
njzj.k5
\Startup.exe
</StartProgram>
<StartProgram>
D:\
git.kivii.org\k5-njzj
\Startup.exe
</StartProgram>
<StartArguments>
-debug
</StartArguments>
<StartArguments>
-debug
</StartArguments>
</PropertyGroup>
</PropertyGroup>
</Project>
</Project>
\ No newline at end of file
Src/Transforms/Statistics/RestfulStatistic.cs
View file @
b6ebcc10
...
@@ -520,6 +520,73 @@ namespace Kivii.Finances.Transforms
...
@@ -520,6 +520,73 @@ namespace Kivii.Finances.Transforms
}
}
}
}
[
Api
(
Description
=
"到账划转分析"
)]
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
public
class
PaymentAssignAnalysis
:
RestfulExecution
<
Payment
>
{
public
Guid
OwnerKvid
{
get
;
set
;
}
public
List
<
Guid
>
OwnerKvids
{
get
;
set
;
}
public
DateTime
BeginTime
{
get
;
set
;
}
public
DateTime
EndTime
{
get
;
set
;
}
public
override
object
OnExecution
(
IRequest
req
,
IResponse
res
)
{
if
(
OwnerKvids
.
IsNullOrEmpty
())
OwnerKvids
=
new
List
<
Guid
>();
if
(
OwnerKvid
!=
Guid
.
Empty
)
OwnerKvids
.
Add
(
OwnerKvid
);
int
monthDay
=
DateTime
.
DaysInMonth
(
DateTime
.
Now
.
Year
,
DateTime
.
Now
.
Month
);
if
(
BeginTime
==
DateTime
.
MinValue
)
BeginTime
=
new
DateTime
(
DateTime
.
Now
.
Year
,
DateTime
.
Now
.
Month
,
1
);
if
(
EndTime
==
DateTime
.
MinValue
)
EndTime
=
new
DateTime
(
DateTime
.
Now
.
Year
,
DateTime
.
Now
.
Month
,
monthDay
);
BeginTime
=
DateTime
.
Parse
(
BeginTime
.
ToString
(
"yyyy-MM-dd"
));
EndTime
=
DateTime
.
Parse
(
EndTime
.
ToString
(
"yyyy-MM-dd"
));
if
(
EndTime
<
BeginTime
)
throw
new
Exception
(
"查询结束日期不可小于开始日期!"
);
var
rtns
=
new
StatisticResponse
<
Analysis
>();
rtns
.
Results
=
new
List
<
Analysis
>();
rtns
.
BeginTime
=
BeginTime
;
rtns
.
EndTime
=
EndTime
;
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Payment
>();
var
queryAccount
=
conn
.
From
<
Account
>();
queryAccount
.
Where
(
o
=>
o
.
OrganizationKvid
==
KiviiContext
.
CurrentMember
.
OrganizationKvid
&&
Sql
.
In
(
o
.
Type
,
AccountType
.
Balance
,
AccountType
.
Cash
,
AccountType
.
Pos
));
queryAccount
.
Select
(
o
=>
o
.
Kvid
);
//当前部门已经认领且被划转的流水Kvid
var
querySplits
=
conn
.
From
<
Payment
>();
querySplits
.
Where
(
o
=>
o
.
OffsetKvid
==
Guid
.
Empty
&&
o
.
Type
==
PaymentType
.
Split
&&
o
.
AmountSplited
>
0
);
querySplits
.
And
(
o
=>
o
.
OperateTime
>=
BeginTime
&&
o
.
OperateTime
<
EndTime
);
if
(!
OwnerKvids
.
IsNullOrEmpty
())
querySplits
.
And
(
o
=>
Sql
.
In
(
o
.
OwnerKvid
,
OwnerKvids
));
querySplits
.
And
(
o
=>
(
Sql
.
In
(
o
.
PayerAccountKvid
,
queryAccount
)));
querySplits
.
Select
(
o
=>
o
.
Kvid
);
var
sqlExpress
=
conn
.
From
<
Payment
>();
sqlExpress
.
Where
(
o
=>
o
.
OffsetKvid
==
Guid
.
Empty
&&
o
.
Type
==
PaymentType
.
Assign
);
sqlExpress
.
And
(
o
=>
o
.
OperateTime
>=
BeginTime
&&
o
.
OperateTime
<
EndTime
);
sqlExpress
.
And
(
o
=>
(
Sql
.
In
(
o
.
ParentKvid
,
querySplits
)
||
Sql
.
In
(
o
.
OwnerKvid
,
OwnerKvids
)));
sqlExpress
.
OrderBy
(
o
=>
o
.
OwnerName
);
sqlExpress
.
Select
(
o
=>
new
{
o
.
OwnerKvid
,
o
.
OwnerName
,
o
.
Amount
,
o
.
AmountInvoice
,
o
.
AmountUsed
,
o
.
OperateTime
,
o
.
CreateTime
,
o
.
Type
,
o
.
Kvid
});
sqlExpress
.
GroupBy
(
o
=>
o
.
OwnerName
);
sqlExpress
.
Select
(
o
=>
new
{
Summary
=
o
.
OwnerName
,
Amount
=
Sql
.
Sum
(
o
.
Amount
),
Quantity
=
Sql
.
Count
(
o
.
Kvid
),
AmountInvoice
=
Sql
.
Sum
(
o
.
AmountInvoice
),
QuantityInvoice
=
Sql
.
Sum
(
o
.
AmountInvoice
==
o
.
Amount
?
1
:
0
),
AmountUsed
=
Sql
.
Sum
(
o
.
AmountUsed
),
QuantityUsed
=
Sql
.
Sum
(
o
.
AmountUsed
==
o
.
Amount
?
1
:
0
),
AmountSplit
=
Sql
.
Sum
(
o
.
Amount
),
QuantitySplit
=
Sql
.
Count
(
o
.
Kvid
)
});
rtns
.
Results
=
conn
.
Select
<
Analysis
>(
sqlExpress
);
rtns
.
Total
=
rtns
.
Results
.
Count
;
return
rtns
;
}
}
//[Api(Description = "结算分析")]
//[Api(Description = "结算分析")]
//[RequiresAnyRole(SystemRoles.Everyone)]
//[RequiresAnyRole(SystemRoles.Everyone)]
//public class SettlementPayedAnalysis : RestfulExecution<Settlement>
//public class SettlementPayedAnalysis : RestfulExecution<Settlement>
...
...
Src/packages.config
View file @
b6ebcc10
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
packages
>
<
package
id
=
"Kivii.Common"
version
=
"5.6.202
2.1200
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Common"
version
=
"5.6.202
3.222
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Core"
version
=
"5.6.202
2.1200
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Core"
version
=
"5.6.202
3.131
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Linq"
version
=
"5.6.2022.12
18
0"
targetFramework
=
"net45"
/>
<
package
id
=
"Kivii.Linq"
version
=
"5.6.2022.12
20
0"
targetFramework
=
"net45"
/>
</
packages
>
</
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