记得上下班打卡 | 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
7dc360f9
Commit
7dc360f9
authored
Mar 09, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/hjc' into hjc
parents
34cfe8dc
f4c9eefb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
10 deletions
+21
-10
GoblinStoreOrderServiceImpl.java
...blin/service/impl/manage/GoblinStoreOrderServiceImpl.java
+9
-1
GoblinOrderServiceImpl.java
...et/service/order/service/impl/GoblinOrderServiceImpl.java
+5
-8
GoblinOrderUtils.java
...a/com/liquidnet/service/order/utils/GoblinOrderUtils.java
+7
-1
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreOrderServiceImpl.java
View file @
7dc360f9
...
@@ -682,7 +682,15 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
...
@@ -682,7 +682,15 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
params
.
add
(
"paymentId"
,
orderVo
.
getPaymentId
());
params
.
add
(
"paymentId"
,
orderVo
.
getPaymentId
());
params
.
add
(
"paymentType"
,
orderVo
.
getPaymentType
());
params
.
add
(
"paymentType"
,
orderVo
.
getPaymentType
());
params
.
add
(
"price"
,
String
.
valueOf
(
price
));
params
.
add
(
"price"
,
String
.
valueOf
(
price
));
params
.
add
(
"priceTotal"
,
String
.
valueOf
(
orderVo
.
getPriceActual
()));
BigDecimal
totalPrice
=
BigDecimal
.
ZERO
;
String
[]
orderIds
=
redisUtils
.
getMasterCode
(
orderVo
.
getOrderId
());
for
(
String
orderId:
orderIds
){
GoblinStoreOrderVo
vo
=
redisUtils
.
getGoblinOrder
(
orderId
);
totalPrice
=
totalPrice
.
add
(
vo
.
getPriceActual
());
}
params
.
add
(
"priceTotal"
,
String
.
valueOf
(
totalPrice
));
params
.
add
(
"reason"
,
"按需退款"
);
params
.
add
(
"reason"
,
"按需退款"
);
MultiValueMap
<
String
,
String
>
headers
=
CollectionUtil
.
linkedMultiValueMapStringString
();
MultiValueMap
<
String
,
String
>
headers
=
CollectionUtil
.
linkedMultiValueMapStringString
();
headers
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
headers
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/GoblinOrderServiceImpl.java
View file @
7dc360f9
...
@@ -103,19 +103,17 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
...
@@ -103,19 +103,17 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
String
orderId
=
IDGenerator
.
nextSnowId
();
String
orderId
=
IDGenerator
.
nextSnowId
();
String
orderCode
=
IDGenerator
.
storeCode
(
orderId
);
String
orderCode
=
IDGenerator
.
storeCode
(
orderId
);
for
(
GoblinOrderSkuParam
skuParam
:
storeParam
.
getGoblinOrderSkuParamArrayList
())
{
//商品维度循环
for
(
GoblinOrderSkuParam
skuParam
:
storeParam
.
getGoblinOrderSkuParamArrayList
())
{
//商品维度循环
Long
time3
=
System
.
currentTimeMillis
();
String
skuId
=
skuParam
.
getSkuId
();
String
skuId
=
skuParam
.
getSkuId
();
int
number
=
skuParam
.
getNumber
();
int
number
=
skuParam
.
getNumber
();
Long
time3
=
System
.
currentTimeMillis
();
GoblinGoodsSkuInfoVo
skuVo
=
redisUtils
.
getGoodsSkuInfoVo
(
skuId
);
GoblinGoodsSkuInfoVo
skuVo
=
redisUtils
.
getGoodsSkuInfoVo
(
skuId
);
if
(!(
skuVo
.
getStatus
().
equals
(
"3"
)
&&
skuVo
.
getShelvesStatus
().
equals
(
"3"
))
||
skuVo
.
getDelFlg
().
equals
(
"1"
))
{
if
(!(
skuVo
.
getStatus
().
equals
(
"3"
)
&&
skuVo
.
getShelvesStatus
().
equals
(
"3"
))
||
skuVo
.
getDelFlg
().
equals
(
"1"
))
{
throw
new
Exception
(
"不可购买"
);
throw
new
Exception
(
"不可购买"
);
}
}
log
.
info
(
"获取skuVo "
+(
time3
-
System
.
currentTimeMillis
())+
"ms"
);
// 判断库存
// 判断库存
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
skuId
);
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
skuId
);
int
limitCount
=
skuVo
.
getBuyLimit
()
==
0
?
Integer
.
MAX_VALUE
:
skuVo
.
getBuyLimit
();
int
limitCount
=
skuVo
.
getBuyLimit
()
==
0
?
Integer
.
MAX_VALUE
:
skuVo
.
getBuyLimit
();
//判断限购
//判断限购
time3
=
System
.
currentTimeMillis
();
if
(
noZhengzaiOrder
(
uid
))
{
if
(
noZhengzaiOrder
(
uid
))
{
String
res1
=
orderUtils
.
judgeOrderLimit
(
uid
,
skuId
,
number
,
limitCount
);
String
res1
=
orderUtils
.
judgeOrderLimit
(
uid
,
skuId
,
number
,
limitCount
);
if
(!
res1
.
equals
(
""
))
{
if
(!
res1
.
equals
(
""
))
{
...
@@ -127,11 +125,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
...
@@ -127,11 +125,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
throw
new
Exception
(
"无权购买"
);
throw
new
Exception
(
"无权购买"
);
}
}
}
}
log
.
info
(
"判断限购 "
+(
time3
-
System
.
currentTimeMillis
())+
"ms"
);
time3
=
System
.
currentTimeMillis
();
int
surplusGeneral
=
redisUtils
.
decrSkuStock
(
pre
,
skuId
,
number
);
int
surplusGeneral
=
redisUtils
.
decrSkuStock
(
pre
,
skuId
,
number
);
log
.
info
(
"获取剩余库存 "
+(
time3
-
System
.
currentTimeMillis
())+
"ms"
);
skuAndPreListAndNumber
.
add
(
skuId
+
","
+
pre
+
","
+
number
);
skuAndPreListAndNumber
.
add
(
skuId
+
","
+
pre
+
","
+
number
);
log
.
info
(
"判断逻辑 "
+(
System
.
currentTimeMillis
()-
time3
)+
"ms"
);
//库存回滚
//库存回滚
if
(
surplusGeneral
<
0
)
{
if
(
surplusGeneral
<
0
)
{
throw
new
Exception
(
"库存不足"
);
throw
new
Exception
(
"库存不足"
);
...
@@ -155,7 +151,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
...
@@ -155,7 +151,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
}
}
return
payOrder
(
preParam
,
orderSqlParams
,
uid
);
return
payOrder
(
preParam
,
orderSqlParams
,
uid
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"Kylin Order Pay Error = {}"
,
e
);
// log.error("Kylin Order Pay Error = {}", e);
Long
time3
=
System
.
currentTimeMillis
();
//回顾限购 回滚库存
//回顾限购 回滚库存
for
(
String
item
:
skuAndPreListAndNumber
)
{
for
(
String
item
:
skuAndPreListAndNumber
)
{
String
[]
array
=
item
.
split
(
","
);
String
[]
array
=
item
.
split
(
","
);
...
@@ -183,7 +180,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
...
@@ -183,7 +180,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
if
(
params
.
size
()
>
0
)
{
if
(
params
.
size
()
>
0
)
{
orderUtils
.
backStoreCoupon
(
params
);
orderUtils
.
backStoreCoupon
(
params
);
}
}
log
.
info
(
"回滚逻辑 "
+(
System
.
currentTimeMillis
()-
time3
)+
"ms"
);
if
(
e
.
getMessage
()
==
null
)
{
if
(
e
.
getMessage
()
==
null
)
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20018"
));
//乱七八糟异常
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20018"
));
//乱七八糟异常
}
else
if
(
e
.
getMessage
().
equals
(
"无权购买"
))
{
}
else
if
(
e
.
getMessage
().
equals
(
"无权购买"
))
{
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinOrderUtils.java
View file @
7dc360f9
...
@@ -427,7 +427,13 @@ public class GoblinOrderUtils {
...
@@ -427,7 +427,13 @@ public class GoblinOrderUtils {
params
.
add
(
"paymentId"
,
orderVo
.
getPaymentId
());
params
.
add
(
"paymentId"
,
orderVo
.
getPaymentId
());
params
.
add
(
"paymentType"
,
orderVo
.
getPaymentType
());
params
.
add
(
"paymentType"
,
orderVo
.
getPaymentType
());
params
.
add
(
"price"
,
String
.
valueOf
(
price
));
params
.
add
(
"price"
,
String
.
valueOf
(
price
));
params
.
add
(
"priceTotal"
,
String
.
valueOf
(
orderVo
.
getPriceActual
()));
BigDecimal
totalPrice
=
BigDecimal
.
ZERO
;
String
[]
orderIds
=
redisUtils
.
getMasterCode
(
orderVo
.
getOrderId
());
for
(
String
orderId:
orderIds
){
GoblinStoreOrderVo
vo
=
redisUtils
.
getGoblinOrder
(
orderId
);
totalPrice
=
totalPrice
.
add
(
vo
.
getPriceActual
());
}
params
.
add
(
"priceTotal"
,
String
.
valueOf
(
totalPrice
));
params
.
add
(
"reason"
,
"超时支付"
);
params
.
add
(
"reason"
,
"超时支付"
);
MultiValueMap
<
String
,
String
>
headers
=
CollectionUtil
.
linkedMultiValueMapStringString
();
MultiValueMap
<
String
,
String
>
headers
=
CollectionUtil
.
linkedMultiValueMapStringString
();
headers
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
headers
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
...
...
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