记得上下班打卡 | 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
f3b80d19
Commit
f3b80d19
authored
Jul 15, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hjc_admin_galaxy' into dev_pre
parents
4db77df5
9dc525b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
GoblinGagoController.java
.../web/controller/zhengzai/goblin/GoblinGagoController.java
+8
-0
GoblinRedisUtils.java
.../client/admin/zhengzai/goblin/utils/GoblinRedisUtils.java
+31
-2
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/goblin/GoblinGagoController.java
View file @
f3b80d19
...
@@ -90,6 +90,14 @@ public class GoblinGagoController extends BaseController {
...
@@ -90,6 +90,14 @@ public class GoblinGagoController extends BaseController {
return
AjaxResult
.
error
(
"该序号已被占用"
);
return
AjaxResult
.
error
(
"该序号已被占用"
);
}
}
//
//
int
count
=
goblinRedisUtils
.
decrSkuStock
(
null
,
skuId
,
1
);
if
(
count
<
0
){
goblinRedisUtils
.
incrSkuStock
(
null
,
skuId
,
1
);
goblinRedisUtils
.
removeNftList
(
skuId
,
nftNum
+
""
);
return
AjaxResult
.
error
(
"已售罄"
);
}
//下单
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
params
.
add
(
"userId"
,
uid
);
params
.
add
(
"userId"
,
uid
);
params
.
add
(
"skuId"
,
skuId
);
params
.
add
(
"skuId"
,
skuId
);
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/utils/GoblinRedisUtils.java
View file @
f3b80d19
...
@@ -158,7 +158,7 @@ public class GoblinRedisUtils {
...
@@ -158,7 +158,7 @@ public class GoblinRedisUtils {
}
}
//获取 当前xx链上SkuId 发行的数量
//获取 当前xx链上SkuId 发行的数量
public
int
getNftCountBySku
(
String
routerType
,
String
skuId
)
{
public
int
getNftCountBySku
(
String
routerType
,
String
skuId
)
{
String
redisKey
=
GalaxyConstant
.
REDIS_KEY_GALAXY_PUBLISH_NFT
.
concat
(
routerType
).
concat
(
":"
).
concat
(
skuId
);
String
redisKey
=
GalaxyConstant
.
REDIS_KEY_GALAXY_PUBLISH_NFT
.
concat
(
routerType
).
concat
(
":"
).
concat
(
skuId
);
Object
obj
=
redisDataSourceUtil
.
getRedisGoblinUtil
().
get
(
redisKey
);
Object
obj
=
redisDataSourceUtil
.
getRedisGoblinUtil
().
get
(
redisKey
);
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
...
@@ -191,10 +191,19 @@ public class GoblinRedisUtils {
...
@@ -191,10 +191,19 @@ public class GoblinRedisUtils {
return
true
;
return
true
;
}
}
//删除 nft序号站位list
public
boolean
removeNftList
(
String
skuId
,
String
num
)
{
String
redisKey
=
GoblinRedisConst
.
GOBLIN_NUM_LIST
.
concat
(
skuId
);
List
<
String
>
voList
=
getNftList
(
skuId
);
voList
.
remove
(
skuId
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
redisKey
,
voList
);
return
true
;
}
public
GoblinGoodsSkuInfoVo
getGoodsSkuInfoVo
(
String
skuId
)
{
public
GoblinGoodsSkuInfoVo
getGoodsSkuInfoVo
(
String
skuId
)
{
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
skuId
);
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
skuId
);
GoblinGoodsSkuInfoVo
vo
=
(
GoblinGoodsSkuInfoVo
)
redisDataSourceUtil
.
getRedisGoblinUtil
().
get
(
rk
);
GoblinGoodsSkuInfoVo
vo
=
(
GoblinGoodsSkuInfoVo
)
redisDataSourceUtil
.
getRedisGoblinUtil
().
get
(
rk
);
if
(
null
==
vo
)
{
if
(
null
==
vo
)
{
return
null
;
return
null
;
}
}
return
vo
;
return
vo
;
...
@@ -205,4 +214,24 @@ public class GoblinRedisUtils {
...
@@ -205,4 +214,24 @@ public class GoblinRedisUtils {
String
redisKey
=
GoblinRedisConst
.
GOBLIN_NUM_DETAILS
.
concat
(
num
).
concat
(
skuId
);
String
redisKey
=
GoblinRedisConst
.
GOBLIN_NUM_DETAILS
.
concat
(
num
).
concat
(
skuId
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
redisKey
,
dto
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
redisKey
,
dto
);
}
}
//减少库存
public
int
decrSkuStock
(
String
marketPre
,
String
skuId
,
Integer
stock
)
{
String
rk
=
GoblinRedisConst
.
REAL_STOCK_SKU
;
if
(
marketPre
!=
null
&&
!
marketPre
.
equals
(
"null"
))
{
rk
=
rk
.
concat
(
marketPre
+
":"
);
}
rk
=
rk
.
concat
(
skuId
);
return
(
int
)
redisDataSourceUtil
.
getRedisGoblinUtil
().
decr
(
rk
,
stock
);
}
//增加库存
public
int
incrSkuStock
(
String
marketPre
,
String
skuId
,
Integer
stock
)
{
String
rk
=
GoblinRedisConst
.
REAL_STOCK_SKU
;
if
(
marketPre
!=
null
&&
!
marketPre
.
equals
(
"null"
))
{
rk
=
rk
.
concat
(
marketPre
+
":"
);
}
rk
=
rk
.
concat
(
skuId
);
return
(
int
)
redisDataSourceUtil
.
getRedisGoblinUtil
().
incr
(
rk
,
stock
);
}
}
}
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