记得上下班打卡 | 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
92007c4b
Commit
92007c4b
authored
May 21, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加定时任务
parent
eb8e42d9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
1 deletion
+53
-1
FeignGoblinTaskClient.java
...dnet/service/feign/goblin/task/FeignGoblinTaskClient.java
+3
-0
GoblinTaskHandler.java
...dnet/service/executor/main/handler/GoblinTaskHandler.java
+9
-0
GoblinNftJobServiceImpl.java
...ce/goblin/service/impl/inner/GoblinNftJobServiceImpl.java
+1
-1
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+40
-0
No files found.
liquidnet-bus-feign/liquidnet-api-feign-goblin/src/main/java/com/liquidnet/service/feign/goblin/task/FeignGoblinTaskClient.java
View file @
92007c4b
...
@@ -16,4 +16,7 @@ public interface FeignGoblinTaskClient {
...
@@ -16,4 +16,7 @@ public interface FeignGoblinTaskClient {
@GetMapping
(
"rsc/nft/job/goodsList"
)
@GetMapping
(
"rsc/nft/job/goodsList"
)
ResponseDto
<
Boolean
>
goodsList
();
ResponseDto
<
Boolean
>
goodsList
();
@GetMapping
(
"rsc/nft/job/goblinNftListStock"
)
ResponseDto
<
Boolean
>
goblinNftListStock
();
}
}
liquidnet-bus-service/liquidnet-service-executor-all/liquidnet-service-executor-main/src/main/java/com/liquidnet/service/executor/main/handler/GoblinTaskHandler.java
View file @
92007c4b
...
@@ -29,4 +29,13 @@ public class GoblinTaskHandler {
...
@@ -29,4 +29,13 @@ public class GoblinTaskHandler {
}
}
}
}
@XxlJob
(
value
=
"sev-goblin:rollbackNftStock"
)
public
void
goblinNftListStock
()
{
try
{
XxlJobHelper
.
handleSuccess
(
"结果:"
+
feignGoblinTaskClient
.
goblinNftListStock
().
getData
());
}
catch
(
Exception
e
)
{
XxlJobHelper
.
log
(
e
);
XxlJobHelper
.
handleFail
();
}
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/inner/GoblinNftJobServiceImpl.java
View file @
92007c4b
...
@@ -261,7 +261,7 @@ public class GoblinNftJobServiceImpl {
...
@@ -261,7 +261,7 @@ public class GoblinNftJobServiceImpl {
List
<
GoblinNftGoodsSkuListJobVo
>
notStartSkuInfoVos
=
mongoTemplate
.
find
(
query1
,
GoblinNftGoodsSkuListJobVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
List
<
GoblinNftGoodsSkuListJobVo
>
notStartSkuInfoVos
=
mongoTemplate
.
find
(
query1
,
GoblinNftGoodsSkuListJobVo
.
class
,
GoblinGoodsSkuInfoVo
.
class
.
getSimpleName
());
for
(
GoblinNftGoodsSkuListJobVo
item
:
notStartSkuInfoVos
)
{
for
(
GoblinNftGoodsSkuListJobVo
item
:
notStartSkuInfoVos
)
{
goblinRedisUtils
.
g
etCollectByNow
(
now
,
item
.
getSkuId
());
goblinRedisUtils
.
g
oblinNftListStock
(
now
,
item
.
getSkuId
());
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
92007c4b
...
@@ -883,6 +883,46 @@ public class GoblinRedisUtils {
...
@@ -883,6 +883,46 @@ public class GoblinRedisUtils {
return
collectVo
;
return
collectVo
;
}
}
/**
* 分批购nft库存回滚
*
* @param now
* @param skuId
* @return
*/
public
GoblinListCollectVo
goblinNftListStock
(
LocalDateTime
now
,
String
skuId
)
{
GoblinListCollectVo
collectVo
=
null
;
GoblinListCollectVo
collectTemp
=
null
;
List
<
GoblinListCollectVo
>
collectVos
=
getGoblinListCollect
(
skuId
);
for
(
int
i
=
0
;
i
<
collectVos
.
size
();
i
++)
{
GoblinListCollectVo
collectVoItem
=
collectVos
.
get
(
i
);
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
;
}
else
if
(
collectVoItem
.
getTimeEnd
()
!=
null
&&
now
.
isAfter
(
collectVoItem
.
getTimeEnd
())){
collectTemp
=
null
;
}
}
if
(
collectVo
==
null
)
{
collectVo
=
collectTemp
;
}
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
;
}
/**
/**
* 根据时间获取当前分段购vo 如果当前没有返回下一个
* 根据时间获取当前分段购vo 如果当前没有返回下一个
*
*
...
...
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