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
f7c90817
Commit
f7c90817
authored
May 29, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
534f27c8
cd2721d6
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
86 additions
and
73 deletions
+86
-73
RequestHandler.cs
Mall.Common/Pay/WeChatPat/RequestHandler.cs
+28
-27
RB_Distributor_Custom.cs
Mall.Model/Entity/User/RB_Distributor_Custom.cs
+8
-7
UserCommonModule.cs
Mall.Module.User/UserCommonModule.cs
+7
-7
RB_Material_InfoRepository.cs
Mall.Repository/Product/RB_Material_InfoRepository.cs
+1
-1
PayUtil.cs
Mall.WebApi/App_Code/PayUtil.cs
+14
-9
WeChatNotifyController.cs
...WebApi/Controllers/AppletWeChat/WeChatNotifyController.cs
+12
-2
WeChatPayController.cs
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
+2
-2
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+5
-5
UserController.cs
Mall.WebApi/Controllers/User/UserController.cs
+7
-11
MallHelper.cs
Test/Helper/MallHelper.cs
+2
-2
No files found.
Mall.Common/Pay/WeChatPat/RequestHandler.cs
View file @
f7c90817
...
@@ -92,31 +92,31 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -92,31 +92,31 @@ namespace Mall.Common.Pay.WeChatPat
}
}
}
}
/// <summary>
///
//
<summary>
/// 获取package带参数的签名包
///
//
获取package带参数的签名包
/// </summary>
///
//
</summary>
/// <returns></returns>
///
//
<returns></returns>
public
string
GetRequestURL
()
//
public string GetRequestURL()
{
//
{
this
.
CreateMd5Sign
();
//
this.CreateMd5Sign();
var
sb
=
new
StringBuilder
();
//
var sb = new StringBuilder();
var
akeys
=
new
ArrayList
(
Parameters
.
Keys
);
//
var akeys = new ArrayList(Parameters.Keys);
akeys
.
Sort
();
//
akeys.Sort();
foreach
(
string
k
in
akeys
)
//
foreach (string k in akeys)
{
//
{
var
v
=
(
string
)
Parameters
[
k
];
//
var v = (string)Parameters[k];
if
(
null
!=
v
&&
String
.
Compare
(
"key"
,
k
,
StringComparison
.
Ordinal
)
!=
0
)
//
if (null != v && String.Compare("key", k, StringComparison.Ordinal) != 0)
{
//
{
sb
.
Append
(
k
+
"="
+
UrlEncode
(
v
,
GetCharset
())
+
"&"
);
//
sb.Append(k + "=" + UrlEncode(v, GetCharset()) + "&");
}
//
}
}
//
}
//去掉最后一个&
//
//去掉最后一个&
if
(
sb
.
Length
>
0
)
//
if (sb.Length > 0)
{
//
{
sb
.
Remove
(
sb
.
Length
-
1
,
1
);
//
sb.Remove(sb.Length - 1, 1);
}
//
}
return
sb
.
ToString
();
//
return sb.ToString();
}
//
}
...
@@ -172,7 +172,7 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -172,7 +172,7 @@ namespace Mall.Common.Pay.WeChatPat
/// 创建package签名,按参数名称a-z排序,遇到空值的参数不参加签名。
/// 创建package签名,按参数名称a-z排序,遇到空值的参数不参加签名。
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
public
string
CreateMd5Sign
(
IHttpContextAccessor
accessor
)
public
string
CreateMd5Sign
(
IHttpContextAccessor
accessor
,
string
WeChatApiSecret
)
{
{
var
sb
=
new
StringBuilder
();
var
sb
=
new
StringBuilder
();
var
akeys
=
new
ArrayList
(
Parameters
.
Keys
);
var
akeys
=
new
ArrayList
(
Parameters
.
Keys
);
...
@@ -186,7 +186,8 @@ namespace Mall.Common.Pay.WeChatPat
...
@@ -186,7 +186,8 @@ namespace Mall.Common.Pay.WeChatPat
sb
.
Append
(
k
+
"="
+
v
+
"&"
);
sb
.
Append
(
k
+
"="
+
v
+
"&"
);
}
}
}
}
sb
.
Append
(
"key="
+
GetKey
());
// sb.Append("key=" + GetKey());
sb
.
Append
(
"key="
+
WeChatApiSecret
);
var
sign
=
Plugin
.
SecurityHelper
.
MD5EncryptWeChat
(
sb
.
ToString
(),
GetCharset
(
accessor
)).
ToUpper
();
var
sign
=
Plugin
.
SecurityHelper
.
MD5EncryptWeChat
(
sb
.
ToString
(),
GetCharset
(
accessor
)).
ToUpper
();
return
sign
;
return
sign
;
}
}
...
...
Mall.Model/Entity/User/RB_Distributor_Custom.cs
View file @
f7c90817
...
@@ -25,15 +25,16 @@ namespace Mall.Model.Entity.User
...
@@ -25,15 +25,16 @@ namespace Mall.Model.Entity.User
/// <summary>
/// <summary>
/// 头部图片
/// 头部图片
/// </summary>
/// </summary>
public
int
?
HeadImage
public
string
HeadImage
{
{
get
;
get
;
set
;
set
;
}
}
/// <summary>
/// <summary>
/// 底部图片
/// 底部图片
/// </summary>
/// </summary>
public
int
?
BottomImage
public
string
BottomImage
{
{
get
;
get
;
set
;
set
;
...
@@ -97,7 +98,7 @@ namespace Mall.Model.Entity.User
...
@@ -97,7 +98,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// <summary>
/// 分销佣金图片
/// 分销佣金图片
/// </summary>
/// </summary>
public
int
?
DistributionCommissionImage
public
string
DistributionCommissionImage
{
{
get
;
get
;
set
;
set
;
...
@@ -113,7 +114,7 @@ namespace Mall.Model.Entity.User
...
@@ -113,7 +114,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// <summary>
/// 分销订单图片
/// 分销订单图片
/// </summary>
/// </summary>
public
int
?
DistributionOrderImage
public
string
DistributionOrderImage
{
{
get
;
get
;
set
;
set
;
...
@@ -129,7 +130,7 @@ namespace Mall.Model.Entity.User
...
@@ -129,7 +130,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// <summary>
/// 提现明细图片
/// 提现明细图片
/// </summary>
/// </summary>
public
int
?
WithdrawDetialsImage
public
string
WithdrawDetialsImage
{
{
get
;
get
;
set
;
set
;
...
@@ -145,7 +146,7 @@ namespace Mall.Model.Entity.User
...
@@ -145,7 +146,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// <summary>
/// 我的团队图片
/// 我的团队图片
/// </summary>
/// </summary>
public
int
?
MyTeamImage
public
string
MyTeamImage
{
{
get
;
get
;
set
;
set
;
...
@@ -161,7 +162,7 @@ namespace Mall.Model.Entity.User
...
@@ -161,7 +162,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// <summary>
/// 推广二维码图片
/// 推广二维码图片
/// </summary>
/// </summary>
public
int
?
PromoteQRCodeImage
public
string
PromoteQRCodeImage
{
{
get
;
get
;
set
;
set
;
...
...
Mall.Module.User/UserCommonModule.cs
View file @
f7c90817
...
@@ -111,23 +111,23 @@ namespace Mall.Module.User
...
@@ -111,23 +111,23 @@ namespace Mall.Module.User
{
{
Id
=
0
,
Id
=
0
,
ApplicationAgreement
=
"分销申请协议"
,
ApplicationAgreement
=
"分销申请协议"
,
HeadImage
=
1
,
HeadImage
=
Common
.
Config
.
GetFileUrl
(
"/Upload/Set/1587968479000.png"
)
,
BottomImage
=
2
,
BottomImage
=
Common
.
Config
.
GetFileUrl
(
"/Upload/Set/1587968716000.png"
)
,
ButtonColor
=
"#FF4544"
,
ButtonColor
=
"#FF4544"
,
ButtonFilletPX
=
40
,
ButtonFilletPX
=
40
,
ButtonText
=
"申请成为分销商"
,
ButtonText
=
"申请成为分销商"
,
ButtonTextColor
=
"#FFFFFF"
,
ButtonTextColor
=
"#FFFFFF"
,
DistributionApplication
=
"分销申请"
,
DistributionApplication
=
"分销申请"
,
DistributionCommissionName
=
"分销佣金"
,
DistributionCommissionName
=
"分销佣金"
,
DistributionCommissionImage
=
3
,
DistributionCommissionImage
=
Common
.
Config
.
GetFileUrl
(
"/Upload/Set/1587968503000.png"
)
,
DistributionOrderName
=
"分销订单"
,
DistributionOrderName
=
"分销订单"
,
DistributionOrderImage
=
4
,
DistributionOrderImage
=
Common
.
Config
.
GetFileUrl
(
"/Upload/Set/1587968517000.png"
)
,
WithdrawDetialsName
=
"提现明细"
,
WithdrawDetialsName
=
"提现明细"
,
WithdrawDetialsImage
=
5
,
WithdrawDetialsImage
=
Common
.
Config
.
GetFileUrl
(
"/Upload/Set/1587968599000.png"
)
,
MyTeamName
=
"我的团队"
,
MyTeamName
=
"我的团队"
,
MyTeamImage
=
6
,
MyTeamImage
=
Common
.
Config
.
GetFileUrl
(
"/Upload/Set/1587968613000.png"
)
,
PromoteQRCodeName
=
"推广二维码"
,
PromoteQRCodeName
=
"推广二维码"
,
PromoteQRCodeImage
=
7
,
PromoteQRCodeImage
=
Common
.
Config
.
GetFileUrl
(
"/Upload/Set/1587968626000.png"
)
,
ReferrerName
=
"推荐人"
,
ReferrerName
=
"推荐人"
,
CommissionForWithdrawalName
=
"可提现佣金"
,
CommissionForWithdrawalName
=
"可提现佣金"
,
WithdrawDepositName
=
"提现"
,
WithdrawDepositName
=
"提现"
,
...
...
Mall.Repository/Product/RB_Material_InfoRepository.cs
View file @
f7c90817
...
@@ -23,7 +23,7 @@ namespace Mall.Repository.Product
...
@@ -23,7 +23,7 @@ namespace Mall.Repository.Product
/// <returns></returns>
/// <returns></returns>
public
List
<
RB_Material_Info_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Material_Info_Extend
dmodel
)
public
List
<
RB_Material_Info_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Material_Info_Extend
dmodel
)
{
{
string
where
=
$" 1=1 and
Id>100 and
{
nameof
(
RB_Material_Info
.
Status
)}
=0"
;
string
where
=
$" 1=1 and
{
nameof
(
RB_Material_Info
.
Status
)}
=0"
;
if
(
dmodel
.
Id
>=
100
)
if
(
dmodel
.
Id
>=
100
)
{
{
if
(
dmodel
.
TenantId
>
0
)
if
(
dmodel
.
TenantId
>
0
)
...
...
Mall.WebApi/App_Code/PayUtil.cs
View file @
f7c90817
...
@@ -16,6 +16,7 @@ using Mall.Model.Entity.User;
...
@@ -16,6 +16,7 @@ using Mall.Model.Entity.User;
using
Mall.Common
;
using
Mall.Common
;
using
Mall.Model.Extend.User
;
using
Mall.Model.Extend.User
;
using
NPOI.SS.Formula.Functions
;
using
NPOI.SS.Formula.Functions
;
using
Org.BouncyCastle.Utilities.Net
;
namespace
Mall.WebApi.App_Code
namespace
Mall.WebApi.App_Code
{
{
...
@@ -44,7 +45,7 @@ namespace Mall.WebApi.App_Code
...
@@ -44,7 +45,7 @@ namespace Mall.WebApi.App_Code
/// <param name="CustomerId"></param>
/// <param name="CustomerId"></param>
/// <param name="openid"></param>
/// <param name="openid"></param>
/// <returns></returns>
/// <returns></returns>
public
static
string
GetMinUnifiedOrder
(
string
sOrderNo
,
string
sProductName
,
decimal
dPrice
,
string
CustomerId
,
string
openid
,
RB_MiniProgram_Extend
model
,
IHttpContextAccessor
_accessor
)
public
static
string
GetMinUnifiedOrder
(
string
sOrderNo
,
string
sProductName
,
decimal
dPrice
,
string
CustomerId
,
string
openid
,
RB_MiniProgram_Extend
model
,
IHttpContextAccessor
_accessor
,
string
IPAddress
)
{
{
var
req
=
new
Common
.
Pay
.
WeChatPat
.
RequestHandler
();
var
req
=
new
Common
.
Pay
.
WeChatPat
.
RequestHandler
();
req
.
SetKey
(
model
.
WeChatApiSecret
);
req
.
SetKey
(
model
.
WeChatApiSecret
);
...
@@ -56,13 +57,13 @@ namespace Mall.WebApi.App_Code
...
@@ -56,13 +57,13 @@ namespace Mall.WebApi.App_Code
req
.
SetParameter
(
"attach"
,
CustomerId
);
req
.
SetParameter
(
"attach"
,
CustomerId
);
req
.
SetParameter
(
"out_trade_no"
,
sOrderNo
);
req
.
SetParameter
(
"out_trade_no"
,
sOrderNo
);
req
.
SetParameter
(
"total_fee"
,
(
dPrice
*
100
).
ToString
(
"f0"
));
req
.
SetParameter
(
"total_fee"
,
(
dPrice
*
100
).
ToString
(
"f0"
));
req
.
SetParameter
(
"spbill_create_ip"
,
_accessor
.
HttpContext
.
Connection
.
RemoteIpAddress
.
ToString
()
);
req
.
SetParameter
(
"spbill_create_ip"
,
IPAddress
);
req
.
SetParameter
(
"time_start"
,
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
));
req
.
SetParameter
(
"time_start"
,
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
));
req
.
SetParameter
(
"time_expire"
,
DateTime
.
Now
.
AddMinutes
(
10
).
ToString
(
"yyyyMMddHHmmss"
));
req
.
SetParameter
(
"time_expire"
,
DateTime
.
Now
.
AddMinutes
(
10
).
ToString
(
"yyyyMMddHHmmss"
));
req
.
SetParameter
(
"notify_url"
,
Config
.
sTenpayNotify
);
req
.
SetParameter
(
"notify_url"
,
Config
.
sTenpayNotify
);
req
.
SetParameter
(
"trade_type"
,
"JSAPI"
);
req
.
SetParameter
(
"trade_type"
,
"JSAPI"
);
req
.
SetParameter
(
"openid"
,
openid
);
req
.
SetParameter
(
"openid"
,
openid
);
req
.
SetParameter
(
"sign"
,
req
.
CreateMd5Sign
(
_accessor
));
req
.
SetParameter
(
"sign"
,
req
.
CreateMd5Sign
(
_accessor
,
model
.
WeChatApiSecret
));
var
reqXml
=
req
.
ParseXml
();
var
reqXml
=
req
.
ParseXml
();
var
result
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
Post
(
new
HttpParam
()
var
result
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
Post
(
new
HttpParam
()
...
@@ -77,12 +78,16 @@ namespace Mall.WebApi.App_Code
...
@@ -77,12 +78,16 @@ namespace Mall.WebApi.App_Code
try
try
{
{
var
prepayId
=
xe
.
GetElement
(
"
return_code
"
).
Value
;
var
prepayId
=
xe
.
GetElement
(
"
prepay_id
"
).
Value
;
var
payReq
=
new
RequestHandler
();
var
payReq
=
new
RequestHandler
();
payReq
.
SetKey
(
model
.
WeChatApiSecret
);
payReq
.
SetParameter
(
"appId"
,
model
.
MiniAppId
);
payReq
.
SetParameter
(
"appId"
,
model
.
MiniAppId
);
payReq
.
SetParameter
(
"timeStamp"
,
GetTimestamp
());
payReq
.
SetParameter
(
"nonceStr"
,
GetNoncestr
());
payReq
.
SetParameter
(
"package"
,
"prepay_id="
+
prepayId
);
payReq
.
SetParameter
(
"signType"
,
"MD5"
);
//创建签名
//创建签名
payReq
.
SetParameter
(
"sign"
,
payReq
.
CreateMd5Sign
(
_accessor
));
payReq
.
SetParameter
(
"sign"
,
payReq
.
CreateMd5Sign
(
_accessor
,
model
.
WeChatApiSecret
));
var
payReqXml
=
payReq
.
ParseXml
();
var
payReqXml
=
payReq
.
ParseXml
();
var
payReqJson
=
payReq
.
ParseJson
();
var
payReqJson
=
payReq
.
ParseJson
();
return
payReqJson
;
return
payReqJson
;
...
@@ -217,7 +222,7 @@ namespace Mall.WebApi.App_Code
...
@@ -217,7 +222,7 @@ namespace Mall.WebApi.App_Code
packageReq
.
SetParameter
(
"out_refund_no"
,
param
.
RefundNumber
);
packageReq
.
SetParameter
(
"out_refund_no"
,
param
.
RefundNumber
);
packageReq
.
SetParameter
(
"total_fee"
,
(
param
.
TotalFee
.
Value
).
ToString
(
System
.
Globalization
.
CultureInfo
.
InvariantCulture
));
packageReq
.
SetParameter
(
"total_fee"
,
(
param
.
TotalFee
.
Value
).
ToString
(
System
.
Globalization
.
CultureInfo
.
InvariantCulture
));
packageReq
.
SetParameter
(
"refund_fee"
,
param
.
RefundFee
.
Value
.
ToString
(
System
.
Globalization
.
CultureInfo
.
InvariantCulture
));
packageReq
.
SetParameter
(
"refund_fee"
,
param
.
RefundFee
.
Value
.
ToString
(
System
.
Globalization
.
CultureInfo
.
InvariantCulture
));
packageReq
.
SetParameter
(
"sign"
,
packageReq
.
CreateMd5Sign
(
_accessor
));
packageReq
.
SetParameter
(
"sign"
,
packageReq
.
CreateMd5Sign
(
_accessor
,
model
.
WeChatApiSecret
));
var
reqXml
=
packageReq
.
ParseXml
();
var
reqXml
=
packageReq
.
ParseXml
();
var
result
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
Post
(
new
HttpParam
()
var
result
=
Common
.
Pay
.
WeChatPat
.
HttpHelper
.
Post
(
new
HttpParam
()
...
@@ -277,7 +282,7 @@ namespace Mall.WebApi.App_Code
...
@@ -277,7 +282,7 @@ namespace Mall.WebApi.App_Code
packageReq
.
SetParameter
(
"appid"
,
model
.
MiniAppId
);
packageReq
.
SetParameter
(
"appid"
,
model
.
MiniAppId
);
packageReq
.
SetParameter
(
"mch_id"
,
model
.
WeChatPayMerchants
);
packageReq
.
SetParameter
(
"mch_id"
,
model
.
WeChatPayMerchants
);
packageReq
.
SetParameter
(
"nonce_str"
,
GetNoncestr
());
packageReq
.
SetParameter
(
"nonce_str"
,
GetNoncestr
());
packageReq
.
SetParameter
(
"sign"
,
packageReq
.
CreateMd5Sign
(
_accessor
));
packageReq
.
SetParameter
(
"sign"
,
packageReq
.
CreateMd5Sign
(
_accessor
,
model
.
WeChatApiSecret
));
packageReq
.
SetParameter
(
"out_refund_no"
,
param
.
RefundNumber
);
//商户系统内部的退款单号
packageReq
.
SetParameter
(
"out_refund_no"
,
param
.
RefundNumber
);
//商户系统内部的退款单号
var
reqXml
=
packageReq
.
ParseXml
();
var
reqXml
=
packageReq
.
ParseXml
();
...
@@ -362,7 +367,7 @@ namespace Mall.WebApi.App_Code
...
@@ -362,7 +367,7 @@ namespace Mall.WebApi.App_Code
req
.
SetParameter
(
"mch_appid"
,
model
.
MiniAppId
);
//微信开放平台审核通过的应用APPID
req
.
SetParameter
(
"mch_appid"
,
model
.
MiniAppId
);
//微信开放平台审核通过的应用APPID
req
.
SetParameter
(
"mchid"
,
model
.
WeChatPayMerchants
);
//微信支付分配的商户号
req
.
SetParameter
(
"mchid"
,
model
.
WeChatPayMerchants
);
//微信支付分配的商户号
req
.
SetParameter
(
"nonce_str"
,
GetNoncestr
());
//随机字符串,不长于32位
req
.
SetParameter
(
"nonce_str"
,
GetNoncestr
());
//随机字符串,不长于32位
req
.
SetParameter
(
"sign"
,
req
.
CreateMd5Sign
(
_accessor
));
req
.
SetParameter
(
"sign"
,
req
.
CreateMd5Sign
(
_accessor
,
model
.
WeChatApiSecret
));
req
.
SetParameter
(
"partner_trade_no"
,
sOrderNo
);
//商户订单号,需保持唯一性(只能是字母或者数字,不能包含有其它字符)
req
.
SetParameter
(
"partner_trade_no"
,
sOrderNo
);
//商户订单号,需保持唯一性(只能是字母或者数字,不能包含有其它字符)
req
.
SetParameter
(
"openid"
,
openid
);
req
.
SetParameter
(
"openid"
,
openid
);
req
.
SetParameter
(
"check_name"
,
"NO_CHECK"
);
req
.
SetParameter
(
"check_name"
,
"NO_CHECK"
);
...
...
Mall.WebApi/Controllers/AppletWeChat/WeChatNotifyController.cs
View file @
f7c90817
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Web
;
using
System.Web
;
using
Google.Protobuf.WellKnownTypes
;
using
Mall.Common.API
;
using
Mall.Common.API
;
using
Mall.Common.Pay.WeChatPat
;
using
Mall.Common.Pay.WeChatPat
;
using
Mall.Common.Plugin
;
using
Mall.Common.Plugin
;
...
@@ -14,12 +15,17 @@ using Newtonsoft.Json.Linq;
...
@@ -14,12 +15,17 @@ using Newtonsoft.Json.Linq;
namespace
Mall.WebApi.Controllers.AppletWeChat
namespace
Mall.WebApi.Controllers.AppletWeChat
{
{
[
Route
(
"api/[controller]/[action]"
)]
[
ApiExceptionFilter
]
[
ApiController
]
[
EnableCors
(
"AllowCors"
)]
public
class
WeChatNotifyController
:
Controller
public
class
WeChatNotifyController
:
Controller
{
{
private
static
object
_lock
=
new
object
();
private
static
object
_lock
=
new
object
();
UserCommonModule
userCommonModule
=
new
UserCommonModule
();
UserCommonModule
userCommonModule
=
new
UserCommonModule
();
/// <summary>
/// <summary>
/// 订单支付回调
/// 订单支付回调
/// </summary>
/// </summary>
...
@@ -52,9 +58,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -52,9 +58,12 @@ namespace Mall.WebApi.Controllers.AppletWeChat
userCommonModule
.
InsertOrderPayInfo
(
UserId
,
OrderId
,
sOrderNo
,
TransactionId
,
Common
.
Enum
.
Goods
.
OrderPayTypeEnum
.
WeChatPay
,
PayType
,
dPaid
,
PayDate
,
0
);
userCommonModule
.
InsertOrderPayInfo
(
UserId
,
OrderId
,
sOrderNo
,
TransactionId
,
Common
.
Enum
.
Goods
.
OrderPayTypeEnum
.
WeChatPay
,
PayType
,
dPaid
,
PayDate
,
0
);
#
endregion
#
endregion
}
}
var
reqXml
=
req
.
ParseXml
();
//告诉微信我们已经处理成功,不需要再调用我们的接口了
//告诉微信我们已经处理成功,不需要再调用我们的接口了
req
.
SetParameter
(
"return_code"
,
"SUCCESS"
);
req
.
SetParameter
(
"return_msg"
,
"OK"
);
var
reqXml
=
req
.
ParseXml
();
return
reqXml
;
return
reqXml
;
// return ApiResult.Success("", reqXml);
}
}
else
else
{
{
...
@@ -63,6 +72,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -63,6 +72,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
var
reqXmlFAIL
=
req
.
ParseXml
();
var
reqXmlFAIL
=
req
.
ParseXml
();
LogHelper
.
Write
(
null
,
"Notify返回信息:"
+
reqXmlFAIL
);
LogHelper
.
Write
(
null
,
"Notify返回信息:"
+
reqXmlFAIL
);
return
reqXmlFAIL
;
return
reqXmlFAIL
;
// return ApiResult.Failed("", reqXmlFAIL);
}
}
}
}
}
}
...
...
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
View file @
f7c90817
...
@@ -92,8 +92,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat
...
@@ -92,8 +92,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat
App_Code
.
PayUtil
payUtil
=
new
App_Code
.
PayUtil
();
App_Code
.
PayUtil
payUtil
=
new
App_Code
.
PayUtil
();
switch
((
int
)
demodel
.
OrderPayType
)
switch
((
int
)
demodel
.
OrderPayType
)
{
{
case
1
:
//微信支付
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
);
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
()
);
break
;
break
;
default
:
default
:
break
;
break
;
...
...
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
f7c90817
...
@@ -1656,14 +1656,14 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1656,14 +1656,14 @@ namespace Mall.WebApi.Controllers.MallBase
icon_url
=
qitem
.
MenuIcon
,
icon_url
=
qitem
.
MenuIcon
,
name
=
qitem
.
MenuName
,
name
=
qitem
.
MenuName
,
is_show
=
1
,
is_show
=
1
,
link_url
=
qitem
.
MenuUrl
,
link_url
=
qitem
.
MenuUrl
.
Trim
()
,
}),
}),
//自定义菜单
//自定义菜单
menus
=
miniProgram
?.
SelfMenuList
.
Select
(
qitem
=>
new
menus
=
miniProgram
?.
SelfMenuList
.
Select
(
qitem
=>
new
{
{
icon_url
=
qitem
.
MenuIcon
,
icon_url
=
qitem
.
MenuIcon
,
name
=
qitem
.
MenuName
,
name
=
qitem
.
MenuName
,
link_url
=
qitem
.
MenuUrl
,
link_url
=
qitem
.
MenuUrl
.
Trim
()
,
open_type
=
"navigate"
,
open_type
=
"navigate"
,
@params
=
""
,
@params
=
""
,
...
@@ -1673,7 +1673,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1673,7 +1673,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
{
icon_url
=
qitem
.
MenuIcon
,
icon_url
=
qitem
.
MenuIcon
,
name
=
qitem
.
MenuName
,
name
=
qitem
.
MenuName
,
link_url
=
qitem
.
MenuUrl
,
link_url
=
qitem
.
MenuUrl
.
Trim
()
,
open_type
=
"navigate"
,
open_type
=
"navigate"
,
text
=
""
,
text
=
""
,
}),
}),
...
@@ -1682,7 +1682,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1682,7 +1682,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
{
icon_url
=
qitem
.
MenuIcon
,
icon_url
=
qitem
.
MenuIcon
,
name
=
qitem
.
MenuName
,
name
=
qitem
.
MenuName
,
link_url
=
qitem
.
MenuUrl
,
link_url
=
qitem
.
MenuUrl
.
Trim
()
,
open_type
=
"navigate"
,
open_type
=
"navigate"
,
}),
}),
//版权设置
//版权设置
...
@@ -1690,7 +1690,7 @@ namespace Mall.WebApi.Controllers.MallBase
...
@@ -1690,7 +1690,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
{
pic_url
=
miniProgram
.
CopyRightImg
,
pic_url
=
miniProgram
.
CopyRightImg
,
description
=
miniProgram
.
CopyRightWord
,
description
=
miniProgram
.
CopyRightWord
,
link_url
=
miniProgram
.
CopyRightLink
,
link_url
=
miniProgram
.
CopyRightLink
.
Trim
()
,
}
}
}
}
};
};
...
...
Mall.WebApi/Controllers/User/UserController.cs
View file @
f7c90817
...
@@ -874,11 +874,11 @@ namespace Mall.WebApi.Controllers.User
...
@@ -874,11 +874,11 @@ namespace Mall.WebApi.Controllers.User
{
{
var
requestParm
=
RequestParm
;
var
requestParm
=
RequestParm
;
RB_Distributor_Custom_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Distributor_Custom_Extend
>(
requestParm
.
msg
.
ToString
());
RB_Distributor_Custom_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Distributor_Custom_Extend
>(
requestParm
.
msg
.
ToString
());
if
(
(
demodel
.
HeadImage
??
0
)
<=
0
)
if
(
demodel
.
HeadImage
==
null
||
string
.
IsNullOrWhiteSpace
(
demodel
.
HeadImage
)
)
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销申请下头部图片"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销申请下头部图片"
);
}
}
if
(
(
demodel
.
BottomImage
??
0
)
<=
0
)
if
(
demodel
.
BottomImage
==
null
||
string
.
IsNullOrWhiteSpace
(
demodel
.
BottomImage
)
)
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销申请下底部图片"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销申请下底部图片"
);
}
}
...
@@ -890,10 +890,6 @@ namespace Mall.WebApi.Controllers.User
...
@@ -890,10 +890,6 @@ namespace Mall.WebApi.Controllers.User
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销申请下分销申请协议"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销申请下分销申请协议"
);
}
}
if
((
demodel
.
BottomImage
??
0
)
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请传递分销申请下按钮圆角像素"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
ButtonText
))
if
(
string
.
IsNullOrEmpty
(
demodel
.
ButtonText
))
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销申请下按钮文本"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销申请下按钮文本"
);
...
@@ -911,7 +907,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -911,7 +907,7 @@ namespace Mall.WebApi.Controllers.User
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下分销佣金"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下分销佣金"
);
}
}
if
(
(
demodel
.
DistributionCommissionImage
??
0
)
<=
0
)
if
(
demodel
.
DistributionCommissionImage
==
null
||
string
.
IsNullOrWhiteSpace
(
demodel
.
DistributionCommissionImage
)
)
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下分销佣金图片"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下分销佣金图片"
);
}
}
...
@@ -919,7 +915,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -919,7 +915,7 @@ namespace Mall.WebApi.Controllers.User
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下分销订单"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下分销订单"
);
}
}
if
(
(
demodel
.
DistributionOrderImage
??
0
)
<=
0
)
if
(
demodel
.
DistributionOrderImage
==
null
||
string
.
IsNullOrWhiteSpace
(
demodel
.
DistributionOrderImage
)
)
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下分销订单图片"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下分销订单图片"
);
}
}
...
@@ -927,7 +923,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -927,7 +923,7 @@ namespace Mall.WebApi.Controllers.User
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下提现明细"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下提现明细"
);
}
}
if
(
(
demodel
.
WithdrawDetialsImage
??
0
)
<=
0
)
if
(
demodel
.
WithdrawDetialsImage
==
null
||
string
.
IsNullOrWhiteSpace
(
demodel
.
WithdrawDetialsImage
)
)
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下提现明细图片"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下提现明细图片"
);
}
}
...
@@ -935,7 +931,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -935,7 +931,7 @@ namespace Mall.WebApi.Controllers.User
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下我的团队"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下我的团队"
);
}
}
if
(
(
demodel
.
MyTeamImage
??
0
)
<=
0
)
if
(
demodel
.
MyTeamImage
==
null
||
string
.
IsNullOrWhiteSpace
(
demodel
.
MyTeamImage
)
)
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下我的团队图片"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下我的团队图片"
);
}
}
...
@@ -943,7 +939,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -943,7 +939,7 @@ namespace Mall.WebApi.Controllers.User
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下推广二维码"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下推广二维码"
);
}
}
if
(
(
demodel
.
PromoteQRCodeImage
??
0
)
<=
0
)
if
(
demodel
.
PromoteQRCodeImage
==
null
||
string
.
IsNullOrWhiteSpace
(
demodel
.
PromoteQRCodeImage
)
)
{
{
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下推广二维码图片"
);
return
ApiResult
.
ParamIsNull
(
"请传递分销中心下推广二维码图片"
);
}
}
...
...
Test/Helper/MallHelper.cs
View file @
f7c90817
...
@@ -55,7 +55,7 @@ namespace Test.Helper
...
@@ -55,7 +55,7 @@ namespace Test.Helper
{
{
}
}
int
pageIndex
=
0
;
int
pageIndex
=
1
;
int
pageCount
=
1
;
int
pageCount
=
1
;
List
<
CategoryImg
>
imgList
=
new
List
<
CategoryImg
>();
List
<
CategoryImg
>
imgList
=
new
List
<
CategoryImg
>();
while
(
pageIndex
<=
pageCount
)
while
(
pageIndex
<=
pageCount
)
...
@@ -155,7 +155,7 @@ namespace Test.Helper
...
@@ -155,7 +155,7 @@ namespace Test.Helper
list
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
List
<
CategoryImg
>>(
dataObj
[
"list"
].
ToString
());
list
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
List
<
CategoryImg
>>(
dataObj
[
"list"
].
ToString
());
var
pageObj
=
JObject
.
Parse
(
dataObj
[
"pagination"
].
ToString
());
var
pageObj
=
JObject
.
Parse
(
dataObj
[
"pagination"
].
ToString
());
Int32
.
TryParse
(
pageObj
[
"
total
_count"
].
ToString
(),
out
pageCount
);
Int32
.
TryParse
(
pageObj
[
"
page
_count"
].
ToString
(),
out
pageCount
);
}
}
return
list
;
return
list
;
}
}
...
...
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