记得上下班打卡 | 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
eadfaac5
Commit
eadfaac5
authored
Feb 14, 2022
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~API:店铺管理:SPU列表:筛选条件报错;
+SPU下架缓存查询处理;
parent
cf175928
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
23 deletions
+47
-23
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+5
-0
GoblinStoreMgtGoodsServiceImpl.java
...n/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
+5
-2
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+12
-15
GoblinRedisUtils.java
...a/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
+25
-6
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
eadfaac5
...
...
@@ -53,6 +53,11 @@ public class GoblinRedisConst {
* {goblin:bsc:goods:${spu_id}, com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo}
*/
public
static
final
String
BASIC_GOODS
=
PREFIX
.
concat
(
"bsc:goods:"
);
/**
* SPU信息
* {goblin:bsc:goods:${spu_id}, com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo}
*/
public
static
final
String
BASIC_GOODS_UNSHELVES
=
PREFIX
.
concat
(
"bsc:goods_unshelves:"
);
/**
* SKU信息
* {goblin:bsc:goods_sku:${sku_id}, com.liquidnet.service.goblin.dto.vo.GoblinGoodsSkuInfoVo}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtGoodsServiceImpl.java
View file @
eadfaac5
...
...
@@ -64,7 +64,7 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
categoryVoList
.
forEach
(
cr
->
{
if
(
cr
.
getCateId
().
equals
(
cateFid
))
vo
.
setCateFid
(
cr
.
getName
());
if
(
cr
.
getCateId
().
equals
(
cateSid
))
vo
.
setCateSid
(
cr
.
getName
());
if
(
cr
.
getCateId
().
equals
(
cate
S
id
))
vo
.
setCateTid
(
cr
.
getName
());
if
(
cr
.
getCateId
().
equals
(
cate
T
id
))
vo
.
setCateTid
(
cr
.
getName
());
});
});
goodsListVoPagedResult
.
setList
(
voList
);
...
...
@@ -575,7 +575,10 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
if
(
goblinMongoUtils
.
updateGoodsSkuInfoVoByShelves
(
storeId
,
spuIdList
,
shelvesFlg
,
uid
,
now
))
{
goblinRedisUtils
.
deleteKeyForSelectGoods
();
// 精选商品:商品上架、下架、删除 调用的方法
spuIdList
.
forEach
(
spuId
->
goblinRedisUtils
.
delGoodsInfoVo
(
spuId
));
spuIdList
.
forEach
(
spuId
->
{
goblinRedisUtils
.
delGoodsInfoVo
(
spuId
);
goblinRedisUtils
.
delGoodsInfoVoByUnShelves
(
spuId
);
});
List
<
String
>
skuIds
=
goblinMongoUtils
.
getMgtGoodsSkuIds
(
storeId
,
spuIdList
);
skuIds
.
forEach
(
skuId
->
goblinRedisUtils
.
delGoodsSkuInfoVo
(
skuId
));
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
eadfaac5
...
...
@@ -148,9 +148,7 @@ public class GoblinMongoUtils {
Criteria
criteria
=
Criteria
.
where
(
"storeId"
).
is
(
filterParam
.
getStoreId
()).
and
(
"delFlg"
).
is
(
"0"
);
if
(
StringUtils
.
isNotBlank
(
filterParam
.
getKeyword
()))
{
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
filterParam
.
getKeyword
()
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
criteria
.
andOperator
(
Criteria
.
where
(
"content"
).
regex
(
pattern
)
);
criteria
.
and
(
"content"
).
regex
(
pattern
);
}
Query
query
=
Query
.
query
(
criteria
);
...
...
@@ -324,34 +322,32 @@ public class GoblinMongoUtils {
Criteria
criteria
=
Criteria
.
where
(
"delFlg"
).
is
(
"0"
).
and
(
"storeId"
).
is
(
filterParam
.
getStoreId
()).
and
(
"marketId"
).
exists
(
false
);
if
(
StringUtils
.
isNotBlank
(
filterParam
.
getKeyword
()))
{
Pattern
pattern
=
Pattern
.
compile
(
"^.*"
+
filterParam
.
getKeyword
()
+
".*$"
,
Pattern
.
CASE_INSENSITIVE
);
criteria
.
andOperator
(
Criteria
.
where
(
"name"
).
regex
(
pattern
)
);
criteria
.
and
(
"name"
).
regex
(
pattern
);
}
if
(
StringUtils
.
isNotBlank
(
filterParam
.
getShelvesStatus
()))
{
criteria
.
and
Operator
(
Criteria
.
where
(
"shelvesStatus"
).
is
(
filterParam
.
getShelvesStatus
()
));
criteria
.
and
(
"shelvesStatus"
).
is
(
filterParam
.
getShelvesStatus
(
));
}
if
(
StringUtils
.
isNotBlank
(
filterParam
.
getCateFid
()))
{
criteria
.
and
Operator
(
Criteria
.
where
(
"cateFid"
).
is
(
filterParam
.
getCateFid
()
));
criteria
.
and
(
"cateFid"
).
is
(
filterParam
.
getCateFid
(
));
}
if
(
StringUtils
.
isNotBlank
(
filterParam
.
getCateSid
()))
{
criteria
.
and
Operator
(
Criteria
.
where
(
"cateSid"
).
is
(
filterParam
.
getCateSid
()
));
criteria
.
and
(
"cateSid"
).
is
(
filterParam
.
getCateSid
(
));
}
if
(
StringUtils
.
isNotBlank
(
filterParam
.
getCateTid
()))
{
criteria
.
and
Operator
(
Criteria
.
where
(
"cateTid"
).
is
(
filterParam
.
getCateTid
()
));
criteria
.
and
(
"cateTid"
).
is
(
filterParam
.
getCateTid
(
));
}
if
(
StringUtils
.
isNotBlank
(
filterParam
.
getCreatedDt
()))
{
LocalDateTime
createDt
=
DateUtil
.
Formatter
.
yyyy_MM_dd
.
parse
(
filterParam
.
getCreatedDt
());
LocalDateTime
createdAtBegin
=
createDt
.
withHour
(
0
).
withMinute
(
0
).
withSecond
(
0
).
withNano
(
0
);
LocalDateTime
createdAtEnd
=
createDt
.
withHour
(
23
).
withMinute
(
59
).
withSecond
(
59
).
withNano
(
999
);
criteria
.
and
Operator
(
Criteria
.
where
(
"createdAt"
).
gte
(
createdAtBegin
).
lte
(
createdAtEnd
)
);
criteria
.
and
(
"createdAt"
).
gte
(
createdAtBegin
).
lte
(
createdAtEnd
);
}
if
(
null
!=
filterParam
.
getPriceGe
())
{
criteria
.
and
Operator
(
Criteria
.
where
(
"priceGe"
).
gte
(
filterParam
.
getPriceGe
()
));
criteria
.
and
(
"priceGe"
).
gte
(
filterParam
.
getPriceGe
(
));
}
if
(
null
!=
filterParam
.
getPriceLe
())
{
criteria
.
and
Operator
(
Criteria
.
where
(
"priceGe"
).
lte
(
filterParam
.
getPriceLe
()
));
criteria
.
and
(
"priceLe"
).
lte
(
filterParam
.
getPriceLe
(
));
}
Query
query
=
Query
.
query
(
criteria
);
...
...
@@ -388,7 +384,8 @@ public class GoblinMongoUtils {
// SPU信息
public
GoblinGoodsInfoVo
getGoodsInfoVo
(
String
spuId
)
{
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"spuId"
).
is
(
spuId
).
and
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
)),
// return mongoTemplate.findOne(Query.query(Criteria.where("spuId").is(spuId).and("delFlg").is("0").and("shelvesStatus").is("3")),
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"spuId"
).
is
(
spuId
).
and
(
"delFlg"
).
is
(
"0"
)),
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
}
...
...
@@ -400,7 +397,7 @@ public class GoblinMongoUtils {
// SPU信息
public
GoblinGoodsInfoVo
getMgtGoodsInfoVo
(
String
storeId
,
String
name
)
{
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"name"
).
is
(
name
).
and
(
"delFlg"
).
is
(
"0"
)),
return
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"
storeId"
).
is
(
storeId
).
and
(
"
name"
).
is
(
name
).
and
(
"delFlg"
).
is
(
"0"
)),
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinRedisUtils.java
View file @
eadfaac5
...
...
@@ -309,6 +309,9 @@ public class GoblinRedisUtils {
public
void
delGoodsInfoVo
(
String
spuId
)
{
redisUtil
.
del
(
GoblinRedisConst
.
BASIC_GOODS
.
concat
(
spuId
));
}
public
void
delGoodsInfoVoByUnShelves
(
String
spuId
)
{
redisUtil
.
del
(
GoblinRedisConst
.
BASIC_GOODS_UNSHELVES
.
concat
(
spuId
));
}
/**
* 商品基础信息
...
...
@@ -320,9 +323,23 @@ public class GoblinRedisUtils {
String
rk
=
GoblinRedisConst
.
BASIC_GOODS
.
concat
(
spuId
);
GoblinGoodsInfoVo
vo
=
(
GoblinGoodsInfoVo
)
redisUtil
.
get
(
rk
);
if
(
null
==
vo
&&
null
!=
(
vo
=
goblinMongoUtils
.
getGoodsInfoVo
(
spuId
)))
{
// redisUtil.set(rk, vo);// TODO: 2022/1/4 zhanggb==
vo
=
!
vo
.
getDelFlg
().
equals
(
"0"
)
?
null
:
vo
;
if
(
vo
.
getShelvesStatus
().
equals
(
"3"
))
{
redisUtil
.
set
(
rk
,
vo
);
}
else
{
vo
=
null
;
}
}
return
vo
;
}
public
GoblinGoodsInfoVo
getGoodsInfoVoByUnShelves
(
String
spuId
)
{
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_UNSHELVES
.
concat
(
spuId
);
GoblinGoodsInfoVo
vo
=
(
GoblinGoodsInfoVo
)
redisUtil
.
get
(
rk
);
if
(
null
==
vo
&&
null
!=
(
vo
=
goblinMongoUtils
.
getGoodsInfoVo
(
spuId
)))
{
if
(
vo
.
getShelvesStatus
().
equals
(
"1"
))
{
redisUtil
.
set
(
rk
,
vo
);
}
else
{
vo
=
null
;
}
}
return
vo
;
}
...
...
@@ -354,9 +371,11 @@ public class GoblinRedisUtils {
String
rk
=
GoblinRedisConst
.
BASIC_GOODS_SKU
.
concat
(
skuId
);
GoblinGoodsSkuInfoVo
vo
=
(
GoblinGoodsSkuInfoVo
)
redisUtil
.
get
(
rk
);
if
(
null
==
vo
&&
null
!=
(
vo
=
goblinMongoUtils
.
getGoodsSkuInfoVo
(
skuId
)))
{
// redisUtil.set(rk, vo);// TODO: 2022/1/4 zhanggb==
vo
=
!
vo
.
getDelFlg
().
equals
(
"0"
)
?
null
:
vo
;
if
(
vo
.
getShelvesStatus
().
equals
(
"3"
))
{
redisUtil
.
set
(
rk
,
vo
);
// TODO: 2022/1/4 zhanggb==
}
else
{
vo
=
null
;
}
}
return
vo
;
}
...
...
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