记得上下班打卡 | 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
2ae90555
Commit
2ae90555
authored
Apr 11, 2022
by
jiangxiulong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_nft_411' into dev_nft_411
parents
b3e40357
74c9d0d2
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
74 additions
and
34 deletions
+74
-34
GoblinGoodsAnticipateParam.java
...service/goblin/dto/manage/GoblinGoodsAnticipateParam.java
+5
-0
GoblinStoreMgtDigitalGoodsAddSkuParam.java
...lin/dto/manage/GoblinStoreMgtDigitalGoodsAddSkuParam.java
+6
-2
IGoblinGoodsAnticipateService.java
...service/goblin/service/IGoblinGoodsAnticipateService.java
+2
-0
ConsumerGoblinBizArtworkGenRdsReceiver.java
...ylin/receiver/ConsumerGoblinBizArtworkGenRdsReceiver.java
+22
-19
GoblinGoodsAnticipateController.java
...in/controller/manage/GoblinGoodsAnticipateController.java
+6
-0
GoblinStoreMgtGoodsController.java
...blin/controller/manage/GoblinStoreMgtGoodsController.java
+7
-1
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+1
-0
GoblinGoodsAnticipateServiceImpl.java
...goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
+11
-5
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+8
-1
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+6
-6
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinGoodsAnticipateParam.java
View file @
2ae90555
...
@@ -32,6 +32,11 @@ public class GoblinGoodsAnticipateParam{
...
@@ -32,6 +32,11 @@ public class GoblinGoodsAnticipateParam{
/**
/**
* 预约名称
* 预约名称
*/
*/
@ApiModelProperty
(
"预约名称"
)
private
String
name
;
private
String
name
;
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/manage/GoblinStoreMgtDigitalGoodsAddSkuParam.java
View file @
2ae90555
...
@@ -77,9 +77,11 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
...
@@ -77,9 +77,11 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
// private BigDecimal priceMember;
// private BigDecimal priceMember;
@ApiModelProperty
(
position
=
25
,
required
=
false
,
value
=
"限购[0-无限制|X:限购数量],`unbox=0`时必传"
,
example
=
"1"
)
@ApiModelProperty
(
position
=
25
,
required
=
false
,
value
=
"限购[0-无限制|X:限购数量],`unbox=0`时必传"
,
example
=
"1"
)
// @NotNull(message = "限购数量不能为空")// TODO: 2022/4/11 ==zhanggb.open
@Min
(
value
=
1
,
message
=
"限购数量必须大于0"
)
@Min
(
value
=
1
,
message
=
"限购数量必须大于0"
)
private
Integer
buyLimit
;
private
Integer
buyLimit
;
@ApiModelProperty
(
position
=
26
,
required
=
false
,
value
=
"购买限制[0-全部用户|1-仅会员],`unbox=0`时必传"
,
example
=
"0"
)
@ApiModelProperty
(
position
=
26
,
required
=
false
,
value
=
"购买限制[0-全部用户|1-仅会员],`unbox=0`时必传"
,
example
=
"0"
)
// @NotBlank(message = "购买条件不能为空")// TODO: 2022/4/11 ==zhanggb.open
@Pattern
(
regexp
=
"\\b(0|1)\\b"
,
message
=
"购买条件参数无效"
)
@Pattern
(
regexp
=
"\\b(0|1)\\b"
,
message
=
"购买条件参数无效"
)
private
String
buyFactor
;
private
String
buyFactor
;
@ApiModelProperty
(
position
=
27
,
required
=
false
,
value
=
"是否隐藏[0-默认展示|1-隐藏],`unbox=0`时必传"
,
example
=
"0"
)
@ApiModelProperty
(
position
=
27
,
required
=
false
,
value
=
"是否隐藏[0-默认展示|1-隐藏],`unbox=0`时必传"
,
example
=
"0"
)
...
@@ -181,7 +183,8 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
...
@@ -181,7 +183,8 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
}
else
{
}
else
{
initVo
.
setStock
(
0
);
initVo
.
setStock
(
0
);
initVo
.
setSkuStock
(
0
);
initVo
.
setSkuStock
(
0
);
initVo
.
setBuyFactor
(
"0"
);
initVo
.
setBuyLimit
(
this
.
getBuyLimit
());
//
initVo
.
setBuyFactor
(
this
.
getBuyFactor
());
//
initVo
.
setSkuAppear
(
"0"
);
initVo
.
setSkuAppear
(
"0"
);
initVo
.
setSkuCanbuy
(
"1"
);
initVo
.
setSkuCanbuy
(
"1"
);
initVo
.
setOpeningTime
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
this
.
getOpeningTime
()));
//1
initVo
.
setOpeningTime
(
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
this
.
getOpeningTime
()));
//1
...
@@ -209,7 +212,8 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
...
@@ -209,7 +212,8 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
updateVo
.
setSkuCanbuy
(
this
.
getSkuCanbuy
());
//0
updateVo
.
setSkuCanbuy
(
this
.
getSkuCanbuy
());
//0
break
;
break
;
case
"1"
:
case
"1"
:
updateVo
.
setBuyFactor
(
"0"
);
//
updateVo
.
setBuyLimit
(
this
.
getBuyLimit
());
//
updateVo
.
setBuyFactor
(
this
.
getBuyFactor
());
//
updateVo
.
setSkuAppear
(
"0"
);
//
updateVo
.
setSkuAppear
(
"0"
);
//
updateVo
.
setSkuCanbuy
(
"1"
);
//
updateVo
.
setSkuCanbuy
(
"1"
);
//
updateVo
.
setName
(
this
.
getName
());
//1
updateVo
.
setName
(
this
.
getName
());
//1
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinGoodsAnticipateService.java
View file @
2ae90555
...
@@ -40,4 +40,6 @@ public interface IGoblinGoodsAnticipateService{
...
@@ -40,4 +40,6 @@ public interface IGoblinGoodsAnticipateService{
ResponseDto
<
Object
>
addAnticipateValues
(
List
<
GoblinGoodsAnticipateValueParam
>
list
);
ResponseDto
<
Object
>
addAnticipateValues
(
List
<
GoblinGoodsAnticipateValueParam
>
list
);
ResponseDto
<
Object
>
updateAnticipateValues
(
List
<
GoblinGoodsAnticipateValueParam
>
list
);
ResponseDto
<
Object
>
updateAnticipateValues
(
List
<
GoblinGoodsAnticipateValueParam
>
list
);
ResponseDto
<
Object
>
getAnticipateValues
(
String
antId
);
}
}
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-kylin/src/main/java/com/liquidnet/service/consumer/kylin/receiver/ConsumerGoblinBizArtworkGenRdsReceiver.java
View file @
2ae90555
...
@@ -130,23 +130,16 @@ public class ConsumerGoblinBizArtworkGenRdsReceiver extends AbstractBizRedisRece
...
@@ -130,23 +130,16 @@ public class ConsumerGoblinBizArtworkGenRdsReceiver extends AbstractBizRedisRece
.
getUpdateObject
()
.
getUpdateObject
()
);
);
}
}
}
else
{
redisUtil
.
incr
(
GoblinRedisConst
.
USER_DIGITAL_ARTWORK_CT
.
concat
(
uid
),
1
);
}
}
// Redis记录VO
// Redis记录VO
redisUtil
.
set
(
GoblinRedisConst
.
USER_DIGITAL_ARTWORK
.
concat
(
digitalArtworkVo
.
getArtworkId
()),
digitalArtworkVo
);
redisUtil
.
set
(
GoblinRedisConst
.
USER_DIGITAL_ARTWORK
.
concat
(
digitalArtworkVo
.
getArtworkId
()),
digitalArtworkVo
);
// Redis更新藏品ID列表
// Redis更新藏品ID列表
List
<
String
>
userDigitalArtworkIds
=
this
.
getUserDigitalArtworkIdsFromRdb
(
uid
);
this
.
addGoblinUserDigitalArtworkIds
(
uid
,
artworkId
);
if
(
CollectionUtils
.
isEmpty
(
userDigitalArtworkIds
))
{
// Redis生成标记(缓存三天),用于上面的生成检查
userDigitalArtworkIds
=
CollectionUtil
.
arrayListString
();
redisUtil
.
set
(
genMarkerKey
,
1
,
259200
);
userDigitalArtworkIds
.
add
(
artworkId
);
}
else
{
userDigitalArtworkIds
.
add
(
0
,
artworkId
);
if
(
fromBoxArtworkFlg
)
{
userDigitalArtworkIds
.
remove
(
fromArtworkId
);
}
int
size
=
userDigitalArtworkIds
.
size
();
if
(
size
>
30
)
userDigitalArtworkIds
.
remove
(
size
-
1
);
}
redisUtil
.
set
(
GoblinRedisConst
.
USER_DIGITAL_ARTWORK_IDS
.
concat
(
uid
),
userDigitalArtworkIds
);
StreamOperations
<
String
,
Object
,
Object
>
streamOperations
=
stringRedisTemplate
.
opsForStream
();
StreamOperations
<
String
,
Object
,
Object
>
streamOperations
=
stringRedisTemplate
.
opsForStream
();
// Mysql持久化
// Mysql持久化
HashMap
<
String
,
String
>
sqlArtworkMap
=
CollectionUtil
.
mapStringString
();
HashMap
<
String
,
String
>
sqlArtworkMap
=
CollectionUtil
.
mapStringString
();
...
@@ -163,12 +156,6 @@ public class ConsumerGoblinBizArtworkGenRdsReceiver extends AbstractBizRedisRece
...
@@ -163,12 +156,6 @@ public class ConsumerGoblinBizArtworkGenRdsReceiver extends AbstractBizRedisRece
.
put
(
"skuId"
,
skuId
).
put
(
"userId"
,
uid
).
put
(
"buyTimestamp"
,
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
now
));
.
put
(
"skuId"
,
skuId
).
put
(
"userId"
,
uid
).
put
(
"buyTimestamp"
,
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
now
));
bizNftBuyMap
.
put
(
"message"
,
bizNftBuyNode
.
toString
());
bizNftBuyMap
.
put
(
"message"
,
bizNftBuyNode
.
toString
());
streamOperations
.
add
(
StreamRecords
.
mapBacked
(
bizNftBuyMap
).
withStreamKey
(
MQConst
.
GalaxyQueue
.
JSON_NFT_PUBLISH_AND_BUY
.
getKey
()));
streamOperations
.
add
(
StreamRecords
.
mapBacked
(
bizNftBuyMap
).
withStreamKey
(
MQConst
.
GalaxyQueue
.
JSON_NFT_PUBLISH_AND_BUY
.
getKey
()));
if
(!
fromBoxArtworkFlg
)
{
redisUtil
.
incr
(
GoblinRedisConst
.
USER_DIGITAL_ARTWORK_CT
.
concat
(
uid
),
1
);
}
// Redis生成标记(缓存三天),用于上面的生成检查
redisUtil
.
set
(
genMarkerKey
,
1
,
259200
);
return
true
;
return
true
;
}
}
...
@@ -198,6 +185,22 @@ public class ConsumerGoblinBizArtworkGenRdsReceiver extends AbstractBizRedisRece
...
@@ -198,6 +185,22 @@ public class ConsumerGoblinBizArtworkGenRdsReceiver extends AbstractBizRedisRece
return
(
List
<
String
>)
redisUtil
.
get
(
GoblinRedisConst
.
USER_DIGITAL_ARTWORK_IDS
.
concat
(
uid
));
return
(
List
<
String
>)
redisUtil
.
get
(
GoblinRedisConst
.
USER_DIGITAL_ARTWORK_IDS
.
concat
(
uid
));
}
}
/**
* 缓存并更新用户藏品ID集合
*/
public
boolean
addGoblinUserDigitalArtworkIds
(
String
uid
,
String
artworkId
)
{
List
<
String
>
ids
=
this
.
getUserDigitalArtworkIdsFromRdb
(
uid
);
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
ids
=
CollectionUtil
.
arrayListString
();
ids
.
add
(
artworkId
);
}
else
{
ids
.
add
(
0
,
artworkId
);
int
size
=
ids
.
size
();
if
(
size
>
30
)
ids
.
remove
(
size
-
1
);
}
return
redisUtil
.
set
(
GoblinRedisConst
.
USER_DIGITAL_ARTWORK_IDS
.
concat
(
uid
),
ids
);
}
public
GoblinGoodsSkuInfoVo
getGoodsSkuInfoVoFromRdb
(
String
skuId
)
{
public
GoblinGoodsSkuInfoVo
getGoodsSkuInfoVoFromRdb
(
String
skuId
)
{
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
skuId
);
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
skuId
);
GoblinGoodsSkuInfoVo
vo
=
(
GoblinGoodsSkuInfoVo
)
redisUtil
.
get
(
rk
);
GoblinGoodsSkuInfoVo
vo
=
(
GoblinGoodsSkuInfoVo
)
redisUtil
.
get
(
rk
);
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinGoodsAnticipateController.java
View file @
2ae90555
...
@@ -88,4 +88,10 @@ public class GoblinGoodsAnticipateController {
...
@@ -88,4 +88,10 @@ public class GoblinGoodsAnticipateController {
return
goblinGoodsAnticipateService
.
userAbout
(
antId
,
skuId
,
uid
,
phone
,
state
);
return
goblinGoodsAnticipateService
.
userAbout
(
antId
,
skuId
,
uid
,
phone
,
state
);
}
}
@ApiOperation
(
"根据预约id查询sku关联"
)
@PostMapping
(
"getAnticipateValues"
)
public
ResponseDto
<
Object
>
getAnticipateValues
(
@RequestParam
(
name
=
"antId"
,
required
=
true
)
String
antId
){
return
goblinGoodsAnticipateService
.
getAnticipateValues
(
antId
);
}
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreMgtGoodsController.java
View file @
2ae90555
...
@@ -1037,7 +1037,7 @@ public class GoblinStoreMgtGoodsController {
...
@@ -1037,7 +1037,7 @@ public class GoblinStoreMgtGoodsController {
if
(
goodsInfoVo
.
getSpuType
()
==
0
)
{
if
(
goodsInfoVo
.
getSpuType
()
==
0
)
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"无效操作,该商品非数字藏品"
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"无效操作,该商品非数字藏品"
);
}
}
if
(
StringUtils
.
isBlank
(
mgtDigitalGoodsAddSkuParam
.
getProductId
()))
{
// TODO: 2022/4/8 ==zhanggb
if
(
StringUtils
.
isBlank
(
mgtDigitalGoodsAddSkuParam
.
getProductId
()))
{
// TODO: 2022/4/8 ==zhanggb
.del
mgtDigitalGoodsAddSkuParam
.
setProductId
(
"NGoods1"
);
mgtDigitalGoodsAddSkuParam
.
setProductId
(
"NGoods1"
);
}
}
JsonNode
priceVNode
=
goblinRedisUtils
.
getIosProducts
().
get
(
mgtDigitalGoodsAddSkuParam
.
getProductId
());
JsonNode
priceVNode
=
goblinRedisUtils
.
getIosProducts
().
get
(
mgtDigitalGoodsAddSkuParam
.
getProductId
());
...
@@ -1069,6 +1069,12 @@ public class GoblinStoreMgtGoodsController {
...
@@ -1069,6 +1069,12 @@ public class GoblinStoreMgtGoodsController {
// }
// }
// }
// }
}
else
{
// 盲盒校验
}
else
{
// 盲盒校验
if
(
null
==
mgtDigitalGoodsAddSkuParam
.
getBuyLimit
())
{
// TODO: 2022/4/11 ==zhanggb.del
mgtDigitalGoodsAddSkuParam
.
setBuyLimit
(
1
);
}
if
(
StringUtils
.
isEmpty
(
mgtDigitalGoodsAddSkuParam
.
getBuyFactor
()))
{
// TODO: 2022/4/11 ==zhanggb.del
mgtDigitalGoodsAddSkuParam
.
setBuyFactor
(
"0"
);
}
if
(
StringUtils
.
isEmpty
(
mgtDigitalGoodsAddSkuParam
.
getOpeningTime
()))
{
if
(
StringUtils
.
isEmpty
(
mgtDigitalGoodsAddSkuParam
.
getOpeningTime
()))
{
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"盲盒开启时间不能为空"
);
return
ResponseDto
.
failure
(
ErrorCode
.
HTTP_PARAM_ERROR
.
getCode
(),
"盲盒开启时间不能为空"
);
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
2ae90555
...
@@ -456,6 +456,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
...
@@ -456,6 +456,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
name
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
name
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
Query
query
=
new
Query
();
Query
query
=
new
Query
();
query
.
addCriteria
(
new
Criteria
().
orOperator
(
query
.
addCriteria
(
new
Criteria
().
orOperator
(
Criteria
.
where
(
"spuType"
).
is
(
0
),
Criteria
.
where
(
"name"
).
regex
(
pattern
),
Criteria
.
where
(
"name"
).
regex
(
pattern
),
Criteria
.
where
(
"storeId"
).
in
(
listStore
),
Criteria
.
where
(
"storeId"
).
in
(
listStore
),
Criteria
.
where
(
"extagVoList.tagName"
).
is
(
name
)
Criteria
.
where
(
"extagVoList.tagName"
).
is
(
name
)
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinGoodsAnticipateServiceImpl.java
View file @
2ae90555
...
@@ -113,7 +113,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -113,7 +113,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//mongodb新增
//mongodb新增
goblinMongoUtils
.
setGoblinGoodsAnticipateVo
(
goodsAnticipateVo
);
goblinMongoUtils
.
setGoblinGoodsAnticipateVo
(
goodsAnticipateVo
);
return
ResponseDto
.
success
();
//返回预约id
return
ResponseDto
.
success
(
antId
);
}
}
return
ResponseDto
.
failure
(
"参数有误"
);
return
ResponseDto
.
failure
(
"参数有误"
);
}
}
...
@@ -210,7 +211,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -210,7 +211,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
public
ResponseDto
<
Object
>
addAnticipateValues
(
List
<
GoblinGoodsAnticipateValueParam
>
list
)
{
public
ResponseDto
<
Object
>
addAnticipateValues
(
List
<
GoblinGoodsAnticipateValueParam
>
list
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
GoblinGoodsAnticipateValueParam
vo
:
list
)
{
for
(
GoblinGoodsAnticipateValueParam
vo
:
list
)
{
if
(
goblinRedisUtils
.
getAnticipate
(
vo
.
get
AntId
(),
vo
.
get
SkuId
()))
if
(
goblinRedisUtils
.
getAnticipate
(
vo
.
getSkuId
()))
return
ResponseDto
.
failure
(
"该预约已选择该sku"
);
return
ResponseDto
.
failure
(
"该预约已选择该sku"
);
}
}
list
.
forEach
(
item
->
{
list
.
forEach
(
item
->
{
...
@@ -221,7 +222,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -221,7 +222,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
goodsAnticipateValueVo
.
setDelTag
(
0
);
goodsAnticipateValueVo
.
setDelTag
(
0
);
//redis消息
//redis消息
//redis标识存入该sku处于预约列表
//redis标识存入该sku处于预约列表
goblinRedisUtils
.
setAnticipateValue
(
goodsAnticipateValueVo
.
get
AntId
(),
goodsAnticipateValueVo
.
get
SkuId
());
goblinRedisUtils
.
setAnticipateValue
(
goodsAnticipateValueVo
.
getSkuId
());
//保存mysql中间表
//保存mysql中间表
LinkedList
<
Object
[]>
sqlValue
=
CollectionUtil
.
linkedListObjectArr
();
LinkedList
<
Object
[]>
sqlValue
=
CollectionUtil
.
linkedListObjectArr
();
...
@@ -257,13 +258,13 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -257,13 +258,13 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//删除该sku关联
//删除该sku关联
goblinMongoUtils
.
delAnticipateValueVo
(
goodsAnticipateValueVo
);
goblinMongoUtils
.
delAnticipateValueVo
(
goodsAnticipateValueVo
);
//删除redis
//删除redis
goblinRedisUtils
.
delAnticipateValue
(
goodsAnticipateValueVo
.
get
AntId
(),
goodsAnticipateValueVo
.
get
SkuId
());
goblinRedisUtils
.
delAnticipateValue
(
goodsAnticipateValueVo
.
getSkuId
());
//删除mysql中的关联数据
//删除mysql中的关联数据
sqlValue
.
add
(
new
Object
[]{
sqlValue
.
add
(
new
Object
[]{
goodsAnticipateValueVo
.
getAntId
(),
goodsAnticipateValueVo
.
getAntId
(),
goodsAnticipateValueVo
.
getSkuId
()
goodsAnticipateValueVo
.
getSkuId
()
});
});
sendRedis
(
"goblin_goods_anticipate_value_delete_by_antId_and_skuId"
,
sqlValue
);
sendRedis
(
"goblin_goods_anticipate_value_delete_by_antId_and_skuId"
,
sqlValue
);
}
else
{
}
else
{
//保存mysql中间表
//保存mysql中间表
sqlValue
.
add
(
new
Object
[]{
sqlValue
.
add
(
new
Object
[]{
...
@@ -283,6 +284,11 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
...
@@ -283,6 +284,11 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
@Override
public
ResponseDto
<
Object
>
getAnticipateValues
(
String
antId
)
{
return
ResponseDto
.
success
(
goblinMongoUtils
.
getGoodsAnticipateValues
(
antId
));
}
public
void
sendRedis
(
String
sqlKey
,
LinkedList
<
Object
[]>
sqlData
)
{
public
void
sendRedis
(
String
sqlKey
,
LinkedList
<
Object
[]>
sqlData
)
{
LinkedList
<
String
>
sql
=
CollectionUtil
.
linkedListString
();
LinkedList
<
String
>
sql
=
CollectionUtil
.
linkedListString
();
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
2ae90555
...
@@ -123,7 +123,7 @@ public class GoblinMongoUtils {
...
@@ -123,7 +123,7 @@ public class GoblinMongoUtils {
* 根据活动id查询关联
* 根据活动id查询关联
*/
*/
public
List
<
GoblinGoodsAnticipateValueVo
>
getGoodsAnticipateValues
(
String
antId
){
public
List
<
GoblinGoodsAnticipateValueVo
>
getGoodsAnticipateValues
(
String
antId
){
Criteria
criteria
=
Criteria
.
where
(
"antId"
).
is
(
antId
);
Criteria
criteria
=
Criteria
.
where
(
"antId"
).
is
(
antId
)
.
and
(
"delTag"
).
is
(
0
)
;
Query
query
=
Query
.
query
(
criteria
);
Query
query
=
Query
.
query
(
criteria
);
return
mongoTemplate
.
find
(
query
,
GoblinGoodsAnticipateValueVo
.
class
,
GoblinGoodsAnticipateValueVo
.
class
.
getSimpleName
());
return
mongoTemplate
.
find
(
query
,
GoblinGoodsAnticipateValueVo
.
class
,
GoblinGoodsAnticipateValueVo
.
class
.
getSimpleName
());
}
}
...
@@ -164,6 +164,13 @@ public class GoblinMongoUtils {
...
@@ -164,6 +164,13 @@ public class GoblinMongoUtils {
*/
*/
public
void
delAnticipateValues
(
String
antId
){
public
void
delAnticipateValues
(
String
antId
){
Query
query
=
Query
.
query
(
Criteria
.
where
(
"antId"
).
is
(
antId
));
Query
query
=
Query
.
query
(
Criteria
.
where
(
"antId"
).
is
(
antId
));
//查询处所有的sku关联信息
List
<
GoblinGoodsAnticipateValueVo
>
goodsAnticipateValues
=
getGoodsAnticipateValues
(
antId
);
if
(
goodsAnticipateValues
!=
null
&&
goodsAnticipateValues
.
size
()>
0
){
goodsAnticipateValues
.
forEach
(
item
->
{
redisUtils
.
delAnticipateValue
(
item
.
getSkuId
());
});
}
mongoTemplate
.
remove
(
query
,
GoblinGoodsAnticipateValueVo
.
class
.
getSimpleName
()).
getDeletedCount
();
mongoTemplate
.
remove
(
query
,
GoblinGoodsAnticipateValueVo
.
class
.
getSimpleName
()).
getDeletedCount
();
}
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
2ae90555
...
@@ -47,15 +47,15 @@ public class GoblinRedisUtils {
...
@@ -47,15 +47,15 @@ public class GoblinRedisUtils {
/**
/**
* 该skuId已开启预约
* 该skuId已开启预约
*/
*/
public
void
setAnticipateValue
(
String
antId
,
String
skuId
){
public
void
setAnticipateValue
(
String
skuId
){
redisUtil
.
set
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
antId
).
concat
(
skuId
),
1
);
redisUtil
.
set
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
skuId
),
1
);
}
}
/**
/**
* 删除skuId已开启预约
* 删除skuId已开启预约
*/
*/
public
void
delAnticipateValue
(
String
antId
,
String
skuId
){
public
void
delAnticipateValue
(
String
skuId
){
redisUtil
.
del
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
antId
).
concat
(
skuId
));
redisUtil
.
del
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
skuId
));
}
}
...
@@ -63,8 +63,8 @@ public class GoblinRedisUtils {
...
@@ -63,8 +63,8 @@ public class GoblinRedisUtils {
/**
/**
* 获取关联
* 获取关联
*/
*/
public
boolean
getAnticipate
(
String
antId
,
String
skuId
){
public
boolean
getAnticipate
(
String
skuId
){
return
redisUtil
.
get
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
antId
).
concat
(
skuId
))
!=
null
;
return
redisUtil
.
get
(
GoblinRedisConst
.
ANTICIPATE_SKUID
.
concat
(
skuId
))
!=
null
;
}
}
public
GoblinGoodAnticipateUserVo
getUserAboutAut
(
String
skuId
,
String
uid
)
{
public
GoblinGoodAnticipateUserVo
getUserAboutAut
(
String
skuId
,
String
uid
)
{
...
...
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