Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
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
黄奎
mall.oytour.com
Commits
d2d941ce
Commit
d2d941ce
authored
Jun 04, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品导出修改
parent
8b5b52b9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
310 deletions
+123
-310
ExcelTempLateHelper.cs
Mall.Common/Plugin/ExcelTempLateHelper.cs
+0
-31
ExportController.cs
Mall.WebApi/Controllers/Export/ExportController.cs
+15
-22
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+108
-257
No files found.
Mall.Common/Plugin/ExcelTempLateHelper.cs
View file @
d2d941ce
...
...
@@ -91,21 +91,6 @@ namespace Mall.Common.Plugin
//fCellStyle.FillPattern = FillPattern.SolidForeground;
break
;
}
//自定义背景颜色
if
(
subItem
.
SelfBgColorIndex
>
0
)
{
//var color = RGBToColor(subItem.SelfBgColor);
//short FIRST_COLOR_INDEX = (short)0x8;
//var defaultColor = palette.GetColor(FIRST_COLOR_INDEX);
//palette.SetColorAtIndex(FIRST_COLOR_INDEX, color.R, color.G, color.B);
//HSSFColor hSSFColor = palette.GetColor(FIRST_COLOR_INDEX);
//palette.SetColorAtIndex(FIRST_COLOR_INDEX, 0, 0, 0);
//HSSFColor hSSFColor = palette.FindSimilarColor(color.R, color.G, color.B);
//fCellStyle.FillForegroundColor = subItem.SelfBgColorIndex;
//fCellStyle.FillPattern = FillPattern.SolidForeground;
}
HSSFFont
ffont
=
(
HSSFFont
)
workbook
.
CreateFont
();
if
(
subItem
.
FontHeight
>
0
)
{
...
...
@@ -302,22 +287,6 @@ namespace Mall.Common.Plugin
fCellStyle
.
FillPattern
=
FillPattern
.
SolidForeground
;
break
;
}
//自定义背景颜色
if
(
subItem
.
SelfBgColorIndex
>
0
)
{
//var color = RGBToColor(subItem.SelfBgColor);
//short FIRST_COLOR_INDEX = (short)0x8;
//var defaultColor = palette.GetColor(FIRST_COLOR_INDEX);
//palette.SetColorAtIndex(FIRST_COLOR_INDEX, color.R, color.G, color.B);
//HSSFColor hSSFColor = palette.GetColor(FIRST_COLOR_INDEX);
//palette.SetColorAtIndex(FIRST_COLOR_INDEX, 0, 0, 0);
//HSSFColor hSSFColor = palette.FindSimilarColor(color.R, color.G, color.B);
//fCellStyle.FillForegroundColor = subItem.SelfBgColorIndex;
//fCellStyle.FillPattern = FillPattern.SolidForeground;
}
if
(
subItem
.
FontHeight
>
0
)
{
ffont
.
FontHeight
=
subItem
.
FontHeight
*
20
;
...
...
Mall.WebApi/Controllers/Export/ExportController.cs
View file @
d2d941ce
...
...
@@ -7,6 +7,7 @@ using System.Net.Http;
using
System.Net.Http.Headers
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.WebApi.Controllers.User
;
using
Microsoft.AspNetCore.Mvc
;
namespace
Mall.WebApi.Controllers.Export
...
...
@@ -19,41 +20,33 @@ namespace Mall.WebApi.Controllers.Export
/// <summary>
/// 文件流下载
/// </summary>
/// <param name="requestData"></param>
/// <returns></returns>
[
HttpPost
]
public
HttpResponseMessage
DownLoad
()
public
FileContentResult
DownLoad
()
{
string
fileName
=
"Test.xls"
;
try
{
HttpResponseMessage
response
=
new
HttpResponseMessage
(
HttpStatusCode
.
OK
);
switch
(
RequestParm
.
cmd
)
var
downLoadRequest
=
RequestParm
;
//获取参数
if
(
downLoadRequest
.
cmd
!=
null
&&
!
string
.
IsNullOrEmpty
(
downLoadRequest
.
cmd
)
)
{
//商品购买力TOP排行
case
"getSalesGoodTop"
:
var
file_SalesGood
=
new
Services
.
DMCService
.
BusService
().
DownLoadBusConfig
(
requestData
);
Stream
stream_SalesGood
=
new
MemoryStream
(
file_SalesGood
);
response
.
Content
=
new
StreamContent
(
stream
);
break
;
if
(
downLoadRequest
.
cmd
==
"getSalesGoodTop"
)
{
return
File
(
new
TenantController
().
DownLoadSalesGoods
(
downLoadRequest
),
"application/octet-stream"
,
fileName
);
}
//用户购买力TOP排行
case
"getSalesUserTop"
:
var
file_SalesUser
=
new
Services
.
DMCService
.
BusService
().
DownLoadBusConfig
(
requestData
);
Stream
stream_SalesUser
=
new
MemoryStream
(
file_SalesUser
);
response
.
Content
=
new
StreamContent
(
stream_SalesUser
);
break
;
if
(
downLoadRequest
.
cmd
==
"getSalesUserTop"
)
{
return
File
(
new
TenantController
().
DownLoadSalesUser
(
downLoadRequest
),
"application/octet-stream"
,
fileName
);
}
}
response
.
Content
.
Headers
.
ContentType
=
new
MediaTypeHeaderValue
(
"application/octet-stream"
);
response
.
Content
.
Headers
.
ContentDisposition
=
new
ContentDispositionHeaderValue
(
"attachment"
)
{
FileName
=
"Test.xls"
};
return
response
;
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"DownLoad_requestData: {0}"
,
Common
.
Plugin
.
JsonHelper
.
Serialize
(
requestData
)));
return
new
HttpResponseMessage
(
HttpStatusCode
.
NoContent
);
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
string
.
Format
(
"DownLoad_requestData: {0}"
,
Common
.
Plugin
.
JsonHelper
.
Serialize
(
this
.
RequestParm
)));
}
return
File
(
new
byte
[
0
],
"application/octet-stream"
,
fileName
);
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/User/TenantController.cs
View file @
d2d941ce
This diff is collapsed.
Click to expand it.
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