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
70b69403
Commit
70b69403
authored
May 08, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交微信发布
parent
c462abac
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
411 additions
and
19 deletions
+411
-19
Config.cs
Mall.Common/Config.cs
+22
-0
IntegralExportEnum.cs
Mall.Common/Enum/MarketingCenter/IntegralExportEnum.cs
+54
-0
RB_Member_Integral.cs
Mall.Model/Entity/User/RB_Member_Integral.cs
+4
-1
RB_Member_Integral_Extend.cs
Mall.Model/Extend/User/RB_Member_Integral_Extend.cs
+9
-3
IntegralModule.cs
Mall.Module.MarketingCenter/IntegralModule.cs
+15
-0
RB_Member_BalanceRepository.cs
Mall.Repository/User/RB_Member_BalanceRepository.cs
+7
-3
RB_Member_IntegralRepository.cs
Mall.Repository/User/RB_Member_IntegralRepository.cs
+47
-2
RB_Member_UserRepository.cs
Mall.Repository/User/RB_Member_UserRepository.cs
+5
-5
PublishController.cs
Mall.WebApi/Controllers/AppletWeChat/PublishController.cs
+128
-0
CouponController.cs
Mall.WebApi/Controllers/MarketingCenter/CouponController.cs
+5
-5
IntegralController.cs
....WebApi/Controllers/MarketingCenter/IntegralController.cs
+97
-0
RechargeController.cs
....WebApi/Controllers/MarketingCenter/RechargeController.cs
+16
-0
appsettings.json
Mall.WebApi/appsettings.json
+2
-0
No files found.
Mall.Common/Config.cs
View file @
70b69403
...
...
@@ -287,5 +287,27 @@ namespace Mall.Common
}
}
/// <summary>
/// 小程序发布程序路径
/// </summary>
public
static
string
ProjectUrl
{
get
{
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"ProjectUrl"
).
Value
;
}
}
/// <summary>
/// 小程序开发工具端口号
/// </summary>
public
static
string
DeveloperKitsPort
{
get
{
return
new
ConfigurationBuilder
().
Add
(
new
JsonConfigurationSource
{
Path
=
"appsettings.json"
}).
Build
().
GetSection
(
"DeveloperKitsPort"
).
Value
;
}
}
}
}
\ No newline at end of file
Mall.Common/Enum/MarketingCenter/IntegralExportEnum.cs
0 → 100644
View file @
70b69403
using
Mall.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Common.Enum.MarketingCenter
{
public
enum
IntegralExportEnum
{
/// 所属平台
/// </summary>
[
EnumField
(
"所属平台"
)]
SSPT
=
1
,
/// <summary>
/// 用户ID
/// </summary>
[
EnumField
(
"用户ID"
)]
ID
=
2
,
/// <summary>
/// 用户昵称
/// </summary>
[
EnumField
(
"用户昵称"
)]
YHNC
=
3
,
/// <summary>
/// 用户手机号
/// </summary>
[
EnumField
(
"用户手机号"
)]
SJHM
=
4
,
/// <summary>
/// 充值积分
/// </summary>
[
EnumField
(
"充值积分"
)]
JF
=
5
,
/// <summary>
/// 充值时间
/// </summary>
[
EnumField
(
"充值时间"
)]
CZSJ
=
6
,
/// <summary>
/// 说明
/// </summary>
[
EnumField
(
"说明"
)]
Explain
=
7
,
}
}
Mall.Model/Entity/User/RB_Member_Integral.cs
View file @
70b69403
...
...
@@ -37,7 +37,10 @@ namespace Mall.Model.Entity.User
}
/// <summary>
/// 平台类型
/// </summary>
public
UserSourceEnum
?
PlatformType
{
get
;
set
;
}
/// <summary>
/// 积分
...
...
Mall.Model/Extend/User/RB_Member_Integral_Extend.cs
View file @
70b69403
...
...
@@ -19,6 +19,11 @@ namespace Mall.Model.Extend.User
/// </summary>
public
string
MemberName
{
get
;
set
;
}
/// <summary>
/// 手机号码
/// </summary>
public
string
Moblie
{
get
;
set
;
}
/// <summary>
/// 开始时间【查询使用】
/// </summary>
...
...
@@ -29,10 +34,11 @@ namespace Mall.Model.Extend.User
/// </summary>
public
string
EndDate
{
get
;
set
;
}
/// <summary>
///
平台类型
///
下载枚举
/// </summary>
public
UserSourceEnum
?
PlatformType
{
get
;
set
;
}
public
List
<
int
>
ExcelEnumIds
{
get
;
set
;
}
}
}
Mall.Module.MarketingCenter/IntegralModule.cs
View file @
70b69403
...
...
@@ -64,6 +64,21 @@ namespace Mall.Module.MarketingCenter
}
/// <summary>
/// 营销中心-积分记录导出
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Member_Integral_Extend
>
GetIntegralRecordExport
(
RB_Member_Integral_Extend
query
)
{
return
recordRepository
.
GetIntegralExport
(
query
);
}
/// <summary>
/// 数据统计-积分收支
/// </summary>
...
...
Mall.Repository/User/RB_Member_BalanceRepository.cs
View file @
70b69403
...
...
@@ -109,21 +109,25 @@ namespace Mall.Repository.User
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Member_Balance_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
Tenant
Id
>
0
)
if
(
query
.
MallBase
Id
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Member_Balance_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
PlatformType
>
0
)
{
builder
.
Append
(
$" AND b.
{
nameof
(
RB_Member_Balance_Extend
.
PlatformType
)}
=
{
query
.
PlatformType
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
MemberName
))
{
builder
.
Append
(
$" AND b.
{
nameof
(
RB_Member_Balance_Extend
.
MemberName
)}
like '%
{
query
.
MemberName
}
%'"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
StartDate
))
{
builder
.
Append
(
$" AND DATE_FORMAT(a.
{
nameof
(
RB_Member_Balance_Extend
.
CreateDate
)}
,'%Y-%m-%d' )>= DATE_FORMAT('
{
nameof
(
RB_Member_Balance_Extend
.
StartDate
)
}
','%Y-%m-%d' )"
);
builder
.
Append
(
$" AND DATE_FORMAT(a.
{
nameof
(
RB_Member_Balance_Extend
.
CreateDate
)}
,'%Y-%m-%d' )>= DATE_FORMAT('
{
query
.
StartDate
}
','%Y-%m-%d' )"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
EndDate
))
{
builder
.
Append
(
$" AND DATE_FORMAT(a.
{
nameof
(
RB_Member_Balance_Extend
.
CreateDate
)}
,'%Y-%m-%d' )<= DATE_FORMAT('
{
nameof
(
RB_Member_Balance_Extend
.
EndDate
)
}
','%Y-%m-%d' )"
);
builder
.
Append
(
$" AND DATE_FORMAT(a.
{
nameof
(
RB_Member_Balance_Extend
.
CreateDate
)}
,'%Y-%m-%d' )<= DATE_FORMAT('
{
query
.
EndDate
}
','%Y-%m-%d' )"
);
}
}
return
GetPage
<
RB_Member_Balance_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
...
...
Mall.Repository/User/RB_Member_IntegralRepository.cs
View file @
70b69403
...
...
@@ -85,7 +85,7 @@ namespace Mall.Repository.User
}
if
(
dmodel
.
PlatformType
>
0
)
{
where
+=
$" AND b.
{
nameof
(
RB_Member_User
.
Source
)}
=
{
dmodel
.
PlatformType
}
"
;
where
+=
$" AND b.
{
nameof
(
RB_Member_User
.
Source
)}
=
{
(
int
)
dmodel
.
PlatformType
}
"
;
}
if
(!
string
.
IsNullOrWhiteSpace
(
dmodel
.
StartDate
))
{
...
...
@@ -128,7 +128,7 @@ namespace Mall.Repository.User
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
MemberName
))
{
builder
.
Append
(
$" AND b.
{
nameof
(
RB_Member_
Integral_Extend
.
Member
Name
)}
like '%
{
query
.
MemberName
}
%'"
);
builder
.
Append
(
$" AND b.
{
nameof
(
RB_Member_
User
.
Name
)}
like '%
{
query
.
MemberName
}
%'"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
StartDate
))
{
...
...
@@ -141,6 +141,51 @@ namespace Mall.Repository.User
}
return
GetPage
<
RB_Member_Integral_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 营销中心-积分记录导出
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Member_Integral_Extend
>
GetIntegralExport
(
RB_Member_Integral_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
$" SELECT a.*,b.`Name` as MemberName,b.Moblie FROM
{
TableName
}
as a LEFT JOIN
{
MemberTableName
}
as b on a.UserId = b.Id WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
Id
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Member_Integral_Extend
.
Id
)}
=
{
query
.
Id
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Member_Integral_Extend
.
TenantId
)}
=
{
query
.
TenantId
}
"
);
}
if
(
query
.
MallBaseId
>
0
)
{
builder
.
Append
(
$" AND a.
{
nameof
(
RB_Member_Integral_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
MemberName
))
{
builder
.
Append
(
$" AND b.
{
nameof
(
RB_Member_User
.
Name
)}
like '%
{
query
.
MemberName
}
%'"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
StartDate
))
{
builder
.
Append
(
$" AND DATE_FORMAT(a.
{
nameof
(
RB_Member_Integral_Extend
.
CreateDate
)}
,'%Y-%m-%d' )>= DATE_FORMAT('
{
query
.
StartDate
}
','%Y-%m-%d' )"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
EndDate
))
{
builder
.
Append
(
$" AND DATE_FORMAT(a.
{
nameof
(
RB_Member_Integral_Extend
.
CreateDate
)}
,'%Y-%m-%d' )<= DATE_FORMAT('
{
query
.
EndDate
}
','%Y-%m-%d' )"
);
}
}
return
Get
<
RB_Member_Integral_Extend
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 数据统计-积分收支
/// </summary>
...
...
Mall.Repository/User/RB_Member_UserRepository.cs
View file @
70b69403
...
...
@@ -267,13 +267,13 @@ WHERE u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and u.SuperiorId ={use
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
//
if (dmodel.Id > 0)
//
{
//
where += $@" and {nameof(RB_Member_User.Id)}={dmodel.Id}";
//
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Name
)}
like '%
{
dmodel
.
Name
}
%'
"
;
where
+=
$@" and
(
{
nameof
(
RB_Member_User
.
Name
)}
like '%
{
dmodel
.
Name
}
%' or
{
nameof
(
RB_Member_User
.
Id
)}
like '%
{
dmodel
.
Name
}
%')
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
AliasName
))
{
...
...
Mall.WebApi/Controllers/AppletWeChat/PublishController.cs
0 → 100644
View file @
70b69403
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.Model.Entity.AppletWeChat
;
using
Mall.Module.AppletWeChat
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
Newtonsoft.Json.Linq
;
namespace
Mall.WebApi.Controllers.AppletWeChat
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
PublishController
:
BaseController
{
private
AppletWeChatModule
appletWeChatModule
=
new
AppletWeChatModule
();
string
projectUrl
=
Mall
.
Common
.
Config
.
ProjectUrl
;
string
developerKitsPort
=
Mall
.
Common
.
Config
.
DeveloperKitsPort
;
/// <summary>
/// 发布微信小程序获取登录二维码
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetLoginAppletWeChat
()
{
var
parms
=
RequestParm
;
var
query
=
new
RB_AppletWeChat
();
query
.
TenantId
=
UserInfo
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
model
=
appletWeChatModule
.
GetAppletWeChatList
(
query
).
FirstOrDefault
();
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"您还未配置微信小程序基础信息"
);
}
try
{
string
URL
=
$"http://127.0.0.1:
{
developerKitsPort
}
/v2/login?qr-format=base64&project=&appid=
{
model
.
AppId
}
&ext-appid="
;
string
result
=
Mall
.
Common
.
Plugin
.
HttpHelper
.
HttpGet
(
URL
,
Encoding
.
UTF8
,
""
);
JObject
parmsJob
=
JObject
.
Parse
(
result
);
string
imgUrl
=
parmsJob
.
GetValue
(
"qrcode"
).
ToString
();
if
(
parmsJob
.
ContainsKey
(
"code"
))
{
return
ApiResult
.
Failed
(
parmsJob
.
GetValue
(
"message"
).
ToString
());
}
return
ApiResult
.
Success
(
"获取成功"
,
imgUrl
);
}
catch
(
Exception
ex
)
{
return
ApiResult
.
Failed
(
"获取登录二维码识别"
);
}
}
/// <summary>
/// 获取项目预览二维码
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetPreviewAppletWeChat
()
{
try
{
string
URL
=
$"http://127.0.0.1:
{
developerKitsPort
}
/v2/preview?project=
{
Mall
.
Common
.
Plugin
.
StringHelper
.
UrlEncode
(
projectUrl
)}
&qr-format=base64"
;
string
result
=
Mall
.
Common
.
Plugin
.
HttpHelper
.
HttpGet
(
URL
,
Encoding
.
UTF8
,
""
);
JObject
parmsJob
=
JObject
.
Parse
(
result
);
if
(
parmsJob
.
ContainsKey
(
"code"
))
{
return
ApiResult
.
Failed
(
parmsJob
.
GetValue
(
"message"
).
ToString
());
}
if
(!
result
.
Contains
(
"data:image/png;base64,"
))
{
result
=
"data:image/png;base64,"
+
result
;
}
return
ApiResult
.
Success
(
"获取成功"
,
result
);
}
catch
(
Exception
ex
)
{
return
ApiResult
.
Failed
(
"获取登录二维码识别"
);
}
}
/// <summary>
/// 获取项目预览二维码
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetPuploadAppletWeChat
()
{
var
parms
=
RequestParm
;
var
query
=
new
RB_AppletWeChat
();
query
.
TenantId
=
UserInfo
.
TenantId
;
query
.
MallBaseId
=
parms
.
MallBaseId
;
var
model
=
appletWeChatModule
.
GetAppletWeChatList
(
query
).
FirstOrDefault
();
if
(
model
==
null
)
{
return
ApiResult
.
Failed
(
"您还未配置微信小程序基础信息"
);
}
try
{
string
URL
=
$"http://127.0.0.1:
{
developerKitsPort
}
/v2/upload?project=
{
Mall
.
Common
.
Plugin
.
StringHelper
.
UrlEncode
(
projectUrl
)}
&version=v1.0.0&desc=微信开发者工具HTTP上传&appid=
{
model
.
AppId
}
"
;
string
result
=
Mall
.
Common
.
Plugin
.
HttpHelper
.
HttpGet
(
URL
,
Encoding
.
UTF8
,
""
);
JObject
parmsJob
=
JObject
.
Parse
(
result
);
if
(
parmsJob
.
ContainsKey
(
"code"
))
{
return
ApiResult
.
Failed
(
parmsJob
.
GetValue
(
"message"
).
ToString
());
}
return
ApiResult
.
Success
(
"上传成功"
,
result
);
}
catch
(
Exception
ex
)
{
return
ApiResult
.
Failed
(
"上传失败"
);
}
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/MarketingCenter/CouponController.cs
View file @
70b69403
...
...
@@ -45,12 +45,12 @@ namespace Mall.WebApi.Controllers.MarketingCenter
x
.
Name
,
x
.
HeXiao
,
x
.
CouponIco
,
x
.
StartDate
,
StartDate
=
x
.
StartDate
.
HasValue
?
x
.
StartDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
x
.
IndateType
,
x
.
IndateDay
,
x
.
EndDate
,
EndDate
=
x
.
EndDate
.
HasValue
?
x
.
EndDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
,
CreateDate
=
x
.
CreateDate
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
});
});
;
return
ApiResult
.
Success
(
""
,
pagelist
);
}
...
...
@@ -114,7 +114,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
{
return
ApiResult
.
Failed
(
"开始日期或结束日期必填"
);
}
if
(
query
.
StartDate
<
query
.
EndDate
)
if
(
query
.
StartDate
>
query
.
EndDate
)
{
return
ApiResult
.
Failed
(
"开始日期必须小于结束日期"
);
}
...
...
@@ -194,7 +194,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
x
.
Name
,
x
.
MinConsumePrice
,
x
.
DiscountsPrice
,
x
.
UseType
,
UseTypeStr
=
Mall
.
Common
.
Plugin
.
EnumHelper
.
GetEnumName
(
x
.
UseType
)
,
x
.
CouponType
,
x
.
StartDate
,
x
.
IndateType
,
...
...
Mall.WebApi/Controllers/MarketingCenter/IntegralController.cs
View file @
70b69403
...
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.Common.Enum.MarketingCenter
;
using
Mall.Common.Plugin
;
using
Mall.Model.Entity.MarketingCenter
;
using
Mall.Model.Extend.MarketingCenter
;
...
...
@@ -112,6 +113,102 @@ namespace Mall.WebApi.Controllers.MarketingCenter
return
ApiResult
.
Success
(
""
,
pagelist
);
}
[
HttpPost
]
public
FileContentResult
GetDistributorRemitListToExcel
()
{
var
parms
=
RequestParm
;
RB_Member_Integral_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Member_Integral_Extend
>(
parms
.
msg
.
ToString
());
string
ExcelName
=
"积分记录"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
)
+
".xls"
;
List
<
ExcelDataSource
>
slist
=
new
List
<
ExcelDataSource
>();
if
(
demodel
.
ExcelEnumIds
==
null
||
!
demodel
.
ExcelEnumIds
.
Any
())
{
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
ExcelName
);
}
var
Enumlist
=
EnumHelper
.
GetEnumList
(
typeof
(
IntegralExportEnum
));
ExcelDataSource
header
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
"序号"
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
}
}
};
foreach
(
var
item
in
demodel
.
ExcelEnumIds
)
{
var
Name
=
Enumlist
.
Where
(
x
=>
x
.
Value
==
item
.
ToString
()).
FirstOrDefault
().
Key
??
""
;
header
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
Name
)
{
CellWidth
=
15
,
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
});
}
slist
.
Add
(
header
);
try
{
demodel
.
TenantId
=
Convert
.
ToInt32
(
parms
.
uid
);
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
IntegralModule
.
GetIntegralRecordExport
(
demodel
);
#
region
组装数据
int
Num
=
0
;
foreach
(
var
item
in
list
)
{
Num
++;
ExcelDataSource
datarow
=
new
ExcelDataSource
()
{
ExcelRows
=
new
List
<
ExcelColumn
>(
30
)
{
new
ExcelColumn
(
value
:
Num
.
ToString
()){
},
}
};
foreach
(
var
qitem
in
demodel
.
ExcelEnumIds
)
{
switch
(
qitem
)
{
case
1
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
PlatformType
.
GetEnumName
())
{
});
break
;
case
2
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
UserId
.
ToString
())
{
});
break
;
case
3
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
MemberName
??
""
)
{
});
break
;
case
4
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
(
item
.
Moblie
).
ToString
())
{
});
break
;
case
5
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
Type
.
GetEnumName
()
+
(
item
.
Integral
??
0
).
ToString
())
{
});
break
;
case
6
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd"
))
{
});
break
;
case
7
:
datarow
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
Description
)
{
});
break
;
}
}
slist
.
Add
(
datarow
);
}
#
endregion
var
byteData
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData
,
"application/octet-stream"
,
ExcelName
);
}
catch
(
Exception
ex
)
{
LogHelper
.
Write
(
ex
,
string
.
Format
(
"GetFileFromWebApi_requestData: {0}"
,
JsonHelper
.
Serialize
(
RequestParm
)));
var
byteData1
=
ExcelTempLateHelper
.
ToExcelExtend
(
slist
);
return
File
(
byteData1
,
"application/octet-stream"
,
ExcelName
);
}
}
/// <summary>
/// 获取积分记录下载枚举列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetIntegralExportEnumList
()
{
var
list
=
EnumHelper
.
GetEnumList
(
typeof
(
IntegralExportEnum
));
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
Name
=
x
.
Key
,
Id
=
Convert
.
ToInt32
(
x
.
Value
)
}));
}
#
endregion
...
...
Mall.WebApi/Controllers/MarketingCenter/RechargeController.cs
View file @
70b69403
...
...
@@ -316,6 +316,22 @@ namespace Mall.WebApi.Controllers.MarketingCenter
}
/// <summary>
/// 获取余额收支下载枚举列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetBalanceExportEnumList
()
{
var
list
=
EnumHelper
.
GetEnumList
(
typeof
(
BalanceExportEnum
));
return
ApiResult
.
Success
(
""
,
list
.
Select
(
x
=>
new
{
Name
=
x
.
Key
,
Id
=
Convert
.
ToInt32
(
x
.
Value
)
}));
}
#
endregion
}
}
\ No newline at end of file
Mall.WebApi/appsettings.json
View file @
70b69403
...
...
@@ -21,6 +21,8 @@
"ImSecret"
:
"66000451fb72"
,
"Mongo"
:
"mongodb://192.168.2.214:27017"
,
"MongoDBName"
:
"Mall"
,
"ProjectUrl"
:
"D:/project/GitProject/tripfriend"
,
"DeveloperKitsPort"
:
"54333"
,
"RedisSetting"
:
{
"RedisServer"
:
"192.168.2.214"
,
"RedisPort"
:
"6379"
,
...
...
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