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
8b5b52b9
Commit
8b5b52b9
authored
Jun 04, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增页面
parent
39e2d283
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
376 additions
and
1 deletion
+376
-1
RequestParm.cs
Mall.Common/API/RequestParm.cs
+5
-0
ExportController.cs
Mall.WebApi/Controllers/Export/ExportController.cs
+59
-0
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+26
-1
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+286
-0
No files found.
Mall.Common/API/RequestParm.cs
View file @
8b5b52b9
...
...
@@ -22,6 +22,11 @@ namespace Mall.Common.API
/// </summary>
public
int
MallBaseId
{
get
;
set
;
}
/// <summary>
/// 命令
/// </summary>
public
string
cmd
{
get
;
set
;
}
/// <summary>
/// 用户ID
/// </summary>
...
...
Mall.WebApi/Controllers/Export/ExportController.cs
0 → 100644
View file @
8b5b52b9
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Net
;
using
System.Net.Http
;
using
System.Net.Http.Headers
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Microsoft.AspNetCore.Mvc
;
namespace
Mall.WebApi.Controllers.Export
{
/// <summary>
/// 文件下载
/// </summary>
public
class
ExportController
:
BaseController
{
/// <summary>
/// 文件流下载
/// </summary>
/// <param name="requestData"></param>
/// <returns></returns>
[
HttpPost
]
public
HttpResponseMessage
DownLoad
()
{
try
{
HttpResponseMessage
response
=
new
HttpResponseMessage
(
HttpStatusCode
.
OK
);
switch
(
RequestParm
.
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
;
//用户购买力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
;
}
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
);
}
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
8b5b52b9
...
...
@@ -151,7 +151,7 @@ namespace Mall.WebApi.Controllers.MallBase
//授权页面热区
var
hotspotCancel
=
new
object
();
var
hotspotLogin
=
new
object
();
if
(
miniProgram
.
AuthDataList
!=
null
&&
miniProgram
.
AuthDataList
.
Count
>
0
)
if
(
miniProgram
.
AuthDataList
!=
null
&&
miniProgram
.
AuthDataList
.
Count
>
0
&&
miniProgram
.
AuthDataList
.
Count
==
2
)
{
var
first
=
miniProgram
.
AuthDataList
[
0
];
var
second
=
miniProgram
.
AuthDataList
[
1
];
...
...
@@ -166,6 +166,31 @@ namespace Mall.WebApi.Controllers.MallBase
hotspotCancel
=
first
;
}
}
else
{
hotspotLogin
=
new
AuthItem
()
{
width
=
224
,
height
=
80
,
left
=
340
,
top
=
566
,
defaultX
=
340
,
defaultY
=
566
,
link
=
""
,
open_type
=
"login"
};
hotspotCancel
=
new
AuthItem
()
{
width
=
224
,
height
=
80
,
left
=
84
,
top
=
566
,
defaultX
=
84
,
defaultY
=
566
,
link
=
""
,
open_type
=
"cancel"
};
}
auth_page
=
new
{
pic_url
=
miniProgram
.
AuthUrl
,
...
...
Mall.WebApi/Controllers/User/TenantController.cs
View file @
8b5b52b9
...
...
@@ -1401,6 +1401,292 @@ namespace Mall.WebApi.Controllers.User
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 下载车配表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
virtual
byte
[]
DownLoadSalesGoods
(
RequestParm
request
)
{
JObject
parm
=
JObject
.
Parse
(
request
.
msg
.
ToString
());
string
TCIDS
=
parm
.
GetStringValue
(
"TCIDS"
);
var
extModel
=
GetDownLoadData
(
TCIDS
);
#
region
文件下载
List
<
ExcelDataSource
>
list
=
new
List
<
ExcelDataSource
>();
ExcelDataSource
header
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"印象ジャパンバス手配依頼書"
,
colspan
:
6
)
{
FontColorEnum
=
ColorEnum
.
Red
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
,
IsBold
=
true
}
}
};
list
.
Add
(
header
);
ExcelDataSource
firstRow
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"団 體 名:"
){
BgColorEnum
=
ColorEnum
.
BrightGreen
,
CellWidth
=
25
,
IsBold
=
true
},
new
ExcelColumn
(
value
:
extModel
.
TeamNum
,
colspan
:
5
)
{
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
},
}
};
list
.
Add
(
firstRow
);
list
.
Add
(
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"ガイド名前:"
)
{
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
new
ExcelColumn
(
value
:
extModel
.
GuideName
)
{
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
},
new
ExcelColumn
(
value
:
"攜帯番號:"
)
{
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
new
ExcelColumn
(
value
:
extModel
.
GuideTel
,
colspan
:
3
)
{
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
}
}
});
list
.
Add
(
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"人 數:"
)
{
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
new
ExcelColumn
(
value
:
extModel
.
PeopleNum
,
colspan
:
5
)
{
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
},
}
});
list
.
Add
(
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"バス 種類:"
){
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
new
ExcelColumn
(
value
:
extModel
.
BusType
,
colspan
:
5
)
{
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
},
}
});
list
.
Add
(
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"スケジュール:"
)
{
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
//7天6晚
new
ExcelColumn
(
value
:
extModel
.
DayNight
,
colspan
:
5
)
{
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
},
}
});
list
.
Add
(
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
""
)
{
IsSetBorder
=
true
,
},
new
ExcelColumn
(
value
:
""
)
{
IsSetBorder
=
true
,
},
new
ExcelColumn
(
value
:
""
){
IsSetBorder
=
true
,
},
new
ExcelColumn
(
value
:
""
){
IsSetBorder
=
true
,
},
new
ExcelColumn
(
value
:
""
){
IsSetBorder
=
true
,
},
new
ExcelColumn
(
value
:
""
){
IsSetBorder
=
true
,
},
}
});
list
.
Add
(
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"日付"
){
CellWidth
=
25
,
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
new
ExcelColumn
(
value
:
"用車状況"
)
{
CellWidth
=
15
,
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
new
ExcelColumn
(
value
:
"便名"
)
{
CellWidth
=
20
,
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
new
ExcelColumn
(
value
:
"スケジュール內容"
)
{
CellWidth
=
30
,
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
new
ExcelColumn
(
value
:
"ホテル"
)
{
CellWidth
=
20
,
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
new
ExcelColumn
(
value
:
"ホテルTEL"
)
{
CellWidth
=
20
,
IsBold
=
true
,
BgColorEnum
=
ColorEnum
.
BrightGreen
,
},
}
});
int
index
=
0
;
foreach
(
var
item
in
extModel
.
Details_Extends
)
{
ExcelDataSource
excelDataSource
=
new
ExcelDataSource
{
ExcelRows
=
new
List
<
ExcelColumn
>()
};
excelDataSource
.
ColumnHight
=
50
;
excelDataSource
.
ExcelRows
.
Add
(
new
ExcelColumn
()
{
Value
=
Convert
.
ToDateTime
(
item
.
UseDate
).
ToString
(
"MM月dd日"
),
IsBold
=
true
,
FontColorEnum
=
ColorEnum
.
Green
,
});
excelDataSource
.
ExcelRows
.
Add
(
new
ExcelColumn
()
{
Value
=
item
.
BusType
,
IsBold
=
true
,
FontColorEnum
=
ColorEnum
.
Green
,
});
if
(
item
.
FlightNum
!=
null
&&
!
string
.
IsNullOrEmpty
(
item
.
FlightNum
))
{
excelDataSource
.
ExcelRows
.
Add
(
new
ExcelColumn
()
{
Value
=
item
.
FlightNum
,
FontColorEnum
=
ColorEnum
.
Red
,
});
}
else
{
excelDataSource
.
ExcelRows
.
Add
(
new
ExcelColumn
()
{
Value
=
item
.
FlightNum
,
BgColorEnum
=
ColorEnum
.
DarkBlue
,
});
}
excelDataSource
.
ExcelRows
.
Add
(
new
ExcelColumn
()
{
Value
=
item
.
BusContent
,
FontColorEnum
=
ColorEnum
.
Red
,
});
//酒店
excelDataSource
.
ExcelRows
.
Add
(
new
ExcelColumn
()
{
Value
=
item
.
HotelName
,
FontColorEnum
=
ColorEnum
.
Green
,
});
//电话
excelDataSource
.
ExcelRows
.
Add
(
new
ExcelColumn
()
{
Value
=
item
.
HotelTel
,
FontColorEnum
=
ColorEnum
.
Green
,
});
list
.
Add
(
excelDataSource
);
index
++;
}
list
.
Add
(
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"備考欄:"
)
{
IsBold
=
true
},
new
ExcelColumn
(
value
:
extModel
.
Remarks
,
colspan
:
5
)
{
FontColorEnum
=
ColorEnum
.
Red
,
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
},
}
});
list
.
Add
(
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"*迎えや送りは必要・不要となることは、必ず標記してください。"
,
colspan
:
6
)
{
FontColorEnum
=
ColorEnum
.
Red
,
IsBold
=
false
,
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
,
},
}
});
list
.
Add
(
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"*直接バス會社へ送付するので、必ず日本語でご記入ください。"
,
colspan
:
6
)
{
FontColorEnum
=
ColorEnum
.
Red
,
IsBold
=
false
,
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
,
},
}
});
#
endregion
var
fileStream
=
Common
.
Plugin
.
ExcelTempLateHelper
.
ToExcel
(
list
);
return
fileStream
;
}
/// <summary>
/// 用户购买力TOP排行
/// </summary>
...
...
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