Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
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
bltdc
DataCenter_Core2.1_20190520
Commits
b86daa53
Commit
b86daa53
authored
Jul 15, 2021
by
GhostUI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
797fa862
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
120 additions
and
10 deletions
+120
-10
FinanceDto.cs
Bailun.DC.Models/Dtos/Finance/FinanceDto.cs
+21
-0
FinanceService.cs
Bailun.DC.Services/WebApiService/FinanceService.cs
+96
-7
FinanceController.cs
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
+1
-1
FinanceController.cs
Bailun.DC.WebApi/Controllers/FinanceController.cs
+2
-2
No files found.
Bailun.DC.Models/Dtos/Finance/FinanceDto.cs
0 → 100644
View file @
b86daa53
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.Models.Dtos.Finance
{
public
class
FinanceDto
{
//public List<dc_base_finance_fee> Finance { get; set; }
public
List
<
columnsObj
>
Col
{
get
;
set
;
}
=
new
List
<
columnsObj
>();
public
string
Data
{
get
;
set
;
}
}
public
class
columnsObj
{
public
string
title
{
get
;
set
;
}
public
string
key
{
get
;
set
;
}
public
bool
show
{
get
;
set
;
}
=
true
;
public
string
width
{
get
;
set
;
}
=
"120"
;
}
}
Bailun.DC.Services/WebApiService/FinanceService.cs
View file @
b86daa53
...
...
@@ -5,6 +5,7 @@ using Bailun.DC.Models.Common;
using
Bailun.DC.Models.Common.Page
;
using
Bailun.DC.Models.Dtos.Finance
;
using
Dapper
;
using
Newtonsoft.Json
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -16,10 +17,11 @@ namespace Bailun.DC.Services.WebApiService
{
public
partial
class
FinanceService
{
public
async
Task
<
CommonApiResponseDto
<
List
<
dc_base_finance_fee
>>
>
GetCashFlowStatement
(
GetCashFlowStatementInput
input
)
public
CommonApiResponseDto
<
FinanceDto
>
GetCashFlowStatement
(
GetCashFlowStatementInput
input
)
{
try
{
var
dtos
=
new
FinanceDto
();
var
sql
=
$@"select * from dc_base_finance_fee s1
left JOIN dc_base_finance_company s2
ON s1.company_name = s2.company_name
...
...
@@ -33,23 +35,110 @@ and s2.company_type = @CorporateEntity";
para
.
Add
(
"PaymentTimeEnd"
,
input
.
PaymentTimeEnd
.
Date
);
para
.
Add
(
"CorporateEntity"
,
input
.
CorporateEntity
);
var
data
=
SimpleCRUD
.
Query
<
dc_base_finance_fee
>(
sql
,
para
,
GlobalConfig
.
ConnectionString
).
ToList
();
foreach
(
var
item
in
data
)
{
if
(
item
.
cost_form
==
2
)
{
item
.
amount
=
-(
item
.
amount
);
item
.
amount_rmb
=
-(
item
.
amount_rmb
);
}
//借支单待还余额
if
(
item
.
cost_form
==
3
)
{
if
(
item
.
is_lend
.
HasValue
&&
item
.
is_lend
.
Value
==
2
&&
((
item
.
lend_balance
??
0
)
>
0
))
//归还金额
{
item
.
amount
=
-(
item
.
amount
);
item
.
amount_rmb
=
-(
item
.
amount_rmb
);
}
}
}
if
(
data
.
Count
>
0
)
{
var
url
=
ConfigHelper
.
AppSetting
(
"cwUrl"
);
url
+=
$"?BeginRepayTime=
{
input
.
PaymentTimeStart
.
ToString
(
"yyyy-MM-dd"
)}
&EndRepayTime=
{
input
.
PaymentTimeEnd
.
ToString
(
"yyyy-MM-dd"
)}
"
;
var
listInterest
=
new
FinanceReportServices
().
ListInterestExpense
(
url
);
//手续费
var
listHandleFee
=
new
FinanceReportServices
().
ListFinanceHandleFee
(
input
.
PaymentTimeStart
,
input
.
PaymentTimeEnd
,
null
,
""
);
//利息支出
var
Col
=
data
.
GroupBy
(
a
=>
a
.
company_name
).
Select
(
p
=>
p
.
Key
).
OrderBy
(
a
=>
a
).
ToList
();
var
listValue
=
new
List
<
Tuple
<
string
,
List
<
decimal
>>>();
for
(
var
i
=
0
;
i
<
Col
.
Count
;
i
++)
{
//主体下所有费用单
var
feedata
=
data
.
Where
(
x
=>
x
.
company_name
==
Col
[
i
]).
ToList
();
foreach
(
var
item
in
feedata
)
{
var
obj
=
listValue
.
Where
(
a
=>
a
.
Item1
==
item
.
type_name
).
FirstOrDefault
();
if
(
obj
==
null
)
{
var
listItems
=
new
List
<
decimal
>();
while
(
listItems
.
Count
<
Col
.
Count
)
//所有主体都添加上
{
listItems
.
Add
(
0.00
M
);
}
listItems
[
i
]
=
item
.
amount_rmb
??
0
;
//当前主体赋值
listValue
.
Add
(
new
Tuple
<
string
,
List
<
decimal
>>(
item
.
type_name
,
listItems
));
}
else
{
obj
.
Item2
[
i
]
+=
item
.
amount_rmb
??
0
;
}
}
}
dtos
.
Col
.
Add
(
new
columnsObj
{
key
=
"key"
,
title
=
"费用类型"
});
for
(
int
j
=
0
;
j
<
Col
.
Count
;
j
++)
{
var
keyInfo
=
new
columnsObj
{
key
=
"key"
+
j
,
title
=
Col
[
j
]
};
dtos
.
Col
.
Add
(
keyInfo
);
}
var
jsonStr
=
"["
;
for
(
int
i
=
0
;
i
<
listValue
.
Count
;
i
++)
{
jsonStr
+=
"{"
;
jsonStr
+=
"\"key\":\""
+
listValue
[
i
].
Item1
+
"\","
;
for
(
int
j
=
1
;
j
<
listValue
[
i
].
Item2
.
Count
;
j
++)
{
jsonStr
+=
"\""
+
dtos
.
Col
[
j
].
key
+
"\":\""
+
listValue
[
i
].
Item2
[
j
]
+
"\","
;
}
jsonStr
=
jsonStr
.
Trim
(
','
);
jsonStr
+=
"},"
;
}
jsonStr
=
jsonStr
.
Trim
(
','
);
jsonStr
+=
"]"
;
//if (listInterest.Count > 0)
//{
//}
//if (listHandleFee.Count > 0)
//{
var
url
=
ConfigHelper
.
AppSetting
(
"cwUrl"
);
return
new
CommonApiResponseDto
<
List
<
dc_base_finance_fee
>>
//}
dtos
.
Data
=
jsonStr
;
}
return
new
CommonApiResponseDto
<
FinanceDto
>
{
Data
=
d
ata
Data
=
d
tos
};
}
catch
(
Exception
e
)
{
return
new
CommonApiResponseDto
<
List
<
dc_base_finance_fee
>
>
{
IsSuccess
=
false
,
Message
=
e
.
Message
};
return
new
CommonApiResponseDto
<
FinanceDto
>
{
IsSuccess
=
false
,
Message
=
e
.
Message
};
}
}
private
async
Task
<
List
<
Models
.
Api
.
mInterestExpense
>
>
GetMInterestExpense
(
string
url
)
private
List
<
Models
.
Api
.
mInterestExpense
>
GetMInterestExpense
(
string
url
)
{
using
(
var
http
=
new
HttpClient
())
{
var
result
=
await
http
.
GetStringAsync
(
url
);
var
result
=
http
.
GetStringAsync
(
url
).
GetAwaiter
().
GetResult
(
);
var
obj
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
List
<
Models
.
Api
.
mInterestExpense
>>(
result
);
return
obj
;
};
...
...
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
View file @
b86daa53
...
...
@@ -1374,7 +1374,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="PayName"></param>
/// <param name="ismanager">是否管理成本</param>
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
//
[BailunAuthentication(LoginMode.Enforce)]
[
HttpPost
]
[
BrowseLog
(
"Bailun_data"
,
"访问【百伦数据中心】->【财务报表】->【管理成本报表】->【查询】页面"
,
0
)]
public
JsonResult
AdministrativeCostJson
(
int
t
,
DateTime
start
,
DateTime
end
,
int
?
paycompanyid
,
int
?
ismanager
)
...
...
Bailun.DC.WebApi/Controllers/FinanceController.cs
View file @
b86daa53
...
...
@@ -40,7 +40,7 @@ namespace Bailun.DC.WebApi.Controllers
/// <param name="input"></param>
/// <returns></returns>
[
HttpPost
(
"getCashFlowStatement"
)]
public
async
Task
<
CommonApiResponseDto
<
List
<
dc_base_finance_fee
>>
>
GetCashFlowStatement
(
GetCashFlowStatementInput
input
)
=>
await
new
FinanceService
().
GetCashFlowStatement
(
input
);
public
CommonApiResponseDto
<
FinanceDto
>
GetCashFlowStatement
(
GetCashFlowStatementInput
input
)
=>
new
FinanceService
().
GetCashFlowStatement
(
input
);
}
}
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