Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xinrenli
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑云飞
xinrenli
Commits
60281576
Commit
60281576
authored
Apr 07, 2023
by
kaevom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改支付接口判断
parent
a2bbc772
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
yongqi-admin/src/main/resources/application-dev.yml
+1
-1
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/controller/DbFileController.java
+1
-1
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/impl/DbOrderServiceImpl.java
+6
-4
No files found.
yongqi-admin/src/main/resources/application-dev.yml
View file @
60281576
...
@@ -175,7 +175,7 @@ wx:
...
@@ -175,7 +175,7 @@ wx:
mchKey
:
fdfgg56hdfgh52sdf35dfgscfg84wsed
#微信支付商户密钥
mchKey
:
fdfgg56hdfgh52sdf35dfgscfg84wsed
#微信支付商户密钥
subAppId
:
#服务商模式下的子商户公众账号ID
subAppId
:
#服务商模式下的子商户公众账号ID
subMchId
:
#服务商模式下的子商户号
subMchId
:
#服务商模式下的子商户号
keyPath
:
C:\\ProgramData\\certKey\xinrenli\\apiclient_cert.p12
# p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
keyPath
:
/opt/xinrenli/cert/
#
C:\\ProgramData\\certKey\xinrenli\\apiclient_cert.p12 # p12证书的位置,可以指定绝对路径,也可以指定类路径(以classpath:开头)
notifyUrl
:
http://xinrenli.nyinhong.com/api/xinrenli/order/notify
# 微信支付回调接口
notifyUrl
:
http://xinrenli.nyinhong.com/api/xinrenli/order/notify
# 微信支付回调接口
refundNotifyUrl
:
http://xinrenli.nyinhong.com/api/xinrenli/order/refundNotify
# 微信t退款回调接口
refundNotifyUrl
:
http://xinrenli.nyinhong.com/api/xinrenli/order/refundNotify
# 微信t退款回调接口
# mp:
# mp:
...
...
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/controller/DbFileController.java
View file @
60281576
...
@@ -124,7 +124,7 @@ public class DbFileController extends BaseController {
...
@@ -124,7 +124,7 @@ public class DbFileController extends BaseController {
@PostMapping
(
"/upload"
)
@PostMapping
(
"/upload"
)
public
R
upload
(
MultipartFile
file
,
HttpServletRequest
req
)
{
public
R
upload
(
MultipartFile
file
,
HttpServletRequest
req
)
{
if
(!
file
.
isEmpty
()){
if
(!
file
.
isEmpty
()){
//
String uploadPath = "C:\\uploadFile";
String
uploadPath
=
"C:\\uploadFile"
;
// 如果目录不存在则创建
// 如果目录不存在则创建
File
uploadDir
=
new
File
(
uploadPath
);
File
uploadDir
=
new
File
(
uploadPath
);
if
(!
uploadDir
.
exists
())
{
if
(!
uploadDir
.
exists
())
{
...
...
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/impl/DbOrderServiceImpl.java
View file @
60281576
...
@@ -370,6 +370,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -370,6 +370,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
public
R
orderPay
(
Long
orderId
,
Long
couponId
,
Long
discountId
,
LoginUser
loginUser
,
String
ipAddr
)
{
public
R
orderPay
(
Long
orderId
,
Long
couponId
,
Long
discountId
,
LoginUser
loginUser
,
String
ipAddr
)
{
// 1.根据订单id获取订单信息
// 1.根据订单id获取订单信息
DbOrder
dbOrder
=
this
.
baseMapper
.
selectById
(
orderId
);
DbOrder
dbOrder
=
this
.
baseMapper
.
selectById
(
orderId
);
//支付金额
BigDecimal
payAmount
=
dbOrder
.
getActualAmount
();
// 2.根据卡券id获取卡券信息
// 2.根据卡券id获取卡券信息
DbCoupon
dbCoupon
=
couponMapper
.
selectById
(
couponId
);
DbCoupon
dbCoupon
=
couponMapper
.
selectById
(
couponId
);
//3.根据打折id获取打折信息
//3.根据打折id获取打折信息
...
@@ -392,7 +394,7 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -392,7 +394,7 @@ public class DbOrderServiceImpl implements IDbOrderService {
log
.
error
(
"此优惠券已经使用过了:userId:{},couponId:{}"
,
loginUser
.
getUserId
(),
couponId
);
log
.
error
(
"此优惠券已经使用过了:userId:{},couponId:{}"
,
loginUser
.
getUserId
(),
couponId
);
return
R
.
fail
(
"此优惠券已经使用过了"
);
return
R
.
fail
(
"此优惠券已经使用过了"
);
}
}
dbOrder
.
setActualAmount
(
dbOrder
.
getActualAmount
().
subtract
(
dbCoupon
.
getFullSubtraction
()
));
payAmount
=
dbOrder
.
getActualAmount
().
subtract
(
dbCoupon
.
getFullSubtraction
(
));
}
}
if
(
ObjectUtils
.
isNotEmpty
(
discount
)){
if
(
ObjectUtils
.
isNotEmpty
(
discount
)){
if
(!
discount
.
getUserId
().
equals
(
loginUser
.
getUserId
())){
if
(!
discount
.
getUserId
().
equals
(
loginUser
.
getUserId
())){
...
@@ -403,10 +405,10 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -403,10 +405,10 @@ public class DbOrderServiceImpl implements IDbOrderService {
log
.
error
(
"此折扣已经使用过了:userId:{},couponId:{}"
,
loginUser
.
getUserId
(),
discountId
);
log
.
error
(
"此折扣已经使用过了:userId:{},couponId:{}"
,
loginUser
.
getUserId
(),
discountId
);
return
R
.
fail
(
"此折扣已经使用过了"
);
return
R
.
fail
(
"此折扣已经使用过了"
);
}
}
dbOrder
.
setActualAmount
(
dbOrder
.
getActualAmount
().
multiply
(
discount
.
getDiscountRatio
()
));
payAmount
=
payAmount
.
multiply
(
discount
.
getDiscountRatio
(
));
}
}
dbOrder
.
setPayAmount
(
dbOrder
.
getActualAmount
()
);
dbOrder
.
setPayAmount
(
payAmount
);
dbOrder
.
setUseCouponId
(
couponId
);
dbOrder
.
setUseCouponId
(
couponId
);
dbOrder
.
setUseDiscountId
(
discountId
);
dbOrder
.
setUseDiscountId
(
discountId
);
String
orderNo
=
CodeUtils
.
createSerialNumber
(
"XQ"
);
String
orderNo
=
CodeUtils
.
createSerialNumber
(
"XQ"
);
...
@@ -424,7 +426,7 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -424,7 +426,7 @@ public class DbOrderServiceImpl implements IDbOrderService {
// 商户订单号
// 商户订单号
request
.
setOutTradeNo
(
orderNo
);
request
.
setOutTradeNo
(
orderNo
);
BigDecimal
actualPrice
=
dbOrder
.
getActualAmount
()
.
multiply
(
BigDecimal
.
valueOf
(
100
));
BigDecimal
actualPrice
=
payAmount
.
multiply
(
BigDecimal
.
valueOf
(
100
));
// 标价金额
// 标价金额
request
.
setTotalFee
((
actualPrice
.
intValue
()));
request
.
setTotalFee
((
actualPrice
.
intValue
()));
// 客户端IP
// 客户端IP
...
...
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