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
38ebfa64
Commit
38ebfa64
authored
Feb 22, 2021
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
806f4877
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
4 deletions
+104
-4
RB_Point_Order.cs
Mall.Model/Entity/Point/RB_Point_Order.cs
+1
-1
PointModule.cs
Mall.Module.Education/PointModule.cs
+11
-2
WeChatPayController.cs
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
+92
-1
No files found.
Mall.Model/Entity/Point/RB_Point_Order.cs
View file @
38ebfa64
...
...
@@ -104,7 +104,7 @@ namespace Mall.Model.Entity.Point
/// <summary>
/// 版本来源 0默认商城 1教育
/// 版本来源 0默认商城 1教育
,2-相亲
/// </summary>
public
int
?
VersionSource
{
get
;
set
;
}
...
...
Mall.Module.Education/PointModule.cs
View file @
38ebfa64
...
...
@@ -251,13 +251,22 @@ namespace Mall.Module.Education
UserId
=
model
.
UserId
,
Type
=
Common
.
Enum
.
MarketingCenter
.
RecordTypeEnum
.
Income
,
PonitNum
=
model
.
PonitNum
+
model
.
GivePoint
,
Description
=
"在线购买"
+
model
.
PonitNum
+
"点"
+
(
model
.
GivePoint
>
0
?
(
"赠送"
+
model
.
GivePoint
+
"点"
)
:
""
),
//
Description = "在线购买" + model.PonitNum + "点" + (model.GivePoint > 0 ? ("赠送" + model.GivePoint+"点") : ""),
CreateDate
=
newModel
.
PaymentTime
,
TenantId
=
model
.
TenantId
,
MallBaseId
=
model
.
MallBaseId
,
Remarks
=
"订单号:"
+
model
.
OrderNo
+
"在线购买支付"
+
model
.
Income
+
"元"
+
model
.
PonitNum
+
"点"
+
(
model
.
GivePoint
>
0
?
(
"赠送"
+
model
.
GivePoint
+
"点"
)
:
""
),
//
Remarks = "订单号:" + model.OrderNo + "在线购买支付" + model.Income + "元" + model.PonitNum + "点" + (model.GivePoint > 0 ? ("赠送" + model.GivePoint + "点") : ""),
PlatformType
=
model
.
OrderSource
};
if
(
model
.
VersionSource
==
2
)
{
memberBalanceModel
.
Description
=
"在线购买"
+
model
.
PonitNum
+
"星"
+
(
model
.
GivePoint
>
0
?
(
"赠送"
+
model
.
GivePoint
+
"星"
)
:
""
);
memberBalanceModel
.
Remarks
=
"订单号:"
+
model
.
OrderNo
+
"在线购买支付"
+
model
.
Income
+
"元"
+
model
.
PonitNum
+
"星"
+
(
model
.
GivePoint
>
0
?
(
"赠送"
+
model
.
GivePoint
+
"星"
)
:
""
);
}
else
{
memberBalanceModel
.
Description
=
"在线购买"
+
model
.
PonitNum
+
"点"
+
(
model
.
GivePoint
>
0
?
(
"赠送"
+
model
.
GivePoint
+
"点"
)
:
""
);
memberBalanceModel
.
Remarks
=
"订单号:"
+
model
.
OrderNo
+
"在线购买支付"
+
model
.
Income
+
"元"
+
model
.
PonitNum
+
"点"
+
(
model
.
GivePoint
>
0
?
(
"赠送"
+
model
.
GivePoint
+
"点"
)
:
""
);
}
memberPointBalanceRepository
.
Insert
(
memberBalanceModel
,
trans
);
flag
=
pointOrderRepository
.
Update
(
fileds
,
auditrecordWhereHelpers
,
trans
);
...
...
Mall.WebApi/Controllers/AppletWeChat/WeChatPayController.cs
View file @
38ebfa64
...
...
@@ -202,7 +202,7 @@ namespace Mall.WebApi.Controllers.AppletWeChat
#
region
点数充值
#
region
点数充值
(教育线上约课)
/// <summary>
/// 微信支付
/// </summary>
...
...
@@ -589,5 +589,96 @@ namespace Mall.WebApi.Controllers.AppletWeChat
return
ApiResult
.
Success
(
""
);
}
#
endregion
#
region
星星充值(相亲)
/// <summary>
/// 微信支付
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetStarsPayInfo
()
{
var
request
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
if
(
userInfo
==
null
)
{
return
ApiResult
.
Failed
(
"请登录"
);
}
RB_Point_Order_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Point_Order_Extend
>(
request
.
msg
.
ToString
());
string
sPayInfo
=
string
.
Empty
;
if
(!
demodel
.
PayWay
.
HasValue
)
{
return
ApiResult
.
Failed
(
"请选择支付方式"
);
}
//查询充值信息
if
(!
demodel
.
Income
.
HasValue
)
{
return
ApiResult
.
Failed
(
"请传入星星购买金额"
);
}
//查询用户的openId
var
userModel
=
userModule
.
GetMemberUserEntityModule
(
new
RB_Member_User_Extend
{
MallBaseId
=
userInfo
.
MallBaseId
,
TenantId
=
userInfo
.
TenantId
,
Id
=
userInfo
.
UserId
});
if
(
userModel
==
null
)
{
return
ApiResult
.
Failed
(
"用户不存在"
);
}
string
payGoodsName
=
"购买星星"
;
var
rechargeRulesModel
=
pointModule
.
GetPointGoodsList
(
new
Model
.
Extend
.
Point
.
RB_Point_Goods_Extend
{
MallBaseId
=
userInfo
.
MallBaseId
,
TenantId
=
userInfo
.
TenantId
,
ID
=
demodel
.
PointGoodsId
}).
FirstOrDefault
();
if
(
rechargeRulesModel
==
null
)
{
return
ApiResult
.
Failed
(
"选择的星星产品不存在"
);
}
if
(
demodel
.
PointGoodsId
>
0
)
{
if
(
demodel
.
Income
.
Value
!=
Convert
.
ToDecimal
(
rechargeRulesModel
.
SellingPrice
.
Value
))
{
return
ApiResult
.
Failed
(
"购买星星金额与设定的金额不符"
);
}
demodel
.
PonitNum
=
rechargeRulesModel
.
PonitNum
;
demodel
.
OldPonitNum
=
userModel
.
PointNum
;
demodel
.
GivePoint
=
rechargeRulesModel
.
GivePoint
;
}
else
{
return
ApiResult
.
Failed
(
"星星产品不存在"
);
}
Random
R
=
new
Random
();
int
Rstr
=
R
.
Next
(
111
,
999
);
demodel
.
OrderNo
=
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
)
+
Rstr
;
demodel
.
State
=
0
;
demodel
.
CreateDate
=
System
.
DateTime
.
Now
;
demodel
.
PaymentWay
=
Common
.
Enum
.
Goods
.
OrderPaymentTypeEnum
.
OnlinePayment
;
demodel
.
OrderStatus
=
1
;
demodel
.
VersionSource
=
2
;
demodel
.
UserId
=
userInfo
.
UserId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
OrderSource
=
userModel
.
Source
;
//新增充值记录
int
rechargeId
=
pointModule
.
SetPointOrder
(
demodel
);
if
(
rechargeId
==
0
)
{
return
ApiResult
.
Failed
(
"购买星星失败"
);
}
string
sOrderNo
=
(
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmssfff"
))
+
rechargeId
;
//根据订单号获取微信支付配置信息
RB_MiniProgram_Extend
miniProgram
=
new
RB_MiniProgram_Extend
();
//2020年5月26号新增
miniProgram
=
programModule
.
GetMiniProgramModule
(
new
RB_MiniProgram_Extend
{
MallBaseId
=
userInfo
.
MallBaseId
,
TenantId
=
userInfo
.
TenantId
});
App_Code
.
PayUtil
payUtil
=
new
App_Code
.
PayUtil
();
switch
((
int
)
demodel
.
PayWay
)
{
case
1
:
//微信支付
sPayInfo
=
App_Code
.
PayUtil
.
GetMinUnifiedOrder
(
sOrderNo
,
payGoodsName
,
Convert
.
ToDecimal
(
demodel
.
Income
),
userInfo
.
UserId
.
ToString
(),
userModel
.
OpenId
,
(
Config
.
sTenpayPointNotify
+
"/"
+
demodel
.
MallBaseId
+
"/"
+
demodel
.
TenantId
),
miniProgram
,
_accessor
,
System
.
Net
.
Dns
.
GetHostEntry
(
System
.
Net
.
Dns
.
GetHostName
()).
AddressList
.
FirstOrDefault
(
address
=>
address
.
AddressFamily
==
System
.
Net
.
Sockets
.
AddressFamily
.
InterNetwork
)?.
ToString
());
break
;
default
:
break
;
}
return
ApiResult
.
Success
(
""
,
sPayInfo
);
}
#
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