记得上下班打卡 | 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
0a936419
Commit
0a936419
authored
May 24, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into hjc_goblin_list_unbox
parents
8c5fd082
e33e076c
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
120 additions
and
64 deletions
+120
-64
GoblinNftGoodsSkuInfoVo.java
...uidnet/service/goblin/dto/vo/GoblinNftGoodsSkuInfoVo.java
+5
-0
GoblinUserDigitalArtworkInfoVo.java
...service/goblin/dto/vo/GoblinUserDigitalArtworkInfoVo.java
+5
-1
liquidnet-service-goblin.yml
...-bus-config/liquidnet-config/liquidnet-service-goblin.yml
+1
-0
GoblinGoodsSku.java
...a/com/liquidnet/service/goblin/entity/GoblinGoodsSku.java
+0
-3
AbstractDataUtils.java
...com/liquidnet/service/galaxy/utils/AbstractDataUtils.java
+1
-1
sqlmap-galaxy.properties
...goblin-common/src/main/resources/sqlmap-galaxy.properties
+1
-1
GoblinGoodsAnticipateServiceImpl.java
...goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
+13
-9
GoblinNftGoodsAppServiceImpl.java
...ice/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
+3
-0
GoblinUserDigitalArtworkServiceImpl.java
...lin/service/impl/GoblinUserDigitalArtworkServiceImpl.java
+5
-0
GoblinListServiceImpl.java
...ice/goblin/service/impl/manage/GoblinListServiceImpl.java
+12
-6
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+6
-1
errors.properties
...-service-goblin-impl/src/main/resources/errors.properties
+2
-1
GoblinNftOrderServiceImpl.java
...service/order/service/impl/GoblinNftOrderServiceImpl.java
+12
-9
GoblinNftOrderUtils.java
...om/liquidnet/service/order/utils/GoblinNftOrderUtils.java
+4
-1
GoblinRedisUtils.java
...a/com/liquidnet/service/order/utils/GoblinRedisUtils.java
+3
-1
GoblinNftExSkuServiceImpl.java
...atform/service/impl/goblin/GoblinNftExSkuServiceImpl.java
+47
-30
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinNftGoodsSkuInfoVo.java
View file @
0a936419
...
...
@@ -100,6 +100,11 @@ public class GoblinNftGoodsSkuInfoVo implements Serializable, Cloneable {
private
String
arUrlAndroid
;
@ApiModelProperty
(
position
=
67
,
value
=
"标签[0-提前购买|1-分段购买]"
)
private
Integer
tagType
;
@ApiModelProperty
(
position
=
68
,
value
=
"分批购活动id"
)
private
String
listId
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
DateUtil
.
DATE_FULL_STR
)
@ApiModelProperty
(
position
=
69
,
value
=
"sku正常开售时间"
)
private
LocalDateTime
baseSaleStartTime
;
private
static
final
GoblinNftGoodsSkuInfoVo
obj
=
new
GoblinNftGoodsSkuInfoVo
();
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinUserDigitalArtworkInfoVo.java
View file @
0a936419
...
...
@@ -42,11 +42,14 @@ public class GoblinUserDigitalArtworkInfoVo implements Serializable, Cloneable {
@ApiModelProperty
(
position
=
23
,
value
=
"藏品详情"
)
private
String
details
;
@ApiModelProperty
(
position
=
2
3
,
value
=
"单品AR文件URL-iOS版"
)
@ApiModelProperty
(
position
=
2
4
,
value
=
"单品AR文件URL-iOS版"
)
private
String
arUrlIos
;
@ApiModelProperty
(
position
=
25
,
value
=
"单品AR文件URL-android版"
)
private
String
arUrlAndroid
;
@ApiModelProperty
(
position
=
26
,
value
=
"单品ID"
)
private
String
skuId
;
private
static
final
GoblinUserDigitalArtworkInfoVo
obj
=
new
GoblinUserDigitalArtworkInfoVo
();
public
static
GoblinUserDigitalArtworkInfoVo
getNew
()
{
...
...
@@ -71,6 +74,7 @@ public class GoblinUserDigitalArtworkInfoVo implements Serializable, Cloneable {
// this.setAuthor();
// this.setPublisher();
// this.setDetails();
this
.
setSkuId
(
source
.
getSkuId
());
return
this
;
}
}
liquidnet-bus-config/liquidnet-config/liquidnet-service-goblin.yml
View file @
0a936419
...
...
@@ -117,6 +117,7 @@ global-auth:
-
${liquidnet.info.context}/nftTrade/**
-
${liquidnet.info.context}/nftTradeQuery/**
-
${liquidnet.info.context}/nftUser/**
-
${liquidnet.info.context}/nftGoods/payType
oncheck-url-pattern
:
-
# -----------------------------------------------------------
...
...
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinGoodsSku.java
View file @
0a936419
...
...
@@ -249,9 +249,6 @@ public class GoblinGoodsSku implements Serializable {
private
LocalDateTime
deletedAt
;
private
Integer
upchain
;
/**
* 物流模版id
*/
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/java/com/liquidnet/service/galaxy/utils/AbstractDataUtils.java
View file @
0a936419
...
...
@@ -72,7 +72,7 @@ public abstract class AbstractDataUtils {
this
.
getQueueUtil
().
sendMySqlRedis
(
SqlMapping
.
get
(
"galaxy_user_info.update"
),
new
Object
[]{
userInfoBo
.
getUserName
(),
userInfoBo
.
getIdCardType
(),
userInfoBo
.
getIdCard
(),
userInfoBo
.
getMobile
()
,
userInfoBo
.
getBlockChainAddress
(),
new
Date
(),
userInfoBo
.
getRouterType
(),
userInfoBo
.
getUserId
()
,
userInfoBo
.
getBlockChainAddress
(),
userInfoBo
.
getUserIdentification
(),
new
Date
(),
userInfoBo
.
getRouterType
(),
userInfoBo
.
getUserId
()
}
,
MQConst
.
GalaxyQueue
.
SQL_USER_INFO
.
getKey
()
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-common/src/main/resources/sqlmap-galaxy.properties
View file @
0a936419
...
...
@@ -12,7 +12,7 @@ galaxy_nft_trade_info.insert=insert into galaxy_nft_trade_info (user_id, nft_id,
galaxy_nft_order_fail_log.insert
=
insert into galaxy_nft_order_fail_log (nft_order_pay_id, user_id, nft_id, nft_name, series_name, series_id,series_code, taskId, fail_reason_desc, fail_reason_desc_second, deal_with_status, trade_type,router_type, created_at, updated_at)values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
# ------------------------更新用户注册信息----------------------------
galaxy_user_info.update
=
update galaxy_user_info set user_name = ?,id_card_type = ?,id_card = ?,mobile = ?,block_chain_address = ?,updated_at =? where router_type = ? and user_id = ?
galaxy_user_info.update
=
update galaxy_user_info set user_name = ?,id_card_type = ?,id_card = ?,mobile = ?,block_chain_address = ?,u
ser_identification = ?,u
pdated_at =? where router_type = ? and user_id = ?
# ------------------------更新系列声明信息----------------------------
galaxy_series_info.updateSeriesIdAndStatus
=
update galaxy_series_info t set t.series_id = ?,t.chain_timestamp = ?,t.trade_hash = ?,t.series_claim_status = ? ,t.updated_at =? where t.series_code = ?
# ------------------------更新系列NFT信息----------------------------
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
View file @
0a936419
...
...
@@ -230,6 +230,19 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//mongodb缓存
// goblinMongoUtils.setHelpVo(helpVo);
//记录助力人数头像(前六个)
List
<
String
>
helpUserAvatar
=
goblinRedisUtils
.
getHelpUserAvatar
(
sid
);
if
(
helpUserAvatar
.
size
()
<=
6
)
{
//获取用户头像保存
AdamUserInfoVo
userInfo
=
goblinAnticipateUtils
.
getUserInfo
();
if
(
userInfo
!=
null
){
//新增助力头像
goblinRedisUtils
.
setHelpUserAvatar
(
sid
,
userInfo
.
getAvatar
());
}
else
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
150008
));
}
}
//加入redis缓存
Duration
between
=
Duration
.
between
(
shareVo
.
getAboutStartDate
(),
shareVo
.
getAboutEndDate
());
goblinRedisUtils
.
setHelpByUidAndSid
(
uid
,
sid
,
between
.
toDays
());
...
...
@@ -246,15 +259,6 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
});
sendRedis
(
"goblin_goods_anticipate_help"
,
sqlValue
);
//记录助力人数头像(前六个)
List
<
String
>
helpUserAvatar
=
goblinRedisUtils
.
getHelpUserAvatar
(
sid
);
if
(
helpUserAvatar
.
size
()
<=
6
)
{
//获取用户头像保存
AdamUserInfoVo
userInfo
=
goblinAnticipateUtils
.
getUserInfo
();
//新增助力头像
goblinRedisUtils
.
setHelpUserAvatar
(
sid
,
userInfo
.
getAvatar
());
}
//判断主力人数是否达标,达标则自动预约
if
(
shareVo
.
getPeopleType
().
equals
(
goblinRedisUtils
.
getHelpSidAddHelp
(
sid
))){
//主力人数达到可预约条件
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinNftGoodsAppServiceImpl.java
View file @
0a936419
...
...
@@ -147,6 +147,7 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
GoblinGoodsSkuInfoVo
skuInfoVo
=
(
GoblinGoodsSkuInfoVo
)
map
.
get
(
"vo"
);
Integer
tagType
=
(
Integer
)
map
.
get
(
"tagType"
);
String
listId
=
(
String
)
map
.
get
(
"listId"
);
LocalDateTime
baseSaleStartTime
=
(
LocalDateTime
)
map
.
get
(
"baseSaleStartTime"
);
if
(
goblinRedisUtils
.
getSkuAllStatusShow
(
skuInfoVo
))
{
//获取预约相关
AnticipateValueVo
anticipateValueVo
=
goblinGoodsAnticipateMgService
.
getAnticipateValueBySkuId
(
skuId
,
1
);
...
...
@@ -175,6 +176,8 @@ public class GoblinNftGoodsAppServiceImpl implements IGoblinNftGoodsAppService {
// 系统时间
nftGoodsSkuInfoVo
.
setSystime
(
LocalDateTime
.
now
());
nftGoodsSkuInfoVo
.
setTagType
(
tagType
);
nftGoodsSkuInfoVo
.
setListId
(
listId
);
nftGoodsSkuInfoVo
.
setBaseSaleStartTime
(
baseSaleStartTime
);
// 是否开启兑换
nftGoodsSkuInfoVo
.
setIsExchange
(
goblinRedisUtils
.
getIsExchange
(
skuId
));
return
nftGoodsSkuInfoVo
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinUserDigitalArtworkServiceImpl.java
View file @
0a936419
...
...
@@ -21,6 +21,7 @@ import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import
com.liquidnet.service.goblin.util.ObjectUtil
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -113,6 +114,10 @@ public class GoblinUserDigitalArtworkServiceImpl implements IGoblinUserDigitalAr
GoblinGoodsSkuInfoVo
goodsSkuInfoVo
=
goblinRedisUtils
.
getGoodsSkuInfoVo
(
userDigitalArtworkVo
.
getSkuId
());
GoblinGoodsInfoVo
goodsInfoVo
=
goblinRedisUtils
.
getGoodsInfoVo
(
goodsSkuInfoVo
.
getSpuId
());
GoblinNftOrderVo
nftOrder
=
goblinRedisUtils
.
getGoblinNftOrder
(
userDigitalArtworkVo
.
getOrderId
());
if
(
null
!=
nftOrder
&&
StringUtils
.
isNotBlank
(
nftOrder
.
getBoxSkuId
()))
{
artworkInfoVo
.
setSkuId
(
nftOrder
.
getSkuId
());
}
artworkInfoVo
.
setCoverPic
(
goodsSkuInfoVo
.
getSkuPic
());
artworkInfoVo
.
setName
(
goodsSkuInfoVo
.
getName
());
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinListServiceImpl.java
View file @
0a936419
...
...
@@ -188,9 +188,9 @@ public class GoblinListServiceImpl implements IGoblinListService {
vo
.
setCreatedAt
(
DateUtil
.
format
(
now
,
DateUtil
.
Formatter
.
yyyyMMddHHmmss
));
//判断 白名单类型
if
(
param
.
getWhiteType
().
equals
(
1
))
{
//需要xls文件
if
(
param
.
getWhiteUrl
()
==
null
||
param
.
getWhiteUrl
().
equals
(
""
))
{
return
ResponseDto
.
failure
(
"未上传指定用户文件"
);
}
//
if (param.getWhiteUrl() == null || param.getWhiteUrl().equals("")) {
//
return ResponseDto.failure("未上传指定用户文件");
//
}
vo
.
setWhiteUrl
(
param
.
getWhiteUrl
());
vo
.
setWhiteName
(
param
.
getWhiteName
());
}
else
{
//不需要xls文件
...
...
@@ -252,6 +252,9 @@ public class GoblinListServiceImpl implements IGoblinListService {
collectVo
.
setPriceV
(
itemVo
.
getPriceV
());
collectVo
.
setProductId
(
itemVo
.
getProductId
());
collectVo
.
setWhiteType
(
vo
.
getWhiteType
());
if
(
vo
.
getWhiteType
().
equals
(
1
)
&&
vo
.
getWhiteUrl
().
equals
(
""
)){
collectVo
.
setWhiteType
(-
1
);
}
collectVo
.
setTimeStart
(
st
);
collectVo
.
setTimeEnd
(
et
);
collectVo
.
setTagType
(
vo
.
getTagType
());
...
...
@@ -290,9 +293,9 @@ public class GoblinListServiceImpl implements IGoblinListService {
//判断 白名单类型
vo
.
setWhiteType
(
param
.
getWhiteType
());
if
(
param
.
getWhiteType
().
equals
(
1
))
{
//需要xls文件
if
(
param
.
getWhiteUrl
()
==
null
||
param
.
getWhiteUrl
().
equals
(
""
))
{
return
ResponseDto
.
failure
(
"未上传指定用户文件"
);
}
//
if (param.getWhiteUrl() == null || param.getWhiteUrl().equals("")) {
//
return ResponseDto.failure("未上传指定用户文件");
//
}
vo
.
setWhiteUrl
(
param
.
getWhiteUrl
());
vo
.
setWhiteName
(
param
.
getWhiteName
());
}
else
{
//不需要xls文件
...
...
@@ -311,6 +314,9 @@ public class GoblinListServiceImpl implements IGoblinListService {
for
(
GoblinListCollectVo
itemVo
:
collectVos
)
{
if
(
itemVo
.
getListId
().
equals
(
param
.
getListId
()))
{
itemVo
.
setWhiteType
(
vo
.
getWhiteType
());
if
(
vo
.
getWhiteType
().
equals
(
1
)
&&
vo
.
getWhiteUrl
().
equals
(
""
)){
itemVo
.
setWhiteType
(-
1
);
}
break
;
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
0a936419
...
...
@@ -815,11 +815,13 @@ public class GoblinRedisUtils {
map
.
put
(
"tagType"
,
null
);
map
.
put
(
"listId"
,
null
);
map
.
put
(
"whiteType"
,
null
);
map
.
put
(
"baseSaleStartTime"
,
vo
.
getSaleStartTime
());
}
else
{
//未开售
GoblinListCollectVo
collectVo
=
getCollectByNow
(
now
,
skuId
);
Integer
tagType
=
null
;
Integer
whiteType
=
null
;
String
listId
=
null
;
LocalDateTime
baseSaleStartTime
=
vo
.
getSaleStartTime
();
if
(
collectVo
!=
null
)
{
vo
.
setPrice
(
collectVo
.
getPrice
());
vo
.
setPriceV
(
collectVo
.
getPriceV
());
...
...
@@ -840,6 +842,7 @@ public class GoblinRedisUtils {
map
.
put
(
"tagType"
,
tagType
);
map
.
put
(
"listId"
,
listId
);
map
.
put
(
"whiteType"
,
whiteType
);
map
.
put
(
"baseSaleStartTime"
,
baseSaleStartTime
);
}
return
map
;
}
...
...
@@ -1043,7 +1046,9 @@ public class GoblinRedisUtils {
if
(
bResult
)
{
return
false
;
}
if
(
whiteType
==
0
)
{
//会员
if
(
whiteType
==
-
1
)
{
return
true
;
}
else
if
(
whiteType
==
0
)
{
//会员
return
memberStage
!=
null
;
}
else
{
//白名单
return
wResult
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/resources/errors.properties
View file @
0a936419
...
...
@@ -83,4 +83,5 @@
150004
=
\u
5DF2
\u
52A9
\u
529B
\u
8BE5
\u5206\u
4EAB
150005
=
SKU
\u
4E0D
\u
5B58
\u5728
150006
=
\u9884\u
7EA6
\u
672A
\u
5F00
\u
59CB
\u6216\u
5DF2
\u
7ED3
\u
675F
150007
=
\u
8BE5
\u5546\u
54C1
\u9884\u
7EA6
\u
5C1A
\u
672A
\u
5F00
\u
59CB
\u6216\u
5DF2
\u
7ECF
\u
7ED3
\u
675F
\u
FF0C
\u
4E0D
\u
53EF
\u9884\u
7EA6
\ No newline at end of file
150007
=
\u
8BE5
\u5546\u
54C1
\u9884\u
7EA6
\u
5C1A
\u
672A
\u
5F00
\u
59CB
\u6216\u
5DF2
\u
7ECF
\u
7ED3
\u
675F
\u
FF0C
\u
4E0D
\u
53EF
\u9884\u
7EA6
150008
=
\u
52A9
\u7406\u5931\u
8D25
\u
FF0C
\u
8BF7
\u
91CD
\u
8BD5
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/service/impl/GoblinNftOrderServiceImpl.java
View file @
0a936419
...
...
@@ -74,11 +74,6 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
return
ResponseDto
.
failure
(
"您还未开通数字账户~"
);
}
// 若开启了预约 判断用户是否预约
boolean
userAboutAut
=
nftOrderUtils
.
getUserAboutAut
(
payParam
.
getSkuId
(),
uid
);
if
(!
userAboutAut
)
{
return
ResponseDto
.
failure
(
"此数字藏品仅限预约用户购买~"
);
}
// 基础参数
String
mobile
=
StringUtils
.
defaultString
(((
String
)
CurrentUtil
.
getTokenClaims
().
get
(
CurrentUtil
.
TOKEN_MOBILE
)),
""
);
...
...
@@ -91,8 +86,16 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
String
listId
=
(
String
)
map
.
get
(
"listId"
);
Integer
whiteType
=
(
Integer
)
map
.
get
(
"whiteType"
);
// 若没有分批购 若开启了预约 判断用户是否预约
if
(
null
==
listId
)
{
boolean
userAboutAut
=
nftOrderUtils
.
getUserAboutAut
(
payParam
.
getSkuId
(),
uid
);
if
(!
userAboutAut
)
{
return
ResponseDto
.
failure
(
"此数字藏品仅限预约用户购买~"
);
}
}
// 分批、提前购黑、白名单
if
(
null
!=
tagType
)
{
if
(
null
!=
listId
)
{
Boolean
listCanBuy
=
goblinRedisUtils
.
getListCanBuy
(
listId
,
skuId
,
mobile
,
uid
,
whiteType
);
if
(!
listCanBuy
)
{
return
ResponseDto
.
failure
(
"该藏品仅对部分用户开放~"
);
...
...
@@ -157,11 +160,11 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
return
ResponseDto
.
failure
(
"该商品SPU不存在~"
);
}
else
{
HashMap
<
String
,
Object
>
lotteryDrawMap
=
lotteryDraw
(
skuIdList
,
number
,
nowTime
);
GoblinGoodsSkuInfoVo
skuInfoVo
=
(
GoblinGoodsSkuInfoVo
)
lotteryDrawMap
.
get
(
"goodsSkuInfoVo"
);
if
(
null
==
skuInfoVo
)
{
if
(
null
==
lotteryDrawMap
)
{
goblinRedisUtils
.
decrSkuCountByUid
(
uid
,
skuId
,
number
);
return
ResponseDto
.
failure
(
"盲盒库存不足啦~"
);
}
GoblinGoodsSkuInfoVo
skuInfoVo
=
(
GoblinGoodsSkuInfoVo
)
lotteryDrawMap
.
get
(
"goodsSkuInfoVo"
);
boxSkuId
=
skuInfoVo
.
getSkuId
();
stockSkuId
=
boxSkuId
;
listId
=
(
String
)
lotteryDrawMap
.
get
(
"listId"
);
...
...
@@ -344,7 +347,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
GoblinNftOrderPayParam
payParam
,
String
storeId
,
String
uid
,
String
spuId
,
int
number
,
String
orderId
,
String
orderCode
,
BigDecimal
totalPrice
,
BigDecimal
voucherPrice
,
BigDecimal
storeVoucherPrice
,
String
boxSkuId
,
String
skuTitle
,
int
orderType
,
int
orderType
)
{
try
{
LocalDateTime
now
=
LocalDateTime
.
now
();
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinNftOrderUtils.java
View file @
0a936419
...
...
@@ -9,6 +9,7 @@ import com.liquidnet.service.base.constant.MQConst;
import
com.liquidnet.service.candy.vo.CandyUseResultVo
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.manage.vo.GoblinGoodsAnticipateValueVo
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -179,11 +180,13 @@ public class GoblinNftOrderUtils {
// skuId 是否开启预约
public
boolean
getValueBySkuId
(
String
skuId
)
{
String
redisKey
=
GoblinRedisConst
.
ANTICIPATE_VALUE_SKUID
.
concat
(
skuId
);
Object
obj
=
redisUtil
.
get
(
redisKey
);
if
(
obj
==
null
)
{
return
false
;
}
else
{
return
true
;
GoblinGoodsAnticipateValueVo
anticipateValueVo
=
(
GoblinGoodsAnticipateValueVo
)
obj
;
return
anticipateValueVo
.
getType
()
!=
1
;
}
}
// 是否预约过 没开启true
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/GoblinRedisUtils.java
View file @
0a936419
...
...
@@ -316,7 +316,9 @@ public class GoblinRedisUtils {
if
(
bResult
)
{
return
false
;
}
if
(
whiteType
==
0
)
{
//会员
if
(
whiteType
==
-
1
)
{
return
true
;
}
else
if
(
whiteType
==
0
)
{
//会员
return
memberStage
!=
null
;
}
else
{
//白名单
return
wResult
;
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/goblin/GoblinNftExSkuServiceImpl.java
View file @
0a936419
package
com
.
liquidnet
.
service
.
platform
.
service
.
impl
.
goblin
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinNftExCodeVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinNftExSkuVo
;
import
com.liquidnet.service.goblin.entity.*
;
import
com.liquidnet.service.goblin.mapper.*
;
import
com.liquidnet.service.goblin.entity.GoblinGoodsSku
;
import
com.liquidnet.service.goblin.entity.GoblinNftExCodeTask
;
import
com.liquidnet.service.goblin.entity.GoblinNftExCodeTaskRelation
;
import
com.liquidnet.service.goblin.mapper.GoblinGoodsSkuMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinNftExCodeTaskMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinNftExCodeTaskRelationMapper
;
import
com.liquidnet.service.goblin.param.GoblinNftExSkuParam
;
import
com.liquidnet.service.goblin.service.IGoblinNftExSkuService
;
import
com.liquidnet.service.platform.utils.GoblinRedisUtils
;
import
com.liquidnet.service.platform.utils.ObjectUtil
;
import
com.microsoft.schemas.office.visio.x2012.main.ShapeSheetType
;
import
io.swagger.models.auth.In
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.time.Duration
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Author: wll
...
...
@@ -124,7 +121,7 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
}
//是否购买
if
(!
goblinGoodsSku
.
getSkuCanbuy
().
equals
(
"1"
)){
if
(!
goblinGoodsSku
.
getSkuCanbuy
().
equals
(
"1"
))
{
continue
;
}
// 不能购买的 没库存的 概率是0的 过滤
...
...
@@ -135,7 +132,7 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
}
}
if
(
checkNumberSku
<=
0
){
if
(
checkNumberSku
<=
0
)
{
return
ResponseDto
.
failure
(
"盲盒下没有可生成兑换码的sku!"
);
}
...
...
@@ -149,7 +146,6 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
List
<
GoblinNftExCodeTask
>
goblinNftExCodeTasks
=
ObjectUtil
.
getGoblinNftExCodeTaskArrayList
();
// 构建对象
for
(
GoblinNftExSkuParam
goblinNftExSkuParam
:
goblinNftExSkuParams
)
{
...
...
@@ -182,6 +178,10 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
Integer
sNumber
=
0
;
for
(
String
key
:
skuMap
.
keySet
())
{
Integer
stockNum
=
skuMap
.
get
(
key
);
log
.
debug
(
"skuId:"
+
key
+
"库存:"
+
stockNum
);
if
(
stockNum
<=
0
)
{
continue
;
}
// 根据sku减库存
int
stock
=
goblinRedisUtils
.
decrSkuStock
(
null
,
key
,
stockNum
);
if
(
stock
<
0
)
{
...
...
@@ -284,28 +284,44 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
Map
<
String
,
Map
<
String
,
Object
>>
mapMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>();
objectMap
.
put
(
"hitRatio"
,
2
0
);
objectMap
.
put
(
"stock"
,
10
00
);
objectMap
.
put
(
"hitRatio"
,
3
0
);
objectMap
.
put
(
"stock"
,
9
00
);
mapMap
.
put
(
"1"
,
objectMap
);
Map
<
String
,
Object
>
objectMap1
=
new
HashMap
<>();
objectMap1
.
put
(
"hitRatio"
,
30
);
objectMap1
.
put
(
"stock"
,
4
);
//
mapMap.put("2", objectMap1);
objectMap1
.
put
(
"hitRatio"
,
0.3
);
objectMap1
.
put
(
"stock"
,
9
);
mapMap
.
put
(
"2"
,
objectMap1
);
Map
<
String
,
Object
>
objectMap2
=
new
HashMap
<>();
objectMap2
.
put
(
"hitRatio"
,
30
);
objectMap2
.
put
(
"stock"
,
1000
);
//
mapMap.put("3", objectMap2);
objectMap2
.
put
(
"hitRatio"
,
23.3
);
objectMap2
.
put
(
"stock"
,
697
);
mapMap
.
put
(
"3"
,
objectMap2
);
Map
<
String
,
Object
>
objectMap3
=
new
HashMap
<>();
objectMap3
.
put
(
"hitRatio"
,
10
);
objectMap3
.
put
(
"stock"
,
1000
);
// mapMap.put("4", objectMap3);
objectMap3
.
put
(
"hitRatio"
,
2.2
);
objectMap3
.
put
(
"stock"
,
66
);
mapMap
.
put
(
"4"
,
objectMap3
);
Map
<
String
,
Object
>
objectMap4
=
new
HashMap
<>();
objectMap4
.
put
(
"hitRatio"
,
26.7
);
objectMap4
.
put
(
"stock"
,
797
);
mapMap
.
put
(
"5"
,
objectMap4
);
Map
<
String
,
Object
>
objectMap5
=
new
HashMap
<>();
objectMap5
.
put
(
"hitRatio"
,
2.2
);
objectMap5
.
put
(
"stock"
,
66
);
mapMap
.
put
(
"6"
,
objectMap5
);
Map
<
String
,
Object
>
objectMap6
=
new
HashMap
<>();
objectMap6
.
put
(
"hitRatio"
,
15.3
);
objectMap6
.
put
(
"stock"
,
458
);
mapMap
.
put
(
"7"
,
objectMap6
);
Map
<
String
,
Integer
>
stockMap
=
new
HashMap
<>();
ArrayList
<
String
>
eliminateSkuIdList
=
CollectionUtil
.
arrayListString
();
getStock
(
7
,
new
BigDecimal
(
20
),
mapMap
,
stockMap
,
1032
,
eliminateSkuIdList
);
getStock
(
594
,
new
BigDecimal
(
100
),
mapMap
,
stockMap
,
2993
,
eliminateSkuIdList
);
for
(
String
key
:
stockMap
.
keySet
())
{
System
.
out
.
println
(
"skuId"
+
key
+
"***********数量"
+
stockMap
.
get
(
key
));
}
...
...
@@ -369,8 +385,9 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
for
(
int
k
=
0
;
k
<
usNumber
;
k
++)
{
String
subKey
=
""
;
double
maxValue
=
Double
.
MAX_VALUE
;
for
(
String
key
:
bigDecimalHashMap
.
keySet
())
{
if
(
skuIdList
.
contains
(
key
))
{
if
(
skuIdList
.
contains
(
key
)
||
stockMap
.
get
(
key
)
==
0
)
{
continue
;
}
Double
compare
=
Double
.
valueOf
(
bigDecimalHashMap
.
get
(
key
).
toString
());
...
...
@@ -411,7 +428,7 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
&&
info
.
getShelvesStatus
().
equals
(
"3"
)
// && (info.getSkuAppear() == null || info.getSkuAppear().equals("0"))
&&
info
.
getDelFlg
().
equals
(
"0"
)
)
{
)
{
return
true
;
}
else
{
return
false
;
...
...
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