记得上下班打卡 | 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
316c1abe
Commit
316c1abe
authored
Feb 17, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交 xls 队列 修改 平台券
parent
6e326c43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
8 deletions
+38
-8
GoblinOrderServiceImpl.java
...t/service/goblin/service/impl/GoblinOrderServiceImpl.java
+16
-7
GoblinOrderUtils.java
...a/com/liquidnet/service/goblin/util/GoblinOrderUtils.java
+22
-1
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinOrderServiceImpl.java
View file @
316c1abe
...
...
@@ -60,6 +60,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
@Override
public
ResponseDto
<
GoblinPayInnerResultVo
>
checkOrder
(
GoblinOrderParam
param
,
String
uid
)
{
List
<
String
>
skuAndPreListAndNumber
=
CollectionUtil
.
arrayListString
();
List
<
String
>
platformCodeList
=
CollectionUtil
.
arrayListString
();
List
<
String
>
storeCodeList
=
CollectionUtil
.
arrayListString
();
List
<
GoblinOrderSqlParam
>
orderSqlParams
=
ObjectUtil
.
getGoblinOrderSqlParamArrayListList
();
...
...
@@ -134,7 +136,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
}
}
//GoblinOrderSkuParam
//下单
GoblinOrderPreParam
pre
=
order
(
param
,
storeParam
,
uid
,
isMember
,
addressesVo
,
orderMasterCode
,
orderId
,
orderCode
);
GoblinOrderPreParam
pre
=
order
(
param
,
storeParam
,
uid
,
isMember
,
addressesVo
,
orderMasterCode
,
orderId
,
orderCode
,
platformCodeList
);
preParam
.
setPriceActual
(
preParam
.
getPriceActual
().
add
(
pre
.
getPriceActual
()));
preParam
.
setStoreName
(
preParam
.
getStoreName
()
+
","
+
pre
.
getStoreName
());
preParam
.
setSkuName
(
preParam
.
getSkuName
()
+
","
+
pre
.
getSkuName
());
...
...
@@ -162,8 +164,13 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
if
(
noZhengzaiOrder
(
uid
))
{
redisUtils
.
decrSkuCountByUid
(
uid
,
skuId
,
number
);
}
log
.
error
(
"回滚库存 skuId:{}"
,
skuId
);
log
.
error
(
"回滚库存 skuId:{}"
,
skuId
);
}
//回退平台券
for
(
String
platformCode
:
platformCodeList
)
{
orderUtils
.
backCoupon
(
platformCode
,
uid
);
}
//回退店铺券
if
(
e
.
getMessage
()
==
null
)
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"20018"
));
//乱七八糟异常
}
else
if
(
e
.
getMessage
().
equals
(
"券不可用"
))
{
...
...
@@ -182,7 +189,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
}
}
private
GoblinOrderPreParam
order
(
GoblinOrderParam
param
,
GoblinOrderStoreParam
storeParam
,
String
uid
,
boolean
isMember
,
AdamAddressesVo
addressesVo
,
String
orderMasterCode
,
String
orderId
,
String
orderCode
)
throws
Exception
{
private
GoblinOrderPreParam
order
(
GoblinOrderParam
param
,
GoblinOrderStoreParam
storeParam
,
String
uid
,
boolean
isMember
,
AdamAddressesVo
addressesVo
,
String
orderMasterCode
,
String
orderId
,
String
orderCode
,
List
<
String
>
platformCodeList
)
throws
Exception
{
String
platVoucherCode
=
storeParam
.
getPlatVoucherCode
();
String
storeId
=
storeParam
.
getStoreId
();
Map
token
=
CurrentUtil
.
getTokenClaims
();
...
...
@@ -256,14 +263,16 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
BigDecimal
voucherPrice
=
BigDecimal
.
ZERO
;
if
(
platVoucherCode
!=
null
&&
!
platVoucherCode
.
equals
(
""
))
{
String
spuIds
=
""
;
for
(
GoblinOrderSkuParam
item
:
storeParam
.
getGoblinOrderSkuParamArrayList
())
{
spuIds
=
spuIds
.
concat
(
item
.
getSpuId
());
for
(
GoblinOrderSkuParam
item
:
storeParam
.
getGoblinOrderSkuParamArrayList
())
{
spuIds
=
spuIds
.
concat
(
item
.
getSpuId
());
}
HashMap
<
String
,
Object
>
hashMap
=
orderUtils
.
useCoupon
(
platVoucherCode
,
"购买商品["
+
orderCode
+
"]"
,
storeTotalPrice
,
spuIds
);
voucherPrice
=
(
BigDecimal
)
hashMap
.
get
(
"voucher"
);
Integer
typeVoucher
=
(
Integer
)
hashMap
.
get
(
"type"
);
if
(
typeVoucher
.
equals
(-
1
))
{
throw
new
Exception
(
"券不可用"
);
}
else
{
platformCodeList
.
add
(
platVoucherCode
);
}
}
GoblinStoreInfoVo
storeInfoVo
=
redisUtils
.
getStoreInfoVo
(
storeId
);
...
...
@@ -440,9 +449,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
redisUtils
.
addUnPayOrder
(
orderVo
.
getOrderId
());
//redis 订单列表
if
(
noZhengzaiOrder
(
uid
))
{
if
(
orderVo
.
getMarketType
()
==
null
)
{
if
(
orderVo
.
getMarketType
()
==
null
)
{
redisUtils
.
addOrderList
(
uid
,
orderVo
.
getOrderId
());
}
else
if
(
orderVo
.
getMarketType
().
equals
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
()))
{
}
else
if
(
orderVo
.
getMarketType
().
equals
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
()))
{
redisUtils
.
addZhengzaiOrderList
(
uid
,
orderVo
.
getOrderId
());
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinOrderUtils.java
View file @
316c1abe
package
com
.
liquidnet
.
service
.
goblin
.
util
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
...
...
@@ -7,6 +8,7 @@ import com.liquidnet.commons.lang.util.HttpUtil;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.adam.dto.vo.AdamRscPolymer01Vo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.candy.param.BackCouponParam
;
import
com.liquidnet.service.candy.vo.CandyUseResultVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -15,6 +17,7 @@ import org.springframework.stereotype.Component;
import
org.springframework.util.MultiValueMap
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
@Component
...
...
@@ -85,7 +88,7 @@ public class GoblinOrderUtils {
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Authorization"
,
"Bearer "
+
CurrentUtil
.
getToken
());
header
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
String
returnData
=
HttpUtil
.
post
(
"http://172.16.3.71:9009/candy"
+
"/candy-coupon/use"
,
params
,
header
);
String
returnData
=
HttpUtil
.
post
(
candyUrl
+
"/candy-coupon/use"
,
params
,
header
);
ResponseDto
<
CandyUseResultVo
>
innerReturnVo
=
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
ResponseDto
<
CandyUseResultVo
>>()
{
});
CandyUseResultVo
candyUseResultVo
=
innerReturnVo
.
getData
();
...
...
@@ -123,6 +126,24 @@ public class GoblinOrderUtils {
}
}
public
void
backCoupon
(
String
uCouponId
,
String
uid
)
{
try
{
BackCouponParam
param
=
BackCouponParam
.
getNew
();
param
.
setuCouponIds
(
uCouponId
);
param
.
setUid
(
uid
);
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Authorization"
,
"Bearer "
+
CurrentUtil
.
getToken
());
header
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
ArrayList
<
BackCouponParam
>
params
=
new
ArrayList
();
params
.
add
(
param
);
String
jsonString
=
JSON
.
toJSONString
(
params
);
String
returnData
=
HttpUtil
.
postRaw
(
candyUrl
+
"/candy-coupon/useBack"
,
jsonString
,
header
);
}
catch
(
Exception
e
)
{
log
.
error
(
"回退券ERROR:{}"
,
e
);
}
}
public
void
doTask
(
String
uid
,
BigDecimal
price
)
{
try
{
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
...
...
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