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
87ef2099
Commit
87ef2099
authored
Jun 04, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
8751720a
1a955160
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
338 additions
and
48 deletions
+338
-48
RequestParm.cs
Mall.Common/API/RequestParm.cs
+5
-0
ExcelTempLateHelper.cs
Mall.Common/Plugin/ExcelTempLateHelper.cs
+0
-31
PayUtil.cs
Mall.WebApi/App_Code/PayUtil.cs
+71
-3
PublishController.cs
Mall.WebApi/Controllers/AppletWeChat/PublishController.cs
+24
-1
WeChatPayController.cs
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
+15
-4
ExportController.cs
Mall.WebApi/Controllers/Export/ExportController.cs
+52
-0
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+26
-1
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+145
-8
No files found.
Mall.Common/API/RequestParm.cs
View file @
87ef2099
...
...
@@ -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.Common/Plugin/ExcelTempLateHelper.cs
View file @
87ef2099
...
...
@@ -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/App_Code/PayUtil.cs
View file @
87ef2099
...
...
@@ -46,11 +46,10 @@ namespace Mall.WebApi.App_Code
/// <param name="CustomerId"></param>
/// <param name="openid"></param>
/// <returns></returns>
public
static
string
GetMinUnifiedOrder
(
string
sOrderNo
,
string
sProductName
,
decimal
dPrice
,
string
CustomerId
,
string
openid
,
RB_MiniProgram_Extend
model
,
IHttpContextAccessor
_accessor
,
string
IPAddress
)
public
static
string
GetMinUnifiedOrder
(
string
sOrderNo
,
string
sProductName
,
decimal
dPrice
,
string
CustomerId
,
string
openid
,
string
notify_url
,
RB_MiniProgram_Extend
model
,
IHttpContextAccessor
_accessor
,
string
IPAddress
)
{
var
req
=
new
Common
.
Pay
.
WeChatPat
.
RequestHandler
();
req
.
SetKey
(
model
.
WeChatApiSecret
);
//
req
.
SetParameter
(
"appid"
,
model
.
MiniAppId
);
//微信开放平台审核通过的应用APPID
req
.
SetParameter
(
"mch_id"
,
model
.
WeChatPayMerchants
);
//微信支付分配的商户号
req
.
SetParameter
(
"nonce_str"
,
GetNoncestr
());
//随机字符串,不长于32位
...
...
@@ -61,7 +60,7 @@ namespace Mall.WebApi.App_Code
req
.
SetParameter
(
"spbill_create_ip"
,
IPAddress
);
req
.
SetParameter
(
"time_start"
,
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
));
req
.
SetParameter
(
"time_expire"
,
DateTime
.
Now
.
AddMinutes
(
10
).
ToString
(
"yyyyMMddHHmmss"
));
req
.
SetParameter
(
"notify_url"
,
Config
.
sTenpayNotify
);
req
.
SetParameter
(
"notify_url"
,
notify_url
);
req
.
SetParameter
(
"trade_type"
,
"JSAPI"
);
req
.
SetParameter
(
"openid"
,
openid
);
req
.
SetParameter
(
"sign"
,
req
.
CreateMd5Sign
(
_accessor
,
model
.
WeChatApiSecret
));
...
...
@@ -494,6 +493,75 @@ namespace Mall.WebApi.App_Code
/// <summary>
/// 当面支付
/// </summary>
/// <param name="sOrderNo"></param>
/// <param name="dPrice"></param>
/// <param name="CustomerId"></param>
/// <param name="model"></param>
/// <param name="_accessor"></param>
/// <returns></returns>
public
static
BaseResult
GetNativeOrder
(
string
sOrderNo
,
decimal
dPrice
,
string
ProductName
,
string
CustomerId
,
RB_MiniProgram_Extend
model
,
string
IPAddress
,
IHttpContextAccessor
_accessor
)
{
var
req
=
new
Common
.
Pay
.
WeChatPat
.
RequestHandler
();
req
.
SetKey
(
model
.
WeChatApiSecret
);
req
.
SetParameter
(
"appid"
,
model
.
MiniAppId
);
//微信开放平台审核通过的应用APPID
req
.
SetParameter
(
"mch_id"
,
model
.
WeChatPayMerchants
);
//微信支付分配的商户号
req
.
SetParameter
(
"nonce_str"
,
GetNoncestr
());
//随机字符串,不长于32位
req
.
SetParameter
(
"out_trade_no"
,
sOrderNo
);
//商户订单号,需保持唯一性(只能是字母或者数字,不能包含有其它字符)
req
.
SetParameter
(
"body"
,
ProductName
);
req
.
SetParameter
(
"total_fee"
,
(
dPrice
*
100
).
ToString
(
"f0"
));
req
.
SetParameter
(
"spbill_create_ip"
,
IPAddress
);
req
.
SetParameter
(
"notify_url"
,
Config
.
sTenpayNotify
);
//回调地址20200604 后面用的时候修改,现在只是把支付调通
req
.
SetParameter
(
"trade_type"
,
"NATIVE"
);
//
req
.
SetParameter
(
"sign"
,
req
.
CreateMd5Sign
(
_accessor
,
model
.
WeChatApiSecret
));
var
reqXml
=
req
.
ParseXml
();
var
result
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
Post
(
new
HttpParam
()
{
Url
=
Mall
.
Common
.
Pay
.
WeChatPat
.
Model
.
ApiList
.
UnifiedOrderUrl
,
PostParam
=
reqXml
,
Encoding
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
GetRequestEncoding
(
_accessor
.
HttpContext
.
Request
),
});
var
xe
=
XElement
.
Parse
(
result
,
LoadOptions
.
SetLineInfo
);
var
returnCode
=
xe
.
GetElement
(
"return_code"
)
==
null
?
""
:
xe
.
GetElement
(
"return_code"
).
Value
;
var
returnMsg
=
xe
.
GetElement
(
"return_msg"
)
==
null
?
""
:
xe
.
GetElement
(
"return_msg"
).
Value
;
if
(
returnCode
.
Equals
(
"SUCCESS"
)
&&
returnCode
.
Equals
(
"SUCCESS"
))
{
var
code_url
=
xe
.
GetElement
(
"code_url"
)
==
null
?
""
:
xe
.
GetElement
(
"code_url"
).
Value
;
//在外面回写订单
return
new
BaseResult
()
{
IsSuccess
=
true
,
Data
=
new
Dictionary
<
string
,
string
>
{
{
"code_url"
,
code_url
}
}
};
}
//在外面回写订单
return
new
BaseResult
()
{
IsSuccess
=
false
,
Message
=
returnMsg
+
returnCode
,
Data
=
new
Dictionary
<
string
,
string
>
{
{
"code_url"
,
""
}
}
};
}
/// <summary>
/// 获取随机字符串
/// </summary>
...
...
Mall.WebApi/Controllers/AppletWeChat/PublishController.cs
View file @
87ef2099
...
...
@@ -128,7 +128,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
int
version
=
Convert
.
ToInt32
(
query
.
Version
.
Replace
(
"."
,
""
));
version
+=
1
;
query
.
Version
=
version
.
ToString
().
Substring
(
0
,
version
.
ToString
().
Length
-
2
)
+
"."
+
version
.
ToString
().
Substring
(
version
.
ToString
().
Length
-
2
,
1
)
+
"."
+
version
.
ToString
().
Substring
(
version
.
ToString
().
Length
-
1
,
1
);
query
.
Version
=
version
.
ToString
().
Substring
(
0
,
version
.
ToString
().
Length
-
2
)
+
"."
+
version
.
ToString
().
Substring
(
version
.
ToString
().
Length
-
2
,
1
)
+
"."
+
version
.
ToString
().
Substring
(
version
.
ToString
().
Length
-
1
,
1
);
string
URL
=
$"http://127.0.0.1:
{
developerKitsPort
}
/v2/upload?project=
{
Mall
.
Common
.
Plugin
.
StringHelper
.
UrlEncode
(
projectUrl
)}
&version=V
{
query
.
Version
}
&desc=微信开发者工具HTTP上传&appid=
{
model
.
MiniAppId
}
"
;
string
result
=
Mall
.
Common
.
Plugin
.
HttpHelper
.
HttpGet
(
URL
,
Encoding
.
UTF8
,
""
);
...
...
@@ -176,6 +176,29 @@ namespace Mall.WebApi.Controllers.AppletWeChat
/// <summary>
/// 当面付页面调转
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
HttpPost
]
public
virtual
ApiResult
GetNativeOrder
()
{
var
parms
=
RequestParm
;
var
query
=
new
RB_MiniProgram_Extend
{
TenantId
=
UserInfo
.
TenantId
,
MallBaseId
=
parms
.
MallBaseId
};
var
appletWeChatModel
=
appletWeChatModule
.
GetTenantListModule
(
query
).
FirstOrDefault
();
string
imgBase64
=
appletWeChatModule
.
GetWeiXinShare
(
appletWeChatModel
,
""
);
//页面暂时还未确定,确定后填入20200604 Add By:W
return
ApiResult
.
Success
(
""
,
imgBase64
);
}
/// <summary>
/// 订阅消息推送
/// </summary>
...
...
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
View file @
87ef2099
...
...
@@ -53,7 +53,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
{
var
request
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
// new AppletUserInfo();
if
(
userInfo
==
null
)
if
(
userInfo
==
null
)
{
return
ApiResult
.
Failed
(
"请登录"
);
}
...
...
@@ -96,7 +96,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
switch
((
int
)
demodel
.
OrderPayType
)
{
case
1
:
//微信支付 _accessor.HttpContext.Connection.RemoteIpAddress.ToString()
sPayInfo
=
App_Code
.
PayUtil
.
GetMinUnifiedOrder
(
sOrderNo
,
demodel
.
GoodsName
,
model
.
Income
.
Value
,
model
.
UserId
.
ToString
(),
demodel
.
OpenId
,
miniProgram
,
_accessor
,
System
.
Net
.
Dns
.
GetHostEntry
(
System
.
Net
.
Dns
.
GetHostName
()).
AddressList
.
FirstOrDefault
(
address
=>
address
.
AddressFamily
==
System
.
Net
.
Sockets
.
AddressFamily
.
InterNetwork
)?.
ToString
());
sPayInfo
=
App_Code
.
PayUtil
.
GetMinUnifiedOrder
(
sOrderNo
,
demodel
.
GoodsName
,
model
.
Income
.
Value
,
model
.
UserId
.
ToString
(),
demodel
.
OpenId
,
Config
.
sTenpayNotify
,
miniProgram
,
_accessor
,
System
.
Net
.
Dns
.
GetHostEntry
(
System
.
Net
.
Dns
.
GetHostName
()).
AddressList
.
FirstOrDefault
(
address
=>
address
.
AddressFamily
==
System
.
Net
.
Sockets
.
AddressFamily
.
InterNetwork
)?.
ToString
());
break
;
default
:
break
;
...
...
@@ -130,8 +130,19 @@ namespace Mall.WebApi.Controllers.AppletWeChat
RB_MiniProgram_Extend
miniProgram
=
new
RB_MiniProgram_Extend
();
//2020年5月26号新增
miniProgram
=
new
RB_MiniProgram_Extend
{
MiniAppId
=
"wxacd9f8cc3480d29e"
,
WeChatApiSecret
=
"936110e2c2214340b9829a3608bde6b0"
,
WeChatPayMerchants
=
"1562277941"
};
// programModule.GetMiniProgramModule(new RB_MiniProgram_Extend { MallBaseId = 1, TenantId =1 });
string
RefundOrderNo
=
"20200529160443264111"
;
var
Robj
=
App_Code
.
PayUtil
.
GetTransfersOrder
(
RefundOrderNo
,
Convert
.
ToDecimal
(
"0.01"
),
"21233"
,
"ow_7I5XC1-RGwwk8QANBmWKYKmOc"
,
miniProgram
,
_accessor
);
;
var
Robj
=
App_Code
.
PayUtil
.
GetTransfersOrder
(
RefundOrderNo
,
Convert
.
ToDecimal
(
"0.01"
),
"21233"
,
"ow_7I5XC1-RGwwk8QANBmWKYKmOc"
,
miniProgram
,
_accessor
);
;
return
ApiResult
.
Success
(
""
,
Robj
);
}
public
ApiResult
TestNativeOrder
()
{
RB_MiniProgram_Extend
miniProgram
=
new
RB_MiniProgram_Extend
();
//2020年5月26号新增
miniProgram
=
new
RB_MiniProgram_Extend
{
MiniAppId
=
"wxacd9f8cc3480d29e"
,
WeChatApiSecret
=
"936110e2c2214340b9829a3608bde6b0"
,
WeChatPayMerchants
=
"1562277941"
};
// programModule.GetMiniProgramModule(new RB_MiniProgram_Extend { MallBaseId = 1, TenantId =1 });
string
RefundOrderNo
=
System
.
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
);
var
Robj
=
App_Code
.
PayUtil
.
GetNativeOrder
(
RefundOrderNo
,
Convert
.
ToDecimal
(
"0.01"
),
"测试商品"
,
"21233"
,
miniProgram
,
System
.
Net
.
Dns
.
GetHostEntry
(
System
.
Net
.
Dns
.
GetHostName
()).
AddressList
.
FirstOrDefault
(
address
=>
address
.
AddressFamily
==
System
.
Net
.
Sockets
.
AddressFamily
.
InterNetwork
)?.
ToString
(),
_accessor
);
;
return
ApiResult
.
Success
(
""
,
Robj
);
}
}
...
...
Mall.WebApi/Controllers/Export/ExportController.cs
0 → 100644
View file @
87ef2099
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
Mall.WebApi.Controllers.User
;
using
Microsoft.AspNetCore.Mvc
;
namespace
Mall.WebApi.Controllers.Export
{
/// <summary>
/// 文件下载
/// </summary>
public
class
ExportController
:
BaseController
{
/// <summary>
/// 文件流下载
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
FileContentResult
DownLoad
()
{
string
fileName
=
"Test.xls"
;
try
{
var
downLoadRequest
=
RequestParm
;
//获取参数
if
(
downLoadRequest
.
cmd
!=
null
&&
!
string
.
IsNullOrEmpty
(
downLoadRequest
.
cmd
))
{
//商品购买力TOP排行
if
(
downLoadRequest
.
cmd
==
"getSalesGoodTop"
)
{
return
File
(
new
TenantController
().
DownLoadSalesGoods
(
downLoadRequest
),
"application/octet-stream"
,
fileName
);
}
//用户购买力TOP排行
if
(
downLoadRequest
.
cmd
==
"getSalesUserTop"
)
{
return
File
(
new
TenantController
().
DownLoadSalesUser
(
downLoadRequest
),
"application/octet-stream"
,
fileName
);
}
}
}
catch
(
Exception
ex
)
{
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/Mall/MallController.cs
View file @
87ef2099
...
...
@@ -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 @
87ef2099
...
...
@@ -154,7 +154,7 @@ namespace Mall.WebApi.Controllers.User
/// 用户注册第一步
/// </summary>
/// <returns></returns>
[
AllowAnonymous
]
[
AllowAnonymous
]
public
ApiResult
SetTenantFirst
()
{
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_Tenant_Extend
>(
RequestParm
.
msg
.
ToString
());
...
...
@@ -409,7 +409,7 @@ namespace Mall.WebApi.Controllers.User
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
MallBaseId
=
parms
.
GetInt
(
"MallBaseId"
,
0
);
int
isGetNav
=
parms
.
GetInt
(
"isGetNav"
,
0
);
var
extModel
=
programModule
.
GetMiniProgramModule
(
new
RB_MiniProgram_Extend
()
{
MallBaseId
=
MallBaseId
},
isGetNav
:
isGetNav
);
var
extModel
=
programModule
.
GetMiniProgramModule
(
new
RB_MiniProgram_Extend
()
{
MallBaseId
=
MallBaseId
},
isGetNav
:
isGetNav
);
return
ApiResult
.
Success
(
data
:
extModel
);
}
...
...
@@ -448,7 +448,7 @@ namespace Mall.WebApi.Controllers.User
/// <returns></returns>
public
ApiResult
GetMiniProgramMallIndex
()
{
var
data
=
programModule
.
GetMiniProgramModule
(
new
RB_MiniProgram_Extend
()
{
MallBaseId
=
RequestParm
.
MallBaseId
},
isGetHomeData
:
true
);
var
data
=
programModule
.
GetMiniProgramModule
(
new
RB_MiniProgram_Extend
()
{
MallBaseId
=
RequestParm
.
MallBaseId
},
isGetHomeData
:
true
);
List
<
object
>
resultList
=
new
List
<
object
>();
List
<
object
>
normalList
=
new
List
<
object
>();
...
...
@@ -531,8 +531,13 @@ namespace Mall.WebApi.Controllers.User
name
=
"常用"
,
list
=
normalList
});
var
categoryList
=
productModule
.
GetCategoryListModule
(
new
Model
.
Extend
.
Product
.
RB_Product_Category_Extend
()
{
MallBaseId
=
RequestParm
.
MallBaseId
,
TenantId
=
RequestParm
.
TenantId
,
Tier
=
1
,
IsShow
=
1
,
Enabled
=
1
var
categoryList
=
productModule
.
GetCategoryListModule
(
new
Model
.
Extend
.
Product
.
RB_Product_Category_Extend
()
{
MallBaseId
=
RequestParm
.
MallBaseId
,
TenantId
=
RequestParm
.
TenantId
,
Tier
=
1
,
IsShow
=
1
,
Enabled
=
1
});
List
<
object
>
catList
=
new
List
<
object
>();
catList
.
Add
(
new
...
...
@@ -1170,7 +1175,7 @@ namespace Mall.WebApi.Controllers.User
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
DetailId
=
parms
.
GetStringValue
(
"DetailId"
);
var
flag
=
programModule
.
DeleteMiniProgramUserCenterMenuModule
(
DetailIds
:
DetailId
,
MallBaseId
:
0
);
var
flag
=
programModule
.
DeleteMiniProgramUserCenterMenuModule
(
DetailIds
:
DetailId
,
MallBaseId
:
0
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -1181,7 +1186,7 @@ namespace Mall.WebApi.Controllers.User
public
ApiResult
RemoveMiniUserCenterMenuByMallId
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
flag
=
programModule
.
DeleteMiniProgramUserCenterMenuModule
(
DetailIds
:
""
,
MallBaseId
:
RequestParm
.
MallBaseId
);
var
flag
=
programModule
.
DeleteMiniProgramUserCenterMenuModule
(
DetailIds
:
""
,
MallBaseId
:
RequestParm
.
MallBaseId
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
...
...
@@ -1367,7 +1372,7 @@ namespace Mall.WebApi.Controllers.User
/// </summary>
/// <returns></returns>
public
ApiResult
MallIndexStatistics
()
{
{
var
query
=
JsonConvert
.
DeserializeObject
<
StatisticsQuery
>(
RequestParm
.
msg
.
ToString
());
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
query
.
TenantId
=
RequestParm
.
TenantId
;
...
...
@@ -1401,6 +1406,72 @@ namespace Mall.WebApi.Controllers.User
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 下载商品购买力TOP排行
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
virtual
byte
[]
DownLoadSalesGoods
(
RequestParm
request
)
{
var
query
=
JsonConvert
.
DeserializeObject
<
StatisticsQuery
>(
request
.
msg
.
ToString
());
query
.
MallBaseId
=
request
.
MallBaseId
;
query
.
TenantId
=
request
.
TenantId
;
var
dataList
=
programModule
.
MallIndesSalesIncomeStatisticsModule
(
query
);
#
region
文件下载
List
<
ExcelDataSource
>
list
=
new
List
<
ExcelDataSource
>();
ExcelDataSource
header
=
new
ExcelDataSource
(
30
)
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"序号"
)
{
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
,
IsBold
=
true
},
new
ExcelColumn
(
value
:
"商品"
)
{
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
,
IsBold
=
true
,
CellWidth
=
30
,
},
new
ExcelColumn
(
value
:
"销售额"
)
{
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
,
IsBold
=
true
,
CellWidth
=
20
},
new
ExcelColumn
(
value
:
"销售量"
)
{
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
,
IsBold
=
true
,
CellWidth
=
20
}
}
};
list
.
Add
(
header
);
foreach
(
var
item
in
dataList
)
{
var
ExcelDataRow
=
new
List
<
ExcelColumn
>();
ExcelDataRow
.
Add
(
new
ExcelColumn
(
value
:
item
.
Num
.
ToString
()));
ExcelDataRow
.
Add
(
new
ExcelColumn
(
value
:
item
.
GoodsName
));
ExcelDataRow
.
Add
(
new
ExcelColumn
(
value
:
item
.
Income
.
ToString
()));
ExcelDataRow
.
Add
(
new
ExcelColumn
(
value
:
item
.
SaleCount
.
ToString
()));
ExcelDataSource
dataRow
=
new
ExcelDataSource
(
30
)
{
ExcelRows
=
ExcelDataRow
};
list
.
Add
(
dataRow
);
}
#
endregion
var
fileStream
=
Common
.
Plugin
.
ExcelTempLateHelper
.
ToExcel
(
list
);
return
fileStream
;
}
/// <summary>
/// 用户购买力TOP排行
/// </summary>
...
...
@@ -1413,6 +1484,72 @@ namespace Mall.WebApi.Controllers.User
var
list
=
programModule
.
MallIndesSalesUserStatisticsModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 用户购买力TOP排行
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public
virtual
byte
[]
DownLoadSalesUser
(
RequestParm
request
)
{
var
query
=
JsonConvert
.
DeserializeObject
<
StatisticsQuery
>(
request
.
msg
.
ToString
());
query
.
MallBaseId
=
request
.
MallBaseId
;
query
.
TenantId
=
request
.
TenantId
;
var
dataList
=
programModule
.
MallIndesSalesUserStatisticsModule
(
query
);
#
region
文件下载
List
<
ExcelDataSource
>
list
=
new
List
<
ExcelDataSource
>();
ExcelDataSource
header
=
new
ExcelDataSource
(
30
)
{
ExcelRows
=
new
List
<
ExcelColumn
>()
{
new
ExcelColumn
(
value
:
"序号"
)
{
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
,
IsBold
=
true
},
new
ExcelColumn
(
value
:
"用户"
)
{
HAlignmentEnum
=
HAlignmentEnum
.
LEFT
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
,
IsBold
=
true
,
CellWidth
=
25
},
new
ExcelColumn
(
value
:
"支付金额"
)
{
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
,
IsBold
=
true
,
CellWidth
=
20
},
new
ExcelColumn
(
value
:
"支付件数"
)
{
HAlignmentEnum
=
HAlignmentEnum
.
CENTER
,
VAlignmentEnum
=
VAlignmentEnum
.
CENTER
,
IsBold
=
true
,
CellWidth
=
20
}
}
};
list
.
Add
(
header
);
foreach
(
var
item
in
dataList
)
{
var
ExcelDataRow
=
new
List
<
ExcelColumn
>();
ExcelDataRow
.
Add
(
new
ExcelColumn
(
value
:
item
.
Num
.
ToString
()));
ExcelDataRow
.
Add
(
new
ExcelColumn
(
value
:
item
.
UserName
));
ExcelDataRow
.
Add
(
new
ExcelColumn
(
value
:
item
.
Income
.
ToString
()));
ExcelDataRow
.
Add
(
new
ExcelColumn
(
value
:
item
.
SaleCount
.
ToString
()));
ExcelDataSource
dataRow
=
new
ExcelDataSource
(
30
)
{
ExcelRows
=
ExcelDataRow
};
list
.
Add
(
dataRow
);
}
#
endregion
var
fileStream
=
Common
.
Plugin
.
ExcelTempLateHelper
.
ToExcel
(
list
);
return
fileStream
;
}
#
endregion
}
}
\ 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