Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
79a27917
Commit
79a27917
authored
Jan 30, 2019
by
Junling Bu
Browse files
chore[litemall-wx-api]: 微调
parent
fbc7dc6a
Changes
1
Show whitespace changes
Inline
Side-by-side
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/WxOrderService.java
View file @
79a27917
...
...
@@ -24,22 +24,14 @@ import org.linlinjava.litemall.db.service.*;
import
org.linlinjava.litemall.db.util.CouponUserConstant
;
import
org.linlinjava.litemall.db.util.OrderHandleOption
;
import
org.linlinjava.litemall.db.util.OrderUtil
;
import
org.linlinjava.litemall.wx.annotation.LoginUser
;
import
org.linlinjava.litemall.wx.util.IpUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.TransactionDefinition
;
import
org.springframework.transaction.TransactionStatus
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.support.DefaultTransactionDefinition
;
import
org.springframework.util.Assert
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.constraints.NotNull
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
...
...
@@ -320,9 +312,9 @@ public class WxOrderService {
// 使用优惠券减免的金额
BigDecimal
couponPrice
=
new
BigDecimal
(
0.00
);
// 如果couponId=0则没有优惠券,couponId=-1则不使用优惠券
if
(
couponId
!=
0
&&
couponId
!=
-
1
){
if
(
couponId
!=
0
&&
couponId
!=
-
1
)
{
LitemallCoupon
coupon
=
couponVerifyService
.
checkCoupon
(
userId
,
couponId
,
checkedGoodsPrice
);
if
(
coupon
==
null
){
if
(
coupon
==
null
)
{
return
ResponseUtil
.
badArgumentValue
();
}
couponPrice
=
coupon
.
getDiscount
();
...
...
@@ -409,7 +401,7 @@ public class WxOrderService {
}
// 如果使用了优惠券,设置优惠券使用状态
if
(
couponId
!=
0
&&
couponId
!=
-
1
){
if
(
couponId
!=
0
&&
couponId
!=
-
1
)
{
LitemallCouponUser
couponUser
=
couponUserService
.
queryOne
(
userId
,
couponId
);
couponUser
.
setStatus
(
CouponUserConstant
.
STATUS_USED
);
couponUser
.
setUsedTime
(
LocalDateTime
.
now
());
...
...
Write
Preview
Supports
Markdown
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