记得上下班打卡 | 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
7c1c6494
Commit
7c1c6494
authored
May 18, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 优先购/分批购 库存回滚逻辑
从 上个时间段内返回时间段内 改为 如果当前时间段不存在 则返回 下个时间段内
parent
b634b1be
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
3 deletions
+45
-3
GoblinNftJobController.java
...rvice/goblin/controller/Inner/GoblinNftJobController.java
+6
-0
GoblinNftJobServiceImpl.java
...ce/goblin/service/impl/inner/GoblinNftJobServiceImpl.java
+29
-2
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+10
-1
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/Inner/GoblinNftJobController.java
View file @
7c1c6494
...
@@ -27,4 +27,10 @@ public class GoblinNftJobController {
...
@@ -27,4 +27,10 @@ public class GoblinNftJobController {
return
goblinNftJobService
.
goodsList
();
return
goblinNftJobService
.
goodsList
();
}
}
@GetMapping
(
"goblinNftListStock"
)
@ApiOperation
(
"处理[未开售/开售]五分钟内的nft[优先购/分批购]库存job "
)
public
ResponseDto
<
Boolean
>
goblinNftListStock
()
{
return
goblinNftJobService
.
goblinNftListStock
();
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/inner/GoblinNftJobServiceImpl.java
View file @
7c1c6494
...
@@ -36,8 +36,6 @@ public class GoblinNftJobServiceImpl {
...
@@ -36,8 +36,6 @@ public class GoblinNftJobServiceImpl {
@Autowired
@Autowired
GoblinMongoUtils
mongoUtils
;
GoblinMongoUtils
mongoUtils
;
@Autowired
@Autowired
RedisUtil
redisUtil
;
@Autowired
private
GoblinOrderUtils
goblinOrderUtils
;
private
GoblinOrderUtils
goblinOrderUtils
;
@Autowired
@Autowired
GoblinCouponService
goblinCouponService
;
GoblinCouponService
goblinCouponService
;
...
@@ -141,4 +139,33 @@ public class GoblinNftJobServiceImpl {
...
@@ -141,4 +139,33 @@ public class GoblinNftJobServiceImpl {
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
/**
* 处理[未开售/开售]五分钟内的nft[优先购/分批购]库存job
*
* @return
*/
public
ResponseDto
<
Boolean
>
goblinNftListStock
()
{
LocalDateTime
now
=
LocalDateTime
.
now
();
try
{
// mongo初始条件
Query
query1
=
Query
.
query
(
Criteria
.
where
(
"skuType"
).
is
(
1
).
and
(
"delFlg"
).
is
(
"0"
)
.
and
(
"status"
).
is
(
"3"
).
and
(
"shelvesStatus"
).
is
(
"3"
)
.
and
(
"skuAppear"
).
is
(
"0"
)
.
orOperator
(
Criteria
.
where
(
"unbox"
).
is
(
"0"
).
and
(
"upchain"
).
is
(
1
),
Criteria
.
where
(
"unbox"
).
is
(
"1"
))
);
query1
.
addCriteria
(
Criteria
.
where
(
"saleStartTime"
).
gt
(
now
.
minusMinutes
(
10
)));
// 查询 未开售 和 开售五分钟内的skuId
List
<
GoblinNftGoodsSkuListJobVo
>
notStartSkuInfoVos
=
mongoTemplate
.
find
(
query1
,
GoblinNftGoodsSkuListJobVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
for
(
GoblinNftGoodsSkuListJobVo
item
:
notStartSkuInfoVos
)
{
goblinRedisUtils
.
getCollectByNow
(
now
,
item
.
getSkuId
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseDto
.
failure
();
}
return
ResponseDto
.
success
();
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
7c1c6494
...
@@ -868,7 +868,16 @@ public class GoblinRedisUtils {
...
@@ -868,7 +868,16 @@ public class GoblinRedisUtils {
if
(
collectVo
==
null
)
{
if
(
collectVo
==
null
)
{
collectVo
=
collectTemp
;
collectVo
=
collectTemp
;
}
}
lastStockToLastStock
(
1
,
collectVos
,
collectVo
,
skuId
);
if
(
collectVo
==
null
)
{
GoblinListCollectVo
collectNext
=
getCollectByNowNext
(
now
,
skuId
);
if
(
collectNext
==
null
)
{
lastStockToLastStock
(
0
,
collectVos
,
null
,
skuId
);
}
else
{
lastStockToLastStock
(
1
,
collectVos
,
collectNext
,
skuId
);
}
}
else
{
lastStockToLastStock
(
1
,
collectVos
,
collectVo
,
skuId
);
}
return
collectVo
;
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