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
d7b2ee85
Commit
d7b2ee85
authored
Jul 29, 2021
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加物流账单流水显示
parent
eafdc0c5
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
719 additions
and
1 deletion
+719
-1
Services.cs
Bailun.DC.LogicWareHouse/Services.cs
+0
-1
flowing_logistic.cs
Bailun.DC.Models/DataWareHouse/flowing_logistic.cs
+70
-0
flowing_logistic_config.cs
Bailun.DC.Models/DataWareHouse/flowing_logistic_config.cs
+34
-0
LogisticServices.cs
Bailun.DC.Services/DataWareHouse/LogisticServices.cs
+92
-0
LogisticsController.cs
...eb/Areas/DataWareHouse/Controllers/LogisticsController.cs
+64
-0
List.cshtml
...un.DC.Web/Areas/DataWareHouse/Views/Logistics/List.cshtml
+457
-0
HomeController.cs
Bailun.DC.Web/Controllers/HomeController.cs
+2
-0
No files found.
Bailun.DC.LogicWareHouse/Services.cs
View file @
d7b2ee85
...
...
@@ -156,7 +156,6 @@ namespace Bailun.DC.LogicWareHouse
}
/// <summary>
/// 半成品
/// </summary>
...
...
Bailun.DC.Models/DataWareHouse/flowing_logistic.cs
0 → 100644
View file @
d7b2ee85
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.Models.DataWareHouse
{
public
class
flowing_logistic
{
/// <summary>
///
/// </summary>
public
int
id
{
get
;
set
;
}
/// <summary>
/// 物流商名称
/// </summary>
public
string
platformtype
{
get
;
set
;
}
/// <summary>
/// 帐号
/// </summary>
public
string
account
{
get
;
set
;
}
/// <summary>
/// 物流数据类型
/// </summary>
public
int
datatype
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
datatypename
{
get
;
set
;
}
/// <summary>
/// json数据
/// </summary>
public
string
jsondata
{
get
;
set
;
}
/// <summary>
/// 账单上的时间
/// </summary>
public
DateTime
?
datatime
{
get
;
set
;
}
/// <summary>
/// 开始时间
/// </summary>
public
DateTime
?
starttime
{
get
;
set
;
}
/// <summary>
/// 结束时间
/// </summary>
public
DateTime
?
endtime
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
createtime
{
get
;
set
;
}
public
string
col_orderno
{
get
;
set
;
}
}
}
Bailun.DC.Models/DataWareHouse/flowing_logistic_config.cs
0 → 100644
View file @
d7b2ee85
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Bailun.DC.Models.DataWareHouse
{
public
class
flowing_logistic_config
{
/// <summary>
///
/// </summary>
public
int
id
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
platform
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
col_datatime
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
col_orderno
{
get
;
set
;
}
}
}
Bailun.DC.Services/DataWareHouse/LogisticServices.cs
0 → 100644
View file @
d7b2ee85
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
MySql.Data.MySqlClient
;
using
Dapper
;
using
Bailun.DC.Models.DataWareHouse
;
using
System.Linq
;
namespace
Bailun.DC.Services.DataWareHouse
{
public
class
LogisticServices
{
/// <summary>
/// 获取物流流水的简单配置
/// </summary>
/// <returns></returns>
public
List
<
flowing_logistic_config
>
ListLogisticConfig
()
{
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_DW
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
return
cn
.
Query
<
flowing_logistic_config
>(
"select * from flowing_logistic_config"
).
ToList
();
}
}
/// <summary>
/// 获取物流账单流水 json数据
/// </summary>
/// <param name="page"></param>
/// <param name="pagesize"></param>
/// <param name="platform"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <param name="total"></param>
/// <returns></returns>
public
List
<
flowing_logistic
>
ListFlowingLogistic
(
int
page
,
int
pagesize
,
string
platform
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
ref
int
total
)
{
var
sql
=
"select * from flowing_logistic where 1=1"
;
var
sqlparam
=
new
DynamicParameters
();
if
(!
string
.
IsNullOrEmpty
(
platform
))
{
sql
+=
" and platformtype=@platform"
;
sqlparam
.
Add
(
"platform"
,
platform
);
}
if
(
start
.
HasValue
)
{
sql
+=
$" and datatime>='
{
start
.
Value
.
ToString
(
"yyyy-MM-dd"
)}
'"
;
}
if
(
end
.
HasValue
)
{
sql
+=
$" and datatime<'
{
end
.
Value
.
AddDays
(
1
).
ToString
(
"yyyy-MM-dd"
)}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
orderno
))
{
sql
+=
" and col_orderno=@no"
;
sqlparam
.
Add
(
"no"
,
orderno
);
}
using
(
var
cn
=
new
MySqlConnection
(
Common
.
GlobalConfig
.
ConnectionString_DW
))
{
if
(
cn
.
State
==
System
.
Data
.
ConnectionState
.
Closed
)
{
cn
.
Open
();
}
if
(
pagesize
>
0
)
{
var
obj
=
cn
.
Page
<
flowing_logistic
>(
page
,
pagesize
,
sql
,
ref
total
,
sqlparam
).
ToList
();
return
obj
;
}
else
{
var
obj
=
cn
.
Query
<
flowing_logistic
>(
sql
).
ToList
();
total
=
obj
.
Count
;
return
obj
;
}
}
}
}
}
Bailun.DC.Web/Areas/DataWareHouse/Controllers/LogisticsController.cs
0 → 100644
View file @
d7b2ee85
using
Microsoft.AspNetCore.Mvc
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
namespace
Bailun.DC.Web.Areas.DataWareHouse.Controllers
{
[
Area
(
"DataWareHouse"
)]
public
class
LogisticsController
:
Controller
{
public
IActionResult
List
(
string
platform
)
{
var
listconfig
=
new
Services
.
DataWareHouse
.
LogisticServices
().
ListLogisticConfig
();
ViewBag
.
listconfig
=
listconfig
;
ViewBag
.
platform
=
platform
;
return
View
();
}
/// <summary>
/// 获取物流账单json数据
/// </summary>
/// <param name="page"></param>
/// <param name="platform"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <param name="orderno"></param>
/// <param name="pagesize"></param>
/// <returns></returns>
[
HttpPost
]
public
JsonResult
ListFlowingJson
(
int
page
,
string
platform
,
DateTime
?
start
,
DateTime
?
end
,
string
orderno
,
int
pagesize
=
25
)
{
var
total
=
0
;
if
(
page
<=
0
)
{
page
=
1
;
}
var
obj
=
new
Services
.
DataWareHouse
.
LogisticServices
().
ListFlowingLogistic
(
page
,
pagesize
,
platform
,
start
,
end
,
orderno
,
ref
total
);
;
var
list
=
obj
.
Select
(
a
=>
new
{
a
.
createtime
,
jsondata
=
Newtonsoft
.
Json
.
Linq
.
JRaw
.
Parse
(
a
.
jsondata
),
datatime
=
a
.
datatime
.
HasValue
?
a
.
datatime
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
});
return
Json
(
new
{
success
=
true
,
msg
=
""
,
rows
=
list
,
total
=
total
,
page
=
page
,
totalpage
=
total
/
pagesize
+
(
total
%
pagesize
>
0
?
1
:
0
),
});
}
}
}
Bailun.DC.Web/Areas/DataWareHouse/Views/Logistics/List.cshtml
0 → 100644
View file @
d7b2ee85
@{
ViewData["Title"] = "物流账单流水";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
ViewBag.Nav = new string[] { "物流账单流水", "物流账单流水" };
}
<div class="row">
<div class="col-sm-12">
<div class="ibox-content m-b-sm border-bottom">
<div class="alert alert-warning">
</div>
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
<div id="sel_platform_contain" class="form-group" style="display:none;">
<label>平台:</label>
<select id="platform" name="platform" class="form-control" style="width:120px">
@if (ViewBag.listconfig.Count > 0)
{
foreach (var item in ViewBag.listconfig)
{
<option value="@item">@item</option>
}
}
</select>
</div>
<div class="form-group" style="margin-left:10px">
<label>时间</label>
@*<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="" placeholder="开始时间" />至
<input id="end" name="end" class="form-control" style="width:100px" value="" placeholder="结束时间" />
</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 class="form-group">
<label> </label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i> 查询</button>
<button id="btnexport" style="" type="button" class="btn btn-success" onclick="ExportCSV()">导出</button>
<button type="button" style="margin-left:10px" class="btn btn-warning" onclick="downloadTemplate()">模版下载</button>
<button id="btn_Upload" type="button" style="" class="btn btn-warning">导入流水</button>
@*<button id="btn_Upload_Merge" type="button" style="" class="btn btn-warning">导入站点合并流水</button>*@
</div>
</div>
</form>
</div>
<div class="ibox-content m-b-sm border-bottom table-responsive">
<table id="roletable" class="table table-hover table-bordered table-striped" style="table-layout:fixed;">
<thead id="tb_head">
</thead>
<tbody id="tb">
</tbody>
</table>
<div id="page-contain">
<span id="pageresult" style="padding: 5px 3px; display: inline; border: solid 1px #ccc; border-radius: 3px 3px; top: -10px; position: relative;"></span>
<div id="pagination" class="pagination" style="margin-left:50px;"></div>
</div>
</div>
</div>
</div>
@section css{
<link href="~/js/webuploader-0.1.5/webuploader.css" rel="stylesheet" />
<style>
.webuploader-pick {
position: relative;
display: block;
cursor: pointer;
background: none;
padding: 0px;
color: #fff;
text-align: center;
border-radius: 3px;
overflow: hidden;
}
.webuploader-container {
background-color: cornflowerblue !important;
}
.mules {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/*.pagination ul{
list-style-type:none;
padding:0px;
margin:0px;
}
.pagination ul li{float:left;width:20px;}
*/
.pagination {
margin: 20px 0;
}
.pagination ul {
display: inline-block;
*display: inline;
margin-bottom: 0;
margin-left: 0;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
*zoom: 1;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
padding-left: 0px;
}
.pagination ul > li {
display: inline;
}
.pagination ul > li > a,
.pagination ul > li > span {
float: left;
padding: 4px 12px;
line-height: 20px;
text-decoration: none;
background-color: #ffffff;
border: 1px solid #dddddd;
border-left-width: 0;
}
.pagination ul > li > a:hover,
.pagination ul > li > a:focus,
.pagination ul > .active > a,
.pagination ul > .active > span {
background-color: #f5f5f5;
}
.pagination ul > .active > a,
.pagination ul > .active > span {
color: #999999;
cursor: default;
}
.pagination ul > .disabled > span,
.pagination ul > .disabled > a,
.pagination ul > .disabled > a:hover,
.pagination ul > .disabled > a:focus {
color: #999999;
cursor: default;
background-color: transparent;
}
.pagination ul > li:first-child > a,
.pagination ul > li:first-child > span {
border-left-width: 1px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-left-radius: 4px;
-webkit-border-top-left-radius: 4px;
border-top-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
-moz-border-radius-topleft: 4px;
}
.pagination ul > li:last-child > a,
.pagination ul > li:last-child > span {
-webkit-border-top-right-radius: 4px;
border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
-moz-border-radius-topright: 4px;
-moz-border-radius-bottomright: 4px;
}
.pagination-centered {
text-align: center;
}
.pagination-right {
text-align: right;
}
</style>
}
@section scripts{
<script src="~/js/jspagination/bootstrap-paginator.js"></script>
<script src="~/js/webuploader-0.1.5/webuploader.min.js"></script>
<script src="~/js/Layer-2.1/extend/layer.ext.js"></script>
<script type="text/javascript">
var tb;
var current_page = 1;
var platform = '@(ViewBag.platform)';
var BASE_URL = '@(Url.Content("~/js/webuploader-0.1.5/"))';
$(document).ready(function () {
//其他平台,默认选择第一个平台
if (platform == '') {
$('#sel_platform_contain').css('display', 'inline');
platform = $('#platform').val();
$('#platform').change(function () {
platform = $('#platform').val();
initUpload();
})
}
list();
laydate.render({ elem: '#start' });
laydate.render({ elem: '#end' });
initUpload();
//btn_Upload_Merge
@*uploadfile('btn_Upload_Merge',
'@Url.Content("~/DataWareHouse/PlatformOrder/UploadOrderBillingMerge")' + '?platform=' + platform,
function(result){
if(result.success)
{
alert('上传成功!');
}
else
{
alert(result.msg);
}
});*@
})
function list() {
//var website = $('#website').val();
//var month = $('#month').val();
//if (website == '') {
// alert('请选择站点');
// return false;
//}
//if (month == '') {
// alert('请选择月份');
// return false;
//}
var start = $('#start').val();
var end = $('#end').val();
var orderno = $('#orderno').val();
if (platform == '') {
alert('请选择平台');
return false;
}
var load_index = layer.load();
$.submit({
url: '@Url.Content("~/DataWareHouse/Logistics/ListFlowingJson")',
type:'POST',
paramData: 'page=' + current_page + '&platform=' + platform + '&start=' + start + '&end=' + end + '&orderno=' + orderno ,
func: function (result) {
layer.close(load_index)
$('#tb_head').html('');
$('#tb').html('');
$('#page-contain').html('<span id="pageresult" style="padding: 5px 3px; display: inline; border: solid 1px #ccc; border-radius: 3px 3px; top: -10px; position: relative;"></span><div id="pagination" class="pagination" style="margin-left:5px;"></div>');
if (result.success) {
//表头
if (result.total == 0) {
//alert('没有找到该平台数据,请上传');
layer.msg("没有找到该平台数据,请上传");
return false;
}
var firstrow = result.rows[0].jsondata;
var _head = '<tr><th style="width:160px;">格式化时间</th>';
for (var i in firstrow) {
_head += '<th style="width:160px;">' + '<div class="mules" title="' + i + '">' + i + '</div>'+'</th>';
}
_head += '</tr>';
$('#tb_head').html(_head);
//内容
for (var i in result.rows) {
var _obj = result.rows[i].jsondata;
var _r = '<tr><td>' + result.rows[i].datatime+'</td>';
for (var r in _obj) {
var _v = _obj[r];
if (isJson(_obj[r])) {
_v = JSON.stringify(_obj[r]).replace(/"/g, "'");
}
_r += '<td style="width:160px;">' + '<div class="mules" title="' + _v + '">' + _v + '</div>' +'</td>';
}
_r += '</tr>';
$('#tb').append(_r);
}
//分页
InitPage(result.totalpage);
$('#pageresult').html('总记录数:' + result.total + ';总页数:' + result.totalpage);
}
else {
//alert('获取数据出现异常')
layer.msg("获取数据出现异常");
}
}
})
}
function initUpload() {
if (platform == '') {
alert('请选择平台');
return false;
}
//var month = $('#month').val();
//if (month == '') {
// alert('请选择月份');
// return false;
//}
//if (websitecount > 0 && website == '') {
// alert('请选择站点,再下载导入模版。');
// return false;
//}
uploadfile('btn_Upload',
'@Url.Content("~/DataWareHouse/PlatformOrder/UploadOrderBilling")' + '?platform=' + platform,
function(result){
if(result.success)
{
alert('上传成功!');
}
else
{
alert(result.msg);
}
});
}
function InitPage(totalpage) {
$('#page-contain').html('<span id="pageresult" style="padding: 5px 3px; display: inline; border: solid 1px #ccc; border-radius: 3px 3px; top: -10px; position: relative;"></span><div id="pagination" class="pagination" style="margin-left:5px;"></div>');
var container = $('#pagination');
options = {
containerClass: "pagination"
, currentPage: current_page
//, numberOfPages: 6
, totalPages: totalpage
, pageUrl: function (type, page) {
//return null;
}
, onPageClicked: function (e, originalEvent, type, page) {
current_page = page;
list();
}
, onPageChUrlnged: function (page) {
}
};
container.bootstrapPaginator(options);
}
function isJson (obj) {
var isjson = typeof (obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length;
return isjson;
}
function ExportCSV() {
//var website = $('#website').val();
//var month = $('#month').val();
//if (website == '') {
// alert('请选择站点');
// return false;
//}
var start = $('#start').val();
var end = $('#end').val();
var orderno = $('#orderno').val();
if (platform == '') {
alert('请选择平台');
return false;
}
window.open('@Url.Content("~/DataWareHouse/PlatformOrder/ExportOrderBillings")' + '?platform=' + platform + '&start=' + start + '&end=' + end + '&orderno=' + orderno);
}
function downloadTemplate() {
if (platform == '') {
alert('请选择平台');
return false;
}
var start = $('#start').val();
var end = $('#end').val();
var orderno = $('#orderno').val();
window.open('@Url.Content("~/DataWareHouse/PlatformOrder/DownLoadOrderBillingTemplate?platform=")' + platform + '&start=' + start + '&end=' + end ,'_blank');
}
function uploadfile(id,url,callback)
{
var uploader = new WebUploader.Uploader({
// swf文件路径
swf: BASE_URL + 'Uploader.swf',
// 文件接收服务端。
server: url!=undefined?url:'@Url.Content("~/File/UploadFile")',
// 选择文件的按钮。可选。
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
pick: '#'+id,
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
resize: false,
auto: true,
timeout: 0,
accept: {
extensions: "xls,xlsx",
mimeTypes: ".xls,.xlsx"
}
});
uploader.on('uploadSuccess', function (file, response) {
if(callback!=undefined)
{
callback(response);
}
});
uploader.on('uploadError', function (file) {
layer.msg("上传出错");
});
}
</script>
}
\ No newline at end of file
Bailun.DC.Web/Controllers/HomeController.cs
View file @
d7b2ee85
...
...
@@ -419,5 +419,6 @@ namespace Bailun.DC.Web.Controllers
return
Content
(
"OK"
);
}
}
}
\ 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