记得上下班打卡 | 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
de7323c5
Commit
de7323c5
authored
Jan 06, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上线 组件排序
parent
45f33802
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
GoblinRedisConst.java
...m/liquidnet/service/goblin/constant/GoblinRedisConst.java
+1
-0
GoblinFrontMoudleIndexServiceImpl.java
...oblin/service/impl/GoblinFrontMoudleIndexServiceImpl.java
+25
-1
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/constant/GoblinRedisConst.java
View file @
de7323c5
...
...
@@ -35,6 +35,7 @@ public class GoblinRedisConst {
public
static
final
String
FRONT_FRONT_SECKILL
=
PREFIX
.
concat
(
"front_front_seckill"
);
//前端 首页秒杀
public
static
final
String
FRONT_SECKILL
=
PREFIX
.
concat
(
"front_seckill"
);
//前端 秒杀列表
public
static
final
String
SELECT_GOODS
=
PREFIX
.
concat
(
"select_goods"
);
//精选商品
public
static
final
String
MOUDLE_INDEX
=
PREFIX
.
concat
(
"moudle_index"
);
//moudle_index 组件排序
/* ----------------------------------------------------------------- */
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/GoblinFrontMoudleIndexServiceImpl.java
View file @
de7323c5
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontMoudleIndexService
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.entity.GoblinFrontMoudleIndex
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontMoudleIndexMapper
;
import
com.mongodb.BasicDBObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
...
...
@@ -24,6 +32,10 @@ import java.util.List;
public
class
GoblinFrontMoudleIndexServiceImpl
extends
ServiceImpl
<
GoblinFrontMoudleIndexMapper
,
GoblinFrontMoudleIndex
>
implements
IGoblinFrontMoudleIndexService
{
@Autowired
GoblinFrontMoudleIndexMapper
goblinFrontMoudleIndexMapper
;
@Autowired
private
MongoTemplate
mongoTemplate
;
@Autowired
private
RedisDataSourceUtil
redisDataSourceUtil
;
@Override
public
List
<
GoblinFrontMoudleIndex
>
listGoblinFrontMoudleIndex
()
{
...
...
@@ -44,8 +56,20 @@ public class GoblinFrontMoudleIndexServiceImpl extends ServiceImpl<GoblinFrontMo
//查出数据
List
<
GoblinFrontMoudleIndex
>
list
=
this
.
listGoblinFrontMoudleIndex
();
// mongodb 放入
for
(
GoblinFrontMoudleIndex
goblinFrontMoudleIndex:
list
){
GoblinFrontMoudleIndex
goblinFrontMoudleIndex1
=
mongoTemplate
.
findOne
(
Query
.
query
(
Criteria
.
where
(
"moudleIndexId"
).
is
(
goblinFrontMoudleIndex
.
getMoudleIndexId
())),
GoblinFrontMoudleIndex
.
class
,
GoblinFrontMoudleIndex
.
class
.
getSimpleName
());
if
(
null
==
goblinFrontMoudleIndex1
){
mongoTemplate
.
save
(
goblinFrontMoudleIndex
,
GoblinFrontMoudleIndex
.
class
.
getSimpleName
());
}
else
{
BasicDBObject
orderObject
=
new
BasicDBObject
(
"$set"
,
JSON
.
parse
(
JsonUtils
.
toJson
(
goblinFrontMoudleIndex
)));
mongoTemplate
.
getCollection
(
GoblinFrontMoudleIndex
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"moudleIndexId"
).
is
(
goblinFrontMoudleIndex
.
getMoudleIndexId
())).
getQueryObject
(),
orderObject
);
}
}
// reids 存入
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
MOUDLE_INDEX
,
list
);
return
true
;
}
...
...
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