记得上下班打卡 | 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
e0ea79d5
Commit
e0ea79d5
authored
Aug 20, 2026
by
wangyifan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goblin 改成从mongodb查询商品
parent
bdae082e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
GoblinStoreMgtArtistServiceImpl.java
.../service/impl/manage/GoblinStoreMgtArtistServiceImpl.java
+20
-19
No files found.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreMgtArtistServiceImpl.java
View file @
e0ea79d5
...
@@ -27,8 +27,6 @@ import com.liquidnet.service.goblin.dto.vo.GoblinArtistAuthApplyVo;
...
@@ -27,8 +27,6 @@ import com.liquidnet.service.goblin.dto.vo.GoblinArtistAuthApplyVo;
import
com.liquidnet.service.goblin.dto.vo.GoblinArtistTopicVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinArtistTopicVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreInfoVo
;
import
com.liquidnet.service.goblin.entity.GoblinGoods
;
import
com.liquidnet.service.goblin.mapper.GoblinGoodsMapper
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtArtistService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreMgtArtistService
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
import
com.liquidnet.service.goblin.util.QueueUtils
;
...
@@ -72,8 +70,6 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -72,8 +70,6 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
@Autowired
@Autowired
private
QueueUtils
queueUtils
;
private
QueueUtils
queueUtils
;
@Autowired
@Autowired
private
GoblinGoodsMapper
goodsMapper
;
@Autowired
private
KylinArtistMapper
kylinArtistMapper
;
private
KylinArtistMapper
kylinArtistMapper
;
private
ResponseDto
<
GoblinStoreInfoVo
>
requireStore
()
{
private
ResponseDto
<
GoblinStoreInfoVo
>
requireStore
()
{
...
@@ -396,14 +392,14 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -396,14 +392,14 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
.
map
(
GoblinArtistTopicVo
.
GoodsItem
::
getSpuId
)
.
map
(
GoblinArtistTopicVo
.
GoodsItem
::
getSpuId
)
.
filter
(
StringUtils:
:
isNotBlank
)
.
filter
(
StringUtils:
:
isNotBlank
)
.
collect
(
Collectors
.
toSet
());
.
collect
(
Collectors
.
toSet
());
Map
<
String
,
GoblinGoods
>
goodsMap
=
loadGoodsMapBySpuIds
(
spuIds
);
Map
<
String
,
GoblinGoods
InfoVo
>
goodsMap
=
loadGoodsMapBySpuIds
(
spuIds
);
for
(
GoblinArtistTopicVo
.
GoodsItem
goods
:
topic
.
getGoods
())
{
for
(
GoblinArtistTopicVo
.
GoodsItem
goods
:
topic
.
getGoods
())
{
GoblinStoreMgtArtistTopicDetailVo
.
GoodsItem
item
=
new
GoblinStoreMgtArtistTopicDetailVo
.
GoodsItem
();
GoblinStoreMgtArtistTopicDetailVo
.
GoodsItem
item
=
new
GoblinStoreMgtArtistTopicDetailVo
.
GoodsItem
();
item
.
setSpuId
(
goods
.
getSpuId
());
item
.
setSpuId
(
goods
.
getSpuId
());
item
.
setSort
(
goods
.
getSort
());
item
.
setSort
(
goods
.
getSort
());
item
.
setName
(
goods
.
getName
());
item
.
setName
(
goods
.
getName
());
item
.
setCoverPic
(
goods
.
getCoverPic
());
item
.
setCoverPic
(
goods
.
getCoverPic
());
GoblinGoods
dbGoods
=
goodsMap
.
get
(
goods
.
getSpuId
());
GoblinGoods
InfoVo
dbGoods
=
goodsMap
.
get
(
goods
.
getSpuId
());
if
(
dbGoods
!=
null
)
{
if
(
dbGoods
!=
null
)
{
item
.
setName
(
dbGoods
.
getName
());
item
.
setName
(
dbGoods
.
getName
());
item
.
setCoverPic
(
dbGoods
.
getCoverPic
());
item
.
setCoverPic
(
dbGoods
.
getCoverPic
());
...
@@ -470,7 +466,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -470,7 +466,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
topicVo
.
setCreatedAt
(
now
);
topicVo
.
setCreatedAt
(
now
);
topicVo
.
setUpdatedAt
(
now
);
topicVo
.
setUpdatedAt
(
now
);
Map
<
String
,
GoblinGoods
>
goodsMap
=
loadGoodsMap
(
params
.
getGoods
());
Map
<
String
,
GoblinGoods
InfoVo
>
goodsMap
=
loadGoodsMap
(
params
.
getGoods
());
List
<
GoblinArtistTopicVo
.
GoodsItem
>
goodsItems
=
buildGoodsItems
(
params
.
getGoods
(),
goodsMap
);
List
<
GoblinArtistTopicVo
.
GoodsItem
>
goodsItems
=
buildGoodsItems
(
params
.
getGoods
(),
goodsMap
);
ResponseDto
<
Void
>
goodsCheck
=
checkGoodsBelong
(
storeId
,
goodsMap
,
params
.
getGoods
());
ResponseDto
<
Void
>
goodsCheck
=
checkGoodsBelong
(
storeId
,
goodsMap
,
params
.
getGoods
());
if
(!
goodsCheck
.
isSuccess
())
{
if
(!
goodsCheck
.
isSuccess
())
{
...
@@ -523,7 +519,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -523,7 +519,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
}
}
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
Map
<
String
,
GoblinGoods
>
goodsMap
=
loadGoodsMap
(
params
.
getGoods
());
Map
<
String
,
GoblinGoods
InfoVo
>
goodsMap
=
loadGoodsMap
(
params
.
getGoods
());
ResponseDto
<
Void
>
goodsCheck
=
checkGoodsBelong
(
storeId
,
goodsMap
,
params
.
getGoods
());
ResponseDto
<
Void
>
goodsCheck
=
checkGoodsBelong
(
storeId
,
goodsMap
,
params
.
getGoods
());
if
(!
goodsCheck
.
isSuccess
())
{
if
(!
goodsCheck
.
isSuccess
())
{
return
ResponseDto
.
failure
(
goodsCheck
.
getMessage
());
return
ResponseDto
.
failure
(
goodsCheck
.
getMessage
());
...
@@ -681,14 +677,14 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -681,14 +677,14 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
return
StringUtils
.
trimToNull
(
customAvatarUrl
);
return
StringUtils
.
trimToNull
(
customAvatarUrl
);
}
}
private
ResponseDto
<
Void
>
checkGoodsBelong
(
String
storeId
,
Map
<
String
,
GoblinGoods
>
goodsMap
,
private
ResponseDto
<
Void
>
checkGoodsBelong
(
String
storeId
,
Map
<
String
,
GoblinGoods
InfoVo
>
goodsMap
,
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
paramsGoods
)
{
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
paramsGoods
)
{
if
(
CollectionUtils
.
isEmpty
(
paramsGoods
))
{
if
(
CollectionUtils
.
isEmpty
(
paramsGoods
))
{
return
ResponseDto
.
success
(
null
);
return
ResponseDto
.
success
(
null
);
}
}
for
(
GoblinStoreMgtArtistTopicGoodsItemParams
item
:
paramsGoods
)
{
for
(
GoblinStoreMgtArtistTopicGoodsItemParams
item
:
paramsGoods
)
{
if
(
StringUtils
.
isBlank
(
item
.
getSpuId
()))
continue
;
if
(
StringUtils
.
isBlank
(
item
.
getSpuId
()))
continue
;
GoblinGoods
goods
=
goodsMap
.
get
(
item
.
getSpuId
());
GoblinGoods
InfoVo
goods
=
goodsMap
.
get
(
item
.
getSpuId
());
if
(
goods
==
null
||
!
Objects
.
equals
(
goods
.
getStoreId
(),
storeId
)
if
(
goods
==
null
||
!
Objects
.
equals
(
goods
.
getStoreId
(),
storeId
)
||
!
Objects
.
equals
(
goods
.
getDelFlg
(),
"0"
))
{
||
!
Objects
.
equals
(
goods
.
getDelFlg
(),
"0"
))
{
return
ResponseDto
.
failure
(
"存在非本店或已删除商品"
);
return
ResponseDto
.
failure
(
"存在非本店或已删除商品"
);
...
@@ -735,7 +731,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -735,7 +731,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
// ======================== 私有:商品 / 艺人 Map ========================
// ======================== 私有:商品 / 艺人 Map ========================
private
Map
<
String
,
GoblinGoods
>
loadGoodsMap
(
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
goods
)
{
private
Map
<
String
,
GoblinGoods
InfoVo
>
loadGoodsMap
(
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
goods
)
{
if
(
CollectionUtils
.
isEmpty
(
goods
))
{
if
(
CollectionUtils
.
isEmpty
(
goods
))
{
return
Collections
.
emptyMap
();
return
Collections
.
emptyMap
();
}
}
...
@@ -744,22 +740,27 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -744,22 +740,27 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
return
loadGoodsMapBySpuIds
(
spuIds
);
return
loadGoodsMapBySpuIds
(
spuIds
);
}
}
private
Map
<
String
,
GoblinGoods
>
loadGoodsMapBySpuIds
(
Set
<
String
>
spuIds
)
{
private
Map
<
String
,
GoblinGoods
InfoVo
>
loadGoodsMapBySpuIds
(
Set
<
String
>
spuIds
)
{
if
(
CollectionUtils
.
isEmpty
(
spuIds
))
{
if
(
CollectionUtils
.
isEmpty
(
spuIds
))
{
return
Collections
.
emptyMap
();
return
Collections
.
emptyMap
();
}
}
List
<
GoblinGoods
>
list
=
goodsMapper
.
selectList
(
new
LambdaQueryWrapper
<
GoblinGoods
>()
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
.
in
(
GoblinGoods:
:
getSpuId
,
spuIds
));
new
Query
(
Criteria
.
where
(
"spuId"
).
in
(
spuIds
)),
Map
<
String
,
GoblinGoods
>
map
=
new
HashMap
<>();
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
for
(
GoblinGoods
g
:
list
)
{
Map
<
String
,
GoblinGoodsInfoVo
>
map
=
new
HashMap
<>();
if
(
list
!=
null
)
{
for
(
GoblinGoodsInfoVo
g
:
list
)
{
if
(
g
!=
null
&&
StringUtils
.
isNotBlank
(
g
.
getSpuId
()))
{
map
.
put
(
g
.
getSpuId
(),
g
);
map
.
put
(
g
.
getSpuId
(),
g
);
}
}
}
}
return
map
;
return
map
;
}
}
private
List
<
GoblinArtistTopicVo
.
GoodsItem
>
buildGoodsItems
(
private
List
<
GoblinArtistTopicVo
.
GoodsItem
>
buildGoodsItems
(
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
paramsGoods
,
List
<
GoblinStoreMgtArtistTopicGoodsItemParams
>
paramsGoods
,
Map
<
String
,
GoblinGoods
>
goodsMap
)
{
Map
<
String
,
GoblinGoods
InfoVo
>
goodsMap
)
{
List
<
GoblinArtistTopicVo
.
GoodsItem
>
items
=
new
ArrayList
<>();
List
<
GoblinArtistTopicVo
.
GoodsItem
>
items
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
paramsGoods
))
{
if
(
CollectionUtils
.
isEmpty
(
paramsGoods
))
{
return
items
;
return
items
;
...
@@ -770,7 +771,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
...
@@ -770,7 +771,7 @@ public class GoblinStoreMgtArtistServiceImpl implements IGoblinStoreMgtArtistSer
GoblinArtistTopicVo
.
GoodsItem
item
=
new
GoblinArtistTopicVo
.
GoodsItem
();
GoblinArtistTopicVo
.
GoodsItem
item
=
new
GoblinArtistTopicVo
.
GoodsItem
();
item
.
setSpuId
(
p
.
getSpuId
());
item
.
setSpuId
(
p
.
getSpuId
());
item
.
setSort
(
p
.
getSort
()
==
null
?
index
:
p
.
getSort
());
item
.
setSort
(
p
.
getSort
()
==
null
?
index
:
p
.
getSort
());
GoblinGoods
goods
=
goodsMap
.
get
(
p
.
getSpuId
());
GoblinGoods
InfoVo
goods
=
goodsMap
.
get
(
p
.
getSpuId
());
if
(
goods
!=
null
)
{
if
(
goods
!=
null
)
{
item
.
setName
(
goods
.
getName
());
item
.
setName
(
goods
.
getName
());
item
.
setCoverPic
(
goods
.
getCoverPic
());
item
.
setCoverPic
(
goods
.
getCoverPic
());
...
...
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