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
83ffc508
Commit
83ffc508
authored
Jun 01, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
cf26709d
fb4d1339
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
51 deletions
+45
-51
ResponseHandler.cs
Mall.Common/Pay/WeChatPat/ResponseHandler.cs
+12
-29
RB_Member_DiscountCoupon.cs
Mall.Model/Entity/User/RB_Member_DiscountCoupon.cs
+1
-1
UserModule.cs
Mall.Module.User/UserModule.cs
+3
-3
PublishController.cs
Mall.WebApi/Controllers/AppletWeChat/PublishController.cs
+29
-18
No files found.
Mall.Common/Pay/WeChatPat/ResponseHandler.cs
View file @
83ffc508
...
@@ -27,14 +27,13 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -27,14 +27,13 @@ namespace Mall.Common.Pay.WeChatPat
/// </summary>
/// </summary>
private
const
string
Charset
=
"utf-8"
;
private
const
string
Charset
=
"utf-8"
;
/// <summary>
///
public
Hashtable
XmlMap
{
get
;
}
/// </summary>
private
Hashtable
xmlMap
;
/// <summary>
/// <summary>
/// 获取页面提交的
get和post
参数
/// 获取页面提交的参数
/// </summary>
/// </summary>
/// <param name="_accessor"></param>
public
ResponseHandler
(
IHttpContextAccessor
_accessor
)
public
ResponseHandler
(
IHttpContextAccessor
_accessor
)
{
{
xmlMap
=
new
Hashtable
();
xmlMap
=
new
Hashtable
();
...
@@ -51,9 +50,9 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -51,9 +50,9 @@ namespace Mall.Common.Pay.WeChatPat
//接收从微信后台POST过来的数据
//接收从微信后台POST过来的数据
System
.
IO
.
Stream
s
=
_accessor
.
HttpContext
.
Request
.
Body
;
System
.
IO
.
Stream
s
=
_accessor
.
HttpContext
.
Request
.
Body
;
int
count
=
0
;
byte
[]
buffer
=
new
byte
[
1024
];
byte
[]
buffer
=
new
byte
[
1024
];
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
int
count
;
while
((
count
=
s
.
Read
(
buffer
,
0
,
1024
))
>
0
)
while
((
count
=
s
.
Read
(
buffer
,
0
,
1024
))
>
0
)
{
{
builder
.
Append
(
Encoding
.
UTF8
.
GetString
(
buffer
,
0
,
count
));
builder
.
Append
(
Encoding
.
UTF8
.
GetString
(
buffer
,
0
,
count
));
...
@@ -73,11 +72,12 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -73,11 +72,12 @@ namespace Mall.Common.Pay.WeChatPat
XmlNodeList
nodes
=
xmlNode
.
ChildNodes
;
XmlNodeList
nodes
=
xmlNode
.
ChildNodes
;
foreach
(
XmlNode
xn
in
nodes
)
foreach
(
XmlNode
xn
in
nodes
)
{
{
x
mlMap
.
Add
(
xn
.
Name
,
xn
.
InnerText
);
X
mlMap
.
Add
(
xn
.
Name
,
xn
.
InnerText
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"ResponseHandler"
);
//若签名错误,则立即返回结果给微信支付后台
//若签名错误,则立即返回结果给微信支付后台
Plugin
.
LogHelper
.
Error
(
$"ResponseHandler xml错误"
,
ex
);
Plugin
.
LogHelper
.
Error
(
$"ResponseHandler xml错误"
,
ex
);
}
}
...
@@ -117,27 +117,10 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -117,27 +117,10 @@ namespace Mall.Common.Pay.WeChatPat
/// <returns></returns>
/// <returns></returns>
public
string
GetParameter
(
string
parameter
)
public
string
GetParameter
(
string
parameter
)
{
{
var
s
=
(
string
)
x
mlMap
[
parameter
];
var
s
=
(
string
)
X
mlMap
[
parameter
];
return
s
??
""
;
return
s
??
""
;
}
}
/// <summary>
/// 设置参数值
/// </summary>
/// <param name="parameter"></param>
/// <param name="parameterValue"></param>
public
void
SetParameter
(
string
parameter
,
string
parameterValue
)
{
//if (parameter != null && parameter != "")
//{
// if (parameters.Contains(parameter))
// {
// parameters.Remove(parameter);
// }
// parameters.Add(parameter, parameterValue);
//}
}
/// <summary>
/// <summary>
/// 判断微信签名
/// 判断微信签名
/// </summary>
/// </summary>
...
@@ -146,11 +129,11 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -146,11 +129,11 @@ namespace Mall.Common.Pay.WeChatPat
{
{
var
sb
=
new
StringBuilder
();
var
sb
=
new
StringBuilder
();
var
signMap
=
new
Hashtable
();
var
signMap
=
new
Hashtable
();
foreach
(
string
k
in
x
mlMap
.
Keys
)
foreach
(
string
k
in
X
mlMap
.
Keys
)
{
{
if
(
k
!=
"sign"
)
if
(
k
!=
"sign"
)
{
{
signMap
.
Add
(
k
.
ToLower
(),
x
mlMap
[
k
]);
signMap
.
Add
(
k
.
ToLower
(),
X
mlMap
[
k
]);
}
}
}
}
var
akeys
=
new
ArrayList
(
signMap
.
Keys
);
var
akeys
=
new
ArrayList
(
signMap
.
Keys
);
...
@@ -162,8 +145,8 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -162,8 +145,8 @@ namespace Mall.Common.Pay.WeChatPat
}
}
sb
.
Append
(
"key="
+
this
.
_key
);
sb
.
Append
(
"key="
+
this
.
_key
);
var
sign
=
Plugin
.
SecurityHelper
.
MD5EncryptWeChat
(
sb
.
ToString
(),
Charset
).
ToUpper
();
var
sign
=
Plugin
.
SecurityHelper
.
MD5EncryptWeChat
(
sb
.
ToString
(),
Charset
).
ToUpper
();
error
=
"sign = "
+
sign
+
"\r\n xmlMap[sign]="
+
x
mlMap
[
"sign"
].
ToString
();
error
=
"sign = "
+
sign
+
"\r\n xmlMap[sign]="
+
X
mlMap
[
"sign"
].
ToString
();
return
sign
.
Equals
(
x
mlMap
[
"sign"
]);
return
sign
.
Equals
(
X
mlMap
[
"sign"
]);
}
}
///// <summary>
///// <summary>
...
...
Mall.Model/Entity/User/RB_Member_DiscountCoupon.cs
View file @
83ffc508
...
@@ -102,7 +102,7 @@ namespace Mall.Model.Entity.User
...
@@ -102,7 +102,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// <summary>
/// 领取方式0-自行领取(领劵中心领取),1-分享,2-购买并付款,3-新人领取
/// 领取方式0-自行领取(领劵中心领取),1-分享,2-购买并付款,3-新人领取
/// </summary>
/// </summary>
public
int
GetType
{
get
;
set
;
}
public
new
int
GetType
{
get
;
set
;
}
/// <summary>
/// <summary>
...
...
Mall.Module.User/UserModule.cs
View file @
83ffc508
...
@@ -2351,13 +2351,13 @@ namespace Mall.Module.User
...
@@ -2351,13 +2351,13 @@ namespace Mall.Module.User
{
{
return
"提现方式不正确"
;
return
"提现方式不正确"
;
}
}
//今日可提
decimal
CanRemitMoney
=
-
1
;
if
(
basicsModel
.
DailyWithdrawalLimit
!=
-
1
)
if
(
basicsModel
.
DailyWithdrawalLimit
!=
-
1
)
{
{
//获取当日所有用户提现金额
//获取当日所有用户提现金额
decimal
RemitMoney
=
distributor_RemitRepository
.
GetAllUserToDayRemitMoney
(
demodel
.
TenantId
,
demodel
.
MallBaseId
);
decimal
RemitMoney
=
distributor_RemitRepository
.
GetAllUserToDayRemitMoney
(
demodel
.
TenantId
,
demodel
.
MallBaseId
);
CanRemitMoney
=
(
basicsModel
.
DailyWithdrawalLimit
??
0
)
-
RemitMoney
;
//今日可提
decimal
CanRemitMoney
=
(
basicsModel
.
DailyWithdrawalLimit
??
0
)
-
RemitMoney
;
CanRemitMoney
=
CanRemitMoney
<
0
?
0
:
CanRemitMoney
;
CanRemitMoney
=
CanRemitMoney
<
0
?
0
:
CanRemitMoney
;
if
(
CanRemitMoney
<
(
demodel
.
AppliedMoney
??
0
))
{
if
(
CanRemitMoney
<
(
demodel
.
AppliedMoney
??
0
))
{
...
...
Mall.WebApi/Controllers/AppletWeChat/PublishController.cs
View file @
83ffc508
...
@@ -24,10 +24,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -24,10 +24,10 @@ namespace Mall.WebApi.Controllers.AppletWeChat
public
class
PublishController
:
BaseController
public
class
PublishController
:
BaseController
{
{
private
MiniProgramModule
appletWeChatModule
=
new
MiniProgramModule
();
private
readonly
MiniProgramModule
appletWeChatModule
=
new
MiniProgramModule
();
string
projectUrl
=
Mall
.
Common
.
Config
.
ProjectUrl
;
readonly
string
projectUrl
=
Mall
.
Common
.
Config
.
ProjectUrl
;
string
developerKitsPort
=
Mall
.
Common
.
Config
.
DeveloperKitsPort
;
readonly
string
developerKitsPort
=
Mall
.
Common
.
Config
.
DeveloperKitsPort
;
string
FirstPage
=
Mall
.
Common
.
Config
.
FirstPage
;
readonly
string
FirstPage
=
Mall
.
Common
.
Config
.
FirstPage
;
/// <summary>
/// <summary>
/// 发布微信小程序获取登录二维码
/// 发布微信小程序获取登录二维码
...
@@ -37,9 +37,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -37,9 +37,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat
public
ApiResult
GetLoginAppletWeChat
()
public
ApiResult
GetLoginAppletWeChat
()
{
{
var
parms
=
RequestParm
;
var
parms
=
RequestParm
;
var
query
=
new
RB_MiniProgram_Extend
();
var
query
=
new
RB_MiniProgram_Extend
query
.
TenantId
=
UserInfo
.
TenantId
;
{
query
.
MallBaseId
=
parms
.
MallBaseId
;
TenantId
=
UserInfo
.
TenantId
,
MallBaseId
=
parms
.
MallBaseId
};
var
model
=
appletWeChatModule
.
GetTenantListModule
(
query
).
FirstOrDefault
();
var
model
=
appletWeChatModule
.
GetTenantListModule
(
query
).
FirstOrDefault
();
if
(
model
==
null
)
if
(
model
==
null
)
{
{
...
@@ -60,6 +62,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -60,6 +62,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetLoginAppletWeChat"
);
return
ApiResult
.
Failed
(
"获取登录二维码识别"
);
return
ApiResult
.
Failed
(
"获取登录二维码识别"
);
}
}
}
}
...
@@ -91,6 +94,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -91,6 +94,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetPreviewAppletWeChat"
);
return
ApiResult
.
Failed
(
"获取登录二维码识别"
);
return
ApiResult
.
Failed
(
"获取登录二维码识别"
);
}
}
}
}
...
@@ -104,9 +108,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -104,9 +108,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat
public
ApiResult
GetPuploadAppletWeChat
()
public
ApiResult
GetPuploadAppletWeChat
()
{
{
var
parms
=
RequestParm
;
var
parms
=
RequestParm
;
var
query
=
new
RB_MiniProgram_Extend
();
var
query
=
new
RB_MiniProgram_Extend
query
.
TenantId
=
UserInfo
.
TenantId
;
{
query
.
MallBaseId
=
parms
.
MallBaseId
;
TenantId
=
UserInfo
.
TenantId
,
MallBaseId
=
parms
.
MallBaseId
};
var
model
=
appletWeChatModule
.
GetTenantListModule
(
query
).
FirstOrDefault
();
var
model
=
appletWeChatModule
.
GetTenantListModule
(
query
).
FirstOrDefault
();
if
(
model
==
null
)
if
(
model
==
null
)
{
{
...
@@ -138,6 +144,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -138,6 +144,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetPuploadAppletWeChat"
);
return
ApiResult
.
Failed
(
"上传失败"
);
return
ApiResult
.
Failed
(
"上传失败"
);
}
}
}
}
...
@@ -155,9 +162,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -155,9 +162,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat
public
virtual
ApiResult
GetWeiXinShare
()
public
virtual
ApiResult
GetWeiXinShare
()
{
{
var
parms
=
RequestParm
;
var
parms
=
RequestParm
;
var
query
=
new
RB_MiniProgram_Extend
();
var
query
=
new
RB_MiniProgram_Extend
query
.
TenantId
=
UserInfo
.
TenantId
;
{
query
.
MallBaseId
=
parms
.
MallBaseId
;
TenantId
=
UserInfo
.
TenantId
,
MallBaseId
=
parms
.
MallBaseId
};
var
appletWeChatModel
=
appletWeChatModule
.
GetTenantListModule
(
query
).
FirstOrDefault
();
var
appletWeChatModel
=
appletWeChatModule
.
GetTenantListModule
(
query
).
FirstOrDefault
();
string
imgBase64
=
appletWeChatModule
.
GetWeiXinShare
(
appletWeChatModel
,
FirstPage
);
string
imgBase64
=
appletWeChatModule
.
GetWeiXinShare
(
appletWeChatModel
,
FirstPage
);
...
@@ -293,9 +302,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -293,9 +302,11 @@ namespace Mall.WebApi.Controllers.AppletWeChat
JObject
parmsJob
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
JObject
parmsJob
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
string
OpenId
=
parmsJob
.
GetStringValue
(
"OpenId"
);
string
OpenId
=
parmsJob
.
GetStringValue
(
"OpenId"
);
var
query
=
new
RB_Member_Subscription_Extend
();
var
query
=
new
RB_Member_Subscription_Extend
query
.
TenantId
=
UserInfo
.
TenantId
;
{
query
.
MallBaseId
=
parms
.
MallBaseId
;
TenantId
=
UserInfo
.
TenantId
,
MallBaseId
=
parms
.
MallBaseId
};
if
(
string
.
IsNullOrEmpty
(
OpenId
))
if
(
string
.
IsNullOrEmpty
(
OpenId
))
{
{
...
@@ -396,6 +407,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -396,6 +407,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
[
HttpPost
]
[
HttpPost
]
[
Obsolete
]
public
ApiResult
GetLiveHousePageList
()
public
ApiResult
GetLiveHousePageList
()
{
{
var
parms
=
RequestParm
;
var
parms
=
RequestParm
;
...
@@ -427,19 +439,18 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -427,19 +439,18 @@ namespace Mall.WebApi.Controllers.AppletWeChat
/// </summary>
/// </summary>
/// <param name="timeStamp">Unix时间戳格式</param>
/// <param name="timeStamp">Unix时间戳格式</param>
/// <returns>C#格式时间</returns>
/// <returns>C#格式时间</returns>
[
Obsolete
]
public
static
string
GetTime
(
string
timeStamp
)
public
static
string
GetTime
(
string
timeStamp
)
{
{
try
try
{
{
DateTime
dtStart
=
TimeZone
.
CurrentTimeZone
.
ToLocalTime
(
new
DateTime
(
1970
,
1
,
1
));
DateTime
dtStart
=
TimeZone
.
CurrentTimeZone
.
ToLocalTime
(
new
DateTime
(
1970
,
1
,
1
));
long
lTime
=
long
.
Parse
(
timeStamp
+
"0000000"
);
long
lTime
=
long
.
Parse
(
timeStamp
+
"0000000"
);
TimeSpan
toNow
=
new
TimeSpan
(
lTime
);
TimeSpan
toNow
=
new
TimeSpan
(
lTime
);
return
dtStart
.
Add
(
toNow
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
return
dtStart
.
Add
(
toNow
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
}
}
catch
(
Exception
)
catch
(
Exception
)
{
{
return
""
;
return
""
;
}
}
}
}
...
...
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