记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
f9a2ab5b
Commit
f9a2ab5b
authored
Mar 07, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优先券报错 则订单下单失败
优惠券报错则 优惠券逻辑跳过
parent
55634f02
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
84 deletions
+93
-84
KylinOrderTicketsServiceImpl.java
...vice/order/service/impl/KylinOrderTicketsServiceImpl.java
+24
-21
GoblinOrderUtils.java
...a/com/liquidnet/service/order/utils/GoblinOrderUtils.java
+65
-60
OrderUtils.java
...in/java/com/liquidnet/service/order/utils/OrderUtils.java
+4
-3
No files found.
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/KylinOrderTicketsServiceImpl.java
View file @
f9a2ab5b
...
@@ -260,6 +260,9 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -260,6 +260,9 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
}
else
{
}
else
{
if
(
memberType
==
1
)
{
if
(
memberType
==
1
)
{
advanceMap
=
orderUtils
.
useCoupon
(
payOrderParam
.
getAdvanceCode
(),
"购买 "
+
performanceData
.
getTitle
(),
BigDecimal
.
ZERO
,
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTimeId
(),
payOrderParam
.
getTicketId
());
advanceMap
=
orderUtils
.
useCoupon
(
payOrderParam
.
getAdvanceCode
(),
"购买 "
+
performanceData
.
getTitle
(),
BigDecimal
.
ZERO
,
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTimeId
(),
payOrderParam
.
getTicketId
());
if
(
advanceMap
==
null
)
{
return
ResponseDto
.
failure
(
"优先券券不可用"
);
}
Integer
typeVoucher
=
(
Integer
)
advanceMap
.
get
(
"type"
);
Integer
typeVoucher
=
(
Integer
)
advanceMap
.
get
(
"type"
);
if
(
typeVoucher
.
equals
(-
1
))
{
if
(
typeVoucher
.
equals
(-
1
))
{
return
ResponseDto
.
failure
(
"优先券券不可用"
);
return
ResponseDto
.
failure
(
"优先券券不可用"
);
...
@@ -453,13 +456,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -453,13 +456,13 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
if
(
payOrderParam
.
getVoucherCode
()
!=
null
)
{
if
(
payOrderParam
.
getVoucherCode
()
!=
null
)
{
HashMap
<
String
,
Object
>
hashMap
=
orderUtils
.
useCoupon
(
payOrderParam
.
getVoucherCode
(),
content
,
orderTickets
.
getPriceTotal
().
subtract
(
priceExpress
),
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTimeId
(),
payOrderParam
.
getTicketId
());
HashMap
<
String
,
Object
>
hashMap
=
orderUtils
.
useCoupon
(
payOrderParam
.
getVoucherCode
(),
content
,
orderTickets
.
getPriceTotal
().
subtract
(
priceExpress
),
payOrderParam
.
getPerformanceId
(),
payOrderParam
.
getTimeId
(),
payOrderParam
.
getTicketId
());
if
(
null
!=
hashMap
)
{
BigDecimal
priceVoucher
=
(
BigDecimal
)
hashMap
.
get
(
"voucher"
);
BigDecimal
priceVoucher
=
(
BigDecimal
)
hashMap
.
get
(
"voucher"
);
Integer
typeVoucher
=
(
Integer
)
hashMap
.
get
(
"type"
);
Integer
typeVoucher
=
(
Integer
)
hashMap
.
get
(
"type"
);
if
(
typeVoucher
.
equals
(-
1
))
{
if
(
typeVoucher
.
equals
(-
1
))
{
throw
new
Exception
(
"券不可用"
);
throw
new
Exception
(
"券不可用"
);
}
}
orderTickets
.
setPriceVoucher
(
priceVoucher
);
orderTickets
.
setPriceVoucher
(
priceVoucher
);
KylinOrderCoupons
couponsVoucher
=
KylinOrderCoupons
.
getNew
();
KylinOrderCoupons
couponsVoucher
=
KylinOrderCoupons
.
getNew
();
couponsVoucher
.
setOrderId
(
orderTicketId
);
couponsVoucher
.
setOrderId
(
orderTicketId
);
couponsVoucher
.
setCouponCode
(
payOrderParam
.
getVoucherCode
());
couponsVoucher
.
setCouponCode
(
payOrderParam
.
getVoucherCode
());
...
@@ -467,11 +470,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -467,11 +470,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
couponsVoucher
.
setCouponPrice
(
priceVoucher
);
couponsVoucher
.
setCouponPrice
(
priceVoucher
);
couponsVoucher
.
setCreatedAt
(
now
);
couponsVoucher
.
setCreatedAt
(
now
);
couponsList
.
add
(
couponsVoucher
);
couponsList
.
add
(
couponsVoucher
);
sqlsDataE
.
add
(
new
Object
[]{
sqlsDataE
.
add
(
new
Object
[]{
orderTicketId
,
payOrderParam
.
getVoucherCode
(),
typeVoucher
,
priceVoucher
,
now
,
now
orderTicketId
,
payOrderParam
.
getVoucherCode
(),
typeVoucher
,
priceVoucher
,
now
,
now
});
});
}
}
}
if
(
couponsList
.
size
()
>
0
)
{
if
(
couponsList
.
size
()
>
0
)
{
dataUtils
.
setOrderCoupon
(
orderTicketId
,
couponsList
);
dataUtils
.
setOrderCoupon
(
orderTicketId
,
couponsList
);
...
@@ -644,11 +647,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -644,11 +647,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
httpData
.
add
(
"showUrl"
,
payOrderParam
.
getShowUrl
()
+
orderTicketId
);
httpData
.
add
(
"showUrl"
,
payOrderParam
.
getShowUrl
()
+
orderTicketId
);
httpData
.
add
(
"returnUrl"
,
payOrderParam
.
getReturnUrl
()
+
orderTicketId
);
httpData
.
add
(
"returnUrl"
,
payOrderParam
.
getReturnUrl
()
+
orderTicketId
);
}
}
if
(
payOrderParam
.
getPayType
().
equals
(
"douyinpay"
))
{
if
(
payOrderParam
.
getPayType
().
equals
(
"douyinpay"
))
{
httpData
.
add
(
"showUrl"
,
payOrderParam
.
getShowUrl
()
+
orderTicketId
);
httpData
.
add
(
"showUrl"
,
payOrderParam
.
getShowUrl
()
+
orderTicketId
);
httpData
.
add
(
"returnUrl"
,
payOrderParam
.
getReturnUrl
()
+
orderTicketId
);
httpData
.
add
(
"returnUrl"
,
payOrderParam
.
getReturnUrl
()
+
orderTicketId
);
}
}
if
(
payOrderParam
.
getPayType
().
equals
(
"unionpay"
))
{
if
(
payOrderParam
.
getPayType
().
equals
(
"unionpay"
))
{
httpData
.
add
(
"returnUrl"
,
payOrderParam
.
getReturnUrl
()
+
orderTicketId
);
httpData
.
add
(
"returnUrl"
,
payOrderParam
.
getReturnUrl
()
+
orderTicketId
);
}
}
log
.
debug
(
"调用 DRAGON 参数 = "
+
httpData
.
toString
());
log
.
debug
(
"调用 DRAGON 参数 = "
+
httpData
.
toString
());
...
@@ -770,11 +773,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
...
@@ -770,11 +773,11 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
httpData
.
add
(
"showUrl"
,
payAgainParam
.
getShowUrl
()
+
payAgainParam
.
getOrderId
());
httpData
.
add
(
"showUrl"
,
payAgainParam
.
getShowUrl
()
+
payAgainParam
.
getOrderId
());
httpData
.
add
(
"returnUrl"
,
payAgainParam
.
getReturnUrl
()
+
payAgainParam
.
getOrderId
());
httpData
.
add
(
"returnUrl"
,
payAgainParam
.
getReturnUrl
()
+
payAgainParam
.
getOrderId
());
}
}
if
(
payAgainParam
.
getPayType
().
equals
(
"douyinpay"
))
{
if
(
payAgainParam
.
getPayType
().
equals
(
"douyinpay"
))
{
httpData
.
add
(
"showUrl"
,
payAgainParam
.
getShowUrl
()
+
payAgainParam
.
getOrderId
());
httpData
.
add
(
"showUrl"
,
payAgainParam
.
getShowUrl
()
+
payAgainParam
.
getOrderId
());
httpData
.
add
(
"returnUrl"
,
payAgainParam
.
getReturnUrl
()
+
payAgainParam
.
getOrderId
());
httpData
.
add
(
"returnUrl"
,
payAgainParam
.
getReturnUrl
()
+
payAgainParam
.
getOrderId
());
}
}
if
(
payAgainParam
.
getPayType
().
equals
(
"unionpay"
))
{
if
(
payAgainParam
.
getPayType
().
equals
(
"unionpay"
))
{
httpData
.
add
(
"returnUrl"
,
payAgainParam
.
getReturnUrl
()
+
payAgainParam
.
getOrderId
());
httpData
.
add
(
"returnUrl"
,
payAgainParam
.
getReturnUrl
()
+
payAgainParam
.
getOrderId
());
}
}
String
returnData
=
HttpUtil
.
post
(
payUrl
,
httpData
);
String
returnData
=
HttpUtil
.
post
(
payUrl
,
httpData
);
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinOrderUtils.java
View file @
f9a2ab5b
...
@@ -205,6 +205,7 @@ public class GoblinOrderUtils {
...
@@ -205,6 +205,7 @@ public class GoblinOrderUtils {
}
}
public
GoblinUseResultVo
useStoreCoupon
(
String
ucouponId
,
String
content
,
BigDecimal
totalPrice
,
String
spuId
,
String
uid
)
{
public
GoblinUseResultVo
useStoreCoupon
(
String
ucouponId
,
String
content
,
BigDecimal
totalPrice
,
String
spuId
,
String
uid
)
{
try
{
List
<
GoblinUserCouponVo
>
voList
=
redisUtils
.
getUserCouponVos
(
uid
);
List
<
GoblinUserCouponVo
>
voList
=
redisUtils
.
getUserCouponVos
(
uid
);
GoblinUseResultVo
returnVo
=
GoblinUseResultVo
.
getNew
();
GoblinUseResultVo
returnVo
=
GoblinUseResultVo
.
getNew
();
returnVo
.
setValue
(
BigDecimal
.
ZERO
);
returnVo
.
setValue
(
BigDecimal
.
ZERO
);
...
@@ -274,6 +275,10 @@ public class GoblinOrderUtils {
...
@@ -274,6 +275,10 @@ public class GoblinOrderUtils {
redisUtils
.
setUserCouponVos
(
uid
,
voList
);
redisUtils
.
setUserCouponVos
(
uid
,
voList
);
}
}
return
returnVo
;
return
returnVo
;
}
catch
(
Exception
e
){
log
.
error
(
"店铺券错误:{}"
,
e
);
return
null
;
}
}
}
public
Boolean
backStoreCoupon
(
List
<
com
.
liquidnet
.
service
.
goblin
.
param
.
BackCouponParam
>
params
)
{
public
Boolean
backStoreCoupon
(
List
<
com
.
liquidnet
.
service
.
goblin
.
param
.
BackCouponParam
>
params
)
{
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/OrderUtils.java
View file @
f9a2ab5b
...
@@ -271,9 +271,10 @@ public class OrderUtils {
...
@@ -271,9 +271,10 @@ public class OrderUtils {
return
hashMap
;
return
hashMap
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"用券ERROR:{}"
,
e
);
log
.
error
(
"用券ERROR:{}"
,
e
);
hashMap
.
put
(
"type"
,
-
1
);
// hashMap.put("type", -1);
hashMap
.
put
(
"voucher"
,
-
1
);
// hashMap.put("voucher", -1);
return
hashMap
;
// return hashMap;
return
null
;
}
}
}
}
...
...
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