记得上下班打卡 | 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
9945fb2f
Commit
9945fb2f
authored
May 10, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kylin消费nft超时支付关闭listId
parent
52f2dc4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
79 deletions
+19
-79
AbstractOrderCloseReceiver.java
...e/consumer/kylin/receiver/AbstractOrderCloseReceiver.java
+4
-4
GoblinNftUtils.java
...iquidnet/service/consumer/kylin/utils/GoblinNftUtils.java
+15
-75
No files found.
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-kylin/src/main/java/com/liquidnet/service/consumer/kylin/receiver/AbstractOrderCloseReceiver.java
View file @
9945fb2f
...
...
@@ -171,12 +171,12 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
goblinNftUtils
.
decrSkuCountByUid
(
nftOrder
.
getUserId
(),
nftOrder
.
getSkuId
(),
nftOrder
.
getNum
());
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
if
(
StringUtils
.
isEmpty
(
nftOrder
.
getBoxSkuId
()))
{
// 购买藏品
HashMap
<
String
,
Object
>
map
=
goblinNftUtils
.
getGoodsSkuInfoVo
(
nowTime
,
nftOrder
.
getSkuId
());
String
listId
=
(
String
)
map
.
get
(
"listId"
);
GoblinListCollectVo
goblinListCollectVo
=
goblinNftUtils
.
getCollectByNow
(
nowTime
,
nftOrder
.
getSkuId
());
String
listId
=
(
null
==
goblinListCollectVo
)
?
null
:
goblinListCollectVo
.
getListId
(
);
goblinNftUtils
.
incrSkuStock
(
listId
,
nftOrder
.
getSkuId
(),
nftOrder
.
getNum
());
}
else
{
// 购买盲盒
HashMap
<
String
,
Object
>
map
=
goblinNftUtils
.
getGoodsSkuInfoVo
(
nowTime
,
nftOrder
.
getBoxSkuId
());
String
listId
=
(
String
)
map
.
get
(
"listId"
);
GoblinListCollectVo
goblinListCollectVo
=
goblinNftUtils
.
getCollectByNow
(
nowTime
,
nftOrder
.
getBoxSkuId
());
String
listId
=
(
null
==
goblinListCollectVo
)
?
null
:
goblinListCollectVo
.
getListId
(
);
goblinNftUtils
.
incrSkuStock
(
listId
,
nftOrder
.
getBoxSkuId
(),
nftOrder
.
getNum
());
}
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-kylin/src/main/java/com/liquidnet/service/consumer/kylin/utils/GoblinNftUtils.java
View file @
9945fb2f
...
...
@@ -84,91 +84,31 @@ public class GoblinNftUtils {
}
/**
*
获取 包含分段购的sku详情 HASHMAP
*
根据时间获取当前分段购vo
*
* @param now
当前时间
* @param skuId
skuId
* @param now
* @param skuId
* @return
*/
public
HashMap
<
String
,
Object
>
getGoodsSkuInfoVo
(
LocalDateTime
now
,
String
skuId
)
{
GoblinGoodsSkuInfoVo
vo
=
getGoodsSkuInfoVo
(
skuId
);
List
<
GoblinListCollectVo
>
collectVos
=
getGoblinListCollect
(
skuId
);
public
GoblinListCollectVo
getCollectByNow
(
LocalDateTime
now
,
String
skuId
)
{
GoblinListCollectVo
collectVo
=
null
;
GoblinListCollectVo
collectTemp
=
null
;
List
<
GoblinListCollectVo
>
collectVos
=
getGoblinListCollect
(
skuId
);
for
(
GoblinListCollectVo
collectVoItem
:
collectVos
)
{
if
(
now
.
isAfter
(
collectVoItem
.
getTimeStart
())
&&
now
.
isBefore
(
collectVoItem
.
getTimeEnd
()))
{
if
(
now
.
isAfter
(
collectVoItem
.
getTimeStart
())
&&
collectVoItem
.
getTimeEnd
()
==
null
)
{
if
(
collectTemp
==
null
||
collectTemp
.
getTimeStart
().
isBefore
(
collectVoItem
.
getTimeStart
()))
{
collectTemp
=
collectVoItem
;
}
}
else
if
(
now
.
isAfter
(
collectVoItem
.
getTimeStart
())
&&
now
.
isBefore
(
collectVoItem
.
getTimeEnd
()))
{
collectVo
=
collectVoItem
;
break
;
}
}
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
Integer
tagType
=
null
;
String
listId
=
null
;
if
(
collectVo
!=
null
)
{
vo
.
setPrice
(
collectVo
.
getPrice
());
vo
.
setPriceV
(
collectVo
.
getPriceV
());
vo
.
setProductId
(
collectVo
.
getProductId
());
vo
.
setSaleStartTime
(
collectVo
.
getTimeStart
());
vo
.
setSaleStopTime
(
collectVo
.
getTimeEnd
());
tagType
=
collectVo
.
getTagType
();
listId
=
collectVo
.
getListId
();
}
map
.
put
(
"vo"
,
vo
);
map
.
put
(
"tagType"
,
tagType
);
map
.
put
(
"listId"
,
listId
);
return
map
;
}
/**
* 单品信息
*
* @param skuId 单品ID
* @return GoblinGoodsSkuInfoVo
*/
public
GoblinGoodsSkuInfoVo
getGoodsSkuInfoVo
(
String
skuId
)
{
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
skuId
);
if
(
pre
!=
null
&&
pre
.
equals
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
()))
{
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
skuId
.
split
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
())[
0
]);
GoblinGoodsSkuInfoVo
vo
=
(
GoblinGoodsSkuInfoVo
)
redisUtil
.
get
(
rk
);
if
(
null
==
vo
&&
null
!=
(
vo
=
getGoodsSkuInfoVoMdb
(
skuId
)))
{
redisUtil
.
set
(
rk
,
vo
);
}
if
(
vo
==
null
)
{
return
vo
;
}
String
marketrk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
skuId
);
GoblinGoodsSkuInfoVo
marketVo
=
(
GoblinGoodsSkuInfoVo
)
redisUtil
.
get
(
marketrk
);
if
(
null
==
marketVo
&&
null
!=
(
marketVo
=
getGoodsSkuInfoVoMdb
(
skuId
)))
{
redisUtil
.
set
(
marketrk
,
marketVo
);
}
if
(
marketVo
==
null
)
{
return
marketVo
;
}
vo
.
setSpuId
(
marketVo
.
getSpuId
());
vo
.
setSkuId
(
marketVo
.
getSkuId
());
vo
.
setPrice
(
marketVo
.
getPrice
());
vo
.
setPriceMember
(
marketVo
.
getPriceMember
());
vo
.
setSkuStock
(
marketVo
.
getSkuStock
());
vo
.
setBuyLimit
(
marketVo
.
getBuyLimit
());
vo
.
setBuyRoster
(
marketVo
.
getBuyRoster
());
vo
.
setBuyFactor
(
marketVo
.
getBuyFactor
());
// vo.setDelFlg("0");
vo
.
setDelFlg
(
marketVo
.
getDelFlg
().
equals
(
"1"
)
?
marketVo
.
getDelFlg
()
:
vo
.
getDelFlg
());
vo
.
setMarketId
(
marketVo
.
getMarketId
());
vo
.
setCreatedAt
(
LocalDateTime
.
now
());
return
vo
;
}
else
{
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
skuId
);
GoblinGoodsSkuInfoVo
vo
=
(
GoblinGoodsSkuInfoVo
)
redisUtil
.
get
(
rk
);
if
(
null
==
vo
&&
null
!=
(
vo
=
getGoodsSkuInfoVoMdb
(
skuId
)))
{
redisUtil
.
set
(
rk
,
vo
);
}
return
vo
;
if
(
collectVo
==
null
)
{
collectVo
=
collectTemp
;
}
}
// SKU信息
public
GoblinGoodsSkuInfoVo
getGoodsSkuInfoVoMdb
(
String
skuId
)
{
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"skuId"
).
is
(
skuId
)),
GoblinGoodsSkuInfoVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
// lastStockToLastStock(1,collectVos, collectVo, skuId);
return
collectVo
;
}
/**
* 分段购获取
...
...
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