记得上下班打卡 | 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
69de7d89
Commit
69de7d89
authored
Feb 11, 2024
by
zhangguobing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~api:券商品业务-券类商品券限购调整;
parent
f03d4886
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
GoblinOrderServiceImpl.java
...et/service/order/service/impl/GoblinOrderServiceImpl.java
+2
-8
GoblinOrderUtils.java
...a/com/liquidnet/service/order/utils/GoblinOrderUtils.java
+10
-1
No files found.
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/GoblinOrderServiceImpl.java
View file @
69de7d89
...
@@ -195,13 +195,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
...
@@ -195,13 +195,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
}
}
//库存回滚
//库存回滚
if
(
surplusGeneral
<
0
)
{
if
(
surplusGeneral
<
0
)
{
// 这里加的'券类商品实名限购回滚'是因为这里'库存不足'没按异常处理
return
orderUtils
.
orderException
(
skuAndPreListAndNumber
,
platformCodeList
,
storeCodeList
,
uid
,
"库存不足"
,
couponSkuIdNoBuyLimitMap
);
if
(!
CollectionUtils
.
isEmpty
(
couponSkuIdNoBuyLimitMap
))
{
// 券类商品实名限购回滚
couponSkuIdNoBuyLimitMap
.
forEach
((
couponSkuIdNoBuyLimitKey
,
numb
)
->
{
redisUtils
.
redisUtil
.
decr
(
couponSkuIdNoBuyLimitKey
,
numb
);
});
}
return
orderUtils
.
orderException
(
skuAndPreListAndNumber
,
platformCodeList
,
storeCodeList
,
uid
,
"库存不足"
);
// throw new Exception("库存不足");
// throw new Exception("库存不足");
}
}
}
//GoblinOrderSkuParam
}
//GoblinOrderSkuParam
...
@@ -223,7 +217,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
...
@@ -223,7 +217,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
orderSqlParams
.
add
(
sqlParam
);
orderSqlParams
.
add
(
sqlParam
);
}
//GoblinOrderStoreParam
}
//GoblinOrderStoreParam
if
(
preParam
.
getOrderIdList
().
equals
(
""
))
{
if
(
preParam
.
getOrderIdList
().
equals
(
""
))
{
return
orderUtils
.
orderException
(
skuAndPreListAndNumber
,
platformCodeList
,
storeCodeList
,
uid
,
"参数异常"
);
return
orderUtils
.
orderException
(
skuAndPreListAndNumber
,
platformCodeList
,
storeCodeList
,
uid
,
"参数异常"
,
couponSkuIdNoBuyLimitMap
);
// throw new Exception("参数异常");
// throw new Exception("参数异常");
}
}
ResponseDto
<
GoblinPayInnerResultVo
>
data
=
payOrder
(
preParam
,
orderSqlParams
,
uid
);
ResponseDto
<
GoblinPayInnerResultVo
>
data
=
payOrder
(
preParam
,
orderSqlParams
,
uid
);
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinOrderUtils.java
View file @
69de7d89
...
@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -526,7 +527,9 @@ public class GoblinOrderUtils {
...
@@ -526,7 +527,9 @@ public class GoblinOrderUtils {
}
}
//订单异常处理
//订单异常处理
public
ResponseDto
<
GoblinPayInnerResultVo
>
orderException
(
List
<
String
>
skuAndPreListAndNumber
,
List
<
String
>
platformCodeList
,
List
<
String
>
storeCodeList
,
String
uid
,
String
message
)
{
public
ResponseDto
<
GoblinPayInnerResultVo
>
orderException
(
List
<
String
>
skuAndPreListAndNumber
,
List
<
String
>
platformCodeList
,
List
<
String
>
storeCodeList
,
String
uid
,
String
message
,
HashMap
<
String
,
Integer
>
couponSkuIdNoBuyLimitMap
)
{
long
time3
=
System
.
currentTimeMillis
();
long
time3
=
System
.
currentTimeMillis
();
//回顾限购 回滚库存
//回顾限购 回滚库存
for
(
String
item
:
skuAndPreListAndNumber
)
{
for
(
String
item
:
skuAndPreListAndNumber
)
{
...
@@ -554,6 +557,12 @@ public class GoblinOrderUtils {
...
@@ -554,6 +557,12 @@ public class GoblinOrderUtils {
if
(
params
.
size
()
>
0
)
{
if
(
params
.
size
()
>
0
)
{
backStoreCoupon
(
params
);
backStoreCoupon
(
params
);
}
}
// 这里加的'券类商品实名限购回滚'是因为这里'库存不足'没按异常处理
if
(!
CollectionUtils
.
isEmpty
(
couponSkuIdNoBuyLimitMap
))
{
// 券类商品实名限购回滚
couponSkuIdNoBuyLimitMap
.
forEach
((
couponSkuIdNoBuyLimitKey
,
numb
)
->
{
redisUtils
.
redisUtil
.
decr
(
couponSkuIdNoBuyLimitKey
,
numb
);
});
}
log
.
info
(
"回滚逻辑 "
+
(
System
.
currentTimeMillis
()
-
time3
)
+
"ms"
);
log
.
info
(
"回滚逻辑 "
+
(
System
.
currentTimeMillis
()
-
time3
)
+
"ms"
);
if
(
message
==
null
&&
!
message
.
equals
(
""
))
{
if
(
message
==
null
&&
!
message
.
equals
(
""
))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20018"
));
//乱七八糟异常
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20018"
));
//乱七八糟异常
...
...
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