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
01ac2a14
Commit
01ac2a14
authored
Apr 04, 2019
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决管理成本报表无法按付款主体查看明细的问题
parent
1b981a22
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
447 additions
and
10 deletions
+447
-10
mInterestExpense.cs
Bailun.DC.Models/Api/mInterestExpense.cs
+58
-0
FinanceReportServices.cs
Bailun.DC.Services/FinanceReportServices.cs
+42
-0
FinanceController.cs
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
+242
-1
AdministrativeCost.cshtml
...Web/Areas/Reports/Views/Finance/AdministrativeCost.cshtml
+18
-8
ListInterestExpense.cshtml
...eb/Areas/Reports/Views/Finance/ListInterestExpense.cshtml
+85
-0
appsettings.json
Bailun.DC.Web/appsettings.json
+2
-1
No files found.
Bailun.DC.Models/Api/mInterestExpense.cs
0 → 100644
View file @
01ac2a14
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.Models.Api
{
/// <summary>
/// 利息支出
/// </summary>
public
class
mInterestExpense
{
/// <summary>
/// 借入公司主体value
/// </summary>
public
int
CompanyVal
{
get
;
set
;
}
/// <summary>
/// 借入公司主体名称
/// </summary>
public
string
Company
{
get
;
set
;
}
/// <summary>
/// 借款帐号
/// </summary>
public
string
BankCard
{
get
;
set
;
}
/// <summary>
/// 借款银行名称
/// </summary>
public
string
BankCardUser
{
get
;
set
;
}
/// <summary>
/// 借款银行持卡人
/// </summary>
public
string
BankName
{
get
;
set
;
}
/// <summary>
/// 债权方
/// </summary>
public
string
Creditor
{
get
;
set
;
}
/// <summary>
/// 本期归还利息
/// </summary>
public
decimal
RepayInterest
{
get
;
set
;
}
/// <summary>
/// 本期归还利息RMB
/// </summary>
public
decimal
RepayInterestRMB
{
get
;
set
;
}
/// <summary>
/// 实际还款时间
/// </summary>
public
DateTime
?
ActualRepayTime
{
get
;
set
;
}
}
}
Bailun.DC.Services/FinanceReportServices.cs
View file @
01ac2a14
...
...
@@ -224,6 +224,29 @@ namespace Bailun.DC.Services
return
list
;
}
/// <summary>
/// 管理成本--利息支出
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public
List
<
Models
.
Api
.
mInterestExpense
>
ListInterestExpense
(
string
url
)
{
var
list
=
new
List
<
Models
.
Api
.
mInterestExpense
>();
var
result
=
Common
.
HttpHelper
.
NetHelper
.
Request
(
url
);
if
(!
string
.
IsNullOrEmpty
(
result
))
{
var
obj
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
List
<
Models
.
Api
.
mInterestExpense
>>(
result
);
if
(
obj
.
Count
>
0
)
{
list
=
obj
;
}
}
return
list
;
}
#
endregion
#
region
平台余额
...
...
@@ -1144,6 +1167,25 @@ namespace Bailun.DC.Services
}
}
/// <summary>
/// 获取付款主体
/// </summary>
/// <param name="name">付款主体名称</param>
/// <returns></returns>
public
dc_company_main_body
GetPayCompanyByName
(
string
name
)
{
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString
))
{
if
(
cn
.
State
==
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
var
m
=
cn
.
QueryFirstOrDefault
<
dc_company_main_body
>(
"select * from dc_company_main_body where company_name = '"
+
name
+
"'"
);
return
m
;
}
}
#
endregion
#
region
每日平台销售额(小平台)
...
...
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
View file @
01ac2a14
...
...
@@ -210,14 +210,21 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
public
JsonResult
AdministrativeCostJson
(
int
t
,
DateTime
start
,
DateTime
end
,
int
?
paycompanyid
)
{
var
url
=
ConfigHelper
.
GetByName
(
"FeeUrl"
)+
"?o=0"
;
var
cwurl
=
ConfigHelper
.
GetByName
(
"cwUrl"
)
+
"?"
;
url
+=
"&startDate="
+
start
.
ToString
(
"yyyy-MM-dd"
)
+
"&endDate="
+
end
.
ToString
(
"yyyy-MM-dd"
);
cwurl
+=
"BeginRepayTime="
+
start
.
ToString
(
"yyyy-MM-dd"
)+
"&EndRepayTime="
+
end
.
ToString
(
"yyyy-MM-dd"
);
if
(
paycompanyid
.
HasValue
)
{
url
+=
"&companyValue="
+
paycompanyid
.
Value
;
cwurl
+=
"&CompanyVal="
+
paycompanyid
.
Value
;
}
//利息支出
var
listInterest
=
new
Services
.
FinanceReportServices
().
ListInterestExpense
(
cwurl
);
var
list
=
new
Services
.
FinanceReportServices
().
ListOtherCost
(
url
);
var
listValue
=
new
List
<
Tuple
<
string
,
List
<
decimal
>>>();
var
listCol
=
new
List
<
string
>();
...
...
@@ -290,6 +297,142 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var
listCount
=
new
List
<
decimal
>();
if
(
listInterest
.
Count
>
0
)
{
var
obj
=
listValue
.
Where
(
a
=>
a
.
Item1
==
"利息支出"
).
FirstOrDefault
();
var
index_Interest
=
-
1
;
if
(
t
==
2
)
//按付款主体
{
var
clothindex
=
-
1
;
for
(
var
i
=
0
;
i
<
listCol
.
Count
;
i
++)
{
if
(
listCol
[
i
]
==
"广州电子服装仓"
)
{
clothindex
=
i
;
}
if
(
listCol
[
i
]
==
"广州百伦供应链科技有限公司"
)
{
index_Interest
=
i
;
}
}
//广州电子服装仓
var
clothVal
=
0.00
M
;
var
objCloth
=
listInterest
.
Where
(
a
=>
a
.
CompanyVal
!=
1
);
if
(
objCloth
.
Count
()
>
0
)
{
clothVal
=
objCloth
.
Sum
(
a
=>
a
.
RepayInterestRMB
);
}
//广州百伦
var
gzblVal
=
0.00
M
;
var
objGZBL
=
listInterest
.
Where
(
a
=>
a
.
CompanyVal
==
1
);
if
(
objGZBL
.
Count
()
>
0
)
{
gzblVal
=
objGZBL
.
Sum
(
a
=>
a
.
RepayInterestRMB
);
}
if
(
clothVal
>
0
&&
clothindex
==
-
1
)
{
listCol
.
Add
(
"广州电子服装仓"
);
clothindex
=
listCol
.
Count
-
1
;
foreach
(
var
item
in
listValue
)
{
item
.
Item2
.
Add
(
0
);
}
}
if
(
gzblVal
>
0
&&
index_Interest
==-
1
)
{
listCol
.
Add
(
"广州百伦供应链科技有限公司"
);
index_Interest
=
listCol
.
Count
-
1
;
foreach
(
var
item
in
listValue
)
{
item
.
Item2
.
Add
(
0
);
}
}
if
(
obj
==
null
)
{
var
_list
=
new
List
<
decimal
>();
for
(
var
j
=
0
;
j
<
listCol
.
Count
;
j
++)
{
if
(
j
==
clothindex
)
{
_list
.
Add
(
clothVal
);
}
else
if
(
j
==
index_Interest
)
{
_list
.
Add
(
gzblVal
);
}
else
{
_list
.
Add
(
0
);
}
}
listValue
.
Add
(
new
Tuple
<
string
,
List
<
decimal
>>(
"利息支出"
,
_list
));
}
else
{
obj
.
Item2
[
clothindex
]
=
clothVal
;
obj
.
Item2
[
index_Interest
]
=
gzblVal
;
}
}
else
//按部门
{
for
(
var
i
=
0
;
i
<
listCol
.
Count
;
i
++)
{
if
(
listCol
[
i
]
==
"财务部"
)
{
index_Interest
=
i
;
}
}
var
val
=
listInterest
.
Sum
(
a
=>
a
.
RepayInterestRMB
);
if
(
index_Interest
==
-
1
&&
val
>
0
)
{
listCol
.
Add
(
"财务部"
);
index_Interest
=
listCol
.
Count
-
1
;
foreach
(
var
item
in
listValue
)
{
item
.
Item2
.
Add
(
0
);
}
}
if
(
obj
==
null
)
{
var
_list
=
new
List
<
decimal
>();
for
(
var
j
=
0
;
j
<
listCol
.
Count
;
j
++)
{
if
(
j
==
index_Interest
)
{
_list
.
Add
(
val
);
}
else
{
_list
.
Add
(
0
);
}
}
listValue
.
Add
(
new
Tuple
<
string
,
List
<
decimal
>>(
"利息支出"
,
_list
));
}
else
{
obj
.
Item2
[
index_Interest
]
=
val
;
}
}
}
foreach
(
var
item
in
listValue
)
{
for
(
var
i
=
0
;
i
<
item
.
Item2
.
Count
;
i
++)
...
...
@@ -447,7 +590,15 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
else
{
url
+=
"&companyValue="
+
headname
;
var
val
=
-
1
;
var
objPayCompany
=
new
Services
.
FinanceReportServices
().
GetPayCompanyByName
(
headname
);
if
(
objPayCompany
!=
null
)
{
val
=
objPayCompany
.
company_value
;
}
url
+=
"&companyValue="
+
val
;
}
}
...
...
@@ -502,6 +653,96 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
return
JsonConvert
.
SerializeObject
(
new
{
total
=
list
.
Count
,
rows
=
list
});
}
public
ActionResult
ListInterestExpense
(
DateTime
start
,
DateTime
end
,
int
?
paycompanyid
,
string
headname
,
string
categoryname
,
int
type
,
int
issub
)
{
ViewBag
.
start
=
start
;
ViewBag
.
end
=
end
;
ViewBag
.
paycompanyid
=
paycompanyid
??
-
1
;
ViewBag
.
headname
=
headname
;
ViewBag
.
categoryname
=
categoryname
;
ViewBag
.
type
=
type
;
ViewBag
.
isSub
=
issub
;
return
View
();
}
/// <summary>
/// 获取利息支出明细列表
/// </summary>
/// <param name="start"></param>
/// <param name="end"></param>
/// <param name="paycompanyid"></param>
/// <param name="headname"></param>
/// <param name="type"></param>
/// <returns></returns>
public
string
ListInterestExpenseJson
(
DateTime
start
,
DateTime
end
,
int
?
paycompanyid
,
string
headname
,
int
type
)
{
var
cwurl
=
ConfigHelper
.
GetByName
(
"cwUrl"
)
+
"?BeginRepayTime="
+
start
.
ToString
(
"yyyy-MM-dd"
)
+
"&EndRepayTime="
+
end
.
ToString
(
"yyyy-MM-dd"
);
if
(
paycompanyid
.
HasValue
&&
paycompanyid
.
Value
>
0
)
{
cwurl
+=
"&CompanyVal="
+
paycompanyid
.
Value
;
}
//利息支出
var
listInterest
=
new
Services
.
FinanceReportServices
().
ListInterestExpense
(
cwurl
);
if
(
listInterest
.
Count
>
0
)
{
listInterest
.
Add
(
new
Models
.
Api
.
mInterestExpense
{
Company
=
"总计"
,
RepayInterest
=
listInterest
.
Sum
(
a
=>
a
.
RepayInterest
),
RepayInterestRMB
=
listInterest
.
Sum
(
a
=>
a
.
RepayInterestRMB
),
//ActualRepayTime = DateTime.Now,
});
}
var
list
=
listInterest
.
Select
(
a
=>
new
{
ActualRepayTime
=
a
.
ActualRepayTime
.
HasValue
?
a
.
ActualRepayTime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
):
""
,
a
.
BankCard
,
a
.
BankCardUser
,
a
.
BankName
,
a
.
Company
,
a
.
Creditor
,
RepayInterest
=
a
.
RepayInterest
.
ToString
(
"N2"
),
RepayInterestRMB
=
a
.
RepayInterestRMB
.
ToString
(
"N2"
),
});
return
JsonConvert
.
SerializeObject
(
new
{
total
=
list
.
Count
(),
rows
=
list
});
}
public
ActionResult
ExportListInterestExpense
(
DateTime
start
,
DateTime
end
,
int
?
paycompanyid
,
string
headname
,
string
categoryname
,
int
type
,
int
issub
)
{
var
cwurl
=
ConfigHelper
.
GetByName
(
"cwUrl"
)
+
"?BeginRepayTime="
+
start
.
ToString
(
"yyyy-MM-dd"
)
+
"&EndRepayTime="
+
end
.
ToString
(
"yyyy-MM-dd"
);
if
(
paycompanyid
.
HasValue
&&
paycompanyid
.
Value
>
0
)
{
cwurl
+=
"&CompanyVal="
+
paycompanyid
.
Value
;
}
//利息支出
var
listInterest
=
new
Services
.
FinanceReportServices
().
ListInterestExpense
(
cwurl
);
var
colNames
=
new
List
<
string
>
{
"借入公司主体名称"
,
"借款帐号"
,
"借款银行名称"
,
"借款银行持卡人"
,
"债权方"
,
"本期归还利息"
,
"本期归还利息RMB"
,
"实际还款时间"
};
var
list
=
new
List
<
string
>();
foreach
(
var
item
in
listInterest
)
{
list
.
Add
(
item
.
Company
+
"|"
+
item
.
BankCard
+
"|"
+
item
.
BankCardUser
+
"|"
+
item
.
BankName
+
"|"
+
item
.
Creditor
+
"|"
+
item
.
RepayInterest
+
"|"
+
item
.
RepayInterestRMB
+
"|"
+(
item
.
ActualRepayTime
.
HasValue
?
item
.
ActualRepayTime
.
Value
.
ToString
(
"yyyy-MM-dd"
):
""
)
);
}
var
filename
=
categoryname
+
"+"
+
headname
+
" 利息支出明细"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
);
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
ToCSV
(
list
,
colNames
,
filename
,
filepath
);
return
File
(
"~/Files/Report/"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"/"
+
filename
+
".csv"
,
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
,
filename
+
".csv"
);
}
/// <summary>
/// 导出分类管理成品明细
/// </summary>
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/AdministrativeCost.cshtml
View file @
01ac2a14
...
...
@@ -184,6 +184,11 @@
}
function getChildren(trindex, typename) {
if (typename == '利息支出') {
layer.msg('利息支出没有子分类哦');
return false;
}
var objTr = $('.tr_' + trindex + '_');
if (objTr.length > 0) {
if (objTr.attr('ishide') == 1) {
...
...
@@ -276,6 +281,7 @@
var start = $('#start').val();
var end = $('#end').val();
var paycompanyid = $('#sel_paycompanyid').val();
var param = '';
if (start == '') {
alert('请选择付款开始时间');
...
...
@@ -287,15 +293,19 @@
return false;
}
url += 'type=' + type;
url += '&start=' + start;
url += '&end=' + end;
url += '&paycompanyid=' + paycompanyid;
url += '&headname=' + colname;
url += '&categoryname=' + title;
url += '&issub=' + issub||0;
param += 'type=' + type;
param += '&start=' + start;
param += '&end=' + end;
param += '&paycompanyid=' + paycompanyid;
param += '&headname=' + colname;
param += '&categoryname=' + title;
param += '&issub=' + issub||0;
if (title == '利息支出') {
url = '@Url.Content("~/Reports/Finance/ListInterestExpense?")';
}
layer_show(title + '+' + colname
+'的明细', url
, '90%', '90%');
layer_show(title + '+' + colname
+ '的明细', url + param
, '90%', '90%');
}
function numFormat(num) {
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/ListInterestExpense.cshtml
0 → 100644
View file @
01ac2a14
@{
ViewData["Title"] = "利息支出明细";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
}
<div class="row">
<div class="col-sm-12">
<div class="ibox-content m-b-sm border-bottom">
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<label>付款时间</label>
<input class="form-control layer-date" id="start" style="width:120px;" placeholder="付款开始时间" value="@ViewBag.start.ToString("yyyy-MM-dd")" />
<input class="form-control layer-date" id="end" style="width:120px" placeholder="付款结束时间" value="@ViewBag.end.ToString("yyyy-MM-dd")" />
</div>
<div class="form-group">
<label> </label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i> 查询</button>
<button type="button" class="btn btn-success" onclick="ExportCSV()">导出</button>
</div>
</div>
</form>
</div>
<div class="ibox-content m-b-sm border-bottom">
<table id="roletable" style="table-layout:fixed;"></table>
</div>
</div>
</div>
@section scripts{
<script type="text/javascript">
var companyid = @ViewBag.paycompanyid;
var headname = '@Html.Raw(ViewBag.headname)';
var categoryname = '@Html.Raw(ViewBag.categoryname)';
var type = @ViewBag.type;
var issub = @ViewBag.isSub;
var tb;
$(document).ready(function () {
list();
})
function list() {
var start = $('#start').val();
var end = $('#end').val();
var columns = [
{
field: 'Company', title: '借入公司主体名称'
},
{ field: 'BankCard', title: '借款帐号' },
{ field: 'BankCardUser', title: '借款银行名称', },
{ field: 'BankName', title: '借款银行持卡人' },
{ field: 'Creditor', title: '债权方' },
{ field: 'RepayInterest',title: '本期归还利息' },
{ field: 'RepayInterestRMB', title: '本期归还利息RMB' },
{ field: 'ActualRepayTime', title: '实际还款时间' }
];
var url = '@Url.Content("~/Reports/Finance/ListInterestExpenseJson")' + '?paycompanyid=' + companyid + '&headname=' + headname + '&categoryname=' + categoryname + '&start=' + start + '&end=' + end + '&type=' + type + '&issub=' + issub;
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "",);
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
function ExportCSV() {
var start = $('#start').val();
var end = $('#end').val();
window.open('@Url.Content("~/Reports/Finance/ExportListInterestExpense")' + '?paycompanyid=' + companyid + '&headname=' + headname + '&categoryname=' + categoryname + '&start=' + start + '&end=' + end + '&type=' + type + '&issub=' + issub, '_blank');
}
</script>
}
Bailun.DC.Web/appsettings.json
View file @
01ac2a14
...
...
@@ -6,5 +6,6 @@
},
"AllowedHosts"
:
"*"
,
"FeeUrl"
:
"http://api.fee.bailuntec.com/purchase/other/cost/api/manageCostList"
,
"cn_str"
:
"server=gz-cdb-kp7s5i79.sql.tencentcdb.com;port=61691;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
"cn_str"
:
"server=gz-cdb-kp7s5i79.sql.tencentcdb.com;port=61691;database=bailun_datacenter;uid=root;password=#7kfnymAM$Y9-Ntf;"
,
"cwUrl"
:
"http://cw.bailuntec.com/api/api/GetRepayPlanDetails"
}
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