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