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
ae87abd7
Commit
ae87abd7
authored
Jul 15, 2021
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整销售平台流水报表显示
parent
0cb58afe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
75 deletions
+110
-75
flowing_sales.cs
Bailun.DC.Models/DataWareHouse/flowing_sales.cs
+2
-0
PlatformOrderServices.cs
Bailun.DC.Services/DataWareHouse/PlatformOrderServices.cs
+20
-4
PlatformOrderController.cs
...reas/DataWareHouse/Controllers/PlatformOrderController.cs
+36
-35
OrderBillings.cshtml
...as/DataWareHouse/Views/PlatformOrder/OrderBillings.cshtml
+52
-36
No files found.
Bailun.DC.Models/DataWareHouse/flowing_sales.cs
View file @
ae87abd7
...
@@ -25,5 +25,7 @@ namespace Bailun.DC.Models.DataWareHouse
...
@@ -25,5 +25,7 @@ namespace Bailun.DC.Models.DataWareHouse
public
string
accountname
{
get
;
set
;
}
public
string
accountname
{
get
;
set
;
}
public
DateTime
?
datatime
{
get
;
set
;
}
}
}
}
}
Bailun.DC.Services/DataWareHouse/PlatformOrderServices.cs
View file @
ae87abd7
...
@@ -40,7 +40,7 @@ namespace Bailun.DC.Services.DataWareHouse
...
@@ -40,7 +40,7 @@ namespace Bailun.DC.Services.DataWareHouse
/// <param name="month">月份</param>
/// <param name="month">月份</param>
/// <param name="total">符合条件的记录数</param>
/// <param name="total">符合条件的记录数</param>
/// <returns></returns>
/// <returns></returns>
public
List
<
Models
.
DataWareHouse
.
flowing_sales
>
List
(
int
page
,
string
platform
,
string
website
,
string
account
,
string
month
,
ref
int
total
,
int
pagesize
)
public
List
<
Models
.
DataWareHouse
.
flowing_sales
>
List
(
int
page
,
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
ref
int
total
,
int
pagesize
)
{
{
var
sql
=
"select * from flowing_sales t1 where 1=1"
;
var
sql
=
"select * from flowing_sales t1 where 1=1"
;
var
sqlparam
=
new
DynamicParameters
();
var
sqlparam
=
new
DynamicParameters
();
...
@@ -63,10 +63,26 @@ namespace Bailun.DC.Services.DataWareHouse
...
@@ -63,10 +63,26 @@ namespace Bailun.DC.Services.DataWareHouse
sqlparam
.
Add
(
"account"
,
account
);
sqlparam
.
Add
(
"account"
,
account
);
}
}
if
(!
string
.
IsNullOrEmpty
(
month
))
//if(!string.IsNullOrEmpty(month))
//{
// sql += " and t1.month=@month";
// sqlparam.Add("month", month);
//}
if
(!
string
.
IsNullOrEmpty
(
orderno
))
{
sql
+=
" and t1.orderno=@orderno"
;
sqlparam
.
Add
(
"orderno"
,
orderno
);
}
if
(
start
.
HasValue
)
{
sql
+=
$" and t1.datatime>='
{
start
.
Value
.
ToString
(
"yyyy-MM-dd"
)}
'"
;
}
if
(
end
.
HasValue
)
{
{
sql
+=
" and t1.month=@month"
;
sql
+=
$" and t1.datatime<'
{
end
.
Value
.
AddDays
(
1
).
ToString
(
"yyyy-MM-dd"
)}
'"
;
sqlparam
.
Add
(
"month"
,
month
);
}
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_DW
))
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_DW
))
...
...
Bailun.DC.Web/Areas/DataWareHouse/Controllers/PlatformOrderController.cs
View file @
ae87abd7
...
@@ -29,7 +29,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -29,7 +29,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
[
HttpPost
]
[
HttpPost
]
public
JsonResult
OrderBillingsJson
(
int
page
,
string
platform
,
string
website
,
string
account
,
string
month
,
int
pagesize
=
25
)
public
JsonResult
OrderBillingsJson
(
int
page
,
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
int
pagesize
=
25
)
{
{
if
(
string
.
IsNullOrEmpty
(
platform
))
if
(
string
.
IsNullOrEmpty
(
platform
))
{
{
...
@@ -39,21 +39,21 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -39,21 +39,21 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
});
});
}
}
if
(
string
.
IsNullOrEmpty
(
website
))
//
if(string.IsNullOrEmpty(website))
{
//
{
return
Json
(
new
{
//
return Json(new {
success
=
false
,
//
success = false,
msg
=
"请选择站点"
,
//
msg = "请选择站点",
});
//
});
}
//
}
if
(
string
.
IsNullOrEmpty
(
month
))
//
if(string.IsNullOrEmpty(month))
{
//
{
return
Json
(
new
{
//
return Json(new {
success
=
false
,
//
success = false,
msg
=
"请选择月份"
//
msg = "请选择月份"
});
//
});
}
//
}
if
(
page
<=
0
)
if
(
page
<=
0
)
{
{
...
@@ -61,7 +61,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -61,7 +61,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
}
}
int
total
=
0
;
int
total
=
0
;
var
obj
=
new
Services
.
DataWareHouse
.
PlatformOrderServices
().
List
(
page
,
platform
,
website
,
account
,
month
,
ref
total
,
pagesize
);
var
obj
=
new
Services
.
DataWareHouse
.
PlatformOrderServices
().
List
(
page
,
platform
,
website
,
account
,
start
,
end
,
orderno
,
ref
total
,
pagesize
);
var
list
=
obj
.
Select
(
a
=>
new
{
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
accountname
,
a
.
accountname
,
...
@@ -71,6 +71,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -71,6 +71,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
a
.
orderno
,
a
.
orderno
,
a
.
platform
,
a
.
platform
,
a
.
website
,
a
.
website
,
datatime
=
a
.
datatime
.
HasValue
?
a
.
datatime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
):
""
,
});
});
return
Json
(
new
{
return
Json
(
new
{
...
@@ -83,7 +84,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -83,7 +84,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
});
});
}
}
public
ActionResult
ExportOrderBillings
(
string
platform
,
string
website
,
string
account
,
string
month
)
public
ActionResult
ExportOrderBillings
(
string
platform
,
string
website
,
string
account
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
)
{
{
if
(
string
.
IsNullOrEmpty
(
platform
))
if
(
string
.
IsNullOrEmpty
(
platform
))
{
{
...
@@ -94,27 +95,27 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -94,27 +95,27 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
});
});
}
}
if
(
string
.
IsNullOrEmpty
(
website
))
//
if (string.IsNullOrEmpty(website))
{
//
{
return
Json
(
new
//
return Json(new
{
//
{
success
=
false
,
//
success = false,
msg
=
"请选择站点"
,
//
msg = "请选择站点",
});
//
});
}
//
}
if
(
string
.
IsNullOrEmpty
(
month
))
//
if (string.IsNullOrEmpty(month))
{
//
{
return
Json
(
new
//
return Json(new
{
//
{
success
=
false
,
//
success = false,
msg
=
"请选择月份"
//
msg = "请选择月份"
});
//
});
}
//
}
var
total
=
0
;
var
total
=
0
;
var
obj
=
new
Services
.
DataWareHouse
.
PlatformOrderServices
().
List
(
1
,
platform
,
website
,
account
,
month
,
ref
total
,
0
);
var
obj
=
new
Services
.
DataWareHouse
.
PlatformOrderServices
().
List
(
1
,
platform
,
website
,
account
,
start
,
end
,
orderno
,
ref
total
,
0
);
if
(
obj
.
Count
==
0
)
if
(
obj
.
Count
==
0
)
{
{
...
@@ -175,7 +176,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
...
@@ -175,7 +176,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
}
}
var
guid
=
Guid
.
NewGuid
().
ToString
();
var
guid
=
Guid
.
NewGuid
().
ToString
();
var
filename
=
platform
+
" "
+
month
+
"的账单流水"
;
var
filename
=
platform
+
" "
+
((
start
.
HasValue
?
start
.
Value
.
ToString
(
"yyyy-MM-dd"
):
""
+(
end
.
HasValue
?
"至"
+
end
.
Value
.
ToString
(
"yyyy-MM-dd"
):
""
)))
+
"的账单流水"
;
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
ToCSV
(
listVal
,
colnames
,
guid
,
filepath
);
ToCSV
(
listVal
,
colnames
,
guid
,
filepath
);
...
...
Bailun.DC.Web/Areas/DataWareHouse/Views/PlatformOrder/OrderBillings.cshtml
View file @
ae87abd7
...
@@ -12,14 +12,14 @@
...
@@ -12,14 +12,14 @@
<div class="form-inline" style="line-height:40px;">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<div class="form-group">
@*<label>站点</label>
@*<label>站点</label>
<select id="website" name="website" class="form-control" style="width:130px;">
<select id="website" name="website" class="form-control" style="width:130px;">
<option value="">请选择站点</option>
<option value="">请选择站点</option>
@foreach (var item in ViewBag.sites)
@foreach (var item in ViewBag.sites)
{
{
<option value="@item">@item</option>
<option value="@item">@item</option>
<button class="btn btn-info" type="button" aria-pressed="false"></button>
<button class="btn btn-info" type="button" aria-pressed="false"></button>
}
}
</select>*@
</select>*@
站点:
站点:
<div data-toggle="buttons-checkbox" class="btn-group">
<div data-toggle="buttons-checkbox" class="btn-group">
@foreach (var item in ViewBag.sites)
@foreach (var item in ViewBag.sites)
...
@@ -30,8 +30,14 @@
...
@@ -30,8 +30,14 @@
</div>
</div>
</div>
</div>
<div class="form-group" style="margin-left:10px">
<div class="form-group" style="margin-left:10px">
<label>月份</label>
<label>时间</label>
<input id="month" name="month" class="form-control" style="width:100px" value="@(DateTime.Now.AddMonths(-1).ToString("yyyy-MM"))" />
@*<input id="month" name="month" class="form-control" style="width:100px" value="@(DateTime.Now.AddMonths(-1).ToString("yyyy-MM"))" />*@
<input id="start" name="start" class="form-control" style="width:100px" value="" />至
<input id="end" name="end" class="form-control" style="width:100px" value="" />
</div>
<div class="form-group" style="margin-left:10px">
<label>平台单号</label>
<input id="orderno" name="orderno" class="form-control" style="width:200px" placeholder="请输入平台单号" />
</div>
</div>
<div class="form-group">
<div class="form-group">
<label> </label>
<label> </label>
...
@@ -171,30 +177,36 @@
...
@@ -171,30 +177,36 @@
var website = '';
var website = '';
$(document).ready(function () {
$(document).ready(function () {
//
list();
list();
laydate.render({ elem: '#month', type: 'month' });
laydate.render({ elem: '#start' });
laydate.render({ elem: '#end' });
})
})
function list() {
function list() {
//var website = $('#website').val();
//var website = $('#website').val();
var month = $('#month').val();
//
var month = $('#month').val();
if (website == '') {
alert('请选择站点');
return false;
}
if (month == '') {
//if (website == '') {
alert('请选择月份');
// alert('请选择站点');
return false;
// return false;
}
//}
//if (month == '') {
// alert('请选择月份');
// return false;
//}
var start = $('#start').val();
var end = $('#end').val();
var orderno = $('#orderno').val();
var load_index = layer.load();
var load_index = layer.load();
$.submit({
$.submit({
url: '@Url.Content("~/DataWareHouse/PlatformOrder/OrderBillingsJson")',
url: '@Url.Content("~/DataWareHouse/PlatformOrder/OrderBillingsJson")',
type:'POST',
type:'POST',
paramData: 'page=' + current_page + '&platform=@(ViewBag.platform)&website=' + website + '&
month=' + month
,
paramData: 'page=' + current_page + '&platform=@(ViewBag.platform)&website=' + website + '&
start=' + start + '&end=' + end + '&orderno=' + orderno
,
func: function (result) {
func: function (result) {
layer.close(load_index)
layer.close(load_index)
$('#tb').html('');
$('#tb').html('');
...
@@ -205,9 +217,9 @@
...
@@ -205,9 +217,9 @@
return false;
return false;
}
}
var firstrow = result.rows[0].jsondata;
var firstrow = result.rows[0].jsondata;
var _head = '<tr>';
var _head = '<tr>
<th style="width:160px;">格式化时间</th>
';
for (var i in firstrow) {
for (var i in firstrow) {
_head += '<th style="width:1
3
0px;">' + '<div class="mules" title="' + i + '">' + i + '</div>'+'</th>';
_head += '<th style="width:1
6
0px;">' + '<div class="mules" title="' + i + '">' + i + '</div>'+'</th>';
}
}
_head += '</tr>';
_head += '</tr>';
$('#tb_head').html(_head);
$('#tb_head').html(_head);
...
@@ -216,9 +228,9 @@
...
@@ -216,9 +228,9 @@
for (var i in result.rows) {
for (var i in result.rows) {
var _obj = result.rows[i].jsondata;
var _obj = result.rows[i].jsondata;
var _r = '<tr>';
var _r = '<tr>
<td>' + result.rows[i].datatime+'</td>
';
for (var r in _obj) {
for (var r in _obj) {
_r += '<td style="width:1
3
0px;">' + '<div class="mules" title="' + _obj[r] + '">' + _obj[r] + '</div>' +'</td>';
_r += '<td style="width:1
6
0px;">' + '<div class="mules" title="' + _obj[r] + '">' + _obj[r] + '</div>' +'</td>';
}
}
_r += '</tr>';
_r += '</tr>';
...
@@ -281,19 +293,23 @@
...
@@ -281,19 +293,23 @@
function ExportCSV() {
function ExportCSV() {
//var website = $('#website').val();
//var website = $('#website').val();
var month = $('#month').val();
//
var month = $('#month').val();
if (website == '') {
//
if (website == '') {
alert('请选择站点');
//
alert('请选择站点');
return false;
//
return false;
}
//
}
if (month == '') {
var start = $('#start').val();
alert('请选择月份');
var end = $('#end').val();
return false;
var orderno = $('#orderno').val();
}
//if (month == '') {
// alert('请选择月份');
// return false;
//}
window.open('@Url.Content("~/DataWareHouse/PlatformOrder/ExportOrderBillings")' + '?platform=@(ViewBag.platform)&website=' + website + '&
month=' + month
);
window.open('@Url.Content("~/DataWareHouse/PlatformOrder/ExportOrderBillings")' + '?platform=@(ViewBag.platform)&website=' + website + '&
start=' + start + '&end=' + end + '&orderno=' + orderno
);
}
}
</script>
</script>
...
...
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