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
bd7ac948
Commit
bd7ac948
authored
Jul 18, 2021
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理亚马逊流水的问题
parent
93aaf08e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
3 deletions
+101
-3
PlatformOrderController.cs
...reas/DataWareHouse/Controllers/PlatformOrderController.cs
+67
-0
OrderBillings.cshtml
...as/DataWareHouse/Views/PlatformOrder/OrderBillings.cshtml
+16
-0
Program.cs
Bailun.DC.Web/Program.cs
+10
-1
Startup.cs
Bailun.DC.Web/Startup.cs
+8
-2
No files found.
Bailun.DC.Web/Areas/DataWareHouse/Controllers/PlatformOrderController.cs
View file @
bd7ac948
...
...
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
using
Bailun.ServiceFabric.Authorize
;
using
Bailun.ServiceFabric.Core.Extension.HttpContext
;
using
Bailun.ServiceFabric.Core.Extension
;
using
Microsoft.AspNetCore.Http
;
namespace
Bailun.DC.Web.Areas.DataWareHouse.Controllers
{
...
...
@@ -282,6 +283,7 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
/// <param name="website">站点</param>
/// <returns></returns>
//[BailunAuthentication(LoginMode.Enforce)]
[
DisableRequestSizeLimit
]
public
JsonResult
UploadOrderBilling
(
string
platform
,
string
website
)
{
...
...
@@ -336,6 +338,71 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
});
}
/// <summary>
/// 平台站点合并单个文件上传
/// </summary>
/// <param name="platform"></param>
/// <param name="website"></param>
/// <returns></returns>
public
JsonResult
UploadOrderBillingMerge
(
string
platform
)
{
if
(
Request
.
Form
.
Files
.
Count
==
0
)
{
return
Json
(
new
{
success
=
false
,
msg
=
"请上传文件!"
});
}
//var user = HttpContextHelper.Current?.User;
var
file
=
Request
.
Form
.
Files
[
0
];
Dictionary
<
string
,
DataTable
>
dic
=
Base
.
NpolHelper
.
ExcelToDataTable
(
file
.
OpenReadStream
(),
file
.
FileName
,
true
);
if
(
dic
.
Count
>
0
)
{
var
tb
=
dic
.
FirstOrDefault
();
var
list
=
Dtb2Json
(
tb
.
Value
);
var
listOrders
=
new
List
<
Models
.
DataWareHouse
.
flowing_sales
>();
foreach
(
var
item
in
list
)
{
//保存数据
var
m
=
new
Models
.
DataWareHouse
.
flowing_sales
{
accountname
=
""
,
createtime
=
DateTime
.
Now
,
jsondata
=
Newtonsoft
.
Json
.
JsonConvert
.
SerializeObject
(
item
),
month
=
""
,
platform
=
platform
,
//website = website ?? "",
orderno
=
""
,
platformsku
=
""
,
createuser
=
"页面上传"
};
listOrders
.
Add
(
m
);
}
var
result
=
new
Services
.
DataWareHouse
.
PlatformOrderServices
().
InsertOrderBilling
(
listOrders
);
return
Json
(
new
{
success
=
string
.
IsNullOrEmpty
(
result
),
msg
=
result
});
}
return
Json
(
new
{
success
=
false
,
msg
=
"无法识别表格的数据,请下载模版重新导入,或者检查下表格数据是否正确。"
,
});
}
private
System
.
Collections
.
ArrayList
Dtb2Json
(
DataTable
dtb
)
{
...
...
Bailun.DC.Web/Areas/DataWareHouse/Views/PlatformOrder/OrderBillings.cshtml
View file @
bd7ac948
...
...
@@ -54,6 +54,7 @@
<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>
...
...
@@ -230,6 +231,20 @@
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() {
...
...
@@ -445,6 +460,7 @@
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
resize: false,
auto: true,
timeout: 0,
accept: {
extensions: "xls,xlsx",
mimeTypes: ".xls,.xlsx"
...
...
Bailun.DC.Web/Program.cs
View file @
bd7ac948
...
...
@@ -19,6 +19,15 @@ namespace Bailun.DC.Web
public
static
IWebHostBuilder
CreateWebHostBuilder
(
string
[]
args
)
=>
WebHost
.
CreateDefaultBuilder
(
args
)
.
UseStartup
<
Startup
>();
.
UseKestrel
(
options
=>
{
options
.
Limits
.
MaxRequestBodySize
=
200
*
1024
*
1024
;
// 200M
})
//.UseHttpSys(options =>
//{
// options.MaxRequestBodySize = 100_000_000;
//})
.
UseStartup
<
Startup
>()
;
}
}
Bailun.DC.Web/Startup.cs
View file @
bd7ac948
...
...
@@ -41,9 +41,13 @@ namespace Bailun.DC.Web
{
options
.
ValueLengthLimit
=
1024
*
1024
*
100
;
options
.
ValueCountLimit
=
int
.
MaxValue
;
options
.
MultipartBodyLengthLimit
=
200
*
1024
*
1024
;
//最大200M 解决文件上传Request body too large
options
.
MultipartHeadersCountLimit
=
10
;
options
.
MemoryBufferThreshold
=
int
.
MaxValue
;
});
//注入session服务
//services.AddSession();
...
...
@@ -97,6 +101,8 @@ namespace Bailun.DC.Web
ConfigManagerConf
.
SetConfiguration
(
Configuration
);
app
.
UseStaticHttpContext
();
}
}
}
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