记得上下班打卡 | 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
21301da6
Commit
21301da6
authored
Dec 28, 2021
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改banner和金刚位
parent
b4cdb595
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
9 deletions
+57
-9
GoblinFrontBannerServiceImpl.java
...gzai/goblin/service/imp/GoblinFrontBannerServiceImpl.java
+14
-4
GoblinFrontNavigationServiceImpl.java
.../goblin/service/imp/GoblinFrontNavigationServiceImpl.java
+43
-5
No files found.
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/imp/GoblinFrontBannerServiceImpl.java
View file @
21301da6
...
...
@@ -16,6 +16,7 @@ import com.liquidnet.commons.lang.util.IDGenerator;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontNavigation
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontBannerMapper
;
import
com.liquidnet.service.kylin.dao.BannerDetailsListDao
;
import
com.liquidnet.service.kylin.dto.param.BannersSearchParam
;
...
...
@@ -87,7 +88,13 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
orderObject
);
//redis 修改
if
(
redisDataSourceUtil
.
getRedisGoblinUtil
().
hasKey
(
GoblinRedisConst
.
FRONT_BANNER
+
"0"
)){
//从数据库中查出来,从新塞进去
LambdaQueryWrapper
<
GoblinFrontBanner
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontBanner
.
class
);
queryWrapper
.
ne
(
GoblinFrontBanner:
:
getDelTag
,
1
);
queryWrapper
.
orderByDesc
(
GoblinFrontBanner:
:
getIndexs
);
List
<
GoblinFrontBanner
>
list
=
goblinFrontBannerMapper
.
selectList
(
queryWrapper
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_BANNER
,
list
);
/* if(redisDataSourceUtil.getRedisGoblinUtil().hasKey(GoblinRedisConst.FRONT_BANNER+"0")){
ArrayList<GoblinFrontBanner> list = (ArrayList<GoblinFrontBanner>) redisDataSourceUtil.getRedisGoblinUtil().get(GoblinRedisConst.FRONT_BANNER+0);
list= (ArrayList<GoblinFrontBanner>) list.stream().map(goblinFrontBanner1->{
if(goblinFrontBanner1.getBannerId().equals(goblinFrontBanner.getBannerId())){
...
...
@@ -96,7 +103,7 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
return goblinFrontBanner1;
}).collect(Collectors.toList());
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_BANNER+"0",list);
}
}
*/
return
true
;
}
/**
...
...
@@ -113,7 +120,10 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
* @date 2021/12/27 下午4:36
*/
public
boolean
delte
(
Long
id
){
//数据库
GoblinFrontBanner
goblinFrontBanner
=
goblinFrontBannerMapper
.
selectById
(
id
);
goblinFrontBanner
.
setDelTag
(
1
);
this
.
update
(
goblinFrontBanner
);
/* //数据库
goblinFrontBannerMapper.deleteById(id);
//mongodb 删除
mongoTemplate.remove(Query.query(Criteria.where("mid").is(id)), GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
...
...
@@ -127,7 +137,7 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
return goblinFrontBanner1;
}).collect(Collectors.toList());
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_BANNER+"0",list);
}
}
*/
return
true
;
}
/**
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/imp/GoblinFrontNavigationServiceImpl.java
View file @
21301da6
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
goblin
.
service
.
imp
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontNavigationService
;
import
com.liquidnet.common.cache.redis.util.RedisDataSourceUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.entity.GoblinFrontBanner
;
import
com.liquidnet.service.goblin.entity.GoblinFrontNavigation
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontBannerMapper
;
import
com.liquidnet.service.goblin.mapper.GoblinFrontNavigationMapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
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.util.ArrayList
;
import
java.util.List
;
/**
* <p>
...
...
@@ -31,7 +40,7 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
@Autowired
private
MongoTemplate
mongoTemplate
;
@Autowired
GoblinFrontNavigationMapper
goblinFrontNavigationMapper
;
private
GoblinFrontNavigationMapper
goblinFrontNavigationMapper
;
@Autowired
private
RedisDataSourceUtil
redisDataSourceUtil
;
...
...
@@ -57,16 +66,45 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
}
return
true
;
}
public
boolean
update
(
GoblinFrontNavigation
goblinFrontBanner
){
public
boolean
update
(
GoblinFrontNavigation
goblinFrontNavigation
){
//数据库修改
goblinFrontNavigationMapper
.
updateById
(
goblinFrontNavigation
);
//mongodb修改
BasicDBObject
orderObject
=
new
BasicDBObject
(
"$set"
,
JSON
.
parse
(
JsonUtils
.
toJson
(
goblinFrontNavigation
)));
mongoTemplate
.
getCollection
(
GoblinFrontNavigation
.
class
.
getSimpleName
()).
updateOne
(
Query
.
query
(
Criteria
.
where
(
"navigationId"
).
is
(
goblinFrontNavigation
.
getNavigationId
())).
getQueryObject
(),
orderObject
);
//redis 修改
//从数据库中查出来,从新塞进去
LambdaQueryWrapper
<
GoblinFrontNavigation
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontNavigation
.
class
);
queryWrapper
.
ne
(
GoblinFrontNavigation:
:
getDelTag
,
1
);
queryWrapper
.
orderByDesc
(
GoblinFrontNavigation:
:
getIndexs
);
List
<
GoblinFrontNavigation
>
list
=
goblinFrontNavigationMapper
.
selectList
(
queryWrapper
);
redisDataSourceUtil
.
getRedisGoblinUtil
().
set
(
GoblinRedisConst
.
FRONT_NAVIGATION
,
list
);
return
true
;
}
public
GoblinFrontNavigation
getOne
(
Long
id
){
return
null
;
return
goblinFrontNavigationMapper
.
selectById
(
id
)
;
}
public
boolean
delte
(
Long
id
){
public
boolean
delete
(
Long
id
){
GoblinFrontNavigation
goblinFrontNavigation
=
goblinFrontNavigationMapper
.
selectById
(
id
);
goblinFrontNavigation
.
setDelTag
(
1
);
this
.
update
(
goblinFrontNavigation
);
return
true
;
}
public
PageInfo
<
GoblinFrontNavigation
>
page
(
int
pageSize
,
int
pageNumber
,
GoblinFrontNavigation
goblinFrontNavigation
)
{
return
null
;
PageInfo
<
GoblinFrontNavigation
>
pageInfoTmp
=
null
;
try
{
PageHelper
.
startPage
(
pageNumber
,
pageSize
);
LambdaQueryWrapper
<
GoblinFrontNavigation
>
queryWrapper
=
Wrappers
.
lambdaQuery
(
GoblinFrontNavigation
.
class
);
queryWrapper
.
orderByDesc
(
GoblinFrontNavigation:
:
getCreateTime
);
List
<
GoblinFrontNavigation
>
list
=
goblinFrontNavigationMapper
.
selectList
(
queryWrapper
);
pageInfoTmp
=
new
PageInfo
(
list
);
}
catch
(
Exception
e
)
{
return
new
PageInfo
();
}
return
pageInfoTmp
;
}
}
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