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
5f380dca
Commit
5f380dca
authored
Jul 01, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
e401ddc1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
23 deletions
+62
-23
PayUtil.cs
Mall.WebApi/App_Code/PayUtil.cs
+8
-2
WeChatPayController.cs
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
+20
-0
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+32
-19
StatisticsController.cs
...ebApi/Controllers/MarketingCenter/StatisticsController.cs
+2
-2
No files found.
Mall.WebApi/App_Code/PayUtil.cs
View file @
5f380dca
...
...
@@ -48,6 +48,7 @@ namespace Mall.WebApi.App_Code
/// <returns></returns>
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
)
{
DateTime
time_start
=
DateTime
.
Now
;
var
req
=
new
Common
.
Pay
.
WeChatPat
.
RequestHandler
();
req
.
SetKey
(
model
.
WeChatApiSecret
);
req
.
SetParameter
(
"appid"
,
model
.
MiniAppId
);
//微信开放平台审核通过的应用APPID
...
...
@@ -58,8 +59,8 @@ namespace Mall.WebApi.App_Code
req
.
SetParameter
(
"out_trade_no"
,
sOrderNo
);
req
.
SetParameter
(
"total_fee"
,
(
dPrice
*
100
).
ToString
(
"f0"
));
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
(
"time_start"
,
time_start
.
ToString
(
"yyyyMMddHHmmss"
));
req
.
SetParameter
(
"time_expire"
,
time_start
.
AddMinutes
(
10
).
ToString
(
"yyyyMMddHHmmss"
));
req
.
SetParameter
(
"notify_url"
,
notify_url
);
req
.
SetParameter
(
"trade_type"
,
"JSAPI"
);
req
.
SetParameter
(
"openid"
,
openid
);
...
...
@@ -79,6 +80,11 @@ namespace Mall.WebApi.App_Code
LogHelper
.
Write
(
null
,
"订单号【"
+
sOrderNo
+
"】成功回调:"
+
xe
);
try
{
//存入缓存,方便自动取消的时候不被清理
TimeSpan
ts
=
time_start
.
AddMinutes
(
10
)
-
time_start
;
string
orderId
=
sOrderNo
[
17.
.];
System
.
Threading
.
Tasks
.
Task
.
Run
(()
=>
CacheManager
.
AppletWeChat
.
OrderPayReidsCache
.
Set
(
orderId
,
orderId
,
ts
));
var
prepayId
=
xe
.
GetElement
(
"prepay_id"
).
Value
;
var
payReq
=
new
RequestHandler
();
...
...
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
View file @
5f380dca
...
...
@@ -285,6 +285,8 @@ namespace Mall.WebApi.Controllers.AppletWeChat
#
region
测试接口
public
ApiResult
TestReturn
()
{
RB_MiniProgram_Extend
miniProgram
=
new
RB_MiniProgram_Extend
();
//2020年5月26号新增
...
...
@@ -302,6 +304,24 @@ namespace Mall.WebApi.Controllers.AppletWeChat
}
public
ApiResult
TestWeChatPay
()
{
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
=
"2020052916044326411"
;
var
pram
=
new
Common
.
Pay
.
WeChatPat
.
PayParam
()
{
TotalFee
=
Convert
.
ToInt32
(
0.01
*
100
),
RefundFee
=
Convert
.
ToInt32
(
0.01
*
100
),
OrderNumber
=
"202005291604432641"
,
RefundNumber
=
RefundOrderNo
};
string
sOrderNo
=
(
System
.
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
))
+
"1001"
;
App_Code
.
PayUtil
.
GetMinUnifiedOrder
(
sOrderNo
,
"测试"
,
Convert
.
ToDecimal
(
0.05
),
"1"
,
""
,
Config
.
sTenpayNotify
,
miniProgram
,
_accessor
,
System
.
Net
.
Dns
.
GetHostEntry
(
System
.
Net
.
Dns
.
GetHostName
()).
AddressList
.
FirstOrDefault
(
address
=>
address
.
AddressFamily
==
System
.
Net
.
Sockets
.
AddressFamily
.
InterNetwork
)?.
ToString
());
return
ApiResult
.
Success
(
""
);
}
public
ApiResult
TestTransfersOrder
()
{
RB_MiniProgram_Extend
miniProgram
=
new
RB_MiniProgram_Extend
();
//2020年5月26号新增
...
...
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
5f380dca
...
...
@@ -51,6 +51,11 @@ namespace Mall.WebApi.Controllers
/// </summary>
private
static
IntegralModule
integralModule
=
new
IntegralModule
();
/// <summary>
/// 充值设置
/// </summary>
private
static
RechargeModule
rechargeModule
=
new
RechargeModule
();
/// <summary>
/// 用户处理类
/// </summary>
...
...
@@ -171,7 +176,7 @@ namespace Mall.WebApi.Controllers
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
GoodsIds
=
Ids
,
GoodsStatus
=
1
GoodsStatus
=
1
});
List
<
GoodsDetailsItem2
>
newGoodsList
=
new
List
<
GoodsDetailsItem2
>();
...
...
@@ -182,7 +187,7 @@ namespace Mall.WebApi.Controllers
{
lastItem
.
id
=
tempGood
.
Id
;
lastItem
.
name
=
tempGood
.
Name
;
lastItem
.
price
=
Math
.
Round
((
tempGood
?.
SellingPrice
??
0
),
2
);
lastItem
.
price
=
Math
.
Round
((
tempGood
?.
SellingPrice
??
0
),
2
);
lastItem
.
picUrl
=
tempGood
?.
CoverImage
!=
null
?
Common
.
Config
.
GetFileUrl
(
tempGood
.
CoverImage
)
:
""
;
lastItem
.
OriginalPrice
=
Math
.
Round
((
tempGood
?.
OriginalPrice
??
0
),
2
);
newGoodsList
.
Add
(
lastItem
);
...
...
@@ -746,7 +751,7 @@ namespace Mall.WebApi.Controllers
{
TenantId
=
Convert
.
ToInt32
(
miniProgram
.
TenantId
),
MallBaseId
=
miniProgram
.
MallBaseId
,
GoodsStatus
=
1
,
GoodsStatus
=
1
,
});
if
(
goodsList
!=
null
&&
goodsList
.
Count
>
0
)
{
...
...
@@ -865,7 +870,7 @@ namespace Mall.WebApi.Controllers
h
=
1
,
x
=
0
,
y
=
0
,
link
=
new
List
<
rubikLinkItem
>()
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()
{
...
...
@@ -923,7 +928,7 @@ namespace Mall.WebApi.Controllers
h
=
12
,
x
=
10
,
y
=
0
,
link
=
new
List
<
rubikLinkItem
>()
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()
{
...
...
@@ -981,7 +986,7 @@ namespace Mall.WebApi.Controllers
h
=
6
,
x
=
10
,
y
=
0
,
link
=
new
List
<
rubikLinkItem
>()
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()
{
...
...
@@ -1039,7 +1044,7 @@ namespace Mall.WebApi.Controllers
h
=
24
,
x
=
0
,
y
=
0
,
link
=
new
List
<
rubikLinkItem
>()
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()
{
...
...
@@ -1065,7 +1070,7 @@ namespace Mall.WebApi.Controllers
h
=
12
,
x
=
20
,
y
=
0
,
link
=
new
List
<
rubikLinkItem
>()
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()
{
...
...
@@ -1091,7 +1096,7 @@ namespace Mall.WebApi.Controllers
h
=
12
,
x
=
20
,
y
=
12
,
link
=
new
List
<
rubikLinkItem
>()
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()
{
...
...
@@ -1117,7 +1122,7 @@ namespace Mall.WebApi.Controllers
h
=
12
,
x
=
35
,
y
=
12
,
link
=
new
List
<
rubikLinkItem
>()
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()
{
...
...
@@ -1149,7 +1154,7 @@ namespace Mall.WebApi.Controllers
h
=
16
,
x
=
0
,
y
=
0
,
link
=
new
List
<
rubikLinkItem
>()
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()
{
...
...
@@ -1207,7 +1212,7 @@ namespace Mall.WebApi.Controllers
h
=
24
,
x
=
0
,
y
=
0
,
link
=
new
List
<
rubikLinkItem
>()
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()
{
...
...
@@ -1318,7 +1323,7 @@ namespace Mall.WebApi.Controllers
h
=
1
,
x
=
1
,
y
=
0
,
link
=
new
List
<
rubikLinkItem
>()
link
=
new
List
<
rubikLinkItem
>()
{
new
rubikLinkItem
()
{
...
...
@@ -1555,6 +1560,13 @@ namespace Mall.WebApi.Controllers
{
integralModel
=
new
RB_Integral_Settings
();
}
//充值信息
var
rechargeModel
=
rechargeModule
.
GetRechargeSettingsList
(
new
RB_Recharge_Settings
{
TenantId
=
miniProgram
.
TenantId
??
0
,
MallBaseId
=
miniProgram
.
MallBaseId
}).
FirstOrDefault
();
if
(
rechargeModel
==
null
)
{
rechargeModel
=
new
RB_Recharge_Settings
();
}
List
<
string
>
payment_type
=
new
List
<
string
>();
if
(!
string
.
IsNullOrWhiteSpace
(
mallBaseModel
.
PayWay
))
{
...
...
@@ -1620,7 +1632,7 @@ namespace Mall.WebApi.Controllers
}
//商城风格
var
mallStyle
=
new
object
();
ResultMallShopStyle
resultMallShopStyle
=
new
ResultMallShopStyle
();
switch
(
miniProgram
.
MallShopStyle
)
{
...
...
@@ -1660,7 +1672,7 @@ namespace Mall.WebApi.Controllers
resultMallShopStyle
?.
main
,
resultMallShopStyle
?.
secondary
,
};
var
setting
=
new
{
mallStyle
,
...
...
@@ -1710,8 +1722,8 @@ namespace Mall.WebApi.Controllers
is_quick_map
=
mallBaseModel
?.
ShortcutNavigation
,
quick_map_pic
=
mallBaseModel
?.
ShortcutNavigationIco
,
quick_map_address
=
mallBaseModel
?.
Address
,
longitude
=
!
string
.
IsNullOrWhiteSpace
(
mallBaseModel
.
LongAndLat
)?
mallBaseModel
?.
LongAndLat
.
Split
(
","
)[
0
]:
""
,
latitude
=
!
string
.
IsNullOrWhiteSpace
(
mallBaseModel
.
LongAndLat
)
?
mallBaseModel
?.
LongAndLat
.
Split
(
","
)[
1
]
:
""
,
longitude
=
!
string
.
IsNullOrWhiteSpace
(
mallBaseModel
.
LongAndLat
)
?
mallBaseModel
?.
LongAndLat
.
Split
(
","
)[
0
]
:
""
,
latitude
=
!
string
.
IsNullOrWhiteSpace
(
mallBaseModel
.
LongAndLat
)
?
mallBaseModel
?.
LongAndLat
.
Split
(
","
)[
1
]
:
""
,
is_quick_home
=
mallBaseModel
?.
BackTopNavigation
,
quick_home_pic
=
mallBaseModel
?.
BackTopNavigationIco
,
logo
=
""
,
...
...
@@ -1753,7 +1765,8 @@ namespace Mall.WebApi.Controllers
quick_customize_link_url
=
mallBaseModel
?.
TurnLink
,
quick_customize_new_params
=
""
,
theme_color
=
""
,
latitude_longitude
=
mallBaseModel
?.
LongAndLat
latitude_longitude
=
mallBaseModel
?.
LongAndLat
,
IsShowRecharge
=
rechargeModel
.
IsOpenBtn
};
#
endregion
return
setting
;
...
...
@@ -1799,7 +1812,7 @@ namespace Mall.WebApi.Controllers
}
}
var
share_setting
=
new
var
share_setting
=
new
{
level
=
distributorBasics
?.
DistributorTier
,
is_rebate
=
distributorBasics
?.
InPurchasing
,
...
...
Mall.WebApi/Controllers/MarketingCenter/StatisticsController.cs
View file @
5f380dca
...
...
@@ -340,7 +340,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
item
.
ALLCommission
=
item
.
CostFreight
+
item
.
CostMoney
+
item
.
PackingMoney
+
item
.
GoodsFreight
+
item
.
OneCommission
+
item
.
TwoCommission
+
item
.
OtherPrice
;
item
.
NoPaid
=
item
.
ALLCommission
-
item
.
Paid
;
item
.
GrossProfit
=
item
.
AllPrice
-
item
.
ALLCommission
;
item
.
GrossProfitRate
=
item
.
AllPrice
==
0
?
0
:
item
.
GrossProfit
/
item
.
AllPrice
;
item
.
GrossProfitRate
=
item
.
AllPrice
==
0
?
0
:
Math
.
Round
((
item
.
GrossProfit
/
item
.
AllPrice
),
2
,
MidpointRounding
.
AwayFromZero
)
;
}
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
;
...
...
@@ -402,7 +402,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
item
.
ALLCommission
=
item
.
CostFreight
+
item
.
CostMoney
+
item
.
PackingMoney
+
item
.
GoodsFreight
+
item
.
OneCommission
+
item
.
TwoCommission
+
item
.
OtherPrice
;
item
.
NoPaid
=
item
.
ALLCommission
-
item
.
Paid
;
item
.
GrossProfit
=
item
.
AllPrice
-
item
.
ALLCommission
;
item
.
GrossProfitRate
=
item
.
AllPrice
==
0
?
0
:
item
.
GrossProfit
/
item
.
AllPrice
;
item
.
GrossProfitRate
=
item
.
AllPrice
==
0
?
0
:
Math
.
Round
((
item
.
GrossProfit
/
item
.
AllPrice
),
2
,
MidpointRounding
.
AwayFromZero
)
;
}
#
region
组装数据
int
Num
=
0
;
...
...
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