记得上下班打卡 | 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
2aa46f40
Commit
2aa46f40
authored
Aug 27, 2022
by
张禹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre' into 'master'
Pre See merge request
!302
parents
a39000b7
7e9644eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
8 deletions
+30
-8
GoblinGagoController.java
.../web/controller/zhengzai/goblin/GoblinGagoController.java
+6
-4
GalaxyTradeBiz.java
...java/com/liquidnet/service/galaxy/biz/GalaxyTradeBiz.java
+5
-4
XuperTradeCommonBiz.java
.../service/galaxy/router/xuper/biz/XuperTradeCommonBiz.java
+19
-0
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 @
2aa46f40
...
...
@@ -36,7 +36,7 @@ public class GoblinGagoController extends BaseController {
RedisDataSourceUtil
redisDataSourceUtil
;
@Autowired
GoblinRedisUtils
goblinRedisUtils
;
@Value
(
"${liquidnet.service.order.url}"
)
@Value
(
"${liquidnet.service.order.url}"
)
private
String
orderUrl
;
// private String orderUrl = "http://127.0.0.1:9004/order";
...
...
@@ -75,6 +75,7 @@ public class GoblinGagoController extends BaseController {
public
AjaxResult
listByStatus
(
@RequestParam
(
value
=
"skuId"
)
String
skuId
,
@RequestParam
(
value
=
"nftNum"
)
int
nftNum
,
@RequestParam
(
value
=
"uid"
)
String
uid
)
{
//当前 nft序号
GoblinGoodsSkuInfoVo
skuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
skuId
);
String
routeType
=
skuInfoVo
.
getRouteType
();
int
cNufCount
=
goblinRedisUtils
.
getNftCountBySku
(
skuInfoVo
.
getRouteType
(),
skuId
);
if
(
cNufCount
>=
nftNum
)
{
return
AjaxResult
.
error
(
"该序号已售卖"
);
...
...
@@ -90,9 +91,9 @@ public class GoblinGagoController extends BaseController {
return
AjaxResult
.
error
(
"该序号已被占用"
);
}
//
int
count
=
goblinRedisUtils
.
decrSkuStock
(
null
,
skuId
,
1
);
if
(
count
<
0
)
{
goblinRedisUtils
.
incrSkuStock
(
null
,
skuId
,
1
);
int
count
=
goblinRedisUtils
.
decrSkuStock
(
null
,
skuId
,
1
);
if
(
count
<
0
)
{
goblinRedisUtils
.
incrSkuStock
(
null
,
skuId
,
1
);
goblinRedisUtils
.
removeNftList
(
skuId
,
nftNum
+
""
);
return
AjaxResult
.
error
(
"已售罄"
);
}
...
...
@@ -113,6 +114,7 @@ public class GoblinGagoController extends BaseController {
dto
.
setNftOrderPayId
(
innerReturnVo
.
getData
());
dto
.
setSkuId
(
skuId
);
dto
.
setUserId
(
uid
);
dto
.
setRouterType
(
routeType
);
goblinRedisUtils
.
setNftNumDetails
(
nftNum
+
""
,
skuId
,
dto
);
return
AjaxResult
.
success
();
}
else
{
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/biz/GalaxyTradeBiz.java
View file @
2aa46f40
...
...
@@ -8,12 +8,13 @@ import com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBindBo;
import
com.liquidnet.service.galaxy.dto.bo.GalaxySeriesNftInfoBo
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyReqDto
;
import
com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyRespDto
;
import
com.liquidnet.service.galaxy.
router.zxin.biz.ZxinTradeCommonBiz
;
import
com.liquidnet.service.galaxy.
service.IGalaxyTradeService
;
import
com.liquidnet.service.galaxy.utils.GalaxyDataUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.List
;
...
...
@@ -32,8 +33,8 @@ public class GalaxyTradeBiz {
@Autowired
private
GalaxyDataUtils
dataUtils
;
@
Autowired
private
ZxinTradeCommonBiz
zxinTradeCommonBiz
;
@
Resource
(
name
=
"galaxyTradeServiceImpl"
)
private
IGalaxyTradeService
galaxyTradeService
;
/**
* 根据skuid和nftIndex判断是否切换nft购买订单
* @param skuid
...
...
@@ -71,7 +72,7 @@ public class GalaxyTradeBiz {
//执行nft购买订单切换
log
.
info
(
"开始执行nft购买订单切换===>>>>> reqParam:{}"
,
JsonUtils
.
toJson
(
reqDto
));
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
responseDto
=
zxinTradeCommonBiz
.
nftPublishAndBuy
(
reqDto
);
ResponseDto
<
GalaxyNftPublishAndBuyRespDto
>
responseDto
=
galaxyTradeService
.
nftPublishAndBuy
(
reqDto
);
log
.
info
(
"执行nft购买订单切换结果===>>>>> response:{}"
,
JsonUtils
.
toJson
(
responseDto
));
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/router/xuper/biz/XuperTradeCommonBiz.java
View file @
2aa46f40
...
...
@@ -13,6 +13,7 @@ import com.liquidnet.commons.lang.util.StringUtil;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.galaxy.biz.GalaxyBeanTransferBiz
;
import
com.liquidnet.service.galaxy.biz.GalaxyEnumBiz
;
import
com.liquidnet.service.galaxy.biz.GalaxyTradeBiz
;
import
com.liquidnet.service.galaxy.constant.GalaxyEnum
;
import
com.liquidnet.service.galaxy.constant.GalaxyErrorEnum
;
import
com.liquidnet.service.galaxy.dto.bo.GalaxyNftOrderBindBo
;
...
...
@@ -30,6 +31,8 @@ import org.springframework.stereotype.Component;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
...
...
@@ -55,6 +58,11 @@ public class XuperTradeCommonBiz {
@Autowired
private
GalaxyBeanTransferBiz
galaxyBeanTransferBiz
;
@Autowired
private
GalaxyTradeBiz
galaxyTradeBiz
;
private
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
10
);
/**
* 发行和购买
* @param reqDto
...
...
@@ -139,6 +147,17 @@ public class XuperTradeCommonBiz {
//发行失败
throw
new
GalaxyNftPublishException
(
GalaxyErrorEnum
.
NFT_PUBLISH_ERROR
.
getCode
(),
"该sku:"
+
reqDto
.
getSkuId
()+
" 总共"
+
seriesNftInfoBo
.
getNftTotalCount
()+
"个NFT已经发行完毕,没有剩余库存!"
);
}
//判断是否切换订单
while
(
galaxyTradeBiz
.
isNeedSwitch
(
reqDto
.
getSkuId
(),
String
.
valueOf
(
nftIdNo
))){
long
finalNftIdNo
=
nftIdNo
;
//开启新线程去执行购买
executorService
.
submit
(()
->
{
galaxyTradeBiz
.
switchBuyRouterBySkuId
(
reqDto
.
getSkuId
(),
String
.
valueOf
(
finalNftIdNo
),
seriesNftInfoBo
);
});
nftIdNo
=
dataUtils
.
incrNftIdNo
(
reqDto
.
getRouterType
(),
reqDto
.
getSkuId
());
}
nftOrderBindBo
=
GalaxyNftOrderBindBo
.
getNew
();
nftOrderBindBo
.
setNftOrderPayId
(
reqDto
.
getNftOrderPayId
());
nftOrderBindBo
.
setSeriesId
(
seriesNftInfoBo
.
getSeriesId
());
...
...
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